vendor: 3,595 bytes, lines 1-88
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // define getter function for harmony exports 37/******/ __webpack_require__.d = function(exports, name, getter) { 38/******/ if(!__webpack_require__.o(exports, name)) { 39/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); 40/******/ } 41/******/ }; 42/******/ 43/******/ // define __esModule on exports 44/******/ __webpack_require__.r = function(exports) { 45/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 46/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 47/******/ } 48/******/ Object.defineProperty(exports, '__esModule', { value: true }); 49/******/ }; 50/******/ 51/******/ // create a fake namespace object 52/******/ // mode & 1: value is a module id, require it 53/******/ // mode & 2: merge all properties of value into the ns 54/******/ // mode & 4: return value when already ns object 55/******/ // mode & 8|1: behave like require 56/******/ __webpack_require__.t = function(value, mode) { 57/******/ if(mode & 1) value = __webpack_require__(value); 58/******/ if(mode & 8) return value; 59/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; 60/******/ var ns = Object.create(null); 61/******/ __webpack_require__.r(ns); 62/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); 63/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); 64/******/ return ns; 65/******/ }; 66/******/ 67/******/ // getDefaultExport function for compatibility with non-harmony modules 68/******/ __webpack_require__.n = function(module) { 69/******/ var getter = module && module.__esModule ? 70/******/ function getDefault() { return module['default']; } : 71/******/ function getModuleExports() { return module; }; 72/******/ __webpack_require__.d(getter, 'a', getter); 73/******/ return getter; 74/******/ }; 75/******/ 76/******/ // Object.prototype.hasOwnProperty.call 77/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 78/******/ 79/******/ // __webpack_public_path__ 80/******/ __webpack_require__.p = "/"; 81/******/ 82/******/ 83/******/ // Load entry module and return exports 84/******/ return __webpack_require__(__webpack_require__.s = 1); 85/******/ }) 86/************************************************************************/ 87/******/ ({ 88
vendor: 14,826 bytes, lines 89-99
89/***/ "./node_modules/aos/dist/aos.js": 90/*!**************************************!*\ 91 !*** ./node_modules/aos/dist/aos.js ***! 92 \**************************************/ 93/*! no static exports found */ 94/***/ (function(module, exports, __webpack_require__) { 95 96!function(e,t){ true?module.exports=t():undefined}(this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var i=n[o]={exports:{},id:o,loaded:!1};return e[o].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="dist/",t(0)}([function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}var i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},r=n(1),a=(o(r),n(6)),u=o(a),c=n(7),s=o(c),f=n(8),d=o(f),l=n(9),p=o(l),m=n(10),b=o(m),v=n(11),y=o(v),g=n(14),h=o(g),w=[],k=!1,x={offset:120,delay:0,easing:"ease",duration:400,disable:!1,once:!1,startEvent:"DOMContentLoaded",throttleDelay:99,debounceDelay:50,disableMutationObserver:!1},j=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e&&(k=!0),k)return w=(0,y.default)(w,x),(0,b.default)(w,x.once),w},O=function(){w=(0,h.default)(),j()},M=function(){w.forEach(function(e,t){e.node.removeAttribute("data-aos"),e.node.removeAttribute("data-aos-easing"),e.node.removeAttribute("data-aos-duration"),e.node.removeAttribute("data-aos-delay")})},S=function(e){return e===!0||"mobile"===e&&p.default.mobile()||"phone"===e&&p.default.phone()||"tablet"===e&&p.default.tablet()||"function"==typeof e&&e()===!0},_=function(e){x=i(x,e),w=(0,h.default)();var t=document.all&&!window.atob;return S(x.disable)||t?M():(x.disableMutationObserver||d.default.isSupported()||(console.info('\n aos: MutationObserver is not supported on this browser,\n code mutations observing has been disabled.\n You may have to call "refreshHard()" by yourself.\n '),x.disableMutationObserver=!0),document.querySelector("body").setAttribute("data-aos-easing",x.easing),document.querySelector("body").setAttribute("data-aos-duration",x.duration),document.querySelector("body").setAttribute("data-aos-delay",x.delay),"DOMContentLoaded"===x.startEvent&&["complete","interactive"].indexOf(document.readyState)>-1?j(!0):"load"===x.startEvent?window.addEventListener(x.startEvent,function(){j(!0)}):document.addEventListener(x.startEvent,function(){j(!0)}),window.addEventListener("resize",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("orientationchange",(0,s.default)(j,x.debounceDelay,!0)),window.addEventListener("scroll",(0,u.default)(function(){(0,b.default)(w,x.once)},x.throttleDelay)),x.disableMutationObserver||d.default.ready("[data-aos]",O),w)};e.exports={init:_,refresh:j,refreshHard:O}},function(e,t){},,,,,function(e,t){(function(t){"use strict";function n(e,t,n){function o(t){var n=b,o=v;return b=v=void 0,k=t,g=e.apply(o,n)}function r(e){return k=e,h=setTimeout(f,t),M?o(e):g}function a(e){var n=e-w,o=e-k,i=t-n;return S?j(i,y-o):i}function c(e){var n=e-w,o=e-k;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=O();return c(e)?d(e):void(h=setTimeout(f,a(e)))}function d(e){return h=void 0,_&&b?o(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),k=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(O())}function m(){var e=O(),n=c(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),o(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,k=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(s);return t=u(t)||0,i(n)&&(M=!!n.leading,S="maxWait"in n,y=S?x(u(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e,t,o){var r=!0,a=!0;if("function"!=typeof e)throw new TypeError(s);return i(o)&&(r="leading"in o?!!o.leading:r,a="trailing"in o?!!o.trailing:a),n(e,t,{leading:r,maxWait:t,trailing:a})}function i(e){var t="undefined"==typeof e?"undefined":c(e);return!!e&&("object"==t||"function"==t)}function r(e){return!!e&&"object"==("undefined"==typeof e?"undefined":c(e))}function a(e){return"symbol"==("undefined"==typeof e?"undefined":c(e))||r(e)&&k.call(e)==d}function u(e){if("number"==typeof e)return e;if(a(e))return f;if(i(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(l,"");var n=m.test(e);return n||b.test(e)?v(e.slice(2),n?2:8):p.test(e)?f:+e}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s="Expected a function",f=NaN,d="[object Symbol]",l=/^\s+|\s+$/g,p=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,b=/^0o[0-7]+$/i,v=parseInt,y="object"==("undefined"==typeof t?"undefined":c(t))&&t&&t.Object===Object&&t,g="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,h=y||g||Function("return this")(),w=Object.prototype,k=w.toString,x=Math.max,j=Math.min,O=function(){return h.Date.now()};e.exports=o}).call(t,function(){return this}())},function(e,t){(function(t){"use strict";function n(e,t,n){function i(t){var n=b,o=v;return b=v=void 0,O=t,g=e.apply(o,n)}function r(e){return O=e,h=setTimeout(f,t),M?i(e):g}function u(e){var n=e-w,o=e-O,i=t-n;return S?x(i,y-o):i}function s(e){var n=e-w,o=e-O;return void 0===w||n>=t||n<0||S&&o>=y}function f(){var e=j();return s(e)?d(e):void(h=setTimeout(f,u(e)))}function d(e){return h=void 0,_&&b?i(e):(b=v=void 0,g)}function l(){void 0!==h&&clearTimeout(h),O=0,b=w=v=h=void 0}function p(){return void 0===h?g:d(j())}function m(){var e=j(),n=s(e);if(b=arguments,v=this,w=e,n){if(void 0===h)return r(w);if(S)return h=setTimeout(f,t),i(w)}return void 0===h&&(h=setTimeout(f,t)),g}var b,v,y,g,h,w,O=0,M=!1,S=!1,_=!0;if("function"!=typeof e)throw new TypeError(c);return t=a(t)||0,o(n)&&(M=!!n.leading,S="maxWait"in n,y=S?k(a(n.maxWait)||0,t):y,_="trailing"in n?!!n.trailing:_),m.cancel=l,m.flush=p,m}function o(e){var t="undefined"==typeof e?"undefined":u(e);return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==("undefined"==typeof e?"undefined":u(e))}function r(e){return"symbol"==("undefined"==typeof e?"undefined":u(e))||i(e)&&w.call(e)==f}function a(e){if("number"==typeof e)return e;if(r(e))return s;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(d,"");var n=p.test(e);return n||m.test(e)?b(e.slice(2),n?2:8):l.test(e)?s:+e}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c="Expected a function",s=NaN,f="[object Symbol]",d=/^\s+|\s+$/g,l=/^[-+]0x[0-9a-f]+$/i,p=/^0b[01]+$/i,m=/^0o[0-7]+$/i,b=parseInt,v="object"==("undefined"==typeof t?"undefined":u(t))&&t&&t.Object===Object&&t,y="object"==("undefined"==typeof self?"undefined":u(self))&&self&&self.Object===Object&&self,g=v||y||Function("return this")(),h=Object.prototype,w=h.toString,k=Math.max,x=Math.min,j=function(){return g.Date.now()};e.exports=n}).call(t,function(){return this}())},function(e,t){"use strict";function n(e){var t=void 0,o=void 0,i=void 0;for(t=0;t<e.length;t+=1){if(o=e[t],o.dataset&&o.dataset.aos)return!0;if(i=o.children&&n(o.children))return!0}return!1}function o(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function i(){return!!o()}function r(e,t){var n=window.document,i=o(),r=new i(a);u=t,r.observe(n.documentElement,{childList:!0,subtree:!0,removedNodes:!0})}function a(e){e&&e.forEach(function(e){var t=Array.prototype.slice.call(e.addedNodes),o=Array.prototype.slice.call(e.removedNodes),i=t.concat(o);if(n(i))return u()})}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){};t.default={isSupported:i,ready:r}},function(e,t){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return navigator.userAgent||navigator.vendor||window.opera||""}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}(),r=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,a=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,u=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,c=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,s=function(){function e(){n(this,e)}return i(e,[{key:"phone",value:function(){var e=o();return!(!r.test(e)&&!a.test(e.substr(0,4)))}},{key:"mobile",value:function(){var e=o();return!(!u.test(e)&&!c.test(e.substr(0,4)))}},{key:"tablet",value:function(){return this.mobile()&&!this.phone()}}]),e}();t.default=new s},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,n){var o=e.node.getAttribute("data-aos-once");t>e.position?e.node.classList.add("aos-animate"):"undefined"!=typeof o&&("false"===o||!n&&"true"!==o)&&e.node.classList.remove("aos-animate")},o=function(e,t){var o=window.pageYOffset,i=window.innerHeight;e.forEach(function(e,r){n(e,i+o,t)})};t.default=o},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(12),r=o(i),a=function(e,t){return e.forEach(function(e,n){e.node.classList.add("aos-init"),e.position=(0,r.default)(e.node,t.offset)}),e};t.default=a},function(e,t,n){"use strict";function o(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(13),r=o(i),a=function(e,t){var n=0,o=0,i=window.innerHeight,a={offset:e.getAttribute("data-aos-offset"),anchor:e.getAttribute("data-aos-anchor"),anchorPlacement:e.getAttribute("data-aos-anchor-placement")};switch(a.offset&&!isNaN(a.offset)&&(o=parseInt(a.offset)),a.anchor&&document.querySelectorAll(a.anchor)&&(e=document.querySelectorAll(a.anchor)[0]),n=(0,r.default)(e).top,a.anchorPlacement){case"top-bottom":break;case"center-bottom":n+=e.offsetHeight/2;break;case"bottom-bottom":n+=e.offsetHeight;break;case"top-center":n+=i/2;break;case"bottom-center":n+=i/2+e.offsetHeight;break;case"center-center":n+=i/2+e.offsetHeight/2;break;case"top-top":n+=i;break;case"bottom-top":n+=e.offsetHeight+i;break;case"center-top":n+=e.offsetHeight/2+i}return a.anchorPlacement||a.offset||isNaN(t)||(o=t),n+o};t.default=a},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){for(var t=0,n=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-("BODY"!=e.tagName?e.scrollLeft:0),n+=e.offsetTop-("BODY"!=e.tagName?e.scrollTop:0),e=e.offsetParent;return{top:n,left:t}};t.default=n},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e){return e=e||document.querySelectorAll("[data-aos]"),Array.prototype.map.call(e,function(e){return{node:e}})};t.default=n}])}); 97 98/***/ }), 99
vendor: 361 bytes, lines 100-110
100/***/ "./node_modules/axios/index.js": 101/*!*************************************!*\ 102 !*** ./node_modules/axios/index.js ***! 103 \*************************************/ 104/*! no static exports found */ 105/***/ (function(module, exports, __webpack_require__) { 106 107module.exports = __webpack_require__(/*! ./lib/axios */ "./node_modules/axios/lib/axios.js"); 108 109/***/ }), 110
vendor: 6,658 bytes, lines 111-302
111/***/ "./node_modules/axios/lib/adapters/xhr.js": 112/*!************************************************!*\ 113 !*** ./node_modules/axios/lib/adapters/xhr.js ***! 114 \************************************************/ 115/*! no static exports found */ 116/***/ (function(module, exports, __webpack_require__) { 117 118"use strict"; 119 120 121var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 122var settle = __webpack_require__(/*! ./../core/settle */ "./node_modules/axios/lib/core/settle.js"); 123var buildURL = __webpack_require__(/*! ./../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); 124var buildFullPath = __webpack_require__(/*! ../core/buildFullPath */ "./node_modules/axios/lib/core/buildFullPath.js"); 125var parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ "./node_modules/axios/lib/helpers/parseHeaders.js"); 126var isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ "./node_modules/axios/lib/helpers/isURLSameOrigin.js"); 127var createError = __webpack_require__(/*! ../core/createError */ "./node_modules/axios/lib/core/createError.js"); 128 129module.exports = function xhrAdapter(config) { 130 return new Promise(function dispatchXhrRequest(resolve, reject) { 131 var requestData = config.data; 132 var requestHeaders = config.headers; 133 134 if (utils.isFormData(requestData)) { 135 delete requestHeaders['Content-Type']; // Let the browser set it 136 } 137 138 var request = new XMLHttpRequest(); 139 140 // HTTP basic authentication 141 if (config.auth) { 142 var username = config.auth.username || ''; 143 var password = config.auth.password || ''; 144 requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password); 145 } 146 147 var fullPath = buildFullPath(config.baseURL, config.url); 148 request.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); 149 150 // Set the request timeout in MS 151 request.timeout = config.timeout; 152 153 // Listen for ready state 154 request.onreadystatechange = function handleLoad() { 155 if (!request || request.readyState !== 4) { 156 return; 157 } 158 159 // The request errored out and we didn't get a response, this will be 160 // handled by onerror instead 161 // With one exception: request that using file: protocol, most browsers 162 // will return status as 0 even though it's a successful request 163 if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) { 164 return; 165 } 166 167 // Prepare the response 168 var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null; 169 var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response; 170 var response = { 171 data: responseData, 172 status: request.status, 173 statusText: request.statusText, 174 headers: responseHeaders, 175 config: config, 176 request: request 177 }; 178 179 settle(resolve, reject, response); 180 181 // Clean up request 182 request = null; 183 }; 184 185 // Handle browser request cancellation (as opposed to a manual cancellation) 186 request.onabort = function handleAbort() { 187 if (!request) { 188 return; 189 } 190 191 reject(createError('Request aborted', config, 'ECONNABORTED', request)); 192 193 // Clean up request 194 request = null; 195 }; 196 197 // Handle low level network errors 198 request.onerror = function handleError() { 199 // Real errors are hidden from us by the browser 200 // onerror should only fire if it's a network error 201 reject(createError('Network Error', config, null, request)); 202 203 // Clean up request 204 request = null; 205 }; 206 207 // Handle timeout 208 request.ontimeout = function handleTimeout() { 209 var timeoutErrorMessage = 'timeout of ' + config.timeout + 'ms exceeded'; 210 if (config.timeoutErrorMessage) { 211 timeoutErrorMessage = config.timeoutErrorMessage; 212 } 213 reject(createError(timeoutErrorMessage, config, 'ECONNABORTED', 214 request)); 215 216 // Clean up request 217 request = null; 218 }; 219 220 // Add xsrf header 221 // This is only done if running in a standard browser environment. 222 // Specifically not if we're in a web worker, or react-native. 223 if (utils.isStandardBrowserEnv()) { 224 var cookies = __webpack_require__(/*! ./../helpers/cookies */ "./node_modules/axios/lib/helpers/cookies.js"); 225 226 // Add xsrf header 227 var xsrfValue = (config.withCredentials || isURLSameOrigin(fullPath)) && config.xsrfCookieName ? 228 cookies.read(config.xsrfCookieName) : 229 undefined; 230 231 if (xsrfValue) { 232 requestHeaders[config.xsrfHeaderName] = xsrfValue; 233 } 234 } 235 236 // Add headers to the request 237 if ('setRequestHeader' in request) { 238 utils.forEach(requestHeaders, function setRequestHeader(val, key) { 239 if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') { 240 // Remove Content-Type if data is undefined 241 delete requestHeaders[key]; 242 } else { 243 // Otherwise add header to the request 244 request.setRequestHeader(key, val); 245 } 246 }); 247 } 248 249 // Add withCredentials to request if needed 250 if (!utils.isUndefined(config.withCredentials)) { 251 request.withCredentials = !!config.withCredentials; 252 } 253 254 // Add responseType to request if needed 255 if (config.responseType) { 256 try { 257 request.responseType = config.responseType; 258 } catch (e) { 259 // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2. 260 // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function. 261 if (config.responseType !== 'json') { 262 throw e; 263 } 264 } 265 } 266 267 // Handle progress if needed 268 if (typeof config.onDownloadProgress === 'function') { 269 request.addEventListener('progress', config.onDownloadProgress); 270 } 271 272 // Not all browsers support upload events 273 if (typeof config.onUploadProgress === 'function' && request.upload) { 274 request.upload.addEventListener('progress', config.onUploadProgress); 275 } 276 277 if (config.cancelToken) { 278 // Handle cancellation 279 config.cancelToken.promise.then(function onCanceled(cancel) { 280 if (!request) { 281 return; 282 } 283 284 request.abort(); 285 reject(cancel); 286 // Clean up request 287 request = null; 288 }); 289 } 290 291 if (requestData === undefined) { 292 requestData = null; 293 } 294 295 // Send the request 296 request.send(requestData); 297 }); 298}; 299 300 301/***/ }), 302
vendor: 2,251 bytes, lines 303-367
303/***/ "./node_modules/axios/lib/axios.js": 304/*!*****************************************!*\ 305 !*** ./node_modules/axios/lib/axios.js ***! 306 \*****************************************/ 307/*! no static exports found */ 308/***/ (function(module, exports, __webpack_require__) { 309 310"use strict"; 311 312 313var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); 314var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); 315var Axios = __webpack_require__(/*! ./core/Axios */ "./node_modules/axios/lib/core/Axios.js"); 316var mergeConfig = __webpack_require__(/*! ./core/mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); 317var defaults = __webpack_require__(/*! ./defaults */ "./node_modules/axios/lib/defaults.js"); 318 319/** 320 * Create an instance of Axios 321 * 322 * @param {Object} defaultConfig The default config for the instance 323 * @return {Axios} A new instance of Axios 324 */ 325function createInstance(defaultConfig) { 326 var context = new Axios(defaultConfig); 327 var instance = bind(Axios.prototype.request, context); 328 329 // Copy axios.prototype to instance 330 utils.extend(instance, Axios.prototype, context); 331 332 // Copy context to instance 333 utils.extend(instance, context); 334 335 return instance; 336} 337 338// Create the default instance to be exported 339var axios = createInstance(defaults); 340 341// Expose Axios class to allow class inheritance 342axios.Axios = Axios; 343 344// Factory for creating new instances 345axios.create = function create(instanceConfig) { 346 return createInstance(mergeConfig(axios.defaults, instanceConfig)); 347}; 348 349// Expose Cancel & CancelToken 350axios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 351axios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ "./node_modules/axios/lib/cancel/CancelToken.js"); 352axios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); 353 354// Expose all/spread 355axios.all = function all(promises) { 356 return Promise.all(promises); 357}; 358axios.spread = __webpack_require__(/*! ./helpers/spread */ "./node_modules/axios/lib/helpers/spread.js"); 359 360module.exports = axios; 361 362// Allow use of default import syntax in TypeScript 363module.exports.default = axios; 364 365 366/***/ }), 367
vendor: 702 bytes, lines 368-398
368/***/ "./node_modules/axios/lib/cancel/Cancel.js": 369/*!*************************************************!*\ 370 !*** ./node_modules/axios/lib/cancel/Cancel.js ***! 371 \*************************************************/ 372/*! no static exports found */ 373/***/ (function(module, exports, __webpack_require__) { 374 375"use strict"; 376 377 378/** 379 * A `Cancel` is an object that is thrown when an operation is canceled. 380 * 381 * @class 382 * @param {string=} message The message. 383 */ 384function Cancel(message) { 385 this.message = message; 386} 387 388Cancel.prototype.toString = function toString() { 389 return 'Cancel' + (this.message ? ': ' + this.message : ''); 390}; 391 392Cancel.prototype.__CANCEL__ = true; 393 394module.exports = Cancel; 395 396 397/***/ }), 398
vendor: 1,638 bytes, lines 399-467
399/***/ "./node_modules/axios/lib/cancel/CancelToken.js": 400/*!******************************************************!*\ 401 !*** ./node_modules/axios/lib/cancel/CancelToken.js ***! 402 \******************************************************/ 403/*! no static exports found */ 404/***/ (function(module, exports, __webpack_require__) { 405 406"use strict"; 407 408 409var Cancel = __webpack_require__(/*! ./Cancel */ "./node_modules/axios/lib/cancel/Cancel.js"); 410 411/** 412 * A `CancelToken` is an object that can be used to request cancellation of an operation. 413 * 414 * @class 415 * @param {Function} executor The executor function. 416 */ 417function CancelToken(executor) { 418 if (typeof executor !== 'function') { 419 throw new TypeError('executor must be a function.'); 420 } 421 422 var resolvePromise; 423 this.promise = new Promise(function promiseExecutor(resolve) { 424 resolvePromise = resolve; 425 }); 426 427 var token = this; 428 executor(function cancel(message) { 429 if (token.reason) { 430 // Cancellation has already been requested 431 return; 432 } 433 434 token.reason = new Cancel(message); 435 resolvePromise(token.reason); 436 }); 437} 438 439/** 440 * Throws a `Cancel` if cancellation has been requested. 441 */ 442CancelToken.prototype.throwIfRequested = function throwIfRequested() { 443 if (this.reason) { 444 throw this.reason; 445 } 446}; 447 448/** 449 * Returns an object that contains a new `CancelToken` and a function that, when called, 450 * cancels the `CancelToken`. 451 */ 452CancelToken.source = function source() { 453 var cancel; 454 var token = new CancelToken(function executor(c) { 455 cancel = c; 456 }); 457 return { 458 token: token, 459 cancel: cancel 460 }; 461}; 462 463module.exports = CancelToken; 464 465 466/***/ }), 467
vendor: 427 bytes, lines 468-484
468/***/ "./node_modules/axios/lib/cancel/isCancel.js": 469/*!***************************************************!*\ 470 !*** ./node_modules/axios/lib/cancel/isCancel.js ***! 471 \***************************************************/ 472/*! no static exports found */ 473/***/ (function(module, exports, __webpack_require__) { 474 475"use strict"; 476 477 478module.exports = function isCancel(value) { 479 return !!(value && value.__CANCEL__); 480}; 481 482 483/***/ }), 484
vendor: 3,240 bytes, lines 485-590
485/***/ "./node_modules/axios/lib/core/Axios.js": 486/*!**********************************************!*\ 487 !*** ./node_modules/axios/lib/core/Axios.js ***! 488 \**********************************************/ 489/*! no static exports found */ 490/***/ (function(module, exports, __webpack_require__) { 491 492"use strict"; 493 494 495var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 496var buildURL = __webpack_require__(/*! ../helpers/buildURL */ "./node_modules/axios/lib/helpers/buildURL.js"); 497var InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ "./node_modules/axios/lib/core/InterceptorManager.js"); 498var dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ "./node_modules/axios/lib/core/dispatchRequest.js"); 499var mergeConfig = __webpack_require__(/*! ./mergeConfig */ "./node_modules/axios/lib/core/mergeConfig.js"); 500 501/** 502 * Create a new instance of Axios 503 * 504 * @param {Object} instanceConfig The default config for the instance 505 */ 506function Axios(instanceConfig) { 507 this.defaults = instanceConfig; 508 this.interceptors = { 509 request: new InterceptorManager(), 510 response: new InterceptorManager() 511 }; 512} 513 514/** 515 * Dispatch a request 516 * 517 * @param {Object} config The config specific for this request (merged with this.defaults) 518 */ 519Axios.prototype.request = function request(config) { 520 /*eslint no-param-reassign:0*/ 521 // Allow for axios('example/url'[, config]) a la fetch API 522 if (typeof config === 'string') { 523 config = arguments[1] || {}; 524 config.url = arguments[0]; 525 } else { 526 config = config || {}; 527 } 528 529 config = mergeConfig(this.defaults, config); 530 531 // Set config.method 532 if (config.method) { 533 config.method = config.method.toLowerCase(); 534 } else if (this.defaults.method) { 535 config.method = this.defaults.method.toLowerCase(); 536 } else { 537 config.method = 'get'; 538 } 539 540 // Hook up interceptors middleware 541 var chain = [dispatchRequest, undefined]; 542 var promise = Promise.resolve(config); 543 544 this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) { 545 chain.unshift(interceptor.fulfilled, interceptor.rejected); 546 }); 547 548 this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) { 549 chain.push(interceptor.fulfilled, interceptor.rejected); 550 }); 551 552 while (chain.length) { 553 promise = promise.then(chain.shift(), chain.shift()); 554 } 555 556 return promise; 557}; 558 559Axios.prototype.getUri = function getUri(config) { 560 config = mergeConfig(this.defaults, config); 561 return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\?/, ''); 562}; 563 564// Provide aliases for supported request methods 565utils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) { 566 /*eslint func-names:0*/ 567 Axios.prototype[method] = function(url, config) { 568 return this.request(utils.merge(config || {}, { 569 method: method, 570 url: url 571 })); 572 }; 573}); 574 575utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 576 /*eslint func-names:0*/ 577 Axios.prototype[method] = function(url, data, config) { 578 return this.request(utils.merge(config || {}, { 579 method: method, 580 url: url, 581 data: data 582 })); 583 }; 584}); 585 586module.exports = Axios; 587 588 589/***/ }), 590
vendor: 1,661 bytes, lines 591-654
591/***/ "./node_modules/axios/lib/core/InterceptorManager.js": 592/*!***********************************************************!*\ 593 !*** ./node_modules/axios/lib/core/InterceptorManager.js ***! 594 \***********************************************************/ 595/*! no static exports found */ 596/***/ (function(module, exports, __webpack_require__) { 597 598"use strict"; 599 600 601var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 602 603function InterceptorManager() { 604 this.handlers = []; 605} 606 607/** 608 * Add a new interceptor to the stack 609 * 610 * @param {Function} fulfilled The function to handle `then` for a `Promise` 611 * @param {Function} rejected The function to handle `reject` for a `Promise` 612 * 613 * @return {Number} An ID used to remove interceptor later 614 */ 615InterceptorManager.prototype.use = function use(fulfilled, rejected) { 616 this.handlers.push({ 617 fulfilled: fulfilled, 618 rejected: rejected 619 }); 620 return this.handlers.length - 1; 621}; 622 623/** 624 * Remove an interceptor from the stack 625 * 626 * @param {Number} id The ID that was returned by `use` 627 */ 628InterceptorManager.prototype.eject = function eject(id) { 629 if (this.handlers[id]) { 630 this.handlers[id] = null; 631 } 632}; 633 634/** 635 * Iterate over all the registered interceptors 636 * 637 * This method is particularly useful for skipping over any 638 * interceptors that may have become `null` calling `eject`. 639 * 640 * @param {Function} fn The function to call for each interceptor 641 */ 642InterceptorManager.prototype.forEach = function forEach(fn) { 643 utils.forEach(this.handlers, function forEachHandler(h) { 644 if (h !== null) { 645 fn(h); 646 } 647 }); 648}; 649 650module.exports = InterceptorManager; 651 652 653/***/ }), 654
vendor: 1,168 bytes, lines 655-686
655/***/ "./node_modules/axios/lib/core/buildFullPath.js": 656/*!******************************************************!*\ 657 !*** ./node_modules/axios/lib/core/buildFullPath.js ***! 658 \******************************************************/ 659/*! no static exports found */ 660/***/ (function(module, exports, __webpack_require__) { 661 662"use strict"; 663 664 665var isAbsoluteURL = __webpack_require__(/*! ../helpers/isAbsoluteURL */ "./node_modules/axios/lib/helpers/isAbsoluteURL.js"); 666var combineURLs = __webpack_require__(/*! ../helpers/combineURLs */ "./node_modules/axios/lib/helpers/combineURLs.js"); 667 668/** 669 * Creates a new URL by combining the baseURL with the requestedURL, 670 * only when the requestedURL is not already an absolute URL. 671 * If the requestURL is absolute, this function returns the requestedURL untouched. 672 * 673 * @param {string} baseURL The base URL 674 * @param {string} requestedURL Absolute or relative URL to combine 675 * @returns {string} The combined full path 676 */ 677module.exports = function buildFullPath(baseURL, requestedURL) { 678 if (baseURL && !isAbsoluteURL(requestedURL)) { 679 return combineURLs(baseURL, requestedURL); 680 } 681 return requestedURL; 682}; 683 684 685/***/ }), 686
vendor: 1,019 bytes, lines 687-716
687/***/ "./node_modules/axios/lib/core/createError.js": 688/*!****************************************************!*\ 689 !*** ./node_modules/axios/lib/core/createError.js ***! 690 \****************************************************/ 691/*! no static exports found */ 692/***/ (function(module, exports, __webpack_require__) { 693 694"use strict"; 695 696 697var enhanceError = __webpack_require__(/*! ./enhanceError */ "./node_modules/axios/lib/core/enhanceError.js"); 698 699/** 700 * Create an Error with the specified message, config, error code, request and response. 701 * 702 * @param {string} message The error message. 703 * @param {Object} config The config. 704 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 705 * @param {Object} [request] The request. 706 * @param {Object} [response] The response. 707 * @returns {Error} The created error. 708 */ 709module.exports = function createError(message, config, code, request, response) { 710 var error = new Error(message); 711 return enhanceError(error, config, code, request, response); 712}; 713 714 715/***/ }), 716
vendor: 2,517 bytes, lines 717-807
717/***/ "./node_modules/axios/lib/core/dispatchRequest.js": 718/*!********************************************************!*\ 719 !*** ./node_modules/axios/lib/core/dispatchRequest.js ***! 720 \********************************************************/ 721/*! no static exports found */ 722/***/ (function(module, exports, __webpack_require__) { 723 724"use strict"; 725 726 727var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 728var transformData = __webpack_require__(/*! ./transformData */ "./node_modules/axios/lib/core/transformData.js"); 729var isCancel = __webpack_require__(/*! ../cancel/isCancel */ "./node_modules/axios/lib/cancel/isCancel.js"); 730var defaults = __webpack_require__(/*! ../defaults */ "./node_modules/axios/lib/defaults.js"); 731 732/** 733 * Throws a `Cancel` if cancellation has been requested. 734 */ 735function throwIfCancellationRequested(config) { 736 if (config.cancelToken) { 737 config.cancelToken.throwIfRequested(); 738 } 739} 740 741/** 742 * Dispatch a request to the server using the configured adapter. 743 * 744 * @param {object} config The config that is to be used for the request 745 * @returns {Promise} The Promise to be fulfilled 746 */ 747module.exports = function dispatchRequest(config) { 748 throwIfCancellationRequested(config); 749 750 // Ensure headers exist 751 config.headers = config.headers || {}; 752 753 // Transform request data 754 config.data = transformData( 755 config.data, 756 config.headers, 757 config.transformRequest 758 ); 759 760 // Flatten headers 761 config.headers = utils.merge( 762 config.headers.common || {}, 763 config.headers[config.method] || {}, 764 config.headers 765 ); 766 767 utils.forEach( 768 ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'], 769 function cleanHeaderConfig(method) { 770 delete config.headers[method]; 771 } 772 ); 773 774 var adapter = config.adapter || defaults.adapter; 775 776 return adapter(config).then(function onAdapterResolution(response) { 777 throwIfCancellationRequested(config); 778 779 // Transform response data 780 response.data = transformData( 781 response.data, 782 response.headers, 783 config.transformResponse 784 ); 785 786 return response; 787 }, function onAdapterRejection(reason) { 788 if (!isCancel(reason)) { 789 throwIfCancellationRequested(config); 790 791 // Transform response data 792 if (reason && reason.response) { 793 reason.response.data = transformData( 794 reason.response.data, 795 reason.response.headers, 796 config.transformResponse 797 ); 798 } 799 } 800 801 return Promise.reject(reason); 802 }); 803}; 804 805 806/***/ }), 807
vendor: 1,375 bytes, lines 808-861
808/***/ "./node_modules/axios/lib/core/enhanceError.js": 809/*!*****************************************************!*\ 810 !*** ./node_modules/axios/lib/core/enhanceError.js ***! 811 \*****************************************************/ 812/*! no static exports found */ 813/***/ (function(module, exports, __webpack_require__) { 814 815"use strict"; 816 817 818/** 819 * Update an Error with the specified config, error code, and response. 820 * 821 * @param {Error} error The error to update. 822 * @param {Object} config The config. 823 * @param {string} [code] The error code (for example, 'ECONNABORTED'). 824 * @param {Object} [request] The request. 825 * @param {Object} [response] The response. 826 * @returns {Error} The error. 827 */ 828module.exports = function enhanceError(error, config, code, request, response) { 829 error.config = config; 830 if (code) { 831 error.code = code; 832 } 833 834 error.request = request; 835 error.response = response; 836 error.isAxiosError = true; 837 838 error.toJSON = function() { 839 return { 840 // Standard 841 message: this.message, 842 name: this.name, 843 // Microsoft 844 description: this.description, 845 number: this.number, 846 // Mozilla 847 fileName: this.fileName, 848 lineNumber: this.lineNumber, 849 columnNumber: this.columnNumber, 850 stack: this.stack, 851 // Axios 852 config: this.config, 853 code: this.code 854 }; 855 }; 856 return error; 857}; 858 859 860/***/ }), 861
vendor: 2,792 bytes, lines 862-946
862/***/ "./node_modules/axios/lib/core/mergeConfig.js": 863/*!****************************************************!*\ 864 !*** ./node_modules/axios/lib/core/mergeConfig.js ***! 865 \****************************************************/ 866/*! no static exports found */ 867/***/ (function(module, exports, __webpack_require__) { 868 869"use strict"; 870 871 872var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 873 874/** 875 * Config-specific merge-function which creates a new config-object 876 * by merging two configuration objects together. 877 * 878 * @param {Object} config1 879 * @param {Object} config2 880 * @returns {Object} New object resulting from merging config2 to config1 881 */ 882module.exports = function mergeConfig(config1, config2) { 883 // eslint-disable-next-line no-param-reassign 884 config2 = config2 || {}; 885 var config = {}; 886 887 var valueFromConfig2Keys = ['url', 'method', 'params', 'data']; 888 var mergeDeepPropertiesKeys = ['headers', 'auth', 'proxy']; 889 var defaultToConfig2Keys = [ 890 'baseURL', 'url', 'transformRequest', 'transformResponse', 'paramsSerializer', 891 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName', 892 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 893 'maxContentLength', 'validateStatus', 'maxRedirects', 'httpAgent', 894 'httpsAgent', 'cancelToken', 'socketPath' 895 ]; 896 897 utils.forEach(valueFromConfig2Keys, function valueFromConfig2(prop) { 898 if (typeof config2[prop] !== 'undefined') { 899 config[prop] = config2[prop]; 900 } 901 }); 902 903 utils.forEach(mergeDeepPropertiesKeys, function mergeDeepProperties(prop) { 904 if (utils.isObject(config2[prop])) { 905 config[prop] = utils.deepMerge(config1[prop], config2[prop]); 906 } else if (typeof config2[prop] !== 'undefined') { 907 config[prop] = config2[prop]; 908 } else if (utils.isObject(config1[prop])) { 909 config[prop] = utils.deepMerge(config1[prop]); 910 } else if (typeof config1[prop] !== 'undefined') { 911 config[prop] = config1[prop]; 912 } 913 }); 914 915 utils.forEach(defaultToConfig2Keys, function defaultToConfig2(prop) { 916 if (typeof config2[prop] !== 'undefined') { 917 config[prop] = config2[prop]; 918 } else if (typeof config1[prop] !== 'undefined') { 919 config[prop] = config1[prop]; 920 } 921 }); 922 923 var axiosKeys = valueFromConfig2Keys 924 .concat(mergeDeepPropertiesKeys) 925 .concat(defaultToConfig2Keys); 926 927 var otherKeys = Object 928 .keys(config2) 929 .filter(function filterAxiosKeys(key) { 930 return axiosKeys.indexOf(key) === -1; 931 }); 932 933 utils.forEach(otherKeys, function otherKeysDefaultToConfig2(prop) { 934 if (typeof config2[prop] !== 'undefined') { 935 config[prop] = config2[prop]; 936 } else if (typeof config1[prop] !== 'undefined') { 937 config[prop] = config1[prop]; 938 } 939 }); 940 941 return config; 942}; 943 944 945/***/ }), 946
vendor: 1,059 bytes, lines 947-983
947/***/ "./node_modules/axios/lib/core/settle.js": 948/*!***********************************************!*\ 949 !*** ./node_modules/axios/lib/core/settle.js ***! 950 \***********************************************/ 951/*! no static exports found */ 952/***/ (function(module, exports, __webpack_require__) { 953 954"use strict"; 955 956 957var createError = __webpack_require__(/*! ./createError */ "./node_modules/axios/lib/core/createError.js"); 958 959/** 960 * Resolve or reject a Promise based on response status. 961 * 962 * @param {Function} resolve A function that resolves the promise. 963 * @param {Function} reject A function that rejects the promise. 964 * @param {object} response The response. 965 */ 966module.exports = function settle(resolve, reject, response) { 967 var validateStatus = response.config.validateStatus; 968 if (!validateStatus || validateStatus(response.status)) { 969 resolve(response); 970 } else { 971 reject(createError( 972 'Request failed with status code ' + response.status, 973 response.config, 974 null, 975 response.request, 976 response 977 )); 978 } 979}; 980 981 982/***/ }), 983
vendor: 940 bytes, lines 984-1015
984/***/ "./node_modules/axios/lib/core/transformData.js": 985/*!******************************************************!*\ 986 !*** ./node_modules/axios/lib/core/transformData.js ***! 987 \******************************************************/ 988/*! no static exports found */ 989/***/ (function(module, exports, __webpack_require__) { 990 991"use strict"; 992 993 994var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 995 996/** 997 * Transform the data for a request or a response 998 * 999 * @param {Object|String} data The data to be transformed 1000 * @param {Array} headers The headers for the request or response 1001 * @param {Array|Function} fns A single function or Array of functions 1002 * @returns {*} The resulting transformed data 1003 */ 1004module.exports = function transformData(data, headers, fns) { 1005 /*eslint no-param-reassign:0*/ 1006 utils.forEach(fns, function transform(fn) { 1007 data = fn(data, headers); 1008 }); 1009 1010 return data; 1011}; 1012 1013 1014/***/ }), 1015
vendor: 3,267 bytes, lines 1016-1125
1016/***/ "./node_modules/axios/lib/defaults.js": 1017/*!********************************************!*\ 1018 !*** ./node_modules/axios/lib/defaults.js ***! 1019 \********************************************/ 1020/*! no static exports found */ 1021/***/ (function(module, exports, __webpack_require__) { 1022 1023"use strict"; 1024/* WEBPACK VAR INJECTION */(function(process) { 1025 1026var utils = __webpack_require__(/*! ./utils */ "./node_modules/axios/lib/utils.js"); 1027var normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ "./node_modules/axios/lib/helpers/normalizeHeaderName.js"); 1028 1029var DEFAULT_CONTENT_TYPE = { 1030 'Content-Type': 'application/x-www-form-urlencoded' 1031}; 1032 1033function setContentTypeIfUnset(headers, value) { 1034 if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) { 1035 headers['Content-Type'] = value; 1036 } 1037} 1038 1039function getDefaultAdapter() { 1040 var adapter; 1041 if (typeof XMLHttpRequest !== 'undefined') { 1042 // For browsers use XHR adapter 1043 adapter = __webpack_require__(/*! ./adapters/xhr */ "./node_modules/axios/lib/adapters/xhr.js"); 1044 } else if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') { 1045 // For node use HTTP adapter 1046 adapter = __webpack_require__(/*! ./adapters/http */ "./node_modules/axios/lib/adapters/xhr.js"); 1047 } 1048 return adapter; 1049} 1050 1051var defaults = { 1052 adapter: getDefaultAdapter(), 1053 1054 transformRequest: [function transformRequest(data, headers) { 1055 normalizeHeaderName(headers, 'Accept'); 1056 normalizeHeaderName(headers, 'Content-Type'); 1057 if (utils.isFormData(data) || 1058 utils.isArrayBuffer(data) || 1059 utils.isBuffer(data) || 1060 utils.isStream(data) || 1061 utils.isFile(data) || 1062 utils.isBlob(data) 1063 ) { 1064 return data; 1065 } 1066 if (utils.isArrayBufferView(data)) { 1067 return data.buffer; 1068 } 1069 if (utils.isURLSearchParams(data)) { 1070 setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8'); 1071 return data.toString(); 1072 } 1073 if (utils.isObject(data)) { 1074 setContentTypeIfUnset(headers, 'application/json;charset=utf-8'); 1075 return JSON.stringify(data); 1076 } 1077 return data; 1078 }], 1079 1080 transformResponse: [function transformResponse(data) { 1081 /*eslint no-param-reassign:0*/ 1082 if (typeof data === 'string') { 1083 try { 1084 data = JSON.parse(data); 1085 } catch (e) { /* Ignore */ } 1086 } 1087 return data; 1088 }], 1089 1090 /** 1091 * A timeout in milliseconds to abort a request. If set to 0 (default) a 1092 * timeout is not created. 1093 */ 1094 timeout: 0, 1095 1096 xsrfCookieName: 'XSRF-TOKEN', 1097 xsrfHeaderName: 'X-XSRF-TOKEN', 1098 1099 maxContentLength: -1, 1100 1101 validateStatus: function validateStatus(status) { 1102 return status >= 200 && status < 300; 1103 } 1104}; 1105 1106defaults.headers = { 1107 common: { 1108 'Accept': 'application/json, text/plain, */*' 1109 } 1110}; 1111 1112utils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) { 1113 defaults.headers[method] = {}; 1114}); 1115 1116utils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) { 1117 defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE); 1118}); 1119 1120module.exports = defaults; 1121 1122/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../process/browser.js */ "./node_modules/process/browser.js"))) 1123 1124/***/ }), 1125
vendor: 569 bytes, lines 1126-1148
1126/***/ "./node_modules/axios/lib/helpers/bind.js": 1127/*!************************************************!*\ 1128 !*** ./node_modules/axios/lib/helpers/bind.js ***! 1129 \************************************************/ 1130/*! no static exports found */ 1131/***/ (function(module, exports, __webpack_require__) { 1132 1133"use strict"; 1134 1135 1136module.exports = function bind(fn, thisArg) { 1137 return function wrap() { 1138 var args = new Array(arguments.length); 1139 for (var i = 0; i < args.length; i++) { 1140 args[i] = arguments[i]; 1141 } 1142 return fn.apply(thisArg, args); 1143 }; 1144}; 1145 1146 1147/***/ }), 1148
vendor: 2,053 bytes, lines 1149-1231
1149/***/ "./node_modules/axios/lib/helpers/buildURL.js": 1150/*!****************************************************!*\ 1151 !*** ./node_modules/axios/lib/helpers/buildURL.js ***! 1152 \****************************************************/ 1153/*! no static exports found */ 1154/***/ (function(module, exports, __webpack_require__) { 1155 1156"use strict"; 1157 1158 1159var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1160 1161function encode(val) { 1162 return encodeURIComponent(val). 1163 replace(/%40/gi, '@'). 1164 replace(/%3A/gi, ':'). 1165 replace(/%24/g, '$'). 1166 replace(/%2C/gi, ','). 1167 replace(/%20/g, '+'). 1168 replace(/%5B/gi, '['). 1169 replace(/%5D/gi, ']'); 1170} 1171 1172/** 1173 * Build a URL by appending params to the end 1174 * 1175 * @param {string} url The base of the url (e.g., http://www.google.com) 1176 * @param {object} [params] The params to be appended 1177 * @returns {string} The formatted url 1178 */ 1179module.exports = function buildURL(url, params, paramsSerializer) { 1180 /*eslint no-param-reassign:0*/ 1181 if (!params) { 1182 return url; 1183 } 1184 1185 var serializedParams; 1186 if (paramsSerializer) { 1187 serializedParams = paramsSerializer(params); 1188 } else if (utils.isURLSearchParams(params)) { 1189 serializedParams = params.toString(); 1190 } else { 1191 var parts = []; 1192 1193 utils.forEach(params, function serialize(val, key) { 1194 if (val === null || typeof val === 'undefined') { 1195 return; 1196 } 1197 1198 if (utils.isArray(val)) { 1199 key = key + '[]'; 1200 } else { 1201 val = [val]; 1202 } 1203 1204 utils.forEach(val, function parseValue(v) { 1205 if (utils.isDate(v)) { 1206 v = v.toISOString(); 1207 } else if (utils.isObject(v)) { 1208 v = JSON.stringify(v); 1209 } 1210 parts.push(encode(key) + '=' + encode(v)); 1211 }); 1212 }); 1213 1214 serializedParams = parts.join('&'); 1215 } 1216 1217 if (serializedParams) { 1218 var hashmarkIndex = url.indexOf('#'); 1219 if (hashmarkIndex !== -1) { 1220 url = url.slice(0, hashmarkIndex); 1221 } 1222 1223 url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams; 1224 } 1225 1226 return url; 1227}; 1228 1229 1230/***/ }), 1231
vendor: 721 bytes, lines 1232-1257
1232/***/ "./node_modules/axios/lib/helpers/combineURLs.js": 1233/*!*******************************************************!*\ 1234 !*** ./node_modules/axios/lib/helpers/combineURLs.js ***! 1235 \*******************************************************/ 1236/*! no static exports found */ 1237/***/ (function(module, exports, __webpack_require__) { 1238 1239"use strict"; 1240 1241 1242/** 1243 * Creates a new URL by combining the specified URLs 1244 * 1245 * @param {string} baseURL The base URL 1246 * @param {string} relativeURL The relative URL 1247 * @returns {string} The combined URL 1248 */ 1249module.exports = function combineURLs(baseURL, relativeURL) { 1250 return relativeURL 1251 ? baseURL.replace(/\/+$/, '') + '/' + relativeURL.replace(/^\/+/, '') 1252 : baseURL; 1253}; 1254 1255 1256/***/ }), 1257
vendor: 1,813 bytes, lines 1258-1322
1258/***/ "./node_modules/axios/lib/helpers/cookies.js": 1259/*!***************************************************!*\ 1260 !*** ./node_modules/axios/lib/helpers/cookies.js ***! 1261 \***************************************************/ 1262/*! no static exports found */ 1263/***/ (function(module, exports, __webpack_require__) { 1264 1265"use strict"; 1266 1267 1268var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1269 1270module.exports = ( 1271 utils.isStandardBrowserEnv() ? 1272 1273 // Standard browser envs support document.cookie 1274 (function standardBrowserEnv() { 1275 return { 1276 write: function write(name, value, expires, path, domain, secure) { 1277 var cookie = []; 1278 cookie.push(name + '=' + encodeURIComponent(value)); 1279 1280 if (utils.isNumber(expires)) { 1281 cookie.push('expires=' + new Date(expires).toGMTString()); 1282 } 1283 1284 if (utils.isString(path)) { 1285 cookie.push('path=' + path); 1286 } 1287 1288 if (utils.isString(domain)) { 1289 cookie.push('domain=' + domain); 1290 } 1291 1292 if (secure === true) { 1293 cookie.push('secure'); 1294 } 1295 1296 document.cookie = cookie.join('; '); 1297 }, 1298 1299 read: function read(name) { 1300 var match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)')); 1301 return (match ? decodeURIComponent(match[3]) : null); 1302 }, 1303 1304 remove: function remove(name) { 1305 this.write(name, '', Date.now() - 86400000); 1306 } 1307 }; 1308 })() : 1309 1310 // Non standard browser env (web workers, react-native) lack needed support. 1311 (function nonStandardBrowserEnv() { 1312 return { 1313 write: function write() {}, 1314 read: function read() { return null; }, 1315 remove: function remove() {} 1316 }; 1317 })() 1318); 1319 1320 1321/***/ }), 1322
vendor: 912 bytes, lines 1323-1348
1323/***/ "./node_modules/axios/lib/helpers/isAbsoluteURL.js": 1324/*!*********************************************************!*\ 1325 !*** ./node_modules/axios/lib/helpers/isAbsoluteURL.js ***! 1326 \*********************************************************/ 1327/*! no static exports found */ 1328/***/ (function(module, exports, __webpack_require__) { 1329 1330"use strict"; 1331 1332 1333/** 1334 * Determines whether the specified URL is absolute 1335 * 1336 * @param {string} url The URL to test 1337 * @returns {boolean} True if the specified URL is absolute, otherwise false 1338 */ 1339module.exports = function isAbsoluteURL(url) { 1340 // A URL is considered absolute if it begins with "<scheme>://" or "//" (protocol-relative URL). 1341 // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed 1342 // by any combination of letters, digits, plus, period, or hyphen. 1343 return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(url); 1344}; 1345 1346 1347/***/ }), 1348
vendor: 2,715 bytes, lines 1349-1428
1349/***/ "./node_modules/axios/lib/helpers/isURLSameOrigin.js": 1350/*!***********************************************************!*\ 1351 !*** ./node_modules/axios/lib/helpers/isURLSameOrigin.js ***! 1352 \***********************************************************/ 1353/*! no static exports found */ 1354/***/ (function(module, exports, __webpack_require__) { 1355 1356"use strict"; 1357 1358 1359var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1360 1361module.exports = ( 1362 utils.isStandardBrowserEnv() ? 1363 1364 // Standard browser envs have full support of the APIs needed to test 1365 // whether the request URL is of the same origin as current location. 1366 (function standardBrowserEnv() { 1367 var msie = /(msie|trident)/i.test(navigator.userAgent); 1368 var urlParsingNode = document.createElement('a'); 1369 var originURL; 1370 1371 /** 1372 * Parse a URL to discover it's components 1373 * 1374 * @param {String} url The URL to be parsed 1375 * @returns {Object} 1376 */ 1377 function resolveURL(url) { 1378 var href = url; 1379 1380 if (msie) { 1381 // IE needs attribute set twice to normalize properties 1382 urlParsingNode.setAttribute('href', href); 1383 href = urlParsingNode.href; 1384 } 1385 1386 urlParsingNode.setAttribute('href', href); 1387 1388 // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils 1389 return { 1390 href: urlParsingNode.href, 1391 protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '', 1392 host: urlParsingNode.host, 1393 search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '', 1394 hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '', 1395 hostname: urlParsingNode.hostname, 1396 port: urlParsingNode.port, 1397 pathname: (urlParsingNode.pathname.charAt(0) === '/') ? 1398 urlParsingNode.pathname : 1399 '/' + urlParsingNode.pathname 1400 }; 1401 } 1402 1403 originURL = resolveURL(window.location.href); 1404 1405 /** 1406 * Determine if a URL shares the same origin as the current location 1407 * 1408 * @param {String} requestURL The URL to test 1409 * @returns {boolean} True if URL shares the same origin, otherwise false 1410 */ 1411 return function isURLSameOrigin(requestURL) { 1412 var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL; 1413 return (parsed.protocol === originURL.protocol && 1414 parsed.host === originURL.host); 1415 }; 1416 })() : 1417 1418 // Non standard browser envs (web workers, react-native) lack needed support. 1419 (function nonStandardBrowserEnv() { 1420 return function isURLSameOrigin() { 1421 return true; 1422 }; 1423 })() 1424); 1425 1426 1427/***/ }), 1428
vendor: 783 bytes, lines 1429-1452
1429/***/ "./node_modules/axios/lib/helpers/normalizeHeaderName.js": 1430/*!***************************************************************!*\ 1431 !*** ./node_modules/axios/lib/helpers/normalizeHeaderName.js ***! 1432 \***************************************************************/ 1433/*! no static exports found */ 1434/***/ (function(module, exports, __webpack_require__) { 1435 1436"use strict"; 1437 1438 1439var utils = __webpack_require__(/*! ../utils */ "./node_modules/axios/lib/utils.js"); 1440 1441module.exports = function normalizeHeaderName(headers, normalizedName) { 1442 utils.forEach(headers, function processHeader(value, name) { 1443 if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) { 1444 headers[normalizedName] = value; 1445 delete headers[name]; 1446 } 1447 }); 1448}; 1449 1450 1451/***/ }), 1452
vendor: 1,791 bytes, lines 1453-1517
1453/***/ "./node_modules/axios/lib/helpers/parseHeaders.js": 1454/*!********************************************************!*\ 1455 !*** ./node_modules/axios/lib/helpers/parseHeaders.js ***! 1456 \********************************************************/ 1457/*! no static exports found */ 1458/***/ (function(module, exports, __webpack_require__) { 1459 1460"use strict"; 1461 1462 1463var utils = __webpack_require__(/*! ./../utils */ "./node_modules/axios/lib/utils.js"); 1464 1465// Headers whose duplicates are ignored by node 1466// c.f. https://nodejs.org/api/http.html#http_message_headers 1467var ignoreDuplicateOf = [ 1468 'age', 'authorization', 'content-length', 'content-type', 'etag', 1469 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 1470 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 1471 'referer', 'retry-after', 'user-agent' 1472]; 1473 1474/** 1475 * Parse headers into an object 1476 * 1477 * ``` 1478 * Date: Wed, 27 Aug 2014 08:58:49 GMT 1479 * Content-Type: application/json 1480 * Connection: keep-alive 1481 * Transfer-Encoding: chunked 1482 * ``` 1483 * 1484 * @param {String} headers Headers needing to be parsed 1485 * @returns {Object} Headers parsed into an object 1486 */ 1487module.exports = function parseHeaders(headers) { 1488 var parsed = {}; 1489 var key; 1490 var val; 1491 var i; 1492 1493 if (!headers) { return parsed; } 1494 1495 utils.forEach(headers.split('\n'), function parser(line) { 1496 i = line.indexOf(':'); 1497 key = utils.trim(line.substr(0, i)).toLowerCase(); 1498 val = utils.trim(line.substr(i + 1)); 1499 1500 if (key) { 1501 if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) { 1502 return; 1503 } 1504 if (key === 'set-cookie') { 1505 parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]); 1506 } else { 1507 parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val; 1508 } 1509 } 1510 }); 1511 1512 return parsed; 1513}; 1514 1515 1516/***/ }), 1517
vendor: 885 bytes, lines 1518-1556
1518/***/ "./node_modules/axios/lib/helpers/spread.js": 1519/*!**************************************************!*\ 1520 !*** ./node_modules/axios/lib/helpers/spread.js ***! 1521 \**************************************************/ 1522/*! no static exports found */ 1523/***/ (function(module, exports, __webpack_require__) { 1524 1525"use strict"; 1526 1527 1528/** 1529 * Syntactic sugar for invoking a function and expanding an array for arguments. 1530 * 1531 * Common use case would be to use `Function.prototype.apply`. 1532 * 1533 * ```js 1534 * function f(x, y, z) {} 1535 * var args = [1, 2, 3]; 1536 * f.apply(null, args); 1537 * ``` 1538 * 1539 * With `spread` this example can be re-written. 1540 * 1541 * ```js 1542 * spread(function(x, y, z) {})([1, 2, 3]); 1543 * ``` 1544 * 1545 * @param {Function} callback 1546 * @returns {Function} 1547 */ 1548module.exports = function spread(callback) { 1549 return function wrap(arr) { 1550 return callback.apply(null, arr); 1551 }; 1552}; 1553 1554 1555/***/ }), 1556
vendor: 115,736 bytes, lines 1557-7882
1557/***/ "./node_modules/axios/lib/utils.js": 1558/*!*****************************************!*\ 1559 !*** ./node_modules/axios/lib/utils.js ***! 1560 \*****************************************/ 1561/*! no static exports found */ 1562/***/ (function(module, exports, __webpack_require__) { 1563 1564"use strict"; 1565 1566 1567var bind = __webpack_require__(/*! ./helpers/bind */ "./node_modules/axios/lib/helpers/bind.js"); 1568 1569/*global toString:true*/ 1570 1571// utils is a library of generic helper functions non-specific to axios 1572 1573var toString = Object.prototype.toString; 1574 1575/** 1576 * Determine if a value is an Array 1577 * 1578 * @param {Object} val The value to test 1579 * @returns {boolean} True if value is an Array, otherwise false 1580 */ 1581function isArray(val) { 1582 return toString.call(val) === '[object Array]'; 1583} 1584 1585/** 1586 * Determine if a value is undefined 1587 * 1588 * @param {Object} val The value to test 1589 * @returns {boolean} True if the value is undefined, otherwise false 1590 */ 1591function isUndefined(val) { 1592 return typeof val === 'undefined'; 1593} 1594 1595/** 1596 * Determine if a value is a Buffer 1597 * 1598 * @param {Object} val The value to test 1599 * @returns {boolean} True if value is a Buffer, otherwise false 1600 */ 1601function isBuffer(val) { 1602 return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor) 1603 && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val); 1604} 1605 1606/** 1607 * Determine if a value is an ArrayBuffer 1608 * 1609 * @param {Object} val The value to test 1610 * @returns {boolean} True if value is an ArrayBuffer, otherwise false 1611 */ 1612function isArrayBuffer(val) { 1613 return toString.call(val) === '[object ArrayBuffer]'; 1614} 1615 1616/** 1617 * Determine if a value is a FormData 1618 * 1619 * @param {Object} val The value to test 1620 * @returns {boolean} True if value is an FormData, otherwise false 1621 */ 1622function isFormData(val) { 1623 return (typeof FormData !== 'undefined') && (val instanceof FormData); 1624} 1625 1626/** 1627 * Determine if a value is a view on an ArrayBuffer 1628 * 1629 * @param {Object} val The value to test 1630 * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false 1631 */ 1632function isArrayBufferView(val) { 1633 var result; 1634 if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { 1635 result = ArrayBuffer.isView(val); 1636 } else { 1637 result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer); 1638 } 1639 return result; 1640} 1641 1642/** 1643 * Determine if a value is a String 1644 * 1645 * @param {Object} val The value to test 1646 * @returns {boolean} True if value is a String, otherwise false 1647 */ 1648function isString(val) { 1649 return typeof val === 'string'; 1650} 1651 1652/** 1653 * Determine if a value is a Number 1654 * 1655 * @param {Object} val The value to test 1656 * @returns {boolean} True if value is a Number, otherwise false 1657 */ 1658function isNumber(val) { 1659 return typeof val === 'number'; 1660} 1661 1662/** 1663 * Determine if a value is an Object 1664 * 1665 * @param {Object} val The value to test 1666 * @returns {boolean} True if value is an Object, otherwise false 1667 */ 1668function isObject(val) { 1669 return val !== null && typeof val === 'object'; 1670} 1671 1672/** 1673 * Determine if a value is a Date 1674 * 1675 * @param {Object} val The value to test 1676 * @returns {boolean} True if value is a Date, otherwise false 1677 */ 1678function isDate(val) { 1679 return toString.call(val) === '[object Date]'; 1680} 1681 1682/** 1683 * Determine if a value is a File 1684 * 1685 * @param {Object} val The value to test 1686 * @returns {boolean} True if value is a File, otherwise false 1687 */ 1688function isFile(val) { 1689 return toString.call(val) === '[object File]'; 1690} 1691 1692/** 1693 * Determine if a value is a Blob 1694 * 1695 * @param {Object} val The value to test 1696 * @returns {boolean} True if value is a Blob, otherwise false 1697 */ 1698function isBlob(val) { 1699 return toString.call(val) === '[object Blob]'; 1700} 1701 1702/** 1703 * Determine if a value is a Function 1704 * 1705 * @param {Object} val The value to test 1706 * @returns {boolean} True if value is a Function, otherwise false 1707 */ 1708function isFunction(val) { 1709 return toString.call(val) === '[object Function]'; 1710} 1711 1712/** 1713 * Determine if a value is a Stream 1714 * 1715 * @param {Object} val The value to test 1716 * @returns {boolean} True if value is a Stream, otherwise false 1717 */ 1718function isStream(val) { 1719 return isObject(val) && isFunction(val.pipe); 1720} 1721 1722/** 1723 * Determine if a value is a URLSearchParams object 1724 * 1725 * @param {Object} val The value to test 1726 * @returns {boolean} True if value is a URLSearchParams object, otherwise false 1727 */ 1728function isURLSearchParams(val) { 1729 return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams; 1730} 1731 1732/** 1733 * Trim excess whitespace off the beginning and end of a string 1734 * 1735 * @param {String} str The String to trim 1736 * @returns {String} The String freed of excess whitespace 1737 */ 1738function trim(str) { 1739 return str.replace(/^\s*/, '').replace(/\s*$/, ''); 1740} 1741 1742/** 1743 * Determine if we're running in a standard browser environment 1744 * 1745 * This allows axios to run in a web worker, and react-native. 1746 * Both environments support XMLHttpRequest, but not fully standard globals. 1747 * 1748 * web workers: 1749 * typeof window -> undefined 1750 * typeof document -> undefined 1751 * 1752 * react-native: 1753 * navigator.product -> 'ReactNative' 1754 * nativescript 1755 * navigator.product -> 'NativeScript' or 'NS' 1756 */ 1757function isStandardBrowserEnv() { 1758 if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || 1759 navigator.product === 'NativeScript' || 1760 navigator.product === 'NS')) { 1761 return false; 1762 } 1763 return ( 1764 typeof window !== 'undefined' && 1765 typeof document !== 'undefined' 1766 ); 1767} 1768 1769/** 1770 * Iterate over an Array or an Object invoking a function for each item. 1771 * 1772 * If `obj` is an Array callback will be called passing 1773 * the value, index, and complete array for each item. 1774 * 1775 * If 'obj' is an Object callback will be called passing 1776 * the value, key, and complete object for each property. 1777 * 1778 * @param {Object|Array} obj The object to iterate 1779 * @param {Function} fn The callback to invoke for each item 1780 */ 1781function forEach(obj, fn) { 1782 // Don't bother if no value provided 1783 if (obj === null || typeof obj === 'undefined') { 1784 return; 1785 } 1786 1787 // Force an array if not already something iterable 1788 if (typeof obj !== 'object') { 1789 /*eslint no-param-reassign:0*/ 1790 obj = [obj]; 1791 } 1792 1793 if (isArray(obj)) { 1794 // Iterate over array values 1795 for (var i = 0, l = obj.length; i < l; i++) { 1796 fn.call(null, obj[i], i, obj); 1797 } 1798 } else { 1799 // Iterate over object keys 1800 for (var key in obj) { 1801 if (Object.prototype.hasOwnProperty.call(obj, key)) { 1802 fn.call(null, obj[key], key, obj); 1803 } 1804 } 1805 } 1806} 1807 1808/** 1809 * Accepts varargs expecting each argument to be an object, then 1810 * immutably merges the properties of each object and returns result. 1811 * 1812 * When multiple objects contain the same key the later object in 1813 * the arguments list will take precedence. 1814 * 1815 * Example: 1816 * 1817 * ```js 1818 * var result = merge({foo: 123}, {foo: 456}); 1819 * console.log(result.foo); // outputs 456 1820 * ``` 1821 * 1822 * @param {Object} obj1 Object to merge 1823 * @returns {Object} Result of all merge properties 1824 */ 1825function merge(/* obj1, obj2, obj3, ... */) { 1826 var result = {}; 1827 function assignValue(val, key) { 1828 if (typeof result[key] === 'object' && typeof val === 'object') { 1829 result[key] = merge(result[key], val); 1830 } else { 1831 result[key] = val; 1832 } 1833 } 1834 1835 for (var i = 0, l = arguments.length; i < l; i++) { 1836 forEach(arguments[i], assignValue); 1837 } 1838 return result; 1839} 1840 1841/** 1842 * Function equal to merge with the difference being that no reference 1843 * to original objects is kept. 1844 * 1845 * @see merge 1846 * @param {Object} obj1 Object to merge 1847 * @returns {Object} Result of all merge properties 1848 */ 1849function deepMerge(/* obj1, obj2, obj3, ... */) { 1850 var result = {}; 1851 function assignValue(val, key) { 1852 if (typeof result[key] === 'object' && typeof val === 'object') { 1853 result[key] = deepMerge(result[key], val); 1854 } else if (typeof val === 'object') { 1855 result[key] = deepMerge({}, val); 1856 } else { 1857 result[key] = val; 1858 } 1859 } 1860 1861 for (var i = 0, l = arguments.length; i < l; i++) { 1862 forEach(arguments[i], assignValue); 1863 } 1864 return result; 1865} 1866 1867/** 1868 * Extends object a by mutably adding to it the properties of object b. 1869 * 1870 * @param {Object} a The object to be extended 1871 * @param {Object} b The object to copy properties from 1872 * @param {Object} thisArg The object to bind function to 1873 * @return {Object} The resulting value of object a 1874 */ 1875function extend(a, b, thisArg) { 1876 forEach(b, function assignValue(val, key) { 1877 if (thisArg && typeof val === 'function') { 1878 a[key] = bind(val, thisArg); 1879 } else { 1880 a[key] = val; 1881 } 1882 }); 1883 return a; 1884} 1885 1886module.exports = { 1887 isArray: isArray, 1888 isArrayBuffer: isArrayBuffer, 1889 isBuffer: isBuffer, 1890 isFormData: isFormData, 1891 isArrayBufferView: isArrayBufferView, 1892 isString: isString, 1893 isNumber: isNumber, 1894 isObject: isObject, 1895 isUndefined: isUndefined, 1896 isDate: isDate, 1897 isFile: isFile, 1898 isBlob: isBlob, 1899 isFunction: isFunction, 1900 isStream: isStream, 1901 isURLSearchParams: isURLSearchParams, 1902 isStandardBrowserEnv: isStandardBrowserEnv, 1903 forEach: forEach, 1904 merge: merge, 1905 deepMerge: deepMerge, 1906 extend: extend, 1907 trim: trim 1908}; 1909 1910 1911/***/ }), 1912 1913/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=script&lang=js&": 1914/*!*****************************************************************************************************************************************************************************************!*\ 1915 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=script&lang=js& ***! 1916 \*****************************************************************************************************************************************************************************************/ 1917/*! exports provided: default */ 1918/***/ (function(module, __webpack_exports__, __webpack_require__) { 1919 1920"use strict"; 1921__webpack_require__.r(__webpack_exports__); 1922/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-cleave-component */ "./node_modules/vue-cleave-component/dist/vue-cleave.min.js"); 1923/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__); 1924/* harmony import */ var _mixins_customers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/customers */ "./resources/js/mixins/customers.js"); 1925/* harmony import */ var _mixins_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/helper */ "./resources/js/mixins/helper.js"); 1926// 1927// 1928// 1929// 1930// 1931// 1932// 1933// 1934// 1935// 1936// 1937// 1938// 1939// 1940// 1941// 1942// 1943// 1944// 1945// 1946// 1947// 1948// 1949// 1950// 1951// 1952// 1953// 1954// 1955// 1956// 1957// 1958// 1959// 1960// 1961// 1962// 1963// 1964// 1965// 1966// 1967// 1968// 1969// 1970// 1971// 1972// 1973// 1974// 1975// 1976// 1977// 1978// 1979// 1980// 1981// 1982// 1983// 1984// 1985// 1986// 1987// 1988// 1989// 1990// 1991// 1992// 1993// 1994// 1995// 1996// 1997// 1998// 1999// 2000// 2001// 2002// 2003// 2004// 2005// 2006// 2007// 2008// 2009// 2010// 2011// 2012// 2013// 2014// 2015// 2016// 2017// 2018// 2019// 2020// 2021// 2022// 2023// 2024// 2025// 2026// 2027// 2028// 2029// 2030// 2031// 2032// 2033// 2034// 2035// 2036// 2037// 2038// 2039// 2040// 2041// 2042// 2043// 2044// 2045// 2046// 2047// 2048// 2049// 2050// 2051// 2052// 2053// 2054// 2055// 2056// 2057// 2058// 2059// 2060// 2061// 2062// 2063// 2064// 2065// 2066// 2067// 2068// 2069// 2070// 2071// 2072// 2073// 2074// 2075// 2076// 2077// 2078// 2079// 2080// 2081// 2082// 2083// 2084// 2085// 2086// 2087// 2088// 2089// 2090// 2091// 2092// 2093// 2094// 2095// 2096// 2097// 2098// 2099// 2100// 2101// 2102// 2103// 2104// 2105// 2106// 2107// 2108// 2109// 2110// 2111// 2112// 2113// 2114// 2115// 2116// 2117// 2118// 2119// 2120// 2121// 2122// 2123// 2124// 2125// 2126// 2127// 2128// 2129// 2130// 2131// 2132// 2133// 2134// 2135// 2136// 2137// 2138// 2139// 2140// 2141// 2142// 2143// 2144// 2145// 2146// 2147// 2148// 2149// 2150// 2151// 2152// 2153// 2154// 2155// 2156// 2157// 2158// 2159// 2160// 2161// 2162// 2163// 2164// 2165// 2166// 2167// 2168// 2169// 2170// 2171// 2172// 2173// 2174// 2175// 2176// 2177// 2178// 2179// 2180// 2181// 2182// 2183// 2184// 2185// 2186// 2187// 2188// 2189// 2190// 2191// 2192// 2193// 2194// 2195// 2196// 2197// 2198// 2199// 2200// 2201// 2202// 2203// 2204// 2205// 2206// 2207// 2208// 2209// 2210// 2211// 2212// 2213// 2214// 2215// 2216// 2217// 2218// 2219// 2220// 2221// 2222// 2223// 2224// 2225// 2226// 2227// 2228// 2229// 2230// 2231// 2232// 2233// 2234// 2235// 2236// 2237// 2238// 2239// 2240// 2241// 2242// 2243// 2244// 2245// 2246// 2247// 2248// 2249// 2250// 2251// 2252// 2253// 2254// 2255// 2256// 2257// 2258// 2259// 2260// 2261// 2262// 2263// 2264// 2265// 2266// 2267// 2268// 2269// 2270// 2271// 2272// 2273// 2274// 2275// 2276// 2277// 2278// 2279// 2280// 2281// 2282// 2283// 2284// 2285// 2286// 2287// 2288// 2289// 2290// 2291// 2292// 2293// 2294// 2295// 2296// 2297// 2298// 2299// 2300// 2301// 2302// 2303// 2304// 2305// 2306// 2307// 2308// 2309// 2310// 2311// 2312// 2313// 2314// 2315// 2316// 2317// 2318// 2319// 2320// 2321// 2322// 2323// 2324// 2325// 2326// 2327// 2328// 2329// 2330// 2331// 2332// 2333// 2334// 2335// 2336// 2337// 2338// 2339// 2340// 2341// 2342// 2343// 2344// 2345// 2346// 2347// 2348// 2349// 2350// 2351// 2352// 2353// 2354// 2355// 2356// 2357// 2358// 2359// 2360// 2361// 2362// 2363// 2364// 2365// 2366// 2367// 2368// 2369// 2370// 2371// 2372// 2373// 2374// 2375// 2376// 2377// 2378// 2379// 2380// 2381// 2382// 2383// 2384// 2385// 2386// 2387// 2388// 2389// 2390// 2391// 2392// 2393// 2394// 2395// 2396// 2397// 2398// 2399// 2400// 2401// 2402// 2403// 2404// 2405// 2406// 2407// 2408// 2409// 2410// 2411// 2412// 2413// 2414// 2415// 2416// 2417// 2418// 2419// 2420// 2421// 2422// 2423// 2424// 2425// 2426// 2427// 2428// 2429// 2430// 2431// 2432// 2433// 2434// 2435// 2436// 2437// 2438// 2439 2440 2441 2442var today = new Date(); 2443var startDate = today.toISOString().slice(0, 10); 2444today.setFullYear(today.getFullYear() + 1); 2445var endDate = today.toISOString().slice(0, 10); 2446/* harmony default export */ __webpack_exports__["default"] = ({ 2447 name: "BicycleInsuranceForm", 2448 mixins: [_mixins_customers__WEBPACK_IMPORTED_MODULE_1__["customers"], _mixins_helper__WEBPACK_IMPORTED_MODULE_2__["helper"]], 2449 components: { 2450 Cleave: vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default.a 2451 }, 2452 props: { 2453 customerType: { 2454 type: String, 2455 "default": 'personal' // 'personal / bisnis 2456 2457 }, 2458 accessCode: { 2459 type: String, 2460 "default": '100000000767' // Kode Akses Khusus Untuk Partner 13 digit. 2461 2462 }, 2463 businessCode: { 2464 type: String, 2465 "default": '10018' 2466 }, 2467 businessName: { 2468 type: String, 2469 "default": 'BICYCLE' // max 50 character 2470 2471 }, 2472 groupPanel: { 2473 type: String, 2474 "default": '003' // Group panel 3 digit. 2475 2476 }, 2477 branchName: { 2478 type: String, 2479 "default": 'DIRECT' 2480 }, 2481 startDate: { 2482 type: String, 2483 "default": startDate 2484 }, 2485 endDate: { 2486 type: String, 2487 "default": endDate 2488 } 2489 }, 2490 data: function data() { 2491 return { 2492 submitting: false, 2493 errors: [], 2494 currentPage: 1, 2495 isAgreement: false, 2496 formData: { 2497 // config 2498 customer_type: this.customerType, 2499 access_code: this.accessCode, 2500 business_code: this.businessCode, 2501 business_name: this.businessName, 2502 group_panel: this.groupPanel, 2503 branch_name: this.branchName, 2504 // data. 2505 id: 0, 2506 id_transaction: 'ASM003', 2507 step: 1, 2508 qq_name: '', 2509 the_insured: '', 2510 first_name: '', 2511 last_name: '', 2512 gender: '1', 2513 status: '0', 2514 id_card: '', 2515 npwp: '', 2516 email: '', 2517 address: '', 2518 zip_code: '', 2519 telephone: '', 2520 fax: '', 2521 mobile_phone: '', 2522 hand_phone: '', 2523 office_address: '', 2524 office_zip_code: '', 2525 office_telephone: '', 2526 office_fax: '', 2527 office_mobile_phone: '', 2528 office_hand_phone: '', 2529 office_email: '', 2530 occupation_name: '', 2531 club: '2', 2532 purchase_date: '', 2533 qty: '1', 2534 bicycle_name: '', 2535 // Ambil dari Data Master Partner / ASM 2536 brand_name: '', 2537 type_name: '', 2538 warranty_number: '', 2539 registration_number: '', 2540 serial_number: '', 2541 specification: '10', 2542 year: '', 2543 tsi: '', 2544 discount_percentage: 0, 2545 start_date: this.startDate, 2546 end_date: this.endDate, 2547 type_of_packet: "PAKET BASIC", 2548 // case_id: '', 2549 policy_number: '', 2550 heir_name: '', 2551 heir_gender: 'Laki-Laki', 2552 heir_birth_date: '', 2553 heir_percentage: '100', 2554 premium: '', 2555 admin_fee: '', 2556 commission: '', 2557 stamp_receipts: '', 2558 stamp_policy: '', 2559 discount: '', 2560 payment_total: '', 2561 sum_payment_total: '', 2562 pdf: '', 2563 coverage: '' 2564 }, 2565 isValidPrice: false, 2566 customerProfile: {}, 2567 registrationResponse: {}, 2568 responseData: [], 2569 priceOption: { 2570 numeral: true, 2571 numeralDecimalScale: 2, 2572 numeralDecimalMark: ',', 2573 delimiter: '.', 2574 numeralPositiveOnly: true 2575 }, 2576 tempData: {}, 2577 datetimePickerConfig: { 2578 enableTime: true, 2579 time_24hr: true, 2580 enableSeconds: false, 2581 dateFormat: 'Y-m-d', 2582 altInput: true, 2583 altFormat: 'Y-m-d', 2584 locale: null 2585 }, 2586 datePickerConfig: { 2587 dateFormat: 'Y-m-d', 2588 altInput: true, 2589 altFormat: 'Ymd', 2590 locale: null 2591 }, 2592 optionPackets: ['PAKET BASIC', 'PAKET RIDER', 'PAKET PROFESSIONAL'], 2593 optionSpecifications: [{ 2594 text: 'HYBRID', 2595 value: '1' 2596 }, { 2597 text: 'MTB', 2598 value: '2' 2599 }, { 2600 text: 'DOWNHILL', 2601 value: '3' 2602 }, { 2603 text: 'KIDS BIKE', 2604 value: '4' 2605 }, { 2606 text: 'FOLDING BIKE', 2607 value: '5' 2608 }, { 2609 text: 'ROAD BIKE', 2610 value: '6' 2611 }, { 2612 text: 'FIXED GEAR', 2613 value: '7' 2614 }, { 2615 text: 'BMX', 2616 value: '8' 2617 }, { 2618 text: 'CITY BIKE', 2619 value: '9' 2620 }, { 2621 text: 'LAINNYA', 2622 value: '10' 2623 }], 2624 optionOccupations: [], 2625 optionObjects: [], 2626 optionColors: [], 2627 optionTypes: [], 2628 optionBrands: [], 2629 optionCoverages: [], 2630 // storage 2631 storageForm: "data-bicycle-insurance-form", 2632 storageResponse: "response-bicycle-insurance-form", 2633 storageRequest: "request-bicycle-insurance-form", 2634 storagePage: "data-bicycle-current-page" 2635 }; 2636 }, 2637 mounted: function mounted() { 2638 this.checkProfile(); 2639 this.prepareForm(); 2640 this.getOptionBrands(); 2641 this.getOptionObjects(); 2642 this.getOptionOccupations(); //this.getOptionTypes(); 2643 2644 this.getOptionCoverages(); 2645 }, 2646 methods: { 2647 parsePrice: function parsePrice(val) { 2648 var newVal = String(val).replace(/\s/g, '') // Replace Space 2649 .replace(/\./g, '') // Replace . 2650 .replace(/,/g, '.'); // Replace , to . 2651 2652 return parseFloat(newVal); 2653 }, 2654 formatPrice: function formatPrice(price) { 2655 var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "id"; 2656 return Number(price.toFixed()).toLocaleString(locale); 2657 }, 2658 changePage: function changePage(page) { 2659 this.currentPage = page; 2660 localStorage.setItem("data-bicycle-current-page", page); 2661 }, 2662 submitData: function submitData() { 2663 var _this = this; 2664 2665 var storageForm = "data-bicycle-insurance-form"; 2666 var storageResponse = "response-bicycle-insurance-form"; 2667 2668 if (!this.submitting) { 2669 this.submitting = true; 2670 2671 if (!this.customerProfile.hasOwnProperty("Email") && this.formData.step === 1) { 2672 this.registrationCustomer(); 2673 } 2674 2675 axios.post('/api/bicycle?step=' + this.formData.step, this.formData).then(function (response) { 2676 _this.submitting = false; 2677 var data = response.data.data; 2678 _this.formData = data; 2679 _this.formData.step++; 2680 _this.currentPage++; 2681 localStorage.setItem("data-bicycle-current-page", _this.currentPage); 2682 2683 _this.responseData.push(data.response); 2684 2685 delete _this.formData.response; 2686 localStorage.setItem(storageForm, JSON.stringify(_this.formData)); 2687 localStorage.setItem(storageResponse, JSON.stringify(_this.responseData)); 2688 2689 _this.$toasted.global.message('Success Created!'); 2690 })["catch"](function (error) { 2691 console.log(error); 2692 _this.submitting = false; 2693 2694 if (error.response.data.hasOwnProperty("FeedbackMessage")) { 2695 _this.$toasted.global.error(error.response.data.FeedbackMessage); 2696 } else { 2697 _this.doHandleErrors(error, true); 2698 } 2699 }).then(function () { 2700 _this.submitting = false; 2701 }); 2702 } 2703 }, 2704 processPayment: function processPayment() { 2705 var _this2 = this; 2706 2707 if (!this.submitting) { 2708 var formData = this.formData; 2709 var totalAmount = parseInt(formData.sum_payment_total); 2710 var dataPayment = Object.assign({ 2711 order_id: formData.id_transaction, 2712 gross_amount: totalAmount, 2713 tgl_order: formData.purchase_date, 2714 first_name: formData.first_name, 2715 last_name: formData.last_name, 2716 email: formData.email, 2717 phone: formData.telephone, 2718 address: formData.address, 2719 order_details: [{ 2720 id: formData.id_transaction, 2721 price: totalAmount, 2722 name: "Polis ".concat(formData.business_code, " ").concat(formData.policy_number, " ") 2723 }] 2724 }); 2725 this.submitting = true; 2726 axios.post('/api/payment', dataPayment).then(function (response) { 2727 _this2.submitting = false; 2728 var data = response.data.data; 2729 console.log(response.data, data); 2730 2731 _this2.$toasted.global.message('Halaman dialihkan ke pembayaran!'); 2732 2733 window.location = data.redirect_url; 2734 })["catch"](function (error) { 2735 console.log(error); 2736 _this2.submitting = false; //if (error.response.data.hasOwnProperty("FeedbackMessage")) { 2737 // this.$toasted.global.error(error.response.data.FeedbackMessage); 2738 //} else { 2739 2740 _this2.doHandleErrors(error, true); //} 2741 2742 }).then(function () { 2743 _this2.submitting = false; 2744 }); 2745 } 2746 }, 2747 resetData: function resetData() { 2748 var _this3 = this; 2749 2750 // Toodo Reset Data 2751 Swal.fire({ 2752 title: "Are you sure?", 2753 text: "Once reset, this form will be clear!", 2754 icon: "warning", 2755 showCancelButton: true, 2756 confirmButtonColor: '#d33', 2757 cancelButtonColor: '#3085d6', 2758 confirmButtonText: 'Yes!' 2759 }).then(function (result) { 2760 if (result.value) { 2761 localStorage.removeItem("data-bicycle-insurance-form"); 2762 localStorage.removeItem("response-bicycle-insurance-form"); 2763 _this3.formData = JSON.parse(JSON.stringify(_this3.tempData)); 2764 } 2765 }); 2766 }, 2767 getOptions: function getOptions(option, object) { 2768 var _this4 = this; 2769 2770 var business = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'BICYCLE'; 2771 //if (!this.submitting) { 2772 var storage = "".concat(object, "-").concat(business).toUpperCase(); //this.submitting = true; 2773 2774 axios.get("/api/master-data-live?master=".concat(option, "&business=").concat(business)).then(function (response) { 2775 //this.submitting = false; 2776 localStorage.setItem(storage, JSON.stringify(response.data.data)); 2777 _this4[object] = response.data.data; // this.$toasted.global.message('Success Created!'); 2778 })["catch"](function (error) { 2779 console.log(error); //this.submitting = false; 2780 2781 _this4.doHandleErrors(error, true); 2782 }); //} 2783 }, 2784 getOptionObjects: function getOptionObjects() { 2785 this.getOptions("objek", "optionObjects"); 2786 }, 2787 getOptionCoverages: function getOptionCoverages() { 2788 this.getOptions("jaminan", "optionCoverages"); 2789 }, 2790 getOptionBrands: function getOptionBrands() { 2791 this.getOptions("merk", "optionBrands"); 2792 }, 2793 getOptionTypes: function getOptionTypes(brand, type) { 2794 var _this5 = this; 2795 2796 axios.get("/api/master-data-bicycle-type?brand=".concat(escape(brand), "&type=").concat(escape(type))).then(function (response) { 2797 //this.submitting = false; 2798 _this5.optionTypes = response.data.data; // this.$toasted.global.message('Success Created!'); 2799 2800 loading(false); 2801 })["catch"](function (error) { 2802 loading(false); 2803 console.log(error); //this.submitting = false; 2804 //this.doHandleErrors(error, true); 2805 }); //} 2806 }, 2807 getOptionColors: function getOptionColors(search, loading) { 2808 var _this6 = this; 2809 2810 if (search.length > 2) { 2811 loading(true); 2812 axios.get("/api/master-data-color?color=".concat(escape(search))).then(function (response) { 2813 //this.submitting = false; 2814 _this6.optionColors = response.data.data; // this.$toasted.global.message('Success Created!'); 2815 2816 loading(false); 2817 })["catch"](function (error) { 2818 loading(false); 2819 console.log(error); //this.submitting = false; 2820 //this.doHandleErrors(error, true); 2821 }); //} 2822 } 2823 }, 2824 getOptionOccupations: function getOptionOccupations() { 2825 this.getOptions("okupasi", "optionOccupations"); 2826 }, 2827 copyData: function copyData(data) { 2828 var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Total Payment"; 2829 2830 try { 2831 var el = document.createElement('textarea'); 2832 el.value = data; 2833 el.setAttribute('readonly', ''); 2834 el.style.position = 'absolute'; 2835 el.style.left = '-9999px'; 2836 document.body.appendChild(el); 2837 var selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false; 2838 el.select(); 2839 document.execCommand('copy'); 2840 document.body.removeChild(el); 2841 2842 if (selected) { 2843 document.getSelection().removeAllRanges(); 2844 document.getSelection().addRange(selected); 2845 } 2846 2847 this.$toasted.global.success("Success copy \"".concat(message, "\" : ").concat(data)); 2848 } catch ($e) { 2849 console.log($e); 2850 this.$toasted.global.error("Failed copy \"".concat(message, "\"!")); 2851 } 2852 }, 2853 changeBrand: function changeBrand(val) { 2854 this.getOptionTypes(val, this.formData.bicycle_name); 2855 }, 2856 changeObject: function changeObject(val) { 2857 this.getOptionTypes(this.formData.brand_name, val); 2858 } 2859 }, 2860 watch: { 2861 'formData.tsi': { 2862 handler: function handler(val) { 2863 var price = parseInt(val); 2864 this.isValidPrice = !(price < 1000000 || price > 75000000); 2865 }, 2866 deep: true 2867 } 2868 } 2869}); 2870 2871/***/ }), 2872 2873/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=script&lang=js&": 2874/*!*************************************************************************************************************************************************************************************!*\ 2875 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=script&lang=js& ***! 2876 \*************************************************************************************************************************************************************************************/ 2877/*! exports provided: default */ 2878/***/ (function(module, __webpack_exports__, __webpack_require__) { 2879 2880"use strict"; 2881__webpack_require__.r(__webpack_exports__); 2882/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-cleave-component */ "./node_modules/vue-cleave-component/dist/vue-cleave.min.js"); 2883/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__); 2884/* harmony import */ var _mixins_customers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/customers */ "./resources/js/mixins/customers.js"); 2885/* harmony import */ var _mixins_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/helper */ "./resources/js/mixins/helper.js"); 2886// 2887// 2888// 2889// 2890// 2891// 2892// 2893// 2894// 2895// 2896// 2897// 2898// 2899// 2900// 2901// 2902// 2903// 2904// 2905// 2906// 2907// 2908// 2909// 2910// 2911// 2912// 2913// 2914// 2915// 2916// 2917// 2918// 2919// 2920// 2921// 2922// 2923// 2924// 2925// 2926// 2927// 2928// 2929// 2930// 2931// 2932// 2933// 2934// 2935// 2936// 2937// 2938// 2939// 2940// 2941// 2942// 2943// 2944// 2945// 2946// 2947// 2948// 2949// 2950// 2951// 2952// 2953// 2954// 2955// 2956// 2957// 2958// 2959// 2960// 2961// 2962// 2963// 2964// 2965// 2966// 2967// 2968// 2969// 2970// 2971// 2972// 2973// 2974// 2975// 2976// 2977// 2978// 2979// 2980// 2981// 2982// 2983// 2984// 2985// 2986// 2987// 2988// 2989// 2990// 2991// 2992// 2993// 2994// 2995// 2996// 2997// 2998// 2999// 3000// 3001// 3002// 3003// 3004// 3005// 3006// 3007// 3008// 3009// 3010// 3011// 3012// 3013// 3014// 3015// 3016// 3017// 3018// 3019// 3020// 3021// 3022// 3023// 3024// 3025// 3026// 3027// 3028// 3029// 3030// 3031// 3032// 3033// 3034// 3035// 3036// 3037// 3038// 3039// 3040// 3041// 3042// 3043// 3044// 3045// 3046// 3047// 3048// 3049// 3050// 3051// 3052// 3053// 3054// 3055// 3056// 3057// 3058// 3059// 3060// 3061// 3062// 3063// 3064// 3065// 3066// 3067// 3068// 3069// 3070// 3071// 3072// 3073// 3074// 3075// 3076// 3077// 3078// 3079// 3080// 3081// 3082// 3083// 3084// 3085// 3086// 3087// 3088// 3089// 3090// 3091// 3092// 3093// 3094// 3095// 3096// 3097// 3098// 3099// 3100// 3101// 3102// 3103// 3104// 3105// 3106// 3107// 3108// 3109// 3110// 3111// 3112// 3113// 3114// 3115// 3116// 3117// 3118// 3119// 3120// 3121// 3122// 3123// 3124// 3125// 3126// 3127// 3128// 3129// 3130// 3131// 3132// 3133// 3134// 3135// 3136// 3137// 3138// 3139// 3140// 3141// 3142// 3143// 3144// 3145// 3146// 3147// 3148// 3149// 3150// 3151// 3152// 3153// 3154// 3155// 3156// 3157// 3158// 3159// 3160// 3161// 3162// 3163// 3164// 3165// 3166// 3167// 3168// 3169// 3170// 3171// 3172// 3173// 3174// 3175// 3176// 3177// 3178// 3179// 3180// 3181// 3182// 3183// 3184// 3185// 3186// 3187// 3188// 3189// 3190// 3191// 3192// 3193// 3194// 3195// 3196// 3197// 3198// 3199// 3200// 3201// 3202// 3203// 3204// 3205// 3206// 3207// 3208// 3209// 3210// 3211// 3212// 3213// 3214// 3215// 3216// 3217// 3218// 3219// 3220// 3221// 3222// 3223// 3224// 3225// 3226// 3227// 3228// 3229// 3230// 3231// 3232// 3233// 3234// 3235// 3236// 3237// 3238// 3239// 3240// 3241// 3242// 3243// 3244// 3245// 3246// 3247// 3248// 3249// 3250// 3251// 3252// 3253// 3254// 3255// 3256// 3257// 3258// 3259// 3260// 3261// 3262// 3263// 3264// 3265// 3266// 3267// 3268// 3269// 3270// 3271// 3272// 3273// 3274// 3275// 3276// 3277// 3278// 3279// 3280// 3281// 3282// 3283// 3284// 3285// 3286// 3287// 3288// 3289// 3290// 3291// 3292// 3293// 3294// 3295// 3296// 3297// 3298// 3299// 3300// 3301// 3302// 3303// 3304// 3305// 3306// 3307// 3308// 3309// 3310// 3311// 3312// 3313// 3314// 3315// 3316// 3317// 3318// 3319// 3320// 3321// 3322// 3323// 3324// 3325// 3326// 3327// 3328// 3329// 3330// 3331// 3332// 3333// 3334// 3335// 3336// 3337// 3338// 3339// 3340// 3341// 3342// 3343// 3344// 3345// 3346// 3347// 3348// 3349// 3350// 3351// 3352// 3353// 3354// 3355// 3356 3357 3358 3359var today = new Date(); 3360var startDate = today.toISOString().slice(0, 10); 3361today.setFullYear(today.getFullYear() + 1); 3362var endDate = today.toISOString().slice(0, 10); 3363/* harmony default export */ __webpack_exports__["default"] = ({ 3364 name: "CarInsuranceForm", 3365 mixins: [_mixins_customers__WEBPACK_IMPORTED_MODULE_1__["customers"], _mixins_helper__WEBPACK_IMPORTED_MODULE_2__["helper"]], 3366 components: { 3367 Cleave: vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default.a 3368 }, 3369 props: { 3370 customerType: { 3371 type: String, 3372 "default": 'personal' // 'personal / bisnis 3373 3374 }, 3375 accessCode: { 3376 type: String, 3377 "default": '100000000938' // Kode Akses Khusus Untuk Partner 13 digit. 3378 3379 }, 3380 businessCode: { 3381 type: String, 3382 "default": '10138' 3383 }, 3384 businessName: { 3385 type: String, 3386 "default": 'MBU' // max 50 character 3387 3388 }, 3389 groupPanel: { 3390 type: String, 3391 "default": '007' // Group panel 3 digit. 3392 3393 }, 3394 startDate: { 3395 type: String, 3396 "default": startDate 3397 }, 3398 endDate: { 3399 type: String, 3400 "default": endDate 3401 } 3402 }, 3403 data: function data() { 3404 return { 3405 submitting: false, 3406 errors: [], 3407 currentPage: 1, 3408 isAgreement: false, 3409 formData: { 3410 // config 3411 customer_type: this.customerType, 3412 access_code: this.accessCode, 3413 business_code: this.businessCode, 3414 business_name: this.businessName, 3415 group_panel: this.groupPanel, 3416 //branch_name: this.branchName, 3417 // data. 3418 id: 0, 3419 id_transaction: 'ASM003', 3420 step: 1, 3421 qq_name: '', 3422 the_insured: '', 3423 first_name: '', 3424 last_name: '', 3425 gender: '1', 3426 status: '0', 3427 id_card: '', 3428 npwp: '', 3429 email: '', 3430 address: '', 3431 zip_code: '', 3432 telephone: '', 3433 fax: '', 3434 mobile_phone: '', 3435 hand_phone: '', 3436 office_address: '', 3437 office_zip_code: '', 3438 office_telephone: '', 3439 office_fax: '', 3440 office_mobile_phone: '', 3441 office_hand_phone: '', 3442 office_email: '', 3443 occupation_name: '', 3444 brand_name: '', 3445 type_name: '', 3446 chassis_number: '', 3447 licence_plate: '', 3448 engine_number: '', 3449 car_parking: '', 3450 used_vehicle: '', 3451 manufacture_year: '', 3452 tsi: '', 3453 start_date: this.startDate, 3454 end_date: this.endDate, 3455 type_of_packet: '', 3456 // case_id: '', 3457 policy_number: '', 3458 premium: '', 3459 admin_fee: '', 3460 commission: '', 3461 stamp_receipts: '', 3462 stamp_policy: '', 3463 discount: '', 3464 payment_total: '', 3465 sum_payment_total: '', 3466 pdf: '', 3467 coverage: '', 3468 coverage_year: '1' 3469 }, 3470 customerProfile: {}, 3471 registrationResponse: {}, 3472 responseData: [], 3473 priceOption: { 3474 numeral: true, 3475 numeralDecimalScale: 2, 3476 numeralDecimalMark: ',', 3477 delimiter: '.', 3478 numeralPositiveOnly: true 3479 }, 3480 tempData: {}, 3481 datetimePickerConfig: { 3482 enableTime: true, 3483 time_24hr: true, 3484 enableSeconds: false, 3485 dateFormat: 'Y-m-d', 3486 altInput: true, 3487 altFormat: 'Y-m-d', 3488 locale: null 3489 }, 3490 datePickerConfig: { 3491 dateFormat: 'Y-m-d', 3492 altInput: true, 3493 altFormat: 'Ymd', 3494 locale: null 3495 }, 3496 optionPackets: [{ 3497 text: 'PAKET MOTOR', 3498 value: 'PAKET_MOTOR' 3499 }, { 3500 text: 'PAKET MOBIL EX', 3501 value: 'PAKET_MOBIL_EX' 3502 }, { 3503 text: 'SIMAS MOBIL BULANAN', 3504 value: 'SIMAS_MOBIL_BULANAN' 3505 }], 3506 optionCarParking: [{ 3507 text: 'GARASI TERTUTUP', 3508 value: '1' 3509 }, { 3510 text: 'CAR PORT', 3511 value: '2' 3512 }, { 3513 text: 'POOL', 3514 value: '3' 3515 }, { 3516 text: 'JALAN', 3517 value: '4' 3518 }, { 3519 text: 'LAIN-LAIN', 3520 value: '5' 3521 }], 3522 optionUsedVehicles: [{ 3523 text: 'KENDARAAN BARU / BRAND NEW', 3524 value: '0' 3525 }, { 3526 text: 'KENDARAAN BEKAS / SECOND', 3527 value: '1' 3528 }], 3529 3530 /*optionOccupations: [ 3531 'PRIBADI / DINAS', 3532 'KOMERSIL' 3533 ],*/ 3534 optionOccupations: [], 3535 optionColors: [], 3536 optionTypes: [], 3537 optionBrands: [], 3538 optionCoverages: [], 3539 // storage 3540 storageForm: "data-car-insurance-form", 3541 storageResponse: "response-car-insurance-form", 3542 storageRequest: "request-car-insurance-form", 3543 storagePage: "data-car-current-page" 3544 }; 3545 }, 3546 mounted: function mounted() { 3547 this.checkProfile(); 3548 this.prepareForm(); 3549 this.getOptionCoverages(); 3550 this.getOptionOccupations(); 3551 }, 3552 methods: { 3553 submitData: function submitData() { 3554 var _this = this; 3555 3556 var storageForm = "data-car-insurance-form"; 3557 var storageResponse = "response-car-insurance-form"; 3558 3559 if (!this.submitting) { 3560 this.submitting = true; 3561 3562 if (!this.customerProfile.hasOwnProperty("Email") && this.formData.step === 1) { 3563 this.registrationCustomer(); 3564 } 3565 3566 axios.post('/api/car?step=' + this.formData.step, this.formData).then(function (response) { 3567 _this.submitting = false; 3568 var data = response.data.data; 3569 _this.formData = data; 3570 _this.formData.step++; 3571 _this.currentPage++; 3572 localStorage.setItem("data-car-current-page", _this.currentPage); 3573 3574 _this.responseData.push(data.response); 3575 3576 delete _this.formData.response; 3577 localStorage.setItem(storageForm, JSON.stringify(_this.formData)); 3578 localStorage.setItem(storageResponse, JSON.stringify(_this.responseData)); 3579 3580 _this.$toasted.global.message('Success Created!'); 3581 })["catch"](function (error) { 3582 console.log(error); 3583 _this.submitting = false; 3584 3585 if (error.response.data.hasOwnProperty("FeedbackMessage")) { 3586 _this.$toasted.global.error(error.response.data.FeedbackMessage); 3587 } else { 3588 _this.doHandleErrors(error, true); 3589 } 3590 }).then(function () { 3591 _this.submitting = false; 3592 }); 3593 } 3594 }, 3595 getOptions: function getOptions(option, object) { 3596 var _this2 = this; 3597 3598 var business = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'MBU'; 3599 //if (!this.submitting) { 3600 var type = 'Mobil'; 3601 3602 if (business !== 'MBU') { 3603 type = 'Motor'; 3604 } 3605 3606 var storage = "".concat(object, "-").concat(business).toUpperCase(); //this.submitting = true; 3607 3608 axios.get("/api/master-data-live?master=".concat(option, "&business=").concat(business, "&type=").concat(type, "&brand=").concat(this.formData.brand_name)).then(function (response) { 3609 //this.submitting = false; 3610 localStorage.setItem(storage, JSON.stringify(response.data.data)); 3611 _this2[object] = response.data.data; // this.$toasted.global.message('Success Created!'); 3612 })["catch"](function (error) { 3613 console.log(error); //this.submitting = false; 3614 3615 _this2.doHandleErrors(error, true); 3616 }); //} 3617 }, 3618 getOptionOccupations: function getOptionOccupations() { 3619 this.getOptions("okupasi", "optionOccupations", this.formData.business_name); 3620 }, 3621 getOptionObjects: function getOptionObjects() { 3622 this.getOptions("objek", "optionTypes", this.formData.business_name); 3623 }, 3624 getOptionCoverages: function getOptionCoverages() { 3625 this.getOptions("jaminan", "optionCoverages", this.formData.business_name); 3626 }, 3627 getOptionBrands: function getOptionBrands(search, loading) { 3628 var _this3 = this; 3629 3630 if (search.length > 0) { 3631 loading(true); 3632 axios.get("/api/master-data-car-brand?brand=".concat(escape(search))).then(function (response) { 3633 //this.submitting = false; 3634 _this3.optionBrands = response.data.data; // this.$toasted.global.message('Success Created!'); 3635 3636 loading(false); 3637 })["catch"](function (error) { 3638 loading(false); 3639 console.log(error); //this.submitting = false; 3640 //this.doHandleErrors(error, true); 3641 }); //} 3642 } 3643 }, 3644 getOptionTypes: function getOptionTypes(brand) { 3645 var _this4 = this; 3646 3647 axios.get("/api/master-data-car-type?brand=".concat(escape(brand))).then(function (response) { 3648 //this.submitting = false; 3649 _this4.optionTypes = response.data.data; // this.$toasted.global.message('Success Created!'); 3650 3651 loading(false); 3652 })["catch"](function (error) { 3653 loading(false); 3654 console.log(error); //this.submitting = false; 3655 //this.doHandleErrors(error, true); 3656 }); //} 3657 }, 3658 getOptionColors: function getOptionColors(search, loading) { 3659 var _this5 = this; 3660 3661 if (search.length > 2) { 3662 loading(true); 3663 axios.get("/api/master-data-color?color=".concat(escape(search))).then(function (response) { 3664 //this.submitting = false; 3665 _this5.optionColors = response.data.data; // this.$toasted.global.message('Success Created!'); 3666 3667 loading(false); 3668 })["catch"](function (error) { 3669 loading(false); 3670 console.log(error); //this.submitting = false; 3671 //this.doHandleErrors(error, true); 3672 }); //} 3673 } 3674 }, 3675 changeBrand: function changeBrand(val) { 3676 this.getOptionObjects(); 3677 } 3678 }, 3679 watch: { 3680 'formData.business_name': { 3681 handler: function handler(val, oldVal) { 3682 if (val === 'MOTORCYCLE') { 3683 this.formData.type_of_packet = 'PAKET_MOTOR'; 3684 this.optionPackets = [{ 3685 text: 'PAKET MOTOR', 3686 value: 'PAKET_MOTOR' 3687 }]; 3688 } else { 3689 this.optionPackets = [{ 3690 text: 'PAKET MOBIL EX', 3691 value: 'PAKET_MOBIL_EX' 3692 }, { 3693 text: 'SIMAS MOBIL BULANAN', 3694 value: 'SIMAS_MOBIL_BULANAN' 3695 }]; 3696 } 3697 }, 3698 deep: true 3699 }, 3700 'formData.occupation_name': { 3701 handler: function handler(val) { 3702 if (val === 'KOMERSIL') { 3703 this.formData.occupation_name = ''; 3704 Swal.fire({ 3705 title: "Perhatian!", 3706 text: "Silahkan hubungi tim marketing kami untuk penerbitan kendaraan dengan penggunaan komersil / taxi online, di nomor (021) 23567888 / (021) 50507888 untuk 24 Hours Customer Care atau melalui Whatsapp di 021 8060 0691", 3707 icon: "warning" 3708 }); 3709 } 3710 }, 3711 deep: true 3712 } 3713 } 3714}); 3715 3716/***/ }), 3717 3718/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CheckPolicy.vue?vue&type=script&lang=js&": 3719/*!********************************************************************************************************************************************************************************!*\ 3720 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/CheckPolicy.vue?vue&type=script&lang=js& ***! 3721 \********************************************************************************************************************************************************************************/ 3722/*! exports provided: default */ 3723/***/ (function(module, __webpack_exports__, __webpack_require__) { 3724 3725"use strict"; 3726__webpack_require__.r(__webpack_exports__); 3727// 3728// 3729// 3730// 3731// 3732// 3733// 3734// 3735// 3736// 3737// 3738// 3739// 3740// 3741// 3742// 3743// 3744// 3745// 3746// 3747// 3748// 3749// 3750// 3751// 3752// 3753// 3754// 3755// 3756// 3757// 3758// 3759// 3760// 3761// 3762// 3763// 3764// 3765// 3766// 3767// 3768// 3769// 3770// 3771// 3772// 3773// 3774// 3775// 3776// 3777// 3778// 3779// 3780// 3781// 3782// 3783// 3784// 3785// 3786// 3787// 3788// 3789// 3790// 3791// 3792// 3793// 3794// 3795// 3796// 3797// 3798// 3799// 3800// 3801// 3802// 3803// 3804// 3805// 3806// 3807// 3808// 3809// 3810// 3811// 3812// 3813// 3814// 3815// 3816// 3817// 3818// 3819// 3820// 3821// 3822// 3823// 3824// 3825// 3826// 3827// 3828// 3829// 3830// 3831// 3832// 3833// 3834// 3835// 3836// 3837// 3838// 3839// 3840// 3841// 3842// 3843// 3844/* harmony default export */ __webpack_exports__["default"] = ({ 3845 name: "CheckPolicy", 3846 data: function data() { 3847 return { 3848 errors: {}, 3849 submitting: false, 3850 formData: { 3851 email: '', 3852 no_polis: '', 3853 group_bisnis: '', 3854 jenis_pencarian: '', 3855 opsi: '', 3856 opsi_number: '' 3857 }, 3858 listData: [], 3859 optionSearch: [{ 3860 text: 'Email', 3861 value: 'email' 3862 }, { 3863 text: 'Nomor Polis', 3864 value: 'nopolis' 3865 }], 3866 optionMbu: [{ 3867 text: 'Nomor Plat', 3868 value: 'no_plat' 3869 }, { 3870 text: 'Nomor Mesin', 3871 value: 'no_mesin' 3872 }, { 3873 text: 'Nomor Rangka', 3874 value: 'no_rangka' 3875 }], 3876 optionBusinessGroup: [{ 3877 text: 'Semua', 3878 value: '' 3879 }, { 3880 text: 'Personal Accident', 3881 value: '002' 3882 }, { 3883 text: 'Aneka', 3884 value: '003' 3885 }, { 3886 text: 'Marine', 3887 value: '004' 3888 }, { 3889 text: 'Travel', 3890 value: '005' 3891 }, { 3892 text: 'Fire', 3893 value: '006' 3894 }, { 3895 text: 'MBU/Motor', 3896 value: '007' 3897 }, { 3898 text: 'Satelit', 3899 value: '008' 3900 }] 3901 }; 3902 }, 3903 methods: { 3904 checkPolicy: function checkPolicy() { 3905 var _this = this; 3906 3907 if (!this.submitting) { 3908 this.submitting = true; 3909 axios.post('/api/check-policy', this.formData).then(function (response) { 3910 _this.$toasted.global.message('Berhasil Mandapatkan Data Polis!'); 3911 3912 _this.listData = response.data.data; 3913 console.log(response.data); 3914 _this.submitting = false; 3915 })["catch"](function (error) { 3916 _this.doHandleErrors(error, true); 3917 }).then(function () { 3918 _this.submitting = false; 3919 }); 3920 } 3921 } 3922 }, 3923 computed: { 3924 mbuLabel: function mbuLabel() { 3925 return this.formData.opsi.replaceAll("_", " ").toLocaleLowerCase(); 3926 } 3927 } 3928}); 3929 3930/***/ }), 3931 3932/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=script&lang=js&": 3933/*!*******************************************************************************************************************************************************************************************!*\ 3934 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=script&lang=js& ***! 3935 \*******************************************************************************************************************************************************************************************/ 3936/*! exports provided: default */ 3937/***/ (function(module, __webpack_exports__, __webpack_require__) { 3938 3939"use strict"; 3940__webpack_require__.r(__webpack_exports__); 3941/* harmony import */ var vue2_dropzone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue2-dropzone */ "./node_modules/vue2-dropzone/dist/vue2Dropzone.js"); 3942/* harmony import */ var vue2_dropzone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue2_dropzone__WEBPACK_IMPORTED_MODULE_0__); 3943/* harmony import */ var vue2_dropzone_dist_vue2Dropzone_min_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue2-dropzone/dist/vue2Dropzone.min.css */ "./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css"); 3944/* harmony import */ var vue2_dropzone_dist_vue2Dropzone_min_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue2_dropzone_dist_vue2Dropzone_min_css__WEBPACK_IMPORTED_MODULE_1__); 3945/* harmony import */ var vue_trumbowyg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-trumbowyg */ "./node_modules/vue-trumbowyg/dist/vue-trumbowyg.min.js"); 3946/* harmony import */ var vue_trumbowyg__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue_trumbowyg__WEBPACK_IMPORTED_MODULE_2__); 3947// 3948// 3949// 3950// 3951// 3952// 3953// 3954// 3955// 3956// 3957// 3958// 3959// 3960// 3961// 3962// 3963// 3964// 3965// 3966// 3967// 3968// 3969// 3970// 3971// 3972// 3973// 3974// 3975// 3976// 3977// 3978// 3979// 3980// 3981// 3982// 3983// 3984// 3985// 3986// 3987// 3988// 3989// 3990// 3991// 3992// 3993// 3994// 3995// 3996// 3997// 3998// 3999// 4000// 4001// 4002// 4003// 4004// 4005// 4006// 4007// 4008// 4009// 4010// 4011// 4012// 4013// 4014// 4015// 4016// 4017// 4018// 4019// 4020// 4021// 4022// 4023// 4024// 4025// 4026// 4027// 4028// 4029// 4030// 4031// 4032// 4033// 4034// 4035// 4036// 4037// 4038// 4039// 4040// 4041// 4042// 4043// 4044// 4045// 4046// 4047// 4048// 4049// 4050// 4051// 4052// 4053// 4054// 4055// 4056// 4057// 4058// 4059// 4060// 4061// 4062// 4063// 4064// 4065// 4066// 4067// 4068// 4069// 4070// 4071// 4072// 4073// 4074// 4075// 4076// 4077// 4078// 4079// 4080// 4081// 4082// 4083// 4084// 4085// 4086// 4087// 4088// 4089// 4090// 4091// 4092// 4093// 4094// 4095// 4096// 4097// 4098// 4099// 4100// 4101// 4102// 4103// 4104// 4105// 4106// 4107// 4108// 4109// 4110// 4111// 4112// 4113// 4114// 4115// 4116// 4117// 4118// 4119// 4120// 4121// 4122// 4123// 4124// 4125// 4126// 4127// 4128// 4129// 4130// 4131// 4132// 4133// 4134// 4135// 4136// 4137// 4138// 4139// 4140// 4141// 4142// 4143// 4144// 4145// 4146// 4147// 4148// 4149// 4150// 4151// 4152// 4153// 4154// 4155// 4156// 4157// 4158// 4159// 4160// 4161// 4162// 4163// 4164// 4165// 4166// 4167// 4168// 4169// 4170// 4171// 4172// 4173// 4174// 4175// 4176// 4177// 4178// 4179// 4180// 4181// 4182// 4183// 4184// 4185// 4186// 4187// 4188// 4189// 4190// 4191// 4192// 4193// 4194// 4195// 4196// 4197// 4198// 4199// 4200// 4201// 4202// 4203// 4204// 4205// 4206// 4207// 4208// 4209// 4210// 4211// 4212// 4213// 4214// 4215// 4216// 4217// 4218// 4219// 4220// 4221// 4222// 4223// 4224// 4225// 4226// 4227// 4228// 4229// 4230// 4231// 4232// 4233// 4234// 4235// 4236// 4237// 4238// 4239// 4240// 4241// 4242// 4243// 4244// 4245// 4246// 4247// 4248// 4249// 4250// 4251// 4252// 4253// 4254// 4255// 4256// 4257// 4258// 4259// 4260// 4261// 4262// 4263// 4264// 4265// 4266// 4267// 4268// 4269// 4270// 4271// 4272// 4273// 4274// 4275// 4276// 4277// 4278// 4279// 4280// 4281// 4282// 4283// 4284// 4285// 4286// 4287// 4288// 4289// 4290// 4291// 4292// 4293// 4294// 4295// 4296// 4297// 4298// 4299// 4300// 4301// 4302// 4303// 4304// 4305// 4306// 4307// 4308// 4309// 4310// 4311// 4312// 4313// 4314// 4315// 4316// 4317// 4318// 4319// 4320// 4321// 4322// 4323// 4324// 4325// 4326// 4327// 4328// 4329// 4330// 4331// 4332// 4333// 4334// 4335// 4336// 4337// 4338// 4339// 4340// 4341 4342 4343 4344var config = { 4345 headers: { 4346 "content-type": "multipart/form-data" 4347 } 4348}; 4349/* harmony default export */ __webpack_exports__["default"] = ({ 4350 name: "ClaimHospitalInsurance", 4351 components: { 4352 vueDropzone: vue2_dropzone__WEBPACK_IMPORTED_MODULE_0___default.a 4353 }, 4354 data: function data() { 4355 return { 4356 errors: {}, 4357 submitting: false, 4358 loadingProvinces: false, 4359 loadingHospital: false, 4360 listDataHospital: [], 4361 formData: { 4362 no_polis: '', 4363 no_reg: '', 4364 no_kartu: '', 4365 nama_tertanggung: '', 4366 tanggal_lahir: '', 4367 participant_id: '', 4368 ivr_code: '', 4369 id_rumah_sakit: '', 4370 nama_rumah_sakit: '', 4371 alamat_rumah_sakit: '', 4372 tanggal_kejadian: '', 4373 tanggal_keluar: '', 4374 layanan: '', 4375 total_klaim: '', 4376 // plan klaim 4377 plan_program_id: '', 4378 plan_id: '', 4379 plan_coverage: '', 4380 plan_coverage_note: '', 4381 plan_name: '', 4382 plan_benefit: [], 4383 kode_diagnosis: '', 4384 diagnosis: '', 4385 documents: [{ 4386 file: '', 4387 description: '' 4388 }, { 4389 file: '', 4390 description: '' 4391 }], 4392 claim_ref: '' 4393 }, 4394 maxDocument: 5, 4395 storage: { 4396 data: 'data-hospital', 4397 filter: 'filter-hospital' 4398 }, 4399 filters: { 4400 province: '09', 4401 // Default DKI JAKARTA 4402 hospitalId: '', 4403 hospital: '', 4404 partnerType: '', 4405 country: '' 4406 }, 4407 media: [], 4408 dataPolicies: [], 4409 isValidPolicy: false, 4410 isHasBenefit: false, 4411 dataBenefit: [], 4412 step: 1, 4413 optionProvinces: [], 4414 optionHospital: [], 4415 optionClaimType: [{ 4416 text: 'Kerusakan sebagian', 4417 value: 'JKM1' 4418 }, { 4419 text: 'Kehilangan kendaraan', 4420 value: 'JKM2' 4421 }], 4422 optionTjh: [{ 4423 text: 'Tidak Ada', 4424 value: '0' 4425 }, { 4426 text: 'Ada', 4427 value: '1' 4428 }], 4429 4430 /*optionServices: [ 4431 'INPATIENT', 4432 'OUTPATIENT', 4433 'MATERNITY', 4434 'DENTAL', 4435 'GLASSES', 4436 'SPECIAL CARE', 4437 ],*/ 4438 optionServices: [], 4439 optionCity: [], 4440 optionWorkshopName: [], 4441 datetimePickerConfig: { 4442 enableTime: true, 4443 time_24hr: true, 4444 enableSeconds: false, 4445 dateFormat: 'Y-m-d H:i:S', 4446 altInput: true, 4447 altFormat: 'd/m/Y H:i:S', 4448 locale: null 4449 }, 4450 datePickerConfig: { 4451 enableTime: false, 4452 dateFormat: 'Y-m-d', 4453 altInput: true, 4454 altFormat: 'd/m/Y', 4455 locale: null 4456 }, 4457 configMedia: { 4458 url: '/customer/claim/hospital/prepare-media', 4459 addRemoveLinks: true 4460 /* paramName: 'files', 4461 parallelUploads: 1, 4462 maxFilesize: { 4463 limit: 3, 4464 message: 'The size image is {{filesize}}MB is greater than the {{maxFilesize}}MB' 4465 }, 4466 acceptedFiles: { 4467 extensions: ['image/!*', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'], 4468 message: 'You are uploading an invalid file' 4469 }, 4470 thumbnailWidth: 200,*/ 4471 4472 } 4473 }; 4474 }, 4475 methods: { 4476 checkPolicy: function checkPolicy() { 4477 var _this = this; 4478 4479 if (!this.submitting) { 4480 this.submitting = true; 4481 var formData = this.formData; 4482 axios.post('/customer/claim/hospital/validate', { 4483 no_polis: formData.no_polis, 4484 no_reg: formData.no_reg, 4485 no_kartu: formData.no_kartu, 4486 tanggal_lahir: formData.tanggal_lahir, 4487 nama: formData.nama_tertanggung 4488 }).then(function (response) { 4489 _this.$toasted.global.message('Berhasil Mandapatkan Data Polis!'); 4490 4491 console.log(response.data); 4492 _this.dataPolicies = response.data.data; 4493 _this.isValidPolicy = _this.dataPolicies.length > 0; 4494 4495 _this.prepareServicesOption(_this.dataPolicies); 4496 4497 _this.step++; 4498 _this.submitting = false; 4499 })["catch"](function (error) { 4500 _this.doHandleErrors(error, true); 4501 }).then(function () { 4502 _this.submitting = false; 4503 }); 4504 } 4505 }, 4506 selectProfile: function selectProfile(idx, profile) { 4507 console.log(idx, profile); 4508 this.step++; 4509 this.formData.nama_tertanggung = profile.participant_name; 4510 this.formData.no_reg = profile.reg_no; 4511 this.formData.no_polis = profile.policy_no; 4512 this.formData.no_kartu = profile.card_no; 4513 this.formData.participant_id = profile.participant_id; 4514 this.formData.ivr_code = profile.ivr_code; //this.formData.tanggal_lahir = profile.date_of_birth_text 4515 4516 this.getOptionProvinces(); 4517 this.getDataHospital(); 4518 }, 4519 selectHospital: function selectHospital(hospital) { 4520 console.log(hospital); 4521 this.formData.id_rumah_sakit = hospital.HospitalID; 4522 this.formData.nama_rumah_sakit = hospital.HospitalName; 4523 this.formData.alamat_rumah_sakit = hospital.HospitalAddress; 4524 }, 4525 selectBenefit: function selectBenefit(idx, benefit) { 4526 this.formData.plan_benefit.push({ 4527 benefit_id: benefit.benefit_id, 4528 benefit_idsm: benefit.benefit_idsm, 4529 limit_benefit: parseInt(benefit.limit_benefit), 4530 proposed: benefit.proposed 4531 }); 4532 }, 4533 getOptionProvinces: function getOptionProvinces() { 4534 var _this2 = this; 4535 4536 if (!this.loadingProvinces) { 4537 this.loadingProvinces = true; 4538 axios.get("/api/hospital/provinces").then(function (response) { 4539 _this2.loadingProvinces = false; 4540 console.log(response.data); 4541 _this2.optionProvinces = response.data; 4542 4543 _this2.optionProvinces.unshift({ 4544 text: '-- Pilih Wilayah --', 4545 value: '' 4546 }); 4547 })["catch"](function (error) { 4548 _this2.loadingProvinces = false; 4549 4550 _this2.doHandleErrors(error, true); 4551 }).then(function () { 4552 _this2.loadingProvinces = false; 4553 }); 4554 } 4555 }, 4556 getDataHospital: function getDataHospital() { 4557 var _this3 = this; 4558 4559 var storage = "".concat(this.storage.data, "-").concat(this.filters.province); 4560 var params = { 4561 hospital: this.filters.hospital, 4562 province_id: this.filters.province, 4563 country: this.filters.country, 4564 country_type: 1, 4565 //this.isMainCountry ? '1' : '2', 4566 partner_type: '' //this.filters.partnerType 4567 4568 }; 4569 4570 if (!this.loadingHospital) { 4571 this.loadingHospital = true; 4572 axios.post('/api/hospital', params).then(function (response) { 4573 _this3.loadingHospital = false; 4574 console.log(response.data); 4575 _this3.listDataHospital = response.data.data; 4576 localStorage.setItem(storage, JSON.stringify(_this3.listDataHospital)); //this.$toasted.global.message('Success Created!'); 4577 })["catch"](function (error) { 4578 _this3.loadingHospital = false; 4579 4580 _this3.doHandleErrors(error, true); 4581 }).then(function () { 4582 _this3.loadingHospital = false; 4583 }); 4584 } 4585 }, 4586 checkBenefit: function checkBenefit() { 4587 var _this4 = this; 4588 4589 if (!this.submitting) { 4590 this.submitting = true; 4591 axios.post('/customer/claim/hospital/benefit', this.formData).then(function (response) { 4592 _this4.$toasted.global.message('Berhasil Mandapatkan Data Benefit!'); 4593 4594 var resData = response.data.data; 4595 console.log(response.data); //this.isHasBenefit = resData.hasOwnProperty("HasBenefitsATPM") && resData.HasBenefitsATPM === '1'; 4596 4597 if (resData.hasOwnProperty("sv_person_list") && resData.sv_person_list.length > 0 && resData.sv_person_list[0].sv_plan_list.length > 0) { 4598 _this4.isHasBenefit = true; 4599 var benefit = resData.sv_person_list[0].sv_plan_list[0]; 4600 _this4.dataBenefit = benefit; 4601 _this4.formData.plan_program_id = benefit.program_id; 4602 _this4.formData.plan_id = benefit.plan_id; 4603 _this4.formData.plan_coverage = benefit.coverage; 4604 _this4.formData.plan_coverage_note = benefit.coverage_note; 4605 _this4.formData.plan_name = benefit.plan_name; 4606 } 4607 4608 _this4.submitting = false; 4609 })["catch"](function (error) { 4610 _this4.doHandleErrors(error, true); 4611 }).then(function () { 4612 _this4.submitting = false; 4613 }); 4614 } 4615 }, 4616 prepareForm: function prepareForm() { 4617 var step = this.step; 4618 4619 if (step === 3) { 4620 this.checkBenefit(); 4621 } 4622 4623 this.step++; 4624 }, 4625 getOptionCity: function getOptionCity() { 4626 var _this5 = this; 4627 4628 if (!this.loadingCity) { 4629 this.loadingCity = true; 4630 axios.post('/customer/claim/hospital/city', { 4631 has_benefit: this.isHasBenefit ? 1 : 0 4632 }).then(function (response) { 4633 _this5.$toasted.global.message('Berhasil ambil data kota!'); 4634 4635 console.log(response.data); 4636 _this5.optionCity = response.data.data; 4637 _this5.loadingCity = false; 4638 })["catch"](function (error) { 4639 _this5.doHandleErrors(error, true); 4640 }).then(function () { 4641 _this5.loadingCity = false; 4642 }); 4643 } 4644 }, 4645 claimInsurance: function claimInsurance() { 4646 var _this6 = this; 4647 4648 this.formData.plan_benefit = []; 4649 this.dataBenefit.sv_benefit_list.forEach(function (benefit) { 4650 var proposed = parseInt(benefit.proposed); 4651 4652 if (!isNaN(proposed) && proposed > 0) { 4653 _this6.formData.plan_benefit.push({ 4654 BenefitID: benefit.benefit_id, 4655 BenefitIDSM: benefit.benefit_idsm, 4656 LimitBenefit: parseInt(benefit.limit_benefit), 4657 Proposed: benefit.proposed 4658 }); 4659 } 4660 }); 4661 4662 if (!this.submitting) { 4663 this.submitting = true; 4664 axios.post('/customer/claim/hospital', this.formData).then(function (response) { 4665 _this6.$toasted.global.message('Berhasil Klaim Polis!'); 4666 4667 console.log("Berhasil Klaim Polis", response.data); 4668 var claim = response.data.data; 4669 _this6.formData.claim_ref = claim.data_progress.claim_ref; 4670 _this6.submitting = false; 4671 _this6.step++; 4672 })["catch"](function (error) { 4673 _this6.doHandleErrors(error, true); 4674 }).then(function () { 4675 _this6.submitting = false; 4676 }); 4677 } 4678 }, 4679 uploadMedia: function uploadMedia() { 4680 var _this7 = this; 4681 4682 if (!this.submitting) { 4683 this.submitting = true; 4684 axios.post('/customer/claim/hospital/media', this.formData).then(function (response) { 4685 _this7.$toasted.global.message('Berhasil Upload Media!'); 4686 4687 console.log(response.data); 4688 _this7.submitting = false; 4689 _this7.step++; 4690 })["catch"](function (error) { 4691 _this7.doHandleErrors(error, true); 4692 }).then(function () { 4693 _this7.submitting = false; 4694 }); 4695 } 4696 }, 4697 4698 /*syncConfigMedia() { 4699 this.$refs.mediaKtp.setOption('url', this.path.apiUploadMedia); 4700 this.$refs.mediaSim.setOption('url', this.path.apiUploadMedia); 4701 },*/ 4702 sendingMedia: function sendingMedia(file, xhr, formData) { 4703 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); //formData.append('category', 'KTP'); 4704 }, 4705 successMedia: function successMedia(file, response) { 4706 var _this8 = this; 4707 4708 this.$toasted.global.message("Berhasil Upload Foto!"); 4709 console.log(response); 4710 var doc = response.data; 4711 /*if (response.hasOwnProperty('media')) { 4712 this.media.push(response.data); 4713 }*/ 4714 4715 this.formData.documents.forEach(function (item, idx) { 4716 if (item.file === '') { 4717 _this8.formData.documents[idx].file = doc.base64; 4718 _this8.formData.documents[idx].name = doc.name; 4719 _this8.formData.documents[idx].ext = doc.ext; 4720 } 4721 }); 4722 console.log(file, response); 4723 Object.keys(this.$refs).forEach(function (el) { 4724 console.log(_this8.$refs[el][0]); 4725 }); 4726 }, 4727 errorMedia: function errorMedia(file, response, xhr) { 4728 console.log(file, response, xhr); 4729 var message = ''; 4730 4731 if (response.hasOwnProperty('message')) { 4732 message = response.message; 4733 } else { 4734 message = JSON.stringify(response); 4735 } 4736 4737 this.$toasted.global.error("Gagal Upload Media! (".concat(message, ")")); 4738 }, 4739 prepareServicesOption: function prepareServicesOption(dataPolicies) { 4740 var tmpUniqueOptions = []; 4741 var serviceOptions = []; 4742 dataPolicies.forEach(function (policy) { 4743 policy.sv_plan_list.forEach(function (plan) { 4744 if (!tmpUniqueOptions.includes(plan.CoverageNote)) { 4745 tmpUniqueOptions.push(plan.CoverageNote); 4746 serviceOptions.push({ 4747 value: plan.CoverageNote, 4748 text: plan.CoverageNoteInd 4749 }); 4750 } 4751 }); 4752 }); 4753 this.optionServices = serviceOptions; 4754 }, 4755 numberFormat: function numberFormat(number, decimals, dec_point, thousands_sep) { 4756 // Strip all characters but numerical ones. 4757 number = (number + '').replace(/[^0-9+\-Ee.]/g, ''); 4758 4759 var n = !isFinite(+number) ? 0 : +number, 4760 prec = !isFinite(+decimals) ? 0 : Math.abs(decimals), 4761 sep = typeof thousands_sep === 'undefined' ? ',' : thousands_sep, 4762 dec = typeof dec_point === 'undefined' ? '.' : dec_point, 4763 s = '', 4764 toFixedFix = function toFixedFix(n, prec) { 4765 var k = Math.pow(10, prec); 4766 return '' + Math.round(n * k) / k; 4767 }; // Fix for IE parseFloat(0.55).toFixed(0) = 0; 4768 4769 4770 s = (prec ? toFixedFix(n, prec) : '' + Math.round(n)).split('.'); 4771 4772 if (s[0].length > 3) { 4773 s[0] = s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g, sep); 4774 } 4775 4776 if ((s[1] || '').length < prec) { 4777 s[1] = s[1] || ''; 4778 s[1] += new Array(prec - s[1].length + 1).join('0'); 4779 } 4780 4781 return s.join(dec); 4782 } 4783 /* selectedCity(optionSelected) { 4784 console.log(optionSelected); 4785 this.formData.kota_bengkel = optionSelected.text; 4786 this.getOptionWorkshop() 4787 }, 4788 getOptionWorkshop() { 4789 if (!this.loadingWorkshop) { 4790 this.loadingWorkshop = true; 4791 axios.post('/customer/claim/hospital/workshop', { 4792 city_id: this.formData.kota_bengkel_id 4793 }) 4794 .then(response => { 4795 this.$toasted.global.message('Berhasil ambil data workshop!'); 4796 console.log(response.data); 4797 this.optionWorkshopName = response.data.data; 4798 this.loadingWorkshop = false 4799 }) 4800 .catch(error => { 4801 this.doHandleErrors(error, true); 4802 }) 4803 .then(() => { 4804 this.loadingWorkshop = false 4805 }) 4806 } 4807 }*/ 4808 4809 }, 4810 mounted: function mounted() {//this.getDataHospital(); 4811 }, 4812 computed: { 4813 totalClaim: function totalClaim() { 4814 var totalClaim = 0; 4815 this.dataBenefit.sv_benefit_list.forEach(function (i) { 4816 var total = parseInt(i.proposed); 4817 4818 if (!isNaN(total)) { 4819 totalClaim += total; 4820 } 4821 }); 4822 4823 if (this.formData.layanan === 'OUTPATIENT') { 4824 this.formData.total_klaim = totalClaim; 4825 } 4826 4827 return totalClaim; 4828 } 4829 } 4830}); 4831 4832/***/ }), 4833 4834/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=script&lang=js&": 4835/*!**************************************************************************************************************************************************************************************!*\ 4836 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=script&lang=js& ***! 4837 \**************************************************************************************************************************************************************************************/ 4838/*! exports provided: default */ 4839/***/ (function(module, __webpack_exports__, __webpack_require__) { 4840 4841"use strict"; 4842__webpack_require__.r(__webpack_exports__); 4843/* harmony import */ var vue2_dropzone__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue2-dropzone */ "./node_modules/vue2-dropzone/dist/vue2Dropzone.js"); 4844/* harmony import */ var vue2_dropzone__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue2_dropzone__WEBPACK_IMPORTED_MODULE_0__); 4845/* harmony import */ var vue2_dropzone_dist_vue2Dropzone_min_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue2-dropzone/dist/vue2Dropzone.min.css */ "./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css"); 4846/* harmony import */ var vue2_dropzone_dist_vue2Dropzone_min_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(vue2_dropzone_dist_vue2Dropzone_min_css__WEBPACK_IMPORTED_MODULE_1__); 4847/* harmony import */ var vue_trumbowyg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-trumbowyg */ "./node_modules/vue-trumbowyg/dist/vue-trumbowyg.min.js"); 4848/* harmony import */ var vue_trumbowyg__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue_trumbowyg__WEBPACK_IMPORTED_MODULE_2__); 4849// 4850// 4851// 4852// 4853// 4854// 4855// 4856// 4857// 4858// 4859// 4860// 4861// 4862// 4863// 4864// 4865// 4866// 4867// 4868// 4869// 4870// 4871// 4872// 4873// 4874// 4875// 4876// 4877// 4878// 4879// 4880// 4881// 4882// 4883// 4884// 4885// 4886// 4887// 4888// 4889// 4890// 4891// 4892// 4893// 4894// 4895// 4896// 4897// 4898// 4899// 4900// 4901// 4902// 4903// 4904// 4905// 4906// 4907// 4908// 4909// 4910// 4911// 4912// 4913// 4914// 4915// 4916// 4917// 4918// 4919// 4920// 4921// 4922// 4923// 4924// 4925// 4926// 4927// 4928// 4929// 4930// 4931// 4932// 4933// 4934// 4935// 4936// 4937// 4938// 4939// 4940// 4941// 4942// 4943// 4944// 4945// 4946// 4947// 4948// 4949// 4950// 4951// 4952// 4953// 4954// 4955// 4956// 4957// 4958// 4959// 4960// 4961// 4962// 4963// 4964// 4965// 4966// 4967// 4968// 4969// 4970// 4971// 4972// 4973// 4974// 4975// 4976// 4977// 4978// 4979// 4980// 4981// 4982// 4983// 4984// 4985// 4986// 4987// 4988// 4989// 4990// 4991// 4992// 4993// 4994// 4995// 4996// 4997// 4998// 4999// 5000// 5001// 5002// 5003// 5004// 5005// 5006// 5007// 5008// 5009// 5010// 5011// 5012// 5013// 5014// 5015// 5016// 5017// 5018// 5019// 5020// 5021// 5022// 5023// 5024// 5025// 5026// 5027// 5028// 5029// 5030// 5031// 5032// 5033// 5034// 5035// 5036// 5037// 5038// 5039// 5040// 5041// 5042// 5043// 5044// 5045// 5046// 5047// 5048// 5049// 5050// 5051// 5052// 5053// 5054// 5055// 5056// 5057// 5058// 5059// 5060// 5061// 5062// 5063// 5064// 5065// 5066// 5067// 5068// 5069// 5070// 5071// 5072// 5073// 5074// 5075// 5076// 5077// 5078// 5079// 5080// 5081// 5082// 5083// 5084// 5085// 5086// 5087// 5088// 5089// 5090// 5091// 5092// 5093// 5094// 5095// 5096// 5097// 5098// 5099// 5100// 5101// 5102// 5103// 5104// 5105// 5106// 5107// 5108// 5109// 5110// 5111// 5112// 5113// 5114// 5115// 5116// 5117// 5118// 5119// 5120// 5121// 5122// 5123// 5124// 5125// 5126// 5127// 5128// 5129// 5130// 5131// 5132// 5133// 5134// 5135// 5136// 5137// 5138// 5139// 5140// 5141// 5142// 5143// 5144// 5145// 5146// 5147// 5148// 5149// 5150// 5151// 5152// 5153// 5154// 5155// 5156// 5157// 5158// 5159// 5160// 5161// 5162// 5163// 5164// 5165// 5166// 5167// 5168// 5169// 5170 5171 5172 5173var config = { 5174 headers: { 5175 "content-type": "multipart/form-data" 5176 } 5177}; 5178/* harmony default export */ __webpack_exports__["default"] = ({ 5179 name: "ClaimMbuInsurance", 5180 components: { 5181 vueDropzone: vue2_dropzone__WEBPACK_IMPORTED_MODULE_0___default.a 5182 }, 5183 data: function data() { 5184 return { 5185 errors: {}, 5186 submitting: false, 5187 loadingCity: false, 5188 loadingWorkshop: false, 5189 formData: { 5190 no_polis: '', 5191 no_plat: '', 5192 no_rangka: '', 5193 no_mesin: '', 5194 waktu_kejadian: '', 5195 jenis_kejadian: '', 5196 jenis_klaim: '', 5197 lokasi_kejadian: '', 5198 tjh: 0, 5199 kronologi: '', 5200 no_hp: '', 5201 email: '', 5202 no_ktp: '', 5203 alamat: '', 5204 nama_tertanggung: '', 5205 param_key: '', 5206 kota_bengkel: '', 5207 kota_bengkel_id: '', 5208 nama_bengkel: '' 5209 }, 5210 media: [], 5211 dataPolicy: {}, 5212 isValidPolicy: false, 5213 isHasATPM: false, 5214 step: 1, 5215 optionIncident: [], 5216 optionClaimType: [{ 5217 text: 'Kerusakan sebagian', 5218 value: 'JKM1' 5219 }, { 5220 text: 'Kehilangan kendaraan', 5221 value: 'JKM2' 5222 }], 5223 optionTjh: [{ 5224 text: 'Tidak Ada', 5225 value: '0' 5226 }, { 5227 text: 'Ada', 5228 value: '1' 5229 }], 5230 optionCity: [], 5231 optionWorkshopName: [], 5232 datetimePickerConfig: { 5233 enableTime: true, 5234 time_24hr: true, 5235 enableSeconds: false, 5236 dateFormat: 'Y-m-d H:i:S', 5237 altInput: true, 5238 altFormat: 'd/m/Y H:i:S', 5239 locale: null 5240 }, 5241 configMedia: { 5242 url: '/customer/claim/mbu/media', 5243 addRemoveLinks: true 5244 /* paramName: 'files', 5245 parallelUploads: 1, 5246 maxFilesize: { 5247 limit: 3, 5248 message: 'The size image is {{filesize}}MB is greater than the {{maxFilesize}}MB' 5249 }, 5250 acceptedFiles: { 5251 extensions: ['image/!*', 'application/pdf', 'application/vnd.ms-excel', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'application/msword', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'], 5252 message: 'You are uploading an invalid file' 5253 }, 5254 thumbnailWidth: 200,*/ 5255 5256 } 5257 }; 5258 }, 5259 methods: { 5260 checkPolicy: function checkPolicy() { 5261 var _this = this; 5262 5263 if (!this.submitting) { 5264 this.submitting = true; 5265 var formData = this.formData; 5266 axios.post('/customer/claim/mbu/validate', { 5267 no_polis: formData.no_polis, 5268 no_plat: formData.no_plat, 5269 no_rangka: formData.no_rangka, 5270 no_mesin: formData.no_mesin, 5271 waktu_kejadian: formData.waktu_kejadian 5272 }).then(function (response) { 5273 _this.$toasted.global.message('Berhasil Mandapatkan Data Polis!'); 5274 5275 console.log(response.data); 5276 var dataPolicy = response.data.data; 5277 _this.dataPolicy = dataPolicy; 5278 _this.formData.nama_tertanggung = dataPolicy.TheInsured; 5279 5280 if (dataPolicy.CIFData.AddressList.length > 0) {//this.formData.no_hp = dataPolicy.TheInsured; 5281 } 5282 5283 _this.isValidPolicy = true; 5284 _this.step++; 5285 _this.submitting = false; 5286 5287 _this.checkBenefitATPM(); 5288 })["catch"](function (error) { 5289 _this.doHandleErrors(error, true); 5290 }).then(function () { 5291 _this.submitting = false; 5292 }); 5293 } 5294 }, 5295 checkBenefitATPM: function checkBenefitATPM() { 5296 var _this2 = this; 5297 5298 if (!this.submitting) { 5299 this.submitting = true; 5300 var formData = this.formData; 5301 axios.post('/customer/claim/mbu/benefit', { 5302 no_polis: formData.no_polis, 5303 no_rangka: formData.no_rangka, 5304 no_mesin: formData.no_mesin, 5305 waktu_kejadian: formData.waktu_kejadian 5306 }).then(function (response) { 5307 _this2.$toasted.global.message('Berhasil Mandapatkan Data ATPM!'); 5308 5309 var resData = response.data.data; 5310 console.log(response.data); 5311 _this2.isHasATPM = resData.hasOwnProperty("HasBenefitsATPM") && resData.HasBenefitsATPM === '1'; 5312 _this2.submitting = false; 5313 })["catch"](function (error) { 5314 _this2.doHandleErrors(error, true); 5315 }).then(function () { 5316 _this2.submitting = false; 5317 }); 5318 } 5319 }, 5320 prepareForm: function prepareForm() { 5321 var step = this.step; 5322 5323 if (step === 3) { 5324 this.getOptionCity(); 5325 } 5326 5327 this.step++; 5328 }, 5329 getOptionCity: function getOptionCity() { 5330 var _this3 = this; 5331 5332 if (!this.loadingCity) { 5333 this.loadingCity = true; 5334 axios.post('/customer/claim/mbu/city', { 5335 has_benefit: this.isHasATPM ? 1 : 0 5336 }).then(function (response) { 5337 _this3.$toasted.global.message('Berhasil ambil data kota!'); 5338 5339 console.log(response.data); 5340 _this3.optionCity = response.data.data; 5341 _this3.loadingCity = false; 5342 })["catch"](function (error) { 5343 _this3.doHandleErrors(error, true); 5344 }).then(function () { 5345 _this3.loadingCity = false; 5346 }); 5347 } 5348 }, 5349 claimInsurance: function claimInsurance() { 5350 var _this4 = this; 5351 5352 if (!this.submitting) { 5353 this.submitting = true; 5354 axios.post('/customer/claim/mbu', this.formData).then(function (response) { 5355 _this4.$toasted.global.message('Berhasil Klaim Polis!'); 5356 5357 console.log(response.data); 5358 _this4.submitting = false; 5359 _this4.step++; 5360 })["catch"](function (error) { 5361 _this4.doHandleErrors(error, true); 5362 }).then(function () { 5363 _this4.submitting = false; 5364 }); 5365 } 5366 }, 5367 getDataIncident: function getDataIncident() { 5368 var _this5 = this; 5369 5370 axios.get('/customer/claim/mbu/incident').then(function (response) { 5371 _this5.$toasted.global.message('Berhasil Mandapatkan Data Kejadian!'); 5372 5373 _this5.optionIncident = response.data.data; 5374 console.log(response.data); 5375 })["catch"](function (error) { 5376 _this5.doHandleErrors(error, true); 5377 }); 5378 }, 5379 getParamKey: function getParamKey() { 5380 var _this6 = this; 5381 5382 axios.get('/customer/claim/mbu/parameters').then(function (response) { 5383 _this6.$toasted.global.message('Berhasil Mandapatkan ParamKey!'); 5384 5385 console.log(response.data); 5386 _this6.formData.param_key = response.data.data.paramkey; 5387 })["catch"](function (error) { 5388 _this6.doHandleErrors(error, true); 5389 }); 5390 }, 5391 5392 /*syncConfigMedia() { 5393 this.$refs.mediaKtp.setOption('url', this.path.apiUploadMedia); 5394 this.$refs.mediaSim.setOption('url', this.path.apiUploadMedia); 5395 },*/ 5396 sendingMediaKtp: function sendingMediaKtp(file, xhr, formData) { 5397 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5398 formData.append('category', 'KTP'); 5399 formData.append('param_key', this.formData.param_key); 5400 }, 5401 sendingMediaSim: function sendingMediaSim(file, xhr, formData) { 5402 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5403 formData.append('category', 'SIM'); 5404 formData.append('param_key', this.formData.param_key); 5405 }, 5406 sendingMediaStnk: function sendingMediaStnk(file, xhr, formData) { 5407 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5408 formData.append('category', 'STNK'); 5409 formData.append('param_key', this.formData.param_key); 5410 }, 5411 sendingMediaDepan: function sendingMediaDepan(file, xhr, formData) { 5412 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5413 formData.append('category', 'Depan'); 5414 formData.append('param_key', this.formData.param_key); 5415 }, 5416 sendingMediaDekat: function sendingMediaDekat(file, xhr, formData) { 5417 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5418 formData.append('category', 'Dekat'); 5419 formData.append('param_key', this.formData.param_key); 5420 }, 5421 sendingMediaJauh: function sendingMediaJauh(file, xhr, formData) { 5422 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5423 formData.append('category', 'Jauh'); 5424 formData.append('param_key', this.formData.param_key); 5425 }, 5426 sendingMediaSedang: function sendingMediaSedang(file, xhr, formData) { 5427 xhr.setRequestHeader('X-CSRF-TOKEN', App.csrfToken); 5428 formData.append('category', 'Sedang'); 5429 formData.append('param_key', this.formData.param_key); 5430 }, 5431 successMedia: function successMedia(file, response) { 5432 this.$toasted.global.message("Berhasil Upload Foto!"); 5433 5434 if (response.hasOwnProperty('media')) { 5435 this.media.push(response.media); 5436 } 5437 5438 console.log(file, response); 5439 }, 5440 errorMedia: function errorMedia(file, response, xhr) { 5441 console.log(file, response, xhr); 5442 var message = ''; 5443 5444 if (response.hasOwnProperty('message')) { 5445 message = response.message; 5446 } else { 5447 message = JSON.stringify(response); 5448 } 5449 5450 this.$toasted.global.error("Gagal Upload Media! (".concat(message, ")")); 5451 }, 5452 selectedCity: function selectedCity(optionSelected) { 5453 console.log(optionSelected); 5454 this.formData.kota_bengkel = optionSelected.text; 5455 this.getOptionWorkshop(); 5456 }, 5457 getOptionWorkshop: function getOptionWorkshop() { 5458 var _this7 = this; 5459 5460 if (!this.loadingWorkshop) { 5461 this.loadingWorkshop = true; 5462 axios.post('/customer/claim/mbu/workshop', { 5463 city_id: this.formData.kota_bengkel_id 5464 }).then(function (response) { 5465 _this7.$toasted.global.message('Berhasil ambil data workshop!'); 5466 5467 console.log(response.data); 5468 _this7.optionWorkshopName = response.data.data; 5469 _this7.loadingWorkshop = false; 5470 })["catch"](function (error) { 5471 _this7.doHandleErrors(error, true); 5472 }).then(function () { 5473 _this7.loadingWorkshop = false; 5474 }); 5475 } 5476 } 5477 }, 5478 mounted: function mounted() { 5479 this.getDataIncident(); 5480 this.getParamKey(); 5481 } 5482}); 5483 5484/***/ }), 5485 5486/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/DataHospital.vue?vue&type=script&lang=js&": 5487/*!*********************************************************************************************************************************************************************************!*\ 5488 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/DataHospital.vue?vue&type=script&lang=js& ***! 5489 \*********************************************************************************************************************************************************************************/ 5490/*! exports provided: default */ 5491/***/ (function(module, __webpack_exports__, __webpack_require__) { 5492 5493"use strict"; 5494__webpack_require__.r(__webpack_exports__); 5495/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-cleave-component */ "./node_modules/vue-cleave-component/dist/vue-cleave.min.js"); 5496/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__); 5497// 5498// 5499// 5500// 5501// 5502// 5503// 5504// 5505// 5506// 5507// 5508// 5509// 5510// 5511// 5512// 5513// 5514// 5515// 5516// 5517// 5518// 5519// 5520// 5521// 5522// 5523// 5524// 5525// 5526// 5527// 5528// 5529// 5530// 5531// 5532// 5533// 5534// 5535// 5536// 5537// 5538// 5539// 5540// 5541// 5542// 5543// 5544// 5545// 5546// 5547// 5548// 5549// 5550// 5551// 5552// 5553// 5554// 5555// 5556// 5557// 5558// 5559// 5560// 5561// 5562// 5563// 5564// 5565// 5566// 5567// 5568// 5569// 5570// 5571// 5572// 5573// 5574// 5575// 5576// 5577// 5578// 5579// 5580// 5581// 5582// 5583// 5584// 5585// 5586// 5587// 5588// 5589// 5590// 5591// 5592// 5593// 5594// 5595// 5596// 5597// 5598// 5599// 5600// 5601// 5602// 5603// 5604// 5605// 5606// 5607// 5608// 5609// 5610// 5611// 5612// 5613// 5614// 5615// 5616// 5617// 5618// 5619// 5620// 5621// 5622// 5623// 5624// 5625// 5626// 5627// 5628// 5629// 5630// 5631// 5632// 5633// 5634// 5635// 5636// 5637// 5638// 5639// 5640// 5641// 5642// 5643// 5644// 5645// 5646// 5647// 5648// 5649// 5650// 5651// 5652// 5653// 5654// 5655// 5656// 5657// 5658// 5659// 5660// 5661// 5662// 5663// 5664// 5665// 5666// 5667// 5668// 5669// 5670// 5671// 5672// 5673// 5674// 5675// 5676// 5677// 5678 5679/* harmony default export */ __webpack_exports__["default"] = ({ 5680 name: "DataHospital", 5681 components: { 5682 Cleave: vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default.a 5683 }, 5684 data: function data() { 5685 return { 5686 isMainCountry: true, 5687 loadingListData: false, 5688 loadingCoordinate: false, 5689 loadingSchedule: false, 5690 loadingRate: false, 5691 errors: [], 5692 isDetail: false, 5693 optionProvinces: [], 5694 optionCountries: [], 5695 filters: { 5696 province: '09', 5697 // Default DKI JAKARTA 5698 hospitalId: '', 5699 hospital: '', 5700 partnerType: '', 5701 country: '' 5702 }, 5703 listData: [], 5704 details: { 5705 schedules: [], 5706 coordinate: { 5707 latitude: '0', 5708 longitude: '0' 5709 }, 5710 rates: [] 5711 }, 5712 priceOption: { 5713 numeral: true, 5714 numeralDecimalScale: 2, 5715 numeralDecimalMark: ',', 5716 delimiter: '.', 5717 numeralPositiveOnly: true 5718 }, 5719 storage: { 5720 data: 'data-hospital', 5721 filter: 'filter-hospital', 5722 detail: 'detail-hospital' 5723 }, 5724 optionDays: ['SENIN', 'SELASA', 'RABU', 'KAMIS', 'JUMAT', 'SABTU', 'MINGGU'] 5725 }; 5726 }, 5727 mounted: function mounted() { 5728 this.getOptionProvinces(); 5729 this.getOptionCountries(); 5730 var storage = "".concat(this.storage.data, "-").concat(this.filters.province); 5731 5732 if (localStorage.getItem(storage)) { 5733 this.listData = JSON.parse(localStorage.getItem(storage)); 5734 } else { 5735 this.getDataHospital(); 5736 } 5737 5738 storage = this.storage.filter; 5739 5740 if (localStorage.getItem(storage)) { 5741 this.filters = JSON.parse(localStorage.getItem(storage)); 5742 } 5743 5744 storage = "".concat(this.storage.detail, "-").concat(this.filters.hospitalId); 5745 5746 if (localStorage.getItem(storage)) { 5747 this.details = JSON.parse(localStorage.getItem(storage)); 5748 } 5749 }, 5750 methods: { 5751 parsePrice: function parsePrice(val) { 5752 var newVal = String(val).replace(/\s/g, '') // Replace Space 5753 .replace(/\./g, '') // Replace . 5754 .replace(/,/g, '.'); // Replace , to . 5755 5756 return parseFloat(newVal); 5757 }, 5758 formatPrice: function formatPrice(price) { 5759 var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "id"; 5760 return Number(price.toFixed()).toLocaleString(locale); 5761 }, 5762 getOptionCountries: function getOptionCountries() { 5763 this.optionCountries = [{ 5764 text: '-- Pilih Wilayah --', 5765 value: '' 5766 }, { 5767 text: "CINA", 5768 value: '030' 5769 }, { 5770 text: "MALAYSIA", 5771 value: '006' 5772 }, { 5773 text: "SINGAPURA", 5774 value: '003' 5775 }]; 5776 }, 5777 getOptionProvinces: function getOptionProvinces() { 5778 var _this = this; 5779 5780 if (!this.loadingListData) { 5781 this.loadingListData = true; 5782 axios.get("/api/hospital/provinces").then(function (response) { 5783 _this.loadingListData = false; 5784 console.log(response.data); 5785 _this.optionProvinces = response.data; 5786 5787 _this.optionProvinces.unshift({ 5788 text: '-- Pilih Wilayah --', 5789 value: '' 5790 }); 5791 })["catch"](function (error) { 5792 _this.loadingListData = false; 5793 5794 _this.doHandleErrors(error, true); 5795 }).then(function () { 5796 _this.loadingListData = false; 5797 }); 5798 } 5799 }, 5800 getDataHospital: function getDataHospital() { 5801 var _this2 = this; 5802 5803 var storage = "".concat(this.storage.data, "-").concat(this.filters.province); 5804 var params = { 5805 hospital: this.filters.hospital, 5806 province_id: this.filters.province, 5807 country: this.filters.country, 5808 country_type: this.isMainCountry ? '1' : '2', 5809 partner_type: this.filters.partnerType 5810 }; 5811 5812 if (!this.loadingListData) { 5813 this.loadingListData = true; 5814 axios.post('/api/hospital', params).then(function (response) { 5815 _this2.loadingListData = false; 5816 console.log(response.data); 5817 _this2.listData = response.data.data; 5818 localStorage.setItem(storage, JSON.stringify(_this2.listData)); //this.$toasted.global.message('Success Created!'); 5819 })["catch"](function (error) { 5820 _this2.loadingListData = false; 5821 5822 _this2.doHandleErrors(error, true); 5823 }).then(function () { 5824 _this2.loadingListData = false; 5825 }); 5826 } 5827 }, 5828 getCoordinate: function getCoordinate() { 5829 var _this3 = this; 5830 5831 var storage = "".concat(this.storage.detail, "-").concat(this.filters.hospitalId); 5832 5833 if (!this.loadingCoordinate) { 5834 this.loadingCoordinate = true; 5835 axios.get("/api/hospital/".concat(this.filters.hospitalId, "/location")).then(function (response) { 5836 _this3.loadingCoordinate = false; 5837 console.log(response.data); 5838 _this3.details.coordinate.latitude = response.data.data.CoordLatitude; 5839 _this3.details.coordinate.longitude = response.data.data.CoordLongitude; 5840 localStorage.setItem(storage, JSON.stringify(_this3.details)); //this.$toasted.global.message('Success Created!'); 5841 })["catch"](function (error) { 5842 _this3.loadingCoordinate = false; 5843 5844 _this3.doHandleErrors(error, true); 5845 }).then(function () { 5846 _this3.loadingCoordinate = false; 5847 }); 5848 } 5849 }, 5850 getSchedules: function getSchedules() { 5851 var _this4 = this; 5852 5853 var storage = "".concat(this.storage.detail, "-").concat(this.filters.hospitalId); 5854 5855 if (!this.loadingSchedule) { 5856 this.loadingSchedule = true; 5857 axios.get("/api/hospital/".concat(this.filters.hospitalId, "/schedule")).then(function (response) { 5858 _this4.loadingSchedule = false; 5859 console.log(response.data); 5860 _this4.details.schedules = response.data.data; 5861 localStorage.setItem(storage, JSON.stringify(_this4.details)); //this.$toasted.global.message('Success Created!'); 5862 })["catch"](function (error) { 5863 _this4.loadingSchedule = false; 5864 5865 _this4.doHandleErrors(error, true); 5866 }).then(function () { 5867 _this4.loadingSchedule = false; 5868 }); 5869 } 5870 }, 5871 getRates: function getRates() { 5872 var _this5 = this; 5873 5874 var storage = "".concat(this.storage.detail, "-").concat(this.filters.hospitalId); 5875 5876 if (!this.loadingRate) { 5877 this.loadingRate = true; 5878 axios.get("/api/hospital/".concat(this.filters.hospitalId, "/rate")).then(function (response) { 5879 _this5.loadingRate = false; 5880 console.log(response.data); 5881 _this5.details.rates = response.data.data; 5882 localStorage.setItem(storage, JSON.stringify(_this5.details)); //this.$toasted.global.message('Success Created!'); 5883 })["catch"](function (error) { 5884 _this5.loadingRate = false; 5885 5886 _this5.doHandleErrors(error, true); 5887 }).then(function () { 5888 _this5.loadingRate = false; 5889 }); 5890 } 5891 }, 5892 showDetail: function showDetail(hospitalId) { 5893 this.isDetail = true; 5894 this.filters.hospitalId = hospitalId; 5895 this.getSchedules(); 5896 this.getCoordinate(); 5897 this.getRates(); 5898 }, 5899 setMainCountry: function setMainCountry(_boolean) { 5900 var partner = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; 5901 this.isMainCountry = _boolean; 5902 this.isDetail = false; 5903 this.listData = []; 5904 this.filters.partnerType = partner; 5905 } 5906 }, 5907 computed: { 5908 /*formattedInstalment: function () { 5909 return this.formatPrice(this.calc.monthlyInstallments); 5910 }, 5911 formattedLoan: function () { 5912 return this.formatPrice(this.calc.totalLoan); 5913 },*/ 5914 } 5915}); 5916 5917/***/ }), 5918 5919/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=script&lang=js&": 5920/*!**************************************************************************************************************************************************************************************!*\ 5921 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=script&lang=js& ***! 5922 \**************************************************************************************************************************************************************************************/ 5923/*! exports provided: default */ 5924/***/ (function(module, __webpack_exports__, __webpack_require__) { 5925 5926"use strict"; 5927__webpack_require__.r(__webpack_exports__); 5928/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-cleave-component */ "./node_modules/vue-cleave-component/dist/vue-cleave.min.js"); 5929/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__); 5930/* harmony import */ var _mixins_customers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/customers */ "./resources/js/mixins/customers.js"); 5931/* harmony import */ var _mixins_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/helper */ "./resources/js/mixins/helper.js"); 5932// 5933// 5934// 5935// 5936// 5937// 5938// 5939// 5940// 5941// 5942// 5943// 5944// 5945// 5946// 5947// 5948// 5949// 5950// 5951// 5952// 5953// 5954// 5955// 5956// 5957// 5958// 5959// 5960// 5961// 5962// 5963// 5964// 5965// 5966// 5967// 5968// 5969// 5970// 5971// 5972// 5973// 5974// 5975// 5976// 5977// 5978// 5979// 5980// 5981// 5982// 5983// 5984// 5985// 5986// 5987// 5988// 5989// 5990// 5991// 5992// 5993// 5994// 5995// 5996// 5997// 5998// 5999// 6000// 6001// 6002// 6003// 6004// 6005// 6006// 6007// 6008// 6009// 6010// 6011// 6012// 6013// 6014// 6015// 6016// 6017// 6018// 6019// 6020// 6021// 6022// 6023// 6024// 6025// 6026// 6027// 6028// 6029// 6030// 6031// 6032// 6033// 6034// 6035// 6036// 6037// 6038// 6039// 6040// 6041// 6042// 6043// 6044// 6045// 6046// 6047// 6048// 6049// 6050// 6051// 6052// 6053// 6054// 6055// 6056// 6057// 6058// 6059// 6060// 6061// 6062// 6063// 6064// 6065// 6066// 6067// 6068// 6069// 6070// 6071// 6072// 6073// 6074// 6075// 6076// 6077// 6078// 6079// 6080// 6081// 6082// 6083// 6084// 6085// 6086// 6087// 6088// 6089// 6090// 6091// 6092// 6093// 6094// 6095// 6096// 6097// 6098// 6099// 6100// 6101// 6102// 6103// 6104// 6105// 6106// 6107// 6108// 6109// 6110// 6111// 6112// 6113// 6114// 6115// 6116// 6117// 6118// 6119// 6120// 6121// 6122// 6123// 6124// 6125// 6126// 6127// 6128// 6129// 6130// 6131// 6132// 6133// 6134// 6135// 6136// 6137// 6138// 6139// 6140// 6141// 6142// 6143// 6144// 6145// 6146// 6147// 6148// 6149// 6150// 6151// 6152// 6153// 6154// 6155// 6156// 6157// 6158// 6159// 6160// 6161// 6162// 6163// 6164// 6165// 6166// 6167// 6168// 6169// 6170// 6171// 6172// 6173// 6174// 6175// 6176// 6177// 6178// 6179// 6180// 6181// 6182// 6183// 6184// 6185// 6186// 6187// 6188// 6189// 6190// 6191// 6192// 6193// 6194// 6195// 6196// 6197// 6198// 6199// 6200// 6201// 6202// 6203// 6204// 6205// 6206// 6207// 6208// 6209// 6210// 6211// 6212// 6213// 6214// 6215// 6216// 6217// 6218// 6219// 6220// 6221// 6222// 6223// 6224// 6225// 6226// 6227// 6228// 6229// 6230// 6231// 6232// 6233// 6234// 6235// 6236// 6237// 6238// 6239// 6240// 6241// 6242// 6243// 6244// 6245// 6246// 6247// 6248// 6249// 6250// 6251// 6252// 6253// 6254// 6255// 6256// 6257// 6258// 6259// 6260// 6261// 6262// 6263// 6264// 6265// 6266// 6267// 6268// 6269// 6270// 6271// 6272// 6273// 6274// 6275// 6276// 6277// 6278// 6279// 6280// 6281// 6282// 6283// 6284// 6285// 6286// 6287// 6288// 6289// 6290// 6291// 6292// 6293// 6294// 6295// 6296// 6297// 6298// 6299// 6300// 6301// 6302// 6303// 6304// 6305// 6306// 6307// 6308// 6309// 6310// 6311// 6312// 6313// 6314// 6315// 6316// 6317// 6318// 6319// 6320// 6321// 6322// 6323// 6324// 6325// 6326// 6327// 6328// 6329// 6330// 6331// 6332// 6333// 6334// 6335// 6336// 6337// 6338// 6339// 6340// 6341// 6342// 6343// 6344// 6345// 6346// 6347// 6348// 6349// 6350// 6351// 6352// 6353// 6354// 6355// 6356// 6357// 6358// 6359// 6360// 6361// 6362// 6363// 6364// 6365// 6366// 6367// 6368// 6369// 6370// 6371// 6372// 6373// 6374// 6375// 6376// 6377// 6378// 6379// 6380// 6381// 6382// 6383// 6384// 6385// 6386// 6387// 6388// 6389// 6390// 6391// 6392// 6393// 6394// 6395// 6396// 6397// 6398// 6399// 6400// 6401// 6402// 6403// 6404 6405 6406 6407var today = new Date(); 6408var startDate = today.toISOString().slice(0, 10); 6409today.setFullYear(today.getFullYear() + 1); 6410var endDate = today.toISOString().slice(0, 10); 6411/* harmony default export */ __webpack_exports__["default"] = ({ 6412 name: "FireInsuranceForm", 6413 mixins: [_mixins_customers__WEBPACK_IMPORTED_MODULE_1__["customers"], _mixins_helper__WEBPACK_IMPORTED_MODULE_2__["helper"]], 6414 components: { 6415 Cleave: vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default.a 6416 }, 6417 props: { 6418 customerType: { 6419 type: String, 6420 "default": 'personal' // 'personal / bisnis 6421 6422 }, 6423 accessCode: { 6424 type: String, 6425 "default": '100000000763' // Kode Akses Khusus Untuk Partner 13 digit. 6426 6427 }, 6428 businessCode: { 6429 type: String, 6430 "default": '10002' 6431 }, 6432 businessName: { 6433 type: String, 6434 "default": 'SIMAS RUMAH HEMAT PLUS' // max 50 character 6435 6436 }, 6437 groupPanel: { 6438 type: String, 6439 "default": '006' // Group panel 3 digit. 6440 6441 }, 6442 startDate: { 6443 type: String, 6444 "default": startDate 6445 }, 6446 endDate: { 6447 type: String, 6448 "default": endDate 6449 } 6450 }, 6451 data: function data() { 6452 return { 6453 submitting: false, 6454 errors: [], 6455 currentPage: 1, 6456 isAgreement: false, 6457 formData: { 6458 // config 6459 customer_type: this.customerType, 6460 access_code: this.accessCode, 6461 business_code: this.businessCode, 6462 business_name: this.businessName, 6463 group_panel: this.groupPanel, 6464 // data. 6465 id: 0, 6466 id_transaction: 'ASM006', 6467 step: 1, 6468 qq_name: '', 6469 the_insured: '', 6470 first_name: '', 6471 last_name: '', 6472 birth_date: '', 6473 city: '', 6474 gender: '1', 6475 status: '0', 6476 id_card: '', 6477 company: '', 6478 npwp: '', 6479 address_type: '1', 6480 address: '', 6481 zip_code: '', 6482 telephone: '', 6483 fax: '', 6484 mobile_phone: '', 6485 hand_phone: '', 6486 office_phone: '', 6487 email: '', 6488 office_address: '', 6489 office_zip_code: '', 6490 office_telephone: '', 6491 office_fax: '', 6492 office_mobile_phone: '', 6493 office_hand_phone: '', 6494 office_office_phone: '', 6495 office_email: '', 6496 property_is_material_damage: true, 6497 property_construction: '', 6498 property_object_name: '', 6499 property_building_no: '', 6500 property_floor_type: '', 6501 property_number_of_floor: '1', 6502 property_roof_type: '', 6503 property_wall_type: '', 6504 property_road_name: '', 6505 property_road_type: '', 6506 property_item_code: '', 6507 property_item_amount: '', 6508 property_address: '', 6509 property_zip_code: '', 6510 tsi: '', 6511 start_date: this.startDate, 6512 end_date: this.endDate, 6513 type_of_packet: '', 6514 // case_id: '', 6515 policy_number: '', 6516 premium: '', 6517 admin_fee: '', 6518 commission: '', 6519 stamp_receipts: '', 6520 stamp_policy: '', 6521 discount: '', 6522 payment_total: '', 6523 sum_payment_total: '', 6524 pdf: '', 6525 coverage: '' 6526 }, 6527 customerProfile: {}, 6528 registrationResponse: {}, 6529 optionItemCodes: [{ 6530 value: '10000091', 6531 text: 'BANGUNAN' 6532 } // { 6533 // value: '10000148', 6534 // text: 'HOUSEHOLD CONTENTS', 6535 // }, 6536 ], 6537 optionConstructions: [{ 6538 value: 'I', 6539 text: 'Konstruksi 1' 6540 } // { 6541 // value: 'II', 6542 // text: 'Konstruksi 2', 6543 // }, 6544 // { 6545 // value: 'III', 6546 // text: 'Konstruksi 3', 6547 // }, 6548 ], 6549 optionRoadTypes: ['CAMP', 'DESA', 'DUSUN', 'GANG', 'JL.', 'KAMPUNG', 'KAWASAN', 'KEL.', 'KOMP. PERUM', 'KOMPLEK', 'LORONG', 'PERKAVLINGAN', 'PERUM', 'PERUMAHAN', 'RUKAN', 'RUKO'], 6550 optionAddressTypes: [{ 6551 value: '1', 6552 text: 'ALAMAT RUMAH' 6553 }, { 6554 value: '2', 6555 text: 'ALAMAT KANTOR' 6556 }], 6557 optionFloorTypes: [{ 6558 value: 'KELAS III', 6559 text: 'Keramik' 6560 }, { 6561 value: 'KELAS II', 6562 text: 'Kayu' 6563 }, { 6564 value: 'KELAS I', 6565 text: 'Lain-lain' 6566 }], 6567 optionWallTypes: [{ 6568 value: '1', 6569 text: 'Batu bata' 6570 }, { 6571 value: '2', 6572 text: 'Kayu / Papan' 6573 }, { 6574 value: '3', 6575 text: 'Semi Permanen' 6576 }, { 6577 value: '4', 6578 text: 'Bilik' 6579 }, { 6580 value: '5', 6581 text: 'Batako' 6582 }, { 6583 value: '6', 6584 text: 'Panel Beton' 6585 }, { 6586 value: '7', 6587 text: 'Seng / Plat' 6588 }, { 6589 value: '8', 6590 text: 'Kaca' 6591 }, { 6592 value: '9', 6593 text: 'Lain-lain' 6594 }], 6595 optionRoofTypes: [{ 6596 value: '1', 6597 text: 'Dak Beton' 6598 }, { 6599 value: '2', 6600 text: 'Genteng Beton' 6601 }, { 6602 value: '3', 6603 text: 'Bilik' 6604 }, { 6605 value: '4', 6606 text: 'Genteng Tanah Liat' 6607 }, { 6608 value: '5', 6609 text: 'Sirap' 6610 }, { 6611 value: '6', 6612 text: 'Seng Gelombang' 6613 }, { 6614 value: '7', 6615 text: 'Seng Lembaran' 6616 }, { 6617 value: '8', 6618 text: 'Aluminium Gelombang' 6619 }, { 6620 value: '9', 6621 text: 'Aluminium Lembaran' 6622 }, { 6623 value: '10', 6624 text: 'Kaca' 6625 }, { 6626 value: '11', 6627 text: 'Plastik / Policarbon Lembaran' 6628 }, { 6629 value: '12', 6630 text: 'Plastik / Policarbon Gelombang' 6631 }, { 6632 value: '13', 6633 text: 'Daun' 6634 }, { 6635 value: '14', 6636 text: 'Lain-lain' 6637 }], 6638 responseData: [], 6639 priceOption: { 6640 numeral: true, 6641 numeralDecimalScale: 2, 6642 numeralDecimalMark: ',', 6643 delimiter: '.', 6644 numeralPositiveOnly: true 6645 }, 6646 tempData: {}, 6647 datetimePickerConfig: { 6648 enableTime: true, 6649 time_24hr: true, 6650 enableSeconds: false, 6651 dateFormat: 'Y-m-d', 6652 altInput: true, 6653 altFormat: 'Y-m-d', 6654 locale: null 6655 }, 6656 optionPackets: [// { 6657 // value: 'IA', 6658 // text: 'Paket IA (Menjamin Resiko Banjir Untuk Zona I / Resiko Rendah)', 6659 // }, 6660 // { 6661 // value: 'IB', 6662 // text: 'Paket IB (Menjamin Resiko Banjir Untuk Zona II / Resiko Menengah)', 6663 // }, 6664 { 6665 value: 'II', 6666 text: 'Paket II (Tidak Menjamin Resiko Banjir)' 6667 }], 6668 // storage 6669 storageForm: "data-fire-insurance-form", 6670 storageResponse: "response-fire-insurance-form", 6671 storageRequest: "request-fire-insurance-form", 6672 storagePage: "data-fire-current-page" 6673 }; 6674 }, 6675 mounted: function mounted() { 6676 this.checkProfile(); 6677 this.prepareForm(); 6678 }, 6679 methods: { 6680 submitData: function submitData() { 6681 var _this = this; 6682 6683 var storageForm = "data-fire-insurance-form"; 6684 var storageResponse = "response-fire-insurance-form"; 6685 6686 if (!this.submitting) { 6687 this.submitting = true; 6688 6689 if (!this.customerProfile.hasOwnProperty("Email") && this.formData.step === 1) { 6690 this.registrationCustomer(); 6691 } 6692 6693 axios.post('/api/fire?step=' + this.formData.step, this.formData).then(function (response) { 6694 _this.submitting = false; 6695 var data = response.data.data; 6696 _this.formData = data; 6697 _this.formData.step++; 6698 _this.currentPage++; 6699 localStorage.setItem("data-fire-current-page", _this.currentPage); 6700 6701 _this.responseData.push(data.response); 6702 6703 delete _this.formData.response; 6704 localStorage.setItem(storageForm, JSON.stringify(_this.formData)); 6705 localStorage.setItem(storageResponse, JSON.stringify(_this.responseData)); 6706 6707 _this.$toasted.global.message('Success Created!'); 6708 })["catch"](function (error) { 6709 _this.submitting = false; 6710 6711 _this.doHandleErrors(error, true); 6712 }).then(function () { 6713 _this.submitting = false; 6714 }); // TODO IF !this.customerProfile.hasOwenProperty('Nama') // HIT API RREGISTRASI. 6715 } 6716 } 6717 } 6718}); 6719 6720/***/ }), 6721 6722/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=script&lang=js&": 6723/*!****************************************************************************************************************************************************************************************!*\ 6724 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=script&lang=js& ***! 6725 \****************************************************************************************************************************************************************************************/ 6726/*! exports provided: default */ 6727/***/ (function(module, __webpack_exports__, __webpack_require__) { 6728 6729"use strict"; 6730__webpack_require__.r(__webpack_exports__); 6731/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-cleave-component */ "./node_modules/vue-cleave-component/dist/vue-cleave.min.js"); 6732/* harmony import */ var vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_cleave_component__WEBPACK_IMPORTED_MODULE_0__); 6733/* harmony import */ var _mixins_customers__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../mixins/customers */ "./resources/js/mixins/customers.js"); 6734/* harmony import */ var _mixins_helper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../mixins/helper */ "./resources/js/mixins/helper.js"); 6735// 6736// 6737// 6738// 6739// 6740// 6741// 6742// 6743// 6744// 6745// 6746// 6747// 6748// 6749// 6750// 6751// 6752// 6753// 6754// 6755// 6756// 6757// 6758// 6759// 6760// 6761// 6762// 6763// 6764// 6765// 6766// 6767// 6768// 6769// 6770// 6771// 6772// 6773// 6774// 6775// 6776// 6777// 6778// 6779// 6780// 6781// 6782// 6783// 6784// 6785// 6786// 6787// 6788// 6789// 6790// 6791// 6792// 6793// 6794// 6795// 6796// 6797// 6798// 6799// 6800// 6801// 6802// 6803// 6804// 6805// 6806// 6807// 6808// 6809// 6810// 6811// 6812// 6813// 6814// 6815// 6816// 6817// 6818// 6819// 6820// 6821// 6822// 6823// 6824// 6825// 6826// 6827// 6828// 6829// 6830// 6831// 6832// 6833// 6834// 6835// 6836// 6837// 6838// 6839// 6840// 6841// 6842// 6843// 6844// 6845// 6846// 6847// 6848// 6849// 6850// 6851// 6852// 6853// 6854// 6855// 6856// 6857// 6858// 6859// 6860// 6861// 6862// 6863// 6864// 6865// 6866// 6867// 6868// 6869// 6870// 6871// 6872// 6873// 6874// 6875// 6876// 6877// 6878// 6879// 6880// 6881// 6882// 6883// 6884// 6885// 6886// 6887// 6888// 6889// 6890// 6891// 6892// 6893// 6894// 6895// 6896// 6897// 6898// 6899// 6900// 6901// 6902// 6903// 6904// 6905// 6906// 6907// 6908// 6909// 6910// 6911// 6912// 6913// 6914// 6915// 6916// 6917// 6918// 6919// 6920// 6921// 6922// 6923// 6924// 6925// 6926// 6927// 6928// 6929// 6930// 6931// 6932// 6933// 6934// 6935// 6936// 6937// 6938// 6939// 6940// 6941// 6942// 6943// 6944// 6945// 6946// 6947// 6948// 6949// 6950// 6951// 6952// 6953// 6954// 6955// 6956// 6957// 6958// 6959// 6960// 6961// 6962// 6963// 6964// 6965// 6966// 6967// 6968// 6969// 6970// 6971// 6972// 6973// 6974// 6975// 6976// 6977// 6978// 6979// 6980// 6981// 6982// 6983// 6984// 6985// 6986// 6987// 6988// 6989// 6990// 6991// 6992// 6993// 6994// 6995// 6996// 6997// 6998// 6999// 7000// 7001// 7002// 7003// 7004// 7005// 7006// 7007// 7008// 7009// 7010// 7011// 7012// 7013// 7014// 7015// 7016// 7017// 7018// 7019// 7020// 7021// 7022// 7023// 7024// 7025// 7026// 7027// 7028// 7029// 7030// 7031// 7032// 7033// 7034// 7035// 7036// 7037// 7038// 7039// 7040// 7041// 7042// 7043// 7044// 7045// 7046// 7047// 7048// 7049// 7050// 7051// 7052// 7053// 7054// 7055// 7056// 7057// 7058// 7059// 7060// 7061// 7062// 7063// 7064// 7065// 7066// 7067// 7068// 7069// 7070// 7071// 7072// 7073// 7074// 7075// 7076// 7077// 7078// 7079// 7080// 7081// 7082// 7083// 7084// 7085// 7086// 7087// 7088// 7089// 7090// 7091// 7092// 7093// 7094// 7095// 7096// 7097// 7098// 7099// 7100// 7101// 7102// 7103// 7104// 7105// 7106// 7107// 7108// 7109// 7110// 7111// 7112// 7113// 7114// 7115// 7116// 7117// 7118// 7119// 7120// 7121// 7122// 7123// 7124// 7125// 7126// 7127// 7128// 7129// 7130// 7131// 7132// 7133// 7134// 7135// 7136// 7137// 7138// 7139// 7140// 7141// 7142// 7143// 7144// 7145// 7146// 7147// 7148// 7149// 7150// 7151// 7152// 7153// 7154// 7155// 7156// 7157// 7158// 7159// 7160// 7161// 7162// 7163// 7164// 7165// 7166// 7167// 7168// 7169// 7170// 7171// 7172// 7173// 7174// 7175// 7176// 7177// 7178// 7179// 7180// 7181// 7182// 7183// 7184// 7185// 7186// 7187// 7188// 7189// 7190// 7191// 7192// 7193// 7194// 7195// 7196// 7197// 7198// 7199// 7200// 7201// 7202// 7203// 7204// 7205// 7206// 7207// 7208// 7209// 7210// 7211// 7212// 7213// 7214// 7215// 7216// 7217// 7218// 7219// 7220// 7221// 7222// 7223// 7224// 7225// 7226// 7227// 7228// 7229// 7230// 7231 7232 7233 7234var today = new Date(); 7235var startDate = today.toISOString().slice(0, 10); 7236today.setFullYear(today.getFullYear() + 1); 7237var endDate = today.toISOString().slice(0, 10); 7238/* harmony default export */ __webpack_exports__["default"] = ({ 7239 name: "TravelInsuranceForm", 7240 mixins: [_mixins_customers__WEBPACK_IMPORTED_MODULE_1__["customers"], _mixins_helper__WEBPACK_IMPORTED_MODULE_2__["helper"]], 7241 components: { 7242 Cleave: vue_cleave_component__WEBPACK_IMPORTED_MODULE_0___default.a 7243 }, 7244 props: { 7245 customerType: { 7246 type: String, 7247 "default": 'personal' // 'personal / bisnis 7248 7249 }, 7250 accessCode: { 7251 type: String, 7252 "default": '100000000495' // Kode Akses Khusus Untuk Partner 13 digit. 7253 7254 }, 7255 businessCode: { 7256 type: String, 7257 "default": '10084' 7258 }, 7259 businessName: { 7260 type: String, 7261 "default": 'Travel Insurance' // max 50 character 7262 7263 }, 7264 groupPanel: { 7265 type: String, 7266 "default": '005' // Group panel 3 digit. 7267 7268 }, 7269 startDate: { 7270 type: String, 7271 "default": startDate 7272 }, 7273 endDate: { 7274 type: String, 7275 "default": endDate 7276 } 7277 }, 7278 data: function data() { 7279 return { 7280 submitting: false, 7281 errors: [], 7282 currentPage: 1, 7283 isAgreement: false, 7284 defaultAccessCode: this.accessCode, 7285 formData: { 7286 // config 7287 customer_type: this.customerType, 7288 access_code: this.accessCode, 7289 business_code: this.businessCode, 7290 business_name: this.businessName, 7291 group_panel: this.groupPanel, 7292 is_covid_policy: false, 7293 // option_covid_policy: '1', // 'RAWAT_INAP 7294 option_covid_policy: '2', 7295 // 'SANTUNAN 7296 //branch_name: this.branchName, 7297 // data. 7298 id: 0, 7299 id_transaction: 'ASM005', 7300 step: 1, 7301 qq_name: '', 7302 the_insured: '', 7303 trip_type: '2', 7304 plan_type: '1', 7305 travel_destination: '', 7306 travel_country: 'Indonesia', 7307 travel_purpose: '', 7308 currency: '10026', 7309 first_name: '', 7310 last_name: '', 7311 gender: '1', 7312 birth_date: '', 7313 status: '0', 7314 id_card: '', 7315 npwp: '', 7316 email: '', 7317 address: '', 7318 zip_code: '', 7319 telephone: '', 7320 fax: '', 7321 mobile_phone: '', 7322 hand_phone: '', 7323 office_address: '', 7324 office_zip_code: '', 7325 office_telephone: '', 7326 office_fax: '', 7327 office_mobile_phone: '', 7328 office_hand_phone: '', 7329 office_email: '', 7330 purchase_date: '', 7331 discount_percentage: 0, 7332 start_date: '', 7333 end_date: '', 7334 // start_date: this.startDate, 7335 // end_date: this.endDate, 7336 // type_of_packet: "PAKET BASIC", 7337 // case_id: '', 7338 policy_number: '', 7339 heirs: [{ 7340 heir_name: '', 7341 heir_gender: 'Laki-Laki', 7342 heir_relation: '', 7343 heir_percentage: 100 7344 }], 7345 premium: '', 7346 admin_fee: '', 7347 commission: '', 7348 stamp_receipts: '', 7349 stamp_policy: '', 7350 discount: '', 7351 payment_total: '', 7352 sum_payment_total: '', 7353 pdf: '', 7354 coverage: '' 7355 }, 7356 requestData: [], 7357 responseData: [], 7358 priceOption: { 7359 numeral: true, 7360 numeralDecimalScale: 2, 7361 numeralDecimalMark: ',', 7362 delimiter: '.', 7363 numeralPositiveOnly: true 7364 }, 7365 tempData: {}, 7366 datetimePickerConfig: { 7367 enableTime: true, 7368 time_24hr: true, 7369 enableSeconds: false, 7370 dateFormat: 'Y-m-d', 7371 altInput: true, 7372 altFormat: 'Y-m-d', 7373 locale: null 7374 }, 7375 datePickerConfig: { 7376 dateFormat: 'Y-m-d', 7377 altInput: true, 7378 altFormat: 'Ymd', 7379 locale: null 7380 }, 7381 optionTripTypes: [//{text: 'Overseas', value: '1',}, 7382 { 7383 text: 'Domestik', 7384 value: '2' 7385 }], 7386 optionPackets: [{ 7387 text: 'Hardcopy', 7388 value: '1' 7389 }, { 7390 text: 'E-Polis (default)', 7391 value: '3' 7392 }], 7393 optionPlanTypes: [{ 7394 text: 'Individu', 7395 value: '1' 7396 } // {text: 'Family', value: '1',}, 7397 ], 7398 optionNegara: [{ 7399 text: 'Indonesia', 7400 value: 'Indonesia' 7401 }], 7402 optionTravelPurposes: [{ 7403 text: 'Wisata/Rekreasi', 7404 value: 'A' 7405 }, { 7406 text: 'Bisnis/Dinas', 7407 value: 'B' 7408 }, { 7409 text: 'Ibadah Umroh', 7410 value: 'C' 7411 }, { 7412 text: 'Seminar/Training', 7413 value: 'D' 7414 }, { 7415 text: 'Konser', 7416 value: 'E' 7417 }, { 7418 text: 'Ibadah Haji', 7419 value: 'F' 7420 }], 7421 defaultOptionCoverages: [{ 7422 text: 'PLAN A', 7423 value: 'PLAN A' 7424 }, { 7425 text: 'PLAN B', 7426 value: 'PLAN B' 7427 }, { 7428 text: 'PLAN C', 7429 value: 'PLAN C' 7430 }, { 7431 text: 'PLAN D', 7432 value: 'PLAN D' 7433 }, { 7434 text: 'PLAN E', 7435 value: 'PLAN E' 7436 }, { 7437 text: 'STO_A', 7438 value: 'STO_A' 7439 }, { 7440 text: 'STO_B', 7441 value: 'STO_B' 7442 }, { 7443 text: 'STO_C', 7444 value: 'STO_C' 7445 }, { 7446 text: 'STO_D', 7447 value: 'STO_D' 7448 }, { 7449 text: 'STO_E', 7450 value: 'STO_E' 7451 }, { 7452 text: 'STO_AFM', 7453 value: 'STO_AFM' 7454 }, { 7455 text: 'STO_BFM', 7456 value: 'STO_BFM' 7457 }, { 7458 text: 'STO_CFM', 7459 value: 'STO_CFM' 7460 }, { 7461 text: 'STO_DFM', 7462 value: 'STO_DFM' 7463 }, { 7464 text: 'STO_EFM', 7465 value: 'STO_EFM' 7466 }], 7467 optionCovidInsurance: [// {text: 'Biaya perawatan akibat Covid-19', value: '1',}, 7468 { 7469 text: 'Santunan biaya rawat inap akibat Covid-19', 7470 value: '2' 7471 }], 7472 optionCoverages: [], 7473 optionRelations: ['Tertanggung', 'Istri', 'Suami', 'Anak', 'Ayah', 'Ibu', 'Kakak', 'Adik', 'Kakek', 'Nenek', 'Perusahaan', 'Majikan', 'Keponakan', 'Saudara', 'Cucu', 'Dealer', 'Pimpinan', 'Kreditur', 'Lembaga Pendidikan', 'Kerabat', 'Orang Tua', 'Sepupu', 'Travel Agent'], 7474 // storage 7475 storageForm: "data-travel-insurance-form", 7476 storageResponse: "response-travel-insurance-form", 7477 storageRequest: "request-travel-insurance-form", 7478 storagePage: "data-travel-current-page" 7479 }; 7480 }, 7481 mounted: function mounted() { 7482 this.checkProfile(); 7483 this.prepareForm(); 7484 this.optionCoverages = JSON.parse(JSON.stringify(this.defaultOptionCoverages)); 7485 }, 7486 methods: { 7487 submitData: function submitData() { 7488 var _this = this; 7489 7490 var storageForm = "data-travel-insurance-form"; 7491 var storageResponse = "response-travel-insurance-form"; 7492 var storageRequest = "request-travel-insurance-form"; 7493 7494 if (!this.submitting) { 7495 this.submitting = true; 7496 7497 if (!this.customerProfile.hasOwnProperty("Email") && this.formData.step === 1) { 7498 this.registrationCustomer(); 7499 } 7500 7501 axios.post('/api/travel?step=' + this.formData.step, this.formData).then(function (response) { 7502 _this.submitting = false; 7503 var data = response.data.data; 7504 _this.formData = data; 7505 _this.formData.step++; 7506 _this.currentPage++; 7507 localStorage.setItem("data-travel-current-page", _this.currentPage); 7508 7509 _this.responseData.push(data.response); 7510 7511 _this.requestData.push(data.request); 7512 7513 delete _this.formData.response; 7514 delete _this.formData.request; 7515 localStorage.setItem(storageForm, JSON.stringify(_this.formData)); 7516 localStorage.setItem(storageResponse, JSON.stringify(_this.responseData)); 7517 localStorage.setItem(storageRequest, JSON.stringify(_this.requestData)); 7518 7519 _this.$toasted.global.message('Success Created!'); 7520 })["catch"](function (error) { 7521 console.log(error); 7522 _this.submitting = false; 7523 7524 if (error.response.data.hasOwnProperty("FeedbackMessage")) { 7525 _this.$toasted.global.error(error.response.data.FeedbackMessage); 7526 } else { 7527 _this.doHandleErrors(error, true); 7528 } 7529 }).then(function () { 7530 _this.submitting = false; 7531 }); 7532 } 7533 }, 7534 getOptions: function getOptions(option, object) { 7535 var _this2 = this; 7536 7537 var business = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Aneka'; 7538 //if (!this.submitting) { 7539 var storage = "".concat(object, "-").concat(business).toUpperCase(); //this.submitting = true; 7540 7541 axios.get("/api/master-data?master=".concat(option, "&business=").concat(business)).then(function (response) { 7542 //this.submitting = false; 7543 localStorage.setItem(storage, JSON.stringify(response.data)); 7544 _this2[object] = response.data; // this.$toasted.global.message('Success Created!'); 7545 })["catch"](function (error) { 7546 console.log(error); //this.submitting = false; 7547 7548 _this2.doHandleErrors(error, true); 7549 }); //} 7550 }, 7551 changeCovidInsurance: function changeCovidInsurance(value) { 7552 if (value === '1') { 7553 //perawatan 7554 this.formData.access_code = '100000000935'; 7555 } else if (value === '2') { 7556 // rawat inap 7557 this.formData.access_code = '100000000735'; 7558 } else { 7559 //jika tidak pilih kedua-dua nya 7560 this.formData.access_code = '100000000495'; 7561 } 7562 }, 7563 prepareOptionCoverage: function prepareOptionCoverage(isCovid, covidOptionType, tripType, planType) { 7564 this.optionCoverages = []; // tripType = 1 overseas 2, domestik 7565 7566 if (tripType === '2') { 7567 if (isCovid) { 7568 // plan simas travel domestic perluasan santunan covid-19 : 7569 this.optionCoverages = [{ 7570 text: 'PLAN A', 7571 value: 'PLAN A_COVID19' 7572 }, { 7573 text: 'PLAN B', 7574 value: 'PLAN B_COVID19' 7575 }, { 7576 text: 'PLAN C', 7577 value: 'PLAN C_COVID19' 7578 }, { 7579 text: 'PLAN D', 7580 value: 'PLAN D_COVID19' 7581 }]; 7582 } else { 7583 this.optionCoverages = [{ 7584 text: 'PLAN A', 7585 value: 'PLAN A' 7586 }, { 7587 text: 'PLAN B', 7588 value: 'PLAN B' 7589 }, { 7590 text: 'PLAN C', 7591 value: 'PLAN C' 7592 }, { 7593 text: 'PLAN D', 7594 value: 'PLAN D' 7595 }]; 7596 } 7597 } else { 7598 // planType => 1 individu, 0 family 7599 if (planType === '1') { 7600 if (isCovid) { 7601 // covidOptionType => 2 rawat inapp covid, 1 perawatan covid 7602 if (covidOptionType === '1') { 7603 this.optionCoverages = [{ 7604 text: 'PLAN A', 7605 value: 'STO A_COVID190' 7606 }, { 7607 text: 'PLAN B', 7608 value: 'STO B_COVID190' 7609 }, { 7610 text: 'PLAN C', 7611 value: 'STO C_COVID190' 7612 }, { 7613 text: 'PLAN D', 7614 value: 'STO D_COVID190' 7615 }, { 7616 text: 'PLAN E', 7617 value: 'STO E_COVID190' 7618 }]; 7619 } else { 7620 this.optionCoverages = [{ 7621 text: 'PLAN A', 7622 value: 'STO A_COVID19' 7623 }, { 7624 text: 'PLAN B', 7625 value: 'STO B_COVID19' 7626 }, { 7627 text: 'PLAN C', 7628 value: 'STO C_COVID19' 7629 }, { 7630 text: 'PLAN D', 7631 value: 'STO D_COVID19' 7632 }, { 7633 text: 'PLAN E', 7634 value: 'STO E_COVID19' 7635 }]; 7636 } 7637 } else { 7638 this.optionCoverages = [{ 7639 text: 'PLAN A', 7640 value: 'STO_A' 7641 }, { 7642 text: 'PLAN B', 7643 value: 'STO_B' 7644 }, { 7645 text: 'PLAN C', 7646 value: 'STO_C' 7647 }, { 7648 text: 'PLAN D', 7649 value: 'STO_D' 7650 }, { 7651 text: 'PLAN E', 7652 value: 'STO_E' 7653 }]; 7654 } 7655 } else { 7656 // keluarga 7657 if (isCovid) { 7658 // covidOptionType => 2 rawat inapp covid, 1 perawatan covid 7659 if (covidOptionType === '0') { 7660 var totalPerson = this.formData.heirs.length; 7661 this.optionCoverages = [{ 7662 text: 'PLAN A', 7663 value: "STO A_COVID19".concat(totalPerson) 7664 }, { 7665 text: 'PLAN B', 7666 value: "STO B_COVID19".concat(totalPerson) 7667 }, { 7668 text: 'PLAN C', 7669 value: "STO C_COVID19".concat(totalPerson) 7670 }, { 7671 text: 'PLAN D', 7672 value: "STO D_COVID19".concat(totalPerson) 7673 }, { 7674 text: 'PLAN E', 7675 value: "STO E_COVID19".concat(totalPerson) 7676 }]; 7677 } else { 7678 this.optionCoverages = [{ 7679 text: 'PLAN A', 7680 value: 'STO AFM_COVID19' 7681 }, { 7682 text: 'PLAN B', 7683 value: 'STO BFM_COVID19' 7684 }, { 7685 text: 'PLAN C', 7686 value: 'STO CFM_COVID19' 7687 }, { 7688 text: 'PLAN D', 7689 value: 'STO DFM_COVID19' 7690 }, { 7691 text: 'PLAN E', 7692 value: 'STO EFM_COVID19' 7693 }]; 7694 } 7695 } else { 7696 this.optionCoverages = [{ 7697 text: 'PLAN A', 7698 value: 'STO_AFM' 7699 }, { 7700 text: 'PLAN B', 7701 value: 'STO_BFM' 7702 }, { 7703 text: 'PLAN C', 7704 value: 'STO_CFM' 7705 }, { 7706 text: 'PLAN D', 7707 value: 'STO_DFM' 7708 }, { 7709 text: 'PLAN E', 7710 value: 'STO_EFM' 7711 }]; 7712 } 7713 } 7714 } 7715 }, 7716 deleteHeir: function deleteHeir(idx) { 7717 this.formData.heirs.splice(idx, 1); 7718 }, 7719 addHeir: function addHeir() { 7720 var maxPerson = 4; 7721 7722 if (this.formData.heirs.length < maxPerson) { 7723 this.formData.heirs.push(Object.assign({ 7724 heir_name: '', 7725 heir_gender: 'Laki-Laki', 7726 heir_relation: '', 7727 heir_percentage: 0 7728 })); 7729 } else { 7730 Swal.fire({ 7731 title: "Warning!", 7732 text: "Maximum of heirs is ".concat(maxPerson, "!"), 7733 icon: "warning" 7734 }); 7735 } 7736 } 7737 }, 7738 computed: { 7739 /*formattedInstalment: function () { 7740 return this.formatPrice(this.calc.monthlyInstallments); 7741 }, 7742 formattedLoan: function () { 7743 return this.formatPrice(this.calc.totalLoan); 7744 },*/ 7745 }, 7746 watch: { 7747 'formData.is_covid_policy': { 7748 handler: function handler(isCovidPolicy) { 7749 if (!isCovidPolicy) { 7750 this.formData.access_code = this.defaultAccessCode; 7751 this.optionCoverages = this.defaultOptionCoverages; 7752 } 7753 7754 this.prepareOptionCoverage(isCovidPolicy, this.formData.option_covid_policy, this.formData.trip_type, this.formData.plan_type); 7755 }, 7756 deep: true 7757 }, 7758 'formData.trip_type': { 7759 handler: function handler(tripType) { 7760 this.prepareOptionCoverage(this.formData.is_covid_policy, this.formData.option_covid_policy, tripType, this.formData.plan_type); 7761 }, 7762 deep: true 7763 }, 7764 'formData.option_covid_policy': { 7765 handler: function handler(covidOptionPolicy) { 7766 this.prepareOptionCoverage(this.formData.is_covid_policy, covidOptionPolicy, this.formData.trip_type, this.formData.plan_type); 7767 }, 7768 deep: true 7769 }, 7770 'formData.plan_type': { 7771 handler: function handler(planType) { 7772 this.prepareOptionCoverage(this.formData.is_covid_policy, this.formData.option_covid_policy, this.formData.trip_type, planType); 7773 }, 7774 deep: true 7775 } 7776 } 7777}); 7778 7779/***/ }), 7780 7781/***/ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ValidatePolicy.vue?vue&type=script&lang=js&": 7782/*!***********************************************************************************************************************************************************************************!*\ 7783 !*** ./node_modules/babel-loader/lib??ref--4-0!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/ValidatePolicy.vue?vue&type=script&lang=js& ***! 7784 \***********************************************************************************************************************************************************************************/ 7785/*! exports provided: default */ 7786/***/ (function(module, __webpack_exports__, __webpack_require__) { 7787 7788"use strict"; 7789__webpack_require__.r(__webpack_exports__); 7790// 7791// 7792// 7793// 7794// 7795// 7796// 7797// 7798// 7799// 7800// 7801// 7802// 7803// 7804// 7805// 7806// 7807// 7808// 7809// 7810// 7811// 7812// 7813// 7814// 7815// 7816// 7817// 7818// 7819// 7820// 7821// 7822// 7823// 7824// 7825// 7826// 7827// 7828// 7829// 7830// 7831// 7832// 7833// 7834// 7835// 7836// 7837// 7838// 7839// 7840// 7841// 7842// 7843// 7844// 7845/* harmony default export */ __webpack_exports__["default"] = ({ 7846 name: "ValidatePolicy", 7847 data: function data() { 7848 return { 7849 errors: {}, 7850 submitting: false, 7851 formData: { 7852 no_polis: '', 7853 digit_sum: '' 7854 }, 7855 listData: [] 7856 }; 7857 }, 7858 methods: { 7859 validatePolicy: function validatePolicy() { 7860 var _this = this; 7861 7862 if (!this.submitting) { 7863 this.submitting = true; 7864 axios.post('/api/validate-policy', this.formData).then(function (response) { 7865 _this.$toasted.global.message(response.data.message); 7866 7867 _this.listData.push(response.data); 7868 7869 console.log(response.data); 7870 _this.submitting = false; 7871 })["catch"](function (error) { 7872 _this.doHandleErrors(error, true); 7873 }).then(function () { 7874 _this.submitting = false; 7875 }); 7876 } 7877 } 7878 } 7879}); 7880 7881/***/ }), 7882
vendor: 137,745 bytes, lines 7883-12249
7883/***/ "./node_modules/bootstrap/dist/js/bootstrap.js": 7884/*!*****************************************************!*\ 7885 !*** ./node_modules/bootstrap/dist/js/bootstrap.js ***! 7886 \*****************************************************/ 7887/*! no static exports found */ 7888/***/ (function(module, exports, __webpack_require__) { 7889 7890/*! 7891 * Bootstrap v4.6.1 (https://getbootstrap.com/) 7892 * Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors) 7893 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 7894 */ 7895(function (global, factory) { 7896 true ? factory(exports, __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"), __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")) : 7897 undefined; 7898})(this, (function (exports, $, Popper) { 'use strict'; 7899 7900 function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } 7901 7902 var $__default = /*#__PURE__*/_interopDefaultLegacy($); 7903 var Popper__default = /*#__PURE__*/_interopDefaultLegacy(Popper); 7904 7905 function _defineProperties(target, props) { 7906 for (var i = 0; i < props.length; i++) { 7907 var descriptor = props[i]; 7908 descriptor.enumerable = descriptor.enumerable || false; 7909 descriptor.configurable = true; 7910 if ("value" in descriptor) descriptor.writable = true; 7911 Object.defineProperty(target, descriptor.key, descriptor); 7912 } 7913 } 7914 7915 function _createClass(Constructor, protoProps, staticProps) { 7916 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 7917 if (staticProps) _defineProperties(Constructor, staticProps); 7918 return Constructor; 7919 } 7920 7921 function _extends() { 7922 _extends = Object.assign || function (target) { 7923 for (var i = 1; i < arguments.length; i++) { 7924 var source = arguments[i]; 7925 7926 for (var key in source) { 7927 if (Object.prototype.hasOwnProperty.call(source, key)) { 7928 target[key] = source[key]; 7929 } 7930 } 7931 } 7932 7933 return target; 7934 }; 7935 7936 return _extends.apply(this, arguments); 7937 } 7938 7939 function _inheritsLoose(subClass, superClass) { 7940 subClass.prototype = Object.create(superClass.prototype); 7941 subClass.prototype.constructor = subClass; 7942 7943 _setPrototypeOf(subClass, superClass); 7944 } 7945 7946 function _setPrototypeOf(o, p) { 7947 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 7948 o.__proto__ = p; 7949 return o; 7950 }; 7951 7952 return _setPrototypeOf(o, p); 7953 } 7954 7955 /** 7956 * -------------------------------------------------------------------------- 7957 * Bootstrap (v4.6.1): util.js 7958 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 7959 * -------------------------------------------------------------------------- 7960 */ 7961 /** 7962 * Private TransitionEnd Helpers 7963 */ 7964 7965 var TRANSITION_END = 'transitionend'; 7966 var MAX_UID = 1000000; 7967 var MILLISECONDS_MULTIPLIER = 1000; // Shoutout AngusCroll (https://goo.gl/pxwQGp) 7968 7969 function toType(obj) { 7970 if (obj === null || typeof obj === 'undefined') { 7971 return "" + obj; 7972 } 7973 7974 return {}.toString.call(obj).match(/\s([a-z]+)/i)[1].toLowerCase(); 7975 } 7976 7977 function getSpecialTransitionEndEvent() { 7978 return { 7979 bindType: TRANSITION_END, 7980 delegateType: TRANSITION_END, 7981 handle: function handle(event) { 7982 if ($__default["default"](event.target).is(this)) { 7983 return event.handleObj.handler.apply(this, arguments); // eslint-disable-line prefer-rest-params 7984 } 7985 7986 return undefined; 7987 } 7988 }; 7989 } 7990 7991 function transitionEndEmulator(duration) { 7992 var _this = this; 7993 7994 var called = false; 7995 $__default["default"](this).one(Util.TRANSITION_END, function () { 7996 called = true; 7997 }); 7998 setTimeout(function () { 7999 if (!called) { 8000 Util.triggerTransitionEnd(_this); 8001 } 8002 }, duration); 8003 return this; 8004 } 8005 8006 function setTransitionEndSupport() { 8007 $__default["default"].fn.emulateTransitionEnd = transitionEndEmulator; 8008 $__default["default"].event.special[Util.TRANSITION_END] = getSpecialTransitionEndEvent(); 8009 } 8010 /** 8011 * Public Util API 8012 */ 8013 8014 8015 var Util = { 8016 TRANSITION_END: 'bsTransitionEnd', 8017 getUID: function getUID(prefix) { 8018 do { 8019 // eslint-disable-next-line no-bitwise 8020 prefix += ~~(Math.random() * MAX_UID); // "~~" acts like a faster Math.floor() here 8021 } while (document.getElementById(prefix)); 8022 8023 return prefix; 8024 }, 8025 getSelectorFromElement: function getSelectorFromElement(element) { 8026 var selector = element.getAttribute('data-target'); 8027 8028 if (!selector || selector === '#') { 8029 var hrefAttr = element.getAttribute('href'); 8030 selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : ''; 8031 } 8032 8033 try { 8034 return document.querySelector(selector) ? selector : null; 8035 } catch (_) { 8036 return null; 8037 } 8038 }, 8039 getTransitionDurationFromElement: function getTransitionDurationFromElement(element) { 8040 if (!element) { 8041 return 0; 8042 } // Get transition-duration of the element 8043 8044 8045 var transitionDuration = $__default["default"](element).css('transition-duration'); 8046 var transitionDelay = $__default["default"](element).css('transition-delay'); 8047 var floatTransitionDuration = parseFloat(transitionDuration); 8048 var floatTransitionDelay = parseFloat(transitionDelay); // Return 0 if element or transition duration is not found 8049 8050 if (!floatTransitionDuration && !floatTransitionDelay) { 8051 return 0; 8052 } // If multiple durations are defined, take the first 8053 8054 8055 transitionDuration = transitionDuration.split(',')[0]; 8056 transitionDelay = transitionDelay.split(',')[0]; 8057 return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER; 8058 }, 8059 reflow: function reflow(element) { 8060 return element.offsetHeight; 8061 }, 8062 triggerTransitionEnd: function triggerTransitionEnd(element) { 8063 $__default["default"](element).trigger(TRANSITION_END); 8064 }, 8065 supportsTransitionEnd: function supportsTransitionEnd() { 8066 return Boolean(TRANSITION_END); 8067 }, 8068 isElement: function isElement(obj) { 8069 return (obj[0] || obj).nodeType; 8070 }, 8071 typeCheckConfig: function typeCheckConfig(componentName, config, configTypes) { 8072 for (var property in configTypes) { 8073 if (Object.prototype.hasOwnProperty.call(configTypes, property)) { 8074 var expectedTypes = configTypes[property]; 8075 var value = config[property]; 8076 var valueType = value && Util.isElement(value) ? 'element' : toType(value); 8077 8078 if (!new RegExp(expectedTypes).test(valueType)) { 8079 throw new Error(componentName.toUpperCase() + ": " + ("Option \"" + property + "\" provided type \"" + valueType + "\" ") + ("but expected type \"" + expectedTypes + "\".")); 8080 } 8081 } 8082 } 8083 }, 8084 findShadowRoot: function findShadowRoot(element) { 8085 if (!document.documentElement.attachShadow) { 8086 return null; 8087 } // Can find the shadow root otherwise it'll return the document 8088 8089 8090 if (typeof element.getRootNode === 'function') { 8091 var root = element.getRootNode(); 8092 return root instanceof ShadowRoot ? root : null; 8093 } 8094 8095 if (element instanceof ShadowRoot) { 8096 return element; 8097 } // when we don't find a shadow root 8098 8099 8100 if (!element.parentNode) { 8101 return null; 8102 } 8103 8104 return Util.findShadowRoot(element.parentNode); 8105 }, 8106 jQueryDetection: function jQueryDetection() { 8107 if (typeof $__default["default"] === 'undefined') { 8108 throw new TypeError('Bootstrap\'s JavaScript requires jQuery. jQuery must be included before Bootstrap\'s JavaScript.'); 8109 } 8110 8111 var version = $__default["default"].fn.jquery.split(' ')[0].split('.'); 8112 var minMajor = 1; 8113 var ltMajor = 2; 8114 var minMinor = 9; 8115 var minPatch = 1; 8116 var maxMajor = 4; 8117 8118 if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { 8119 throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0'); 8120 } 8121 } 8122 }; 8123 Util.jQueryDetection(); 8124 setTransitionEndSupport(); 8125 8126 /** 8127 * Constants 8128 */ 8129 8130 var NAME$a = 'alert'; 8131 var VERSION$a = '4.6.1'; 8132 var DATA_KEY$a = 'bs.alert'; 8133 var EVENT_KEY$a = "." + DATA_KEY$a; 8134 var DATA_API_KEY$7 = '.data-api'; 8135 var JQUERY_NO_CONFLICT$a = $__default["default"].fn[NAME$a]; 8136 var CLASS_NAME_ALERT = 'alert'; 8137 var CLASS_NAME_FADE$5 = 'fade'; 8138 var CLASS_NAME_SHOW$7 = 'show'; 8139 var EVENT_CLOSE = "close" + EVENT_KEY$a; 8140 var EVENT_CLOSED = "closed" + EVENT_KEY$a; 8141 var EVENT_CLICK_DATA_API$6 = "click" + EVENT_KEY$a + DATA_API_KEY$7; 8142 var SELECTOR_DISMISS = '[data-dismiss="alert"]'; 8143 /** 8144 * Class definition 8145 */ 8146 8147 var Alert = /*#__PURE__*/function () { 8148 function Alert(element) { 8149 this._element = element; 8150 } // Getters 8151 8152 8153 var _proto = Alert.prototype; 8154 8155 // Public 8156 _proto.close = function close(element) { 8157 var rootElement = this._element; 8158 8159 if (element) { 8160 rootElement = this._getRootElement(element); 8161 } 8162 8163 var customEvent = this._triggerCloseEvent(rootElement); 8164 8165 if (customEvent.isDefaultPrevented()) { 8166 return; 8167 } 8168 8169 this._removeElement(rootElement); 8170 }; 8171 8172 _proto.dispose = function dispose() { 8173 $__default["default"].removeData(this._element, DATA_KEY$a); 8174 this._element = null; 8175 } // Private 8176 ; 8177 8178 _proto._getRootElement = function _getRootElement(element) { 8179 var selector = Util.getSelectorFromElement(element); 8180 var parent = false; 8181 8182 if (selector) { 8183 parent = document.querySelector(selector); 8184 } 8185 8186 if (!parent) { 8187 parent = $__default["default"](element).closest("." + CLASS_NAME_ALERT)[0]; 8188 } 8189 8190 return parent; 8191 }; 8192 8193 _proto._triggerCloseEvent = function _triggerCloseEvent(element) { 8194 var closeEvent = $__default["default"].Event(EVENT_CLOSE); 8195 $__default["default"](element).trigger(closeEvent); 8196 return closeEvent; 8197 }; 8198 8199 _proto._removeElement = function _removeElement(element) { 8200 var _this = this; 8201 8202 $__default["default"](element).removeClass(CLASS_NAME_SHOW$7); 8203 8204 if (!$__default["default"](element).hasClass(CLASS_NAME_FADE$5)) { 8205 this._destroyElement(element); 8206 8207 return; 8208 } 8209 8210 var transitionDuration = Util.getTransitionDurationFromElement(element); 8211 $__default["default"](element).one(Util.TRANSITION_END, function (event) { 8212 return _this._destroyElement(element, event); 8213 }).emulateTransitionEnd(transitionDuration); 8214 }; 8215 8216 _proto._destroyElement = function _destroyElement(element) { 8217 $__default["default"](element).detach().trigger(EVENT_CLOSED).remove(); 8218 } // Static 8219 ; 8220 8221 Alert._jQueryInterface = function _jQueryInterface(config) { 8222 return this.each(function () { 8223 var $element = $__default["default"](this); 8224 var data = $element.data(DATA_KEY$a); 8225 8226 if (!data) { 8227 data = new Alert(this); 8228 $element.data(DATA_KEY$a, data); 8229 } 8230 8231 if (config === 'close') { 8232 data[config](this); 8233 } 8234 }); 8235 }; 8236 8237 Alert._handleDismiss = function _handleDismiss(alertInstance) { 8238 return function (event) { 8239 if (event) { 8240 event.preventDefault(); 8241 } 8242 8243 alertInstance.close(this); 8244 }; 8245 }; 8246 8247 _createClass(Alert, null, [{ 8248 key: "VERSION", 8249 get: function get() { 8250 return VERSION$a; 8251 } 8252 }]); 8253 8254 return Alert; 8255 }(); 8256 /** 8257 * Data API implementation 8258 */ 8259 8260 8261 $__default["default"](document).on(EVENT_CLICK_DATA_API$6, SELECTOR_DISMISS, Alert._handleDismiss(new Alert())); 8262 /** 8263 * jQuery 8264 */ 8265 8266 $__default["default"].fn[NAME$a] = Alert._jQueryInterface; 8267 $__default["default"].fn[NAME$a].Constructor = Alert; 8268 8269 $__default["default"].fn[NAME$a].noConflict = function () { 8270 $__default["default"].fn[NAME$a] = JQUERY_NO_CONFLICT$a; 8271 return Alert._jQueryInterface; 8272 }; 8273 8274 /** 8275 * Constants 8276 */ 8277 8278 var NAME$9 = 'button'; 8279 var VERSION$9 = '4.6.1'; 8280 var DATA_KEY$9 = 'bs.button'; 8281 var EVENT_KEY$9 = "." + DATA_KEY$9; 8282 var DATA_API_KEY$6 = '.data-api'; 8283 var JQUERY_NO_CONFLICT$9 = $__default["default"].fn[NAME$9]; 8284 var CLASS_NAME_ACTIVE$3 = 'active'; 8285 var CLASS_NAME_BUTTON = 'btn'; 8286 var CLASS_NAME_FOCUS = 'focus'; 8287 var EVENT_CLICK_DATA_API$5 = "click" + EVENT_KEY$9 + DATA_API_KEY$6; 8288 var EVENT_FOCUS_BLUR_DATA_API = "focus" + EVENT_KEY$9 + DATA_API_KEY$6 + " " + ("blur" + EVENT_KEY$9 + DATA_API_KEY$6); 8289 var EVENT_LOAD_DATA_API$2 = "load" + EVENT_KEY$9 + DATA_API_KEY$6; 8290 var SELECTOR_DATA_TOGGLE_CARROT = '[data-toggle^="button"]'; 8291 var SELECTOR_DATA_TOGGLES = '[data-toggle="buttons"]'; 8292 var SELECTOR_DATA_TOGGLE$4 = '[data-toggle="button"]'; 8293 var SELECTOR_DATA_TOGGLES_BUTTONS = '[data-toggle="buttons"] .btn'; 8294 var SELECTOR_INPUT = 'input:not([type="hidden"])'; 8295 var SELECTOR_ACTIVE$2 = '.active'; 8296 var SELECTOR_BUTTON = '.btn'; 8297 /** 8298 * Class definition 8299 */ 8300 8301 var Button = /*#__PURE__*/function () { 8302 function Button(element) { 8303 this._element = element; 8304 this.shouldAvoidTriggerChange = false; 8305 } // Getters 8306 8307 8308 var _proto = Button.prototype; 8309 8310 // Public 8311 _proto.toggle = function toggle() { 8312 var triggerChangeEvent = true; 8313 var addAriaPressed = true; 8314 var rootElement = $__default["default"](this._element).closest(SELECTOR_DATA_TOGGLES)[0]; 8315 8316 if (rootElement) { 8317 var input = this._element.querySelector(SELECTOR_INPUT); 8318 8319 if (input) { 8320 if (input.type === 'radio') { 8321 if (input.checked && this._element.classList.contains(CLASS_NAME_ACTIVE$3)) { 8322 triggerChangeEvent = false; 8323 } else { 8324 var activeElement = rootElement.querySelector(SELECTOR_ACTIVE$2); 8325 8326 if (activeElement) { 8327 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$3); 8328 } 8329 } 8330 } 8331 8332 if (triggerChangeEvent) { 8333 // if it's not a radio button or checkbox don't add a pointless/invalid checked property to the input 8334 if (input.type === 'checkbox' || input.type === 'radio') { 8335 input.checked = !this._element.classList.contains(CLASS_NAME_ACTIVE$3); 8336 } 8337 8338 if (!this.shouldAvoidTriggerChange) { 8339 $__default["default"](input).trigger('change'); 8340 } 8341 } 8342 8343 input.focus(); 8344 addAriaPressed = false; 8345 } 8346 } 8347 8348 if (!(this._element.hasAttribute('disabled') || this._element.classList.contains('disabled'))) { 8349 if (addAriaPressed) { 8350 this._element.setAttribute('aria-pressed', !this._element.classList.contains(CLASS_NAME_ACTIVE$3)); 8351 } 8352 8353 if (triggerChangeEvent) { 8354 $__default["default"](this._element).toggleClass(CLASS_NAME_ACTIVE$3); 8355 } 8356 } 8357 }; 8358 8359 _proto.dispose = function dispose() { 8360 $__default["default"].removeData(this._element, DATA_KEY$9); 8361 this._element = null; 8362 } // Static 8363 ; 8364 8365 Button._jQueryInterface = function _jQueryInterface(config, avoidTriggerChange) { 8366 return this.each(function () { 8367 var $element = $__default["default"](this); 8368 var data = $element.data(DATA_KEY$9); 8369 8370 if (!data) { 8371 data = new Button(this); 8372 $element.data(DATA_KEY$9, data); 8373 } 8374 8375 data.shouldAvoidTriggerChange = avoidTriggerChange; 8376 8377 if (config === 'toggle') { 8378 data[config](); 8379 } 8380 }); 8381 }; 8382 8383 _createClass(Button, null, [{ 8384 key: "VERSION", 8385 get: function get() { 8386 return VERSION$9; 8387 } 8388 }]); 8389 8390 return Button; 8391 }(); 8392 /** 8393 * Data API implementation 8394 */ 8395 8396 8397 $__default["default"](document).on(EVENT_CLICK_DATA_API$5, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 8398 var button = event.target; 8399 var initialButton = button; 8400 8401 if (!$__default["default"](button).hasClass(CLASS_NAME_BUTTON)) { 8402 button = $__default["default"](button).closest(SELECTOR_BUTTON)[0]; 8403 } 8404 8405 if (!button || button.hasAttribute('disabled') || button.classList.contains('disabled')) { 8406 event.preventDefault(); // work around Firefox bug #1540995 8407 } else { 8408 var inputBtn = button.querySelector(SELECTOR_INPUT); 8409 8410 if (inputBtn && (inputBtn.hasAttribute('disabled') || inputBtn.classList.contains('disabled'))) { 8411 event.preventDefault(); // work around Firefox bug #1540995 8412 8413 return; 8414 } 8415 8416 if (initialButton.tagName === 'INPUT' || button.tagName !== 'LABEL') { 8417 Button._jQueryInterface.call($__default["default"](button), 'toggle', initialButton.tagName === 'INPUT'); 8418 } 8419 } 8420 }).on(EVENT_FOCUS_BLUR_DATA_API, SELECTOR_DATA_TOGGLE_CARROT, function (event) { 8421 var button = $__default["default"](event.target).closest(SELECTOR_BUTTON)[0]; 8422 $__default["default"](button).toggleClass(CLASS_NAME_FOCUS, /^focus(in)?$/.test(event.type)); 8423 }); 8424 $__default["default"](window).on(EVENT_LOAD_DATA_API$2, function () { 8425 // ensure correct active class is set to match the controls' actual values/states 8426 // find all checkboxes/readio buttons inside data-toggle groups 8427 var buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLES_BUTTONS)); 8428 8429 for (var i = 0, len = buttons.length; i < len; i++) { 8430 var button = buttons[i]; 8431 var input = button.querySelector(SELECTOR_INPUT); 8432 8433 if (input.checked || input.hasAttribute('checked')) { 8434 button.classList.add(CLASS_NAME_ACTIVE$3); 8435 } else { 8436 button.classList.remove(CLASS_NAME_ACTIVE$3); 8437 } 8438 } // find all button toggles 8439 8440 8441 buttons = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$4)); 8442 8443 for (var _i = 0, _len = buttons.length; _i < _len; _i++) { 8444 var _button = buttons[_i]; 8445 8446 if (_button.getAttribute('aria-pressed') === 'true') { 8447 _button.classList.add(CLASS_NAME_ACTIVE$3); 8448 } else { 8449 _button.classList.remove(CLASS_NAME_ACTIVE$3); 8450 } 8451 } 8452 }); 8453 /** 8454 * jQuery 8455 */ 8456 8457 $__default["default"].fn[NAME$9] = Button._jQueryInterface; 8458 $__default["default"].fn[NAME$9].Constructor = Button; 8459 8460 $__default["default"].fn[NAME$9].noConflict = function () { 8461 $__default["default"].fn[NAME$9] = JQUERY_NO_CONFLICT$9; 8462 return Button._jQueryInterface; 8463 }; 8464 8465 /** 8466 * Constants 8467 */ 8468 8469 var NAME$8 = 'carousel'; 8470 var VERSION$8 = '4.6.1'; 8471 var DATA_KEY$8 = 'bs.carousel'; 8472 var EVENT_KEY$8 = "." + DATA_KEY$8; 8473 var DATA_API_KEY$5 = '.data-api'; 8474 var JQUERY_NO_CONFLICT$8 = $__default["default"].fn[NAME$8]; 8475 var ARROW_LEFT_KEYCODE = 37; // KeyboardEvent.which value for left arrow key 8476 8477 var ARROW_RIGHT_KEYCODE = 39; // KeyboardEvent.which value for right arrow key 8478 8479 var TOUCHEVENT_COMPAT_WAIT = 500; // Time for mouse compat events to fire after touch 8480 8481 var SWIPE_THRESHOLD = 40; 8482 var CLASS_NAME_CAROUSEL = 'carousel'; 8483 var CLASS_NAME_ACTIVE$2 = 'active'; 8484 var CLASS_NAME_SLIDE = 'slide'; 8485 var CLASS_NAME_RIGHT = 'carousel-item-right'; 8486 var CLASS_NAME_LEFT = 'carousel-item-left'; 8487 var CLASS_NAME_NEXT = 'carousel-item-next'; 8488 var CLASS_NAME_PREV = 'carousel-item-prev'; 8489 var CLASS_NAME_POINTER_EVENT = 'pointer-event'; 8490 var DIRECTION_NEXT = 'next'; 8491 var DIRECTION_PREV = 'prev'; 8492 var DIRECTION_LEFT = 'left'; 8493 var DIRECTION_RIGHT = 'right'; 8494 var EVENT_SLIDE = "slide" + EVENT_KEY$8; 8495 var EVENT_SLID = "slid" + EVENT_KEY$8; 8496 var EVENT_KEYDOWN = "keydown" + EVENT_KEY$8; 8497 var EVENT_MOUSEENTER = "mouseenter" + EVENT_KEY$8; 8498 var EVENT_MOUSELEAVE = "mouseleave" + EVENT_KEY$8; 8499 var EVENT_TOUCHSTART = "touchstart" + EVENT_KEY$8; 8500 var EVENT_TOUCHMOVE = "touchmove" + EVENT_KEY$8; 8501 var EVENT_TOUCHEND = "touchend" + EVENT_KEY$8; 8502 var EVENT_POINTERDOWN = "pointerdown" + EVENT_KEY$8; 8503 var EVENT_POINTERUP = "pointerup" + EVENT_KEY$8; 8504 var EVENT_DRAG_START = "dragstart" + EVENT_KEY$8; 8505 var EVENT_LOAD_DATA_API$1 = "load" + EVENT_KEY$8 + DATA_API_KEY$5; 8506 var EVENT_CLICK_DATA_API$4 = "click" + EVENT_KEY$8 + DATA_API_KEY$5; 8507 var SELECTOR_ACTIVE$1 = '.active'; 8508 var SELECTOR_ACTIVE_ITEM = '.active.carousel-item'; 8509 var SELECTOR_ITEM = '.carousel-item'; 8510 var SELECTOR_ITEM_IMG = '.carousel-item img'; 8511 var SELECTOR_NEXT_PREV = '.carousel-item-next, .carousel-item-prev'; 8512 var SELECTOR_INDICATORS = '.carousel-indicators'; 8513 var SELECTOR_DATA_SLIDE = '[data-slide], [data-slide-to]'; 8514 var SELECTOR_DATA_RIDE = '[data-ride="carousel"]'; 8515 var Default$7 = { 8516 interval: 5000, 8517 keyboard: true, 8518 slide: false, 8519 pause: 'hover', 8520 wrap: true, 8521 touch: true 8522 }; 8523 var DefaultType$7 = { 8524 interval: '(number|boolean)', 8525 keyboard: 'boolean', 8526 slide: '(boolean|string)', 8527 pause: '(string|boolean)', 8528 wrap: 'boolean', 8529 touch: 'boolean' 8530 }; 8531 var PointerType = { 8532 TOUCH: 'touch', 8533 PEN: 'pen' 8534 }; 8535 /** 8536 * Class definition 8537 */ 8538 8539 var Carousel = /*#__PURE__*/function () { 8540 function Carousel(element, config) { 8541 this._items = null; 8542 this._interval = null; 8543 this._activeElement = null; 8544 this._isPaused = false; 8545 this._isSliding = false; 8546 this.touchTimeout = null; 8547 this.touchStartX = 0; 8548 this.touchDeltaX = 0; 8549 this._config = this._getConfig(config); 8550 this._element = element; 8551 this._indicatorsElement = this._element.querySelector(SELECTOR_INDICATORS); 8552 this._touchSupported = 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; 8553 this._pointerEvent = Boolean(window.PointerEvent || window.MSPointerEvent); 8554 8555 this._addEventListeners(); 8556 } // Getters 8557 8558 8559 var _proto = Carousel.prototype; 8560 8561 // Public 8562 _proto.next = function next() { 8563 if (!this._isSliding) { 8564 this._slide(DIRECTION_NEXT); 8565 } 8566 }; 8567 8568 _proto.nextWhenVisible = function nextWhenVisible() { 8569 var $element = $__default["default"](this._element); // Don't call next when the page isn't visible 8570 // or the carousel or its parent isn't visible 8571 8572 if (!document.hidden && $element.is(':visible') && $element.css('visibility') !== 'hidden') { 8573 this.next(); 8574 } 8575 }; 8576 8577 _proto.prev = function prev() { 8578 if (!this._isSliding) { 8579 this._slide(DIRECTION_PREV); 8580 } 8581 }; 8582 8583 _proto.pause = function pause(event) { 8584 if (!event) { 8585 this._isPaused = true; 8586 } 8587 8588 if (this._element.querySelector(SELECTOR_NEXT_PREV)) { 8589 Util.triggerTransitionEnd(this._element); 8590 this.cycle(true); 8591 } 8592 8593 clearInterval(this._interval); 8594 this._interval = null; 8595 }; 8596 8597 _proto.cycle = function cycle(event) { 8598 if (!event) { 8599 this._isPaused = false; 8600 } 8601 8602 if (this._interval) { 8603 clearInterval(this._interval); 8604 this._interval = null; 8605 } 8606 8607 if (this._config.interval && !this._isPaused) { 8608 this._updateInterval(); 8609 8610 this._interval = setInterval((document.visibilityState ? this.nextWhenVisible : this.next).bind(this), this._config.interval); 8611 } 8612 }; 8613 8614 _proto.to = function to(index) { 8615 var _this = this; 8616 8617 this._activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 8618 8619 var activeIndex = this._getItemIndex(this._activeElement); 8620 8621 if (index > this._items.length - 1 || index < 0) { 8622 return; 8623 } 8624 8625 if (this._isSliding) { 8626 $__default["default"](this._element).one(EVENT_SLID, function () { 8627 return _this.to(index); 8628 }); 8629 return; 8630 } 8631 8632 if (activeIndex === index) { 8633 this.pause(); 8634 this.cycle(); 8635 return; 8636 } 8637 8638 var direction = index > activeIndex ? DIRECTION_NEXT : DIRECTION_PREV; 8639 8640 this._slide(direction, this._items[index]); 8641 }; 8642 8643 _proto.dispose = function dispose() { 8644 $__default["default"](this._element).off(EVENT_KEY$8); 8645 $__default["default"].removeData(this._element, DATA_KEY$8); 8646 this._items = null; 8647 this._config = null; 8648 this._element = null; 8649 this._interval = null; 8650 this._isPaused = null; 8651 this._isSliding = null; 8652 this._activeElement = null; 8653 this._indicatorsElement = null; 8654 } // Private 8655 ; 8656 8657 _proto._getConfig = function _getConfig(config) { 8658 config = _extends({}, Default$7, config); 8659 Util.typeCheckConfig(NAME$8, config, DefaultType$7); 8660 return config; 8661 }; 8662 8663 _proto._handleSwipe = function _handleSwipe() { 8664 var absDeltax = Math.abs(this.touchDeltaX); 8665 8666 if (absDeltax <= SWIPE_THRESHOLD) { 8667 return; 8668 } 8669 8670 var direction = absDeltax / this.touchDeltaX; 8671 this.touchDeltaX = 0; // swipe left 8672 8673 if (direction > 0) { 8674 this.prev(); 8675 } // swipe right 8676 8677 8678 if (direction < 0) { 8679 this.next(); 8680 } 8681 }; 8682 8683 _proto._addEventListeners = function _addEventListeners() { 8684 var _this2 = this; 8685 8686 if (this._config.keyboard) { 8687 $__default["default"](this._element).on(EVENT_KEYDOWN, function (event) { 8688 return _this2._keydown(event); 8689 }); 8690 } 8691 8692 if (this._config.pause === 'hover') { 8693 $__default["default"](this._element).on(EVENT_MOUSEENTER, function (event) { 8694 return _this2.pause(event); 8695 }).on(EVENT_MOUSELEAVE, function (event) { 8696 return _this2.cycle(event); 8697 }); 8698 } 8699 8700 if (this._config.touch) { 8701 this._addTouchEventListeners(); 8702 } 8703 }; 8704 8705 _proto._addTouchEventListeners = function _addTouchEventListeners() { 8706 var _this3 = this; 8707 8708 if (!this._touchSupported) { 8709 return; 8710 } 8711 8712 var start = function start(event) { 8713 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 8714 _this3.touchStartX = event.originalEvent.clientX; 8715 } else if (!_this3._pointerEvent) { 8716 _this3.touchStartX = event.originalEvent.touches[0].clientX; 8717 } 8718 }; 8719 8720 var move = function move(event) { 8721 // ensure swiping with one touch and not pinching 8722 _this3.touchDeltaX = event.originalEvent.touches && event.originalEvent.touches.length > 1 ? 0 : event.originalEvent.touches[0].clientX - _this3.touchStartX; 8723 }; 8724 8725 var end = function end(event) { 8726 if (_this3._pointerEvent && PointerType[event.originalEvent.pointerType.toUpperCase()]) { 8727 _this3.touchDeltaX = event.originalEvent.clientX - _this3.touchStartX; 8728 } 8729 8730 _this3._handleSwipe(); 8731 8732 if (_this3._config.pause === 'hover') { 8733 // If it's a touch-enabled device, mouseenter/leave are fired as 8734 // part of the mouse compatibility events on first tap - the carousel 8735 // would stop cycling until user tapped out of it; 8736 // here, we listen for touchend, explicitly pause the carousel 8737 // (as if it's the second time we tap on it, mouseenter compat event 8738 // is NOT fired) and after a timeout (to allow for mouse compatibility 8739 // events to fire) we explicitly restart cycling 8740 _this3.pause(); 8741 8742 if (_this3.touchTimeout) { 8743 clearTimeout(_this3.touchTimeout); 8744 } 8745 8746 _this3.touchTimeout = setTimeout(function (event) { 8747 return _this3.cycle(event); 8748 }, TOUCHEVENT_COMPAT_WAIT + _this3._config.interval); 8749 } 8750 }; 8751 8752 $__default["default"](this._element.querySelectorAll(SELECTOR_ITEM_IMG)).on(EVENT_DRAG_START, function (e) { 8753 return e.preventDefault(); 8754 }); 8755 8756 if (this._pointerEvent) { 8757 $__default["default"](this._element).on(EVENT_POINTERDOWN, function (event) { 8758 return start(event); 8759 }); 8760 $__default["default"](this._element).on(EVENT_POINTERUP, function (event) { 8761 return end(event); 8762 }); 8763 8764 this._element.classList.add(CLASS_NAME_POINTER_EVENT); 8765 } else { 8766 $__default["default"](this._element).on(EVENT_TOUCHSTART, function (event) { 8767 return start(event); 8768 }); 8769 $__default["default"](this._element).on(EVENT_TOUCHMOVE, function (event) { 8770 return move(event); 8771 }); 8772 $__default["default"](this._element).on(EVENT_TOUCHEND, function (event) { 8773 return end(event); 8774 }); 8775 } 8776 }; 8777 8778 _proto._keydown = function _keydown(event) { 8779 if (/input|textarea/i.test(event.target.tagName)) { 8780 return; 8781 } 8782 8783 switch (event.which) { 8784 case ARROW_LEFT_KEYCODE: 8785 event.preventDefault(); 8786 this.prev(); 8787 break; 8788 8789 case ARROW_RIGHT_KEYCODE: 8790 event.preventDefault(); 8791 this.next(); 8792 break; 8793 } 8794 }; 8795 8796 _proto._getItemIndex = function _getItemIndex(element) { 8797 this._items = element && element.parentNode ? [].slice.call(element.parentNode.querySelectorAll(SELECTOR_ITEM)) : []; 8798 return this._items.indexOf(element); 8799 }; 8800 8801 _proto._getItemByDirection = function _getItemByDirection(direction, activeElement) { 8802 var isNextDirection = direction === DIRECTION_NEXT; 8803 var isPrevDirection = direction === DIRECTION_PREV; 8804 8805 var activeIndex = this._getItemIndex(activeElement); 8806 8807 var lastItemIndex = this._items.length - 1; 8808 var isGoingToWrap = isPrevDirection && activeIndex === 0 || isNextDirection && activeIndex === lastItemIndex; 8809 8810 if (isGoingToWrap && !this._config.wrap) { 8811 return activeElement; 8812 } 8813 8814 var delta = direction === DIRECTION_PREV ? -1 : 1; 8815 var itemIndex = (activeIndex + delta) % this._items.length; 8816 return itemIndex === -1 ? this._items[this._items.length - 1] : this._items[itemIndex]; 8817 }; 8818 8819 _proto._triggerSlideEvent = function _triggerSlideEvent(relatedTarget, eventDirectionName) { 8820 var targetIndex = this._getItemIndex(relatedTarget); 8821 8822 var fromIndex = this._getItemIndex(this._element.querySelector(SELECTOR_ACTIVE_ITEM)); 8823 8824 var slideEvent = $__default["default"].Event(EVENT_SLIDE, { 8825 relatedTarget: relatedTarget, 8826 direction: eventDirectionName, 8827 from: fromIndex, 8828 to: targetIndex 8829 }); 8830 $__default["default"](this._element).trigger(slideEvent); 8831 return slideEvent; 8832 }; 8833 8834 _proto._setActiveIndicatorElement = function _setActiveIndicatorElement(element) { 8835 if (this._indicatorsElement) { 8836 var indicators = [].slice.call(this._indicatorsElement.querySelectorAll(SELECTOR_ACTIVE$1)); 8837 $__default["default"](indicators).removeClass(CLASS_NAME_ACTIVE$2); 8838 8839 var nextIndicator = this._indicatorsElement.children[this._getItemIndex(element)]; 8840 8841 if (nextIndicator) { 8842 $__default["default"](nextIndicator).addClass(CLASS_NAME_ACTIVE$2); 8843 } 8844 } 8845 }; 8846 8847 _proto._updateInterval = function _updateInterval() { 8848 var element = this._activeElement || this._element.querySelector(SELECTOR_ACTIVE_ITEM); 8849 8850 if (!element) { 8851 return; 8852 } 8853 8854 var elementInterval = parseInt(element.getAttribute('data-interval'), 10); 8855 8856 if (elementInterval) { 8857 this._config.defaultInterval = this._config.defaultInterval || this._config.interval; 8858 this._config.interval = elementInterval; 8859 } else { 8860 this._config.interval = this._config.defaultInterval || this._config.interval; 8861 } 8862 }; 8863 8864 _proto._slide = function _slide(direction, element) { 8865 var _this4 = this; 8866 8867 var activeElement = this._element.querySelector(SELECTOR_ACTIVE_ITEM); 8868 8869 var activeElementIndex = this._getItemIndex(activeElement); 8870 8871 var nextElement = element || activeElement && this._getItemByDirection(direction, activeElement); 8872 8873 var nextElementIndex = this._getItemIndex(nextElement); 8874 8875 var isCycling = Boolean(this._interval); 8876 var directionalClassName; 8877 var orderClassName; 8878 var eventDirectionName; 8879 8880 if (direction === DIRECTION_NEXT) { 8881 directionalClassName = CLASS_NAME_LEFT; 8882 orderClassName = CLASS_NAME_NEXT; 8883 eventDirectionName = DIRECTION_LEFT; 8884 } else { 8885 directionalClassName = CLASS_NAME_RIGHT; 8886 orderClassName = CLASS_NAME_PREV; 8887 eventDirectionName = DIRECTION_RIGHT; 8888 } 8889 8890 if (nextElement && $__default["default"](nextElement).hasClass(CLASS_NAME_ACTIVE$2)) { 8891 this._isSliding = false; 8892 return; 8893 } 8894 8895 var slideEvent = this._triggerSlideEvent(nextElement, eventDirectionName); 8896 8897 if (slideEvent.isDefaultPrevented()) { 8898 return; 8899 } 8900 8901 if (!activeElement || !nextElement) { 8902 // Some weirdness is happening, so we bail 8903 return; 8904 } 8905 8906 this._isSliding = true; 8907 8908 if (isCycling) { 8909 this.pause(); 8910 } 8911 8912 this._setActiveIndicatorElement(nextElement); 8913 8914 this._activeElement = nextElement; 8915 var slidEvent = $__default["default"].Event(EVENT_SLID, { 8916 relatedTarget: nextElement, 8917 direction: eventDirectionName, 8918 from: activeElementIndex, 8919 to: nextElementIndex 8920 }); 8921 8922 if ($__default["default"](this._element).hasClass(CLASS_NAME_SLIDE)) { 8923 $__default["default"](nextElement).addClass(orderClassName); 8924 Util.reflow(nextElement); 8925 $__default["default"](activeElement).addClass(directionalClassName); 8926 $__default["default"](nextElement).addClass(directionalClassName); 8927 var transitionDuration = Util.getTransitionDurationFromElement(activeElement); 8928 $__default["default"](activeElement).one(Util.TRANSITION_END, function () { 8929 $__default["default"](nextElement).removeClass(directionalClassName + " " + orderClassName).addClass(CLASS_NAME_ACTIVE$2); 8930 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2 + " " + orderClassName + " " + directionalClassName); 8931 _this4._isSliding = false; 8932 setTimeout(function () { 8933 return $__default["default"](_this4._element).trigger(slidEvent); 8934 }, 0); 8935 }).emulateTransitionEnd(transitionDuration); 8936 } else { 8937 $__default["default"](activeElement).removeClass(CLASS_NAME_ACTIVE$2); 8938 $__default["default"](nextElement).addClass(CLASS_NAME_ACTIVE$2); 8939 this._isSliding = false; 8940 $__default["default"](this._element).trigger(slidEvent); 8941 } 8942 8943 if (isCycling) { 8944 this.cycle(); 8945 } 8946 } // Static 8947 ; 8948 8949 Carousel._jQueryInterface = function _jQueryInterface(config) { 8950 return this.each(function () { 8951 var data = $__default["default"](this).data(DATA_KEY$8); 8952 8953 var _config = _extends({}, Default$7, $__default["default"](this).data()); 8954 8955 if (typeof config === 'object') { 8956 _config = _extends({}, _config, config); 8957 } 8958 8959 var action = typeof config === 'string' ? config : _config.slide; 8960 8961 if (!data) { 8962 data = new Carousel(this, _config); 8963 $__default["default"](this).data(DATA_KEY$8, data); 8964 } 8965 8966 if (typeof config === 'number') { 8967 data.to(config); 8968 } else if (typeof action === 'string') { 8969 if (typeof data[action] === 'undefined') { 8970 throw new TypeError("No method named \"" + action + "\""); 8971 } 8972 8973 data[action](); 8974 } else if (_config.interval && _config.ride) { 8975 data.pause(); 8976 data.cycle(); 8977 } 8978 }); 8979 }; 8980 8981 Carousel._dataApiClickHandler = function _dataApiClickHandler(event) { 8982 var selector = Util.getSelectorFromElement(this); 8983 8984 if (!selector) { 8985 return; 8986 } 8987 8988 var target = $__default["default"](selector)[0]; 8989 8990 if (!target || !$__default["default"](target).hasClass(CLASS_NAME_CAROUSEL)) { 8991 return; 8992 } 8993 8994 var config = _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 8995 8996 var slideIndex = this.getAttribute('data-slide-to'); 8997 8998 if (slideIndex) { 8999 config.interval = false; 9000 } 9001 9002 Carousel._jQueryInterface.call($__default["default"](target), config); 9003 9004 if (slideIndex) { 9005 $__default["default"](target).data(DATA_KEY$8).to(slideIndex); 9006 } 9007 9008 event.preventDefault(); 9009 }; 9010 9011 _createClass(Carousel, null, [{ 9012 key: "VERSION", 9013 get: function get() { 9014 return VERSION$8; 9015 } 9016 }, { 9017 key: "Default", 9018 get: function get() { 9019 return Default$7; 9020 } 9021 }]); 9022 9023 return Carousel; 9024 }(); 9025 /** 9026 * Data API implementation 9027 */ 9028 9029 9030 $__default["default"](document).on(EVENT_CLICK_DATA_API$4, SELECTOR_DATA_SLIDE, Carousel._dataApiClickHandler); 9031 $__default["default"](window).on(EVENT_LOAD_DATA_API$1, function () { 9032 var carousels = [].slice.call(document.querySelectorAll(SELECTOR_DATA_RIDE)); 9033 9034 for (var i = 0, len = carousels.length; i < len; i++) { 9035 var $carousel = $__default["default"](carousels[i]); 9036 9037 Carousel._jQueryInterface.call($carousel, $carousel.data()); 9038 } 9039 }); 9040 /** 9041 * jQuery 9042 */ 9043 9044 $__default["default"].fn[NAME$8] = Carousel._jQueryInterface; 9045 $__default["default"].fn[NAME$8].Constructor = Carousel; 9046 9047 $__default["default"].fn[NAME$8].noConflict = function () { 9048 $__default["default"].fn[NAME$8] = JQUERY_NO_CONFLICT$8; 9049 return Carousel._jQueryInterface; 9050 }; 9051 9052 /** 9053 * Constants 9054 */ 9055 9056 var NAME$7 = 'collapse'; 9057 var VERSION$7 = '4.6.1'; 9058 var DATA_KEY$7 = 'bs.collapse'; 9059 var EVENT_KEY$7 = "." + DATA_KEY$7; 9060 var DATA_API_KEY$4 = '.data-api'; 9061 var JQUERY_NO_CONFLICT$7 = $__default["default"].fn[NAME$7]; 9062 var CLASS_NAME_SHOW$6 = 'show'; 9063 var CLASS_NAME_COLLAPSE = 'collapse'; 9064 var CLASS_NAME_COLLAPSING = 'collapsing'; 9065 var CLASS_NAME_COLLAPSED = 'collapsed'; 9066 var DIMENSION_WIDTH = 'width'; 9067 var DIMENSION_HEIGHT = 'height'; 9068 var EVENT_SHOW$4 = "show" + EVENT_KEY$7; 9069 var EVENT_SHOWN$4 = "shown" + EVENT_KEY$7; 9070 var EVENT_HIDE$4 = "hide" + EVENT_KEY$7; 9071 var EVENT_HIDDEN$4 = "hidden" + EVENT_KEY$7; 9072 var EVENT_CLICK_DATA_API$3 = "click" + EVENT_KEY$7 + DATA_API_KEY$4; 9073 var SELECTOR_ACTIVES = '.show, .collapsing'; 9074 var SELECTOR_DATA_TOGGLE$3 = '[data-toggle="collapse"]'; 9075 var Default$6 = { 9076 toggle: true, 9077 parent: '' 9078 }; 9079 var DefaultType$6 = { 9080 toggle: 'boolean', 9081 parent: '(string|element)' 9082 }; 9083 /** 9084 * Class definition 9085 */ 9086 9087 var Collapse = /*#__PURE__*/function () { 9088 function Collapse(element, config) { 9089 this._isTransitioning = false; 9090 this._element = element; 9091 this._config = this._getConfig(config); 9092 this._triggerArray = [].slice.call(document.querySelectorAll("[data-toggle=\"collapse\"][href=\"#" + element.id + "\"]," + ("[data-toggle=\"collapse\"][data-target=\"#" + element.id + "\"]"))); 9093 var toggleList = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$3)); 9094 9095 for (var i = 0, len = toggleList.length; i < len; i++) { 9096 var elem = toggleList[i]; 9097 var selector = Util.getSelectorFromElement(elem); 9098 var filterElement = [].slice.call(document.querySelectorAll(selector)).filter(function (foundElem) { 9099 return foundElem === element; 9100 }); 9101 9102 if (selector !== null && filterElement.length > 0) { 9103 this._selector = selector; 9104 9105 this._triggerArray.push(elem); 9106 } 9107 } 9108 9109 this._parent = this._config.parent ? this._getParent() : null; 9110 9111 if (!this._config.parent) { 9112 this._addAriaAndCollapsedClass(this._element, this._triggerArray); 9113 } 9114 9115 if (this._config.toggle) { 9116 this.toggle(); 9117 } 9118 } // Getters 9119 9120 9121 var _proto = Collapse.prototype; 9122 9123 // Public 9124 _proto.toggle = function toggle() { 9125 if ($__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 9126 this.hide(); 9127 } else { 9128 this.show(); 9129 } 9130 }; 9131 9132 _proto.show = function show() { 9133 var _this = this; 9134 9135 if (this._isTransitioning || $__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 9136 return; 9137 } 9138 9139 var actives; 9140 var activesData; 9141 9142 if (this._parent) { 9143 actives = [].slice.call(this._parent.querySelectorAll(SELECTOR_ACTIVES)).filter(function (elem) { 9144 if (typeof _this._config.parent === 'string') { 9145 return elem.getAttribute('data-parent') === _this._config.parent; 9146 } 9147 9148 return elem.classList.contains(CLASS_NAME_COLLAPSE); 9149 }); 9150 9151 if (actives.length === 0) { 9152 actives = null; 9153 } 9154 } 9155 9156 if (actives) { 9157 activesData = $__default["default"](actives).not(this._selector).data(DATA_KEY$7); 9158 9159 if (activesData && activesData._isTransitioning) { 9160 return; 9161 } 9162 } 9163 9164 var startEvent = $__default["default"].Event(EVENT_SHOW$4); 9165 $__default["default"](this._element).trigger(startEvent); 9166 9167 if (startEvent.isDefaultPrevented()) { 9168 return; 9169 } 9170 9171 if (actives) { 9172 Collapse._jQueryInterface.call($__default["default"](actives).not(this._selector), 'hide'); 9173 9174 if (!activesData) { 9175 $__default["default"](actives).data(DATA_KEY$7, null); 9176 } 9177 } 9178 9179 var dimension = this._getDimension(); 9180 9181 $__default["default"](this._element).removeClass(CLASS_NAME_COLLAPSE).addClass(CLASS_NAME_COLLAPSING); 9182 this._element.style[dimension] = 0; 9183 9184 if (this._triggerArray.length) { 9185 $__default["default"](this._triggerArray).removeClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', true); 9186 } 9187 9188 this.setTransitioning(true); 9189 9190 var complete = function complete() { 9191 $__default["default"](_this._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 9192 _this._element.style[dimension] = ''; 9193 9194 _this.setTransitioning(false); 9195 9196 $__default["default"](_this._element).trigger(EVENT_SHOWN$4); 9197 }; 9198 9199 var capitalizedDimension = dimension[0].toUpperCase() + dimension.slice(1); 9200 var scrollSize = "scroll" + capitalizedDimension; 9201 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 9202 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 9203 this._element.style[dimension] = this._element[scrollSize] + "px"; 9204 }; 9205 9206 _proto.hide = function hide() { 9207 var _this2 = this; 9208 9209 if (this._isTransitioning || !$__default["default"](this._element).hasClass(CLASS_NAME_SHOW$6)) { 9210 return; 9211 } 9212 9213 var startEvent = $__default["default"].Event(EVENT_HIDE$4); 9214 $__default["default"](this._element).trigger(startEvent); 9215 9216 if (startEvent.isDefaultPrevented()) { 9217 return; 9218 } 9219 9220 var dimension = this._getDimension(); 9221 9222 this._element.style[dimension] = this._element.getBoundingClientRect()[dimension] + "px"; 9223 Util.reflow(this._element); 9224 $__default["default"](this._element).addClass(CLASS_NAME_COLLAPSING).removeClass(CLASS_NAME_COLLAPSE + " " + CLASS_NAME_SHOW$6); 9225 var triggerArrayLength = this._triggerArray.length; 9226 9227 if (triggerArrayLength > 0) { 9228 for (var i = 0; i < triggerArrayLength; i++) { 9229 var trigger = this._triggerArray[i]; 9230 var selector = Util.getSelectorFromElement(trigger); 9231 9232 if (selector !== null) { 9233 var $elem = $__default["default"]([].slice.call(document.querySelectorAll(selector))); 9234 9235 if (!$elem.hasClass(CLASS_NAME_SHOW$6)) { 9236 $__default["default"](trigger).addClass(CLASS_NAME_COLLAPSED).attr('aria-expanded', false); 9237 } 9238 } 9239 } 9240 } 9241 9242 this.setTransitioning(true); 9243 9244 var complete = function complete() { 9245 _this2.setTransitioning(false); 9246 9247 $__default["default"](_this2._element).removeClass(CLASS_NAME_COLLAPSING).addClass(CLASS_NAME_COLLAPSE).trigger(EVENT_HIDDEN$4); 9248 }; 9249 9250 this._element.style[dimension] = ''; 9251 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 9252 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 9253 }; 9254 9255 _proto.setTransitioning = function setTransitioning(isTransitioning) { 9256 this._isTransitioning = isTransitioning; 9257 }; 9258 9259 _proto.dispose = function dispose() { 9260 $__default["default"].removeData(this._element, DATA_KEY$7); 9261 this._config = null; 9262 this._parent = null; 9263 this._element = null; 9264 this._triggerArray = null; 9265 this._isTransitioning = null; 9266 } // Private 9267 ; 9268 9269 _proto._getConfig = function _getConfig(config) { 9270 config = _extends({}, Default$6, config); 9271 config.toggle = Boolean(config.toggle); // Coerce string values 9272 9273 Util.typeCheckConfig(NAME$7, config, DefaultType$6); 9274 return config; 9275 }; 9276 9277 _proto._getDimension = function _getDimension() { 9278 var hasWidth = $__default["default"](this._element).hasClass(DIMENSION_WIDTH); 9279 return hasWidth ? DIMENSION_WIDTH : DIMENSION_HEIGHT; 9280 }; 9281 9282 _proto._getParent = function _getParent() { 9283 var _this3 = this; 9284 9285 var parent; 9286 9287 if (Util.isElement(this._config.parent)) { 9288 parent = this._config.parent; // It's a jQuery object 9289 9290 if (typeof this._config.parent.jquery !== 'undefined') { 9291 parent = this._config.parent[0]; 9292 } 9293 } else { 9294 parent = document.querySelector(this._config.parent); 9295 } 9296 9297 var selector = "[data-toggle=\"collapse\"][data-parent=\"" + this._config.parent + "\"]"; 9298 var children = [].slice.call(parent.querySelectorAll(selector)); 9299 $__default["default"](children).each(function (i, element) { 9300 _this3._addAriaAndCollapsedClass(Collapse._getTargetFromElement(element), [element]); 9301 }); 9302 return parent; 9303 }; 9304 9305 _proto._addAriaAndCollapsedClass = function _addAriaAndCollapsedClass(element, triggerArray) { 9306 var isOpen = $__default["default"](element).hasClass(CLASS_NAME_SHOW$6); 9307 9308 if (triggerArray.length) { 9309 $__default["default"](triggerArray).toggleClass(CLASS_NAME_COLLAPSED, !isOpen).attr('aria-expanded', isOpen); 9310 } 9311 } // Static 9312 ; 9313 9314 Collapse._getTargetFromElement = function _getTargetFromElement(element) { 9315 var selector = Util.getSelectorFromElement(element); 9316 return selector ? document.querySelector(selector) : null; 9317 }; 9318 9319 Collapse._jQueryInterface = function _jQueryInterface(config) { 9320 return this.each(function () { 9321 var $element = $__default["default"](this); 9322 var data = $element.data(DATA_KEY$7); 9323 9324 var _config = _extends({}, Default$6, $element.data(), typeof config === 'object' && config ? config : {}); 9325 9326 if (!data && _config.toggle && typeof config === 'string' && /show|hide/.test(config)) { 9327 _config.toggle = false; 9328 } 9329 9330 if (!data) { 9331 data = new Collapse(this, _config); 9332 $element.data(DATA_KEY$7, data); 9333 } 9334 9335 if (typeof config === 'string') { 9336 if (typeof data[config] === 'undefined') { 9337 throw new TypeError("No method named \"" + config + "\""); 9338 } 9339 9340 data[config](); 9341 } 9342 }); 9343 }; 9344 9345 _createClass(Collapse, null, [{ 9346 key: "VERSION", 9347 get: function get() { 9348 return VERSION$7; 9349 } 9350 }, { 9351 key: "Default", 9352 get: function get() { 9353 return Default$6; 9354 } 9355 }]); 9356 9357 return Collapse; 9358 }(); 9359 /** 9360 * Data API implementation 9361 */ 9362 9363 9364 $__default["default"](document).on(EVENT_CLICK_DATA_API$3, SELECTOR_DATA_TOGGLE$3, function (event) { 9365 // preventDefault only for <a> elements (which change the URL) not inside the collapsible element 9366 if (event.currentTarget.tagName === 'A') { 9367 event.preventDefault(); 9368 } 9369 9370 var $trigger = $__default["default"](this); 9371 var selector = Util.getSelectorFromElement(this); 9372 var selectors = [].slice.call(document.querySelectorAll(selector)); 9373 $__default["default"](selectors).each(function () { 9374 var $target = $__default["default"](this); 9375 var data = $target.data(DATA_KEY$7); 9376 var config = data ? 'toggle' : $trigger.data(); 9377 9378 Collapse._jQueryInterface.call($target, config); 9379 }); 9380 }); 9381 /** 9382 * jQuery 9383 */ 9384 9385 $__default["default"].fn[NAME$7] = Collapse._jQueryInterface; 9386 $__default["default"].fn[NAME$7].Constructor = Collapse; 9387 9388 $__default["default"].fn[NAME$7].noConflict = function () { 9389 $__default["default"].fn[NAME$7] = JQUERY_NO_CONFLICT$7; 9390 return Collapse._jQueryInterface; 9391 }; 9392 9393 /** 9394 * Constants 9395 */ 9396 9397 var NAME$6 = 'dropdown'; 9398 var VERSION$6 = '4.6.1'; 9399 var DATA_KEY$6 = 'bs.dropdown'; 9400 var EVENT_KEY$6 = "." + DATA_KEY$6; 9401 var DATA_API_KEY$3 = '.data-api'; 9402 var JQUERY_NO_CONFLICT$6 = $__default["default"].fn[NAME$6]; 9403 var ESCAPE_KEYCODE$1 = 27; // KeyboardEvent.which value for Escape (Esc) key 9404 9405 var SPACE_KEYCODE = 32; // KeyboardEvent.which value for space key 9406 9407 var TAB_KEYCODE = 9; // KeyboardEvent.which value for tab key 9408 9409 var ARROW_UP_KEYCODE = 38; // KeyboardEvent.which value for up arrow key 9410 9411 var ARROW_DOWN_KEYCODE = 40; // KeyboardEvent.which value for down arrow key 9412 9413 var RIGHT_MOUSE_BUTTON_WHICH = 3; // MouseEvent.which value for the right button (assuming a right-handed mouse) 9414 9415 var REGEXP_KEYDOWN = new RegExp(ARROW_UP_KEYCODE + "|" + ARROW_DOWN_KEYCODE + "|" + ESCAPE_KEYCODE$1); 9416 var CLASS_NAME_DISABLED$1 = 'disabled'; 9417 var CLASS_NAME_SHOW$5 = 'show'; 9418 var CLASS_NAME_DROPUP = 'dropup'; 9419 var CLASS_NAME_DROPRIGHT = 'dropright'; 9420 var CLASS_NAME_DROPLEFT = 'dropleft'; 9421 var CLASS_NAME_MENURIGHT = 'dropdown-menu-right'; 9422 var CLASS_NAME_POSITION_STATIC = 'position-static'; 9423 var EVENT_HIDE$3 = "hide" + EVENT_KEY$6; 9424 var EVENT_HIDDEN$3 = "hidden" + EVENT_KEY$6; 9425 var EVENT_SHOW$3 = "show" + EVENT_KEY$6; 9426 var EVENT_SHOWN$3 = "shown" + EVENT_KEY$6; 9427 var EVENT_CLICK = "click" + EVENT_KEY$6; 9428 var EVENT_CLICK_DATA_API$2 = "click" + EVENT_KEY$6 + DATA_API_KEY$3; 9429 var EVENT_KEYDOWN_DATA_API = "keydown" + EVENT_KEY$6 + DATA_API_KEY$3; 9430 var EVENT_KEYUP_DATA_API = "keyup" + EVENT_KEY$6 + DATA_API_KEY$3; 9431 var SELECTOR_DATA_TOGGLE$2 = '[data-toggle="dropdown"]'; 9432 var SELECTOR_FORM_CHILD = '.dropdown form'; 9433 var SELECTOR_MENU = '.dropdown-menu'; 9434 var SELECTOR_NAVBAR_NAV = '.navbar-nav'; 9435 var SELECTOR_VISIBLE_ITEMS = '.dropdown-menu .dropdown-item:not(.disabled):not(:disabled)'; 9436 var PLACEMENT_TOP = 'top-start'; 9437 var PLACEMENT_TOPEND = 'top-end'; 9438 var PLACEMENT_BOTTOM = 'bottom-start'; 9439 var PLACEMENT_BOTTOMEND = 'bottom-end'; 9440 var PLACEMENT_RIGHT = 'right-start'; 9441 var PLACEMENT_LEFT = 'left-start'; 9442 var Default$5 = { 9443 offset: 0, 9444 flip: true, 9445 boundary: 'scrollParent', 9446 reference: 'toggle', 9447 display: 'dynamic', 9448 popperConfig: null 9449 }; 9450 var DefaultType$5 = { 9451 offset: '(number|string|function)', 9452 flip: 'boolean', 9453 boundary: '(string|element)', 9454 reference: '(string|element)', 9455 display: 'string', 9456 popperConfig: '(null|object)' 9457 }; 9458 /** 9459 * Class definition 9460 */ 9461 9462 var Dropdown = /*#__PURE__*/function () { 9463 function Dropdown(element, config) { 9464 this._element = element; 9465 this._popper = null; 9466 this._config = this._getConfig(config); 9467 this._menu = this._getMenuElement(); 9468 this._inNavbar = this._detectNavbar(); 9469 9470 this._addEventListeners(); 9471 } // Getters 9472 9473 9474 var _proto = Dropdown.prototype; 9475 9476 // Public 9477 _proto.toggle = function toggle() { 9478 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1)) { 9479 return; 9480 } 9481 9482 var isActive = $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5); 9483 9484 Dropdown._clearMenus(); 9485 9486 if (isActive) { 9487 return; 9488 } 9489 9490 this.show(true); 9491 }; 9492 9493 _proto.show = function show(usePopper) { 9494 if (usePopper === void 0) { 9495 usePopper = false; 9496 } 9497 9498 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || $__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 9499 return; 9500 } 9501 9502 var relatedTarget = { 9503 relatedTarget: this._element 9504 }; 9505 var showEvent = $__default["default"].Event(EVENT_SHOW$3, relatedTarget); 9506 9507 var parent = Dropdown._getParentFromElement(this._element); 9508 9509 $__default["default"](parent).trigger(showEvent); 9510 9511 if (showEvent.isDefaultPrevented()) { 9512 return; 9513 } // Totally disable Popper for Dropdowns in Navbar 9514 9515 9516 if (!this._inNavbar && usePopper) { 9517 // Check for Popper dependency 9518 if (typeof Popper__default["default"] === 'undefined') { 9519 throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)'); 9520 } 9521 9522 var referenceElement = this._element; 9523 9524 if (this._config.reference === 'parent') { 9525 referenceElement = parent; 9526 } else if (Util.isElement(this._config.reference)) { 9527 referenceElement = this._config.reference; // Check if it's jQuery element 9528 9529 if (typeof this._config.reference.jquery !== 'undefined') { 9530 referenceElement = this._config.reference[0]; 9531 } 9532 } // If boundary is not `scrollParent`, then set position to `static` 9533 // to allow the menu to "escape" the scroll parent's boundaries 9534 // https://github.com/twbs/bootstrap/issues/24251 9535 9536 9537 if (this._config.boundary !== 'scrollParent') { 9538 $__default["default"](parent).addClass(CLASS_NAME_POSITION_STATIC); 9539 } 9540 9541 this._popper = new Popper__default["default"](referenceElement, this._menu, this._getPopperConfig()); 9542 } // If this is a touch-enabled device we add extra 9543 // empty mouseover listeners to the body's immediate children; 9544 // only needed because of broken event delegation on iOS 9545 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 9546 9547 9548 if ('ontouchstart' in document.documentElement && $__default["default"](parent).closest(SELECTOR_NAVBAR_NAV).length === 0) { 9549 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 9550 } 9551 9552 this._element.focus(); 9553 9554 this._element.setAttribute('aria-expanded', true); 9555 9556 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 9557 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_SHOWN$3, relatedTarget)); 9558 }; 9559 9560 _proto.hide = function hide() { 9561 if (this._element.disabled || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED$1) || !$__default["default"](this._menu).hasClass(CLASS_NAME_SHOW$5)) { 9562 return; 9563 } 9564 9565 var relatedTarget = { 9566 relatedTarget: this._element 9567 }; 9568 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 9569 9570 var parent = Dropdown._getParentFromElement(this._element); 9571 9572 $__default["default"](parent).trigger(hideEvent); 9573 9574 if (hideEvent.isDefaultPrevented()) { 9575 return; 9576 } 9577 9578 if (this._popper) { 9579 this._popper.destroy(); 9580 } 9581 9582 $__default["default"](this._menu).toggleClass(CLASS_NAME_SHOW$5); 9583 $__default["default"](parent).toggleClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 9584 }; 9585 9586 _proto.dispose = function dispose() { 9587 $__default["default"].removeData(this._element, DATA_KEY$6); 9588 $__default["default"](this._element).off(EVENT_KEY$6); 9589 this._element = null; 9590 this._menu = null; 9591 9592 if (this._popper !== null) { 9593 this._popper.destroy(); 9594 9595 this._popper = null; 9596 } 9597 }; 9598 9599 _proto.update = function update() { 9600 this._inNavbar = this._detectNavbar(); 9601 9602 if (this._popper !== null) { 9603 this._popper.scheduleUpdate(); 9604 } 9605 } // Private 9606 ; 9607 9608 _proto._addEventListeners = function _addEventListeners() { 9609 var _this = this; 9610 9611 $__default["default"](this._element).on(EVENT_CLICK, function (event) { 9612 event.preventDefault(); 9613 event.stopPropagation(); 9614 9615 _this.toggle(); 9616 }); 9617 }; 9618 9619 _proto._getConfig = function _getConfig(config) { 9620 config = _extends({}, this.constructor.Default, $__default["default"](this._element).data(), config); 9621 Util.typeCheckConfig(NAME$6, config, this.constructor.DefaultType); 9622 return config; 9623 }; 9624 9625 _proto._getMenuElement = function _getMenuElement() { 9626 if (!this._menu) { 9627 var parent = Dropdown._getParentFromElement(this._element); 9628 9629 if (parent) { 9630 this._menu = parent.querySelector(SELECTOR_MENU); 9631 } 9632 } 9633 9634 return this._menu; 9635 }; 9636 9637 _proto._getPlacement = function _getPlacement() { 9638 var $parentDropdown = $__default["default"](this._element.parentNode); 9639 var placement = PLACEMENT_BOTTOM; // Handle dropup 9640 9641 if ($parentDropdown.hasClass(CLASS_NAME_DROPUP)) { 9642 placement = $__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT) ? PLACEMENT_TOPEND : PLACEMENT_TOP; 9643 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPRIGHT)) { 9644 placement = PLACEMENT_RIGHT; 9645 } else if ($parentDropdown.hasClass(CLASS_NAME_DROPLEFT)) { 9646 placement = PLACEMENT_LEFT; 9647 } else if ($__default["default"](this._menu).hasClass(CLASS_NAME_MENURIGHT)) { 9648 placement = PLACEMENT_BOTTOMEND; 9649 } 9650 9651 return placement; 9652 }; 9653 9654 _proto._detectNavbar = function _detectNavbar() { 9655 return $__default["default"](this._element).closest('.navbar').length > 0; 9656 }; 9657 9658 _proto._getOffset = function _getOffset() { 9659 var _this2 = this; 9660 9661 var offset = {}; 9662 9663 if (typeof this._config.offset === 'function') { 9664 offset.fn = function (data) { 9665 data.offsets = _extends({}, data.offsets, _this2._config.offset(data.offsets, _this2._element)); 9666 return data; 9667 }; 9668 } else { 9669 offset.offset = this._config.offset; 9670 } 9671 9672 return offset; 9673 }; 9674 9675 _proto._getPopperConfig = function _getPopperConfig() { 9676 var popperConfig = { 9677 placement: this._getPlacement(), 9678 modifiers: { 9679 offset: this._getOffset(), 9680 flip: { 9681 enabled: this._config.flip 9682 }, 9683 preventOverflow: { 9684 boundariesElement: this._config.boundary 9685 } 9686 } 9687 }; // Disable Popper if we have a static display 9688 9689 if (this._config.display === 'static') { 9690 popperConfig.modifiers.applyStyle = { 9691 enabled: false 9692 }; 9693 } 9694 9695 return _extends({}, popperConfig, this._config.popperConfig); 9696 } // Static 9697 ; 9698 9699 Dropdown._jQueryInterface = function _jQueryInterface(config) { 9700 return this.each(function () { 9701 var data = $__default["default"](this).data(DATA_KEY$6); 9702 9703 var _config = typeof config === 'object' ? config : null; 9704 9705 if (!data) { 9706 data = new Dropdown(this, _config); 9707 $__default["default"](this).data(DATA_KEY$6, data); 9708 } 9709 9710 if (typeof config === 'string') { 9711 if (typeof data[config] === 'undefined') { 9712 throw new TypeError("No method named \"" + config + "\""); 9713 } 9714 9715 data[config](); 9716 } 9717 }); 9718 }; 9719 9720 Dropdown._clearMenus = function _clearMenus(event) { 9721 if (event && (event.which === RIGHT_MOUSE_BUTTON_WHICH || event.type === 'keyup' && event.which !== TAB_KEYCODE)) { 9722 return; 9723 } 9724 9725 var toggles = [].slice.call(document.querySelectorAll(SELECTOR_DATA_TOGGLE$2)); 9726 9727 for (var i = 0, len = toggles.length; i < len; i++) { 9728 var parent = Dropdown._getParentFromElement(toggles[i]); 9729 9730 var context = $__default["default"](toggles[i]).data(DATA_KEY$6); 9731 var relatedTarget = { 9732 relatedTarget: toggles[i] 9733 }; 9734 9735 if (event && event.type === 'click') { 9736 relatedTarget.clickEvent = event; 9737 } 9738 9739 if (!context) { 9740 continue; 9741 } 9742 9743 var dropdownMenu = context._menu; 9744 9745 if (!$__default["default"](parent).hasClass(CLASS_NAME_SHOW$5)) { 9746 continue; 9747 } 9748 9749 if (event && (event.type === 'click' && /input|textarea/i.test(event.target.tagName) || event.type === 'keyup' && event.which === TAB_KEYCODE) && $__default["default"].contains(parent, event.target)) { 9750 continue; 9751 } 9752 9753 var hideEvent = $__default["default"].Event(EVENT_HIDE$3, relatedTarget); 9754 $__default["default"](parent).trigger(hideEvent); 9755 9756 if (hideEvent.isDefaultPrevented()) { 9757 continue; 9758 } // If this is a touch-enabled device we remove the extra 9759 // empty mouseover listeners we added for iOS support 9760 9761 9762 if ('ontouchstart' in document.documentElement) { 9763 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 9764 } 9765 9766 toggles[i].setAttribute('aria-expanded', 'false'); 9767 9768 if (context._popper) { 9769 context._popper.destroy(); 9770 } 9771 9772 $__default["default"](dropdownMenu).removeClass(CLASS_NAME_SHOW$5); 9773 $__default["default"](parent).removeClass(CLASS_NAME_SHOW$5).trigger($__default["default"].Event(EVENT_HIDDEN$3, relatedTarget)); 9774 } 9775 }; 9776 9777 Dropdown._getParentFromElement = function _getParentFromElement(element) { 9778 var parent; 9779 var selector = Util.getSelectorFromElement(element); 9780 9781 if (selector) { 9782 parent = document.querySelector(selector); 9783 } 9784 9785 return parent || element.parentNode; 9786 } // eslint-disable-next-line complexity 9787 ; 9788 9789 Dropdown._dataApiKeydownHandler = function _dataApiKeydownHandler(event) { 9790 // If not input/textarea: 9791 // - And not a key in REGEXP_KEYDOWN => not a dropdown command 9792 // If input/textarea: 9793 // - If space key => not a dropdown command 9794 // - If key is other than escape 9795 // - If key is not up or down => not a dropdown command 9796 // - If trigger inside the menu => not a dropdown command 9797 if (/input|textarea/i.test(event.target.tagName) ? event.which === SPACE_KEYCODE || event.which !== ESCAPE_KEYCODE$1 && (event.which !== ARROW_DOWN_KEYCODE && event.which !== ARROW_UP_KEYCODE || $__default["default"](event.target).closest(SELECTOR_MENU).length) : !REGEXP_KEYDOWN.test(event.which)) { 9798 return; 9799 } 9800 9801 if (this.disabled || $__default["default"](this).hasClass(CLASS_NAME_DISABLED$1)) { 9802 return; 9803 } 9804 9805 var parent = Dropdown._getParentFromElement(this); 9806 9807 var isActive = $__default["default"](parent).hasClass(CLASS_NAME_SHOW$5); 9808 9809 if (!isActive && event.which === ESCAPE_KEYCODE$1) { 9810 return; 9811 } 9812 9813 event.preventDefault(); 9814 event.stopPropagation(); 9815 9816 if (!isActive || event.which === ESCAPE_KEYCODE$1 || event.which === SPACE_KEYCODE) { 9817 if (event.which === ESCAPE_KEYCODE$1) { 9818 $__default["default"](parent.querySelector(SELECTOR_DATA_TOGGLE$2)).trigger('focus'); 9819 } 9820 9821 $__default["default"](this).trigger('click'); 9822 return; 9823 } 9824 9825 var items = [].slice.call(parent.querySelectorAll(SELECTOR_VISIBLE_ITEMS)).filter(function (item) { 9826 return $__default["default"](item).is(':visible'); 9827 }); 9828 9829 if (items.length === 0) { 9830 return; 9831 } 9832 9833 var index = items.indexOf(event.target); 9834 9835 if (event.which === ARROW_UP_KEYCODE && index > 0) { 9836 // Up 9837 index--; 9838 } 9839 9840 if (event.which === ARROW_DOWN_KEYCODE && index < items.length - 1) { 9841 // Down 9842 index++; 9843 } 9844 9845 if (index < 0) { 9846 index = 0; 9847 } 9848 9849 items[index].focus(); 9850 }; 9851 9852 _createClass(Dropdown, null, [{ 9853 key: "VERSION", 9854 get: function get() { 9855 return VERSION$6; 9856 } 9857 }, { 9858 key: "Default", 9859 get: function get() { 9860 return Default$5; 9861 } 9862 }, { 9863 key: "DefaultType", 9864 get: function get() { 9865 return DefaultType$5; 9866 } 9867 }]); 9868 9869 return Dropdown; 9870 }(); 9871 /** 9872 * Data API implementation 9873 */ 9874 9875 9876 $__default["default"](document).on(EVENT_KEYDOWN_DATA_API, SELECTOR_DATA_TOGGLE$2, Dropdown._dataApiKeydownHandler).on(EVENT_KEYDOWN_DATA_API, SELECTOR_MENU, Dropdown._dataApiKeydownHandler).on(EVENT_CLICK_DATA_API$2 + " " + EVENT_KEYUP_DATA_API, Dropdown._clearMenus).on(EVENT_CLICK_DATA_API$2, SELECTOR_DATA_TOGGLE$2, function (event) { 9877 event.preventDefault(); 9878 event.stopPropagation(); 9879 9880 Dropdown._jQueryInterface.call($__default["default"](this), 'toggle'); 9881 }).on(EVENT_CLICK_DATA_API$2, SELECTOR_FORM_CHILD, function (e) { 9882 e.stopPropagation(); 9883 }); 9884 /** 9885 * jQuery 9886 */ 9887 9888 $__default["default"].fn[NAME$6] = Dropdown._jQueryInterface; 9889 $__default["default"].fn[NAME$6].Constructor = Dropdown; 9890 9891 $__default["default"].fn[NAME$6].noConflict = function () { 9892 $__default["default"].fn[NAME$6] = JQUERY_NO_CONFLICT$6; 9893 return Dropdown._jQueryInterface; 9894 }; 9895 9896 /** 9897 * Constants 9898 */ 9899 9900 var NAME$5 = 'modal'; 9901 var VERSION$5 = '4.6.1'; 9902 var DATA_KEY$5 = 'bs.modal'; 9903 var EVENT_KEY$5 = "." + DATA_KEY$5; 9904 var DATA_API_KEY$2 = '.data-api'; 9905 var JQUERY_NO_CONFLICT$5 = $__default["default"].fn[NAME$5]; 9906 var ESCAPE_KEYCODE = 27; // KeyboardEvent.which value for Escape (Esc) key 9907 9908 var CLASS_NAME_SCROLLABLE = 'modal-dialog-scrollable'; 9909 var CLASS_NAME_SCROLLBAR_MEASURER = 'modal-scrollbar-measure'; 9910 var CLASS_NAME_BACKDROP = 'modal-backdrop'; 9911 var CLASS_NAME_OPEN = 'modal-open'; 9912 var CLASS_NAME_FADE$4 = 'fade'; 9913 var CLASS_NAME_SHOW$4 = 'show'; 9914 var CLASS_NAME_STATIC = 'modal-static'; 9915 var EVENT_HIDE$2 = "hide" + EVENT_KEY$5; 9916 var EVENT_HIDE_PREVENTED = "hidePrevented" + EVENT_KEY$5; 9917 var EVENT_HIDDEN$2 = "hidden" + EVENT_KEY$5; 9918 var EVENT_SHOW$2 = "show" + EVENT_KEY$5; 9919 var EVENT_SHOWN$2 = "shown" + EVENT_KEY$5; 9920 var EVENT_FOCUSIN = "focusin" + EVENT_KEY$5; 9921 var EVENT_RESIZE = "resize" + EVENT_KEY$5; 9922 var EVENT_CLICK_DISMISS$1 = "click.dismiss" + EVENT_KEY$5; 9923 var EVENT_KEYDOWN_DISMISS = "keydown.dismiss" + EVENT_KEY$5; 9924 var EVENT_MOUSEUP_DISMISS = "mouseup.dismiss" + EVENT_KEY$5; 9925 var EVENT_MOUSEDOWN_DISMISS = "mousedown.dismiss" + EVENT_KEY$5; 9926 var EVENT_CLICK_DATA_API$1 = "click" + EVENT_KEY$5 + DATA_API_KEY$2; 9927 var SELECTOR_DIALOG = '.modal-dialog'; 9928 var SELECTOR_MODAL_BODY = '.modal-body'; 9929 var SELECTOR_DATA_TOGGLE$1 = '[data-toggle="modal"]'; 9930 var SELECTOR_DATA_DISMISS$1 = '[data-dismiss="modal"]'; 9931 var SELECTOR_FIXED_CONTENT = '.fixed-top, .fixed-bottom, .is-fixed, .sticky-top'; 9932 var SELECTOR_STICKY_CONTENT = '.sticky-top'; 9933 var Default$4 = { 9934 backdrop: true, 9935 keyboard: true, 9936 focus: true, 9937 show: true 9938 }; 9939 var DefaultType$4 = { 9940 backdrop: '(boolean|string)', 9941 keyboard: 'boolean', 9942 focus: 'boolean', 9943 show: 'boolean' 9944 }; 9945 /** 9946 * Class definition 9947 */ 9948 9949 var Modal = /*#__PURE__*/function () { 9950 function Modal(element, config) { 9951 this._config = this._getConfig(config); 9952 this._element = element; 9953 this._dialog = element.querySelector(SELECTOR_DIALOG); 9954 this._backdrop = null; 9955 this._isShown = false; 9956 this._isBodyOverflowing = false; 9957 this._ignoreBackdropClick = false; 9958 this._isTransitioning = false; 9959 this._scrollbarWidth = 0; 9960 } // Getters 9961 9962 9963 var _proto = Modal.prototype; 9964 9965 // Public 9966 _proto.toggle = function toggle(relatedTarget) { 9967 return this._isShown ? this.hide() : this.show(relatedTarget); 9968 }; 9969 9970 _proto.show = function show(relatedTarget) { 9971 var _this = this; 9972 9973 if (this._isShown || this._isTransitioning) { 9974 return; 9975 } 9976 9977 var showEvent = $__default["default"].Event(EVENT_SHOW$2, { 9978 relatedTarget: relatedTarget 9979 }); 9980 $__default["default"](this._element).trigger(showEvent); 9981 9982 if (showEvent.isDefaultPrevented()) { 9983 return; 9984 } 9985 9986 this._isShown = true; 9987 9988 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 9989 this._isTransitioning = true; 9990 } 9991 9992 this._checkScrollbar(); 9993 9994 this._setScrollbar(); 9995 9996 this._adjustDialog(); 9997 9998 this._setEscapeEvent(); 9999 10000 this._setResizeEvent(); 10001 10002 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, SELECTOR_DATA_DISMISS$1, function (event) { 10003 return _this.hide(event); 10004 }); 10005 $__default["default"](this._dialog).on(EVENT_MOUSEDOWN_DISMISS, function () { 10006 $__default["default"](_this._element).one(EVENT_MOUSEUP_DISMISS, function (event) { 10007 if ($__default["default"](event.target).is(_this._element)) { 10008 _this._ignoreBackdropClick = true; 10009 } 10010 }); 10011 }); 10012 10013 this._showBackdrop(function () { 10014 return _this._showElement(relatedTarget); 10015 }); 10016 }; 10017 10018 _proto.hide = function hide(event) { 10019 var _this2 = this; 10020 10021 if (event) { 10022 event.preventDefault(); 10023 } 10024 10025 if (!this._isShown || this._isTransitioning) { 10026 return; 10027 } 10028 10029 var hideEvent = $__default["default"].Event(EVENT_HIDE$2); 10030 $__default["default"](this._element).trigger(hideEvent); 10031 10032 if (!this._isShown || hideEvent.isDefaultPrevented()) { 10033 return; 10034 } 10035 10036 this._isShown = false; 10037 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 10038 10039 if (transition) { 10040 this._isTransitioning = true; 10041 } 10042 10043 this._setEscapeEvent(); 10044 10045 this._setResizeEvent(); 10046 10047 $__default["default"](document).off(EVENT_FOCUSIN); 10048 $__default["default"](this._element).removeClass(CLASS_NAME_SHOW$4); 10049 $__default["default"](this._element).off(EVENT_CLICK_DISMISS$1); 10050 $__default["default"](this._dialog).off(EVENT_MOUSEDOWN_DISMISS); 10051 10052 if (transition) { 10053 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 10054 $__default["default"](this._element).one(Util.TRANSITION_END, function (event) { 10055 return _this2._hideModal(event); 10056 }).emulateTransitionEnd(transitionDuration); 10057 } else { 10058 this._hideModal(); 10059 } 10060 }; 10061 10062 _proto.dispose = function dispose() { 10063 [window, this._element, this._dialog].forEach(function (htmlElement) { 10064 return $__default["default"](htmlElement).off(EVENT_KEY$5); 10065 }); 10066 /** 10067 * `document` has 2 events `EVENT_FOCUSIN` and `EVENT_CLICK_DATA_API` 10068 * Do not move `document` in `htmlElements` array 10069 * It will remove `EVENT_CLICK_DATA_API` event that should remain 10070 */ 10071 10072 $__default["default"](document).off(EVENT_FOCUSIN); 10073 $__default["default"].removeData(this._element, DATA_KEY$5); 10074 this._config = null; 10075 this._element = null; 10076 this._dialog = null; 10077 this._backdrop = null; 10078 this._isShown = null; 10079 this._isBodyOverflowing = null; 10080 this._ignoreBackdropClick = null; 10081 this._isTransitioning = null; 10082 this._scrollbarWidth = null; 10083 }; 10084 10085 _proto.handleUpdate = function handleUpdate() { 10086 this._adjustDialog(); 10087 } // Private 10088 ; 10089 10090 _proto._getConfig = function _getConfig(config) { 10091 config = _extends({}, Default$4, config); 10092 Util.typeCheckConfig(NAME$5, config, DefaultType$4); 10093 return config; 10094 }; 10095 10096 _proto._triggerBackdropTransition = function _triggerBackdropTransition() { 10097 var _this3 = this; 10098 10099 var hideEventPrevented = $__default["default"].Event(EVENT_HIDE_PREVENTED); 10100 $__default["default"](this._element).trigger(hideEventPrevented); 10101 10102 if (hideEventPrevented.isDefaultPrevented()) { 10103 return; 10104 } 10105 10106 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 10107 10108 if (!isModalOverflowing) { 10109 this._element.style.overflowY = 'hidden'; 10110 } 10111 10112 this._element.classList.add(CLASS_NAME_STATIC); 10113 10114 var modalTransitionDuration = Util.getTransitionDurationFromElement(this._dialog); 10115 $__default["default"](this._element).off(Util.TRANSITION_END); 10116 $__default["default"](this._element).one(Util.TRANSITION_END, function () { 10117 _this3._element.classList.remove(CLASS_NAME_STATIC); 10118 10119 if (!isModalOverflowing) { 10120 $__default["default"](_this3._element).one(Util.TRANSITION_END, function () { 10121 _this3._element.style.overflowY = ''; 10122 }).emulateTransitionEnd(_this3._element, modalTransitionDuration); 10123 } 10124 }).emulateTransitionEnd(modalTransitionDuration); 10125 10126 this._element.focus(); 10127 }; 10128 10129 _proto._showElement = function _showElement(relatedTarget) { 10130 var _this4 = this; 10131 10132 var transition = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4); 10133 var modalBody = this._dialog ? this._dialog.querySelector(SELECTOR_MODAL_BODY) : null; 10134 10135 if (!this._element.parentNode || this._element.parentNode.nodeType !== Node.ELEMENT_NODE) { 10136 // Don't move modal's DOM position 10137 document.body.appendChild(this._element); 10138 } 10139 10140 this._element.style.display = 'block'; 10141 10142 this._element.removeAttribute('aria-hidden'); 10143 10144 this._element.setAttribute('aria-modal', true); 10145 10146 this._element.setAttribute('role', 'dialog'); 10147 10148 if ($__default["default"](this._dialog).hasClass(CLASS_NAME_SCROLLABLE) && modalBody) { 10149 modalBody.scrollTop = 0; 10150 } else { 10151 this._element.scrollTop = 0; 10152 } 10153 10154 if (transition) { 10155 Util.reflow(this._element); 10156 } 10157 10158 $__default["default"](this._element).addClass(CLASS_NAME_SHOW$4); 10159 10160 if (this._config.focus) { 10161 this._enforceFocus(); 10162 } 10163 10164 var shownEvent = $__default["default"].Event(EVENT_SHOWN$2, { 10165 relatedTarget: relatedTarget 10166 }); 10167 10168 var transitionComplete = function transitionComplete() { 10169 if (_this4._config.focus) { 10170 _this4._element.focus(); 10171 } 10172 10173 _this4._isTransitioning = false; 10174 $__default["default"](_this4._element).trigger(shownEvent); 10175 }; 10176 10177 if (transition) { 10178 var transitionDuration = Util.getTransitionDurationFromElement(this._dialog); 10179 $__default["default"](this._dialog).one(Util.TRANSITION_END, transitionComplete).emulateTransitionEnd(transitionDuration); 10180 } else { 10181 transitionComplete(); 10182 } 10183 }; 10184 10185 _proto._enforceFocus = function _enforceFocus() { 10186 var _this5 = this; 10187 10188 $__default["default"](document).off(EVENT_FOCUSIN) // Guard against infinite focus loop 10189 .on(EVENT_FOCUSIN, function (event) { 10190 if (document !== event.target && _this5._element !== event.target && $__default["default"](_this5._element).has(event.target).length === 0) { 10191 _this5._element.focus(); 10192 } 10193 }); 10194 }; 10195 10196 _proto._setEscapeEvent = function _setEscapeEvent() { 10197 var _this6 = this; 10198 10199 if (this._isShown) { 10200 $__default["default"](this._element).on(EVENT_KEYDOWN_DISMISS, function (event) { 10201 if (_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 10202 event.preventDefault(); 10203 10204 _this6.hide(); 10205 } else if (!_this6._config.keyboard && event.which === ESCAPE_KEYCODE) { 10206 _this6._triggerBackdropTransition(); 10207 } 10208 }); 10209 } else if (!this._isShown) { 10210 $__default["default"](this._element).off(EVENT_KEYDOWN_DISMISS); 10211 } 10212 }; 10213 10214 _proto._setResizeEvent = function _setResizeEvent() { 10215 var _this7 = this; 10216 10217 if (this._isShown) { 10218 $__default["default"](window).on(EVENT_RESIZE, function (event) { 10219 return _this7.handleUpdate(event); 10220 }); 10221 } else { 10222 $__default["default"](window).off(EVENT_RESIZE); 10223 } 10224 }; 10225 10226 _proto._hideModal = function _hideModal() { 10227 var _this8 = this; 10228 10229 this._element.style.display = 'none'; 10230 10231 this._element.setAttribute('aria-hidden', true); 10232 10233 this._element.removeAttribute('aria-modal'); 10234 10235 this._element.removeAttribute('role'); 10236 10237 this._isTransitioning = false; 10238 10239 this._showBackdrop(function () { 10240 $__default["default"](document.body).removeClass(CLASS_NAME_OPEN); 10241 10242 _this8._resetAdjustments(); 10243 10244 _this8._resetScrollbar(); 10245 10246 $__default["default"](_this8._element).trigger(EVENT_HIDDEN$2); 10247 }); 10248 }; 10249 10250 _proto._removeBackdrop = function _removeBackdrop() { 10251 if (this._backdrop) { 10252 $__default["default"](this._backdrop).remove(); 10253 this._backdrop = null; 10254 } 10255 }; 10256 10257 _proto._showBackdrop = function _showBackdrop(callback) { 10258 var _this9 = this; 10259 10260 var animate = $__default["default"](this._element).hasClass(CLASS_NAME_FADE$4) ? CLASS_NAME_FADE$4 : ''; 10261 10262 if (this._isShown && this._config.backdrop) { 10263 this._backdrop = document.createElement('div'); 10264 this._backdrop.className = CLASS_NAME_BACKDROP; 10265 10266 if (animate) { 10267 this._backdrop.classList.add(animate); 10268 } 10269 10270 $__default["default"](this._backdrop).appendTo(document.body); 10271 $__default["default"](this._element).on(EVENT_CLICK_DISMISS$1, function (event) { 10272 if (_this9._ignoreBackdropClick) { 10273 _this9._ignoreBackdropClick = false; 10274 return; 10275 } 10276 10277 if (event.target !== event.currentTarget) { 10278 return; 10279 } 10280 10281 if (_this9._config.backdrop === 'static') { 10282 _this9._triggerBackdropTransition(); 10283 } else { 10284 _this9.hide(); 10285 } 10286 }); 10287 10288 if (animate) { 10289 Util.reflow(this._backdrop); 10290 } 10291 10292 $__default["default"](this._backdrop).addClass(CLASS_NAME_SHOW$4); 10293 10294 if (!callback) { 10295 return; 10296 } 10297 10298 if (!animate) { 10299 callback(); 10300 return; 10301 } 10302 10303 var backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 10304 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callback).emulateTransitionEnd(backdropTransitionDuration); 10305 } else if (!this._isShown && this._backdrop) { 10306 $__default["default"](this._backdrop).removeClass(CLASS_NAME_SHOW$4); 10307 10308 var callbackRemove = function callbackRemove() { 10309 _this9._removeBackdrop(); 10310 10311 if (callback) { 10312 callback(); 10313 } 10314 }; 10315 10316 if ($__default["default"](this._element).hasClass(CLASS_NAME_FADE$4)) { 10317 var _backdropTransitionDuration = Util.getTransitionDurationFromElement(this._backdrop); 10318 10319 $__default["default"](this._backdrop).one(Util.TRANSITION_END, callbackRemove).emulateTransitionEnd(_backdropTransitionDuration); 10320 } else { 10321 callbackRemove(); 10322 } 10323 } else if (callback) { 10324 callback(); 10325 } 10326 } // ---------------------------------------------------------------------- 10327 // the following methods are used to handle overflowing modals 10328 // todo (fat): these should probably be refactored out of modal.js 10329 // ---------------------------------------------------------------------- 10330 ; 10331 10332 _proto._adjustDialog = function _adjustDialog() { 10333 var isModalOverflowing = this._element.scrollHeight > document.documentElement.clientHeight; 10334 10335 if (!this._isBodyOverflowing && isModalOverflowing) { 10336 this._element.style.paddingLeft = this._scrollbarWidth + "px"; 10337 } 10338 10339 if (this._isBodyOverflowing && !isModalOverflowing) { 10340 this._element.style.paddingRight = this._scrollbarWidth + "px"; 10341 } 10342 }; 10343 10344 _proto._resetAdjustments = function _resetAdjustments() { 10345 this._element.style.paddingLeft = ''; 10346 this._element.style.paddingRight = ''; 10347 }; 10348 10349 _proto._checkScrollbar = function _checkScrollbar() { 10350 var rect = document.body.getBoundingClientRect(); 10351 this._isBodyOverflowing = Math.round(rect.left + rect.right) < window.innerWidth; 10352 this._scrollbarWidth = this._getScrollbarWidth(); 10353 }; 10354 10355 _proto._setScrollbar = function _setScrollbar() { 10356 var _this10 = this; 10357 10358 if (this._isBodyOverflowing) { 10359 // Note: DOMNode.style.paddingRight returns the actual value or '' if not set 10360 // while $(DOMNode).css('padding-right') returns the calculated value or 0 if not set 10361 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 10362 var stickyContent = [].slice.call(document.querySelectorAll(SELECTOR_STICKY_CONTENT)); // Adjust fixed content padding 10363 10364 $__default["default"](fixedContent).each(function (index, element) { 10365 var actualPadding = element.style.paddingRight; 10366 var calculatedPadding = $__default["default"](element).css('padding-right'); 10367 $__default["default"](element).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + _this10._scrollbarWidth + "px"); 10368 }); // Adjust sticky content margin 10369 10370 $__default["default"](stickyContent).each(function (index, element) { 10371 var actualMargin = element.style.marginRight; 10372 var calculatedMargin = $__default["default"](element).css('margin-right'); 10373 $__default["default"](element).data('margin-right', actualMargin).css('margin-right', parseFloat(calculatedMargin) - _this10._scrollbarWidth + "px"); 10374 }); // Adjust body padding 10375 10376 var actualPadding = document.body.style.paddingRight; 10377 var calculatedPadding = $__default["default"](document.body).css('padding-right'); 10378 $__default["default"](document.body).data('padding-right', actualPadding).css('padding-right', parseFloat(calculatedPadding) + this._scrollbarWidth + "px"); 10379 } 10380 10381 $__default["default"](document.body).addClass(CLASS_NAME_OPEN); 10382 }; 10383 10384 _proto._resetScrollbar = function _resetScrollbar() { 10385 // Restore fixed content padding 10386 var fixedContent = [].slice.call(document.querySelectorAll(SELECTOR_FIXED_CONTENT)); 10387 $__default["default"](fixedContent).each(function (index, element) { 10388 var padding = $__default["default"](element).data('padding-right'); 10389 $__default["default"](element).removeData('padding-right'); 10390 element.style.paddingRight = padding ? padding : ''; 10391 }); // Restore sticky content 10392 10393 var elements = [].slice.call(document.querySelectorAll("" + SELECTOR_STICKY_CONTENT)); 10394 $__default["default"](elements).each(function (index, element) { 10395 var margin = $__default["default"](element).data('margin-right'); 10396 10397 if (typeof margin !== 'undefined') { 10398 $__default["default"](element).css('margin-right', margin).removeData('margin-right'); 10399 } 10400 }); // Restore body padding 10401 10402 var padding = $__default["default"](document.body).data('padding-right'); 10403 $__default["default"](document.body).removeData('padding-right'); 10404 document.body.style.paddingRight = padding ? padding : ''; 10405 }; 10406 10407 _proto._getScrollbarWidth = function _getScrollbarWidth() { 10408 // thx d.walsh 10409 var scrollDiv = document.createElement('div'); 10410 scrollDiv.className = CLASS_NAME_SCROLLBAR_MEASURER; 10411 document.body.appendChild(scrollDiv); 10412 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 10413 document.body.removeChild(scrollDiv); 10414 return scrollbarWidth; 10415 } // Static 10416 ; 10417 10418 Modal._jQueryInterface = function _jQueryInterface(config, relatedTarget) { 10419 return this.each(function () { 10420 var data = $__default["default"](this).data(DATA_KEY$5); 10421 10422 var _config = _extends({}, Default$4, $__default["default"](this).data(), typeof config === 'object' && config ? config : {}); 10423 10424 if (!data) { 10425 data = new Modal(this, _config); 10426 $__default["default"](this).data(DATA_KEY$5, data); 10427 } 10428 10429 if (typeof config === 'string') { 10430 if (typeof data[config] === 'undefined') { 10431 throw new TypeError("No method named \"" + config + "\""); 10432 } 10433 10434 data[config](relatedTarget); 10435 } else if (_config.show) { 10436 data.show(relatedTarget); 10437 } 10438 }); 10439 }; 10440 10441 _createClass(Modal, null, [{ 10442 key: "VERSION", 10443 get: function get() { 10444 return VERSION$5; 10445 } 10446 }, { 10447 key: "Default", 10448 get: function get() { 10449 return Default$4; 10450 } 10451 }]); 10452 10453 return Modal; 10454 }(); 10455 /** 10456 * Data API implementation 10457 */ 10458 10459 10460 $__default["default"](document).on(EVENT_CLICK_DATA_API$1, SELECTOR_DATA_TOGGLE$1, function (event) { 10461 var _this11 = this; 10462 10463 var target; 10464 var selector = Util.getSelectorFromElement(this); 10465 10466 if (selector) { 10467 target = document.querySelector(selector); 10468 } 10469 10470 var config = $__default["default"](target).data(DATA_KEY$5) ? 'toggle' : _extends({}, $__default["default"](target).data(), $__default["default"](this).data()); 10471 10472 if (this.tagName === 'A' || this.tagName === 'AREA') { 10473 event.preventDefault(); 10474 } 10475 10476 var $target = $__default["default"](target).one(EVENT_SHOW$2, function (showEvent) { 10477 if (showEvent.isDefaultPrevented()) { 10478 // Only register focus restorer if modal will actually get shown 10479 return; 10480 } 10481 10482 $target.one(EVENT_HIDDEN$2, function () { 10483 if ($__default["default"](_this11).is(':visible')) { 10484 _this11.focus(); 10485 } 10486 }); 10487 }); 10488 10489 Modal._jQueryInterface.call($__default["default"](target), config, this); 10490 }); 10491 /** 10492 * jQuery 10493 */ 10494 10495 $__default["default"].fn[NAME$5] = Modal._jQueryInterface; 10496 $__default["default"].fn[NAME$5].Constructor = Modal; 10497 10498 $__default["default"].fn[NAME$5].noConflict = function () { 10499 $__default["default"].fn[NAME$5] = JQUERY_NO_CONFLICT$5; 10500 return Modal._jQueryInterface; 10501 }; 10502 10503 /** 10504 * -------------------------------------------------------------------------- 10505 * Bootstrap (v4.6.1): tools/sanitizer.js 10506 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE) 10507 * -------------------------------------------------------------------------- 10508 */ 10509 var uriAttrs = ['background', 'cite', 'href', 'itemtype', 'longdesc', 'poster', 'src', 'xlink:href']; 10510 var ARIA_ATTRIBUTE_PATTERN = /^aria-[\w-]*$/i; 10511 var DefaultWhitelist = { 10512 // Global attributes allowed on any supplied element below. 10513 '*': ['class', 'dir', 'id', 'lang', 'role', ARIA_ATTRIBUTE_PATTERN], 10514 a: ['target', 'href', 'title', 'rel'], 10515 area: [], 10516 b: [], 10517 br: [], 10518 col: [], 10519 code: [], 10520 div: [], 10521 em: [], 10522 hr: [], 10523 h1: [], 10524 h2: [], 10525 h3: [], 10526 h4: [], 10527 h5: [], 10528 h6: [], 10529 i: [], 10530 img: ['src', 'srcset', 'alt', 'title', 'width', 'height'], 10531 li: [], 10532 ol: [], 10533 p: [], 10534 pre: [], 10535 s: [], 10536 small: [], 10537 span: [], 10538 sub: [], 10539 sup: [], 10540 strong: [], 10541 u: [], 10542 ul: [] 10543 }; 10544 /** 10545 * A pattern that recognizes a commonly useful subset of URLs that are safe. 10546 * 10547 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 10548 */ 10549 10550 var SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^#&/:?]*(?:[#/?]|$))/i; 10551 /** 10552 * A pattern that matches safe data URLs. Only matches image, video and audio types. 10553 * 10554 * Shoutout to Angular https://github.com/angular/angular/blob/12.2.x/packages/core/src/sanitization/url_sanitizer.ts 10555 */ 10556 10557 var DATA_URL_PATTERN = /^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[\d+/a-z]+=*$/i; 10558 10559 function allowedAttribute(attr, allowedAttributeList) { 10560 var attrName = attr.nodeName.toLowerCase(); 10561 10562 if (allowedAttributeList.indexOf(attrName) !== -1) { 10563 if (uriAttrs.indexOf(attrName) !== -1) { 10564 return Boolean(SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)); 10565 } 10566 10567 return true; 10568 } 10569 10570 var regExp = allowedAttributeList.filter(function (attrRegex) { 10571 return attrRegex instanceof RegExp; 10572 }); // Check if a regular expression validates the attribute. 10573 10574 for (var i = 0, len = regExp.length; i < len; i++) { 10575 if (regExp[i].test(attrName)) { 10576 return true; 10577 } 10578 } 10579 10580 return false; 10581 } 10582 10583 function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) { 10584 if (unsafeHtml.length === 0) { 10585 return unsafeHtml; 10586 } 10587 10588 if (sanitizeFn && typeof sanitizeFn === 'function') { 10589 return sanitizeFn(unsafeHtml); 10590 } 10591 10592 var domParser = new window.DOMParser(); 10593 var createdDocument = domParser.parseFromString(unsafeHtml, 'text/html'); 10594 var whitelistKeys = Object.keys(whiteList); 10595 var elements = [].slice.call(createdDocument.body.querySelectorAll('*')); 10596 10597 var _loop = function _loop(i, len) { 10598 var el = elements[i]; 10599 var elName = el.nodeName.toLowerCase(); 10600 10601 if (whitelistKeys.indexOf(el.nodeName.toLowerCase()) === -1) { 10602 el.parentNode.removeChild(el); 10603 return "continue"; 10604 } 10605 10606 var attributeList = [].slice.call(el.attributes); // eslint-disable-next-line unicorn/prefer-spread 10607 10608 var whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || []); 10609 attributeList.forEach(function (attr) { 10610 if (!allowedAttribute(attr, whitelistedAttributes)) { 10611 el.removeAttribute(attr.nodeName); 10612 } 10613 }); 10614 }; 10615 10616 for (var i = 0, len = elements.length; i < len; i++) { 10617 var _ret = _loop(i); 10618 10619 if (_ret === "continue") continue; 10620 } 10621 10622 return createdDocument.body.innerHTML; 10623 } 10624 10625 /** 10626 * Constants 10627 */ 10628 10629 var NAME$4 = 'tooltip'; 10630 var VERSION$4 = '4.6.1'; 10631 var DATA_KEY$4 = 'bs.tooltip'; 10632 var EVENT_KEY$4 = "." + DATA_KEY$4; 10633 var JQUERY_NO_CONFLICT$4 = $__default["default"].fn[NAME$4]; 10634 var CLASS_PREFIX$1 = 'bs-tooltip'; 10635 var BSCLS_PREFIX_REGEX$1 = new RegExp("(^|\\s)" + CLASS_PREFIX$1 + "\\S+", 'g'); 10636 var DISALLOWED_ATTRIBUTES = ['sanitize', 'whiteList', 'sanitizeFn']; 10637 var CLASS_NAME_FADE$3 = 'fade'; 10638 var CLASS_NAME_SHOW$3 = 'show'; 10639 var HOVER_STATE_SHOW = 'show'; 10640 var HOVER_STATE_OUT = 'out'; 10641 var SELECTOR_TOOLTIP_INNER = '.tooltip-inner'; 10642 var SELECTOR_ARROW = '.arrow'; 10643 var TRIGGER_HOVER = 'hover'; 10644 var TRIGGER_FOCUS = 'focus'; 10645 var TRIGGER_CLICK = 'click'; 10646 var TRIGGER_MANUAL = 'manual'; 10647 var AttachmentMap = { 10648 AUTO: 'auto', 10649 TOP: 'top', 10650 RIGHT: 'right', 10651 BOTTOM: 'bottom', 10652 LEFT: 'left' 10653 }; 10654 var Default$3 = { 10655 animation: true, 10656 template: '<div class="tooltip" role="tooltip">' + '<div class="arrow"></div>' + '<div class="tooltip-inner"></div></div>', 10657 trigger: 'hover focus', 10658 title: '', 10659 delay: 0, 10660 html: false, 10661 selector: false, 10662 placement: 'top', 10663 offset: 0, 10664 container: false, 10665 fallbackPlacement: 'flip', 10666 boundary: 'scrollParent', 10667 customClass: '', 10668 sanitize: true, 10669 sanitizeFn: null, 10670 whiteList: DefaultWhitelist, 10671 popperConfig: null 10672 }; 10673 var DefaultType$3 = { 10674 animation: 'boolean', 10675 template: 'string', 10676 title: '(string|element|function)', 10677 trigger: 'string', 10678 delay: '(number|object)', 10679 html: 'boolean', 10680 selector: '(string|boolean)', 10681 placement: '(string|function)', 10682 offset: '(number|string|function)', 10683 container: '(string|element|boolean)', 10684 fallbackPlacement: '(string|array)', 10685 boundary: '(string|element)', 10686 customClass: '(string|function)', 10687 sanitize: 'boolean', 10688 sanitizeFn: '(null|function)', 10689 whiteList: 'object', 10690 popperConfig: '(null|object)' 10691 }; 10692 var Event$1 = { 10693 HIDE: "hide" + EVENT_KEY$4, 10694 HIDDEN: "hidden" + EVENT_KEY$4, 10695 SHOW: "show" + EVENT_KEY$4, 10696 SHOWN: "shown" + EVENT_KEY$4, 10697 INSERTED: "inserted" + EVENT_KEY$4, 10698 CLICK: "click" + EVENT_KEY$4, 10699 FOCUSIN: "focusin" + EVENT_KEY$4, 10700 FOCUSOUT: "focusout" + EVENT_KEY$4, 10701 MOUSEENTER: "mouseenter" + EVENT_KEY$4, 10702 MOUSELEAVE: "mouseleave" + EVENT_KEY$4 10703 }; 10704 /** 10705 * Class definition 10706 */ 10707 10708 var Tooltip = /*#__PURE__*/function () { 10709 function Tooltip(element, config) { 10710 if (typeof Popper__default["default"] === 'undefined') { 10711 throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); 10712 } // Private 10713 10714 10715 this._isEnabled = true; 10716 this._timeout = 0; 10717 this._hoverState = ''; 10718 this._activeTrigger = {}; 10719 this._popper = null; // Protected 10720 10721 this.element = element; 10722 this.config = this._getConfig(config); 10723 this.tip = null; 10724 10725 this._setListeners(); 10726 } // Getters 10727 10728 10729 var _proto = Tooltip.prototype; 10730 10731 // Public 10732 _proto.enable = function enable() { 10733 this._isEnabled = true; 10734 }; 10735 10736 _proto.disable = function disable() { 10737 this._isEnabled = false; 10738 }; 10739 10740 _proto.toggleEnabled = function toggleEnabled() { 10741 this._isEnabled = !this._isEnabled; 10742 }; 10743 10744 _proto.toggle = function toggle(event) { 10745 if (!this._isEnabled) { 10746 return; 10747 } 10748 10749 if (event) { 10750 var dataKey = this.constructor.DATA_KEY; 10751 var context = $__default["default"](event.currentTarget).data(dataKey); 10752 10753 if (!context) { 10754 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 10755 $__default["default"](event.currentTarget).data(dataKey, context); 10756 } 10757 10758 context._activeTrigger.click = !context._activeTrigger.click; 10759 10760 if (context._isWithActiveTrigger()) { 10761 context._enter(null, context); 10762 } else { 10763 context._leave(null, context); 10764 } 10765 } else { 10766 if ($__default["default"](this.getTipElement()).hasClass(CLASS_NAME_SHOW$3)) { 10767 this._leave(null, this); 10768 10769 return; 10770 } 10771 10772 this._enter(null, this); 10773 } 10774 }; 10775 10776 _proto.dispose = function dispose() { 10777 clearTimeout(this._timeout); 10778 $__default["default"].removeData(this.element, this.constructor.DATA_KEY); 10779 $__default["default"](this.element).off(this.constructor.EVENT_KEY); 10780 $__default["default"](this.element).closest('.modal').off('hide.bs.modal', this._hideModalHandler); 10781 10782 if (this.tip) { 10783 $__default["default"](this.tip).remove(); 10784 } 10785 10786 this._isEnabled = null; 10787 this._timeout = null; 10788 this._hoverState = null; 10789 this._activeTrigger = null; 10790 10791 if (this._popper) { 10792 this._popper.destroy(); 10793 } 10794 10795 this._popper = null; 10796 this.element = null; 10797 this.config = null; 10798 this.tip = null; 10799 }; 10800 10801 _proto.show = function show() { 10802 var _this = this; 10803 10804 if ($__default["default"](this.element).css('display') === 'none') { 10805 throw new Error('Please use show on visible elements'); 10806 } 10807 10808 var showEvent = $__default["default"].Event(this.constructor.Event.SHOW); 10809 10810 if (this.isWithContent() && this._isEnabled) { 10811 $__default["default"](this.element).trigger(showEvent); 10812 var shadowRoot = Util.findShadowRoot(this.element); 10813 var isInTheDom = $__default["default"].contains(shadowRoot !== null ? shadowRoot : this.element.ownerDocument.documentElement, this.element); 10814 10815 if (showEvent.isDefaultPrevented() || !isInTheDom) { 10816 return; 10817 } 10818 10819 var tip = this.getTipElement(); 10820 var tipId = Util.getUID(this.constructor.NAME); 10821 tip.setAttribute('id', tipId); 10822 this.element.setAttribute('aria-describedby', tipId); 10823 this.setContent(); 10824 10825 if (this.config.animation) { 10826 $__default["default"](tip).addClass(CLASS_NAME_FADE$3); 10827 } 10828 10829 var placement = typeof this.config.placement === 'function' ? this.config.placement.call(this, tip, this.element) : this.config.placement; 10830 10831 var attachment = this._getAttachment(placement); 10832 10833 this.addAttachmentClass(attachment); 10834 10835 var container = this._getContainer(); 10836 10837 $__default["default"](tip).data(this.constructor.DATA_KEY, this); 10838 10839 if (!$__default["default"].contains(this.element.ownerDocument.documentElement, this.tip)) { 10840 $__default["default"](tip).appendTo(container); 10841 } 10842 10843 $__default["default"](this.element).trigger(this.constructor.Event.INSERTED); 10844 this._popper = new Popper__default["default"](this.element, tip, this._getPopperConfig(attachment)); 10845 $__default["default"](tip).addClass(CLASS_NAME_SHOW$3); 10846 $__default["default"](tip).addClass(this.config.customClass); // If this is a touch-enabled device we add extra 10847 // empty mouseover listeners to the body's immediate children; 10848 // only needed because of broken event delegation on iOS 10849 // https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html 10850 10851 if ('ontouchstart' in document.documentElement) { 10852 $__default["default"](document.body).children().on('mouseover', null, $__default["default"].noop); 10853 } 10854 10855 var complete = function complete() { 10856 if (_this.config.animation) { 10857 _this._fixTransition(); 10858 } 10859 10860 var prevHoverState = _this._hoverState; 10861 _this._hoverState = null; 10862 $__default["default"](_this.element).trigger(_this.constructor.Event.SHOWN); 10863 10864 if (prevHoverState === HOVER_STATE_OUT) { 10865 _this._leave(null, _this); 10866 } 10867 }; 10868 10869 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 10870 var transitionDuration = Util.getTransitionDurationFromElement(this.tip); 10871 $__default["default"](this.tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 10872 } else { 10873 complete(); 10874 } 10875 } 10876 }; 10877 10878 _proto.hide = function hide(callback) { 10879 var _this2 = this; 10880 10881 var tip = this.getTipElement(); 10882 var hideEvent = $__default["default"].Event(this.constructor.Event.HIDE); 10883 10884 var complete = function complete() { 10885 if (_this2._hoverState !== HOVER_STATE_SHOW && tip.parentNode) { 10886 tip.parentNode.removeChild(tip); 10887 } 10888 10889 _this2._cleanTipClass(); 10890 10891 _this2.element.removeAttribute('aria-describedby'); 10892 10893 $__default["default"](_this2.element).trigger(_this2.constructor.Event.HIDDEN); 10894 10895 if (_this2._popper !== null) { 10896 _this2._popper.destroy(); 10897 } 10898 10899 if (callback) { 10900 callback(); 10901 } 10902 }; 10903 10904 $__default["default"](this.element).trigger(hideEvent); 10905 10906 if (hideEvent.isDefaultPrevented()) { 10907 return; 10908 } 10909 10910 $__default["default"](tip).removeClass(CLASS_NAME_SHOW$3); // If this is a touch-enabled device we remove the extra 10911 // empty mouseover listeners we added for iOS support 10912 10913 if ('ontouchstart' in document.documentElement) { 10914 $__default["default"](document.body).children().off('mouseover', null, $__default["default"].noop); 10915 } 10916 10917 this._activeTrigger[TRIGGER_CLICK] = false; 10918 this._activeTrigger[TRIGGER_FOCUS] = false; 10919 this._activeTrigger[TRIGGER_HOVER] = false; 10920 10921 if ($__default["default"](this.tip).hasClass(CLASS_NAME_FADE$3)) { 10922 var transitionDuration = Util.getTransitionDurationFromElement(tip); 10923 $__default["default"](tip).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 10924 } else { 10925 complete(); 10926 } 10927 10928 this._hoverState = ''; 10929 }; 10930 10931 _proto.update = function update() { 10932 if (this._popper !== null) { 10933 this._popper.scheduleUpdate(); 10934 } 10935 } // Protected 10936 ; 10937 10938 _proto.isWithContent = function isWithContent() { 10939 return Boolean(this.getTitle()); 10940 }; 10941 10942 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 10943 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX$1 + "-" + attachment); 10944 }; 10945 10946 _proto.getTipElement = function getTipElement() { 10947 this.tip = this.tip || $__default["default"](this.config.template)[0]; 10948 return this.tip; 10949 }; 10950 10951 _proto.setContent = function setContent() { 10952 var tip = this.getTipElement(); 10953 this.setElementContent($__default["default"](tip.querySelectorAll(SELECTOR_TOOLTIP_INNER)), this.getTitle()); 10954 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3 + " " + CLASS_NAME_SHOW$3); 10955 }; 10956 10957 _proto.setElementContent = function setElementContent($element, content) { 10958 if (typeof content === 'object' && (content.nodeType || content.jquery)) { 10959 // Content is a DOM node or a jQuery 10960 if (this.config.html) { 10961 if (!$__default["default"](content).parent().is($element)) { 10962 $element.empty().append(content); 10963 } 10964 } else { 10965 $element.text($__default["default"](content).text()); 10966 } 10967 10968 return; 10969 } 10970 10971 if (this.config.html) { 10972 if (this.config.sanitize) { 10973 content = sanitizeHtml(content, this.config.whiteList, this.config.sanitizeFn); 10974 } 10975 10976 $element.html(content); 10977 } else { 10978 $element.text(content); 10979 } 10980 }; 10981 10982 _proto.getTitle = function getTitle() { 10983 var title = this.element.getAttribute('data-original-title'); 10984 10985 if (!title) { 10986 title = typeof this.config.title === 'function' ? this.config.title.call(this.element) : this.config.title; 10987 } 10988 10989 return title; 10990 } // Private 10991 ; 10992 10993 _proto._getPopperConfig = function _getPopperConfig(attachment) { 10994 var _this3 = this; 10995 10996 var defaultBsConfig = { 10997 placement: attachment, 10998 modifiers: { 10999 offset: this._getOffset(), 11000 flip: { 11001 behavior: this.config.fallbackPlacement 11002 }, 11003 arrow: { 11004 element: SELECTOR_ARROW 11005 }, 11006 preventOverflow: { 11007 boundariesElement: this.config.boundary 11008 } 11009 }, 11010 onCreate: function onCreate(data) { 11011 if (data.originalPlacement !== data.placement) { 11012 _this3._handlePopperPlacementChange(data); 11013 } 11014 }, 11015 onUpdate: function onUpdate(data) { 11016 return _this3._handlePopperPlacementChange(data); 11017 } 11018 }; 11019 return _extends({}, defaultBsConfig, this.config.popperConfig); 11020 }; 11021 11022 _proto._getOffset = function _getOffset() { 11023 var _this4 = this; 11024 11025 var offset = {}; 11026 11027 if (typeof this.config.offset === 'function') { 11028 offset.fn = function (data) { 11029 data.offsets = _extends({}, data.offsets, _this4.config.offset(data.offsets, _this4.element)); 11030 return data; 11031 }; 11032 } else { 11033 offset.offset = this.config.offset; 11034 } 11035 11036 return offset; 11037 }; 11038 11039 _proto._getContainer = function _getContainer() { 11040 if (this.config.container === false) { 11041 return document.body; 11042 } 11043 11044 if (Util.isElement(this.config.container)) { 11045 return $__default["default"](this.config.container); 11046 } 11047 11048 return $__default["default"](document).find(this.config.container); 11049 }; 11050 11051 _proto._getAttachment = function _getAttachment(placement) { 11052 return AttachmentMap[placement.toUpperCase()]; 11053 }; 11054 11055 _proto._setListeners = function _setListeners() { 11056 var _this5 = this; 11057 11058 var triggers = this.config.trigger.split(' '); 11059 triggers.forEach(function (trigger) { 11060 if (trigger === 'click') { 11061 $__default["default"](_this5.element).on(_this5.constructor.Event.CLICK, _this5.config.selector, function (event) { 11062 return _this5.toggle(event); 11063 }); 11064 } else if (trigger !== TRIGGER_MANUAL) { 11065 var eventIn = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSEENTER : _this5.constructor.Event.FOCUSIN; 11066 var eventOut = trigger === TRIGGER_HOVER ? _this5.constructor.Event.MOUSELEAVE : _this5.constructor.Event.FOCUSOUT; 11067 $__default["default"](_this5.element).on(eventIn, _this5.config.selector, function (event) { 11068 return _this5._enter(event); 11069 }).on(eventOut, _this5.config.selector, function (event) { 11070 return _this5._leave(event); 11071 }); 11072 } 11073 }); 11074 11075 this._hideModalHandler = function () { 11076 if (_this5.element) { 11077 _this5.hide(); 11078 } 11079 }; 11080 11081 $__default["default"](this.element).closest('.modal').on('hide.bs.modal', this._hideModalHandler); 11082 11083 if (this.config.selector) { 11084 this.config = _extends({}, this.config, { 11085 trigger: 'manual', 11086 selector: '' 11087 }); 11088 } else { 11089 this._fixTitle(); 11090 } 11091 }; 11092 11093 _proto._fixTitle = function _fixTitle() { 11094 var titleType = typeof this.element.getAttribute('data-original-title'); 11095 11096 if (this.element.getAttribute('title') || titleType !== 'string') { 11097 this.element.setAttribute('data-original-title', this.element.getAttribute('title') || ''); 11098 this.element.setAttribute('title', ''); 11099 } 11100 }; 11101 11102 _proto._enter = function _enter(event, context) { 11103 var dataKey = this.constructor.DATA_KEY; 11104 context = context || $__default["default"](event.currentTarget).data(dataKey); 11105 11106 if (!context) { 11107 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 11108 $__default["default"](event.currentTarget).data(dataKey, context); 11109 } 11110 11111 if (event) { 11112 context._activeTrigger[event.type === 'focusin' ? TRIGGER_FOCUS : TRIGGER_HOVER] = true; 11113 } 11114 11115 if ($__default["default"](context.getTipElement()).hasClass(CLASS_NAME_SHOW$3) || context._hoverState === HOVER_STATE_SHOW) { 11116 context._hoverState = HOVER_STATE_SHOW; 11117 return; 11118 } 11119 11120 clearTimeout(context._timeout); 11121 context._hoverState = HOVER_STATE_SHOW; 11122 11123 if (!context.config.delay || !context.config.delay.show) { 11124 context.show(); 11125 return; 11126 } 11127 11128 context._timeout = setTimeout(function () { 11129 if (context._hoverState === HOVER_STATE_SHOW) { 11130 context.show(); 11131 } 11132 }, context.config.delay.show); 11133 }; 11134 11135 _proto._leave = function _leave(event, context) { 11136 var dataKey = this.constructor.DATA_KEY; 11137 context = context || $__default["default"](event.currentTarget).data(dataKey); 11138 11139 if (!context) { 11140 context = new this.constructor(event.currentTarget, this._getDelegateConfig()); 11141 $__default["default"](event.currentTarget).data(dataKey, context); 11142 } 11143 11144 if (event) { 11145 context._activeTrigger[event.type === 'focusout' ? TRIGGER_FOCUS : TRIGGER_HOVER] = false; 11146 } 11147 11148 if (context._isWithActiveTrigger()) { 11149 return; 11150 } 11151 11152 clearTimeout(context._timeout); 11153 context._hoverState = HOVER_STATE_OUT; 11154 11155 if (!context.config.delay || !context.config.delay.hide) { 11156 context.hide(); 11157 return; 11158 } 11159 11160 context._timeout = setTimeout(function () { 11161 if (context._hoverState === HOVER_STATE_OUT) { 11162 context.hide(); 11163 } 11164 }, context.config.delay.hide); 11165 }; 11166 11167 _proto._isWithActiveTrigger = function _isWithActiveTrigger() { 11168 for (var trigger in this._activeTrigger) { 11169 if (this._activeTrigger[trigger]) { 11170 return true; 11171 } 11172 } 11173 11174 return false; 11175 }; 11176 11177 _proto._getConfig = function _getConfig(config) { 11178 var dataAttributes = $__default["default"](this.element).data(); 11179 Object.keys(dataAttributes).forEach(function (dataAttr) { 11180 if (DISALLOWED_ATTRIBUTES.indexOf(dataAttr) !== -1) { 11181 delete dataAttributes[dataAttr]; 11182 } 11183 }); 11184 config = _extends({}, this.constructor.Default, dataAttributes, typeof config === 'object' && config ? config : {}); 11185 11186 if (typeof config.delay === 'number') { 11187 config.delay = { 11188 show: config.delay, 11189 hide: config.delay 11190 }; 11191 } 11192 11193 if (typeof config.title === 'number') { 11194 config.title = config.title.toString(); 11195 } 11196 11197 if (typeof config.content === 'number') { 11198 config.content = config.content.toString(); 11199 } 11200 11201 Util.typeCheckConfig(NAME$4, config, this.constructor.DefaultType); 11202 11203 if (config.sanitize) { 11204 config.template = sanitizeHtml(config.template, config.whiteList, config.sanitizeFn); 11205 } 11206 11207 return config; 11208 }; 11209 11210 _proto._getDelegateConfig = function _getDelegateConfig() { 11211 var config = {}; 11212 11213 if (this.config) { 11214 for (var key in this.config) { 11215 if (this.constructor.Default[key] !== this.config[key]) { 11216 config[key] = this.config[key]; 11217 } 11218 } 11219 } 11220 11221 return config; 11222 }; 11223 11224 _proto._cleanTipClass = function _cleanTipClass() { 11225 var $tip = $__default["default"](this.getTipElement()); 11226 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX$1); 11227 11228 if (tabClass !== null && tabClass.length) { 11229 $tip.removeClass(tabClass.join('')); 11230 } 11231 }; 11232 11233 _proto._handlePopperPlacementChange = function _handlePopperPlacementChange(popperData) { 11234 this.tip = popperData.instance.popper; 11235 11236 this._cleanTipClass(); 11237 11238 this.addAttachmentClass(this._getAttachment(popperData.placement)); 11239 }; 11240 11241 _proto._fixTransition = function _fixTransition() { 11242 var tip = this.getTipElement(); 11243 var initConfigAnimation = this.config.animation; 11244 11245 if (tip.getAttribute('x-placement') !== null) { 11246 return; 11247 } 11248 11249 $__default["default"](tip).removeClass(CLASS_NAME_FADE$3); 11250 this.config.animation = false; 11251 this.hide(); 11252 this.show(); 11253 this.config.animation = initConfigAnimation; 11254 } // Static 11255 ; 11256 11257 Tooltip._jQueryInterface = function _jQueryInterface(config) { 11258 return this.each(function () { 11259 var $element = $__default["default"](this); 11260 var data = $element.data(DATA_KEY$4); 11261 11262 var _config = typeof config === 'object' && config; 11263 11264 if (!data && /dispose|hide/.test(config)) { 11265 return; 11266 } 11267 11268 if (!data) { 11269 data = new Tooltip(this, _config); 11270 $element.data(DATA_KEY$4, data); 11271 } 11272 11273 if (typeof config === 'string') { 11274 if (typeof data[config] === 'undefined') { 11275 throw new TypeError("No method named \"" + config + "\""); 11276 } 11277 11278 data[config](); 11279 } 11280 }); 11281 }; 11282 11283 _createClass(Tooltip, null, [{ 11284 key: "VERSION", 11285 get: function get() { 11286 return VERSION$4; 11287 } 11288 }, { 11289 key: "Default", 11290 get: function get() { 11291 return Default$3; 11292 } 11293 }, { 11294 key: "NAME", 11295 get: function get() { 11296 return NAME$4; 11297 } 11298 }, { 11299 key: "DATA_KEY", 11300 get: function get() { 11301 return DATA_KEY$4; 11302 } 11303 }, { 11304 key: "Event", 11305 get: function get() { 11306 return Event$1; 11307 } 11308 }, { 11309 key: "EVENT_KEY", 11310 get: function get() { 11311 return EVENT_KEY$4; 11312 } 11313 }, { 11314 key: "DefaultType", 11315 get: function get() { 11316 return DefaultType$3; 11317 } 11318 }]); 11319 11320 return Tooltip; 11321 }(); 11322 /** 11323 * jQuery 11324 */ 11325 11326 11327 $__default["default"].fn[NAME$4] = Tooltip._jQueryInterface; 11328 $__default["default"].fn[NAME$4].Constructor = Tooltip; 11329 11330 $__default["default"].fn[NAME$4].noConflict = function () { 11331 $__default["default"].fn[NAME$4] = JQUERY_NO_CONFLICT$4; 11332 return Tooltip._jQueryInterface; 11333 }; 11334 11335 /** 11336 * Constants 11337 */ 11338 11339 var NAME$3 = 'popover'; 11340 var VERSION$3 = '4.6.1'; 11341 var DATA_KEY$3 = 'bs.popover'; 11342 var EVENT_KEY$3 = "." + DATA_KEY$3; 11343 var JQUERY_NO_CONFLICT$3 = $__default["default"].fn[NAME$3]; 11344 var CLASS_PREFIX = 'bs-popover'; 11345 var BSCLS_PREFIX_REGEX = new RegExp("(^|\\s)" + CLASS_PREFIX + "\\S+", 'g'); 11346 var CLASS_NAME_FADE$2 = 'fade'; 11347 var CLASS_NAME_SHOW$2 = 'show'; 11348 var SELECTOR_TITLE = '.popover-header'; 11349 var SELECTOR_CONTENT = '.popover-body'; 11350 11351 var Default$2 = _extends({}, Tooltip.Default, { 11352 placement: 'right', 11353 trigger: 'click', 11354 content: '', 11355 template: '<div class="popover" role="tooltip">' + '<div class="arrow"></div>' + '<h3 class="popover-header"></h3>' + '<div class="popover-body"></div></div>' 11356 }); 11357 11358 var DefaultType$2 = _extends({}, Tooltip.DefaultType, { 11359 content: '(string|element|function)' 11360 }); 11361 11362 var Event = { 11363 HIDE: "hide" + EVENT_KEY$3, 11364 HIDDEN: "hidden" + EVENT_KEY$3, 11365 SHOW: "show" + EVENT_KEY$3, 11366 SHOWN: "shown" + EVENT_KEY$3, 11367 INSERTED: "inserted" + EVENT_KEY$3, 11368 CLICK: "click" + EVENT_KEY$3, 11369 FOCUSIN: "focusin" + EVENT_KEY$3, 11370 FOCUSOUT: "focusout" + EVENT_KEY$3, 11371 MOUSEENTER: "mouseenter" + EVENT_KEY$3, 11372 MOUSELEAVE: "mouseleave" + EVENT_KEY$3 11373 }; 11374 /** 11375 * Class definition 11376 */ 11377 11378 var Popover = /*#__PURE__*/function (_Tooltip) { 11379 _inheritsLoose(Popover, _Tooltip); 11380 11381 function Popover() { 11382 return _Tooltip.apply(this, arguments) || this; 11383 } 11384 11385 var _proto = Popover.prototype; 11386 11387 // Overrides 11388 _proto.isWithContent = function isWithContent() { 11389 return this.getTitle() || this._getContent(); 11390 }; 11391 11392 _proto.addAttachmentClass = function addAttachmentClass(attachment) { 11393 $__default["default"](this.getTipElement()).addClass(CLASS_PREFIX + "-" + attachment); 11394 }; 11395 11396 _proto.getTipElement = function getTipElement() { 11397 this.tip = this.tip || $__default["default"](this.config.template)[0]; 11398 return this.tip; 11399 }; 11400 11401 _proto.setContent = function setContent() { 11402 var $tip = $__default["default"](this.getTipElement()); // We use append for html objects to maintain js events 11403 11404 this.setElementContent($tip.find(SELECTOR_TITLE), this.getTitle()); 11405 11406 var content = this._getContent(); 11407 11408 if (typeof content === 'function') { 11409 content = content.call(this.element); 11410 } 11411 11412 this.setElementContent($tip.find(SELECTOR_CONTENT), content); 11413 $tip.removeClass(CLASS_NAME_FADE$2 + " " + CLASS_NAME_SHOW$2); 11414 } // Private 11415 ; 11416 11417 _proto._getContent = function _getContent() { 11418 return this.element.getAttribute('data-content') || this.config.content; 11419 }; 11420 11421 _proto._cleanTipClass = function _cleanTipClass() { 11422 var $tip = $__default["default"](this.getTipElement()); 11423 var tabClass = $tip.attr('class').match(BSCLS_PREFIX_REGEX); 11424 11425 if (tabClass !== null && tabClass.length > 0) { 11426 $tip.removeClass(tabClass.join('')); 11427 } 11428 } // Static 11429 ; 11430 11431 Popover._jQueryInterface = function _jQueryInterface(config) { 11432 return this.each(function () { 11433 var data = $__default["default"](this).data(DATA_KEY$3); 11434 11435 var _config = typeof config === 'object' ? config : null; 11436 11437 if (!data && /dispose|hide/.test(config)) { 11438 return; 11439 } 11440 11441 if (!data) { 11442 data = new Popover(this, _config); 11443 $__default["default"](this).data(DATA_KEY$3, data); 11444 } 11445 11446 if (typeof config === 'string') { 11447 if (typeof data[config] === 'undefined') { 11448 throw new TypeError("No method named \"" + config + "\""); 11449 } 11450 11451 data[config](); 11452 } 11453 }); 11454 }; 11455 11456 _createClass(Popover, null, [{ 11457 key: "VERSION", 11458 get: // Getters 11459 function get() { 11460 return VERSION$3; 11461 } 11462 }, { 11463 key: "Default", 11464 get: function get() { 11465 return Default$2; 11466 } 11467 }, { 11468 key: "NAME", 11469 get: function get() { 11470 return NAME$3; 11471 } 11472 }, { 11473 key: "DATA_KEY", 11474 get: function get() { 11475 return DATA_KEY$3; 11476 } 11477 }, { 11478 key: "Event", 11479 get: function get() { 11480 return Event; 11481 } 11482 }, { 11483 key: "EVENT_KEY", 11484 get: function get() { 11485 return EVENT_KEY$3; 11486 } 11487 }, { 11488 key: "DefaultType", 11489 get: function get() { 11490 return DefaultType$2; 11491 } 11492 }]); 11493 11494 return Popover; 11495 }(Tooltip); 11496 /** 11497 * jQuery 11498 */ 11499 11500 11501 $__default["default"].fn[NAME$3] = Popover._jQueryInterface; 11502 $__default["default"].fn[NAME$3].Constructor = Popover; 11503 11504 $__default["default"].fn[NAME$3].noConflict = function () { 11505 $__default["default"].fn[NAME$3] = JQUERY_NO_CONFLICT$3; 11506 return Popover._jQueryInterface; 11507 }; 11508 11509 /** 11510 * Constants 11511 */ 11512 11513 var NAME$2 = 'scrollspy'; 11514 var VERSION$2 = '4.6.1'; 11515 var DATA_KEY$2 = 'bs.scrollspy'; 11516 var EVENT_KEY$2 = "." + DATA_KEY$2; 11517 var DATA_API_KEY$1 = '.data-api'; 11518 var JQUERY_NO_CONFLICT$2 = $__default["default"].fn[NAME$2]; 11519 var CLASS_NAME_DROPDOWN_ITEM = 'dropdown-item'; 11520 var CLASS_NAME_ACTIVE$1 = 'active'; 11521 var EVENT_ACTIVATE = "activate" + EVENT_KEY$2; 11522 var EVENT_SCROLL = "scroll" + EVENT_KEY$2; 11523 var EVENT_LOAD_DATA_API = "load" + EVENT_KEY$2 + DATA_API_KEY$1; 11524 var METHOD_OFFSET = 'offset'; 11525 var METHOD_POSITION = 'position'; 11526 var SELECTOR_DATA_SPY = '[data-spy="scroll"]'; 11527 var SELECTOR_NAV_LIST_GROUP$1 = '.nav, .list-group'; 11528 var SELECTOR_NAV_LINKS = '.nav-link'; 11529 var SELECTOR_NAV_ITEMS = '.nav-item'; 11530 var SELECTOR_LIST_ITEMS = '.list-group-item'; 11531 var SELECTOR_DROPDOWN$1 = '.dropdown'; 11532 var SELECTOR_DROPDOWN_ITEMS = '.dropdown-item'; 11533 var SELECTOR_DROPDOWN_TOGGLE$1 = '.dropdown-toggle'; 11534 var Default$1 = { 11535 offset: 10, 11536 method: 'auto', 11537 target: '' 11538 }; 11539 var DefaultType$1 = { 11540 offset: 'number', 11541 method: 'string', 11542 target: '(string|element)' 11543 }; 11544 /** 11545 * Class definition 11546 */ 11547 11548 var ScrollSpy = /*#__PURE__*/function () { 11549 function ScrollSpy(element, config) { 11550 var _this = this; 11551 11552 this._element = element; 11553 this._scrollElement = element.tagName === 'BODY' ? window : element; 11554 this._config = this._getConfig(config); 11555 this._selector = this._config.target + " " + SELECTOR_NAV_LINKS + "," + (this._config.target + " " + SELECTOR_LIST_ITEMS + ",") + (this._config.target + " " + SELECTOR_DROPDOWN_ITEMS); 11556 this._offsets = []; 11557 this._targets = []; 11558 this._activeTarget = null; 11559 this._scrollHeight = 0; 11560 $__default["default"](this._scrollElement).on(EVENT_SCROLL, function (event) { 11561 return _this._process(event); 11562 }); 11563 this.refresh(); 11564 11565 this._process(); 11566 } // Getters 11567 11568 11569 var _proto = ScrollSpy.prototype; 11570 11571 // Public 11572 _proto.refresh = function refresh() { 11573 var _this2 = this; 11574 11575 var autoMethod = this._scrollElement === this._scrollElement.window ? METHOD_OFFSET : METHOD_POSITION; 11576 var offsetMethod = this._config.method === 'auto' ? autoMethod : this._config.method; 11577 var offsetBase = offsetMethod === METHOD_POSITION ? this._getScrollTop() : 0; 11578 this._offsets = []; 11579 this._targets = []; 11580 this._scrollHeight = this._getScrollHeight(); 11581 var targets = [].slice.call(document.querySelectorAll(this._selector)); 11582 targets.map(function (element) { 11583 var target; 11584 var targetSelector = Util.getSelectorFromElement(element); 11585 11586 if (targetSelector) { 11587 target = document.querySelector(targetSelector); 11588 } 11589 11590 if (target) { 11591 var targetBCR = target.getBoundingClientRect(); 11592 11593 if (targetBCR.width || targetBCR.height) { 11594 // TODO (fat): remove sketch reliance on jQuery position/offset 11595 return [$__default["default"](target)[offsetMethod]().top + offsetBase, targetSelector]; 11596 } 11597 } 11598 11599 return null; 11600 }).filter(function (item) { 11601 return item; 11602 }).sort(function (a, b) { 11603 return a[0] - b[0]; 11604 }).forEach(function (item) { 11605 _this2._offsets.push(item[0]); 11606 11607 _this2._targets.push(item[1]); 11608 }); 11609 }; 11610 11611 _proto.dispose = function dispose() { 11612 $__default["default"].removeData(this._element, DATA_KEY$2); 11613 $__default["default"](this._scrollElement).off(EVENT_KEY$2); 11614 this._element = null; 11615 this._scrollElement = null; 11616 this._config = null; 11617 this._selector = null; 11618 this._offsets = null; 11619 this._targets = null; 11620 this._activeTarget = null; 11621 this._scrollHeight = null; 11622 } // Private 11623 ; 11624 11625 _proto._getConfig = function _getConfig(config) { 11626 config = _extends({}, Default$1, typeof config === 'object' && config ? config : {}); 11627 11628 if (typeof config.target !== 'string' && Util.isElement(config.target)) { 11629 var id = $__default["default"](config.target).attr('id'); 11630 11631 if (!id) { 11632 id = Util.getUID(NAME$2); 11633 $__default["default"](config.target).attr('id', id); 11634 } 11635 11636 config.target = "#" + id; 11637 } 11638 11639 Util.typeCheckConfig(NAME$2, config, DefaultType$1); 11640 return config; 11641 }; 11642 11643 _proto._getScrollTop = function _getScrollTop() { 11644 return this._scrollElement === window ? this._scrollElement.pageYOffset : this._scrollElement.scrollTop; 11645 }; 11646 11647 _proto._getScrollHeight = function _getScrollHeight() { 11648 return this._scrollElement.scrollHeight || Math.max(document.body.scrollHeight, document.documentElement.scrollHeight); 11649 }; 11650 11651 _proto._getOffsetHeight = function _getOffsetHeight() { 11652 return this._scrollElement === window ? window.innerHeight : this._scrollElement.getBoundingClientRect().height; 11653 }; 11654 11655 _proto._process = function _process() { 11656 var scrollTop = this._getScrollTop() + this._config.offset; 11657 11658 var scrollHeight = this._getScrollHeight(); 11659 11660 var maxScroll = this._config.offset + scrollHeight - this._getOffsetHeight(); 11661 11662 if (this._scrollHeight !== scrollHeight) { 11663 this.refresh(); 11664 } 11665 11666 if (scrollTop >= maxScroll) { 11667 var target = this._targets[this._targets.length - 1]; 11668 11669 if (this._activeTarget !== target) { 11670 this._activate(target); 11671 } 11672 11673 return; 11674 } 11675 11676 if (this._activeTarget && scrollTop < this._offsets[0] && this._offsets[0] > 0) { 11677 this._activeTarget = null; 11678 11679 this._clear(); 11680 11681 return; 11682 } 11683 11684 for (var i = this._offsets.length; i--;) { 11685 var isActiveTarget = this._activeTarget !== this._targets[i] && scrollTop >= this._offsets[i] && (typeof this._offsets[i + 1] === 'undefined' || scrollTop < this._offsets[i + 1]); 11686 11687 if (isActiveTarget) { 11688 this._activate(this._targets[i]); 11689 } 11690 } 11691 }; 11692 11693 _proto._activate = function _activate(target) { 11694 this._activeTarget = target; 11695 11696 this._clear(); 11697 11698 var queries = this._selector.split(',').map(function (selector) { 11699 return selector + "[data-target=\"" + target + "\"]," + selector + "[href=\"" + target + "\"]"; 11700 }); 11701 11702 var $link = $__default["default"]([].slice.call(document.querySelectorAll(queries.join(',')))); 11703 11704 if ($link.hasClass(CLASS_NAME_DROPDOWN_ITEM)) { 11705 $link.closest(SELECTOR_DROPDOWN$1).find(SELECTOR_DROPDOWN_TOGGLE$1).addClass(CLASS_NAME_ACTIVE$1); 11706 $link.addClass(CLASS_NAME_ACTIVE$1); 11707 } else { 11708 // Set triggered link as active 11709 $link.addClass(CLASS_NAME_ACTIVE$1); // Set triggered links parents as active 11710 // With both <ul> and <nav> markup a parent is the previous sibling of any nav ancestor 11711 11712 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_LINKS + ", " + SELECTOR_LIST_ITEMS).addClass(CLASS_NAME_ACTIVE$1); // Handle special case when .nav-link is inside .nav-item 11713 11714 $link.parents(SELECTOR_NAV_LIST_GROUP$1).prev(SELECTOR_NAV_ITEMS).children(SELECTOR_NAV_LINKS).addClass(CLASS_NAME_ACTIVE$1); 11715 } 11716 11717 $__default["default"](this._scrollElement).trigger(EVENT_ACTIVATE, { 11718 relatedTarget: target 11719 }); 11720 }; 11721 11722 _proto._clear = function _clear() { 11723 [].slice.call(document.querySelectorAll(this._selector)).filter(function (node) { 11724 return node.classList.contains(CLASS_NAME_ACTIVE$1); 11725 }).forEach(function (node) { 11726 return node.classList.remove(CLASS_NAME_ACTIVE$1); 11727 }); 11728 } // Static 11729 ; 11730 11731 ScrollSpy._jQueryInterface = function _jQueryInterface(config) { 11732 return this.each(function () { 11733 var data = $__default["default"](this).data(DATA_KEY$2); 11734 11735 var _config = typeof config === 'object' && config; 11736 11737 if (!data) { 11738 data = new ScrollSpy(this, _config); 11739 $__default["default"](this).data(DATA_KEY$2, data); 11740 } 11741 11742 if (typeof config === 'string') { 11743 if (typeof data[config] === 'undefined') { 11744 throw new TypeError("No method named \"" + config + "\""); 11745 } 11746 11747 data[config](); 11748 } 11749 }); 11750 }; 11751 11752 _createClass(ScrollSpy, null, [{ 11753 key: "VERSION", 11754 get: function get() { 11755 return VERSION$2; 11756 } 11757 }, { 11758 key: "Default", 11759 get: function get() { 11760 return Default$1; 11761 } 11762 }]); 11763 11764 return ScrollSpy; 11765 }(); 11766 /** 11767 * Data API implementation 11768 */ 11769 11770 11771 $__default["default"](window).on(EVENT_LOAD_DATA_API, function () { 11772 var scrollSpys = [].slice.call(document.querySelectorAll(SELECTOR_DATA_SPY)); 11773 var scrollSpysLength = scrollSpys.length; 11774 11775 for (var i = scrollSpysLength; i--;) { 11776 var $spy = $__default["default"](scrollSpys[i]); 11777 11778 ScrollSpy._jQueryInterface.call($spy, $spy.data()); 11779 } 11780 }); 11781 /** 11782 * jQuery 11783 */ 11784 11785 $__default["default"].fn[NAME$2] = ScrollSpy._jQueryInterface; 11786 $__default["default"].fn[NAME$2].Constructor = ScrollSpy; 11787 11788 $__default["default"].fn[NAME$2].noConflict = function () { 11789 $__default["default"].fn[NAME$2] = JQUERY_NO_CONFLICT$2; 11790 return ScrollSpy._jQueryInterface; 11791 }; 11792 11793 /** 11794 * Constants 11795 */ 11796 11797 var NAME$1 = 'tab'; 11798 var VERSION$1 = '4.6.1'; 11799 var DATA_KEY$1 = 'bs.tab'; 11800 var EVENT_KEY$1 = "." + DATA_KEY$1; 11801 var DATA_API_KEY = '.data-api'; 11802 var JQUERY_NO_CONFLICT$1 = $__default["default"].fn[NAME$1]; 11803 var CLASS_NAME_DROPDOWN_MENU = 'dropdown-menu'; 11804 var CLASS_NAME_ACTIVE = 'active'; 11805 var CLASS_NAME_DISABLED = 'disabled'; 11806 var CLASS_NAME_FADE$1 = 'fade'; 11807 var CLASS_NAME_SHOW$1 = 'show'; 11808 var EVENT_HIDE$1 = "hide" + EVENT_KEY$1; 11809 var EVENT_HIDDEN$1 = "hidden" + EVENT_KEY$1; 11810 var EVENT_SHOW$1 = "show" + EVENT_KEY$1; 11811 var EVENT_SHOWN$1 = "shown" + EVENT_KEY$1; 11812 var EVENT_CLICK_DATA_API = "click" + EVENT_KEY$1 + DATA_API_KEY; 11813 var SELECTOR_DROPDOWN = '.dropdown'; 11814 var SELECTOR_NAV_LIST_GROUP = '.nav, .list-group'; 11815 var SELECTOR_ACTIVE = '.active'; 11816 var SELECTOR_ACTIVE_UL = '> li > .active'; 11817 var SELECTOR_DATA_TOGGLE = '[data-toggle="tab"], [data-toggle="pill"], [data-toggle="list"]'; 11818 var SELECTOR_DROPDOWN_TOGGLE = '.dropdown-toggle'; 11819 var SELECTOR_DROPDOWN_ACTIVE_CHILD = '> .dropdown-menu .active'; 11820 /** 11821 * Class definition 11822 */ 11823 11824 var Tab = /*#__PURE__*/function () { 11825 function Tab(element) { 11826 this._element = element; 11827 } // Getters 11828 11829 11830 var _proto = Tab.prototype; 11831 11832 // Public 11833 _proto.show = function show() { 11834 var _this = this; 11835 11836 if (this._element.parentNode && this._element.parentNode.nodeType === Node.ELEMENT_NODE && $__default["default"](this._element).hasClass(CLASS_NAME_ACTIVE) || $__default["default"](this._element).hasClass(CLASS_NAME_DISABLED)) { 11837 return; 11838 } 11839 11840 var target; 11841 var previous; 11842 var listElement = $__default["default"](this._element).closest(SELECTOR_NAV_LIST_GROUP)[0]; 11843 var selector = Util.getSelectorFromElement(this._element); 11844 11845 if (listElement) { 11846 var itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? SELECTOR_ACTIVE_UL : SELECTOR_ACTIVE; 11847 previous = $__default["default"].makeArray($__default["default"](listElement).find(itemSelector)); 11848 previous = previous[previous.length - 1]; 11849 } 11850 11851 var hideEvent = $__default["default"].Event(EVENT_HIDE$1, { 11852 relatedTarget: this._element 11853 }); 11854 var showEvent = $__default["default"].Event(EVENT_SHOW$1, { 11855 relatedTarget: previous 11856 }); 11857 11858 if (previous) { 11859 $__default["default"](previous).trigger(hideEvent); 11860 } 11861 11862 $__default["default"](this._element).trigger(showEvent); 11863 11864 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) { 11865 return; 11866 } 11867 11868 if (selector) { 11869 target = document.querySelector(selector); 11870 } 11871 11872 this._activate(this._element, listElement); 11873 11874 var complete = function complete() { 11875 var hiddenEvent = $__default["default"].Event(EVENT_HIDDEN$1, { 11876 relatedTarget: _this._element 11877 }); 11878 var shownEvent = $__default["default"].Event(EVENT_SHOWN$1, { 11879 relatedTarget: previous 11880 }); 11881 $__default["default"](previous).trigger(hiddenEvent); 11882 $__default["default"](_this._element).trigger(shownEvent); 11883 }; 11884 11885 if (target) { 11886 this._activate(target, target.parentNode, complete); 11887 } else { 11888 complete(); 11889 } 11890 }; 11891 11892 _proto.dispose = function dispose() { 11893 $__default["default"].removeData(this._element, DATA_KEY$1); 11894 this._element = null; 11895 } // Private 11896 ; 11897 11898 _proto._activate = function _activate(element, container, callback) { 11899 var _this2 = this; 11900 11901 var activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL') ? $__default["default"](container).find(SELECTOR_ACTIVE_UL) : $__default["default"](container).children(SELECTOR_ACTIVE); 11902 var active = activeElements[0]; 11903 var isTransitioning = callback && active && $__default["default"](active).hasClass(CLASS_NAME_FADE$1); 11904 11905 var complete = function complete() { 11906 return _this2._transitionComplete(element, active, callback); 11907 }; 11908 11909 if (active && isTransitioning) { 11910 var transitionDuration = Util.getTransitionDurationFromElement(active); 11911 $__default["default"](active).removeClass(CLASS_NAME_SHOW$1).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 11912 } else { 11913 complete(); 11914 } 11915 }; 11916 11917 _proto._transitionComplete = function _transitionComplete(element, active, callback) { 11918 if (active) { 11919 $__default["default"](active).removeClass(CLASS_NAME_ACTIVE); 11920 var dropdownChild = $__default["default"](active.parentNode).find(SELECTOR_DROPDOWN_ACTIVE_CHILD)[0]; 11921 11922 if (dropdownChild) { 11923 $__default["default"](dropdownChild).removeClass(CLASS_NAME_ACTIVE); 11924 } 11925 11926 if (active.getAttribute('role') === 'tab') { 11927 active.setAttribute('aria-selected', false); 11928 } 11929 } 11930 11931 $__default["default"](element).addClass(CLASS_NAME_ACTIVE); 11932 11933 if (element.getAttribute('role') === 'tab') { 11934 element.setAttribute('aria-selected', true); 11935 } 11936 11937 Util.reflow(element); 11938 11939 if (element.classList.contains(CLASS_NAME_FADE$1)) { 11940 element.classList.add(CLASS_NAME_SHOW$1); 11941 } 11942 11943 var parent = element.parentNode; 11944 11945 if (parent && parent.nodeName === 'LI') { 11946 parent = parent.parentNode; 11947 } 11948 11949 if (parent && $__default["default"](parent).hasClass(CLASS_NAME_DROPDOWN_MENU)) { 11950 var dropdownElement = $__default["default"](element).closest(SELECTOR_DROPDOWN)[0]; 11951 11952 if (dropdownElement) { 11953 var dropdownToggleList = [].slice.call(dropdownElement.querySelectorAll(SELECTOR_DROPDOWN_TOGGLE)); 11954 $__default["default"](dropdownToggleList).addClass(CLASS_NAME_ACTIVE); 11955 } 11956 11957 element.setAttribute('aria-expanded', true); 11958 } 11959 11960 if (callback) { 11961 callback(); 11962 } 11963 } // Static 11964 ; 11965 11966 Tab._jQueryInterface = function _jQueryInterface(config) { 11967 return this.each(function () { 11968 var $this = $__default["default"](this); 11969 var data = $this.data(DATA_KEY$1); 11970 11971 if (!data) { 11972 data = new Tab(this); 11973 $this.data(DATA_KEY$1, data); 11974 } 11975 11976 if (typeof config === 'string') { 11977 if (typeof data[config] === 'undefined') { 11978 throw new TypeError("No method named \"" + config + "\""); 11979 } 11980 11981 data[config](); 11982 } 11983 }); 11984 }; 11985 11986 _createClass(Tab, null, [{ 11987 key: "VERSION", 11988 get: function get() { 11989 return VERSION$1; 11990 } 11991 }]); 11992 11993 return Tab; 11994 }(); 11995 /** 11996 * Data API implementation 11997 */ 11998 11999 12000 $__default["default"](document).on(EVENT_CLICK_DATA_API, SELECTOR_DATA_TOGGLE, function (event) { 12001 event.preventDefault(); 12002 12003 Tab._jQueryInterface.call($__default["default"](this), 'show'); 12004 }); 12005 /** 12006 * jQuery 12007 */ 12008 12009 $__default["default"].fn[NAME$1] = Tab._jQueryInterface; 12010 $__default["default"].fn[NAME$1].Constructor = Tab; 12011 12012 $__default["default"].fn[NAME$1].noConflict = function () { 12013 $__default["default"].fn[NAME$1] = JQUERY_NO_CONFLICT$1; 12014 return Tab._jQueryInterface; 12015 }; 12016 12017 /** 12018 * Constants 12019 */ 12020 12021 var NAME = 'toast'; 12022 var VERSION = '4.6.1'; 12023 var DATA_KEY = 'bs.toast'; 12024 var EVENT_KEY = "." + DATA_KEY; 12025 var JQUERY_NO_CONFLICT = $__default["default"].fn[NAME]; 12026 var CLASS_NAME_FADE = 'fade'; 12027 var CLASS_NAME_HIDE = 'hide'; 12028 var CLASS_NAME_SHOW = 'show'; 12029 var CLASS_NAME_SHOWING = 'showing'; 12030 var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY; 12031 var EVENT_HIDE = "hide" + EVENT_KEY; 12032 var EVENT_HIDDEN = "hidden" + EVENT_KEY; 12033 var EVENT_SHOW = "show" + EVENT_KEY; 12034 var EVENT_SHOWN = "shown" + EVENT_KEY; 12035 var SELECTOR_DATA_DISMISS = '[data-dismiss="toast"]'; 12036 var Default = { 12037 animation: true, 12038 autohide: true, 12039 delay: 500 12040 }; 12041 var DefaultType = { 12042 animation: 'boolean', 12043 autohide: 'boolean', 12044 delay: 'number' 12045 }; 12046 /** 12047 * Class definition 12048 */ 12049 12050 var Toast = /*#__PURE__*/function () { 12051 function Toast(element, config) { 12052 this._element = element; 12053 this._config = this._getConfig(config); 12054 this._timeout = null; 12055 12056 this._setListeners(); 12057 } // Getters 12058 12059 12060 var _proto = Toast.prototype; 12061 12062 // Public 12063 _proto.show = function show() { 12064 var _this = this; 12065 12066 var showEvent = $__default["default"].Event(EVENT_SHOW); 12067 $__default["default"](this._element).trigger(showEvent); 12068 12069 if (showEvent.isDefaultPrevented()) { 12070 return; 12071 } 12072 12073 this._clearTimeout(); 12074 12075 if (this._config.animation) { 12076 this._element.classList.add(CLASS_NAME_FADE); 12077 } 12078 12079 var complete = function complete() { 12080 _this._element.classList.remove(CLASS_NAME_SHOWING); 12081 12082 _this._element.classList.add(CLASS_NAME_SHOW); 12083 12084 $__default["default"](_this._element).trigger(EVENT_SHOWN); 12085 12086 if (_this._config.autohide) { 12087 _this._timeout = setTimeout(function () { 12088 _this.hide(); 12089 }, _this._config.delay); 12090 } 12091 }; 12092 12093 this._element.classList.remove(CLASS_NAME_HIDE); 12094 12095 Util.reflow(this._element); 12096 12097 this._element.classList.add(CLASS_NAME_SHOWING); 12098 12099 if (this._config.animation) { 12100 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 12101 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 12102 } else { 12103 complete(); 12104 } 12105 }; 12106 12107 _proto.hide = function hide() { 12108 if (!this._element.classList.contains(CLASS_NAME_SHOW)) { 12109 return; 12110 } 12111 12112 var hideEvent = $__default["default"].Event(EVENT_HIDE); 12113 $__default["default"](this._element).trigger(hideEvent); 12114 12115 if (hideEvent.isDefaultPrevented()) { 12116 return; 12117 } 12118 12119 this._close(); 12120 }; 12121 12122 _proto.dispose = function dispose() { 12123 this._clearTimeout(); 12124 12125 if (this._element.classList.contains(CLASS_NAME_SHOW)) { 12126 this._element.classList.remove(CLASS_NAME_SHOW); 12127 } 12128 12129 $__default["default"](this._element).off(EVENT_CLICK_DISMISS); 12130 $__default["default"].removeData(this._element, DATA_KEY); 12131 this._element = null; 12132 this._config = null; 12133 } // Private 12134 ; 12135 12136 _proto._getConfig = function _getConfig(config) { 12137 config = _extends({}, Default, $__default["default"](this._element).data(), typeof config === 'object' && config ? config : {}); 12138 Util.typeCheckConfig(NAME, config, this.constructor.DefaultType); 12139 return config; 12140 }; 12141 12142 _proto._setListeners = function _setListeners() { 12143 var _this2 = this; 12144 12145 $__default["default"](this._element).on(EVENT_CLICK_DISMISS, SELECTOR_DATA_DISMISS, function () { 12146 return _this2.hide(); 12147 }); 12148 }; 12149 12150 _proto._close = function _close() { 12151 var _this3 = this; 12152 12153 var complete = function complete() { 12154 _this3._element.classList.add(CLASS_NAME_HIDE); 12155 12156 $__default["default"](_this3._element).trigger(EVENT_HIDDEN); 12157 }; 12158 12159 this._element.classList.remove(CLASS_NAME_SHOW); 12160 12161 if (this._config.animation) { 12162 var transitionDuration = Util.getTransitionDurationFromElement(this._element); 12163 $__default["default"](this._element).one(Util.TRANSITION_END, complete).emulateTransitionEnd(transitionDuration); 12164 } else { 12165 complete(); 12166 } 12167 }; 12168 12169 _proto._clearTimeout = function _clearTimeout() { 12170 clearTimeout(this._timeout); 12171 this._timeout = null; 12172 } // Static 12173 ; 12174 12175 Toast._jQueryInterface = function _jQueryInterface(config) { 12176 return this.each(function () { 12177 var $element = $__default["default"](this); 12178 var data = $element.data(DATA_KEY); 12179 12180 var _config = typeof config === 'object' && config; 12181 12182 if (!data) { 12183 data = new Toast(this, _config); 12184 $element.data(DATA_KEY, data); 12185 } 12186 12187 if (typeof config === 'string') { 12188 if (typeof data[config] === 'undefined') { 12189 throw new TypeError("No method named \"" + config + "\""); 12190 } 12191 12192 data[config](this); 12193 } 12194 }); 12195 }; 12196 12197 _createClass(Toast, null, [{ 12198 key: "VERSION", 12199 get: function get() { 12200 return VERSION; 12201 } 12202 }, { 12203 key: "DefaultType", 12204 get: function get() { 12205 return DefaultType; 12206 } 12207 }, { 12208 key: "Default", 12209 get: function get() { 12210 return Default; 12211 } 12212 }]); 12213 12214 return Toast; 12215 }(); 12216 /** 12217 * jQuery 12218 */ 12219 12220 12221 $__default["default"].fn[NAME] = Toast._jQueryInterface; 12222 $__default["default"].fn[NAME].Constructor = Toast; 12223 12224 $__default["default"].fn[NAME].noConflict = function () { 12225 $__default["default"].fn[NAME] = JQUERY_NO_CONFLICT; 12226 return Toast._jQueryInterface; 12227 }; 12228 12229 exports.Alert = Alert; 12230 exports.Button = Button; 12231 exports.Carousel = Carousel; 12232 exports.Collapse = Collapse; 12233 exports.Dropdown = Dropdown; 12234 exports.Modal = Modal; 12235 exports.Popover = Popover; 12236 exports.Scrollspy = ScrollSpy; 12237 exports.Tab = Tab; 12238 exports.Toast = Toast; 12239 exports.Tooltip = Tooltip; 12240 exports.Util = Util; 12241 12242 Object.defineProperty(exports, '__esModule', { value: true }); 12243 12244})); 12245//# sourceMappingURL=bootstrap.js.map 12246 12247 12248/***/ }), 12249
vendor: 69,165 bytes, lines 12250-13859
12250/***/ "./node_modules/cleave.js/dist/cleave-esm.js": 12251/*!***************************************************!*\ 12252 !*** ./node_modules/cleave.js/dist/cleave-esm.js ***! 12253 \***************************************************/ 12254/*! exports provided: default */ 12255/***/ (function(module, __webpack_exports__, __webpack_require__) { 12256 12257"use strict"; 12258__webpack_require__.r(__webpack_exports__); 12259/* WEBPACK VAR INJECTION */(function(global) {var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 12260 12261var NumeralFormatter = function (numeralDecimalMark, 12262 numeralIntegerScale, 12263 numeralDecimalScale, 12264 numeralThousandsGroupStyle, 12265 numeralPositiveOnly, 12266 stripLeadingZeroes, 12267 prefix, 12268 signBeforePrefix, 12269 tailPrefix, 12270 delimiter) { 12271 var owner = this; 12272 12273 owner.numeralDecimalMark = numeralDecimalMark || '.'; 12274 owner.numeralIntegerScale = numeralIntegerScale > 0 ? numeralIntegerScale : 0; 12275 owner.numeralDecimalScale = numeralDecimalScale >= 0 ? numeralDecimalScale : 2; 12276 owner.numeralThousandsGroupStyle = numeralThousandsGroupStyle || NumeralFormatter.groupStyle.thousand; 12277 owner.numeralPositiveOnly = !!numeralPositiveOnly; 12278 owner.stripLeadingZeroes = stripLeadingZeroes !== false; 12279 owner.prefix = (prefix || prefix === '') ? prefix : ''; 12280 owner.signBeforePrefix = !!signBeforePrefix; 12281 owner.tailPrefix = !!tailPrefix; 12282 owner.delimiter = (delimiter || delimiter === '') ? delimiter : ','; 12283 owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : ''; 12284}; 12285 12286NumeralFormatter.groupStyle = { 12287 thousand: 'thousand', 12288 lakh: 'lakh', 12289 wan: 'wan', 12290 none: 'none' 12291}; 12292 12293NumeralFormatter.prototype = { 12294 getRawValue: function (value) { 12295 return value.replace(this.delimiterRE, '').replace(this.numeralDecimalMark, '.'); 12296 }, 12297 12298 format: function (value) { 12299 var owner = this, parts, partSign, partSignAndPrefix, partInteger, partDecimal = ''; 12300 12301 // strip alphabet letters 12302 value = value.replace(/[A-Za-z]/g, '') 12303 // replace the first decimal mark with reserved placeholder 12304 .replace(owner.numeralDecimalMark, 'M') 12305 12306 // strip non numeric letters except minus and "M" 12307 // this is to ensure prefix has been stripped 12308 .replace(/[^\dM-]/g, '') 12309 12310 // replace the leading minus with reserved placeholder 12311 .replace(/^\-/, 'N') 12312 12313 // strip the other minus sign (if present) 12314 .replace(/\-/g, '') 12315 12316 // replace the minus sign (if present) 12317 .replace('N', owner.numeralPositiveOnly ? '' : '-') 12318 12319 // replace decimal mark 12320 .replace('M', owner.numeralDecimalMark); 12321 12322 // strip any leading zeros 12323 if (owner.stripLeadingZeroes) { 12324 value = value.replace(/^(-)?0+(?=\d)/, '$1'); 12325 } 12326 12327 partSign = value.slice(0, 1) === '-' ? '-' : ''; 12328 if (typeof owner.prefix != 'undefined') { 12329 if (owner.signBeforePrefix) { 12330 partSignAndPrefix = partSign + owner.prefix; 12331 } else { 12332 partSignAndPrefix = owner.prefix + partSign; 12333 } 12334 } else { 12335 partSignAndPrefix = partSign; 12336 } 12337 12338 partInteger = value; 12339 12340 if (value.indexOf(owner.numeralDecimalMark) >= 0) { 12341 parts = value.split(owner.numeralDecimalMark); 12342 partInteger = parts[0]; 12343 partDecimal = owner.numeralDecimalMark + parts[1].slice(0, owner.numeralDecimalScale); 12344 } 12345 12346 if(partSign === '-') { 12347 partInteger = partInteger.slice(1); 12348 } 12349 12350 if (owner.numeralIntegerScale > 0) { 12351 partInteger = partInteger.slice(0, owner.numeralIntegerScale); 12352 } 12353 12354 switch (owner.numeralThousandsGroupStyle) { 12355 case NumeralFormatter.groupStyle.lakh: 12356 partInteger = partInteger.replace(/(\d)(?=(\d\d)+\d$)/g, '$1' + owner.delimiter); 12357 12358 break; 12359 12360 case NumeralFormatter.groupStyle.wan: 12361 partInteger = partInteger.replace(/(\d)(?=(\d{4})+$)/g, '$1' + owner.delimiter); 12362 12363 break; 12364 12365 case NumeralFormatter.groupStyle.thousand: 12366 partInteger = partInteger.replace(/(\d)(?=(\d{3})+$)/g, '$1' + owner.delimiter); 12367 12368 break; 12369 } 12370 12371 if (owner.tailPrefix) { 12372 return partSign + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : '') + owner.prefix; 12373 } 12374 12375 return partSignAndPrefix + partInteger.toString() + (owner.numeralDecimalScale > 0 ? partDecimal.toString() : ''); 12376 } 12377}; 12378 12379var NumeralFormatter_1 = NumeralFormatter; 12380 12381var DateFormatter = function (datePattern, dateMin, dateMax) { 12382 var owner = this; 12383 12384 owner.date = []; 12385 owner.blocks = []; 12386 owner.datePattern = datePattern; 12387 owner.dateMin = dateMin 12388 .split('-') 12389 .reverse() 12390 .map(function(x) { 12391 return parseInt(x, 10); 12392 }); 12393 if (owner.dateMin.length === 2) owner.dateMin.unshift(0); 12394 12395 owner.dateMax = dateMax 12396 .split('-') 12397 .reverse() 12398 .map(function(x) { 12399 return parseInt(x, 10); 12400 }); 12401 if (owner.dateMax.length === 2) owner.dateMax.unshift(0); 12402 12403 owner.initBlocks(); 12404}; 12405 12406DateFormatter.prototype = { 12407 initBlocks: function () { 12408 var owner = this; 12409 owner.datePattern.forEach(function (value) { 12410 if (value === 'Y') { 12411 owner.blocks.push(4); 12412 } else { 12413 owner.blocks.push(2); 12414 } 12415 }); 12416 }, 12417 12418 getISOFormatDate: function () { 12419 var owner = this, 12420 date = owner.date; 12421 12422 return date[2] ? ( 12423 date[2] + '-' + owner.addLeadingZero(date[1]) + '-' + owner.addLeadingZero(date[0]) 12424 ) : ''; 12425 }, 12426 12427 getBlocks: function () { 12428 return this.blocks; 12429 }, 12430 12431 getValidatedDate: function (value) { 12432 var owner = this, result = ''; 12433 12434 value = value.replace(/[^\d]/g, ''); 12435 12436 owner.blocks.forEach(function (length, index) { 12437 if (value.length > 0) { 12438 var sub = value.slice(0, length), 12439 sub0 = sub.slice(0, 1), 12440 rest = value.slice(length); 12441 12442 switch (owner.datePattern[index]) { 12443 case 'd': 12444 if (sub === '00') { 12445 sub = '01'; 12446 } else if (parseInt(sub0, 10) > 3) { 12447 sub = '0' + sub0; 12448 } else if (parseInt(sub, 10) > 31) { 12449 sub = '31'; 12450 } 12451 12452 break; 12453 12454 case 'm': 12455 if (sub === '00') { 12456 sub = '01'; 12457 } else if (parseInt(sub0, 10) > 1) { 12458 sub = '0' + sub0; 12459 } else if (parseInt(sub, 10) > 12) { 12460 sub = '12'; 12461 } 12462 12463 break; 12464 } 12465 12466 result += sub; 12467 12468 // update remaining string 12469 value = rest; 12470 } 12471 }); 12472 12473 return this.getFixedDateString(result); 12474 }, 12475 12476 getFixedDateString: function (value) { 12477 var owner = this, datePattern = owner.datePattern, date = [], 12478 dayIndex = 0, monthIndex = 0, yearIndex = 0, 12479 dayStartIndex = 0, monthStartIndex = 0, yearStartIndex = 0, 12480 day, month, year, fullYearDone = false; 12481 12482 // mm-dd || dd-mm 12483 if (value.length === 4 && datePattern[0].toLowerCase() !== 'y' && datePattern[1].toLowerCase() !== 'y') { 12484 dayStartIndex = datePattern[0] === 'd' ? 0 : 2; 12485 monthStartIndex = 2 - dayStartIndex; 12486 day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10); 12487 month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10); 12488 12489 date = this.getFixedDate(day, month, 0); 12490 } 12491 12492 // yyyy-mm-dd || yyyy-dd-mm || mm-dd-yyyy || dd-mm-yyyy || dd-yyyy-mm || mm-yyyy-dd 12493 if (value.length === 8) { 12494 datePattern.forEach(function (type, index) { 12495 switch (type) { 12496 case 'd': 12497 dayIndex = index; 12498 break; 12499 case 'm': 12500 monthIndex = index; 12501 break; 12502 default: 12503 yearIndex = index; 12504 break; 12505 } 12506 }); 12507 12508 yearStartIndex = yearIndex * 2; 12509 dayStartIndex = (dayIndex <= yearIndex) ? dayIndex * 2 : (dayIndex * 2 + 2); 12510 monthStartIndex = (monthIndex <= yearIndex) ? monthIndex * 2 : (monthIndex * 2 + 2); 12511 12512 day = parseInt(value.slice(dayStartIndex, dayStartIndex + 2), 10); 12513 month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10); 12514 year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10); 12515 12516 fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4; 12517 12518 date = this.getFixedDate(day, month, year); 12519 } 12520 12521 // mm-yy || yy-mm 12522 if (value.length === 4 && (datePattern[0] === 'y' || datePattern[1] === 'y')) { 12523 monthStartIndex = datePattern[0] === 'm' ? 0 : 2; 12524 yearStartIndex = 2 - monthStartIndex; 12525 month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10); 12526 year = parseInt(value.slice(yearStartIndex, yearStartIndex + 2), 10); 12527 12528 fullYearDone = value.slice(yearStartIndex, yearStartIndex + 2).length === 2; 12529 12530 date = [0, month, year]; 12531 } 12532 12533 // mm-yyyy || yyyy-mm 12534 if (value.length === 6 && (datePattern[0] === 'Y' || datePattern[1] === 'Y')) { 12535 monthStartIndex = datePattern[0] === 'm' ? 0 : 4; 12536 yearStartIndex = 2 - 0.5 * monthStartIndex; 12537 month = parseInt(value.slice(monthStartIndex, monthStartIndex + 2), 10); 12538 year = parseInt(value.slice(yearStartIndex, yearStartIndex + 4), 10); 12539 12540 fullYearDone = value.slice(yearStartIndex, yearStartIndex + 4).length === 4; 12541 12542 date = [0, month, year]; 12543 } 12544 12545 date = owner.getRangeFixedDate(date); 12546 owner.date = date; 12547 12548 var result = date.length === 0 ? value : datePattern.reduce(function (previous, current) { 12549 switch (current) { 12550 case 'd': 12551 return previous + (date[0] === 0 ? '' : owner.addLeadingZero(date[0])); 12552 case 'm': 12553 return previous + (date[1] === 0 ? '' : owner.addLeadingZero(date[1])); 12554 case 'y': 12555 return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], false) : ''); 12556 case 'Y': 12557 return previous + (fullYearDone ? owner.addLeadingZeroForYear(date[2], true) : ''); 12558 } 12559 }, ''); 12560 12561 return result; 12562 }, 12563 12564 getRangeFixedDate: function (date) { 12565 var owner = this, 12566 datePattern = owner.datePattern, 12567 dateMin = owner.dateMin || [], 12568 dateMax = owner.dateMax || []; 12569 12570 if (!date.length || (dateMin.length < 3 && dateMax.length < 3)) return date; 12571 12572 if ( 12573 datePattern.find(function(x) { 12574 return x.toLowerCase() === 'y'; 12575 }) && 12576 date[2] === 0 12577 ) return date; 12578 12579 if (dateMax.length && (dateMax[2] < date[2] || ( 12580 dateMax[2] === date[2] && (dateMax[1] < date[1] || ( 12581 dateMax[1] === date[1] && dateMax[0] < date[0] 12582 )) 12583 ))) return dateMax; 12584 12585 if (dateMin.length && (dateMin[2] > date[2] || ( 12586 dateMin[2] === date[2] && (dateMin[1] > date[1] || ( 12587 dateMin[1] === date[1] && dateMin[0] > date[0] 12588 )) 12589 ))) return dateMin; 12590 12591 return date; 12592 }, 12593 12594 getFixedDate: function (day, month, year) { 12595 day = Math.min(day, 31); 12596 month = Math.min(month, 12); 12597 year = parseInt((year || 0), 10); 12598 12599 if ((month < 7 && month % 2 === 0) || (month > 8 && month % 2 === 1)) { 12600 day = Math.min(day, month === 2 ? (this.isLeapYear(year) ? 29 : 28) : 30); 12601 } 12602 12603 return [day, month, year]; 12604 }, 12605 12606 isLeapYear: function (year) { 12607 return ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0); 12608 }, 12609 12610 addLeadingZero: function (number) { 12611 return (number < 10 ? '0' : '') + number; 12612 }, 12613 12614 addLeadingZeroForYear: function (number, fullYearMode) { 12615 if (fullYearMode) { 12616 return (number < 10 ? '000' : (number < 100 ? '00' : (number < 1000 ? '0' : ''))) + number; 12617 } 12618 12619 return (number < 10 ? '0' : '') + number; 12620 } 12621}; 12622 12623var DateFormatter_1 = DateFormatter; 12624 12625var TimeFormatter = function (timePattern, timeFormat) { 12626 var owner = this; 12627 12628 owner.time = []; 12629 owner.blocks = []; 12630 owner.timePattern = timePattern; 12631 owner.timeFormat = timeFormat; 12632 owner.initBlocks(); 12633}; 12634 12635TimeFormatter.prototype = { 12636 initBlocks: function () { 12637 var owner = this; 12638 owner.timePattern.forEach(function () { 12639 owner.blocks.push(2); 12640 }); 12641 }, 12642 12643 getISOFormatTime: function () { 12644 var owner = this, 12645 time = owner.time; 12646 12647 return time[2] ? ( 12648 owner.addLeadingZero(time[0]) + ':' + owner.addLeadingZero(time[1]) + ':' + owner.addLeadingZero(time[2]) 12649 ) : ''; 12650 }, 12651 12652 getBlocks: function () { 12653 return this.blocks; 12654 }, 12655 12656 getTimeFormatOptions: function () { 12657 var owner = this; 12658 if (String(owner.timeFormat) === '12') { 12659 return { 12660 maxHourFirstDigit: 1, 12661 maxHours: 12, 12662 maxMinutesFirstDigit: 5, 12663 maxMinutes: 60 12664 }; 12665 } 12666 12667 return { 12668 maxHourFirstDigit: 2, 12669 maxHours: 23, 12670 maxMinutesFirstDigit: 5, 12671 maxMinutes: 60 12672 }; 12673 }, 12674 12675 getValidatedTime: function (value) { 12676 var owner = this, result = ''; 12677 12678 value = value.replace(/[^\d]/g, ''); 12679 12680 var timeFormatOptions = owner.getTimeFormatOptions(); 12681 12682 owner.blocks.forEach(function (length, index) { 12683 if (value.length > 0) { 12684 var sub = value.slice(0, length), 12685 sub0 = sub.slice(0, 1), 12686 rest = value.slice(length); 12687 12688 switch (owner.timePattern[index]) { 12689 12690 case 'h': 12691 if (parseInt(sub0, 10) > timeFormatOptions.maxHourFirstDigit) { 12692 sub = '0' + sub0; 12693 } else if (parseInt(sub, 10) > timeFormatOptions.maxHours) { 12694 sub = timeFormatOptions.maxHours + ''; 12695 } 12696 12697 break; 12698 12699 case 'm': 12700 case 's': 12701 if (parseInt(sub0, 10) > timeFormatOptions.maxMinutesFirstDigit) { 12702 sub = '0' + sub0; 12703 } else if (parseInt(sub, 10) > timeFormatOptions.maxMinutes) { 12704 sub = timeFormatOptions.maxMinutes + ''; 12705 } 12706 break; 12707 } 12708 12709 result += sub; 12710 12711 // update remaining string 12712 value = rest; 12713 } 12714 }); 12715 12716 return this.getFixedTimeString(result); 12717 }, 12718 12719 getFixedTimeString: function (value) { 12720 var owner = this, timePattern = owner.timePattern, time = [], 12721 secondIndex = 0, minuteIndex = 0, hourIndex = 0, 12722 secondStartIndex = 0, minuteStartIndex = 0, hourStartIndex = 0, 12723 second, minute, hour; 12724 12725 if (value.length === 6) { 12726 timePattern.forEach(function (type, index) { 12727 switch (type) { 12728 case 's': 12729 secondIndex = index * 2; 12730 break; 12731 case 'm': 12732 minuteIndex = index * 2; 12733 break; 12734 case 'h': 12735 hourIndex = index * 2; 12736 break; 12737 } 12738 }); 12739 12740 hourStartIndex = hourIndex; 12741 minuteStartIndex = minuteIndex; 12742 secondStartIndex = secondIndex; 12743 12744 second = parseInt(value.slice(secondStartIndex, secondStartIndex + 2), 10); 12745 minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10); 12746 hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10); 12747 12748 time = this.getFixedTime(hour, minute, second); 12749 } 12750 12751 if (value.length === 4 && owner.timePattern.indexOf('s') < 0) { 12752 timePattern.forEach(function (type, index) { 12753 switch (type) { 12754 case 'm': 12755 minuteIndex = index * 2; 12756 break; 12757 case 'h': 12758 hourIndex = index * 2; 12759 break; 12760 } 12761 }); 12762 12763 hourStartIndex = hourIndex; 12764 minuteStartIndex = minuteIndex; 12765 12766 second = 0; 12767 minute = parseInt(value.slice(minuteStartIndex, minuteStartIndex + 2), 10); 12768 hour = parseInt(value.slice(hourStartIndex, hourStartIndex + 2), 10); 12769 12770 time = this.getFixedTime(hour, minute, second); 12771 } 12772 12773 owner.time = time; 12774 12775 return time.length === 0 ? value : timePattern.reduce(function (previous, current) { 12776 switch (current) { 12777 case 's': 12778 return previous + owner.addLeadingZero(time[2]); 12779 case 'm': 12780 return previous + owner.addLeadingZero(time[1]); 12781 case 'h': 12782 return previous + owner.addLeadingZero(time[0]); 12783 } 12784 }, ''); 12785 }, 12786 12787 getFixedTime: function (hour, minute, second) { 12788 second = Math.min(parseInt(second || 0, 10), 60); 12789 minute = Math.min(minute, 60); 12790 hour = Math.min(hour, 60); 12791 12792 return [hour, minute, second]; 12793 }, 12794 12795 addLeadingZero: function (number) { 12796 return (number < 10 ? '0' : '') + number; 12797 } 12798}; 12799 12800var TimeFormatter_1 = TimeFormatter; 12801 12802var PhoneFormatter = function (formatter, delimiter) { 12803 var owner = this; 12804 12805 owner.delimiter = (delimiter || delimiter === '') ? delimiter : ' '; 12806 owner.delimiterRE = delimiter ? new RegExp('\\' + delimiter, 'g') : ''; 12807 12808 owner.formatter = formatter; 12809}; 12810 12811PhoneFormatter.prototype = { 12812 setFormatter: function (formatter) { 12813 this.formatter = formatter; 12814 }, 12815 12816 format: function (phoneNumber) { 12817 var owner = this; 12818 12819 owner.formatter.clear(); 12820 12821 // only keep number and + 12822 phoneNumber = phoneNumber.replace(/[^\d+]/g, ''); 12823 12824 // strip non-leading + 12825 phoneNumber = phoneNumber.replace(/^\+/, 'B').replace(/\+/g, '').replace('B', '+'); 12826 12827 // strip delimiter 12828 phoneNumber = phoneNumber.replace(owner.delimiterRE, ''); 12829 12830 var result = '', current, validated = false; 12831 12832 for (var i = 0, iMax = phoneNumber.length; i < iMax; i++) { 12833 current = owner.formatter.inputDigit(phoneNumber.charAt(i)); 12834 12835 // has ()- or space inside 12836 if (/[\s()-]/g.test(current)) { 12837 result = current; 12838 12839 validated = true; 12840 } else { 12841 if (!validated) { 12842 result = current; 12843 } 12844 // else: over length input 12845 // it turns to invalid number again 12846 } 12847 } 12848 12849 // strip () 12850 // e.g. US: 7161234567 returns (716) 123-4567 12851 result = result.replace(/[()]/g, ''); 12852 // replace library delimiter with user customized delimiter 12853 result = result.replace(/[\s-]/g, owner.delimiter); 12854 12855 return result; 12856 } 12857}; 12858 12859var PhoneFormatter_1 = PhoneFormatter; 12860 12861var CreditCardDetector = { 12862 blocks: { 12863 uatp: [4, 5, 6], 12864 amex: [4, 6, 5], 12865 diners: [4, 6, 4], 12866 discover: [4, 4, 4, 4], 12867 mastercard: [4, 4, 4, 4], 12868 dankort: [4, 4, 4, 4], 12869 instapayment: [4, 4, 4, 4], 12870 jcb15: [4, 6, 5], 12871 jcb: [4, 4, 4, 4], 12872 maestro: [4, 4, 4, 4], 12873 visa: [4, 4, 4, 4], 12874 mir: [4, 4, 4, 4], 12875 unionPay: [4, 4, 4, 4], 12876 general: [4, 4, 4, 4] 12877 }, 12878 12879 re: { 12880 // starts with 1; 15 digits, not starts with 1800 (jcb card) 12881 uatp: /^(?!1800)1\d{0,14}/, 12882 12883 // starts with 34/37; 15 digits 12884 amex: /^3[47]\d{0,13}/, 12885 12886 // starts with 6011/65/644-649; 16 digits 12887 discover: /^(?:6011|65\d{0,2}|64[4-9]\d?)\d{0,12}/, 12888 12889 // starts with 300-305/309 or 36/38/39; 14 digits 12890 diners: /^3(?:0([0-5]|9)|[689]\d?)\d{0,11}/, 12891 12892 // starts with 51-55/2221â2720; 16 digits 12893 mastercard: /^(5[1-5]\d{0,2}|22[2-9]\d{0,1}|2[3-7]\d{0,2})\d{0,12}/, 12894 12895 // starts with 5019/4175/4571; 16 digits 12896 dankort: /^(5019|4175|4571)\d{0,12}/, 12897 12898 // starts with 637-639; 16 digits 12899 instapayment: /^63[7-9]\d{0,13}/, 12900 12901 // starts with 2131/1800; 15 digits 12902 jcb15: /^(?:2131|1800)\d{0,11}/, 12903 12904 // starts with 2131/1800/35; 16 digits 12905 jcb: /^(?:35\d{0,2})\d{0,12}/, 12906 12907 // starts with 50/56-58/6304/67; 16 digits 12908 maestro: /^(?:5[0678]\d{0,2}|6304|67\d{0,2})\d{0,12}/, 12909 12910 // starts with 22; 16 digits 12911 mir: /^220[0-4]\d{0,12}/, 12912 12913 // starts with 4; 16 digits 12914 visa: /^4\d{0,15}/, 12915 12916 // starts with 62/81; 16 digits 12917 unionPay: /^(62|81)\d{0,14}/ 12918 }, 12919 12920 getStrictBlocks: function (block) { 12921 var total = block.reduce(function (prev, current) { 12922 return prev + current; 12923 }, 0); 12924 12925 return block.concat(19 - total); 12926 }, 12927 12928 getInfo: function (value, strictMode) { 12929 var blocks = CreditCardDetector.blocks, 12930 re = CreditCardDetector.re; 12931 12932 // Some credit card can have up to 19 digits number. 12933 // Set strictMode to true will remove the 16 max-length restrain, 12934 // however, I never found any website validate card number like 12935 // this, hence probably you don't want to enable this option. 12936 strictMode = !!strictMode; 12937 12938 for (var key in re) { 12939 if (re[key].test(value)) { 12940 var matchedBlocks = blocks[key]; 12941 return { 12942 type: key, 12943 blocks: strictMode ? this.getStrictBlocks(matchedBlocks) : matchedBlocks 12944 }; 12945 } 12946 } 12947 12948 return { 12949 type: 'unknown', 12950 blocks: strictMode ? this.getStrictBlocks(blocks.general) : blocks.general 12951 }; 12952 } 12953}; 12954 12955var CreditCardDetector_1 = CreditCardDetector; 12956 12957var Util = { 12958 noop: function () { 12959 }, 12960 12961 strip: function (value, re) { 12962 return value.replace(re, ''); 12963 }, 12964 12965 getPostDelimiter: function (value, delimiter, delimiters) { 12966 // single delimiter 12967 if (delimiters.length === 0) { 12968 return value.slice(-delimiter.length) === delimiter ? delimiter : ''; 12969 } 12970 12971 // multiple delimiters 12972 var matchedDelimiter = ''; 12973 delimiters.forEach(function (current) { 12974 if (value.slice(-current.length) === current) { 12975 matchedDelimiter = current; 12976 } 12977 }); 12978 12979 return matchedDelimiter; 12980 }, 12981 12982 getDelimiterREByDelimiter: function (delimiter) { 12983 return new RegExp(delimiter.replace(/([.?*+^$[\]\\(){}|-])/g, '\\$1'), 'g'); 12984 }, 12985 12986 getNextCursorPosition: function (prevPos, oldValue, newValue, delimiter, delimiters) { 12987 // If cursor was at the end of value, just place it back. 12988 // Because new value could contain additional chars. 12989 if (oldValue.length === prevPos) { 12990 return newValue.length; 12991 } 12992 12993 return prevPos + this.getPositionOffset(prevPos, oldValue, newValue, delimiter ,delimiters); 12994 }, 12995 12996 getPositionOffset: function (prevPos, oldValue, newValue, delimiter, delimiters) { 12997 var oldRawValue, newRawValue, lengthOffset; 12998 12999 oldRawValue = this.stripDelimiters(oldValue.slice(0, prevPos), delimiter, delimiters); 13000 newRawValue = this.stripDelimiters(newValue.slice(0, prevPos), delimiter, delimiters); 13001 lengthOffset = oldRawValue.length - newRawValue.length; 13002 13003 return (lengthOffset !== 0) ? (lengthOffset / Math.abs(lengthOffset)) : 0; 13004 }, 13005 13006 stripDelimiters: function (value, delimiter, delimiters) { 13007 var owner = this; 13008 13009 // single delimiter 13010 if (delimiters.length === 0) { 13011 var delimiterRE = delimiter ? owner.getDelimiterREByDelimiter(delimiter) : ''; 13012 13013 return value.replace(delimiterRE, ''); 13014 } 13015 13016 // multiple delimiters 13017 delimiters.forEach(function (current) { 13018 current.split('').forEach(function (letter) { 13019 value = value.replace(owner.getDelimiterREByDelimiter(letter), ''); 13020 }); 13021 }); 13022 13023 return value; 13024 }, 13025 13026 headStr: function (str, length) { 13027 return str.slice(0, length); 13028 }, 13029 13030 getMaxLength: function (blocks) { 13031 return blocks.reduce(function (previous, current) { 13032 return previous + current; 13033 }, 0); 13034 }, 13035 13036 // strip prefix 13037 // Before type | After type | Return value 13038 // PEFIX-... | PEFIX-... | '' 13039 // PREFIX-123 | PEFIX-123 | 123 13040 // PREFIX-123 | PREFIX-23 | 23 13041 // PREFIX-123 | PREFIX-1234 | 1234 13042 getPrefixStrippedValue: function (value, prefix, prefixLength, prevResult, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix) { 13043 // No prefix 13044 if (prefixLength === 0) { 13045 return value; 13046 } 13047 13048 // Value is prefix 13049 if (value === prefix && value !== '') { 13050 return ''; 13051 } 13052 13053 if (signBeforePrefix && (value.slice(0, 1) == '-')) { 13054 var prev = (prevResult.slice(0, 1) == '-') ? prevResult.slice(1) : prevResult; 13055 return '-' + this.getPrefixStrippedValue(value.slice(1), prefix, prefixLength, prev, delimiter, delimiters, noImmediatePrefix, tailPrefix, signBeforePrefix); 13056 } 13057 13058 // Pre result prefix string does not match pre-defined prefix 13059 if (prevResult.slice(0, prefixLength) !== prefix && !tailPrefix) { 13060 // Check if the first time user entered something 13061 if (noImmediatePrefix && !prevResult && value) return value; 13062 return ''; 13063 } else if (prevResult.slice(-prefixLength) !== prefix && tailPrefix) { 13064 // Check if the first time user entered something 13065 if (noImmediatePrefix && !prevResult && value) return value; 13066 return ''; 13067 } 13068 13069 var prevValue = this.stripDelimiters(prevResult, delimiter, delimiters); 13070 13071 // New value has issue, someone typed in between prefix letters 13072 // Revert to pre value 13073 if (value.slice(0, prefixLength) !== prefix && !tailPrefix) { 13074 return prevValue.slice(prefixLength); 13075 } else if (value.slice(-prefixLength) !== prefix && tailPrefix) { 13076 return prevValue.slice(0, -prefixLength - 1); 13077 } 13078 13079 // No issue, strip prefix for new value 13080 return tailPrefix ? value.slice(0, -prefixLength) : value.slice(prefixLength); 13081 }, 13082 13083 getFirstDiffIndex: function (prev, current) { 13084 var index = 0; 13085 13086 while (prev.charAt(index) === current.charAt(index)) { 13087 if (prev.charAt(index++) === '') { 13088 return -1; 13089 } 13090 } 13091 13092 return index; 13093 }, 13094 13095 getFormattedValue: function (value, blocks, blocksLength, delimiter, delimiters, delimiterLazyShow) { 13096 var result = '', 13097 multipleDelimiters = delimiters.length > 0, 13098 currentDelimiter = ''; 13099 13100 // no options, normal input 13101 if (blocksLength === 0) { 13102 return value; 13103 } 13104 13105 blocks.forEach(function (length, index) { 13106 if (value.length > 0) { 13107 var sub = value.slice(0, length), 13108 rest = value.slice(length); 13109 13110 if (multipleDelimiters) { 13111 currentDelimiter = delimiters[delimiterLazyShow ? (index - 1) : index] || currentDelimiter; 13112 } else { 13113 currentDelimiter = delimiter; 13114 } 13115 13116 if (delimiterLazyShow) { 13117 if (index > 0) { 13118 result += currentDelimiter; 13119 } 13120 13121 result += sub; 13122 } else { 13123 result += sub; 13124 13125 if (sub.length === length && index < blocksLength - 1) { 13126 result += currentDelimiter; 13127 } 13128 } 13129 13130 // update remaining string 13131 value = rest; 13132 } 13133 }); 13134 13135 return result; 13136 }, 13137 13138 // move cursor to the end 13139 // the first time user focuses on an input with prefix 13140 fixPrefixCursor: function (el, prefix, delimiter, delimiters) { 13141 if (!el) { 13142 return; 13143 } 13144 13145 var val = el.value, 13146 appendix = delimiter || (delimiters[0] || ' '); 13147 13148 if (!el.setSelectionRange || !prefix || (prefix.length + appendix.length) <= val.length) { 13149 return; 13150 } 13151 13152 var len = val.length * 2; 13153 13154 // set timeout to avoid blink 13155 setTimeout(function () { 13156 el.setSelectionRange(len, len); 13157 }, 1); 13158 }, 13159 13160 // Check if input field is fully selected 13161 checkFullSelection: function(value) { 13162 try { 13163 var selection = window.getSelection() || document.getSelection() || {}; 13164 return selection.toString().length === value.length; 13165 } catch (ex) { 13166 // Ignore 13167 } 13168 13169 return false; 13170 }, 13171 13172 setSelection: function (element, position, doc) { 13173 if (element !== this.getActiveElement(doc)) { 13174 return; 13175 } 13176 13177 // cursor is already in the end 13178 if (element && element.value.length <= position) { 13179 return; 13180 } 13181 13182 if (element.createTextRange) { 13183 var range = element.createTextRange(); 13184 13185 range.move('character', position); 13186 range.select(); 13187 } else { 13188 try { 13189 element.setSelectionRange(position, position); 13190 } catch (e) { 13191 // eslint-disable-next-line 13192 console.warn('The input element type does not support selection'); 13193 } 13194 } 13195 }, 13196 13197 getActiveElement: function(parent) { 13198 var activeElement = parent.activeElement; 13199 if (activeElement && activeElement.shadowRoot) { 13200 return this.getActiveElement(activeElement.shadowRoot); 13201 } 13202 return activeElement; 13203 }, 13204 13205 isAndroid: function () { 13206 return navigator && /android/i.test(navigator.userAgent); 13207 }, 13208 13209 // On Android chrome, the keyup and keydown events 13210 // always return key code 229 as a composition that 13211 // buffers the userâs keystrokes 13212 // see https://github.com/nosir/cleave.js/issues/147 13213 isAndroidBackspaceKeydown: function (lastInputValue, currentInputValue) { 13214 if (!this.isAndroid() || !lastInputValue || !currentInputValue) { 13215 return false; 13216 } 13217 13218 return currentInputValue === lastInputValue.slice(0, -1); 13219 } 13220}; 13221 13222var Util_1 = Util; 13223 13224/** 13225 * Props Assignment 13226 * 13227 * Separate this, so react module can share the usage 13228 */ 13229var DefaultProperties = { 13230 // Maybe change to object-assign 13231 // for now just keep it as simple 13232 assign: function (target, opts) { 13233 target = target || {}; 13234 opts = opts || {}; 13235 13236 // credit card 13237 target.creditCard = !!opts.creditCard; 13238 target.creditCardStrictMode = !!opts.creditCardStrictMode; 13239 target.creditCardType = ''; 13240 target.onCreditCardTypeChanged = opts.onCreditCardTypeChanged || (function () {}); 13241 13242 // phone 13243 target.phone = !!opts.phone; 13244 target.phoneRegionCode = opts.phoneRegionCode || 'AU'; 13245 target.phoneFormatter = {}; 13246 13247 // time 13248 target.time = !!opts.time; 13249 target.timePattern = opts.timePattern || ['h', 'm', 's']; 13250 target.timeFormat = opts.timeFormat || '24'; 13251 target.timeFormatter = {}; 13252 13253 // date 13254 target.date = !!opts.date; 13255 target.datePattern = opts.datePattern || ['d', 'm', 'Y']; 13256 target.dateMin = opts.dateMin || ''; 13257 target.dateMax = opts.dateMax || ''; 13258 target.dateFormatter = {}; 13259 13260 // numeral 13261 target.numeral = !!opts.numeral; 13262 target.numeralIntegerScale = opts.numeralIntegerScale > 0 ? opts.numeralIntegerScale : 0; 13263 target.numeralDecimalScale = opts.numeralDecimalScale >= 0 ? opts.numeralDecimalScale : 2; 13264 target.numeralDecimalMark = opts.numeralDecimalMark || '.'; 13265 target.numeralThousandsGroupStyle = opts.numeralThousandsGroupStyle || 'thousand'; 13266 target.numeralPositiveOnly = !!opts.numeralPositiveOnly; 13267 target.stripLeadingZeroes = opts.stripLeadingZeroes !== false; 13268 target.signBeforePrefix = !!opts.signBeforePrefix; 13269 target.tailPrefix = !!opts.tailPrefix; 13270 13271 // others 13272 target.swapHiddenInput = !!opts.swapHiddenInput; 13273 13274 target.numericOnly = target.creditCard || target.date || !!opts.numericOnly; 13275 13276 target.uppercase = !!opts.uppercase; 13277 target.lowercase = !!opts.lowercase; 13278 13279 target.prefix = (target.creditCard || target.date) ? '' : (opts.prefix || ''); 13280 target.noImmediatePrefix = !!opts.noImmediatePrefix; 13281 target.prefixLength = target.prefix.length; 13282 target.rawValueTrimPrefix = !!opts.rawValueTrimPrefix; 13283 target.copyDelimiter = !!opts.copyDelimiter; 13284 13285 target.initValue = (opts.initValue !== undefined && opts.initValue !== null) ? opts.initValue.toString() : ''; 13286 13287 target.delimiter = 13288 (opts.delimiter || opts.delimiter === '') ? opts.delimiter : 13289 (opts.date ? '/' : 13290 (opts.time ? ':' : 13291 (opts.numeral ? ',' : 13292 (opts.phone ? ' ' : 13293 ' ')))); 13294 target.delimiterLength = target.delimiter.length; 13295 target.delimiterLazyShow = !!opts.delimiterLazyShow; 13296 target.delimiters = opts.delimiters || []; 13297 13298 target.blocks = opts.blocks || []; 13299 target.blocksLength = target.blocks.length; 13300 13301 target.root = (typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window; 13302 target.document = opts.document || target.root.document; 13303 13304 target.maxLength = 0; 13305 13306 target.backspace = false; 13307 target.result = ''; 13308 13309 target.onValueChanged = opts.onValueChanged || (function () {}); 13310 13311 return target; 13312 } 13313}; 13314 13315var DefaultProperties_1 = DefaultProperties; 13316 13317/** 13318 * Construct a new Cleave instance by passing the configuration object 13319 * 13320 * @param {String | HTMLElement} element 13321 * @param {Object} opts 13322 */ 13323var Cleave = function (element, opts) { 13324 var owner = this; 13325 var hasMultipleElements = false; 13326 13327 if (typeof element === 'string') { 13328 owner.element = document.querySelector(element); 13329 hasMultipleElements = document.querySelectorAll(element).length > 1; 13330 } else { 13331 if (typeof element.length !== 'undefined' && element.length > 0) { 13332 owner.element = element[0]; 13333 hasMultipleElements = element.length > 1; 13334 } else { 13335 owner.element = element; 13336 } 13337 } 13338 13339 if (!owner.element) { 13340 throw new Error('[cleave.js] Please check the element'); 13341 } 13342 13343 if (hasMultipleElements) { 13344 try { 13345 // eslint-disable-next-line 13346 console.warn('[cleave.js] Multiple input fields matched, cleave.js will only take the first one.'); 13347 } catch (e) { 13348 // Old IE 13349 } 13350 } 13351 13352 opts.initValue = owner.element.value; 13353 13354 owner.properties = Cleave.DefaultProperties.assign({}, opts); 13355 13356 owner.init(); 13357}; 13358 13359Cleave.prototype = { 13360 init: function () { 13361 var owner = this, pps = owner.properties; 13362 13363 // no need to use this lib 13364 if (!pps.numeral && !pps.phone && !pps.creditCard && !pps.time && !pps.date && (pps.blocksLength === 0 && !pps.prefix)) { 13365 owner.onInput(pps.initValue); 13366 13367 return; 13368 } 13369 13370 pps.maxLength = Cleave.Util.getMaxLength(pps.blocks); 13371 13372 owner.isAndroid = Cleave.Util.isAndroid(); 13373 owner.lastInputValue = ''; 13374 owner.isBackward = ''; 13375 13376 owner.onChangeListener = owner.onChange.bind(owner); 13377 owner.onKeyDownListener = owner.onKeyDown.bind(owner); 13378 owner.onFocusListener = owner.onFocus.bind(owner); 13379 owner.onCutListener = owner.onCut.bind(owner); 13380 owner.onCopyListener = owner.onCopy.bind(owner); 13381 13382 owner.initSwapHiddenInput(); 13383 13384 owner.element.addEventListener('input', owner.onChangeListener); 13385 owner.element.addEventListener('keydown', owner.onKeyDownListener); 13386 owner.element.addEventListener('focus', owner.onFocusListener); 13387 owner.element.addEventListener('cut', owner.onCutListener); 13388 owner.element.addEventListener('copy', owner.onCopyListener); 13389 13390 13391 owner.initPhoneFormatter(); 13392 owner.initDateFormatter(); 13393 owner.initTimeFormatter(); 13394 owner.initNumeralFormatter(); 13395 13396 // avoid touch input field if value is null 13397 // otherwise Firefox will add red box-shadow for <input required /> 13398 if (pps.initValue || (pps.prefix && !pps.noImmediatePrefix)) { 13399 owner.onInput(pps.initValue); 13400 } 13401 }, 13402 13403 initSwapHiddenInput: function () { 13404 var owner = this, pps = owner.properties; 13405 if (!pps.swapHiddenInput) return; 13406 13407 var inputFormatter = owner.element.cloneNode(true); 13408 owner.element.parentNode.insertBefore(inputFormatter, owner.element); 13409 13410 owner.elementSwapHidden = owner.element; 13411 owner.elementSwapHidden.type = 'hidden'; 13412 13413 owner.element = inputFormatter; 13414 owner.element.id = ''; 13415 }, 13416 13417 initNumeralFormatter: function () { 13418 var owner = this, pps = owner.properties; 13419 13420 if (!pps.numeral) { 13421 return; 13422 } 13423 13424 pps.numeralFormatter = new Cleave.NumeralFormatter( 13425 pps.numeralDecimalMark, 13426 pps.numeralIntegerScale, 13427 pps.numeralDecimalScale, 13428 pps.numeralThousandsGroupStyle, 13429 pps.numeralPositiveOnly, 13430 pps.stripLeadingZeroes, 13431 pps.prefix, 13432 pps.signBeforePrefix, 13433 pps.tailPrefix, 13434 pps.delimiter 13435 ); 13436 }, 13437 13438 initTimeFormatter: function() { 13439 var owner = this, pps = owner.properties; 13440 13441 if (!pps.time) { 13442 return; 13443 } 13444 13445 pps.timeFormatter = new Cleave.TimeFormatter(pps.timePattern, pps.timeFormat); 13446 pps.blocks = pps.timeFormatter.getBlocks(); 13447 pps.blocksLength = pps.blocks.length; 13448 pps.maxLength = Cleave.Util.getMaxLength(pps.blocks); 13449 }, 13450 13451 initDateFormatter: function () { 13452 var owner = this, pps = owner.properties; 13453 13454 if (!pps.date) { 13455 return; 13456 } 13457 13458 pps.dateFormatter = new Cleave.DateFormatter(pps.datePattern, pps.dateMin, pps.dateMax); 13459 pps.blocks = pps.dateFormatter.getBlocks(); 13460 pps.blocksLength = pps.blocks.length; 13461 pps.maxLength = Cleave.Util.getMaxLength(pps.blocks); 13462 }, 13463 13464 initPhoneFormatter: function () { 13465 var owner = this, pps = owner.properties; 13466 13467 if (!pps.phone) { 13468 return; 13469 } 13470 13471 // Cleave.AsYouTypeFormatter should be provided by 13472 // external google closure lib 13473 try { 13474 pps.phoneFormatter = new Cleave.PhoneFormatter( 13475 new pps.root.Cleave.AsYouTypeFormatter(pps.phoneRegionCode), 13476 pps.delimiter 13477 ); 13478 } catch (ex) { 13479 throw new Error('[cleave.js] Please include phone-type-formatter.{country}.js lib'); 13480 } 13481 }, 13482 13483 onKeyDown: function (event) { 13484 var owner = this, 13485 charCode = event.which || event.keyCode; 13486 13487 owner.lastInputValue = owner.element.value; 13488 owner.isBackward = charCode === 8; 13489 }, 13490 13491 onChange: function (event) { 13492 var owner = this, pps = owner.properties, 13493 Util = Cleave.Util; 13494 13495 owner.isBackward = owner.isBackward || event.inputType === 'deleteContentBackward'; 13496 13497 var postDelimiter = Util.getPostDelimiter(owner.lastInputValue, pps.delimiter, pps.delimiters); 13498 13499 if (owner.isBackward && postDelimiter) { 13500 pps.postDelimiterBackspace = postDelimiter; 13501 } else { 13502 pps.postDelimiterBackspace = false; 13503 } 13504 13505 this.onInput(this.element.value); 13506 }, 13507 13508 onFocus: function () { 13509 var owner = this, 13510 pps = owner.properties; 13511 owner.lastInputValue = owner.element.value; 13512 13513 if (pps.prefix && pps.noImmediatePrefix && !owner.element.value) { 13514 this.onInput(pps.prefix); 13515 } 13516 13517 Cleave.Util.fixPrefixCursor(owner.element, pps.prefix, pps.delimiter, pps.delimiters); 13518 }, 13519 13520 onCut: function (e) { 13521 if (!Cleave.Util.checkFullSelection(this.element.value)) return; 13522 this.copyClipboardData(e); 13523 this.onInput(''); 13524 }, 13525 13526 onCopy: function (e) { 13527 if (!Cleave.Util.checkFullSelection(this.element.value)) return; 13528 this.copyClipboardData(e); 13529 }, 13530 13531 copyClipboardData: function (e) { 13532 var owner = this, 13533 pps = owner.properties, 13534 Util = Cleave.Util, 13535 inputValue = owner.element.value, 13536 textToCopy = ''; 13537 13538 if (!pps.copyDelimiter) { 13539 textToCopy = Util.stripDelimiters(inputValue, pps.delimiter, pps.delimiters); 13540 } else { 13541 textToCopy = inputValue; 13542 } 13543 13544 try { 13545 if (e.clipboardData) { 13546 e.clipboardData.setData('Text', textToCopy); 13547 } else { 13548 window.clipboardData.setData('Text', textToCopy); 13549 } 13550 13551 e.preventDefault(); 13552 } catch (ex) { 13553 // empty 13554 } 13555 }, 13556 13557 onInput: function (value) { 13558 var owner = this, pps = owner.properties, 13559 Util = Cleave.Util; 13560 13561 // case 1: delete one more character "4" 13562 // 1234*| -> hit backspace -> 123| 13563 // case 2: last character is not delimiter which is: 13564 // 12|34* -> hit backspace -> 1|34* 13565 // note: no need to apply this for numeral mode 13566 var postDelimiterAfter = Util.getPostDelimiter(value, pps.delimiter, pps.delimiters); 13567 if (!pps.numeral && pps.postDelimiterBackspace && !postDelimiterAfter) { 13568 value = Util.headStr(value, value.length - pps.postDelimiterBackspace.length); 13569 } 13570 13571 // phone formatter 13572 if (pps.phone) { 13573 if (pps.prefix && (!pps.noImmediatePrefix || value.length)) { 13574 pps.result = pps.prefix + pps.phoneFormatter.format(value).slice(pps.prefix.length); 13575 } else { 13576 pps.result = pps.phoneFormatter.format(value); 13577 } 13578 owner.updateValueState(); 13579 13580 return; 13581 } 13582 13583 // numeral formatter 13584 if (pps.numeral) { 13585 // Do not show prefix when noImmediatePrefix is specified 13586 // This mostly because we need to show user the native input placeholder 13587 if (pps.prefix && pps.noImmediatePrefix && value.length === 0) { 13588 pps.result = ''; 13589 } else { 13590 pps.result = pps.numeralFormatter.format(value); 13591 } 13592 owner.updateValueState(); 13593 13594 return; 13595 } 13596 13597 // date 13598 if (pps.date) { 13599 value = pps.dateFormatter.getValidatedDate(value); 13600 } 13601 13602 // time 13603 if (pps.time) { 13604 value = pps.timeFormatter.getValidatedTime(value); 13605 } 13606 13607 // strip delimiters 13608 value = Util.stripDelimiters(value, pps.delimiter, pps.delimiters); 13609 13610 // strip prefix 13611 value = Util.getPrefixStrippedValue(value, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix); 13612 13613 // strip non-numeric characters 13614 value = pps.numericOnly ? Util.strip(value, /[^\d]/g) : value; 13615 13616 // convert case 13617 value = pps.uppercase ? value.toUpperCase() : value; 13618 value = pps.lowercase ? value.toLowerCase() : value; 13619 13620 // prevent from showing prefix when no immediate option enabled with empty input value 13621 if (pps.prefix) { 13622 if (pps.tailPrefix) { 13623 value = value + pps.prefix; 13624 } else { 13625 value = pps.prefix + value; 13626 } 13627 13628 13629 // no blocks specified, no need to do formatting 13630 if (pps.blocksLength === 0) { 13631 pps.result = value; 13632 owner.updateValueState(); 13633 13634 return; 13635 } 13636 } 13637 13638 // update credit card props 13639 if (pps.creditCard) { 13640 owner.updateCreditCardPropsByValue(value); 13641 } 13642 13643 // strip over length characters 13644 value = Util.headStr(value, pps.maxLength); 13645 13646 // apply blocks 13647 pps.result = Util.getFormattedValue( 13648 value, 13649 pps.blocks, pps.blocksLength, 13650 pps.delimiter, pps.delimiters, pps.delimiterLazyShow 13651 ); 13652 13653 owner.updateValueState(); 13654 }, 13655 13656 updateCreditCardPropsByValue: function (value) { 13657 var owner = this, pps = owner.properties, 13658 Util = Cleave.Util, 13659 creditCardInfo; 13660 13661 // At least one of the first 4 characters has changed 13662 if (Util.headStr(pps.result, 4) === Util.headStr(value, 4)) { 13663 return; 13664 } 13665 13666 creditCardInfo = Cleave.CreditCardDetector.getInfo(value, pps.creditCardStrictMode); 13667 13668 pps.blocks = creditCardInfo.blocks; 13669 pps.blocksLength = pps.blocks.length; 13670 pps.maxLength = Util.getMaxLength(pps.blocks); 13671 13672 // credit card type changed 13673 if (pps.creditCardType !== creditCardInfo.type) { 13674 pps.creditCardType = creditCardInfo.type; 13675 13676 pps.onCreditCardTypeChanged.call(owner, pps.creditCardType); 13677 } 13678 }, 13679 13680 updateValueState: function () { 13681 var owner = this, 13682 Util = Cleave.Util, 13683 pps = owner.properties; 13684 13685 if (!owner.element) { 13686 return; 13687 } 13688 13689 var endPos = owner.element.selectionEnd; 13690 var oldValue = owner.element.value; 13691 var newValue = pps.result; 13692 13693 endPos = Util.getNextCursorPosition(endPos, oldValue, newValue, pps.delimiter, pps.delimiters); 13694 13695 // fix Android browser type="text" input field 13696 // cursor not jumping issue 13697 if (owner.isAndroid) { 13698 window.setTimeout(function () { 13699 owner.element.value = newValue; 13700 Util.setSelection(owner.element, endPos, pps.document, false); 13701 owner.callOnValueChanged(); 13702 }, 1); 13703 13704 return; 13705 } 13706 13707 owner.element.value = newValue; 13708 if (pps.swapHiddenInput) owner.elementSwapHidden.value = owner.getRawValue(); 13709 13710 Util.setSelection(owner.element, endPos, pps.document, false); 13711 owner.callOnValueChanged(); 13712 }, 13713 13714 callOnValueChanged: function () { 13715 var owner = this, 13716 pps = owner.properties; 13717 13718 pps.onValueChanged.call(owner, { 13719 target: { 13720 name: owner.element.name, 13721 value: pps.result, 13722 rawValue: owner.getRawValue() 13723 } 13724 }); 13725 }, 13726 13727 setPhoneRegionCode: function (phoneRegionCode) { 13728 var owner = this, pps = owner.properties; 13729 13730 pps.phoneRegionCode = phoneRegionCode; 13731 owner.initPhoneFormatter(); 13732 owner.onChange(); 13733 }, 13734 13735 setRawValue: function (value) { 13736 var owner = this, pps = owner.properties; 13737 13738 value = value !== undefined && value !== null ? value.toString() : ''; 13739 13740 if (pps.numeral) { 13741 value = value.replace('.', pps.numeralDecimalMark); 13742 } 13743 13744 pps.postDelimiterBackspace = false; 13745 13746 owner.element.value = value; 13747 owner.onInput(value); 13748 }, 13749 13750 getRawValue: function () { 13751 var owner = this, 13752 pps = owner.properties, 13753 Util = Cleave.Util, 13754 rawValue = owner.element.value; 13755 13756 if (pps.rawValueTrimPrefix) { 13757 rawValue = Util.getPrefixStrippedValue(rawValue, pps.prefix, pps.prefixLength, pps.result, pps.delimiter, pps.delimiters, pps.noImmediatePrefix, pps.tailPrefix, pps.signBeforePrefix); 13758 } 13759 13760 if (pps.numeral) { 13761 rawValue = pps.numeralFormatter.getRawValue(rawValue); 13762 } else { 13763 rawValue = Util.stripDelimiters(rawValue, pps.delimiter, pps.delimiters); 13764 } 13765 13766 return rawValue; 13767 }, 13768 13769 getISOFormatDate: function () { 13770 var owner = this, 13771 pps = owner.properties; 13772 13773 return pps.date ? pps.dateFormatter.getISOFormatDate() : ''; 13774 }, 13775 13776 getISOFormatTime: function () { 13777 var owner = this, 13778 pps = owner.properties; 13779 13780 return pps.time ? pps.timeFormatter.getISOFormatTime() : ''; 13781 }, 13782 13783 getFormattedValue: function () { 13784 return this.element.value; 13785 }, 13786 13787 destroy: function () { 13788 var owner = this; 13789 13790 owner.element.removeEventListener('input', owner.onChangeListener); 13791 owner.element.removeEventListener('keydown', owner.onKeyDownListener); 13792 owner.element.removeEventListener('focus', owner.onFocusListener); 13793 owner.element.removeEventListener('cut', owner.onCutListener); 13794 owner.element.removeEventListener('copy', owner.onCopyListener); 13795 }, 13796 13797 toString: function () { 13798 return '[Cleave Object]'; 13799 } 13800}; 13801 13802Cleave.NumeralFormatter = NumeralFormatter_1; 13803Cleave.DateFormatter = DateFormatter_1; 13804Cleave.TimeFormatter = TimeFormatter_1; 13805Cleave.PhoneFormatter = PhoneFormatter_1; 13806Cleave.CreditCardDetector = CreditCardDetector_1; 13807Cleave.Util = Util_1; 13808Cleave.DefaultProperties = DefaultProperties_1; 13809 13810// for angular directive 13811((typeof commonjsGlobal === 'object' && commonjsGlobal) ? commonjsGlobal : window)['Cleave'] = Cleave; 13812 13813// CommonJS 13814var Cleave_1 = Cleave; 13815 13816/* harmony default export */ __webpack_exports__["default"] = (Cleave_1); 13817 13818/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 13819 13820/***/ }), 13821 13822/***/ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-content-placeholders/dist/vue-content-placeholders.css": 13823/*!*****************************************************************************************************************************************************************!*\ 13824 !*** ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue-content-placeholders/dist/vue-content-placeholders.css ***! 13825 \*****************************************************************************************************************************************************************/ 13826/*! no static exports found */ 13827/***/ (function(module, exports, __webpack_require__) { 13828 13829exports = module.exports = __webpack_require__(/*! ../../css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); 13830// imports 13831 13832 13833// module 13834exports.push([module.i, "\n@-webkit-keyframes vueContentPlaceholdersAnimation {\n0% {\n transform: translate3d(-30%, 0, 0);\n}\n100% {\n transform: translate3d(100%, 0, 0);\n}\n}\n@keyframes vueContentPlaceholdersAnimation {\n0% {\n transform: translate3d(-30%, 0, 0);\n}\n100% {\n transform: translate3d(100%, 0, 0);\n}\n}\n.vue-content-placeholders-heading {\n display: flex;\n}\n[class^=\"vue-content-placeholders-\"] + .vue-content-placeholders-heading {\n margin-top: 20px;\n}\n.vue-content-placeholders-heading__img {\n position: relative;\n overflow: hidden;\n height: 15px;\n background: #eee;\n width: 60px;\n height: 60px;\n margin-right: 15px;\n}\n.vue-content-placeholders-is-rounded .vue-content-placeholders-heading__img {\n border-radius: 6px;\n}\n.vue-content-placeholders-is-centered .vue-content-placeholders-heading__img {\n margin-left: auto;\n margin-right: auto;\n}\n.vue-content-placeholders-is-animated .vue-content-placeholders-heading__img::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: 1000px;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, #e1e1e1 15%, transparent 30%);\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: vueContentPlaceholdersAnimation;\n animation-name: vueContentPlaceholdersAnimation;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n}\n.vue-content-placeholders-heading__content {\n display: flex;\n flex: 1;\n flex-direction: column;\n justify-content: center;\n}\n.vue-content-placeholders-heading__title {\n position: relative;\n overflow: hidden;\n height: 15px;\n background: #eee;\n width: 85%;\n margin-bottom: 10px;\n background: #ccc;\n}\n.vue-content-placeholders-is-rounded .vue-content-placeholders-heading__title {\n border-radius: 6px;\n}\n.vue-content-placeholders-is-centered .vue-content-placeholders-heading__title {\n margin-left: auto;\n margin-right: auto;\n}\n.vue-content-placeholders-is-animated .vue-content-placeholders-heading__title::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: 1000px;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, #e1e1e1 15%, transparent 30%);\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: vueContentPlaceholdersAnimation;\n animation-name: vueContentPlaceholdersAnimation;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n}\n.vue-content-placeholders-heading__subtitle {\n position: relative;\n overflow: hidden;\n height: 15px;\n background: #eee;\n width: 90%;\n}\n.vue-content-placeholders-is-rounded .vue-content-placeholders-heading__subtitle {\n border-radius: 6px;\n}\n.vue-content-placeholders-is-centered .vue-content-placeholders-heading__subtitle {\n margin-left: auto;\n margin-right: auto;\n}\n.vue-content-placeholders-is-animated .vue-content-placeholders-heading__subtitle::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: 1000px;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, #e1e1e1 15%, transparent 30%);\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: vueContentPlaceholdersAnimation;\n animation-name: vueContentPlaceholdersAnimation;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n}\n[class^=\"vue-content-placeholders-\"] + .vue-content-placeholders-text {\n margin-top: 20px;\n}\n.vue-content-placeholders-text__line {\n position: relative;\n overflow: hidden;\n height: 15px;\n background: #eee;\n width: 100%;\n margin-bottom: 10px;\n}\n.vue-content-placeholders-is-rounded .vue-content-placeholders-text__line {\n border-radius: 6px;\n}\n.vue-content-placeholders-is-centered .vue-content-placeholders-text__line {\n margin-left: auto;\n margin-right: auto;\n}\n.vue-content-placeholders-is-animated .vue-content-placeholders-text__line::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: 1000px;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, #e1e1e1 15%, transparent 30%);\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: vueContentPlaceholdersAnimation;\n animation-name: vueContentPlaceholdersAnimation;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n}\n.vue-content-placeholders-text__line:nth-child(4n + 1) {\n width: 80%;\n}\n.vue-content-placeholders-text__line:nth-child(4n + 2) {\n width: 100%;\n}\n.vue-content-placeholders-text__line:nth-child(4n + 3) {\n width: 70%;\n}\n.vue-content-placeholders-text__line:nth-child(4n + 4) {\n width: 85%;\n}\n.vue-content-placeholders-img {\n position: relative;\n overflow: hidden;\n height: 15px;\n background: #eee;\n width: 100%;\n height: 120px;\n}\n.vue-content-placeholders-is-rounded .vue-content-placeholders-img {\n border-radius: 6px;\n}\n.vue-content-placeholders-is-centered .vue-content-placeholders-img {\n margin-left: auto;\n margin-right: auto;\n}\n.vue-content-placeholders-is-animated .vue-content-placeholders-img::before {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 100vw;\n max-width: 1000px;\n height: 100%;\n background: linear-gradient(to right, transparent 0%, #e1e1e1 15%, transparent 30%);\n -webkit-animation-duration: 1.5s;\n animation-duration: 1.5s;\n -webkit-animation-fill-mode: forwards;\n animation-fill-mode: forwards;\n -webkit-animation-iteration-count: infinite;\n animation-iteration-count: infinite;\n -webkit-animation-name: vueContentPlaceholdersAnimation;\n animation-name: vueContentPlaceholdersAnimation;\n -webkit-animation-timing-function: linear;\n animation-timing-function: linear;\n}\n[class^=\"vue-content-placeholders-\"] + .vue-content-placeholders-img {\n margin-top: 20px;\n}\n", ""]); 13835 13836// exports 13837 13838 13839/***/ }), 13840 13841/***/ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css": 13842/*!**********************************************************************************************************************************************!*\ 13843 !*** ./node_modules/css-loader??ref--7-1!./node_modules/postcss-loader/src??ref--7-2!./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css ***! 13844 \**********************************************************************************************************************************************/ 13845/*! no static exports found */ 13846/***/ (function(module, exports, __webpack_require__) { 13847 13848exports = module.exports = __webpack_require__(/*! ../../css-loader/lib/css-base.js */ "./node_modules/css-loader/lib/css-base.js")(false); 13849// imports 13850 13851 13852// module 13853exports.push([module.i, "/*\n * The MIT License\n * Copyright (c) 2012 Matias Meno <[email protected]>\n */\n@-webkit-keyframes passing-through {\n 0% {\n opacity: 0;\n transform: translateY(40px); }\n 30%, 70% {\n opacity: 1;\n transform: translateY(0px); }\n 100% {\n opacity: 0;\n transform: translateY(-40px); } }\n@keyframes passing-through {\n 0% {\n opacity: 0;\n transform: translateY(40px); }\n 30%, 70% {\n opacity: 1;\n transform: translateY(0px); }\n 100% {\n opacity: 0;\n transform: translateY(-40px); } }\n@-webkit-keyframes slide-in {\n 0% {\n opacity: 0;\n transform: translateY(40px); }\n 30% {\n opacity: 1;\n transform: translateY(0px); } }\n@keyframes slide-in {\n 0% {\n opacity: 0;\n transform: translateY(40px); }\n 30% {\n opacity: 1;\n transform: translateY(0px); } }\n@-webkit-keyframes pulse {\n 0% {\n transform: scale(1); }\n 10% {\n transform: scale(1.1); }\n 20% {\n transform: scale(1); } }\n@keyframes pulse {\n 0% {\n transform: scale(1); }\n 10% {\n transform: scale(1.1); }\n 20% {\n transform: scale(1); } }\n.dropzone, .dropzone * {\n box-sizing: border-box; }\n\n.dropzone {\n min-height: 150px;\n border: 2px solid rgba(0, 0, 0, 0.3);\n background: white;\n padding: 20px 20px; }\n .dropzone.dz-clickable {\n cursor: pointer; }\n .dropzone.dz-clickable * {\n cursor: default; }\n .dropzone.dz-clickable .dz-message, .dropzone.dz-clickable .dz-message * {\n cursor: pointer; }\n .dropzone.dz-started .dz-message {\n display: none; }\n .dropzone.dz-drag-hover {\n border-style: solid; }\n .dropzone.dz-drag-hover .dz-message {\n opacity: 0.5; }\n .dropzone .dz-message {\n text-align: center;\n margin: 2em 0; }\n .dropzone .dz-preview {\n position: relative;\n display: inline-block;\n vertical-align: top;\n margin: 16px;\n min-height: 100px; }\n .dropzone .dz-preview:hover {\n z-index: 1000; }\n .dropzone .dz-preview:hover .dz-details {\n opacity: 1; }\n .dropzone .dz-preview.dz-file-preview .dz-image {\n border-radius: 20px;\n background: #999;\n background: linear-gradient(to bottom, #eee, #ddd); }\n .dropzone .dz-preview.dz-file-preview .dz-details {\n opacity: 1; }\n .dropzone .dz-preview.dz-image-preview {\n background: white; }\n .dropzone .dz-preview.dz-image-preview .dz-details {\n transition: opacity 0.2s linear; }\n .dropzone .dz-preview .dz-remove {\n font-size: 14px;\n text-align: center;\n display: block;\n cursor: pointer;\n border: none; }\n .dropzone .dz-preview .dz-remove:hover {\n text-decoration: underline; }\n .dropzone .dz-preview:hover .dz-details {\n opacity: 1; }\n .dropzone .dz-preview .dz-details {\n z-index: 20;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n font-size: 13px;\n min-width: 100%;\n max-width: 100%;\n padding: 2em 1em;\n text-align: center;\n color: rgba(0, 0, 0, 0.9);\n line-height: 150%; }\n .dropzone .dz-preview .dz-details .dz-size {\n margin-bottom: 1em;\n font-size: 16px; }\n .dropzone .dz-preview .dz-details .dz-filename {\n white-space: nowrap; }\n .dropzone .dz-preview .dz-details .dz-filename:hover span {\n border: 1px solid rgba(200, 200, 200, 0.8);\n background-color: rgba(255, 255, 255, 0.8); }\n .dropzone .dz-preview .dz-details .dz-filename:not(:hover) {\n overflow: hidden;\n text-overflow: ellipsis; }\n .dropzone .dz-preview .dz-details .dz-filename:not(:hover) span {\n border: 1px solid transparent; }\n .dropzone .dz-preview .dz-details .dz-filename span, .dropzone .dz-preview .dz-details .dz-size span {\n background-color: rgba(255, 255, 255, 0.4);\n padding: 0 0.4em;\n border-radius: 3px; }\n .dropzone .dz-preview:hover .dz-image img {\n transform: scale(1.05, 1.05);\n filter: blur(8px); }\n .dropzone .dz-preview .dz-image {\n border-radius: 20px;\n overflow: hidden;\n width: 120px;\n height: 120px;\n position: relative;\n display: block;\n z-index: 10; }\n .dropzone .dz-preview .dz-image img {\n display: block; }\n .dropzone .dz-preview.dz-success .dz-success-mark {\n -webkit-animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1);\n animation: passing-through 3s cubic-bezier(0.77, 0, 0.175, 1); }\n .dropzone .dz-preview.dz-error .dz-error-mark {\n opacity: 1;\n -webkit-animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1);\n animation: slide-in 3s cubic-bezier(0.77, 0, 0.175, 1); }\n .dropzone .dz-preview .dz-success-mark, .dropzone .dz-preview .dz-error-mark {\n pointer-events: none;\n opacity: 0;\n z-index: 500;\n position: absolute;\n display: block;\n top: 50%;\n left: 50%;\n margin-left: -27px;\n margin-top: -27px; }\n .dropzone .dz-preview .dz-success-mark svg, .dropzone .dz-preview .dz-error-mark svg {\n display: block;\n width: 54px;\n height: 54px; }\n .dropzone .dz-preview.dz-processing .dz-progress {\n opacity: 1;\n transition: all 0.2s linear; }\n .dropzone .dz-preview.dz-complete .dz-progress {\n opacity: 0;\n transition: opacity 0.4s ease-in; }\n .dropzone .dz-preview:not(.dz-processing) .dz-progress {\n -webkit-animation: pulse 6s ease infinite;\n animation: pulse 6s ease infinite; }\n .dropzone .dz-preview .dz-progress {\n opacity: 1;\n z-index: 1000;\n pointer-events: none;\n position: absolute;\n height: 16px;\n left: 50%;\n top: 50%;\n margin-top: -8px;\n width: 80px;\n margin-left: -40px;\n background: rgba(255, 255, 255, 0.9);\n -webkit-transform: scale(1);\n border-radius: 8px;\n overflow: hidden; }\n .dropzone .dz-preview .dz-progress .dz-upload {\n background: #333;\n background: linear-gradient(to bottom, #666, #444);\n position: absolute;\n top: 0;\n left: 0;\n bottom: 0;\n width: 0;\n transition: width 300ms ease-in-out; }\n .dropzone .dz-preview.dz-error .dz-error-message {\n display: block; }\n .dropzone .dz-preview.dz-error:hover .dz-error-message {\n opacity: 1;\n pointer-events: auto; }\n .dropzone .dz-preview .dz-error-message {\n pointer-events: none;\n z-index: 1000;\n position: absolute;\n display: block;\n display: none;\n opacity: 0;\n transition: opacity 0.3s ease;\n border-radius: 8px;\n font-size: 13px;\n top: 130px;\n left: -10px;\n width: 140px;\n background: #be2626;\n background: linear-gradient(to bottom, #be2626, #a92222);\n padding: 0.5em 1.2em;\n color: white; }\n .dropzone .dz-preview .dz-error-message:after {\n content: '';\n position: absolute;\n top: -6px;\n left: 64px;\n width: 0;\n height: 0;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n border-bottom: 6px solid #be2626; }\n.vue-dropzone{border:2px solid #e5e5e5;font-family:Arial,sans-serif;letter-spacing:.2px;color:#777;transition:.2s linear}.vue-dropzone:hover{background-color:#f6f6f6}.vue-dropzone>i{color:#ccc}.vue-dropzone>.dz-preview .dz-image{border-radius:0;width:100%;height:100%}.vue-dropzone>.dz-preview .dz-image img:not([src]){width:200px;height:200px}.vue-dropzone>.dz-preview .dz-image:hover img{transform:none;-webkit-filter:none}.vue-dropzone>.dz-preview .dz-details{bottom:0;top:0;color:#fff;background-color:rgba(33,150,243,.8);transition:opacity .2s linear;text-align:left}.vue-dropzone>.dz-preview .dz-details .dz-filename{overflow:hidden}.vue-dropzone>.dz-preview .dz-details .dz-filename span,.vue-dropzone>.dz-preview .dz-details .dz-size span{background-color:transparent}.vue-dropzone>.dz-preview .dz-details .dz-filename:not(:hover) span{border:none}.vue-dropzone>.dz-preview .dz-details .dz-filename:hover span{background-color:transparent;border:none}.vue-dropzone>.dz-preview .dz-progress .dz-upload{background:#ccc}.vue-dropzone>.dz-preview .dz-remove{position:absolute;z-index:30;color:#fff;margin-left:15px;padding:10px;top:inherit;bottom:15px;border:2px #fff solid;text-decoration:none;text-transform:uppercase;font-size:.8rem;font-weight:800;letter-spacing:1.1px;opacity:0}.vue-dropzone>.dz-preview:hover .dz-remove{opacity:1}.vue-dropzone>.dz-preview .dz-error-mark,.vue-dropzone>.dz-preview .dz-success-mark{margin-left:auto;margin-top:auto;width:100%;top:35%;left:0}.vue-dropzone>.dz-preview .dz-error-mark svg,.vue-dropzone>.dz-preview .dz-success-mark svg{margin-left:auto;margin-right:auto}.vue-dropzone>.dz-preview .dz-error-message{margin-left:auto;margin-right:auto;left:0;width:100%;text-align:center}.vue-dropzone>.dz-preview .dz-error-message:after{display:none}", ""]); 13854 13855// exports 13856 13857 13858/***/ }), 13859
vendor: 2,555 bytes, lines 13860-13946
13860/***/ "./node_modules/css-loader/lib/css-base.js": 13861/*!*************************************************!*\ 13862 !*** ./node_modules/css-loader/lib/css-base.js ***! 13863 \*************************************************/ 13864/*! no static exports found */ 13865/***/ (function(module, exports) { 13866 13867/* 13868 MIT License http://www.opensource.org/licenses/mit-license.php 13869 Author Tobias Koppers @sokra 13870*/ 13871// css base code, injected by the css-loader 13872module.exports = function(useSourceMap) { 13873 var list = []; 13874 13875 // return the list of modules as css string 13876 list.toString = function toString() { 13877 return this.map(function (item) { 13878 var content = cssWithMappingToString(item, useSourceMap); 13879 if(item[2]) { 13880 return "@media " + item[2] + "{" + content + "}"; 13881 } else { 13882 return content; 13883 } 13884 }).join(""); 13885 }; 13886 13887 // import a list of modules into the list 13888 list.i = function(modules, mediaQuery) { 13889 if(typeof modules === "string") 13890 modules = [[null, modules, ""]]; 13891 var alreadyImportedModules = {}; 13892 for(var i = 0; i < this.length; i++) { 13893 var id = this[i][0]; 13894 if(typeof id === "number") 13895 alreadyImportedModules[id] = true; 13896 } 13897 for(i = 0; i < modules.length; i++) { 13898 var item = modules[i]; 13899 // skip already imported module 13900 // this implementation is not 100% perfect for weird media query combinations 13901 // when a module is imported multiple times with different media queries. 13902 // I hope this will never occur (Hey this way we have smaller bundles) 13903 if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) { 13904 if(mediaQuery && !item[2]) { 13905 item[2] = mediaQuery; 13906 } else if(mediaQuery) { 13907 item[2] = "(" + item[2] + ") and (" + mediaQuery + ")"; 13908 } 13909 list.push(item); 13910 } 13911 } 13912 }; 13913 return list; 13914}; 13915 13916function cssWithMappingToString(item, useSourceMap) { 13917 var content = item[1] || ''; 13918 var cssMapping = item[3]; 13919 if (!cssMapping) { 13920 return content; 13921 } 13922 13923 if (useSourceMap && typeof btoa === 'function') { 13924 var sourceMapping = toComment(cssMapping); 13925 var sourceURLs = cssMapping.sources.map(function (source) { 13926 return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */' 13927 }); 13928 13929 return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); 13930 } 13931 13932 return [content].join('\n'); 13933} 13934 13935// Adapted from convert-source-map (MIT) 13936function toComment(sourceMap) { 13937 // eslint-disable-next-line no-undef 13938 var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); 13939 var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; 13940 13941 return '/*# ' + data + ' */'; 13942} 13943 13944 13945/***/ }), 13946
vendor: 97,984 bytes, lines 13947-16013
13947/***/ "./node_modules/flatpickr/dist/esm/index.js": 13948/*!**************************************************!*\ 13949 !*** ./node_modules/flatpickr/dist/esm/index.js ***! 13950 \**************************************************/ 13951/*! exports provided: default */ 13952/***/ (function(module, __webpack_exports__, __webpack_require__) { 13953 13954"use strict"; 13955__webpack_require__.r(__webpack_exports__); 13956/* harmony import */ var _types_options__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./types/options */ "./node_modules/flatpickr/dist/esm/types/options.js"); 13957/* harmony import */ var _l10n_default__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./l10n/default */ "./node_modules/flatpickr/dist/esm/l10n/default.js"); 13958/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ "./node_modules/flatpickr/dist/esm/utils/index.js"); 13959/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/dom */ "./node_modules/flatpickr/dist/esm/utils/dom.js"); 13960/* harmony import */ var _utils_dates__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/dates */ "./node_modules/flatpickr/dist/esm/utils/dates.js"); 13961/* harmony import */ var _utils_formatting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/formatting */ "./node_modules/flatpickr/dist/esm/utils/formatting.js"); 13962/* harmony import */ var _utils_polyfills__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/polyfills */ "./node_modules/flatpickr/dist/esm/utils/polyfills.js"); 13963/* harmony import */ var _utils_polyfills__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_utils_polyfills__WEBPACK_IMPORTED_MODULE_6__); 13964var __assign = (undefined && undefined.__assign) || function () { 13965 __assign = Object.assign || function(t) { 13966 for (var s, i = 1, n = arguments.length; i < n; i++) { 13967 s = arguments[i]; 13968 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) 13969 t[p] = s[p]; 13970 } 13971 return t; 13972 }; 13973 return __assign.apply(this, arguments); 13974}; 13975var __spreadArrays = (undefined && undefined.__spreadArrays) || function () { 13976 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 13977 for (var r = Array(s), k = 0, i = 0; i < il; i++) 13978 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 13979 r[k] = a[j]; 13980 return r; 13981}; 13982 13983 13984 13985 13986 13987 13988 13989var DEBOUNCED_CHANGE_MS = 300; 13990function FlatpickrInstance(element, instanceConfig) { 13991 var self = { 13992 config: __assign(__assign({}, _types_options__WEBPACK_IMPORTED_MODULE_0__["defaults"]), flatpickr.defaultConfig), 13993 l10n: _l10n_default__WEBPACK_IMPORTED_MODULE_1__["default"], 13994 }; 13995 self.parseDate = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["createDateParser"])({ config: self.config, l10n: self.l10n }); 13996 self._handlers = []; 13997 self.pluginElements = []; 13998 self.loadedPlugins = []; 13999 self._bind = bind; 14000 self._setHoursFromDate = setHoursFromDate; 14001 self._positionCalendar = positionCalendar; 14002 self.changeMonth = changeMonth; 14003 self.changeYear = changeYear; 14004 self.clear = clear; 14005 self.close = close; 14006 self.onMouseOver = onMouseOver; 14007 self._createElement = _utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"]; 14008 self.createDay = createDay; 14009 self.destroy = destroy; 14010 self.isEnabled = isEnabled; 14011 self.jumpToDate = jumpToDate; 14012 self.updateValue = updateValue; 14013 self.open = open; 14014 self.redraw = redraw; 14015 self.set = set; 14016 self.setDate = setDate; 14017 self.toggle = toggle; 14018 function setupHelperFunctions() { 14019 self.utils = { 14020 getDaysInMonth: function (month, yr) { 14021 if (month === void 0) { month = self.currentMonth; } 14022 if (yr === void 0) { yr = self.currentYear; } 14023 if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0)) 14024 return 29; 14025 return self.l10n.daysInMonth[month]; 14026 }, 14027 }; 14028 } 14029 function init() { 14030 self.element = self.input = element; 14031 self.isOpen = false; 14032 parseConfig(); 14033 setupLocale(); 14034 setupInputs(); 14035 setupDates(); 14036 setupHelperFunctions(); 14037 if (!self.isMobile) 14038 build(); 14039 bindEvents(); 14040 if (self.selectedDates.length || self.config.noCalendar) { 14041 if (self.config.enableTime) { 14042 setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj : undefined); 14043 } 14044 updateValue(false); 14045 } 14046 setCalendarWidth(); 14047 var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 14048 if (!self.isMobile && isSafari) { 14049 positionCalendar(); 14050 } 14051 triggerEvent("onReady"); 14052 } 14053 function getClosestActiveElement() { 14054 var _a; 14055 return (((_a = self.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode()) 14056 .activeElement || document.activeElement); 14057 } 14058 function bindToInstance(fn) { 14059 return fn.bind(self); 14060 } 14061 function setCalendarWidth() { 14062 var config = self.config; 14063 if (config.weekNumbers === false && config.showMonths === 1) { 14064 return; 14065 } 14066 else if (config.noCalendar !== true) { 14067 window.requestAnimationFrame(function () { 14068 if (self.calendarContainer !== undefined) { 14069 self.calendarContainer.style.visibility = "hidden"; 14070 self.calendarContainer.style.display = "block"; 14071 } 14072 if (self.daysContainer !== undefined) { 14073 var daysWidth = (self.days.offsetWidth + 1) * config.showMonths; 14074 self.daysContainer.style.width = daysWidth + "px"; 14075 self.calendarContainer.style.width = 14076 daysWidth + 14077 (self.weekWrapper !== undefined 14078 ? self.weekWrapper.offsetWidth 14079 : 0) + 14080 "px"; 14081 self.calendarContainer.style.removeProperty("visibility"); 14082 self.calendarContainer.style.removeProperty("display"); 14083 } 14084 }); 14085 } 14086 } 14087 function updateTime(e) { 14088 if (self.selectedDates.length === 0) { 14089 var defaultDate = self.config.minDate === undefined || 14090 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(new Date(), self.config.minDate) >= 0 14091 ? new Date() 14092 : new Date(self.config.minDate.getTime()); 14093 var defaults = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["getDefaultHours"])(self.config); 14094 defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds()); 14095 self.selectedDates = [defaultDate]; 14096 self.latestSelectedDateObj = defaultDate; 14097 } 14098 if (e !== undefined && e.type !== "blur") { 14099 timeWrapper(e); 14100 } 14101 var prevValue = self._input.value; 14102 setHoursFromInputs(); 14103 updateValue(); 14104 if (self._input.value !== prevValue) { 14105 self._debouncedChange(); 14106 } 14107 } 14108 function ampm2military(hour, amPM) { 14109 return (hour % 12) + 12 * Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(amPM === self.l10n.amPM[1]); 14110 } 14111 function military2ampm(hour) { 14112 switch (hour % 24) { 14113 case 0: 14114 case 12: 14115 return 12; 14116 default: 14117 return hour % 12; 14118 } 14119 } 14120 function setHoursFromInputs() { 14121 if (self.hourElement === undefined || self.minuteElement === undefined) 14122 return; 14123 var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined 14124 ? (parseInt(self.secondElement.value, 10) || 0) % 60 14125 : 0; 14126 if (self.amPM !== undefined) { 14127 hours = ampm2military(hours, self.amPM.textContent); 14128 } 14129 var limitMinHours = self.config.minTime !== undefined || 14130 (self.config.minDate && 14131 self.minDateHasTime && 14132 self.latestSelectedDateObj && 14133 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(self.latestSelectedDateObj, self.config.minDate, true) === 14134 0); 14135 var limitMaxHours = self.config.maxTime !== undefined || 14136 (self.config.maxDate && 14137 self.maxDateHasTime && 14138 self.latestSelectedDateObj && 14139 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(self.latestSelectedDateObj, self.config.maxDate, true) === 14140 0); 14141 if (self.config.maxTime !== undefined && 14142 self.config.minTime !== undefined && 14143 self.config.minTime > self.config.maxTime) { 14144 var minBound = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["calculateSecondsSinceMidnight"])(self.config.minTime.getHours(), self.config.minTime.getMinutes(), self.config.minTime.getSeconds()); 14145 var maxBound = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["calculateSecondsSinceMidnight"])(self.config.maxTime.getHours(), self.config.maxTime.getMinutes(), self.config.maxTime.getSeconds()); 14146 var currentTime = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["calculateSecondsSinceMidnight"])(hours, minutes, seconds); 14147 if (currentTime > maxBound && currentTime < minBound) { 14148 var result = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["parseSeconds"])(minBound); 14149 hours = result[0]; 14150 minutes = result[1]; 14151 seconds = result[2]; 14152 } 14153 } 14154 else { 14155 if (limitMaxHours) { 14156 var maxTime = self.config.maxTime !== undefined 14157 ? self.config.maxTime 14158 : self.config.maxDate; 14159 hours = Math.min(hours, maxTime.getHours()); 14160 if (hours === maxTime.getHours()) 14161 minutes = Math.min(minutes, maxTime.getMinutes()); 14162 if (minutes === maxTime.getMinutes()) 14163 seconds = Math.min(seconds, maxTime.getSeconds()); 14164 } 14165 if (limitMinHours) { 14166 var minTime = self.config.minTime !== undefined 14167 ? self.config.minTime 14168 : self.config.minDate; 14169 hours = Math.max(hours, minTime.getHours()); 14170 if (hours === minTime.getHours() && minutes < minTime.getMinutes()) 14171 minutes = minTime.getMinutes(); 14172 if (minutes === minTime.getMinutes()) 14173 seconds = Math.max(seconds, minTime.getSeconds()); 14174 } 14175 } 14176 setHours(hours, minutes, seconds); 14177 } 14178 function setHoursFromDate(dateObj) { 14179 var date = dateObj || self.latestSelectedDateObj; 14180 if (date && date instanceof Date) { 14181 setHours(date.getHours(), date.getMinutes(), date.getSeconds()); 14182 } 14183 } 14184 function setHours(hours, minutes, seconds) { 14185 if (self.latestSelectedDateObj !== undefined) { 14186 self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0); 14187 } 14188 if (!self.hourElement || !self.minuteElement || self.isMobile) 14189 return; 14190 self.hourElement.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(!self.config.time_24hr 14191 ? ((12 + hours) % 12) + 12 * Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(hours % 12 === 0) 14192 : hours); 14193 self.minuteElement.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(minutes); 14194 if (self.amPM !== undefined) 14195 self.amPM.textContent = self.l10n.amPM[Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(hours >= 12)]; 14196 if (self.secondElement !== undefined) 14197 self.secondElement.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(seconds); 14198 } 14199 function onYearInput(event) { 14200 var eventTarget = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(event); 14201 var year = parseInt(eventTarget.value) + (event.delta || 0); 14202 if (year / 1000 > 1 || 14203 (event.key === "Enter" && !/[^\d]/.test(year.toString()))) { 14204 changeYear(year); 14205 } 14206 } 14207 function bind(element, event, handler, options) { 14208 if (event instanceof Array) 14209 return event.forEach(function (ev) { return bind(element, ev, handler, options); }); 14210 if (element instanceof Array) 14211 return element.forEach(function (el) { return bind(el, event, handler, options); }); 14212 element.addEventListener(event, handler, options); 14213 self._handlers.push({ 14214 remove: function () { return element.removeEventListener(event, handler, options); }, 14215 }); 14216 } 14217 function triggerChange() { 14218 triggerEvent("onChange"); 14219 } 14220 function bindEvents() { 14221 if (self.config.wrap) { 14222 ["open", "close", "toggle", "clear"].forEach(function (evt) { 14223 Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) { 14224 return bind(el, "click", self[evt]); 14225 }); 14226 }); 14227 } 14228 if (self.isMobile) { 14229 setupMobile(); 14230 return; 14231 } 14232 var debouncedResize = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["debounce"])(onResize, 50); 14233 self._debouncedChange = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["debounce"])(triggerChange, DEBOUNCED_CHANGE_MS); 14234 if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) 14235 bind(self.daysContainer, "mouseover", function (e) { 14236 if (self.config.mode === "range") 14237 onMouseOver(Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e)); 14238 }); 14239 bind(self._input, "keydown", onKeyDown); 14240 if (self.calendarContainer !== undefined) { 14241 bind(self.calendarContainer, "keydown", onKeyDown); 14242 } 14243 if (!self.config.inline && !self.config.static) 14244 bind(window, "resize", debouncedResize); 14245 if (window.ontouchstart !== undefined) 14246 bind(window.document, "touchstart", documentClick); 14247 else 14248 bind(window.document, "mousedown", documentClick); 14249 bind(window.document, "focus", documentClick, { capture: true }); 14250 if (self.config.clickOpens === true) { 14251 bind(self._input, "focus", self.open); 14252 bind(self._input, "click", self.open); 14253 } 14254 if (self.daysContainer !== undefined) { 14255 bind(self.monthNav, "click", onMonthNavClick); 14256 bind(self.monthNav, ["keyup", "increment"], onYearInput); 14257 bind(self.daysContainer, "click", selectDate); 14258 } 14259 if (self.timeContainer !== undefined && 14260 self.minuteElement !== undefined && 14261 self.hourElement !== undefined) { 14262 var selText = function (e) { 14263 return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e).select(); 14264 }; 14265 bind(self.timeContainer, ["increment"], updateTime); 14266 bind(self.timeContainer, "blur", updateTime, { capture: true }); 14267 bind(self.timeContainer, "click", timeIncrement); 14268 bind([self.hourElement, self.minuteElement], ["focus", "click"], selText); 14269 if (self.secondElement !== undefined) 14270 bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); }); 14271 if (self.amPM !== undefined) { 14272 bind(self.amPM, "click", function (e) { 14273 updateTime(e); 14274 }); 14275 } 14276 } 14277 if (self.config.allowInput) { 14278 bind(self._input, "blur", onBlur); 14279 } 14280 } 14281 function jumpToDate(jumpDate, triggerChange) { 14282 var jumpTo = jumpDate !== undefined 14283 ? self.parseDate(jumpDate) 14284 : self.latestSelectedDateObj || 14285 (self.config.minDate && self.config.minDate > self.now 14286 ? self.config.minDate 14287 : self.config.maxDate && self.config.maxDate < self.now 14288 ? self.config.maxDate 14289 : self.now); 14290 var oldYear = self.currentYear; 14291 var oldMonth = self.currentMonth; 14292 try { 14293 if (jumpTo !== undefined) { 14294 self.currentYear = jumpTo.getFullYear(); 14295 self.currentMonth = jumpTo.getMonth(); 14296 } 14297 } 14298 catch (e) { 14299 e.message = "Invalid date supplied: " + jumpTo; 14300 self.config.errorHandler(e); 14301 } 14302 if (triggerChange && self.currentYear !== oldYear) { 14303 triggerEvent("onYearChange"); 14304 buildMonthSwitch(); 14305 } 14306 if (triggerChange && 14307 (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) { 14308 triggerEvent("onMonthChange"); 14309 } 14310 self.redraw(); 14311 } 14312 function timeIncrement(e) { 14313 var eventTarget = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 14314 if (~eventTarget.className.indexOf("arrow")) 14315 incrementNumInput(e, eventTarget.classList.contains("arrowUp") ? 1 : -1); 14316 } 14317 function incrementNumInput(e, delta, inputElem) { 14318 var target = e && Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 14319 var input = inputElem || 14320 (target && target.parentNode && target.parentNode.firstChild); 14321 var event = createEvent("increment"); 14322 event.delta = delta; 14323 input && input.dispatchEvent(event); 14324 } 14325 function build() { 14326 var fragment = window.document.createDocumentFragment(); 14327 self.calendarContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-calendar"); 14328 self.calendarContainer.tabIndex = -1; 14329 if (!self.config.noCalendar) { 14330 fragment.appendChild(buildMonthNav()); 14331 self.innerContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-innerContainer"); 14332 if (self.config.weekNumbers) { 14333 var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers; 14334 self.innerContainer.appendChild(weekWrapper); 14335 self.weekNumbers = weekNumbers; 14336 self.weekWrapper = weekWrapper; 14337 } 14338 self.rContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-rContainer"); 14339 self.rContainer.appendChild(buildWeekdays()); 14340 if (!self.daysContainer) { 14341 self.daysContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-days"); 14342 self.daysContainer.tabIndex = -1; 14343 } 14344 buildDays(); 14345 self.rContainer.appendChild(self.daysContainer); 14346 self.innerContainer.appendChild(self.rContainer); 14347 fragment.appendChild(self.innerContainer); 14348 } 14349 if (self.config.enableTime) { 14350 fragment.appendChild(buildTime()); 14351 } 14352 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "rangeMode", self.config.mode === "range"); 14353 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "animate", self.config.animate === true); 14354 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "multiMonth", self.config.showMonths > 1); 14355 self.calendarContainer.appendChild(fragment); 14356 var customAppend = self.config.appendTo !== undefined && 14357 self.config.appendTo.nodeType !== undefined; 14358 if (self.config.inline || self.config.static) { 14359 self.calendarContainer.classList.add(self.config.inline ? "inline" : "static"); 14360 if (self.config.inline) { 14361 if (!customAppend && self.element.parentNode) 14362 self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling); 14363 else if (self.config.appendTo !== undefined) 14364 self.config.appendTo.appendChild(self.calendarContainer); 14365 } 14366 if (self.config.static) { 14367 var wrapper = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-wrapper"); 14368 if (self.element.parentNode) 14369 self.element.parentNode.insertBefore(wrapper, self.element); 14370 wrapper.appendChild(self.element); 14371 if (self.altInput) 14372 wrapper.appendChild(self.altInput); 14373 wrapper.appendChild(self.calendarContainer); 14374 } 14375 } 14376 if (!self.config.static && !self.config.inline) 14377 (self.config.appendTo !== undefined 14378 ? self.config.appendTo 14379 : window.document.body).appendChild(self.calendarContainer); 14380 } 14381 function createDay(className, date, _dayNumber, i) { 14382 var dateIsEnabled = isEnabled(date, true), dayElement = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", className, date.getDate().toString()); 14383 dayElement.dateObj = date; 14384 dayElement.$i = i; 14385 dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat)); 14386 if (className.indexOf("hidden") === -1 && 14387 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(date, self.now) === 0) { 14388 self.todayDateElem = dayElement; 14389 dayElement.classList.add("today"); 14390 dayElement.setAttribute("aria-current", "date"); 14391 } 14392 if (dateIsEnabled) { 14393 dayElement.tabIndex = -1; 14394 if (isDateSelected(date)) { 14395 dayElement.classList.add("selected"); 14396 self.selectedDateElem = dayElement; 14397 if (self.config.mode === "range") { 14398 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(dayElement, "startRange", self.selectedDates[0] && 14399 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(date, self.selectedDates[0], true) === 0); 14400 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(dayElement, "endRange", self.selectedDates[1] && 14401 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(date, self.selectedDates[1], true) === 0); 14402 if (className === "nextMonthDay") 14403 dayElement.classList.add("inRange"); 14404 } 14405 } 14406 } 14407 else { 14408 dayElement.classList.add("flatpickr-disabled"); 14409 } 14410 if (self.config.mode === "range") { 14411 if (isDateInRange(date) && !isDateSelected(date)) 14412 dayElement.classList.add("inRange"); 14413 } 14414 if (self.weekNumbers && 14415 self.config.showMonths === 1 && 14416 className !== "prevMonthDay" && 14417 i % 7 === 6) { 14418 self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>"); 14419 } 14420 triggerEvent("onDayCreate", dayElement); 14421 return dayElement; 14422 } 14423 function focusOnDayElem(targetNode) { 14424 targetNode.focus(); 14425 if (self.config.mode === "range") 14426 onMouseOver(targetNode); 14427 } 14428 function getFirstAvailableDay(delta) { 14429 var startMonth = delta > 0 ? 0 : self.config.showMonths - 1; 14430 var endMonth = delta > 0 ? self.config.showMonths : -1; 14431 for (var m = startMonth; m != endMonth; m += delta) { 14432 var month = self.daysContainer.children[m]; 14433 var startIndex = delta > 0 ? 0 : month.children.length - 1; 14434 var endIndex = delta > 0 ? month.children.length : -1; 14435 for (var i = startIndex; i != endIndex; i += delta) { 14436 var c = month.children[i]; 14437 if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) 14438 return c; 14439 } 14440 } 14441 return undefined; 14442 } 14443 function getNextAvailableDay(current, delta) { 14444 var givenMonth = current.className.indexOf("Month") === -1 14445 ? current.dateObj.getMonth() 14446 : self.currentMonth; 14447 var endMonth = delta > 0 ? self.config.showMonths : -1; 14448 var loopDelta = delta > 0 ? 1 : -1; 14449 for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) { 14450 var month = self.daysContainer.children[m]; 14451 var startIndex = givenMonth - self.currentMonth === m 14452 ? current.$i + delta 14453 : delta < 0 14454 ? month.children.length - 1 14455 : 0; 14456 var numMonthDays = month.children.length; 14457 for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) { 14458 var c = month.children[i]; 14459 if (c.className.indexOf("hidden") === -1 && 14460 isEnabled(c.dateObj) && 14461 Math.abs(current.$i - i) >= Math.abs(delta)) 14462 return focusOnDayElem(c); 14463 } 14464 } 14465 self.changeMonth(loopDelta); 14466 focusOnDay(getFirstAvailableDay(loopDelta), 0); 14467 return undefined; 14468 } 14469 function focusOnDay(current, offset) { 14470 var activeElement = getClosestActiveElement(); 14471 var dayFocused = isInView(activeElement || document.body); 14472 var startElem = current !== undefined 14473 ? current 14474 : dayFocused 14475 ? activeElement 14476 : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) 14477 ? self.selectedDateElem 14478 : self.todayDateElem !== undefined && isInView(self.todayDateElem) 14479 ? self.todayDateElem 14480 : getFirstAvailableDay(offset > 0 ? 1 : -1); 14481 if (startElem === undefined) { 14482 self._input.focus(); 14483 } 14484 else if (!dayFocused) { 14485 focusOnDayElem(startElem); 14486 } 14487 else { 14488 getNextAvailableDay(startElem, offset); 14489 } 14490 } 14491 function buildMonthDays(year, month) { 14492 var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7; 14493 var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12, year); 14494 var daysInMonth = self.utils.getDaysInMonth(month, year), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay"; 14495 var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0; 14496 for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) { 14497 days.appendChild(createDay("flatpickr-day " + prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex)); 14498 } 14499 for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) { 14500 days.appendChild(createDay("flatpickr-day", new Date(year, month, dayNumber), dayNumber, dayIndex)); 14501 } 14502 for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && 14503 (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) { 14504 days.appendChild(createDay("flatpickr-day " + nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex)); 14505 } 14506 var dayContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "dayContainer"); 14507 dayContainer.appendChild(days); 14508 return dayContainer; 14509 } 14510 function buildDays() { 14511 if (self.daysContainer === undefined) { 14512 return; 14513 } 14514 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["clearNode"])(self.daysContainer); 14515 if (self.weekNumbers) 14516 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["clearNode"])(self.weekNumbers); 14517 var frag = document.createDocumentFragment(); 14518 for (var i = 0; i < self.config.showMonths; i++) { 14519 var d = new Date(self.currentYear, self.currentMonth, 1); 14520 d.setMonth(self.currentMonth + i); 14521 frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth())); 14522 } 14523 self.daysContainer.appendChild(frag); 14524 self.days = self.daysContainer.firstChild; 14525 if (self.config.mode === "range" && self.selectedDates.length === 1) { 14526 onMouseOver(); 14527 } 14528 } 14529 function buildMonthSwitch() { 14530 if (self.config.showMonths > 1 || 14531 self.config.monthSelectorType !== "dropdown") 14532 return; 14533 var shouldBuildMonth = function (month) { 14534 if (self.config.minDate !== undefined && 14535 self.currentYear === self.config.minDate.getFullYear() && 14536 month < self.config.minDate.getMonth()) { 14537 return false; 14538 } 14539 return !(self.config.maxDate !== undefined && 14540 self.currentYear === self.config.maxDate.getFullYear() && 14541 month > self.config.maxDate.getMonth()); 14542 }; 14543 self.monthsDropdownContainer.tabIndex = -1; 14544 self.monthsDropdownContainer.innerHTML = ""; 14545 for (var i = 0; i < 12; i++) { 14546 if (!shouldBuildMonth(i)) 14547 continue; 14548 var month = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("option", "flatpickr-monthDropdown-month"); 14549 month.value = new Date(self.currentYear, i).getMonth().toString(); 14550 month.textContent = Object(_utils_formatting__WEBPACK_IMPORTED_MODULE_5__["monthToStr"])(i, self.config.shorthandCurrentMonth, self.l10n); 14551 month.tabIndex = -1; 14552 if (self.currentMonth === i) { 14553 month.selected = true; 14554 } 14555 self.monthsDropdownContainer.appendChild(month); 14556 } 14557 } 14558 function buildMonth() { 14559 var container = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-month"); 14560 var monthNavFragment = window.document.createDocumentFragment(); 14561 var monthElement; 14562 if (self.config.showMonths > 1 || 14563 self.config.monthSelectorType === "static") { 14564 monthElement = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "cur-month"); 14565 } 14566 else { 14567 self.monthsDropdownContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("select", "flatpickr-monthDropdown-months"); 14568 self.monthsDropdownContainer.setAttribute("aria-label", self.l10n.monthAriaLabel); 14569 bind(self.monthsDropdownContainer, "change", function (e) { 14570 var target = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 14571 var selectedMonth = parseInt(target.value, 10); 14572 self.changeMonth(selectedMonth - self.currentMonth); 14573 triggerEvent("onMonthChange"); 14574 }); 14575 buildMonthSwitch(); 14576 monthElement = self.monthsDropdownContainer; 14577 } 14578 var yearInput = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createNumberInput"])("cur-year", { tabindex: "-1" }); 14579 var yearElement = yearInput.getElementsByTagName("input")[0]; 14580 yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel); 14581 if (self.config.minDate) { 14582 yearElement.setAttribute("min", self.config.minDate.getFullYear().toString()); 14583 } 14584 if (self.config.maxDate) { 14585 yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString()); 14586 yearElement.disabled = 14587 !!self.config.minDate && 14588 self.config.minDate.getFullYear() === self.config.maxDate.getFullYear(); 14589 } 14590 var currentMonth = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-current-month"); 14591 currentMonth.appendChild(monthElement); 14592 currentMonth.appendChild(yearInput); 14593 monthNavFragment.appendChild(currentMonth); 14594 container.appendChild(monthNavFragment); 14595 return { 14596 container: container, 14597 yearElement: yearElement, 14598 monthElement: monthElement, 14599 }; 14600 } 14601 function buildMonths() { 14602 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["clearNode"])(self.monthNav); 14603 self.monthNav.appendChild(self.prevMonthNav); 14604 if (self.config.showMonths) { 14605 self.yearElements = []; 14606 self.monthElements = []; 14607 } 14608 for (var m = self.config.showMonths; m--;) { 14609 var month = buildMonth(); 14610 self.yearElements.push(month.yearElement); 14611 self.monthElements.push(month.monthElement); 14612 self.monthNav.appendChild(month.container); 14613 } 14614 self.monthNav.appendChild(self.nextMonthNav); 14615 } 14616 function buildMonthNav() { 14617 self.monthNav = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-months"); 14618 self.yearElements = []; 14619 self.monthElements = []; 14620 self.prevMonthNav = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "flatpickr-prev-month"); 14621 self.prevMonthNav.innerHTML = self.config.prevArrow; 14622 self.nextMonthNav = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "flatpickr-next-month"); 14623 self.nextMonthNav.innerHTML = self.config.nextArrow; 14624 buildMonths(); 14625 Object.defineProperty(self, "_hidePrevMonthArrow", { 14626 get: function () { return self.__hidePrevMonthArrow; }, 14627 set: function (bool) { 14628 if (self.__hidePrevMonthArrow !== bool) { 14629 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.prevMonthNav, "flatpickr-disabled", bool); 14630 self.__hidePrevMonthArrow = bool; 14631 } 14632 }, 14633 }); 14634 Object.defineProperty(self, "_hideNextMonthArrow", { 14635 get: function () { return self.__hideNextMonthArrow; }, 14636 set: function (bool) { 14637 if (self.__hideNextMonthArrow !== bool) { 14638 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.nextMonthNav, "flatpickr-disabled", bool); 14639 self.__hideNextMonthArrow = bool; 14640 } 14641 }, 14642 }); 14643 self.currentYearElement = self.yearElements[0]; 14644 updateNavigationCurrentMonth(); 14645 return self.monthNav; 14646 } 14647 function buildTime() { 14648 self.calendarContainer.classList.add("hasTime"); 14649 if (self.config.noCalendar) 14650 self.calendarContainer.classList.add("noCalendar"); 14651 var defaults = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["getDefaultHours"])(self.config); 14652 self.timeContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-time"); 14653 self.timeContainer.tabIndex = -1; 14654 var separator = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "flatpickr-time-separator", ":"); 14655 var hourInput = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createNumberInput"])("flatpickr-hour", { 14656 "aria-label": self.l10n.hourAriaLabel, 14657 }); 14658 self.hourElement = hourInput.getElementsByTagName("input")[0]; 14659 var minuteInput = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createNumberInput"])("flatpickr-minute", { 14660 "aria-label": self.l10n.minuteAriaLabel, 14661 }); 14662 self.minuteElement = minuteInput.getElementsByTagName("input")[0]; 14663 self.hourElement.tabIndex = self.minuteElement.tabIndex = -1; 14664 self.hourElement.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(self.latestSelectedDateObj 14665 ? self.latestSelectedDateObj.getHours() 14666 : self.config.time_24hr 14667 ? defaults.hours 14668 : military2ampm(defaults.hours)); 14669 self.minuteElement.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(self.latestSelectedDateObj 14670 ? self.latestSelectedDateObj.getMinutes() 14671 : defaults.minutes); 14672 self.hourElement.setAttribute("step", self.config.hourIncrement.toString()); 14673 self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString()); 14674 self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1"); 14675 self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12"); 14676 self.hourElement.setAttribute("maxlength", "2"); 14677 self.minuteElement.setAttribute("min", "0"); 14678 self.minuteElement.setAttribute("max", "59"); 14679 self.minuteElement.setAttribute("maxlength", "2"); 14680 self.timeContainer.appendChild(hourInput); 14681 self.timeContainer.appendChild(separator); 14682 self.timeContainer.appendChild(minuteInput); 14683 if (self.config.time_24hr) 14684 self.timeContainer.classList.add("time24hr"); 14685 if (self.config.enableSeconds) { 14686 self.timeContainer.classList.add("hasSeconds"); 14687 var secondInput = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createNumberInput"])("flatpickr-second"); 14688 self.secondElement = secondInput.getElementsByTagName("input")[0]; 14689 self.secondElement.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(self.latestSelectedDateObj 14690 ? self.latestSelectedDateObj.getSeconds() 14691 : defaults.seconds); 14692 self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step")); 14693 self.secondElement.setAttribute("min", "0"); 14694 self.secondElement.setAttribute("max", "59"); 14695 self.secondElement.setAttribute("maxlength", "2"); 14696 self.timeContainer.appendChild(Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "flatpickr-time-separator", ":")); 14697 self.timeContainer.appendChild(secondInput); 14698 } 14699 if (!self.config.time_24hr) { 14700 self.amPM = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "flatpickr-am-pm", self.l10n.amPM[Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])((self.latestSelectedDateObj 14701 ? self.hourElement.value 14702 : self.config.defaultHour) > 11)]); 14703 self.amPM.title = self.l10n.toggleTitle; 14704 self.amPM.tabIndex = -1; 14705 self.timeContainer.appendChild(self.amPM); 14706 } 14707 return self.timeContainer; 14708 } 14709 function buildWeekdays() { 14710 if (!self.weekdayContainer) 14711 self.weekdayContainer = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-weekdays"); 14712 else 14713 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["clearNode"])(self.weekdayContainer); 14714 for (var i = self.config.showMonths; i--;) { 14715 var container = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-weekdaycontainer"); 14716 self.weekdayContainer.appendChild(container); 14717 } 14718 updateWeekdays(); 14719 return self.weekdayContainer; 14720 } 14721 function updateWeekdays() { 14722 if (!self.weekdayContainer) { 14723 return; 14724 } 14725 var firstDayOfWeek = self.l10n.firstDayOfWeek; 14726 var weekdays = __spreadArrays(self.l10n.weekdays.shorthand); 14727 if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) { 14728 weekdays = __spreadArrays(weekdays.splice(firstDayOfWeek, weekdays.length), weekdays.splice(0, firstDayOfWeek)); 14729 } 14730 for (var i = self.config.showMonths; i--;) { 14731 self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n "; 14732 } 14733 } 14734 function buildWeeks() { 14735 self.calendarContainer.classList.add("hasWeeks"); 14736 var weekWrapper = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-weekwrapper"); 14737 weekWrapper.appendChild(Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("span", "flatpickr-weekday", self.l10n.weekAbbreviation)); 14738 var weekNumbers = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("div", "flatpickr-weeks"); 14739 weekWrapper.appendChild(weekNumbers); 14740 return { 14741 weekWrapper: weekWrapper, 14742 weekNumbers: weekNumbers, 14743 }; 14744 } 14745 function changeMonth(value, isOffset) { 14746 if (isOffset === void 0) { isOffset = true; } 14747 var delta = isOffset ? value : value - self.currentMonth; 14748 if ((delta < 0 && self._hidePrevMonthArrow === true) || 14749 (delta > 0 && self._hideNextMonthArrow === true)) 14750 return; 14751 self.currentMonth += delta; 14752 if (self.currentMonth < 0 || self.currentMonth > 11) { 14753 self.currentYear += self.currentMonth > 11 ? 1 : -1; 14754 self.currentMonth = (self.currentMonth + 12) % 12; 14755 triggerEvent("onYearChange"); 14756 buildMonthSwitch(); 14757 } 14758 buildDays(); 14759 triggerEvent("onMonthChange"); 14760 updateNavigationCurrentMonth(); 14761 } 14762 function clear(triggerChangeEvent, toInitial) { 14763 if (triggerChangeEvent === void 0) { triggerChangeEvent = true; } 14764 if (toInitial === void 0) { toInitial = true; } 14765 self.input.value = ""; 14766 if (self.altInput !== undefined) 14767 self.altInput.value = ""; 14768 if (self.mobileInput !== undefined) 14769 self.mobileInput.value = ""; 14770 self.selectedDates = []; 14771 self.latestSelectedDateObj = undefined; 14772 if (toInitial === true) { 14773 self.currentYear = self._initialDate.getFullYear(); 14774 self.currentMonth = self._initialDate.getMonth(); 14775 } 14776 if (self.config.enableTime === true) { 14777 var _a = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["getDefaultHours"])(self.config), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds; 14778 setHours(hours, minutes, seconds); 14779 } 14780 self.redraw(); 14781 if (triggerChangeEvent) 14782 triggerEvent("onChange"); 14783 } 14784 function close() { 14785 self.isOpen = false; 14786 if (!self.isMobile) { 14787 if (self.calendarContainer !== undefined) { 14788 self.calendarContainer.classList.remove("open"); 14789 } 14790 if (self._input !== undefined) { 14791 self._input.classList.remove("active"); 14792 } 14793 } 14794 triggerEvent("onClose"); 14795 } 14796 function destroy() { 14797 if (self.config !== undefined) 14798 triggerEvent("onDestroy"); 14799 for (var i = self._handlers.length; i--;) { 14800 self._handlers[i].remove(); 14801 } 14802 self._handlers = []; 14803 if (self.mobileInput) { 14804 if (self.mobileInput.parentNode) 14805 self.mobileInput.parentNode.removeChild(self.mobileInput); 14806 self.mobileInput = undefined; 14807 } 14808 else if (self.calendarContainer && self.calendarContainer.parentNode) { 14809 if (self.config.static && self.calendarContainer.parentNode) { 14810 var wrapper = self.calendarContainer.parentNode; 14811 wrapper.lastChild && wrapper.removeChild(wrapper.lastChild); 14812 if (wrapper.parentNode) { 14813 while (wrapper.firstChild) 14814 wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper); 14815 wrapper.parentNode.removeChild(wrapper); 14816 } 14817 } 14818 else 14819 self.calendarContainer.parentNode.removeChild(self.calendarContainer); 14820 } 14821 if (self.altInput) { 14822 self.input.type = "text"; 14823 if (self.altInput.parentNode) 14824 self.altInput.parentNode.removeChild(self.altInput); 14825 delete self.altInput; 14826 } 14827 if (self.input) { 14828 self.input.type = self.input._type; 14829 self.input.classList.remove("flatpickr-input"); 14830 self.input.removeAttribute("readonly"); 14831 } 14832 [ 14833 "_showTimeInput", 14834 "latestSelectedDateObj", 14835 "_hideNextMonthArrow", 14836 "_hidePrevMonthArrow", 14837 "__hideNextMonthArrow", 14838 "__hidePrevMonthArrow", 14839 "isMobile", 14840 "isOpen", 14841 "selectedDateElem", 14842 "minDateHasTime", 14843 "maxDateHasTime", 14844 "days", 14845 "daysContainer", 14846 "_input", 14847 "_positionElement", 14848 "innerContainer", 14849 "rContainer", 14850 "monthNav", 14851 "todayDateElem", 14852 "calendarContainer", 14853 "weekdayContainer", 14854 "prevMonthNav", 14855 "nextMonthNav", 14856 "monthsDropdownContainer", 14857 "currentMonthElement", 14858 "currentYearElement", 14859 "navigationCurrentMonth", 14860 "selectedDateElem", 14861 "config", 14862 ].forEach(function (k) { 14863 try { 14864 delete self[k]; 14865 } 14866 catch (_) { } 14867 }); 14868 } 14869 function isCalendarElem(elem) { 14870 return self.calendarContainer.contains(elem); 14871 } 14872 function documentClick(e) { 14873 if (self.isOpen && !self.config.inline) { 14874 var eventTarget_1 = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 14875 var isCalendarElement = isCalendarElem(eventTarget_1); 14876 var isInput = eventTarget_1 === self.input || 14877 eventTarget_1 === self.altInput || 14878 self.element.contains(eventTarget_1) || 14879 (e.path && 14880 e.path.indexOf && 14881 (~e.path.indexOf(self.input) || 14882 ~e.path.indexOf(self.altInput))); 14883 var lostFocus = !isInput && 14884 !isCalendarElement && 14885 !isCalendarElem(e.relatedTarget); 14886 var isIgnored = !self.config.ignoredFocusElements.some(function (elem) { 14887 return elem.contains(eventTarget_1); 14888 }); 14889 if (lostFocus && isIgnored) { 14890 if (self.config.allowInput) { 14891 self.setDate(self._input.value, false, self.config.altInput 14892 ? self.config.altFormat 14893 : self.config.dateFormat); 14894 } 14895 if (self.timeContainer !== undefined && 14896 self.minuteElement !== undefined && 14897 self.hourElement !== undefined && 14898 self.input.value !== "" && 14899 self.input.value !== undefined) { 14900 updateTime(); 14901 } 14902 self.close(); 14903 if (self.config && 14904 self.config.mode === "range" && 14905 self.selectedDates.length === 1) 14906 self.clear(false); 14907 } 14908 } 14909 } 14910 function changeYear(newYear) { 14911 if (!newYear || 14912 (self.config.minDate && newYear < self.config.minDate.getFullYear()) || 14913 (self.config.maxDate && newYear > self.config.maxDate.getFullYear())) 14914 return; 14915 var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum; 14916 self.currentYear = newYearNum || self.currentYear; 14917 if (self.config.maxDate && 14918 self.currentYear === self.config.maxDate.getFullYear()) { 14919 self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth); 14920 } 14921 else if (self.config.minDate && 14922 self.currentYear === self.config.minDate.getFullYear()) { 14923 self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth); 14924 } 14925 if (isNewYear) { 14926 self.redraw(); 14927 triggerEvent("onYearChange"); 14928 buildMonthSwitch(); 14929 } 14930 } 14931 function isEnabled(date, timeless) { 14932 var _a; 14933 if (timeless === void 0) { timeless = true; } 14934 var dateToCheck = self.parseDate(date, undefined, timeless); 14935 if ((self.config.minDate && 14936 dateToCheck && 14937 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) || 14938 (self.config.maxDate && 14939 dateToCheck && 14940 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0)) 14941 return false; 14942 if (!self.config.enable && self.config.disable.length === 0) 14943 return true; 14944 if (dateToCheck === undefined) 14945 return false; 14946 var bool = !!self.config.enable, array = (_a = self.config.enable) !== null && _a !== void 0 ? _a : self.config.disable; 14947 for (var i = 0, d = void 0; i < array.length; i++) { 14948 d = array[i]; 14949 if (typeof d === "function" && 14950 d(dateToCheck)) 14951 return bool; 14952 else if (d instanceof Date && 14953 dateToCheck !== undefined && 14954 d.getTime() === dateToCheck.getTime()) 14955 return bool; 14956 else if (typeof d === "string") { 14957 var parsed = self.parseDate(d, undefined, true); 14958 return parsed && parsed.getTime() === dateToCheck.getTime() 14959 ? bool 14960 : !bool; 14961 } 14962 else if (typeof d === "object" && 14963 dateToCheck !== undefined && 14964 d.from && 14965 d.to && 14966 dateToCheck.getTime() >= d.from.getTime() && 14967 dateToCheck.getTime() <= d.to.getTime()) 14968 return bool; 14969 } 14970 return !bool; 14971 } 14972 function isInView(elem) { 14973 if (self.daysContainer !== undefined) 14974 return (elem.className.indexOf("hidden") === -1 && 14975 elem.className.indexOf("flatpickr-disabled") === -1 && 14976 self.daysContainer.contains(elem)); 14977 return false; 14978 } 14979 function onBlur(e) { 14980 var isInput = e.target === self._input; 14981 var valueChanged = self._input.value.trimEnd() !== getDateStr(); 14982 if (isInput && 14983 valueChanged && 14984 !(e.relatedTarget && isCalendarElem(e.relatedTarget))) { 14985 self.setDate(self._input.value, true, e.target === self.altInput 14986 ? self.config.altFormat 14987 : self.config.dateFormat); 14988 } 14989 } 14990 function onKeyDown(e) { 14991 var eventTarget = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 14992 var isInput = self.config.wrap 14993 ? element.contains(eventTarget) 14994 : eventTarget === self._input; 14995 var allowInput = self.config.allowInput; 14996 var allowKeydown = self.isOpen && (!allowInput || !isInput); 14997 var allowInlineKeydown = self.config.inline && isInput && !allowInput; 14998 if (e.keyCode === 13 && isInput) { 14999 if (allowInput) { 15000 self.setDate(self._input.value, true, eventTarget === self.altInput 15001 ? self.config.altFormat 15002 : self.config.dateFormat); 15003 self.close(); 15004 return eventTarget.blur(); 15005 } 15006 else { 15007 self.open(); 15008 } 15009 } 15010 else if (isCalendarElem(eventTarget) || 15011 allowKeydown || 15012 allowInlineKeydown) { 15013 var isTimeObj = !!self.timeContainer && 15014 self.timeContainer.contains(eventTarget); 15015 switch (e.keyCode) { 15016 case 13: 15017 if (isTimeObj) { 15018 e.preventDefault(); 15019 updateTime(); 15020 focusAndClose(); 15021 } 15022 else 15023 selectDate(e); 15024 break; 15025 case 27: 15026 e.preventDefault(); 15027 focusAndClose(); 15028 break; 15029 case 8: 15030 case 46: 15031 if (isInput && !self.config.allowInput) { 15032 e.preventDefault(); 15033 self.clear(); 15034 } 15035 break; 15036 case 37: 15037 case 39: 15038 if (!isTimeObj && !isInput) { 15039 e.preventDefault(); 15040 var activeElement = getClosestActiveElement(); 15041 if (self.daysContainer !== undefined && 15042 (allowInput === false || 15043 (activeElement && isInView(activeElement)))) { 15044 var delta_1 = e.keyCode === 39 ? 1 : -1; 15045 if (!e.ctrlKey) 15046 focusOnDay(undefined, delta_1); 15047 else { 15048 e.stopPropagation(); 15049 changeMonth(delta_1); 15050 focusOnDay(getFirstAvailableDay(1), 0); 15051 } 15052 } 15053 } 15054 else if (self.hourElement) 15055 self.hourElement.focus(); 15056 break; 15057 case 38: 15058 case 40: 15059 e.preventDefault(); 15060 var delta = e.keyCode === 40 ? 1 : -1; 15061 if ((self.daysContainer && 15062 eventTarget.$i !== undefined) || 15063 eventTarget === self.input || 15064 eventTarget === self.altInput) { 15065 if (e.ctrlKey) { 15066 e.stopPropagation(); 15067 changeYear(self.currentYear - delta); 15068 focusOnDay(getFirstAvailableDay(1), 0); 15069 } 15070 else if (!isTimeObj) 15071 focusOnDay(undefined, delta * 7); 15072 } 15073 else if (eventTarget === self.currentYearElement) { 15074 changeYear(self.currentYear - delta); 15075 } 15076 else if (self.config.enableTime) { 15077 if (!isTimeObj && self.hourElement) 15078 self.hourElement.focus(); 15079 updateTime(e); 15080 self._debouncedChange(); 15081 } 15082 break; 15083 case 9: 15084 if (isTimeObj) { 15085 var elems = [ 15086 self.hourElement, 15087 self.minuteElement, 15088 self.secondElement, 15089 self.amPM, 15090 ] 15091 .concat(self.pluginElements) 15092 .filter(function (x) { return x; }); 15093 var i = elems.indexOf(eventTarget); 15094 if (i !== -1) { 15095 var target = elems[i + (e.shiftKey ? -1 : 1)]; 15096 e.preventDefault(); 15097 (target || self._input).focus(); 15098 } 15099 } 15100 else if (!self.config.noCalendar && 15101 self.daysContainer && 15102 self.daysContainer.contains(eventTarget) && 15103 e.shiftKey) { 15104 e.preventDefault(); 15105 self._input.focus(); 15106 } 15107 break; 15108 default: 15109 break; 15110 } 15111 } 15112 if (self.amPM !== undefined && eventTarget === self.amPM) { 15113 switch (e.key) { 15114 case self.l10n.amPM[0].charAt(0): 15115 case self.l10n.amPM[0].charAt(0).toLowerCase(): 15116 self.amPM.textContent = self.l10n.amPM[0]; 15117 setHoursFromInputs(); 15118 updateValue(); 15119 break; 15120 case self.l10n.amPM[1].charAt(0): 15121 case self.l10n.amPM[1].charAt(0).toLowerCase(): 15122 self.amPM.textContent = self.l10n.amPM[1]; 15123 setHoursFromInputs(); 15124 updateValue(); 15125 break; 15126 } 15127 } 15128 if (isInput || isCalendarElem(eventTarget)) { 15129 triggerEvent("onKeyDown", e); 15130 } 15131 } 15132 function onMouseOver(elem, cellClass) { 15133 if (cellClass === void 0) { cellClass = "flatpickr-day"; } 15134 if (self.selectedDates.length !== 1 || 15135 (elem && 15136 (!elem.classList.contains(cellClass) || 15137 elem.classList.contains("flatpickr-disabled")))) 15138 return; 15139 var hoverDate = elem 15140 ? elem.dateObj.getTime() 15141 : self.days.firstElementChild.dateObj.getTime(), initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(), rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()), rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()); 15142 var containsDisabled = false; 15143 var minRange = 0, maxRange = 0; 15144 for (var t = rangeStartDate; t < rangeEndDate; t += _utils_dates__WEBPACK_IMPORTED_MODULE_4__["duration"].DAY) { 15145 if (!isEnabled(new Date(t), true)) { 15146 containsDisabled = 15147 containsDisabled || (t > rangeStartDate && t < rangeEndDate); 15148 if (t < initialDate && (!minRange || t > minRange)) 15149 minRange = t; 15150 else if (t > initialDate && (!maxRange || t < maxRange)) 15151 maxRange = t; 15152 } 15153 } 15154 var hoverableCells = Array.from(self.rContainer.querySelectorAll("*:nth-child(-n+" + self.config.showMonths + ") > ." + cellClass)); 15155 hoverableCells.forEach(function (dayElem) { 15156 var date = dayElem.dateObj; 15157 var timestamp = date.getTime(); 15158 var outOfRange = (minRange > 0 && timestamp < minRange) || 15159 (maxRange > 0 && timestamp > maxRange); 15160 if (outOfRange) { 15161 dayElem.classList.add("notAllowed"); 15162 ["inRange", "startRange", "endRange"].forEach(function (c) { 15163 dayElem.classList.remove(c); 15164 }); 15165 return; 15166 } 15167 else if (containsDisabled && !outOfRange) 15168 return; 15169 ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) { 15170 dayElem.classList.remove(c); 15171 }); 15172 if (elem !== undefined) { 15173 elem.classList.add(hoverDate <= self.selectedDates[0].getTime() 15174 ? "startRange" 15175 : "endRange"); 15176 if (initialDate < hoverDate && timestamp === initialDate) 15177 dayElem.classList.add("startRange"); 15178 else if (initialDate > hoverDate && timestamp === initialDate) 15179 dayElem.classList.add("endRange"); 15180 if (timestamp >= minRange && 15181 (maxRange === 0 || timestamp <= maxRange) && 15182 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["isBetween"])(timestamp, initialDate, hoverDate)) 15183 dayElem.classList.add("inRange"); 15184 } 15185 }); 15186 } 15187 function onResize() { 15188 if (self.isOpen && !self.config.static && !self.config.inline) 15189 positionCalendar(); 15190 } 15191 function open(e, positionElement) { 15192 if (positionElement === void 0) { positionElement = self._positionElement; } 15193 if (self.isMobile === true) { 15194 if (e) { 15195 e.preventDefault(); 15196 var eventTarget = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 15197 if (eventTarget) { 15198 eventTarget.blur(); 15199 } 15200 } 15201 if (self.mobileInput !== undefined) { 15202 self.mobileInput.focus(); 15203 self.mobileInput.click(); 15204 } 15205 triggerEvent("onOpen"); 15206 return; 15207 } 15208 else if (self._input.disabled || self.config.inline) { 15209 return; 15210 } 15211 var wasOpen = self.isOpen; 15212 self.isOpen = true; 15213 if (!wasOpen) { 15214 self.calendarContainer.classList.add("open"); 15215 self._input.classList.add("active"); 15216 triggerEvent("onOpen"); 15217 positionCalendar(positionElement); 15218 } 15219 if (self.config.enableTime === true && self.config.noCalendar === true) { 15220 if (self.config.allowInput === false && 15221 (e === undefined || 15222 !self.timeContainer.contains(e.relatedTarget))) { 15223 setTimeout(function () { return self.hourElement.select(); }, 50); 15224 } 15225 } 15226 } 15227 function minMaxDateSetter(type) { 15228 return function (date) { 15229 var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat)); 15230 var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"]; 15231 if (dateObj !== undefined) { 15232 self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = 15233 dateObj.getHours() > 0 || 15234 dateObj.getMinutes() > 0 || 15235 dateObj.getSeconds() > 0; 15236 } 15237 if (self.selectedDates) { 15238 self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); }); 15239 if (!self.selectedDates.length && type === "min") 15240 setHoursFromDate(dateObj); 15241 updateValue(); 15242 } 15243 if (self.daysContainer) { 15244 redraw(); 15245 if (dateObj !== undefined) 15246 self.currentYearElement[type] = dateObj.getFullYear().toString(); 15247 else 15248 self.currentYearElement.removeAttribute(type); 15249 self.currentYearElement.disabled = 15250 !!inverseDateObj && 15251 dateObj !== undefined && 15252 inverseDateObj.getFullYear() === dateObj.getFullYear(); 15253 } 15254 }; 15255 } 15256 function parseConfig() { 15257 var boolOpts = [ 15258 "wrap", 15259 "weekNumbers", 15260 "allowInput", 15261 "allowInvalidPreload", 15262 "clickOpens", 15263 "time_24hr", 15264 "enableTime", 15265 "noCalendar", 15266 "altInput", 15267 "shorthandCurrentMonth", 15268 "inline", 15269 "static", 15270 "enableSeconds", 15271 "disableMobile", 15272 ]; 15273 var userConfig = __assign(__assign({}, JSON.parse(JSON.stringify(element.dataset || {}))), instanceConfig); 15274 var formats = {}; 15275 self.config.parseDate = userConfig.parseDate; 15276 self.config.formatDate = userConfig.formatDate; 15277 Object.defineProperty(self.config, "enable", { 15278 get: function () { return self.config._enable; }, 15279 set: function (dates) { 15280 self.config._enable = parseDateRules(dates); 15281 }, 15282 }); 15283 Object.defineProperty(self.config, "disable", { 15284 get: function () { return self.config._disable; }, 15285 set: function (dates) { 15286 self.config._disable = parseDateRules(dates); 15287 }, 15288 }); 15289 var timeMode = userConfig.mode === "time"; 15290 if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) { 15291 var defaultDateFormat = flatpickr.defaultConfig.dateFormat || _types_options__WEBPACK_IMPORTED_MODULE_0__["defaults"].dateFormat; 15292 formats.dateFormat = 15293 userConfig.noCalendar || timeMode 15294 ? "H:i" + (userConfig.enableSeconds ? ":S" : "") 15295 : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : ""); 15296 } 15297 if (userConfig.altInput && 15298 (userConfig.enableTime || timeMode) && 15299 !userConfig.altFormat) { 15300 var defaultAltFormat = flatpickr.defaultConfig.altFormat || _types_options__WEBPACK_IMPORTED_MODULE_0__["defaults"].altFormat; 15301 formats.altFormat = 15302 userConfig.noCalendar || timeMode 15303 ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") 15304 : defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K"); 15305 } 15306 Object.defineProperty(self.config, "minDate", { 15307 get: function () { return self.config._minDate; }, 15308 set: minMaxDateSetter("min"), 15309 }); 15310 Object.defineProperty(self.config, "maxDate", { 15311 get: function () { return self.config._maxDate; }, 15312 set: minMaxDateSetter("max"), 15313 }); 15314 var minMaxTimeSetter = function (type) { return function (val) { 15315 self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S"); 15316 }; }; 15317 Object.defineProperty(self.config, "minTime", { 15318 get: function () { return self.config._minTime; }, 15319 set: minMaxTimeSetter("min"), 15320 }); 15321 Object.defineProperty(self.config, "maxTime", { 15322 get: function () { return self.config._maxTime; }, 15323 set: minMaxTimeSetter("max"), 15324 }); 15325 if (userConfig.mode === "time") { 15326 self.config.noCalendar = true; 15327 self.config.enableTime = true; 15328 } 15329 Object.assign(self.config, formats, userConfig); 15330 for (var i = 0; i < boolOpts.length; i++) 15331 self.config[boolOpts[i]] = 15332 self.config[boolOpts[i]] === true || 15333 self.config[boolOpts[i]] === "true"; 15334 _types_options__WEBPACK_IMPORTED_MODULE_0__["HOOKS"].filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) { 15335 self.config[hook] = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["arrayify"])(self.config[hook] || []).map(bindToInstance); 15336 }); 15337 self.isMobile = 15338 !self.config.disableMobile && 15339 !self.config.inline && 15340 self.config.mode === "single" && 15341 !self.config.disable.length && 15342 !self.config.enable && 15343 !self.config.weekNumbers && 15344 /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); 15345 for (var i = 0; i < self.config.plugins.length; i++) { 15346 var pluginConf = self.config.plugins[i](self) || {}; 15347 for (var key in pluginConf) { 15348 if (_types_options__WEBPACK_IMPORTED_MODULE_0__["HOOKS"].indexOf(key) > -1) { 15349 self.config[key] = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["arrayify"])(pluginConf[key]) 15350 .map(bindToInstance) 15351 .concat(self.config[key]); 15352 } 15353 else if (typeof userConfig[key] === "undefined") 15354 self.config[key] = pluginConf[key]; 15355 } 15356 } 15357 if (!userConfig.altInputClass) { 15358 self.config.altInputClass = 15359 getInputElem().className + " " + self.config.altInputClass; 15360 } 15361 triggerEvent("onParseConfig"); 15362 } 15363 function getInputElem() { 15364 return self.config.wrap 15365 ? element.querySelector("[data-input]") 15366 : element; 15367 } 15368 function setupLocale() { 15369 if (typeof self.config.locale !== "object" && 15370 typeof flatpickr.l10ns[self.config.locale] === "undefined") 15371 self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale)); 15372 self.l10n = __assign(__assign({}, flatpickr.l10ns.default), (typeof self.config.locale === "object" 15373 ? self.config.locale 15374 : self.config.locale !== "default" 15375 ? flatpickr.l10ns[self.config.locale] 15376 : undefined)); 15377 _utils_formatting__WEBPACK_IMPORTED_MODULE_5__["tokenRegex"].D = "(" + self.l10n.weekdays.shorthand.join("|") + ")"; 15378 _utils_formatting__WEBPACK_IMPORTED_MODULE_5__["tokenRegex"].l = "(" + self.l10n.weekdays.longhand.join("|") + ")"; 15379 _utils_formatting__WEBPACK_IMPORTED_MODULE_5__["tokenRegex"].M = "(" + self.l10n.months.shorthand.join("|") + ")"; 15380 _utils_formatting__WEBPACK_IMPORTED_MODULE_5__["tokenRegex"].F = "(" + self.l10n.months.longhand.join("|") + ")"; 15381 _utils_formatting__WEBPACK_IMPORTED_MODULE_5__["tokenRegex"].K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")"; 15382 var userConfig = __assign(__assign({}, instanceConfig), JSON.parse(JSON.stringify(element.dataset || {}))); 15383 if (userConfig.time_24hr === undefined && 15384 flatpickr.defaultConfig.time_24hr === undefined) { 15385 self.config.time_24hr = self.l10n.time_24hr; 15386 } 15387 self.formatDate = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["createDateFormatter"])(self); 15388 self.parseDate = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["createDateParser"])({ config: self.config, l10n: self.l10n }); 15389 } 15390 function positionCalendar(customPositionElement) { 15391 if (typeof self.config.position === "function") { 15392 return void self.config.position(self, customPositionElement); 15393 } 15394 if (self.calendarContainer === undefined) 15395 return; 15396 triggerEvent("onPreCalendarPosition"); 15397 var positionElement = customPositionElement || self._positionElement; 15398 var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, (function (acc, child) { return acc + child.offsetHeight; }), 0), calendarWidth = self.calendarContainer.offsetWidth, configPos = self.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" || 15399 (configPosVertical !== "below" && 15400 distanceFromBottom < calendarHeight && 15401 inputBounds.top > calendarHeight); 15402 var top = window.pageYOffset + 15403 inputBounds.top + 15404 (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2); 15405 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "arrowTop", !showOnTop); 15406 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "arrowBottom", showOnTop); 15407 if (self.config.inline) 15408 return; 15409 var left = window.pageXOffset + inputBounds.left; 15410 var isCenter = false; 15411 var isRight = false; 15412 if (configPosHorizontal === "center") { 15413 left -= (calendarWidth - inputBounds.width) / 2; 15414 isCenter = true; 15415 } 15416 else if (configPosHorizontal === "right") { 15417 left -= calendarWidth - inputBounds.width; 15418 isRight = true; 15419 } 15420 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "arrowLeft", !isCenter && !isRight); 15421 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "arrowCenter", isCenter); 15422 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "arrowRight", isRight); 15423 var right = window.document.body.offsetWidth - 15424 (window.pageXOffset + inputBounds.right); 15425 var rightMost = left + calendarWidth > window.document.body.offsetWidth; 15426 var centerMost = right + calendarWidth > window.document.body.offsetWidth; 15427 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "rightMost", rightMost); 15428 if (self.config.static) 15429 return; 15430 self.calendarContainer.style.top = top + "px"; 15431 if (!rightMost) { 15432 self.calendarContainer.style.left = left + "px"; 15433 self.calendarContainer.style.right = "auto"; 15434 } 15435 else if (!centerMost) { 15436 self.calendarContainer.style.left = "auto"; 15437 self.calendarContainer.style.right = right + "px"; 15438 } 15439 else { 15440 var doc = getDocumentStyleSheet(); 15441 if (doc === undefined) 15442 return; 15443 var bodyWidth = window.document.body.offsetWidth; 15444 var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2); 15445 var centerBefore = ".flatpickr-calendar.centerMost:before"; 15446 var centerAfter = ".flatpickr-calendar.centerMost:after"; 15447 var centerIndex = doc.cssRules.length; 15448 var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}"; 15449 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "rightMost", false); 15450 Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["toggleClass"])(self.calendarContainer, "centerMost", true); 15451 doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex); 15452 self.calendarContainer.style.left = centerLeft + "px"; 15453 self.calendarContainer.style.right = "auto"; 15454 } 15455 } 15456 function getDocumentStyleSheet() { 15457 var editableSheet = null; 15458 for (var i = 0; i < document.styleSheets.length; i++) { 15459 var sheet = document.styleSheets[i]; 15460 if (!sheet.cssRules) 15461 continue; 15462 try { 15463 sheet.cssRules; 15464 } 15465 catch (err) { 15466 continue; 15467 } 15468 editableSheet = sheet; 15469 break; 15470 } 15471 return editableSheet != null ? editableSheet : createStyleSheet(); 15472 } 15473 function createStyleSheet() { 15474 var style = document.createElement("style"); 15475 document.head.appendChild(style); 15476 return style.sheet; 15477 } 15478 function redraw() { 15479 if (self.config.noCalendar || self.isMobile) 15480 return; 15481 buildMonthSwitch(); 15482 updateNavigationCurrentMonth(); 15483 buildDays(); 15484 } 15485 function focusAndClose() { 15486 self._input.focus(); 15487 if (window.navigator.userAgent.indexOf("MSIE") !== -1 || 15488 navigator.msMaxTouchPoints !== undefined) { 15489 setTimeout(self.close, 0); 15490 } 15491 else { 15492 self.close(); 15493 } 15494 } 15495 function selectDate(e) { 15496 e.preventDefault(); 15497 e.stopPropagation(); 15498 var isSelectable = function (day) { 15499 return day.classList && 15500 day.classList.contains("flatpickr-day") && 15501 !day.classList.contains("flatpickr-disabled") && 15502 !day.classList.contains("notAllowed"); 15503 }; 15504 var t = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["findParent"])(Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e), isSelectable); 15505 if (t === undefined) 15506 return; 15507 var target = t; 15508 var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime())); 15509 var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || 15510 selectedDate.getMonth() > 15511 self.currentMonth + self.config.showMonths - 1) && 15512 self.config.mode !== "range"; 15513 self.selectedDateElem = target; 15514 if (self.config.mode === "single") 15515 self.selectedDates = [selectedDate]; 15516 else if (self.config.mode === "multiple") { 15517 var selectedIndex = isDateSelected(selectedDate); 15518 if (selectedIndex) 15519 self.selectedDates.splice(parseInt(selectedIndex), 1); 15520 else 15521 self.selectedDates.push(selectedDate); 15522 } 15523 else if (self.config.mode === "range") { 15524 if (self.selectedDates.length === 2) { 15525 self.clear(false, false); 15526 } 15527 self.latestSelectedDateObj = selectedDate; 15528 self.selectedDates.push(selectedDate); 15529 if (Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(selectedDate, self.selectedDates[0], true) !== 0) 15530 self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); 15531 } 15532 setHoursFromInputs(); 15533 if (shouldChangeMonth) { 15534 var isNewYear = self.currentYear !== selectedDate.getFullYear(); 15535 self.currentYear = selectedDate.getFullYear(); 15536 self.currentMonth = selectedDate.getMonth(); 15537 if (isNewYear) { 15538 triggerEvent("onYearChange"); 15539 buildMonthSwitch(); 15540 } 15541 triggerEvent("onMonthChange"); 15542 } 15543 updateNavigationCurrentMonth(); 15544 buildDays(); 15545 updateValue(); 15546 if (!shouldChangeMonth && 15547 self.config.mode !== "range" && 15548 self.config.showMonths === 1) 15549 focusOnDayElem(target); 15550 else if (self.selectedDateElem !== undefined && 15551 self.hourElement === undefined) { 15552 self.selectedDateElem && self.selectedDateElem.focus(); 15553 } 15554 if (self.hourElement !== undefined) 15555 self.hourElement !== undefined && self.hourElement.focus(); 15556 if (self.config.closeOnSelect) { 15557 var single = self.config.mode === "single" && !self.config.enableTime; 15558 var range = self.config.mode === "range" && 15559 self.selectedDates.length === 2 && 15560 !self.config.enableTime; 15561 if (single || range) { 15562 focusAndClose(); 15563 } 15564 } 15565 triggerChange(); 15566 } 15567 var CALLBACKS = { 15568 locale: [setupLocale, updateWeekdays], 15569 showMonths: [buildMonths, setCalendarWidth, buildWeekdays], 15570 minDate: [jumpToDate], 15571 maxDate: [jumpToDate], 15572 positionElement: [updatePositionElement], 15573 clickOpens: [ 15574 function () { 15575 if (self.config.clickOpens === true) { 15576 bind(self._input, "focus", self.open); 15577 bind(self._input, "click", self.open); 15578 } 15579 else { 15580 self._input.removeEventListener("focus", self.open); 15581 self._input.removeEventListener("click", self.open); 15582 } 15583 }, 15584 ], 15585 }; 15586 function set(option, value) { 15587 if (option !== null && typeof option === "object") { 15588 Object.assign(self.config, option); 15589 for (var key in option) { 15590 if (CALLBACKS[key] !== undefined) 15591 CALLBACKS[key].forEach(function (x) { return x(); }); 15592 } 15593 } 15594 else { 15595 self.config[option] = value; 15596 if (CALLBACKS[option] !== undefined) 15597 CALLBACKS[option].forEach(function (x) { return x(); }); 15598 else if (_types_options__WEBPACK_IMPORTED_MODULE_0__["HOOKS"].indexOf(option) > -1) 15599 self.config[option] = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["arrayify"])(value); 15600 } 15601 self.redraw(); 15602 updateValue(true); 15603 } 15604 function setSelectedDate(inputDate, format) { 15605 var dates = []; 15606 if (inputDate instanceof Array) 15607 dates = inputDate.map(function (d) { return self.parseDate(d, format); }); 15608 else if (inputDate instanceof Date || typeof inputDate === "number") 15609 dates = [self.parseDate(inputDate, format)]; 15610 else if (typeof inputDate === "string") { 15611 switch (self.config.mode) { 15612 case "single": 15613 case "time": 15614 dates = [self.parseDate(inputDate, format)]; 15615 break; 15616 case "multiple": 15617 dates = inputDate 15618 .split(self.config.conjunction) 15619 .map(function (date) { return self.parseDate(date, format); }); 15620 break; 15621 case "range": 15622 dates = inputDate 15623 .split(self.l10n.rangeSeparator) 15624 .map(function (date) { return self.parseDate(date, format); }); 15625 break; 15626 default: 15627 break; 15628 } 15629 } 15630 else 15631 self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate))); 15632 self.selectedDates = (self.config.allowInvalidPreload 15633 ? dates 15634 : dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); })); 15635 if (self.config.mode === "range") 15636 self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); }); 15637 } 15638 function setDate(date, triggerChange, format) { 15639 if (triggerChange === void 0) { triggerChange = false; } 15640 if (format === void 0) { format = self.config.dateFormat; } 15641 if ((date !== 0 && !date) || (date instanceof Array && date.length === 0)) 15642 return self.clear(triggerChange); 15643 setSelectedDate(date, format); 15644 self.latestSelectedDateObj = 15645 self.selectedDates[self.selectedDates.length - 1]; 15646 self.redraw(); 15647 jumpToDate(undefined, triggerChange); 15648 setHoursFromDate(); 15649 if (self.selectedDates.length === 0) { 15650 self.clear(false); 15651 } 15652 updateValue(triggerChange); 15653 if (triggerChange) 15654 triggerEvent("onChange"); 15655 } 15656 function parseDateRules(arr) { 15657 return arr 15658 .slice() 15659 .map(function (rule) { 15660 if (typeof rule === "string" || 15661 typeof rule === "number" || 15662 rule instanceof Date) { 15663 return self.parseDate(rule, undefined, true); 15664 } 15665 else if (rule && 15666 typeof rule === "object" && 15667 rule.from && 15668 rule.to) 15669 return { 15670 from: self.parseDate(rule.from, undefined), 15671 to: self.parseDate(rule.to, undefined), 15672 }; 15673 return rule; 15674 }) 15675 .filter(function (x) { return x; }); 15676 } 15677 function setupDates() { 15678 self.selectedDates = []; 15679 self.now = self.parseDate(self.config.now) || new Date(); 15680 var preloadedDate = self.config.defaultDate || 15681 ((self.input.nodeName === "INPUT" || 15682 self.input.nodeName === "TEXTAREA") && 15683 self.input.placeholder && 15684 self.input.value === self.input.placeholder 15685 ? null 15686 : self.input.value); 15687 if (preloadedDate) 15688 setSelectedDate(preloadedDate, self.config.dateFormat); 15689 self._initialDate = 15690 self.selectedDates.length > 0 15691 ? self.selectedDates[0] 15692 : self.config.minDate && 15693 self.config.minDate.getTime() > self.now.getTime() 15694 ? self.config.minDate 15695 : self.config.maxDate && 15696 self.config.maxDate.getTime() < self.now.getTime() 15697 ? self.config.maxDate 15698 : self.now; 15699 self.currentYear = self._initialDate.getFullYear(); 15700 self.currentMonth = self._initialDate.getMonth(); 15701 if (self.selectedDates.length > 0) 15702 self.latestSelectedDateObj = self.selectedDates[0]; 15703 if (self.config.minTime !== undefined) 15704 self.config.minTime = self.parseDate(self.config.minTime, "H:i"); 15705 if (self.config.maxTime !== undefined) 15706 self.config.maxTime = self.parseDate(self.config.maxTime, "H:i"); 15707 self.minDateHasTime = 15708 !!self.config.minDate && 15709 (self.config.minDate.getHours() > 0 || 15710 self.config.minDate.getMinutes() > 0 || 15711 self.config.minDate.getSeconds() > 0); 15712 self.maxDateHasTime = 15713 !!self.config.maxDate && 15714 (self.config.maxDate.getHours() > 0 || 15715 self.config.maxDate.getMinutes() > 0 || 15716 self.config.maxDate.getSeconds() > 0); 15717 } 15718 function setupInputs() { 15719 self.input = getInputElem(); 15720 if (!self.input) { 15721 self.config.errorHandler(new Error("Invalid input element specified")); 15722 return; 15723 } 15724 self.input._type = self.input.type; 15725 self.input.type = "text"; 15726 self.input.classList.add("flatpickr-input"); 15727 self._input = self.input; 15728 if (self.config.altInput) { 15729 self.altInput = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])(self.input.nodeName, self.config.altInputClass); 15730 self._input = self.altInput; 15731 self.altInput.placeholder = self.input.placeholder; 15732 self.altInput.disabled = self.input.disabled; 15733 self.altInput.required = self.input.required; 15734 self.altInput.tabIndex = self.input.tabIndex; 15735 self.altInput.type = "text"; 15736 self.input.setAttribute("type", "hidden"); 15737 if (!self.config.static && self.input.parentNode) 15738 self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling); 15739 } 15740 if (!self.config.allowInput) 15741 self._input.setAttribute("readonly", "readonly"); 15742 updatePositionElement(); 15743 } 15744 function updatePositionElement() { 15745 self._positionElement = self.config.positionElement || self._input; 15746 } 15747 function setupMobile() { 15748 var inputType = self.config.enableTime 15749 ? self.config.noCalendar 15750 ? "time" 15751 : "datetime-local" 15752 : "date"; 15753 self.mobileInput = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["createElement"])("input", self.input.className + " flatpickr-mobile"); 15754 self.mobileInput.tabIndex = 1; 15755 self.mobileInput.type = inputType; 15756 self.mobileInput.disabled = self.input.disabled; 15757 self.mobileInput.required = self.input.required; 15758 self.mobileInput.placeholder = self.input.placeholder; 15759 self.mobileFormatStr = 15760 inputType === "datetime-local" 15761 ? "Y-m-d\\TH:i:S" 15762 : inputType === "date" 15763 ? "Y-m-d" 15764 : "H:i:S"; 15765 if (self.selectedDates.length > 0) { 15766 self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr); 15767 } 15768 if (self.config.minDate) 15769 self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d"); 15770 if (self.config.maxDate) 15771 self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d"); 15772 if (self.input.getAttribute("step")) 15773 self.mobileInput.step = String(self.input.getAttribute("step")); 15774 self.input.type = "hidden"; 15775 if (self.altInput !== undefined) 15776 self.altInput.type = "hidden"; 15777 try { 15778 if (self.input.parentNode) 15779 self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling); 15780 } 15781 catch (_a) { } 15782 bind(self.mobileInput, "change", function (e) { 15783 self.setDate(Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e).value, false, self.mobileFormatStr); 15784 triggerEvent("onChange"); 15785 triggerEvent("onClose"); 15786 }); 15787 } 15788 function toggle(e) { 15789 if (self.isOpen === true) 15790 return self.close(); 15791 self.open(e); 15792 } 15793 function triggerEvent(event, data) { 15794 if (self.config === undefined) 15795 return; 15796 var hooks = self.config[event]; 15797 if (hooks !== undefined && hooks.length > 0) { 15798 for (var i = 0; hooks[i] && i < hooks.length; i++) 15799 hooks[i](self.selectedDates, self.input.value, self, data); 15800 } 15801 if (event === "onChange") { 15802 self.input.dispatchEvent(createEvent("change")); 15803 self.input.dispatchEvent(createEvent("input")); 15804 } 15805 } 15806 function createEvent(name) { 15807 var e = document.createEvent("Event"); 15808 e.initEvent(name, true, true); 15809 return e; 15810 } 15811 function isDateSelected(date) { 15812 for (var i = 0; i < self.selectedDates.length; i++) { 15813 var selectedDate = self.selectedDates[i]; 15814 if (selectedDate instanceof Date && 15815 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(selectedDate, date) === 0) 15816 return "" + i; 15817 } 15818 return false; 15819 } 15820 function isDateInRange(date) { 15821 if (self.config.mode !== "range" || self.selectedDates.length < 2) 15822 return false; 15823 return (Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(date, self.selectedDates[0]) >= 0 && 15824 Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"])(date, self.selectedDates[1]) <= 0); 15825 } 15826 function updateNavigationCurrentMonth() { 15827 if (self.config.noCalendar || self.isMobile || !self.monthNav) 15828 return; 15829 self.yearElements.forEach(function (yearElement, i) { 15830 var d = new Date(self.currentYear, self.currentMonth, 1); 15831 d.setMonth(self.currentMonth + i); 15832 if (self.config.showMonths > 1 || 15833 self.config.monthSelectorType === "static") { 15834 self.monthElements[i].textContent = 15835 Object(_utils_formatting__WEBPACK_IMPORTED_MODULE_5__["monthToStr"])(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " "; 15836 } 15837 else { 15838 self.monthsDropdownContainer.value = d.getMonth().toString(); 15839 } 15840 yearElement.value = d.getFullYear().toString(); 15841 }); 15842 self._hidePrevMonthArrow = 15843 self.config.minDate !== undefined && 15844 (self.currentYear === self.config.minDate.getFullYear() 15845 ? self.currentMonth <= self.config.minDate.getMonth() 15846 : self.currentYear < self.config.minDate.getFullYear()); 15847 self._hideNextMonthArrow = 15848 self.config.maxDate !== undefined && 15849 (self.currentYear === self.config.maxDate.getFullYear() 15850 ? self.currentMonth + 1 > self.config.maxDate.getMonth() 15851 : self.currentYear > self.config.maxDate.getFullYear()); 15852 } 15853 function getDateStr(specificFormat) { 15854 var format = specificFormat || 15855 (self.config.altInput ? self.config.altFormat : self.config.dateFormat); 15856 return self.selectedDates 15857 .map(function (dObj) { return self.formatDate(dObj, format); }) 15858 .filter(function (d, i, arr) { 15859 return self.config.mode !== "range" || 15860 self.config.enableTime || 15861 arr.indexOf(d) === i; 15862 }) 15863 .join(self.config.mode !== "range" 15864 ? self.config.conjunction 15865 : self.l10n.rangeSeparator); 15866 } 15867 function updateValue(triggerChange) { 15868 if (triggerChange === void 0) { triggerChange = true; } 15869 if (self.mobileInput !== undefined && self.mobileFormatStr) { 15870 self.mobileInput.value = 15871 self.latestSelectedDateObj !== undefined 15872 ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) 15873 : ""; 15874 } 15875 self.input.value = getDateStr(self.config.dateFormat); 15876 if (self.altInput !== undefined) { 15877 self.altInput.value = getDateStr(self.config.altFormat); 15878 } 15879 if (triggerChange !== false) 15880 triggerEvent("onValueUpdate"); 15881 } 15882 function onMonthNavClick(e) { 15883 var eventTarget = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e); 15884 var isPrevMonth = self.prevMonthNav.contains(eventTarget); 15885 var isNextMonth = self.nextMonthNav.contains(eventTarget); 15886 if (isPrevMonth || isNextMonth) { 15887 changeMonth(isPrevMonth ? -1 : 1); 15888 } 15889 else if (self.yearElements.indexOf(eventTarget) >= 0) { 15890 eventTarget.select(); 15891 } 15892 else if (eventTarget.classList.contains("arrowUp")) { 15893 self.changeYear(self.currentYear + 1); 15894 } 15895 else if (eventTarget.classList.contains("arrowDown")) { 15896 self.changeYear(self.currentYear - 1); 15897 } 15898 } 15899 function timeWrapper(e) { 15900 e.preventDefault(); 15901 var isKeyDown = e.type === "keydown", eventTarget = Object(_utils_dom__WEBPACK_IMPORTED_MODULE_3__["getEventTarget"])(e), input = eventTarget; 15902 if (self.amPM !== undefined && eventTarget === self.amPM) { 15903 self.amPM.textContent = 15904 self.l10n.amPM[Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(self.amPM.textContent === self.l10n.amPM[0])]; 15905 } 15906 var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || 15907 (isKeyDown ? (e.which === 38 ? 1 : -1) : 0); 15908 var newValue = curValue + step * delta; 15909 if (typeof input.value !== "undefined" && input.value.length === 2) { 15910 var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement; 15911 if (newValue < min) { 15912 newValue = 15913 max + 15914 newValue + 15915 Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(!isHourElem) + 15916 (Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(isHourElem) && Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(!self.amPM)); 15917 if (isMinuteElem) 15918 incrementNumInput(undefined, -1, self.hourElement); 15919 } 15920 else if (newValue > max) { 15921 newValue = 15922 input === self.hourElement ? newValue - max - Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(!self.amPM) : min; 15923 if (isMinuteElem) 15924 incrementNumInput(undefined, 1, self.hourElement); 15925 } 15926 if (self.amPM && 15927 isHourElem && 15928 (step === 1 15929 ? newValue + curValue === 23 15930 : Math.abs(newValue - curValue) > step)) { 15931 self.amPM.textContent = 15932 self.l10n.amPM[Object(_utils__WEBPACK_IMPORTED_MODULE_2__["int"])(self.amPM.textContent === self.l10n.amPM[0])]; 15933 } 15934 input.value = Object(_utils__WEBPACK_IMPORTED_MODULE_2__["pad"])(newValue); 15935 } 15936 } 15937 init(); 15938 return self; 15939} 15940function _flatpickr(nodeList, config) { 15941 var nodes = Array.prototype.slice 15942 .call(nodeList) 15943 .filter(function (x) { return x instanceof HTMLElement; }); 15944 var instances = []; 15945 for (var i = 0; i < nodes.length; i++) { 15946 var node = nodes[i]; 15947 try { 15948 if (node.getAttribute("data-fp-omit") !== null) 15949 continue; 15950 if (node._flatpickr !== undefined) { 15951 node._flatpickr.destroy(); 15952 node._flatpickr = undefined; 15953 } 15954 node._flatpickr = FlatpickrInstance(node, config || {}); 15955 instances.push(node._flatpickr); 15956 } 15957 catch (e) { 15958 console.error(e); 15959 } 15960 } 15961 return instances.length === 1 ? instances[0] : instances; 15962} 15963if (typeof HTMLElement !== "undefined" && 15964 typeof HTMLCollection !== "undefined" && 15965 typeof NodeList !== "undefined") { 15966 HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) { 15967 return _flatpickr(this, config); 15968 }; 15969 HTMLElement.prototype.flatpickr = function (config) { 15970 return _flatpickr([this], config); 15971 }; 15972} 15973var flatpickr = function (selector, config) { 15974 if (typeof selector === "string") { 15975 return _flatpickr(window.document.querySelectorAll(selector), config); 15976 } 15977 else if (selector instanceof Node) { 15978 return _flatpickr([selector], config); 15979 } 15980 else { 15981 return _flatpickr(selector, config); 15982 } 15983}; 15984flatpickr.defaultConfig = {}; 15985flatpickr.l10ns = { 15986 en: __assign({}, _l10n_default__WEBPACK_IMPORTED_MODULE_1__["default"]), 15987 default: __assign({}, _l10n_default__WEBPACK_IMPORTED_MODULE_1__["default"]), 15988}; 15989flatpickr.localize = function (l10n) { 15990 flatpickr.l10ns.default = __assign(__assign({}, flatpickr.l10ns.default), l10n); 15991}; 15992flatpickr.setDefaults = function (config) { 15993 flatpickr.defaultConfig = __assign(__assign({}, flatpickr.defaultConfig), config); 15994}; 15995flatpickr.parseDate = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["createDateParser"])({}); 15996flatpickr.formatDate = Object(_utils_dates__WEBPACK_IMPORTED_MODULE_4__["createDateFormatter"])({}); 15997flatpickr.compareDates = _utils_dates__WEBPACK_IMPORTED_MODULE_4__["compareDates"]; 15998if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") { 15999 jQuery.fn.flatpickr = function (config) { 16000 return _flatpickr(this, config); 16001 }; 16002} 16003Date.prototype.fp_incr = function (days) { 16004 return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days)); 16005}; 16006if (typeof window !== "undefined") { 16007 window.flatpickr = flatpickr; 16008} 16009/* harmony default export */ __webpack_exports__["default"] = (flatpickr); 16010 16011 16012/***/ }), 16013
vendor: 2,236 bytes, lines 16014-16099
16014/***/ "./node_modules/flatpickr/dist/esm/l10n/default.js": 16015/*!*********************************************************!*\ 16016 !*** ./node_modules/flatpickr/dist/esm/l10n/default.js ***! 16017 \*********************************************************/ 16018/*! exports provided: english, default */ 16019/***/ (function(module, __webpack_exports__, __webpack_require__) { 16020 16021"use strict"; 16022__webpack_require__.r(__webpack_exports__); 16023/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "english", function() { return english; }); 16024var english = { 16025 weekdays: { 16026 shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], 16027 longhand: [ 16028 "Sunday", 16029 "Monday", 16030 "Tuesday", 16031 "Wednesday", 16032 "Thursday", 16033 "Friday", 16034 "Saturday", 16035 ], 16036 }, 16037 months: { 16038 shorthand: [ 16039 "Jan", 16040 "Feb", 16041 "Mar", 16042 "Apr", 16043 "May", 16044 "Jun", 16045 "Jul", 16046 "Aug", 16047 "Sep", 16048 "Oct", 16049 "Nov", 16050 "Dec", 16051 ], 16052 longhand: [ 16053 "January", 16054 "February", 16055 "March", 16056 "April", 16057 "May", 16058 "June", 16059 "July", 16060 "August", 16061 "September", 16062 "October", 16063 "November", 16064 "December", 16065 ], 16066 }, 16067 daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], 16068 firstDayOfWeek: 0, 16069 ordinal: function (nth) { 16070 var s = nth % 100; 16071 if (s > 3 && s < 21) 16072 return "th"; 16073 switch (s % 10) { 16074 case 1: 16075 return "st"; 16076 case 2: 16077 return "nd"; 16078 case 3: 16079 return "rd"; 16080 default: 16081 return "th"; 16082 } 16083 }, 16084 rangeSeparator: " to ", 16085 weekAbbreviation: "Wk", 16086 scrollTitle: "Scroll to increment", 16087 toggleTitle: "Click to toggle", 16088 amPM: ["AM", "PM"], 16089 yearAriaLabel: "Year", 16090 monthAriaLabel: "Month", 16091 hourAriaLabel: "Hour", 16092 minuteAriaLabel: "Minute", 16093 time_24hr: false, 16094}; 16095/* harmony default export */ __webpack_exports__["default"] = (english); 16096 16097 16098/***/ }), 16099
vendor: 3,215 bytes, lines 16100-16197
16100/***/ "./node_modules/flatpickr/dist/esm/types/options.js": 16101/*!**********************************************************!*\ 16102 !*** ./node_modules/flatpickr/dist/esm/types/options.js ***! 16103 \**********************************************************/ 16104/*! exports provided: HOOKS, defaults */ 16105/***/ (function(module, __webpack_exports__, __webpack_require__) { 16106 16107"use strict"; 16108__webpack_require__.r(__webpack_exports__); 16109/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "HOOKS", function() { return HOOKS; }); 16110/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "defaults", function() { return defaults; }); 16111var HOOKS = [ 16112 "onChange", 16113 "onClose", 16114 "onDayCreate", 16115 "onDestroy", 16116 "onKeyDown", 16117 "onMonthChange", 16118 "onOpen", 16119 "onParseConfig", 16120 "onReady", 16121 "onValueUpdate", 16122 "onYearChange", 16123 "onPreCalendarPosition", 16124]; 16125var defaults = { 16126 _disable: [], 16127 allowInput: false, 16128 allowInvalidPreload: false, 16129 altFormat: "F j, Y", 16130 altInput: false, 16131 altInputClass: "form-control input", 16132 animate: typeof window === "object" && 16133 window.navigator.userAgent.indexOf("MSIE") === -1, 16134 ariaDateFormat: "F j, Y", 16135 autoFillDefaultTime: true, 16136 clickOpens: true, 16137 closeOnSelect: true, 16138 conjunction: ", ", 16139 dateFormat: "Y-m-d", 16140 defaultHour: 12, 16141 defaultMinute: 0, 16142 defaultSeconds: 0, 16143 disable: [], 16144 disableMobile: false, 16145 enableSeconds: false, 16146 enableTime: false, 16147 errorHandler: function (err) { 16148 return typeof console !== "undefined" && console.warn(err); 16149 }, 16150 getWeek: function (givenDate) { 16151 var date = new Date(givenDate.getTime()); 16152 date.setHours(0, 0, 0, 0); 16153 date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7)); 16154 var week1 = new Date(date.getFullYear(), 0, 4); 16155 return (1 + 16156 Math.round(((date.getTime() - week1.getTime()) / 86400000 - 16157 3 + 16158 ((week1.getDay() + 6) % 7)) / 16159 7)); 16160 }, 16161 hourIncrement: 1, 16162 ignoredFocusElements: [], 16163 inline: false, 16164 locale: "default", 16165 minuteIncrement: 5, 16166 mode: "single", 16167 monthSelectorType: "dropdown", 16168 nextArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>", 16169 noCalendar: false, 16170 now: new Date(), 16171 onChange: [], 16172 onClose: [], 16173 onDayCreate: [], 16174 onDestroy: [], 16175 onKeyDown: [], 16176 onMonthChange: [], 16177 onOpen: [], 16178 onParseConfig: [], 16179 onReady: [], 16180 onValueUpdate: [], 16181 onYearChange: [], 16182 onPreCalendarPosition: [], 16183 plugins: [], 16184 position: "auto", 16185 positionElement: undefined, 16186 prevArrow: "<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>", 16187 shorthandCurrentMonth: false, 16188 showMonths: 1, 16189 static: false, 16190 time_24hr: false, 16191 weekNumbers: false, 16192 wrap: false, 16193}; 16194 16195 16196/***/ }), 16197
vendor: 8,519 bytes, lines 16198-16365
16198/***/ "./node_modules/flatpickr/dist/esm/utils/dates.js": 16199/*!********************************************************!*\ 16200 !*** ./node_modules/flatpickr/dist/esm/utils/dates.js ***! 16201 \********************************************************/ 16202/*! exports provided: createDateFormatter, createDateParser, compareDates, compareTimes, isBetween, calculateSecondsSinceMidnight, parseSeconds, duration, getDefaultHours */ 16203/***/ (function(module, __webpack_exports__, __webpack_require__) { 16204 16205"use strict"; 16206__webpack_require__.r(__webpack_exports__); 16207/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDateFormatter", function() { return createDateFormatter; }); 16208/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createDateParser", function() { return createDateParser; }); 16209/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareDates", function() { return compareDates; }); 16210/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "compareTimes", function() { return compareTimes; }); 16211/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isBetween", function() { return isBetween; }); 16212/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "calculateSecondsSinceMidnight", function() { return calculateSecondsSinceMidnight; }); 16213/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "parseSeconds", function() { return parseSeconds; }); 16214/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "duration", function() { return duration; }); 16215/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDefaultHours", function() { return getDefaultHours; }); 16216/* harmony import */ var _formatting__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./formatting */ "./node_modules/flatpickr/dist/esm/utils/formatting.js"); 16217/* harmony import */ var _types_options__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types/options */ "./node_modules/flatpickr/dist/esm/types/options.js"); 16218/* harmony import */ var _l10n_default__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../l10n/default */ "./node_modules/flatpickr/dist/esm/l10n/default.js"); 16219 16220 16221 16222var createDateFormatter = function (_a) { 16223 var _b = _a.config, config = _b === void 0 ? _types_options__WEBPACK_IMPORTED_MODULE_1__["defaults"] : _b, _c = _a.l10n, l10n = _c === void 0 ? _l10n_default__WEBPACK_IMPORTED_MODULE_2__["english"] : _c, _d = _a.isMobile, isMobile = _d === void 0 ? false : _d; 16224 return function (dateObj, frmt, overrideLocale) { 16225 var locale = overrideLocale || l10n; 16226 if (config.formatDate !== undefined && !isMobile) { 16227 return config.formatDate(dateObj, frmt, locale); 16228 } 16229 return frmt 16230 .split("") 16231 .map(function (c, i, arr) { 16232 return _formatting__WEBPACK_IMPORTED_MODULE_0__["formats"][c] && arr[i - 1] !== "\\" 16233 ? _formatting__WEBPACK_IMPORTED_MODULE_0__["formats"][c](dateObj, locale, config) 16234 : c !== "\\" 16235 ? c 16236 : ""; 16237 }) 16238 .join(""); 16239 }; 16240}; 16241var createDateParser = function (_a) { 16242 var _b = _a.config, config = _b === void 0 ? _types_options__WEBPACK_IMPORTED_MODULE_1__["defaults"] : _b, _c = _a.l10n, l10n = _c === void 0 ? _l10n_default__WEBPACK_IMPORTED_MODULE_2__["english"] : _c; 16243 return function (date, givenFormat, timeless, customLocale) { 16244 if (date !== 0 && !date) 16245 return undefined; 16246 var locale = customLocale || l10n; 16247 var parsedDate; 16248 var dateOrig = date; 16249 if (date instanceof Date) 16250 parsedDate = new Date(date.getTime()); 16251 else if (typeof date !== "string" && 16252 date.toFixed !== undefined) 16253 parsedDate = new Date(date); 16254 else if (typeof date === "string") { 16255 var format = givenFormat || (config || _types_options__WEBPACK_IMPORTED_MODULE_1__["defaults"]).dateFormat; 16256 var datestr = String(date).trim(); 16257 if (datestr === "today") { 16258 parsedDate = new Date(); 16259 timeless = true; 16260 } 16261 else if (config && config.parseDate) { 16262 parsedDate = config.parseDate(date, format); 16263 } 16264 else if (/Z$/.test(datestr) || 16265 /GMT$/.test(datestr)) { 16266 parsedDate = new Date(date); 16267 } 16268 else { 16269 var matched = void 0, ops = []; 16270 for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) { 16271 var token = format[i]; 16272 var isBackSlash = token === "\\"; 16273 var escaped = format[i - 1] === "\\" || isBackSlash; 16274 if (_formatting__WEBPACK_IMPORTED_MODULE_0__["tokenRegex"][token] && !escaped) { 16275 regexStr += _formatting__WEBPACK_IMPORTED_MODULE_0__["tokenRegex"][token]; 16276 var match = new RegExp(regexStr).exec(date); 16277 if (match && (matched = true)) { 16278 ops[token !== "Y" ? "push" : "unshift"]({ 16279 fn: _formatting__WEBPACK_IMPORTED_MODULE_0__["revFormat"][token], 16280 val: match[++matchIndex], 16281 }); 16282 } 16283 } 16284 else if (!isBackSlash) 16285 regexStr += "."; 16286 } 16287 parsedDate = 16288 !config || !config.noCalendar 16289 ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) 16290 : new Date(new Date().setHours(0, 0, 0, 0)); 16291 ops.forEach(function (_a) { 16292 var fn = _a.fn, val = _a.val; 16293 return (parsedDate = fn(parsedDate, val, locale) || parsedDate); 16294 }); 16295 parsedDate = matched ? parsedDate : undefined; 16296 } 16297 } 16298 if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) { 16299 config.errorHandler(new Error("Invalid date provided: " + dateOrig)); 16300 return undefined; 16301 } 16302 if (timeless === true) 16303 parsedDate.setHours(0, 0, 0, 0); 16304 return parsedDate; 16305 }; 16306}; 16307function compareDates(date1, date2, timeless) { 16308 if (timeless === void 0) { timeless = true; } 16309 if (timeless !== false) { 16310 return (new Date(date1.getTime()).setHours(0, 0, 0, 0) - 16311 new Date(date2.getTime()).setHours(0, 0, 0, 0)); 16312 } 16313 return date1.getTime() - date2.getTime(); 16314} 16315function compareTimes(date1, date2) { 16316 return (3600 * (date1.getHours() - date2.getHours()) + 16317 60 * (date1.getMinutes() - date2.getMinutes()) + 16318 date1.getSeconds() - 16319 date2.getSeconds()); 16320} 16321var isBetween = function (ts, ts1, ts2) { 16322 return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2); 16323}; 16324var calculateSecondsSinceMidnight = function (hours, minutes, seconds) { 16325 return hours * 3600 + minutes * 60 + seconds; 16326}; 16327var parseSeconds = function (secondsSinceMidnight) { 16328 var hours = Math.floor(secondsSinceMidnight / 3600), minutes = (secondsSinceMidnight - hours * 3600) / 60; 16329 return [hours, minutes, secondsSinceMidnight - hours * 3600 - minutes * 60]; 16330}; 16331var duration = { 16332 DAY: 86400000, 16333}; 16334function getDefaultHours(config) { 16335 var hours = config.defaultHour; 16336 var minutes = config.defaultMinute; 16337 var seconds = config.defaultSeconds; 16338 if (config.minDate !== undefined) { 16339 var minHour = config.minDate.getHours(); 16340 var minMinutes = config.minDate.getMinutes(); 16341 var minSeconds = config.minDate.getSeconds(); 16342 if (hours < minHour) { 16343 hours = minHour; 16344 } 16345 if (hours === minHour && minutes < minMinutes) { 16346 minutes = minMinutes; 16347 } 16348 if (hours === minHour && minutes === minMinutes && seconds < minSeconds) 16349 seconds = config.minDate.getSeconds(); 16350 } 16351 if (config.maxDate !== undefined) { 16352 var maxHr = config.maxDate.getHours(); 16353 var maxMinutes = config.maxDate.getMinutes(); 16354 hours = Math.min(hours, maxHr); 16355 if (hours === maxHr) 16356 minutes = Math.min(maxMinutes, minutes); 16357 if (hours === maxHr && minutes === maxMinutes) 16358 seconds = config.maxDate.getSeconds(); 16359 } 16360 return { hours: hours, minutes: minutes, seconds: seconds }; 16361} 16362 16363 16364/***/ }), 16365
vendor: 2,934 bytes, lines 16366-16438
16366/***/ "./node_modules/flatpickr/dist/esm/utils/dom.js": 16367/*!******************************************************!*\ 16368 !*** ./node_modules/flatpickr/dist/esm/utils/dom.js ***! 16369 \******************************************************/ 16370/*! exports provided: toggleClass, createElement, clearNode, findParent, createNumberInput, getEventTarget */ 16371/***/ (function(module, __webpack_exports__, __webpack_require__) { 16372 16373"use strict"; 16374__webpack_require__.r(__webpack_exports__); 16375/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "toggleClass", function() { return toggleClass; }); 16376/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createElement", function() { return createElement; }); 16377/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "clearNode", function() { return clearNode; }); 16378/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "findParent", function() { return findParent; }); 16379/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "createNumberInput", function() { return createNumberInput; }); 16380/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getEventTarget", function() { return getEventTarget; }); 16381function toggleClass(elem, className, bool) { 16382 if (bool === true) 16383 return elem.classList.add(className); 16384 elem.classList.remove(className); 16385} 16386function createElement(tag, className, content) { 16387 var e = window.document.createElement(tag); 16388 className = className || ""; 16389 content = content || ""; 16390 e.className = className; 16391 if (content !== undefined) 16392 e.textContent = content; 16393 return e; 16394} 16395function clearNode(node) { 16396 while (node.firstChild) 16397 node.removeChild(node.firstChild); 16398} 16399function findParent(node, condition) { 16400 if (condition(node)) 16401 return node; 16402 else if (node.parentNode) 16403 return findParent(node.parentNode, condition); 16404 return undefined; 16405} 16406function createNumberInput(inputClassName, opts) { 16407 var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown"); 16408 if (navigator.userAgent.indexOf("MSIE 9.0") === -1) { 16409 numInput.type = "number"; 16410 } 16411 else { 16412 numInput.type = "text"; 16413 numInput.pattern = "\\d*"; 16414 } 16415 if (opts !== undefined) 16416 for (var key in opts) 16417 numInput.setAttribute(key, opts[key]); 16418 wrapper.appendChild(numInput); 16419 wrapper.appendChild(arrowUp); 16420 wrapper.appendChild(arrowDown); 16421 return wrapper; 16422} 16423function getEventTarget(event) { 16424 try { 16425 if (typeof event.composedPath === "function") { 16426 var path = event.composedPath(); 16427 return path[0]; 16428 } 16429 return event.target; 16430 } 16431 catch (error) { 16432 return event.target; 16433 } 16434} 16435 16436 16437/***/ }), 16438
vendor: 6,239 bytes, lines 16439-16590
16439/***/ "./node_modules/flatpickr/dist/esm/utils/formatting.js": 16440/*!*************************************************************!*\ 16441 !*** ./node_modules/flatpickr/dist/esm/utils/formatting.js ***! 16442 \*************************************************************/ 16443/*! exports provided: monthToStr, revFormat, tokenRegex, formats */ 16444/***/ (function(module, __webpack_exports__, __webpack_require__) { 16445 16446"use strict"; 16447__webpack_require__.r(__webpack_exports__); 16448/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "monthToStr", function() { return monthToStr; }); 16449/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "revFormat", function() { return revFormat; }); 16450/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "tokenRegex", function() { return tokenRegex; }); 16451/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "formats", function() { return formats; }); 16452/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ "./node_modules/flatpickr/dist/esm/utils/index.js"); 16453 16454var doNothing = function () { return undefined; }; 16455var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; }; 16456var revFormat = { 16457 D: doNothing, 16458 F: function (dateObj, monthName, locale) { 16459 dateObj.setMonth(locale.months.longhand.indexOf(monthName)); 16460 }, 16461 G: function (dateObj, hour) { 16462 dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour)); 16463 }, 16464 H: function (dateObj, hour) { 16465 dateObj.setHours(parseFloat(hour)); 16466 }, 16467 J: function (dateObj, day) { 16468 dateObj.setDate(parseFloat(day)); 16469 }, 16470 K: function (dateObj, amPM, locale) { 16471 dateObj.setHours((dateObj.getHours() % 12) + 16472 12 * Object(_utils__WEBPACK_IMPORTED_MODULE_0__["int"])(new RegExp(locale.amPM[1], "i").test(amPM))); 16473 }, 16474 M: function (dateObj, shortMonth, locale) { 16475 dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth)); 16476 }, 16477 S: function (dateObj, seconds) { 16478 dateObj.setSeconds(parseFloat(seconds)); 16479 }, 16480 U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); }, 16481 W: function (dateObj, weekNum, locale) { 16482 var weekNumber = parseInt(weekNum); 16483 var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0); 16484 date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek); 16485 return date; 16486 }, 16487 Y: function (dateObj, year) { 16488 dateObj.setFullYear(parseFloat(year)); 16489 }, 16490 Z: function (_, ISODate) { return new Date(ISODate); }, 16491 d: function (dateObj, day) { 16492 dateObj.setDate(parseFloat(day)); 16493 }, 16494 h: function (dateObj, hour) { 16495 dateObj.setHours((dateObj.getHours() >= 12 ? 12 : 0) + parseFloat(hour)); 16496 }, 16497 i: function (dateObj, minutes) { 16498 dateObj.setMinutes(parseFloat(minutes)); 16499 }, 16500 j: function (dateObj, day) { 16501 dateObj.setDate(parseFloat(day)); 16502 }, 16503 l: doNothing, 16504 m: function (dateObj, month) { 16505 dateObj.setMonth(parseFloat(month) - 1); 16506 }, 16507 n: function (dateObj, month) { 16508 dateObj.setMonth(parseFloat(month) - 1); 16509 }, 16510 s: function (dateObj, seconds) { 16511 dateObj.setSeconds(parseFloat(seconds)); 16512 }, 16513 u: function (_, unixMillSeconds) { 16514 return new Date(parseFloat(unixMillSeconds)); 16515 }, 16516 w: doNothing, 16517 y: function (dateObj, year) { 16518 dateObj.setFullYear(2000 + parseFloat(year)); 16519 }, 16520}; 16521var tokenRegex = { 16522 D: "", 16523 F: "", 16524 G: "(\\d\\d|\\d)", 16525 H: "(\\d\\d|\\d)", 16526 J: "(\\d\\d|\\d)\\w+", 16527 K: "", 16528 M: "", 16529 S: "(\\d\\d|\\d)", 16530 U: "(.+)", 16531 W: "(\\d\\d|\\d)", 16532 Y: "(\\d{4})", 16533 Z: "(.+)", 16534 d: "(\\d\\d|\\d)", 16535 h: "(\\d\\d|\\d)", 16536 i: "(\\d\\d|\\d)", 16537 j: "(\\d\\d|\\d)", 16538 l: "", 16539 m: "(\\d\\d|\\d)", 16540 n: "(\\d\\d|\\d)", 16541 s: "(\\d\\d|\\d)", 16542 u: "(.+)", 16543 w: "(\\d\\d|\\d)", 16544 y: "(\\d{2})", 16545}; 16546var formats = { 16547 Z: function (date) { return date.toISOString(); }, 16548 D: function (date, locale, options) { 16549 return locale.weekdays.shorthand[formats.w(date, locale, options)]; 16550 }, 16551 F: function (date, locale, options) { 16552 return monthToStr(formats.n(date, locale, options) - 1, false, locale); 16553 }, 16554 G: function (date, locale, options) { 16555 return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(formats.h(date, locale, options)); 16556 }, 16557 H: function (date) { return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(date.getHours()); }, 16558 J: function (date, locale) { 16559 return locale.ordinal !== undefined 16560 ? date.getDate() + locale.ordinal(date.getDate()) 16561 : date.getDate(); 16562 }, 16563 K: function (date, locale) { return locale.amPM[Object(_utils__WEBPACK_IMPORTED_MODULE_0__["int"])(date.getHours() > 11)]; }, 16564 M: function (date, locale) { 16565 return monthToStr(date.getMonth(), true, locale); 16566 }, 16567 S: function (date) { return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(date.getSeconds()); }, 16568 U: function (date) { return date.getTime() / 1000; }, 16569 W: function (date, _, options) { 16570 return options.getWeek(date); 16571 }, 16572 Y: function (date) { return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(date.getFullYear(), 4); }, 16573 d: function (date) { return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(date.getDate()); }, 16574 h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); }, 16575 i: function (date) { return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(date.getMinutes()); }, 16576 j: function (date) { return date.getDate(); }, 16577 l: function (date, locale) { 16578 return locale.weekdays.longhand[date.getDay()]; 16579 }, 16580 m: function (date) { return Object(_utils__WEBPACK_IMPORTED_MODULE_0__["pad"])(date.getMonth() + 1); }, 16581 n: function (date) { return date.getMonth() + 1; }, 16582 s: function (date) { return date.getSeconds(); }, 16583 u: function (date) { return date.getTime(); }, 16584 w: function (date) { return date.getDay(); }, 16585 y: function (date) { return String(date.getFullYear()).substring(2); }, 16586}; 16587 16588 16589/***/ }), 16590
vendor: 1,407 bytes, lines 16591-16624
16591/***/ "./node_modules/flatpickr/dist/esm/utils/index.js": 16592/*!********************************************************!*\ 16593 !*** ./node_modules/flatpickr/dist/esm/utils/index.js ***! 16594 \********************************************************/ 16595/*! exports provided: pad, int, debounce, arrayify */ 16596/***/ (function(module, __webpack_exports__, __webpack_require__) { 16597 16598"use strict"; 16599__webpack_require__.r(__webpack_exports__); 16600/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "pad", function() { return pad; }); 16601/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "int", function() { return int; }); 16602/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "debounce", function() { return debounce; }); 16603/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "arrayify", function() { return arrayify; }); 16604var pad = function (number, length) { 16605 if (length === void 0) { length = 2; } 16606 return ("000" + number).slice(length * -1); 16607}; 16608var int = function (bool) { return (bool === true ? 1 : 0); }; 16609function debounce(fn, wait) { 16610 var t; 16611 return function () { 16612 var _this = this; 16613 var args = arguments; 16614 clearTimeout(t); 16615 t = setTimeout(function () { return fn.apply(_this, args); }, wait); 16616 }; 16617} 16618var arrayify = function (obj) { 16619 return obj instanceof Array ? obj : [obj]; 16620}; 16621 16622 16623/***/ }), 16624
vendor: 1,067 bytes, lines 16625-16658
16625/***/ "./node_modules/flatpickr/dist/esm/utils/polyfills.js": 16626/*!************************************************************!*\ 16627 !*** ./node_modules/flatpickr/dist/esm/utils/polyfills.js ***! 16628 \************************************************************/ 16629/*! no static exports found */ 16630/***/ (function(module, exports, __webpack_require__) { 16631 16632"use strict"; 16633 16634if (typeof Object.assign !== "function") { 16635 Object.assign = function (target) { 16636 var args = []; 16637 for (var _i = 1; _i < arguments.length; _i++) { 16638 args[_i - 1] = arguments[_i]; 16639 } 16640 if (!target) { 16641 throw TypeError("Cannot convert undefined or null to object"); 16642 } 16643 var _loop_1 = function (source) { 16644 if (source) { 16645 Object.keys(source).forEach(function (key) { return (target[key] = source[key]); }); 16646 } 16647 }; 16648 for (var _a = 0, args_1 = args; _a < args_1.length; _a++) { 16649 var source = args_1[_a]; 16650 _loop_1(source); 16651 } 16652 return target; 16653 }; 16654} 16655 16656 16657/***/ }), 16658
vendor: 289,075 bytes, lines 16659-27551
16659/***/ "./node_modules/jquery/dist/jquery.js": 16660/*!********************************************!*\ 16661 !*** ./node_modules/jquery/dist/jquery.js ***! 16662 \********************************************/ 16663/*! no static exports found */ 16664/***/ (function(module, exports, __webpack_require__) { 16665 16666var __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! 16667 * jQuery JavaScript Library v3.6.0 16668 * https://jquery.com/ 16669 * 16670 * Includes Sizzle.js 16671 * https://sizzlejs.com/ 16672 * 16673 * Copyright OpenJS Foundation and other contributors 16674 * Released under the MIT license 16675 * https://jquery.org/license 16676 * 16677 * Date: 2021-03-02T17:08Z 16678 */ 16679( function( global, factory ) { 16680 16681 "use strict"; 16682 16683 if ( true && typeof module.exports === "object" ) { 16684 16685 // For CommonJS and CommonJS-like environments where a proper `window` 16686 // is present, execute the factory and get jQuery. 16687 // For environments that do not have a `window` with a `document` 16688 // (such as Node.js), expose a factory as module.exports. 16689 // This accentuates the need for the creation of a real `window`. 16690 // e.g. var jQuery = require("jquery")(window); 16691 // See ticket #14549 for more info. 16692 module.exports = global.document ? 16693 factory( global, true ) : 16694 function( w ) { 16695 if ( !w.document ) { 16696 throw new Error( "jQuery requires a window with a document" ); 16697 } 16698 return factory( w ); 16699 }; 16700 } else { 16701 factory( global ); 16702 } 16703 16704// Pass this if window is not defined yet 16705} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { 16706 16707// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 16708// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode 16709// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common 16710// enough that all such attempts are guarded in a try block. 16711"use strict"; 16712 16713var arr = []; 16714 16715var getProto = Object.getPrototypeOf; 16716 16717var slice = arr.slice; 16718 16719var flat = arr.flat ? function( array ) { 16720 return arr.flat.call( array ); 16721} : function( array ) { 16722 return arr.concat.apply( [], array ); 16723}; 16724 16725 16726var push = arr.push; 16727 16728var indexOf = arr.indexOf; 16729 16730var class2type = {}; 16731 16732var toString = class2type.toString; 16733 16734var hasOwn = class2type.hasOwnProperty; 16735 16736var fnToString = hasOwn.toString; 16737 16738var ObjectFunctionString = fnToString.call( Object ); 16739 16740var support = {}; 16741 16742var isFunction = function isFunction( obj ) { 16743 16744 // Support: Chrome <=57, Firefox <=52 16745 // In some browsers, typeof returns "function" for HTML <object> elements 16746 // (i.e., `typeof document.createElement( "object" ) === "function"`). 16747 // We don't want to classify *any* DOM node as a function. 16748 // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 16749 // Plus for old WebKit, typeof returns "function" for HTML collections 16750 // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) 16751 return typeof obj === "function" && typeof obj.nodeType !== "number" && 16752 typeof obj.item !== "function"; 16753 }; 16754 16755 16756var isWindow = function isWindow( obj ) { 16757 return obj != null && obj === obj.window; 16758 }; 16759 16760 16761var document = window.document; 16762 16763 16764 16765 var preservedScriptAttributes = { 16766 type: true, 16767 src: true, 16768 nonce: true, 16769 noModule: true 16770 }; 16771 16772 function DOMEval( code, node, doc ) { 16773 doc = doc || document; 16774 16775 var i, val, 16776 script = doc.createElement( "script" ); 16777 16778 script.text = code; 16779 if ( node ) { 16780 for ( i in preservedScriptAttributes ) { 16781 16782 // Support: Firefox 64+, Edge 18+ 16783 // Some browsers don't support the "nonce" property on scripts. 16784 // On the other hand, just using `getAttribute` is not enough as 16785 // the `nonce` attribute is reset to an empty string whenever it 16786 // becomes browsing-context connected. 16787 // See https://github.com/whatwg/html/issues/2369 16788 // See https://html.spec.whatwg.org/#nonce-attributes 16789 // The `node.getAttribute` check was added for the sake of 16790 // `jQuery.globalEval` so that it can fake a nonce-containing node 16791 // via an object. 16792 val = node[ i ] || node.getAttribute && node.getAttribute( i ); 16793 if ( val ) { 16794 script.setAttribute( i, val ); 16795 } 16796 } 16797 } 16798 doc.head.appendChild( script ).parentNode.removeChild( script ); 16799 } 16800 16801 16802function toType( obj ) { 16803 if ( obj == null ) { 16804 return obj + ""; 16805 } 16806 16807 // Support: Android <=2.3 only (functionish RegExp) 16808 return typeof obj === "object" || typeof obj === "function" ? 16809 class2type[ toString.call( obj ) ] || "object" : 16810 typeof obj; 16811} 16812/* global Symbol */ 16813// Defining this global in .eslintrc.json would create a danger of using the global 16814// unguarded in another place, it seems safer to define global only for this module 16815 16816 16817 16818var 16819 version = "3.6.0", 16820 16821 // Define a local copy of jQuery 16822 jQuery = function( selector, context ) { 16823 16824 // The jQuery object is actually just the init constructor 'enhanced' 16825 // Need init if jQuery is called (just allow error to be thrown if not included) 16826 return new jQuery.fn.init( selector, context ); 16827 }; 16828 16829jQuery.fn = jQuery.prototype = { 16830 16831 // The current version of jQuery being used 16832 jquery: version, 16833 16834 constructor: jQuery, 16835 16836 // The default length of a jQuery object is 0 16837 length: 0, 16838 16839 toArray: function() { 16840 return slice.call( this ); 16841 }, 16842 16843 // Get the Nth element in the matched element set OR 16844 // Get the whole matched element set as a clean array 16845 get: function( num ) { 16846 16847 // Return all the elements in a clean array 16848 if ( num == null ) { 16849 return slice.call( this ); 16850 } 16851 16852 // Return just the one element from the set 16853 return num < 0 ? this[ num + this.length ] : this[ num ]; 16854 }, 16855 16856 // Take an array of elements and push it onto the stack 16857 // (returning the new matched element set) 16858 pushStack: function( elems ) { 16859 16860 // Build a new jQuery matched element set 16861 var ret = jQuery.merge( this.constructor(), elems ); 16862 16863 // Add the old object onto the stack (as a reference) 16864 ret.prevObject = this; 16865 16866 // Return the newly-formed element set 16867 return ret; 16868 }, 16869 16870 // Execute a callback for every element in the matched set. 16871 each: function( callback ) { 16872 return jQuery.each( this, callback ); 16873 }, 16874 16875 map: function( callback ) { 16876 return this.pushStack( jQuery.map( this, function( elem, i ) { 16877 return callback.call( elem, i, elem ); 16878 } ) ); 16879 }, 16880 16881 slice: function() { 16882 return this.pushStack( slice.apply( this, arguments ) ); 16883 }, 16884 16885 first: function() { 16886 return this.eq( 0 ); 16887 }, 16888 16889 last: function() { 16890 return this.eq( -1 ); 16891 }, 16892 16893 even: function() { 16894 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 16895 return ( i + 1 ) % 2; 16896 } ) ); 16897 }, 16898 16899 odd: function() { 16900 return this.pushStack( jQuery.grep( this, function( _elem, i ) { 16901 return i % 2; 16902 } ) ); 16903 }, 16904 16905 eq: function( i ) { 16906 var len = this.length, 16907 j = +i + ( i < 0 ? len : 0 ); 16908 return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); 16909 }, 16910 16911 end: function() { 16912 return this.prevObject || this.constructor(); 16913 }, 16914 16915 // For internal use only. 16916 // Behaves like an Array's method, not like a jQuery method. 16917 push: push, 16918 sort: arr.sort, 16919 splice: arr.splice 16920}; 16921 16922jQuery.extend = jQuery.fn.extend = function() { 16923 var options, name, src, copy, copyIsArray, clone, 16924 target = arguments[ 0 ] || {}, 16925 i = 1, 16926 length = arguments.length, 16927 deep = false; 16928 16929 // Handle a deep copy situation 16930 if ( typeof target === "boolean" ) { 16931 deep = target; 16932 16933 // Skip the boolean and the target 16934 target = arguments[ i ] || {}; 16935 i++; 16936 } 16937 16938 // Handle case when target is a string or something (possible in deep copy) 16939 if ( typeof target !== "object" && !isFunction( target ) ) { 16940 target = {}; 16941 } 16942 16943 // Extend jQuery itself if only one argument is passed 16944 if ( i === length ) { 16945 target = this; 16946 i--; 16947 } 16948 16949 for ( ; i < length; i++ ) { 16950 16951 // Only deal with non-null/undefined values 16952 if ( ( options = arguments[ i ] ) != null ) { 16953 16954 // Extend the base object 16955 for ( name in options ) { 16956 copy = options[ name ]; 16957 16958 // Prevent Object.prototype pollution 16959 // Prevent never-ending loop 16960 if ( name === "__proto__" || target === copy ) { 16961 continue; 16962 } 16963 16964 // Recurse if we're merging plain objects or arrays 16965 if ( deep && copy && ( jQuery.isPlainObject( copy ) || 16966 ( copyIsArray = Array.isArray( copy ) ) ) ) { 16967 src = target[ name ]; 16968 16969 // Ensure proper type for the source value 16970 if ( copyIsArray && !Array.isArray( src ) ) { 16971 clone = []; 16972 } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { 16973 clone = {}; 16974 } else { 16975 clone = src; 16976 } 16977 copyIsArray = false; 16978 16979 // Never move original objects, clone them 16980 target[ name ] = jQuery.extend( deep, clone, copy ); 16981 16982 // Don't bring in undefined values 16983 } else if ( copy !== undefined ) { 16984 target[ name ] = copy; 16985 } 16986 } 16987 } 16988 } 16989 16990 // Return the modified object 16991 return target; 16992}; 16993 16994jQuery.extend( { 16995 16996 // Unique for each copy of jQuery on the page 16997 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), 16998 16999 // Assume jQuery is ready without the ready module 17000 isReady: true, 17001 17002 error: function( msg ) { 17003 throw new Error( msg ); 17004 }, 17005 17006 noop: function() {}, 17007 17008 isPlainObject: function( obj ) { 17009 var proto, Ctor; 17010 17011 // Detect obvious negatives 17012 // Use toString instead of jQuery.type to catch host objects 17013 if ( !obj || toString.call( obj ) !== "[object Object]" ) { 17014 return false; 17015 } 17016 17017 proto = getProto( obj ); 17018 17019 // Objects with no prototype (e.g., `Object.create( null )`) are plain 17020 if ( !proto ) { 17021 return true; 17022 } 17023 17024 // Objects with prototype are plain iff they were constructed by a global Object function 17025 Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; 17026 return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; 17027 }, 17028 17029 isEmptyObject: function( obj ) { 17030 var name; 17031 17032 for ( name in obj ) { 17033 return false; 17034 } 17035 return true; 17036 }, 17037 17038 // Evaluates a script in a provided context; falls back to the global one 17039 // if not specified. 17040 globalEval: function( code, options, doc ) { 17041 DOMEval( code, { nonce: options && options.nonce }, doc ); 17042 }, 17043 17044 each: function( obj, callback ) { 17045 var length, i = 0; 17046 17047 if ( isArrayLike( obj ) ) { 17048 length = obj.length; 17049 for ( ; i < length; i++ ) { 17050 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 17051 break; 17052 } 17053 } 17054 } else { 17055 for ( i in obj ) { 17056 if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { 17057 break; 17058 } 17059 } 17060 } 17061 17062 return obj; 17063 }, 17064 17065 // results is for internal usage only 17066 makeArray: function( arr, results ) { 17067 var ret = results || []; 17068 17069 if ( arr != null ) { 17070 if ( isArrayLike( Object( arr ) ) ) { 17071 jQuery.merge( ret, 17072 typeof arr === "string" ? 17073 [ arr ] : arr 17074 ); 17075 } else { 17076 push.call( ret, arr ); 17077 } 17078 } 17079 17080 return ret; 17081 }, 17082 17083 inArray: function( elem, arr, i ) { 17084 return arr == null ? -1 : indexOf.call( arr, elem, i ); 17085 }, 17086 17087 // Support: Android <=4.0 only, PhantomJS 1 only 17088 // push.apply(_, arraylike) throws on ancient WebKit 17089 merge: function( first, second ) { 17090 var len = +second.length, 17091 j = 0, 17092 i = first.length; 17093 17094 for ( ; j < len; j++ ) { 17095 first[ i++ ] = second[ j ]; 17096 } 17097 17098 first.length = i; 17099 17100 return first; 17101 }, 17102 17103 grep: function( elems, callback, invert ) { 17104 var callbackInverse, 17105 matches = [], 17106 i = 0, 17107 length = elems.length, 17108 callbackExpect = !invert; 17109 17110 // Go through the array, only saving the items 17111 // that pass the validator function 17112 for ( ; i < length; i++ ) { 17113 callbackInverse = !callback( elems[ i ], i ); 17114 if ( callbackInverse !== callbackExpect ) { 17115 matches.push( elems[ i ] ); 17116 } 17117 } 17118 17119 return matches; 17120 }, 17121 17122 // arg is for internal usage only 17123 map: function( elems, callback, arg ) { 17124 var length, value, 17125 i = 0, 17126 ret = []; 17127 17128 // Go through the array, translating each of the items to their new values 17129 if ( isArrayLike( elems ) ) { 17130 length = elems.length; 17131 for ( ; i < length; i++ ) { 17132 value = callback( elems[ i ], i, arg ); 17133 17134 if ( value != null ) { 17135 ret.push( value ); 17136 } 17137 } 17138 17139 // Go through every key on the object, 17140 } else { 17141 for ( i in elems ) { 17142 value = callback( elems[ i ], i, arg ); 17143 17144 if ( value != null ) { 17145 ret.push( value ); 17146 } 17147 } 17148 } 17149 17150 // Flatten any nested arrays 17151 return flat( ret ); 17152 }, 17153 17154 // A global GUID counter for objects 17155 guid: 1, 17156 17157 // jQuery.support is not used in Core but other projects attach their 17158 // properties to it so it needs to exist. 17159 support: support 17160} ); 17161 17162if ( typeof Symbol === "function" ) { 17163 jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; 17164} 17165 17166// Populate the class2type map 17167jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), 17168 function( _i, name ) { 17169 class2type[ "[object " + name + "]" ] = name.toLowerCase(); 17170 } ); 17171 17172function isArrayLike( obj ) { 17173 17174 // Support: real iOS 8.2 only (not reproducible in simulator) 17175 // `in` check used to prevent JIT error (gh-2145) 17176 // hasOwn isn't used here due to false negatives 17177 // regarding Nodelist length in IE 17178 var length = !!obj && "length" in obj && obj.length, 17179 type = toType( obj ); 17180 17181 if ( isFunction( obj ) || isWindow( obj ) ) { 17182 return false; 17183 } 17184 17185 return type === "array" || length === 0 || 17186 typeof length === "number" && length > 0 && ( length - 1 ) in obj; 17187} 17188var Sizzle = 17189/*! 17190 * Sizzle CSS Selector Engine v2.3.6 17191 * https://sizzlejs.com/ 17192 * 17193 * Copyright JS Foundation and other contributors 17194 * Released under the MIT license 17195 * https://js.foundation/ 17196 * 17197 * Date: 2021-02-16 17198 */ 17199( function( window ) { 17200var i, 17201 support, 17202 Expr, 17203 getText, 17204 isXML, 17205 tokenize, 17206 compile, 17207 select, 17208 outermostContext, 17209 sortInput, 17210 hasDuplicate, 17211 17212 // Local document vars 17213 setDocument, 17214 document, 17215 docElem, 17216 documentIsHTML, 17217 rbuggyQSA, 17218 rbuggyMatches, 17219 matches, 17220 contains, 17221 17222 // Instance-specific data 17223 expando = "sizzle" + 1 * new Date(), 17224 preferredDoc = window.document, 17225 dirruns = 0, 17226 done = 0, 17227 classCache = createCache(), 17228 tokenCache = createCache(), 17229 compilerCache = createCache(), 17230 nonnativeSelectorCache = createCache(), 17231 sortOrder = function( a, b ) { 17232 if ( a === b ) { 17233 hasDuplicate = true; 17234 } 17235 return 0; 17236 }, 17237 17238 // Instance methods 17239 hasOwn = ( {} ).hasOwnProperty, 17240 arr = [], 17241 pop = arr.pop, 17242 pushNative = arr.push, 17243 push = arr.push, 17244 slice = arr.slice, 17245 17246 // Use a stripped-down indexOf as it's faster than native 17247 // https://jsperf.com/thor-indexof-vs-for/5 17248 indexOf = function( list, elem ) { 17249 var i = 0, 17250 len = list.length; 17251 for ( ; i < len; i++ ) { 17252 if ( list[ i ] === elem ) { 17253 return i; 17254 } 17255 } 17256 return -1; 17257 }, 17258 17259 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + 17260 "ismap|loop|multiple|open|readonly|required|scoped", 17261 17262 // Regular expressions 17263 17264 // http://www.w3.org/TR/css3-selectors/#whitespace 17265 whitespace = "[\\x20\\t\\r\\n\\f]", 17266 17267 // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram 17268 identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + 17269 "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", 17270 17271 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors 17272 attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + 17273 17274 // Operator (capture 2) 17275 "*([*^$|!~]?=)" + whitespace + 17276 17277 // "Attribute values must be CSS identifiers [capture 5] 17278 // or strings [capture 3 or capture 4]" 17279 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + 17280 whitespace + "*\\]", 17281 17282 pseudos = ":(" + identifier + ")(?:\\((" + 17283 17284 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: 17285 // 1. quoted (capture 3; capture 4 or capture 5) 17286 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + 17287 17288 // 2. simple (capture 6) 17289 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + 17290 17291 // 3. anything else (capture 2) 17292 ".*" + 17293 ")\\)|)", 17294 17295 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter 17296 rwhitespace = new RegExp( whitespace + "+", "g" ), 17297 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + 17298 whitespace + "+$", "g" ), 17299 17300 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), 17301 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + 17302 "*" ), 17303 rdescend = new RegExp( whitespace + "|>" ), 17304 17305 rpseudo = new RegExp( pseudos ), 17306 ridentifier = new RegExp( "^" + identifier + "$" ), 17307 17308 matchExpr = { 17309 "ID": new RegExp( "^#(" + identifier + ")" ), 17310 "CLASS": new RegExp( "^\\.(" + identifier + ")" ), 17311 "TAG": new RegExp( "^(" + identifier + "|[*])" ), 17312 "ATTR": new RegExp( "^" + attributes ), 17313 "PSEUDO": new RegExp( "^" + pseudos ), 17314 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + 17315 whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + 17316 whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), 17317 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), 17318 17319 // For use in libraries implementing .is() 17320 // We use this for POS matching in `select` 17321 "needsContext": new RegExp( "^" + whitespace + 17322 "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + 17323 "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) 17324 }, 17325 17326 rhtml = /HTML$/i, 17327 rinputs = /^(?:input|select|textarea|button)$/i, 17328 rheader = /^h\d$/i, 17329 17330 rnative = /^[^{]+\{\s*\[native \w/, 17331 17332 // Easily-parseable/retrievable ID or TAG or CLASS selectors 17333 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, 17334 17335 rsibling = /[+~]/, 17336 17337 // CSS escapes 17338 // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters 17339 runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), 17340 funescape = function( escape, nonHex ) { 17341 var high = "0x" + escape.slice( 1 ) - 0x10000; 17342 17343 return nonHex ? 17344 17345 // Strip the backslash prefix from a non-hex escape sequence 17346 nonHex : 17347 17348 // Replace a hexadecimal escape sequence with the encoded Unicode code point 17349 // Support: IE <=11+ 17350 // For values outside the Basic Multilingual Plane (BMP), manually construct a 17351 // surrogate pair 17352 high < 0 ? 17353 String.fromCharCode( high + 0x10000 ) : 17354 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); 17355 }, 17356 17357 // CSS string/identifier serialization 17358 // https://drafts.csswg.org/cssom/#common-serializing-idioms 17359 rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, 17360 fcssescape = function( ch, asCodePoint ) { 17361 if ( asCodePoint ) { 17362 17363 // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER 17364 if ( ch === "\0" ) { 17365 return "\uFFFD"; 17366 } 17367 17368 // Control characters and (dependent upon position) numbers get escaped as code points 17369 return ch.slice( 0, -1 ) + "\\" + 17370 ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; 17371 } 17372 17373 // Other potentially-special ASCII characters get backslash-escaped 17374 return "\\" + ch; 17375 }, 17376 17377 // Used for iframes 17378 // See setDocument() 17379 // Removing the function wrapper causes a "Permission Denied" 17380 // error in IE 17381 unloadHandler = function() { 17382 setDocument(); 17383 }, 17384 17385 inDisabledFieldset = addCombinator( 17386 function( elem ) { 17387 return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; 17388 }, 17389 { dir: "parentNode", next: "legend" } 17390 ); 17391 17392// Optimize for push.apply( _, NodeList ) 17393try { 17394 push.apply( 17395 ( arr = slice.call( preferredDoc.childNodes ) ), 17396 preferredDoc.childNodes 17397 ); 17398 17399 // Support: Android<4.0 17400 // Detect silently failing push.apply 17401 // eslint-disable-next-line no-unused-expressions 17402 arr[ preferredDoc.childNodes.length ].nodeType; 17403} catch ( e ) { 17404 push = { apply: arr.length ? 17405 17406 // Leverage slice if possible 17407 function( target, els ) { 17408 pushNative.apply( target, slice.call( els ) ); 17409 } : 17410 17411 // Support: IE<9 17412 // Otherwise append directly 17413 function( target, els ) { 17414 var j = target.length, 17415 i = 0; 17416 17417 // Can't trust NodeList.length 17418 while ( ( target[ j++ ] = els[ i++ ] ) ) {} 17419 target.length = j - 1; 17420 } 17421 }; 17422} 17423 17424function Sizzle( selector, context, results, seed ) { 17425 var m, i, elem, nid, match, groups, newSelector, 17426 newContext = context && context.ownerDocument, 17427 17428 // nodeType defaults to 9, since context defaults to document 17429 nodeType = context ? context.nodeType : 9; 17430 17431 results = results || []; 17432 17433 // Return early from calls with invalid selector or context 17434 if ( typeof selector !== "string" || !selector || 17435 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { 17436 17437 return results; 17438 } 17439 17440 // Try to shortcut find operations (as opposed to filters) in HTML documents 17441 if ( !seed ) { 17442 setDocument( context ); 17443 context = context || document; 17444 17445 if ( documentIsHTML ) { 17446 17447 // If the selector is sufficiently simple, try using a "get*By*" DOM method 17448 // (excepting DocumentFragment context, where the methods don't exist) 17449 if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { 17450 17451 // ID selector 17452 if ( ( m = match[ 1 ] ) ) { 17453 17454 // Document context 17455 if ( nodeType === 9 ) { 17456 if ( ( elem = context.getElementById( m ) ) ) { 17457 17458 // Support: IE, Opera, Webkit 17459 // TODO: identify versions 17460 // getElementById can match elements by name instead of ID 17461 if ( elem.id === m ) { 17462 results.push( elem ); 17463 return results; 17464 } 17465 } else { 17466 return results; 17467 } 17468 17469 // Element context 17470 } else { 17471 17472 // Support: IE, Opera, Webkit 17473 // TODO: identify versions 17474 // getElementById can match elements by name instead of ID 17475 if ( newContext && ( elem = newContext.getElementById( m ) ) && 17476 contains( context, elem ) && 17477 elem.id === m ) { 17478 17479 results.push( elem ); 17480 return results; 17481 } 17482 } 17483 17484 // Type selector 17485 } else if ( match[ 2 ] ) { 17486 push.apply( results, context.getElementsByTagName( selector ) ); 17487 return results; 17488 17489 // Class selector 17490 } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && 17491 context.getElementsByClassName ) { 17492 17493 push.apply( results, context.getElementsByClassName( m ) ); 17494 return results; 17495 } 17496 } 17497 17498 // Take advantage of querySelectorAll 17499 if ( support.qsa && 17500 !nonnativeSelectorCache[ selector + " " ] && 17501 ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && 17502 17503 // Support: IE 8 only 17504 // Exclude object elements 17505 ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { 17506 17507 newSelector = selector; 17508 newContext = context; 17509 17510 // qSA considers elements outside a scoping root when evaluating child or 17511 // descendant combinators, which is not what we want. 17512 // In such cases, we work around the behavior by prefixing every selector in the 17513 // list with an ID selector referencing the scope context. 17514 // The technique has to be used as well when a leading combinator is used 17515 // as such selectors are not recognized by querySelectorAll. 17516 // Thanks to Andrew Dupont for this technique. 17517 if ( nodeType === 1 && 17518 ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { 17519 17520 // Expand context for sibling selectors 17521 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || 17522 context; 17523 17524 // We can use :scope instead of the ID hack if the browser 17525 // supports it & if we're not changing the context. 17526 if ( newContext !== context || !support.scope ) { 17527 17528 // Capture the context ID, setting it first if necessary 17529 if ( ( nid = context.getAttribute( "id" ) ) ) { 17530 nid = nid.replace( rcssescape, fcssescape ); 17531 } else { 17532 context.setAttribute( "id", ( nid = expando ) ); 17533 } 17534 } 17535 17536 // Prefix every selector in the list 17537 groups = tokenize( selector ); 17538 i = groups.length; 17539 while ( i-- ) { 17540 groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + 17541 toSelector( groups[ i ] ); 17542 } 17543 newSelector = groups.join( "," ); 17544 } 17545 17546 try { 17547 push.apply( results, 17548 newContext.querySelectorAll( newSelector ) 17549 ); 17550 return results; 17551 } catch ( qsaError ) { 17552 nonnativeSelectorCache( selector, true ); 17553 } finally { 17554 if ( nid === expando ) { 17555 context.removeAttribute( "id" ); 17556 } 17557 } 17558 } 17559 } 17560 } 17561 17562 // All others 17563 return select( selector.replace( rtrim, "$1" ), context, results, seed ); 17564} 17565 17566/** 17567 * Create key-value caches of limited size 17568 * @returns {function(string, object)} Returns the Object data after storing it on itself with 17569 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) 17570 * deleting the oldest entry 17571 */ 17572function createCache() { 17573 var keys = []; 17574 17575 function cache( key, value ) { 17576 17577 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) 17578 if ( keys.push( key + " " ) > Expr.cacheLength ) { 17579 17580 // Only keep the most recent entries 17581 delete cache[ keys.shift() ]; 17582 } 17583 return ( cache[ key + " " ] = value ); 17584 } 17585 return cache; 17586} 17587 17588/** 17589 * Mark a function for special use by Sizzle 17590 * @param {Function} fn The function to mark 17591 */ 17592function markFunction( fn ) { 17593 fn[ expando ] = true; 17594 return fn; 17595} 17596 17597/** 17598 * Support testing using an element 17599 * @param {Function} fn Passed the created element and returns a boolean result 17600 */ 17601function assert( fn ) { 17602 var el = document.createElement( "fieldset" ); 17603 17604 try { 17605 return !!fn( el ); 17606 } catch ( e ) { 17607 return false; 17608 } finally { 17609 17610 // Remove from its parent by default 17611 if ( el.parentNode ) { 17612 el.parentNode.removeChild( el ); 17613 } 17614 17615 // release memory in IE 17616 el = null; 17617 } 17618} 17619 17620/** 17621 * Adds the same handler for all of the specified attrs 17622 * @param {String} attrs Pipe-separated list of attributes 17623 * @param {Function} handler The method that will be applied 17624 */ 17625function addHandle( attrs, handler ) { 17626 var arr = attrs.split( "|" ), 17627 i = arr.length; 17628 17629 while ( i-- ) { 17630 Expr.attrHandle[ arr[ i ] ] = handler; 17631 } 17632} 17633 17634/** 17635 * Checks document order of two siblings 17636 * @param {Element} a 17637 * @param {Element} b 17638 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b 17639 */ 17640function siblingCheck( a, b ) { 17641 var cur = b && a, 17642 diff = cur && a.nodeType === 1 && b.nodeType === 1 && 17643 a.sourceIndex - b.sourceIndex; 17644 17645 // Use IE sourceIndex if available on both nodes 17646 if ( diff ) { 17647 return diff; 17648 } 17649 17650 // Check if b follows a 17651 if ( cur ) { 17652 while ( ( cur = cur.nextSibling ) ) { 17653 if ( cur === b ) { 17654 return -1; 17655 } 17656 } 17657 } 17658 17659 return a ? 1 : -1; 17660} 17661 17662/** 17663 * Returns a function to use in pseudos for input types 17664 * @param {String} type 17665 */ 17666function createInputPseudo( type ) { 17667 return function( elem ) { 17668 var name = elem.nodeName.toLowerCase(); 17669 return name === "input" && elem.type === type; 17670 }; 17671} 17672 17673/** 17674 * Returns a function to use in pseudos for buttons 17675 * @param {String} type 17676 */ 17677function createButtonPseudo( type ) { 17678 return function( elem ) { 17679 var name = elem.nodeName.toLowerCase(); 17680 return ( name === "input" || name === "button" ) && elem.type === type; 17681 }; 17682} 17683 17684/** 17685 * Returns a function to use in pseudos for :enabled/:disabled 17686 * @param {Boolean} disabled true for :disabled; false for :enabled 17687 */ 17688function createDisabledPseudo( disabled ) { 17689 17690 // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable 17691 return function( elem ) { 17692 17693 // Only certain elements can match :enabled or :disabled 17694 // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled 17695 // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled 17696 if ( "form" in elem ) { 17697 17698 // Check for inherited disabledness on relevant non-disabled elements: 17699 // * listed form-associated elements in a disabled fieldset 17700 // https://html.spec.whatwg.org/multipage/forms.html#category-listed 17701 // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled 17702 // * option elements in a disabled optgroup 17703 // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled 17704 // All such elements have a "form" property. 17705 if ( elem.parentNode && elem.disabled === false ) { 17706 17707 // Option elements defer to a parent optgroup if present 17708 if ( "label" in elem ) { 17709 if ( "label" in elem.parentNode ) { 17710 return elem.parentNode.disabled === disabled; 17711 } else { 17712 return elem.disabled === disabled; 17713 } 17714 } 17715 17716 // Support: IE 6 - 11 17717 // Use the isDisabled shortcut property to check for disabled fieldset ancestors 17718 return elem.isDisabled === disabled || 17719 17720 // Where there is no isDisabled, check manually 17721 /* jshint -W018 */ 17722 elem.isDisabled !== !disabled && 17723 inDisabledFieldset( elem ) === disabled; 17724 } 17725 17726 return elem.disabled === disabled; 17727 17728 // Try to winnow out elements that can't be disabled before trusting the disabled property. 17729 // Some victims get caught in our net (label, legend, menu, track), but it shouldn't 17730 // even exist on them, let alone have a boolean value. 17731 } else if ( "label" in elem ) { 17732 return elem.disabled === disabled; 17733 } 17734 17735 // Remaining elements are neither :enabled nor :disabled 17736 return false; 17737 }; 17738} 17739 17740/** 17741 * Returns a function to use in pseudos for positionals 17742 * @param {Function} fn 17743 */ 17744function createPositionalPseudo( fn ) { 17745 return markFunction( function( argument ) { 17746 argument = +argument; 17747 return markFunction( function( seed, matches ) { 17748 var j, 17749 matchIndexes = fn( [], seed.length, argument ), 17750 i = matchIndexes.length; 17751 17752 // Match elements found at the specified indexes 17753 while ( i-- ) { 17754 if ( seed[ ( j = matchIndexes[ i ] ) ] ) { 17755 seed[ j ] = !( matches[ j ] = seed[ j ] ); 17756 } 17757 } 17758 } ); 17759 } ); 17760} 17761 17762/** 17763 * Checks a node for validity as a Sizzle context 17764 * @param {Element|Object=} context 17765 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value 17766 */ 17767function testContext( context ) { 17768 return context && typeof context.getElementsByTagName !== "undefined" && context; 17769} 17770 17771// Expose support vars for convenience 17772support = Sizzle.support = {}; 17773 17774/** 17775 * Detects XML nodes 17776 * @param {Element|Object} elem An element or a document 17777 * @returns {Boolean} True iff elem is a non-HTML XML node 17778 */ 17779isXML = Sizzle.isXML = function( elem ) { 17780 var namespace = elem && elem.namespaceURI, 17781 docElem = elem && ( elem.ownerDocument || elem ).documentElement; 17782 17783 // Support: IE <=8 17784 // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes 17785 // https://bugs.jquery.com/ticket/4833 17786 return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); 17787}; 17788 17789/** 17790 * Sets document-related variables once based on the current document 17791 * @param {Element|Object} [doc] An element or document object to use to set the document 17792 * @returns {Object} Returns the current document 17793 */ 17794setDocument = Sizzle.setDocument = function( node ) { 17795 var hasCompare, subWindow, 17796 doc = node ? node.ownerDocument || node : preferredDoc; 17797 17798 // Return early if doc is invalid or already selected 17799 // Support: IE 11+, Edge 17 - 18+ 17800 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 17801 // two documents; shallow comparisons work. 17802 // eslint-disable-next-line eqeqeq 17803 if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { 17804 return document; 17805 } 17806 17807 // Update global variables 17808 document = doc; 17809 docElem = document.documentElement; 17810 documentIsHTML = !isXML( document ); 17811 17812 // Support: IE 9 - 11+, Edge 12 - 18+ 17813 // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) 17814 // Support: IE 11+, Edge 17 - 18+ 17815 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 17816 // two documents; shallow comparisons work. 17817 // eslint-disable-next-line eqeqeq 17818 if ( preferredDoc != document && 17819 ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { 17820 17821 // Support: IE 11, Edge 17822 if ( subWindow.addEventListener ) { 17823 subWindow.addEventListener( "unload", unloadHandler, false ); 17824 17825 // Support: IE 9 - 10 only 17826 } else if ( subWindow.attachEvent ) { 17827 subWindow.attachEvent( "onunload", unloadHandler ); 17828 } 17829 } 17830 17831 // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, 17832 // Safari 4 - 5 only, Opera <=11.6 - 12.x only 17833 // IE/Edge & older browsers don't support the :scope pseudo-class. 17834 // Support: Safari 6.0 only 17835 // Safari 6.0 supports :scope but it's an alias of :root there. 17836 support.scope = assert( function( el ) { 17837 docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); 17838 return typeof el.querySelectorAll !== "undefined" && 17839 !el.querySelectorAll( ":scope fieldset div" ).length; 17840 } ); 17841 17842 /* Attributes 17843 ---------------------------------------------------------------------- */ 17844 17845 // Support: IE<8 17846 // Verify that getAttribute really returns attributes and not properties 17847 // (excepting IE8 booleans) 17848 support.attributes = assert( function( el ) { 17849 el.className = "i"; 17850 return !el.getAttribute( "className" ); 17851 } ); 17852 17853 /* getElement(s)By* 17854 ---------------------------------------------------------------------- */ 17855 17856 // Check if getElementsByTagName("*") returns only elements 17857 support.getElementsByTagName = assert( function( el ) { 17858 el.appendChild( document.createComment( "" ) ); 17859 return !el.getElementsByTagName( "*" ).length; 17860 } ); 17861 17862 // Support: IE<9 17863 support.getElementsByClassName = rnative.test( document.getElementsByClassName ); 17864 17865 // Support: IE<10 17866 // Check if getElementById returns elements by name 17867 // The broken getElementById methods don't pick up programmatically-set names, 17868 // so use a roundabout getElementsByName test 17869 support.getById = assert( function( el ) { 17870 docElem.appendChild( el ).id = expando; 17871 return !document.getElementsByName || !document.getElementsByName( expando ).length; 17872 } ); 17873 17874 // ID filter and find 17875 if ( support.getById ) { 17876 Expr.filter[ "ID" ] = function( id ) { 17877 var attrId = id.replace( runescape, funescape ); 17878 return function( elem ) { 17879 return elem.getAttribute( "id" ) === attrId; 17880 }; 17881 }; 17882 Expr.find[ "ID" ] = function( id, context ) { 17883 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 17884 var elem = context.getElementById( id ); 17885 return elem ? [ elem ] : []; 17886 } 17887 }; 17888 } else { 17889 Expr.filter[ "ID" ] = function( id ) { 17890 var attrId = id.replace( runescape, funescape ); 17891 return function( elem ) { 17892 var node = typeof elem.getAttributeNode !== "undefined" && 17893 elem.getAttributeNode( "id" ); 17894 return node && node.value === attrId; 17895 }; 17896 }; 17897 17898 // Support: IE 6 - 7 only 17899 // getElementById is not reliable as a find shortcut 17900 Expr.find[ "ID" ] = function( id, context ) { 17901 if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { 17902 var node, i, elems, 17903 elem = context.getElementById( id ); 17904 17905 if ( elem ) { 17906 17907 // Verify the id attribute 17908 node = elem.getAttributeNode( "id" ); 17909 if ( node && node.value === id ) { 17910 return [ elem ]; 17911 } 17912 17913 // Fall back on getElementsByName 17914 elems = context.getElementsByName( id ); 17915 i = 0; 17916 while ( ( elem = elems[ i++ ] ) ) { 17917 node = elem.getAttributeNode( "id" ); 17918 if ( node && node.value === id ) { 17919 return [ elem ]; 17920 } 17921 } 17922 } 17923 17924 return []; 17925 } 17926 }; 17927 } 17928 17929 // Tag 17930 Expr.find[ "TAG" ] = support.getElementsByTagName ? 17931 function( tag, context ) { 17932 if ( typeof context.getElementsByTagName !== "undefined" ) { 17933 return context.getElementsByTagName( tag ); 17934 17935 // DocumentFragment nodes don't have gEBTN 17936 } else if ( support.qsa ) { 17937 return context.querySelectorAll( tag ); 17938 } 17939 } : 17940 17941 function( tag, context ) { 17942 var elem, 17943 tmp = [], 17944 i = 0, 17945 17946 // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too 17947 results = context.getElementsByTagName( tag ); 17948 17949 // Filter out possible comments 17950 if ( tag === "*" ) { 17951 while ( ( elem = results[ i++ ] ) ) { 17952 if ( elem.nodeType === 1 ) { 17953 tmp.push( elem ); 17954 } 17955 } 17956 17957 return tmp; 17958 } 17959 return results; 17960 }; 17961 17962 // Class 17963 Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { 17964 if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { 17965 return context.getElementsByClassName( className ); 17966 } 17967 }; 17968 17969 /* QSA/matchesSelector 17970 ---------------------------------------------------------------------- */ 17971 17972 // QSA and matchesSelector support 17973 17974 // matchesSelector(:active) reports false when true (IE9/Opera 11.5) 17975 rbuggyMatches = []; 17976 17977 // qSa(:focus) reports false when true (Chrome 21) 17978 // We allow this because of a bug in IE8/9 that throws an error 17979 // whenever `document.activeElement` is accessed on an iframe 17980 // So, we allow :focus to pass through QSA all the time to avoid the IE error 17981 // See https://bugs.jquery.com/ticket/13378 17982 rbuggyQSA = []; 17983 17984 if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { 17985 17986 // Build QSA regex 17987 // Regex strategy adopted from Diego Perini 17988 assert( function( el ) { 17989 17990 var input; 17991 17992 // Select is set to empty string on purpose 17993 // This is to test IE's treatment of not explicitly 17994 // setting a boolean content attribute, 17995 // since its presence should be enough 17996 // https://bugs.jquery.com/ticket/12359 17997 docElem.appendChild( el ).innerHTML = "<a id='" + expando + "'></a>" + 17998 "<select id='" + expando + "-\r\\' msallowcapture=''>" + 17999 "<option selected=''></option></select>"; 18000 18001 // Support: IE8, Opera 11-12.16 18002 // Nothing should be selected when empty strings follow ^= or $= or *= 18003 // The test attribute must be unknown in Opera but "safe" for WinRT 18004 // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section 18005 if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { 18006 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); 18007 } 18008 18009 // Support: IE8 18010 // Boolean attributes and "value" are not treated correctly 18011 if ( !el.querySelectorAll( "[selected]" ).length ) { 18012 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); 18013 } 18014 18015 // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ 18016 if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { 18017 rbuggyQSA.push( "~=" ); 18018 } 18019 18020 // Support: IE 11+, Edge 15 - 18+ 18021 // IE 11/Edge don't find elements on a `[name='']` query in some cases. 18022 // Adding a temporary attribute to the document before the selection works 18023 // around the issue. 18024 // Interestingly, IE 10 & older don't seem to have the issue. 18025 input = document.createElement( "input" ); 18026 input.setAttribute( "name", "" ); 18027 el.appendChild( input ); 18028 if ( !el.querySelectorAll( "[name='']" ).length ) { 18029 rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + 18030 whitespace + "*(?:''|\"\")" ); 18031 } 18032 18033 // Webkit/Opera - :checked should return selected option elements 18034 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 18035 // IE8 throws error here and will not see later tests 18036 if ( !el.querySelectorAll( ":checked" ).length ) { 18037 rbuggyQSA.push( ":checked" ); 18038 } 18039 18040 // Support: Safari 8+, iOS 8+ 18041 // https://bugs.webkit.org/show_bug.cgi?id=136851 18042 // In-page `selector#id sibling-combinator selector` fails 18043 if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { 18044 rbuggyQSA.push( ".#.+[+~]" ); 18045 } 18046 18047 // Support: Firefox <=3.6 - 5 only 18048 // Old Firefox doesn't throw on a badly-escaped identifier. 18049 el.querySelectorAll( "\\\f" ); 18050 rbuggyQSA.push( "[\\r\\n\\f]" ); 18051 } ); 18052 18053 assert( function( el ) { 18054 el.innerHTML = "<a href='' disabled='disabled'></a>" + 18055 "<select disabled='disabled'><option/></select>"; 18056 18057 // Support: Windows 8 Native Apps 18058 // The type and name attributes are restricted during .innerHTML assignment 18059 var input = document.createElement( "input" ); 18060 input.setAttribute( "type", "hidden" ); 18061 el.appendChild( input ).setAttribute( "name", "D" ); 18062 18063 // Support: IE8 18064 // Enforce case-sensitivity of name attribute 18065 if ( el.querySelectorAll( "[name=d]" ).length ) { 18066 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); 18067 } 18068 18069 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) 18070 // IE8 throws error here and will not see later tests 18071 if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { 18072 rbuggyQSA.push( ":enabled", ":disabled" ); 18073 } 18074 18075 // Support: IE9-11+ 18076 // IE's :disabled selector does not pick up the children of disabled fieldsets 18077 docElem.appendChild( el ).disabled = true; 18078 if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { 18079 rbuggyQSA.push( ":enabled", ":disabled" ); 18080 } 18081 18082 // Support: Opera 10 - 11 only 18083 // Opera 10-11 does not throw on post-comma invalid pseudos 18084 el.querySelectorAll( "*,:x" ); 18085 rbuggyQSA.push( ",.*:" ); 18086 } ); 18087 } 18088 18089 if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || 18090 docElem.webkitMatchesSelector || 18091 docElem.mozMatchesSelector || 18092 docElem.oMatchesSelector || 18093 docElem.msMatchesSelector ) ) ) ) { 18094 18095 assert( function( el ) { 18096 18097 // Check to see if it's possible to do matchesSelector 18098 // on a disconnected node (IE 9) 18099 support.disconnectedMatch = matches.call( el, "*" ); 18100 18101 // This should fail with an exception 18102 // Gecko does not error, returns false instead 18103 matches.call( el, "[s!='']:x" ); 18104 rbuggyMatches.push( "!=", pseudos ); 18105 } ); 18106 } 18107 18108 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); 18109 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); 18110 18111 /* Contains 18112 ---------------------------------------------------------------------- */ 18113 hasCompare = rnative.test( docElem.compareDocumentPosition ); 18114 18115 // Element contains another 18116 // Purposefully self-exclusive 18117 // As in, an element does not contain itself 18118 contains = hasCompare || rnative.test( docElem.contains ) ? 18119 function( a, b ) { 18120 var adown = a.nodeType === 9 ? a.documentElement : a, 18121 bup = b && b.parentNode; 18122 return a === bup || !!( bup && bup.nodeType === 1 && ( 18123 adown.contains ? 18124 adown.contains( bup ) : 18125 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 18126 ) ); 18127 } : 18128 function( a, b ) { 18129 if ( b ) { 18130 while ( ( b = b.parentNode ) ) { 18131 if ( b === a ) { 18132 return true; 18133 } 18134 } 18135 } 18136 return false; 18137 }; 18138 18139 /* Sorting 18140 ---------------------------------------------------------------------- */ 18141 18142 // Document order sorting 18143 sortOrder = hasCompare ? 18144 function( a, b ) { 18145 18146 // Flag for duplicate removal 18147 if ( a === b ) { 18148 hasDuplicate = true; 18149 return 0; 18150 } 18151 18152 // Sort on method existence if only one input has compareDocumentPosition 18153 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; 18154 if ( compare ) { 18155 return compare; 18156 } 18157 18158 // Calculate position if both inputs belong to the same document 18159 // Support: IE 11+, Edge 17 - 18+ 18160 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18161 // two documents; shallow comparisons work. 18162 // eslint-disable-next-line eqeqeq 18163 compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? 18164 a.compareDocumentPosition( b ) : 18165 18166 // Otherwise we know they are disconnected 18167 1; 18168 18169 // Disconnected nodes 18170 if ( compare & 1 || 18171 ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { 18172 18173 // Choose the first element that is related to our preferred document 18174 // Support: IE 11+, Edge 17 - 18+ 18175 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18176 // two documents; shallow comparisons work. 18177 // eslint-disable-next-line eqeqeq 18178 if ( a == document || a.ownerDocument == preferredDoc && 18179 contains( preferredDoc, a ) ) { 18180 return -1; 18181 } 18182 18183 // Support: IE 11+, Edge 17 - 18+ 18184 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18185 // two documents; shallow comparisons work. 18186 // eslint-disable-next-line eqeqeq 18187 if ( b == document || b.ownerDocument == preferredDoc && 18188 contains( preferredDoc, b ) ) { 18189 return 1; 18190 } 18191 18192 // Maintain original order 18193 return sortInput ? 18194 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 18195 0; 18196 } 18197 18198 return compare & 4 ? -1 : 1; 18199 } : 18200 function( a, b ) { 18201 18202 // Exit early if the nodes are identical 18203 if ( a === b ) { 18204 hasDuplicate = true; 18205 return 0; 18206 } 18207 18208 var cur, 18209 i = 0, 18210 aup = a.parentNode, 18211 bup = b.parentNode, 18212 ap = [ a ], 18213 bp = [ b ]; 18214 18215 // Parentless nodes are either documents or disconnected 18216 if ( !aup || !bup ) { 18217 18218 // Support: IE 11+, Edge 17 - 18+ 18219 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18220 // two documents; shallow comparisons work. 18221 /* eslint-disable eqeqeq */ 18222 return a == document ? -1 : 18223 b == document ? 1 : 18224 /* eslint-enable eqeqeq */ 18225 aup ? -1 : 18226 bup ? 1 : 18227 sortInput ? 18228 ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : 18229 0; 18230 18231 // If the nodes are siblings, we can do a quick check 18232 } else if ( aup === bup ) { 18233 return siblingCheck( a, b ); 18234 } 18235 18236 // Otherwise we need full lists of their ancestors for comparison 18237 cur = a; 18238 while ( ( cur = cur.parentNode ) ) { 18239 ap.unshift( cur ); 18240 } 18241 cur = b; 18242 while ( ( cur = cur.parentNode ) ) { 18243 bp.unshift( cur ); 18244 } 18245 18246 // Walk down the tree looking for a discrepancy 18247 while ( ap[ i ] === bp[ i ] ) { 18248 i++; 18249 } 18250 18251 return i ? 18252 18253 // Do a sibling check if the nodes have a common ancestor 18254 siblingCheck( ap[ i ], bp[ i ] ) : 18255 18256 // Otherwise nodes in our document sort first 18257 // Support: IE 11+, Edge 17 - 18+ 18258 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18259 // two documents; shallow comparisons work. 18260 /* eslint-disable eqeqeq */ 18261 ap[ i ] == preferredDoc ? -1 : 18262 bp[ i ] == preferredDoc ? 1 : 18263 /* eslint-enable eqeqeq */ 18264 0; 18265 }; 18266 18267 return document; 18268}; 18269 18270Sizzle.matches = function( expr, elements ) { 18271 return Sizzle( expr, null, null, elements ); 18272}; 18273 18274Sizzle.matchesSelector = function( elem, expr ) { 18275 setDocument( elem ); 18276 18277 if ( support.matchesSelector && documentIsHTML && 18278 !nonnativeSelectorCache[ expr + " " ] && 18279 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && 18280 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { 18281 18282 try { 18283 var ret = matches.call( elem, expr ); 18284 18285 // IE 9's matchesSelector returns false on disconnected nodes 18286 if ( ret || support.disconnectedMatch || 18287 18288 // As well, disconnected nodes are said to be in a document 18289 // fragment in IE 9 18290 elem.document && elem.document.nodeType !== 11 ) { 18291 return ret; 18292 } 18293 } catch ( e ) { 18294 nonnativeSelectorCache( expr, true ); 18295 } 18296 } 18297 18298 return Sizzle( expr, document, null, [ elem ] ).length > 0; 18299}; 18300 18301Sizzle.contains = function( context, elem ) { 18302 18303 // Set document vars if needed 18304 // Support: IE 11+, Edge 17 - 18+ 18305 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18306 // two documents; shallow comparisons work. 18307 // eslint-disable-next-line eqeqeq 18308 if ( ( context.ownerDocument || context ) != document ) { 18309 setDocument( context ); 18310 } 18311 return contains( context, elem ); 18312}; 18313 18314Sizzle.attr = function( elem, name ) { 18315 18316 // Set document vars if needed 18317 // Support: IE 11+, Edge 17 - 18+ 18318 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 18319 // two documents; shallow comparisons work. 18320 // eslint-disable-next-line eqeqeq 18321 if ( ( elem.ownerDocument || elem ) != document ) { 18322 setDocument( elem ); 18323 } 18324 18325 var fn = Expr.attrHandle[ name.toLowerCase() ], 18326 18327 // Don't get fooled by Object.prototype properties (jQuery #13807) 18328 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? 18329 fn( elem, name, !documentIsHTML ) : 18330 undefined; 18331 18332 return val !== undefined ? 18333 val : 18334 support.attributes || !documentIsHTML ? 18335 elem.getAttribute( name ) : 18336 ( val = elem.getAttributeNode( name ) ) && val.specified ? 18337 val.value : 18338 null; 18339}; 18340 18341Sizzle.escape = function( sel ) { 18342 return ( sel + "" ).replace( rcssescape, fcssescape ); 18343}; 18344 18345Sizzle.error = function( msg ) { 18346 throw new Error( "Syntax error, unrecognized expression: " + msg ); 18347}; 18348 18349/** 18350 * Document sorting and removing duplicates 18351 * @param {ArrayLike} results 18352 */ 18353Sizzle.uniqueSort = function( results ) { 18354 var elem, 18355 duplicates = [], 18356 j = 0, 18357 i = 0; 18358 18359 // Unless we *know* we can detect duplicates, assume their presence 18360 hasDuplicate = !support.detectDuplicates; 18361 sortInput = !support.sortStable && results.slice( 0 ); 18362 results.sort( sortOrder ); 18363 18364 if ( hasDuplicate ) { 18365 while ( ( elem = results[ i++ ] ) ) { 18366 if ( elem === results[ i ] ) { 18367 j = duplicates.push( i ); 18368 } 18369 } 18370 while ( j-- ) { 18371 results.splice( duplicates[ j ], 1 ); 18372 } 18373 } 18374 18375 // Clear input after sorting to release objects 18376 // See https://github.com/jquery/sizzle/pull/225 18377 sortInput = null; 18378 18379 return results; 18380}; 18381 18382/** 18383 * Utility function for retrieving the text value of an array of DOM nodes 18384 * @param {Array|Element} elem 18385 */ 18386getText = Sizzle.getText = function( elem ) { 18387 var node, 18388 ret = "", 18389 i = 0, 18390 nodeType = elem.nodeType; 18391 18392 if ( !nodeType ) { 18393 18394 // If no nodeType, this is expected to be an array 18395 while ( ( node = elem[ i++ ] ) ) { 18396 18397 // Do not traverse comment nodes 18398 ret += getText( node ); 18399 } 18400 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { 18401 18402 // Use textContent for elements 18403 // innerText usage removed for consistency of new lines (jQuery #11153) 18404 if ( typeof elem.textContent === "string" ) { 18405 return elem.textContent; 18406 } else { 18407 18408 // Traverse its children 18409 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 18410 ret += getText( elem ); 18411 } 18412 } 18413 } else if ( nodeType === 3 || nodeType === 4 ) { 18414 return elem.nodeValue; 18415 } 18416 18417 // Do not include comment or processing instruction nodes 18418 18419 return ret; 18420}; 18421 18422Expr = Sizzle.selectors = { 18423 18424 // Can be adjusted by the user 18425 cacheLength: 50, 18426 18427 createPseudo: markFunction, 18428 18429 match: matchExpr, 18430 18431 attrHandle: {}, 18432 18433 find: {}, 18434 18435 relative: { 18436 ">": { dir: "parentNode", first: true }, 18437 " ": { dir: "parentNode" }, 18438 "+": { dir: "previousSibling", first: true }, 18439 "~": { dir: "previousSibling" } 18440 }, 18441 18442 preFilter: { 18443 "ATTR": function( match ) { 18444 match[ 1 ] = match[ 1 ].replace( runescape, funescape ); 18445 18446 // Move the given value to match[3] whether quoted or unquoted 18447 match[ 3 ] = ( match[ 3 ] || match[ 4 ] || 18448 match[ 5 ] || "" ).replace( runescape, funescape ); 18449 18450 if ( match[ 2 ] === "~=" ) { 18451 match[ 3 ] = " " + match[ 3 ] + " "; 18452 } 18453 18454 return match.slice( 0, 4 ); 18455 }, 18456 18457 "CHILD": function( match ) { 18458 18459 /* matches from matchExpr["CHILD"] 18460 1 type (only|nth|...) 18461 2 what (child|of-type) 18462 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) 18463 4 xn-component of xn+y argument ([+-]?\d*n|) 18464 5 sign of xn-component 18465 6 x of xn-component 18466 7 sign of y-component 18467 8 y of y-component 18468 */ 18469 match[ 1 ] = match[ 1 ].toLowerCase(); 18470 18471 if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { 18472 18473 // nth-* requires argument 18474 if ( !match[ 3 ] ) { 18475 Sizzle.error( match[ 0 ] ); 18476 } 18477 18478 // numeric x and y parameters for Expr.filter.CHILD 18479 // remember that false/true cast respectively to 0/1 18480 match[ 4 ] = +( match[ 4 ] ? 18481 match[ 5 ] + ( match[ 6 ] || 1 ) : 18482 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); 18483 match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); 18484 18485 // other types prohibit arguments 18486 } else if ( match[ 3 ] ) { 18487 Sizzle.error( match[ 0 ] ); 18488 } 18489 18490 return match; 18491 }, 18492 18493 "PSEUDO": function( match ) { 18494 var excess, 18495 unquoted = !match[ 6 ] && match[ 2 ]; 18496 18497 if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { 18498 return null; 18499 } 18500 18501 // Accept quoted arguments as-is 18502 if ( match[ 3 ] ) { 18503 match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; 18504 18505 // Strip excess characters from unquoted arguments 18506 } else if ( unquoted && rpseudo.test( unquoted ) && 18507 18508 // Get excess from tokenize (recursively) 18509 ( excess = tokenize( unquoted, true ) ) && 18510 18511 // advance to the next closing parenthesis 18512 ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { 18513 18514 // excess is a negative index 18515 match[ 0 ] = match[ 0 ].slice( 0, excess ); 18516 match[ 2 ] = unquoted.slice( 0, excess ); 18517 } 18518 18519 // Return only captures needed by the pseudo filter method (type and argument) 18520 return match.slice( 0, 3 ); 18521 } 18522 }, 18523 18524 filter: { 18525 18526 "TAG": function( nodeNameSelector ) { 18527 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); 18528 return nodeNameSelector === "*" ? 18529 function() { 18530 return true; 18531 } : 18532 function( elem ) { 18533 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; 18534 }; 18535 }, 18536 18537 "CLASS": function( className ) { 18538 var pattern = classCache[ className + " " ]; 18539 18540 return pattern || 18541 ( pattern = new RegExp( "(^|" + whitespace + 18542 ")" + className + "(" + whitespace + "|$)" ) ) && classCache( 18543 className, function( elem ) { 18544 return pattern.test( 18545 typeof elem.className === "string" && elem.className || 18546 typeof elem.getAttribute !== "undefined" && 18547 elem.getAttribute( "class" ) || 18548 "" 18549 ); 18550 } ); 18551 }, 18552 18553 "ATTR": function( name, operator, check ) { 18554 return function( elem ) { 18555 var result = Sizzle.attr( elem, name ); 18556 18557 if ( result == null ) { 18558 return operator === "!="; 18559 } 18560 if ( !operator ) { 18561 return true; 18562 } 18563 18564 result += ""; 18565 18566 /* eslint-disable max-len */ 18567 18568 return operator === "=" ? result === check : 18569 operator === "!=" ? result !== check : 18570 operator === "^=" ? check && result.indexOf( check ) === 0 : 18571 operator === "*=" ? check && result.indexOf( check ) > -1 : 18572 operator === "$=" ? check && result.slice( -check.length ) === check : 18573 operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : 18574 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : 18575 false; 18576 /* eslint-enable max-len */ 18577 18578 }; 18579 }, 18580 18581 "CHILD": function( type, what, _argument, first, last ) { 18582 var simple = type.slice( 0, 3 ) !== "nth", 18583 forward = type.slice( -4 ) !== "last", 18584 ofType = what === "of-type"; 18585 18586 return first === 1 && last === 0 ? 18587 18588 // Shortcut for :nth-*(n) 18589 function( elem ) { 18590 return !!elem.parentNode; 18591 } : 18592 18593 function( elem, _context, xml ) { 18594 var cache, uniqueCache, outerCache, node, nodeIndex, start, 18595 dir = simple !== forward ? "nextSibling" : "previousSibling", 18596 parent = elem.parentNode, 18597 name = ofType && elem.nodeName.toLowerCase(), 18598 useCache = !xml && !ofType, 18599 diff = false; 18600 18601 if ( parent ) { 18602 18603 // :(first|last|only)-(child|of-type) 18604 if ( simple ) { 18605 while ( dir ) { 18606 node = elem; 18607 while ( ( node = node[ dir ] ) ) { 18608 if ( ofType ? 18609 node.nodeName.toLowerCase() === name : 18610 node.nodeType === 1 ) { 18611 18612 return false; 18613 } 18614 } 18615 18616 // Reverse direction for :only-* (if we haven't yet done so) 18617 start = dir = type === "only" && !start && "nextSibling"; 18618 } 18619 return true; 18620 } 18621 18622 start = [ forward ? parent.firstChild : parent.lastChild ]; 18623 18624 // non-xml :nth-child(...) stores cache data on `parent` 18625 if ( forward && useCache ) { 18626 18627 // Seek `elem` from a previously-cached index 18628 18629 // ...in a gzip-friendly way 18630 node = parent; 18631 outerCache = node[ expando ] || ( node[ expando ] = {} ); 18632 18633 // Support: IE <9 only 18634 // Defend against cloned attroperties (jQuery gh-1709) 18635 uniqueCache = outerCache[ node.uniqueID ] || 18636 ( outerCache[ node.uniqueID ] = {} ); 18637 18638 cache = uniqueCache[ type ] || []; 18639 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 18640 diff = nodeIndex && cache[ 2 ]; 18641 node = nodeIndex && parent.childNodes[ nodeIndex ]; 18642 18643 while ( ( node = ++nodeIndex && node && node[ dir ] || 18644 18645 // Fallback to seeking `elem` from the start 18646 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 18647 18648 // When found, cache indexes on `parent` and break 18649 if ( node.nodeType === 1 && ++diff && node === elem ) { 18650 uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; 18651 break; 18652 } 18653 } 18654 18655 } else { 18656 18657 // Use previously-cached element index if available 18658 if ( useCache ) { 18659 18660 // ...in a gzip-friendly way 18661 node = elem; 18662 outerCache = node[ expando ] || ( node[ expando ] = {} ); 18663 18664 // Support: IE <9 only 18665 // Defend against cloned attroperties (jQuery gh-1709) 18666 uniqueCache = outerCache[ node.uniqueID ] || 18667 ( outerCache[ node.uniqueID ] = {} ); 18668 18669 cache = uniqueCache[ type ] || []; 18670 nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; 18671 diff = nodeIndex; 18672 } 18673 18674 // xml :nth-child(...) 18675 // or :nth-last-child(...) or :nth(-last)?-of-type(...) 18676 if ( diff === false ) { 18677 18678 // Use the same loop as above to seek `elem` from the start 18679 while ( ( node = ++nodeIndex && node && node[ dir ] || 18680 ( diff = nodeIndex = 0 ) || start.pop() ) ) { 18681 18682 if ( ( ofType ? 18683 node.nodeName.toLowerCase() === name : 18684 node.nodeType === 1 ) && 18685 ++diff ) { 18686 18687 // Cache the index of each encountered element 18688 if ( useCache ) { 18689 outerCache = node[ expando ] || 18690 ( node[ expando ] = {} ); 18691 18692 // Support: IE <9 only 18693 // Defend against cloned attroperties (jQuery gh-1709) 18694 uniqueCache = outerCache[ node.uniqueID ] || 18695 ( outerCache[ node.uniqueID ] = {} ); 18696 18697 uniqueCache[ type ] = [ dirruns, diff ]; 18698 } 18699 18700 if ( node === elem ) { 18701 break; 18702 } 18703 } 18704 } 18705 } 18706 } 18707 18708 // Incorporate the offset, then check against cycle size 18709 diff -= last; 18710 return diff === first || ( diff % first === 0 && diff / first >= 0 ); 18711 } 18712 }; 18713 }, 18714 18715 "PSEUDO": function( pseudo, argument ) { 18716 18717 // pseudo-class names are case-insensitive 18718 // http://www.w3.org/TR/selectors/#pseudo-classes 18719 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters 18720 // Remember that setFilters inherits from pseudos 18721 var args, 18722 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || 18723 Sizzle.error( "unsupported pseudo: " + pseudo ); 18724 18725 // The user may use createPseudo to indicate that 18726 // arguments are needed to create the filter function 18727 // just as Sizzle does 18728 if ( fn[ expando ] ) { 18729 return fn( argument ); 18730 } 18731 18732 // But maintain support for old signatures 18733 if ( fn.length > 1 ) { 18734 args = [ pseudo, pseudo, "", argument ]; 18735 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? 18736 markFunction( function( seed, matches ) { 18737 var idx, 18738 matched = fn( seed, argument ), 18739 i = matched.length; 18740 while ( i-- ) { 18741 idx = indexOf( seed, matched[ i ] ); 18742 seed[ idx ] = !( matches[ idx ] = matched[ i ] ); 18743 } 18744 } ) : 18745 function( elem ) { 18746 return fn( elem, 0, args ); 18747 }; 18748 } 18749 18750 return fn; 18751 } 18752 }, 18753 18754 pseudos: { 18755 18756 // Potentially complex pseudos 18757 "not": markFunction( function( selector ) { 18758 18759 // Trim the selector passed to compile 18760 // to avoid treating leading and trailing 18761 // spaces as combinators 18762 var input = [], 18763 results = [], 18764 matcher = compile( selector.replace( rtrim, "$1" ) ); 18765 18766 return matcher[ expando ] ? 18767 markFunction( function( seed, matches, _context, xml ) { 18768 var elem, 18769 unmatched = matcher( seed, null, xml, [] ), 18770 i = seed.length; 18771 18772 // Match elements unmatched by `matcher` 18773 while ( i-- ) { 18774 if ( ( elem = unmatched[ i ] ) ) { 18775 seed[ i ] = !( matches[ i ] = elem ); 18776 } 18777 } 18778 } ) : 18779 function( elem, _context, xml ) { 18780 input[ 0 ] = elem; 18781 matcher( input, null, xml, results ); 18782 18783 // Don't keep the element (issue #299) 18784 input[ 0 ] = null; 18785 return !results.pop(); 18786 }; 18787 } ), 18788 18789 "has": markFunction( function( selector ) { 18790 return function( elem ) { 18791 return Sizzle( selector, elem ).length > 0; 18792 }; 18793 } ), 18794 18795 "contains": markFunction( function( text ) { 18796 text = text.replace( runescape, funescape ); 18797 return function( elem ) { 18798 return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; 18799 }; 18800 } ), 18801 18802 // "Whether an element is represented by a :lang() selector 18803 // is based solely on the element's language value 18804 // being equal to the identifier C, 18805 // or beginning with the identifier C immediately followed by "-". 18806 // The matching of C against the element's language value is performed case-insensitively. 18807 // The identifier C does not have to be a valid language name." 18808 // http://www.w3.org/TR/selectors/#lang-pseudo 18809 "lang": markFunction( function( lang ) { 18810 18811 // lang value must be a valid identifier 18812 if ( !ridentifier.test( lang || "" ) ) { 18813 Sizzle.error( "unsupported lang: " + lang ); 18814 } 18815 lang = lang.replace( runescape, funescape ).toLowerCase(); 18816 return function( elem ) { 18817 var elemLang; 18818 do { 18819 if ( ( elemLang = documentIsHTML ? 18820 elem.lang : 18821 elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { 18822 18823 elemLang = elemLang.toLowerCase(); 18824 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; 18825 } 18826 } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); 18827 return false; 18828 }; 18829 } ), 18830 18831 // Miscellaneous 18832 "target": function( elem ) { 18833 var hash = window.location && window.location.hash; 18834 return hash && hash.slice( 1 ) === elem.id; 18835 }, 18836 18837 "root": function( elem ) { 18838 return elem === docElem; 18839 }, 18840 18841 "focus": function( elem ) { 18842 return elem === document.activeElement && 18843 ( !document.hasFocus || document.hasFocus() ) && 18844 !!( elem.type || elem.href || ~elem.tabIndex ); 18845 }, 18846 18847 // Boolean properties 18848 "enabled": createDisabledPseudo( false ), 18849 "disabled": createDisabledPseudo( true ), 18850 18851 "checked": function( elem ) { 18852 18853 // In CSS3, :checked should return both checked and selected elements 18854 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked 18855 var nodeName = elem.nodeName.toLowerCase(); 18856 return ( nodeName === "input" && !!elem.checked ) || 18857 ( nodeName === "option" && !!elem.selected ); 18858 }, 18859 18860 "selected": function( elem ) { 18861 18862 // Accessing this property makes selected-by-default 18863 // options in Safari work properly 18864 if ( elem.parentNode ) { 18865 // eslint-disable-next-line no-unused-expressions 18866 elem.parentNode.selectedIndex; 18867 } 18868 18869 return elem.selected === true; 18870 }, 18871 18872 // Contents 18873 "empty": function( elem ) { 18874 18875 // http://www.w3.org/TR/selectors/#empty-pseudo 18876 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), 18877 // but not by others (comment: 8; processing instruction: 7; etc.) 18878 // nodeType < 6 works because attributes (2) do not appear as children 18879 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { 18880 if ( elem.nodeType < 6 ) { 18881 return false; 18882 } 18883 } 18884 return true; 18885 }, 18886 18887 "parent": function( elem ) { 18888 return !Expr.pseudos[ "empty" ]( elem ); 18889 }, 18890 18891 // Element/input types 18892 "header": function( elem ) { 18893 return rheader.test( elem.nodeName ); 18894 }, 18895 18896 "input": function( elem ) { 18897 return rinputs.test( elem.nodeName ); 18898 }, 18899 18900 "button": function( elem ) { 18901 var name = elem.nodeName.toLowerCase(); 18902 return name === "input" && elem.type === "button" || name === "button"; 18903 }, 18904 18905 "text": function( elem ) { 18906 var attr; 18907 return elem.nodeName.toLowerCase() === "input" && 18908 elem.type === "text" && 18909 18910 // Support: IE<8 18911 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" 18912 ( ( attr = elem.getAttribute( "type" ) ) == null || 18913 attr.toLowerCase() === "text" ); 18914 }, 18915 18916 // Position-in-collection 18917 "first": createPositionalPseudo( function() { 18918 return [ 0 ]; 18919 } ), 18920 18921 "last": createPositionalPseudo( function( _matchIndexes, length ) { 18922 return [ length - 1 ]; 18923 } ), 18924 18925 "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { 18926 return [ argument < 0 ? argument + length : argument ]; 18927 } ), 18928 18929 "even": createPositionalPseudo( function( matchIndexes, length ) { 18930 var i = 0; 18931 for ( ; i < length; i += 2 ) { 18932 matchIndexes.push( i ); 18933 } 18934 return matchIndexes; 18935 } ), 18936 18937 "odd": createPositionalPseudo( function( matchIndexes, length ) { 18938 var i = 1; 18939 for ( ; i < length; i += 2 ) { 18940 matchIndexes.push( i ); 18941 } 18942 return matchIndexes; 18943 } ), 18944 18945 "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { 18946 var i = argument < 0 ? 18947 argument + length : 18948 argument > length ? 18949 length : 18950 argument; 18951 for ( ; --i >= 0; ) { 18952 matchIndexes.push( i ); 18953 } 18954 return matchIndexes; 18955 } ), 18956 18957 "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { 18958 var i = argument < 0 ? argument + length : argument; 18959 for ( ; ++i < length; ) { 18960 matchIndexes.push( i ); 18961 } 18962 return matchIndexes; 18963 } ) 18964 } 18965}; 18966 18967Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; 18968 18969// Add button/input type pseudos 18970for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { 18971 Expr.pseudos[ i ] = createInputPseudo( i ); 18972} 18973for ( i in { submit: true, reset: true } ) { 18974 Expr.pseudos[ i ] = createButtonPseudo( i ); 18975} 18976 18977// Easy API for creating new setFilters 18978function setFilters() {} 18979setFilters.prototype = Expr.filters = Expr.pseudos; 18980Expr.setFilters = new setFilters(); 18981 18982tokenize = Sizzle.tokenize = function( selector, parseOnly ) { 18983 var matched, match, tokens, type, 18984 soFar, groups, preFilters, 18985 cached = tokenCache[ selector + " " ]; 18986 18987 if ( cached ) { 18988 return parseOnly ? 0 : cached.slice( 0 ); 18989 } 18990 18991 soFar = selector; 18992 groups = []; 18993 preFilters = Expr.preFilter; 18994 18995 while ( soFar ) { 18996 18997 // Comma and first run 18998 if ( !matched || ( match = rcomma.exec( soFar ) ) ) { 18999 if ( match ) { 19000 19001 // Don't consume trailing commas as valid 19002 soFar = soFar.slice( match[ 0 ].length ) || soFar; 19003 } 19004 groups.push( ( tokens = [] ) ); 19005 } 19006 19007 matched = false; 19008 19009 // Combinators 19010 if ( ( match = rcombinators.exec( soFar ) ) ) { 19011 matched = match.shift(); 19012 tokens.push( { 19013 value: matched, 19014 19015 // Cast descendant combinators to space 19016 type: match[ 0 ].replace( rtrim, " " ) 19017 } ); 19018 soFar = soFar.slice( matched.length ); 19019 } 19020 19021 // Filters 19022 for ( type in Expr.filter ) { 19023 if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || 19024 ( match = preFilters[ type ]( match ) ) ) ) { 19025 matched = match.shift(); 19026 tokens.push( { 19027 value: matched, 19028 type: type, 19029 matches: match 19030 } ); 19031 soFar = soFar.slice( matched.length ); 19032 } 19033 } 19034 19035 if ( !matched ) { 19036 break; 19037 } 19038 } 19039 19040 // Return the length of the invalid excess 19041 // if we're just parsing 19042 // Otherwise, throw an error or return tokens 19043 return parseOnly ? 19044 soFar.length : 19045 soFar ? 19046 Sizzle.error( selector ) : 19047 19048 // Cache the tokens 19049 tokenCache( selector, groups ).slice( 0 ); 19050}; 19051 19052function toSelector( tokens ) { 19053 var i = 0, 19054 len = tokens.length, 19055 selector = ""; 19056 for ( ; i < len; i++ ) { 19057 selector += tokens[ i ].value; 19058 } 19059 return selector; 19060} 19061 19062function addCombinator( matcher, combinator, base ) { 19063 var dir = combinator.dir, 19064 skip = combinator.next, 19065 key = skip || dir, 19066 checkNonElements = base && key === "parentNode", 19067 doneName = done++; 19068 19069 return combinator.first ? 19070 19071 // Check against closest ancestor/preceding element 19072 function( elem, context, xml ) { 19073 while ( ( elem = elem[ dir ] ) ) { 19074 if ( elem.nodeType === 1 || checkNonElements ) { 19075 return matcher( elem, context, xml ); 19076 } 19077 } 19078 return false; 19079 } : 19080 19081 // Check against all ancestor/preceding elements 19082 function( elem, context, xml ) { 19083 var oldCache, uniqueCache, outerCache, 19084 newCache = [ dirruns, doneName ]; 19085 19086 // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching 19087 if ( xml ) { 19088 while ( ( elem = elem[ dir ] ) ) { 19089 if ( elem.nodeType === 1 || checkNonElements ) { 19090 if ( matcher( elem, context, xml ) ) { 19091 return true; 19092 } 19093 } 19094 } 19095 } else { 19096 while ( ( elem = elem[ dir ] ) ) { 19097 if ( elem.nodeType === 1 || checkNonElements ) { 19098 outerCache = elem[ expando ] || ( elem[ expando ] = {} ); 19099 19100 // Support: IE <9 only 19101 // Defend against cloned attroperties (jQuery gh-1709) 19102 uniqueCache = outerCache[ elem.uniqueID ] || 19103 ( outerCache[ elem.uniqueID ] = {} ); 19104 19105 if ( skip && skip === elem.nodeName.toLowerCase() ) { 19106 elem = elem[ dir ] || elem; 19107 } else if ( ( oldCache = uniqueCache[ key ] ) && 19108 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { 19109 19110 // Assign to newCache so results back-propagate to previous elements 19111 return ( newCache[ 2 ] = oldCache[ 2 ] ); 19112 } else { 19113 19114 // Reuse newcache so results back-propagate to previous elements 19115 uniqueCache[ key ] = newCache; 19116 19117 // A match means we're done; a fail means we have to keep checking 19118 if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { 19119 return true; 19120 } 19121 } 19122 } 19123 } 19124 } 19125 return false; 19126 }; 19127} 19128 19129function elementMatcher( matchers ) { 19130 return matchers.length > 1 ? 19131 function( elem, context, xml ) { 19132 var i = matchers.length; 19133 while ( i-- ) { 19134 if ( !matchers[ i ]( elem, context, xml ) ) { 19135 return false; 19136 } 19137 } 19138 return true; 19139 } : 19140 matchers[ 0 ]; 19141} 19142 19143function multipleContexts( selector, contexts, results ) { 19144 var i = 0, 19145 len = contexts.length; 19146 for ( ; i < len; i++ ) { 19147 Sizzle( selector, contexts[ i ], results ); 19148 } 19149 return results; 19150} 19151 19152function condense( unmatched, map, filter, context, xml ) { 19153 var elem, 19154 newUnmatched = [], 19155 i = 0, 19156 len = unmatched.length, 19157 mapped = map != null; 19158 19159 for ( ; i < len; i++ ) { 19160 if ( ( elem = unmatched[ i ] ) ) { 19161 if ( !filter || filter( elem, context, xml ) ) { 19162 newUnmatched.push( elem ); 19163 if ( mapped ) { 19164 map.push( i ); 19165 } 19166 } 19167 } 19168 } 19169 19170 return newUnmatched; 19171} 19172 19173function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { 19174 if ( postFilter && !postFilter[ expando ] ) { 19175 postFilter = setMatcher( postFilter ); 19176 } 19177 if ( postFinder && !postFinder[ expando ] ) { 19178 postFinder = setMatcher( postFinder, postSelector ); 19179 } 19180 return markFunction( function( seed, results, context, xml ) { 19181 var temp, i, elem, 19182 preMap = [], 19183 postMap = [], 19184 preexisting = results.length, 19185 19186 // Get initial elements from seed or context 19187 elems = seed || multipleContexts( 19188 selector || "*", 19189 context.nodeType ? [ context ] : context, 19190 [] 19191 ), 19192 19193 // Prefilter to get matcher input, preserving a map for seed-results synchronization 19194 matcherIn = preFilter && ( seed || !selector ) ? 19195 condense( elems, preMap, preFilter, context, xml ) : 19196 elems, 19197 19198 matcherOut = matcher ? 19199 19200 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, 19201 postFinder || ( seed ? preFilter : preexisting || postFilter ) ? 19202 19203 // ...intermediate processing is necessary 19204 [] : 19205 19206 // ...otherwise use results directly 19207 results : 19208 matcherIn; 19209 19210 // Find primary matches 19211 if ( matcher ) { 19212 matcher( matcherIn, matcherOut, context, xml ); 19213 } 19214 19215 // Apply postFilter 19216 if ( postFilter ) { 19217 temp = condense( matcherOut, postMap ); 19218 postFilter( temp, [], context, xml ); 19219 19220 // Un-match failing elements by moving them back to matcherIn 19221 i = temp.length; 19222 while ( i-- ) { 19223 if ( ( elem = temp[ i ] ) ) { 19224 matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); 19225 } 19226 } 19227 } 19228 19229 if ( seed ) { 19230 if ( postFinder || preFilter ) { 19231 if ( postFinder ) { 19232 19233 // Get the final matcherOut by condensing this intermediate into postFinder contexts 19234 temp = []; 19235 i = matcherOut.length; 19236 while ( i-- ) { 19237 if ( ( elem = matcherOut[ i ] ) ) { 19238 19239 // Restore matcherIn since elem is not yet a final match 19240 temp.push( ( matcherIn[ i ] = elem ) ); 19241 } 19242 } 19243 postFinder( null, ( matcherOut = [] ), temp, xml ); 19244 } 19245 19246 // Move matched elements from seed to results to keep them synchronized 19247 i = matcherOut.length; 19248 while ( i-- ) { 19249 if ( ( elem = matcherOut[ i ] ) && 19250 ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { 19251 19252 seed[ temp ] = !( results[ temp ] = elem ); 19253 } 19254 } 19255 } 19256 19257 // Add elements to results, through postFinder if defined 19258 } else { 19259 matcherOut = condense( 19260 matcherOut === results ? 19261 matcherOut.splice( preexisting, matcherOut.length ) : 19262 matcherOut 19263 ); 19264 if ( postFinder ) { 19265 postFinder( null, results, matcherOut, xml ); 19266 } else { 19267 push.apply( results, matcherOut ); 19268 } 19269 } 19270 } ); 19271} 19272 19273function matcherFromTokens( tokens ) { 19274 var checkContext, matcher, j, 19275 len = tokens.length, 19276 leadingRelative = Expr.relative[ tokens[ 0 ].type ], 19277 implicitRelative = leadingRelative || Expr.relative[ " " ], 19278 i = leadingRelative ? 1 : 0, 19279 19280 // The foundational matcher ensures that elements are reachable from top-level context(s) 19281 matchContext = addCombinator( function( elem ) { 19282 return elem === checkContext; 19283 }, implicitRelative, true ), 19284 matchAnyContext = addCombinator( function( elem ) { 19285 return indexOf( checkContext, elem ) > -1; 19286 }, implicitRelative, true ), 19287 matchers = [ function( elem, context, xml ) { 19288 var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( 19289 ( checkContext = context ).nodeType ? 19290 matchContext( elem, context, xml ) : 19291 matchAnyContext( elem, context, xml ) ); 19292 19293 // Avoid hanging onto element (issue #299) 19294 checkContext = null; 19295 return ret; 19296 } ]; 19297 19298 for ( ; i < len; i++ ) { 19299 if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { 19300 matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; 19301 } else { 19302 matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); 19303 19304 // Return special upon seeing a positional matcher 19305 if ( matcher[ expando ] ) { 19306 19307 // Find the next relative operator (if any) for proper handling 19308 j = ++i; 19309 for ( ; j < len; j++ ) { 19310 if ( Expr.relative[ tokens[ j ].type ] ) { 19311 break; 19312 } 19313 } 19314 return setMatcher( 19315 i > 1 && elementMatcher( matchers ), 19316 i > 1 && toSelector( 19317 19318 // If the preceding token was a descendant combinator, insert an implicit any-element `*` 19319 tokens 19320 .slice( 0, i - 1 ) 19321 .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) 19322 ).replace( rtrim, "$1" ), 19323 matcher, 19324 i < j && matcherFromTokens( tokens.slice( i, j ) ), 19325 j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), 19326 j < len && toSelector( tokens ) 19327 ); 19328 } 19329 matchers.push( matcher ); 19330 } 19331 } 19332 19333 return elementMatcher( matchers ); 19334} 19335 19336function matcherFromGroupMatchers( elementMatchers, setMatchers ) { 19337 var bySet = setMatchers.length > 0, 19338 byElement = elementMatchers.length > 0, 19339 superMatcher = function( seed, context, xml, results, outermost ) { 19340 var elem, j, matcher, 19341 matchedCount = 0, 19342 i = "0", 19343 unmatched = seed && [], 19344 setMatched = [], 19345 contextBackup = outermostContext, 19346 19347 // We must always have either seed elements or outermost context 19348 elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), 19349 19350 // Use integer dirruns iff this is the outermost matcher 19351 dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), 19352 len = elems.length; 19353 19354 if ( outermost ) { 19355 19356 // Support: IE 11+, Edge 17 - 18+ 19357 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 19358 // two documents; shallow comparisons work. 19359 // eslint-disable-next-line eqeqeq 19360 outermostContext = context == document || context || outermost; 19361 } 19362 19363 // Add elements passing elementMatchers directly to results 19364 // Support: IE<9, Safari 19365 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id 19366 for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { 19367 if ( byElement && elem ) { 19368 j = 0; 19369 19370 // Support: IE 11+, Edge 17 - 18+ 19371 // IE/Edge sometimes throw a "Permission denied" error when strict-comparing 19372 // two documents; shallow comparisons work. 19373 // eslint-disable-next-line eqeqeq 19374 if ( !context && elem.ownerDocument != document ) { 19375 setDocument( elem ); 19376 xml = !documentIsHTML; 19377 } 19378 while ( ( matcher = elementMatchers[ j++ ] ) ) { 19379 if ( matcher( elem, context || document, xml ) ) { 19380 results.push( elem ); 19381 break; 19382 } 19383 } 19384 if ( outermost ) { 19385 dirruns = dirrunsUnique; 19386 } 19387 } 19388 19389 // Track unmatched elements for set filters 19390 if ( bySet ) { 19391 19392 // They will have gone through all possible matchers 19393 if ( ( elem = !matcher && elem ) ) { 19394 matchedCount--; 19395 } 19396 19397 // Lengthen the array for every element, matched or not 19398 if ( seed ) { 19399 unmatched.push( elem ); 19400 } 19401 } 19402 } 19403 19404 // `i` is now the count of elements visited above, and adding it to `matchedCount` 19405 // makes the latter nonnegative. 19406 matchedCount += i; 19407 19408 // Apply set filters to unmatched elements 19409 // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` 19410 // equals `i`), unless we didn't visit _any_ elements in the above loop because we have 19411 // no element matchers and no seed. 19412 // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that 19413 // case, which will result in a "00" `matchedCount` that differs from `i` but is also 19414 // numerically zero. 19415 if ( bySet && i !== matchedCount ) { 19416 j = 0; 19417 while ( ( matcher = setMatchers[ j++ ] ) ) { 19418 matcher( unmatched, setMatched, context, xml ); 19419 } 19420 19421 if ( seed ) { 19422 19423 // Reintegrate element matches to eliminate the need for sorting 19424 if ( matchedCount > 0 ) { 19425 while ( i-- ) { 19426 if ( !( unmatched[ i ] || setMatched[ i ] ) ) { 19427 setMatched[ i ] = pop.call( results ); 19428 } 19429 } 19430 } 19431 19432 // Discard index placeholder values to get only actual matches 19433 setMatched = condense( setMatched ); 19434 } 19435 19436 // Add matches to results 19437 push.apply( results, setMatched ); 19438 19439 // Seedless set matches succeeding multiple successful matchers stipulate sorting 19440 if ( outermost && !seed && setMatched.length > 0 && 19441 ( matchedCount + setMatchers.length ) > 1 ) { 19442 19443 Sizzle.uniqueSort( results ); 19444 } 19445 } 19446 19447 // Override manipulation of globals by nested matchers 19448 if ( outermost ) { 19449 dirruns = dirrunsUnique; 19450 outermostContext = contextBackup; 19451 } 19452 19453 return unmatched; 19454 }; 19455 19456 return bySet ? 19457 markFunction( superMatcher ) : 19458 superMatcher; 19459} 19460 19461compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { 19462 var i, 19463 setMatchers = [], 19464 elementMatchers = [], 19465 cached = compilerCache[ selector + " " ]; 19466 19467 if ( !cached ) { 19468 19469 // Generate a function of recursive functions that can be used to check each element 19470 if ( !match ) { 19471 match = tokenize( selector ); 19472 } 19473 i = match.length; 19474 while ( i-- ) { 19475 cached = matcherFromTokens( match[ i ] ); 19476 if ( cached[ expando ] ) { 19477 setMatchers.push( cached ); 19478 } else { 19479 elementMatchers.push( cached ); 19480 } 19481 } 19482 19483 // Cache the compiled function 19484 cached = compilerCache( 19485 selector, 19486 matcherFromGroupMatchers( elementMatchers, setMatchers ) 19487 ); 19488 19489 // Save selector and tokenization 19490 cached.selector = selector; 19491 } 19492 return cached; 19493}; 19494 19495/** 19496 * A low-level selection function that works with Sizzle's compiled 19497 * selector functions 19498 * @param {String|Function} selector A selector or a pre-compiled 19499 * selector function built with Sizzle.compile 19500 * @param {Element} context 19501 * @param {Array} [results] 19502 * @param {Array} [seed] A set of elements to match against 19503 */ 19504select = Sizzle.select = function( selector, context, results, seed ) { 19505 var i, tokens, token, type, find, 19506 compiled = typeof selector === "function" && selector, 19507 match = !seed && tokenize( ( selector = compiled.selector || selector ) ); 19508 19509 results = results || []; 19510 19511 // Try to minimize operations if there is only one selector in the list and no seed 19512 // (the latter of which guarantees us context) 19513 if ( match.length === 1 ) { 19514 19515 // Reduce context if the leading compound selector is an ID 19516 tokens = match[ 0 ] = match[ 0 ].slice( 0 ); 19517 if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && 19518 context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { 19519 19520 context = ( Expr.find[ "ID" ]( token.matches[ 0 ] 19521 .replace( runescape, funescape ), context ) || [] )[ 0 ]; 19522 if ( !context ) { 19523 return results; 19524 19525 // Precompiled matchers will still verify ancestry, so step up a level 19526 } else if ( compiled ) { 19527 context = context.parentNode; 19528 } 19529 19530 selector = selector.slice( tokens.shift().value.length ); 19531 } 19532 19533 // Fetch a seed set for right-to-left matching 19534 i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; 19535 while ( i-- ) { 19536 token = tokens[ i ]; 19537 19538 // Abort if we hit a combinator 19539 if ( Expr.relative[ ( type = token.type ) ] ) { 19540 break; 19541 } 19542 if ( ( find = Expr.find[ type ] ) ) { 19543 19544 // Search, expanding context for leading sibling combinators 19545 if ( ( seed = find( 19546 token.matches[ 0 ].replace( runescape, funescape ), 19547 rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || 19548 context 19549 ) ) ) { 19550 19551 // If seed is empty or no tokens remain, we can return early 19552 tokens.splice( i, 1 ); 19553 selector = seed.length && toSelector( tokens ); 19554 if ( !selector ) { 19555 push.apply( results, seed ); 19556 return results; 19557 } 19558 19559 break; 19560 } 19561 } 19562 } 19563 } 19564 19565 // Compile and execute a filtering function if one is not provided 19566 // Provide `match` to avoid retokenization if we modified the selector above 19567 ( compiled || compile( selector, match ) )( 19568 seed, 19569 context, 19570 !documentIsHTML, 19571 results, 19572 !context || rsibling.test( selector ) && testContext( context.parentNode ) || context 19573 ); 19574 return results; 19575}; 19576 19577// One-time assignments 19578 19579// Sort stability 19580support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; 19581 19582// Support: Chrome 14-35+ 19583// Always assume duplicates if they aren't passed to the comparison function 19584support.detectDuplicates = !!hasDuplicate; 19585 19586// Initialize against the default document 19587setDocument(); 19588 19589// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) 19590// Detached nodes confoundingly follow *each other* 19591support.sortDetached = assert( function( el ) { 19592 19593 // Should return 1, but returns 4 (following) 19594 return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; 19595} ); 19596 19597// Support: IE<8 19598// Prevent attribute/property "interpolation" 19599// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx 19600if ( !assert( function( el ) { 19601 el.innerHTML = "<a href='#'></a>"; 19602 return el.firstChild.getAttribute( "href" ) === "#"; 19603} ) ) { 19604 addHandle( "type|href|height|width", function( elem, name, isXML ) { 19605 if ( !isXML ) { 19606 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); 19607 } 19608 } ); 19609} 19610 19611// Support: IE<9 19612// Use defaultValue in place of getAttribute("value") 19613if ( !support.attributes || !assert( function( el ) { 19614 el.innerHTML = "<input/>"; 19615 el.firstChild.setAttribute( "value", "" ); 19616 return el.firstChild.getAttribute( "value" ) === ""; 19617} ) ) { 19618 addHandle( "value", function( elem, _name, isXML ) { 19619 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { 19620 return elem.defaultValue; 19621 } 19622 } ); 19623} 19624 19625// Support: IE<9 19626// Use getAttributeNode to fetch booleans when getAttribute lies 19627if ( !assert( function( el ) { 19628 return el.getAttribute( "disabled" ) == null; 19629} ) ) { 19630 addHandle( booleans, function( elem, name, isXML ) { 19631 var val; 19632 if ( !isXML ) { 19633 return elem[ name ] === true ? name.toLowerCase() : 19634 ( val = elem.getAttributeNode( name ) ) && val.specified ? 19635 val.value : 19636 null; 19637 } 19638 } ); 19639} 19640 19641return Sizzle; 19642 19643} )( window ); 19644 19645 19646 19647jQuery.find = Sizzle; 19648jQuery.expr = Sizzle.selectors; 19649 19650// Deprecated 19651jQuery.expr[ ":" ] = jQuery.expr.pseudos; 19652jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; 19653jQuery.text = Sizzle.getText; 19654jQuery.isXMLDoc = Sizzle.isXML; 19655jQuery.contains = Sizzle.contains; 19656jQuery.escapeSelector = Sizzle.escape; 19657 19658 19659 19660 19661var dir = function( elem, dir, until ) { 19662 var matched = [], 19663 truncate = until !== undefined; 19664 19665 while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { 19666 if ( elem.nodeType === 1 ) { 19667 if ( truncate && jQuery( elem ).is( until ) ) { 19668 break; 19669 } 19670 matched.push( elem ); 19671 } 19672 } 19673 return matched; 19674}; 19675 19676 19677var siblings = function( n, elem ) { 19678 var matched = []; 19679 19680 for ( ; n; n = n.nextSibling ) { 19681 if ( n.nodeType === 1 && n !== elem ) { 19682 matched.push( n ); 19683 } 19684 } 19685 19686 return matched; 19687}; 19688 19689 19690var rneedsContext = jQuery.expr.match.needsContext; 19691 19692 19693 19694function nodeName( elem, name ) { 19695 19696 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); 19697 19698} 19699var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); 19700 19701 19702 19703// Implement the identical functionality for filter and not 19704function winnow( elements, qualifier, not ) { 19705 if ( isFunction( qualifier ) ) { 19706 return jQuery.grep( elements, function( elem, i ) { 19707 return !!qualifier.call( elem, i, elem ) !== not; 19708 } ); 19709 } 19710 19711 // Single element 19712 if ( qualifier.nodeType ) { 19713 return jQuery.grep( elements, function( elem ) { 19714 return ( elem === qualifier ) !== not; 19715 } ); 19716 } 19717 19718 // Arraylike of elements (jQuery, arguments, Array) 19719 if ( typeof qualifier !== "string" ) { 19720 return jQuery.grep( elements, function( elem ) { 19721 return ( indexOf.call( qualifier, elem ) > -1 ) !== not; 19722 } ); 19723 } 19724 19725 // Filtered directly for both simple and complex selectors 19726 return jQuery.filter( qualifier, elements, not ); 19727} 19728 19729jQuery.filter = function( expr, elems, not ) { 19730 var elem = elems[ 0 ]; 19731 19732 if ( not ) { 19733 expr = ":not(" + expr + ")"; 19734 } 19735 19736 if ( elems.length === 1 && elem.nodeType === 1 ) { 19737 return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; 19738 } 19739 19740 return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { 19741 return elem.nodeType === 1; 19742 } ) ); 19743}; 19744 19745jQuery.fn.extend( { 19746 find: function( selector ) { 19747 var i, ret, 19748 len = this.length, 19749 self = this; 19750 19751 if ( typeof selector !== "string" ) { 19752 return this.pushStack( jQuery( selector ).filter( function() { 19753 for ( i = 0; i < len; i++ ) { 19754 if ( jQuery.contains( self[ i ], this ) ) { 19755 return true; 19756 } 19757 } 19758 } ) ); 19759 } 19760 19761 ret = this.pushStack( [] ); 19762 19763 for ( i = 0; i < len; i++ ) { 19764 jQuery.find( selector, self[ i ], ret ); 19765 } 19766 19767 return len > 1 ? jQuery.uniqueSort( ret ) : ret; 19768 }, 19769 filter: function( selector ) { 19770 return this.pushStack( winnow( this, selector || [], false ) ); 19771 }, 19772 not: function( selector ) { 19773 return this.pushStack( winnow( this, selector || [], true ) ); 19774 }, 19775 is: function( selector ) { 19776 return !!winnow( 19777 this, 19778 19779 // If this is a positional/relative selector, check membership in the returned set 19780 // so $("p:first").is("p:last") won't return true for a doc with two "p". 19781 typeof selector === "string" && rneedsContext.test( selector ) ? 19782 jQuery( selector ) : 19783 selector || [], 19784 false 19785 ).length; 19786 } 19787} ); 19788 19789 19790// Initialize a jQuery object 19791 19792 19793// A central reference to the root jQuery(document) 19794var rootjQuery, 19795 19796 // A simple way to check for HTML strings 19797 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) 19798 // Strict HTML recognition (#11290: must start with <) 19799 // Shortcut simple #id case for speed 19800 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, 19801 19802 init = jQuery.fn.init = function( selector, context, root ) { 19803 var match, elem; 19804 19805 // HANDLE: $(""), $(null), $(undefined), $(false) 19806 if ( !selector ) { 19807 return this; 19808 } 19809 19810 // Method init() accepts an alternate rootjQuery 19811 // so migrate can support jQuery.sub (gh-2101) 19812 root = root || rootjQuery; 19813 19814 // Handle HTML strings 19815 if ( typeof selector === "string" ) { 19816 if ( selector[ 0 ] === "<" && 19817 selector[ selector.length - 1 ] === ">" && 19818 selector.length >= 3 ) { 19819 19820 // Assume that strings that start and end with <> are HTML and skip the regex check 19821 match = [ null, selector, null ]; 19822 19823 } else { 19824 match = rquickExpr.exec( selector ); 19825 } 19826 19827 // Match html or make sure no context is specified for #id 19828 if ( match && ( match[ 1 ] || !context ) ) { 19829 19830 // HANDLE: $(html) -> $(array) 19831 if ( match[ 1 ] ) { 19832 context = context instanceof jQuery ? context[ 0 ] : context; 19833 19834 // Option to run scripts is true for back-compat 19835 // Intentionally let the error be thrown if parseHTML is not present 19836 jQuery.merge( this, jQuery.parseHTML( 19837 match[ 1 ], 19838 context && context.nodeType ? context.ownerDocument || context : document, 19839 true 19840 ) ); 19841 19842 // HANDLE: $(html, props) 19843 if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { 19844 for ( match in context ) { 19845 19846 // Properties of context are called as methods if possible 19847 if ( isFunction( this[ match ] ) ) { 19848 this[ match ]( context[ match ] ); 19849 19850 // ...and otherwise set as attributes 19851 } else { 19852 this.attr( match, context[ match ] ); 19853 } 19854 } 19855 } 19856 19857 return this; 19858 19859 // HANDLE: $(#id) 19860 } else { 19861 elem = document.getElementById( match[ 2 ] ); 19862 19863 if ( elem ) { 19864 19865 // Inject the element directly into the jQuery object 19866 this[ 0 ] = elem; 19867 this.length = 1; 19868 } 19869 return this; 19870 } 19871 19872 // HANDLE: $(expr, $(...)) 19873 } else if ( !context || context.jquery ) { 19874 return ( context || root ).find( selector ); 19875 19876 // HANDLE: $(expr, context) 19877 // (which is just equivalent to: $(context).find(expr) 19878 } else { 19879 return this.constructor( context ).find( selector ); 19880 } 19881 19882 // HANDLE: $(DOMElement) 19883 } else if ( selector.nodeType ) { 19884 this[ 0 ] = selector; 19885 this.length = 1; 19886 return this; 19887 19888 // HANDLE: $(function) 19889 // Shortcut for document ready 19890 } else if ( isFunction( selector ) ) { 19891 return root.ready !== undefined ? 19892 root.ready( selector ) : 19893 19894 // Execute immediately if ready is not present 19895 selector( jQuery ); 19896 } 19897 19898 return jQuery.makeArray( selector, this ); 19899 }; 19900 19901// Give the init function the jQuery prototype for later instantiation 19902init.prototype = jQuery.fn; 19903 19904// Initialize central reference 19905rootjQuery = jQuery( document ); 19906 19907 19908var rparentsprev = /^(?:parents|prev(?:Until|All))/, 19909 19910 // Methods guaranteed to produce a unique set when starting from a unique set 19911 guaranteedUnique = { 19912 children: true, 19913 contents: true, 19914 next: true, 19915 prev: true 19916 }; 19917 19918jQuery.fn.extend( { 19919 has: function( target ) { 19920 var targets = jQuery( target, this ), 19921 l = targets.length; 19922 19923 return this.filter( function() { 19924 var i = 0; 19925 for ( ; i < l; i++ ) { 19926 if ( jQuery.contains( this, targets[ i ] ) ) { 19927 return true; 19928 } 19929 } 19930 } ); 19931 }, 19932 19933 closest: function( selectors, context ) { 19934 var cur, 19935 i = 0, 19936 l = this.length, 19937 matched = [], 19938 targets = typeof selectors !== "string" && jQuery( selectors ); 19939 19940 // Positional selectors never match, since there's no _selection_ context 19941 if ( !rneedsContext.test( selectors ) ) { 19942 for ( ; i < l; i++ ) { 19943 for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { 19944 19945 // Always skip document fragments 19946 if ( cur.nodeType < 11 && ( targets ? 19947 targets.index( cur ) > -1 : 19948 19949 // Don't pass non-elements to Sizzle 19950 cur.nodeType === 1 && 19951 jQuery.find.matchesSelector( cur, selectors ) ) ) { 19952 19953 matched.push( cur ); 19954 break; 19955 } 19956 } 19957 } 19958 } 19959 19960 return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); 19961 }, 19962 19963 // Determine the position of an element within the set 19964 index: function( elem ) { 19965 19966 // No argument, return index in parent 19967 if ( !elem ) { 19968 return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; 19969 } 19970 19971 // Index in selector 19972 if ( typeof elem === "string" ) { 19973 return indexOf.call( jQuery( elem ), this[ 0 ] ); 19974 } 19975 19976 // Locate the position of the desired element 19977 return indexOf.call( this, 19978 19979 // If it receives a jQuery object, the first element is used 19980 elem.jquery ? elem[ 0 ] : elem 19981 ); 19982 }, 19983 19984 add: function( selector, context ) { 19985 return this.pushStack( 19986 jQuery.uniqueSort( 19987 jQuery.merge( this.get(), jQuery( selector, context ) ) 19988 ) 19989 ); 19990 }, 19991 19992 addBack: function( selector ) { 19993 return this.add( selector == null ? 19994 this.prevObject : this.prevObject.filter( selector ) 19995 ); 19996 } 19997} ); 19998 19999function sibling( cur, dir ) { 20000 while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} 20001 return cur; 20002} 20003 20004jQuery.each( { 20005 parent: function( elem ) { 20006 var parent = elem.parentNode; 20007 return parent && parent.nodeType !== 11 ? parent : null; 20008 }, 20009 parents: function( elem ) { 20010 return dir( elem, "parentNode" ); 20011 }, 20012 parentsUntil: function( elem, _i, until ) { 20013 return dir( elem, "parentNode", until ); 20014 }, 20015 next: function( elem ) { 20016 return sibling( elem, "nextSibling" ); 20017 }, 20018 prev: function( elem ) { 20019 return sibling( elem, "previousSibling" ); 20020 }, 20021 nextAll: function( elem ) { 20022 return dir( elem, "nextSibling" ); 20023 }, 20024 prevAll: function( elem ) { 20025 return dir( elem, "previousSibling" ); 20026 }, 20027 nextUntil: function( elem, _i, until ) { 20028 return dir( elem, "nextSibling", until ); 20029 }, 20030 prevUntil: function( elem, _i, until ) { 20031 return dir( elem, "previousSibling", until ); 20032 }, 20033 siblings: function( elem ) { 20034 return siblings( ( elem.parentNode || {} ).firstChild, elem ); 20035 }, 20036 children: function( elem ) { 20037 return siblings( elem.firstChild ); 20038 }, 20039 contents: function( elem ) { 20040 if ( elem.contentDocument != null && 20041 20042 // Support: IE 11+ 20043 // <object> elements with no `data` attribute has an object 20044 // `contentDocument` with a `null` prototype. 20045 getProto( elem.contentDocument ) ) { 20046 20047 return elem.contentDocument; 20048 } 20049 20050 // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only 20051 // Treat the template element as a regular one in browsers that 20052 // don't support it. 20053 if ( nodeName( elem, "template" ) ) { 20054 elem = elem.content || elem; 20055 } 20056 20057 return jQuery.merge( [], elem.childNodes ); 20058 } 20059}, function( name, fn ) { 20060 jQuery.fn[ name ] = function( until, selector ) { 20061 var matched = jQuery.map( this, fn, until ); 20062 20063 if ( name.slice( -5 ) !== "Until" ) { 20064 selector = until; 20065 } 20066 20067 if ( selector && typeof selector === "string" ) { 20068 matched = jQuery.filter( selector, matched ); 20069 } 20070 20071 if ( this.length > 1 ) { 20072 20073 // Remove duplicates 20074 if ( !guaranteedUnique[ name ] ) { 20075 jQuery.uniqueSort( matched ); 20076 } 20077 20078 // Reverse order for parents* and prev-derivatives 20079 if ( rparentsprev.test( name ) ) { 20080 matched.reverse(); 20081 } 20082 } 20083 20084 return this.pushStack( matched ); 20085 }; 20086} ); 20087var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); 20088 20089 20090 20091// Convert String-formatted options into Object-formatted ones 20092function createOptions( options ) { 20093 var object = {}; 20094 jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { 20095 object[ flag ] = true; 20096 } ); 20097 return object; 20098} 20099 20100/* 20101 * Create a callback list using the following parameters: 20102 * 20103 * options: an optional list of space-separated options that will change how 20104 * the callback list behaves or a more traditional option object 20105 * 20106 * By default a callback list will act like an event callback list and can be 20107 * "fired" multiple times. 20108 * 20109 * Possible options: 20110 * 20111 * once: will ensure the callback list can only be fired once (like a Deferred) 20112 * 20113 * memory: will keep track of previous values and will call any callback added 20114 * after the list has been fired right away with the latest "memorized" 20115 * values (like a Deferred) 20116 * 20117 * unique: will ensure a callback can only be added once (no duplicate in the list) 20118 * 20119 * stopOnFalse: interrupt callings when a callback returns false 20120 * 20121 */ 20122jQuery.Callbacks = function( options ) { 20123 20124 // Convert options from String-formatted to Object-formatted if needed 20125 // (we check in cache first) 20126 options = typeof options === "string" ? 20127 createOptions( options ) : 20128 jQuery.extend( {}, options ); 20129 20130 var // Flag to know if list is currently firing 20131 firing, 20132 20133 // Last fire value for non-forgettable lists 20134 memory, 20135 20136 // Flag to know if list was already fired 20137 fired, 20138 20139 // Flag to prevent firing 20140 locked, 20141 20142 // Actual callback list 20143 list = [], 20144 20145 // Queue of execution data for repeatable lists 20146 queue = [], 20147 20148 // Index of currently firing callback (modified by add/remove as needed) 20149 firingIndex = -1, 20150 20151 // Fire callbacks 20152 fire = function() { 20153 20154 // Enforce single-firing 20155 locked = locked || options.once; 20156 20157 // Execute callbacks for all pending executions, 20158 // respecting firingIndex overrides and runtime changes 20159 fired = firing = true; 20160 for ( ; queue.length; firingIndex = -1 ) { 20161 memory = queue.shift(); 20162 while ( ++firingIndex < list.length ) { 20163 20164 // Run callback and check for early termination 20165 if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && 20166 options.stopOnFalse ) { 20167 20168 // Jump to end and forget the data so .add doesn't re-fire 20169 firingIndex = list.length; 20170 memory = false; 20171 } 20172 } 20173 } 20174 20175 // Forget the data if we're done with it 20176 if ( !options.memory ) { 20177 memory = false; 20178 } 20179 20180 firing = false; 20181 20182 // Clean up if we're done firing for good 20183 if ( locked ) { 20184 20185 // Keep an empty list if we have data for future add calls 20186 if ( memory ) { 20187 list = []; 20188 20189 // Otherwise, this object is spent 20190 } else { 20191 list = ""; 20192 } 20193 } 20194 }, 20195 20196 // Actual Callbacks object 20197 self = { 20198 20199 // Add a callback or a collection of callbacks to the list 20200 add: function() { 20201 if ( list ) { 20202 20203 // If we have memory from a past run, we should fire after adding 20204 if ( memory && !firing ) { 20205 firingIndex = list.length - 1; 20206 queue.push( memory ); 20207 } 20208 20209 ( function add( args ) { 20210 jQuery.each( args, function( _, arg ) { 20211 if ( isFunction( arg ) ) { 20212 if ( !options.unique || !self.has( arg ) ) { 20213 list.push( arg ); 20214 } 20215 } else if ( arg && arg.length && toType( arg ) !== "string" ) { 20216 20217 // Inspect recursively 20218 add( arg ); 20219 } 20220 } ); 20221 } )( arguments ); 20222 20223 if ( memory && !firing ) { 20224 fire(); 20225 } 20226 } 20227 return this; 20228 }, 20229 20230 // Remove a callback from the list 20231 remove: function() { 20232 jQuery.each( arguments, function( _, arg ) { 20233 var index; 20234 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { 20235 list.splice( index, 1 ); 20236 20237 // Handle firing indexes 20238 if ( index <= firingIndex ) { 20239 firingIndex--; 20240 } 20241 } 20242 } ); 20243 return this; 20244 }, 20245 20246 // Check if a given callback is in the list. 20247 // If no argument is given, return whether or not list has callbacks attached. 20248 has: function( fn ) { 20249 return fn ? 20250 jQuery.inArray( fn, list ) > -1 : 20251 list.length > 0; 20252 }, 20253 20254 // Remove all callbacks from the list 20255 empty: function() { 20256 if ( list ) { 20257 list = []; 20258 } 20259 return this; 20260 }, 20261 20262 // Disable .fire and .add 20263 // Abort any current/pending executions 20264 // Clear all callbacks and values 20265 disable: function() { 20266 locked = queue = []; 20267 list = memory = ""; 20268 return this; 20269 }, 20270 disabled: function() { 20271 return !list; 20272 }, 20273 20274 // Disable .fire 20275 // Also disable .add unless we have memory (since it would have no effect) 20276 // Abort any pending executions 20277 lock: function() { 20278 locked = queue = []; 20279 if ( !memory && !firing ) { 20280 list = memory = ""; 20281 } 20282 return this; 20283 }, 20284 locked: function() { 20285 return !!locked; 20286 }, 20287 20288 // Call all callbacks with the given context and arguments 20289 fireWith: function( context, args ) { 20290 if ( !locked ) { 20291 args = args || []; 20292 args = [ context, args.slice ? args.slice() : args ]; 20293 queue.push( args ); 20294 if ( !firing ) { 20295 fire(); 20296 } 20297 } 20298 return this; 20299 }, 20300 20301 // Call all the callbacks with the given arguments 20302 fire: function() { 20303 self.fireWith( this, arguments ); 20304 return this; 20305 }, 20306 20307 // To know if the callbacks have already been called at least once 20308 fired: function() { 20309 return !!fired; 20310 } 20311 }; 20312 20313 return self; 20314}; 20315 20316 20317function Identity( v ) { 20318 return v; 20319} 20320function Thrower( ex ) { 20321 throw ex; 20322} 20323 20324function adoptValue( value, resolve, reject, noValue ) { 20325 var method; 20326 20327 try { 20328 20329 // Check for promise aspect first to privilege synchronous behavior 20330 if ( value && isFunction( ( method = value.promise ) ) ) { 20331 method.call( value ).done( resolve ).fail( reject ); 20332 20333 // Other thenables 20334 } else if ( value && isFunction( ( method = value.then ) ) ) { 20335 method.call( value, resolve, reject ); 20336 20337 // Other non-thenables 20338 } else { 20339 20340 // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: 20341 // * false: [ value ].slice( 0 ) => resolve( value ) 20342 // * true: [ value ].slice( 1 ) => resolve() 20343 resolve.apply( undefined, [ value ].slice( noValue ) ); 20344 } 20345 20346 // For Promises/A+, convert exceptions into rejections 20347 // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in 20348 // Deferred#then to conditionally suppress rejection. 20349 } catch ( value ) { 20350 20351 // Support: Android 4.0 only 20352 // Strict mode functions invoked without .call/.apply get global-object context 20353 reject.apply( undefined, [ value ] ); 20354 } 20355} 20356 20357jQuery.extend( { 20358 20359 Deferred: function( func ) { 20360 var tuples = [ 20361 20362 // action, add listener, callbacks, 20363 // ... .then handlers, argument index, [final state] 20364 [ "notify", "progress", jQuery.Callbacks( "memory" ), 20365 jQuery.Callbacks( "memory" ), 2 ], 20366 [ "resolve", "done", jQuery.Callbacks( "once memory" ), 20367 jQuery.Callbacks( "once memory" ), 0, "resolved" ], 20368 [ "reject", "fail", jQuery.Callbacks( "once memory" ), 20369 jQuery.Callbacks( "once memory" ), 1, "rejected" ] 20370 ], 20371 state = "pending", 20372 promise = { 20373 state: function() { 20374 return state; 20375 }, 20376 always: function() { 20377 deferred.done( arguments ).fail( arguments ); 20378 return this; 20379 }, 20380 "catch": function( fn ) { 20381 return promise.then( null, fn ); 20382 }, 20383 20384 // Keep pipe for back-compat 20385 pipe: function( /* fnDone, fnFail, fnProgress */ ) { 20386 var fns = arguments; 20387 20388 return jQuery.Deferred( function( newDefer ) { 20389 jQuery.each( tuples, function( _i, tuple ) { 20390 20391 // Map tuples (progress, done, fail) to arguments (done, fail, progress) 20392 var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; 20393 20394 // deferred.progress(function() { bind to newDefer or newDefer.notify }) 20395 // deferred.done(function() { bind to newDefer or newDefer.resolve }) 20396 // deferred.fail(function() { bind to newDefer or newDefer.reject }) 20397 deferred[ tuple[ 1 ] ]( function() { 20398 var returned = fn && fn.apply( this, arguments ); 20399 if ( returned && isFunction( returned.promise ) ) { 20400 returned.promise() 20401 .progress( newDefer.notify ) 20402 .done( newDefer.resolve ) 20403 .fail( newDefer.reject ); 20404 } else { 20405 newDefer[ tuple[ 0 ] + "With" ]( 20406 this, 20407 fn ? [ returned ] : arguments 20408 ); 20409 } 20410 } ); 20411 } ); 20412 fns = null; 20413 } ).promise(); 20414 }, 20415 then: function( onFulfilled, onRejected, onProgress ) { 20416 var maxDepth = 0; 20417 function resolve( depth, deferred, handler, special ) { 20418 return function() { 20419 var that = this, 20420 args = arguments, 20421 mightThrow = function() { 20422 var returned, then; 20423 20424 // Support: Promises/A+ section 2.3.3.3.3 20425 // https://promisesaplus.com/#point-59 20426 // Ignore double-resolution attempts 20427 if ( depth < maxDepth ) { 20428 return; 20429 } 20430 20431 returned = handler.apply( that, args ); 20432 20433 // Support: Promises/A+ section 2.3.1 20434 // https://promisesaplus.com/#point-48 20435 if ( returned === deferred.promise() ) { 20436 throw new TypeError( "Thenable self-resolution" ); 20437 } 20438 20439 // Support: Promises/A+ sections 2.3.3.1, 3.5 20440 // https://promisesaplus.com/#point-54 20441 // https://promisesaplus.com/#point-75 20442 // Retrieve `then` only once 20443 then = returned && 20444 20445 // Support: Promises/A+ section 2.3.4 20446 // https://promisesaplus.com/#point-64 20447 // Only check objects and functions for thenability 20448 ( typeof returned === "object" || 20449 typeof returned === "function" ) && 20450 returned.then; 20451 20452 // Handle a returned thenable 20453 if ( isFunction( then ) ) { 20454 20455 // Special processors (notify) just wait for resolution 20456 if ( special ) { 20457 then.call( 20458 returned, 20459 resolve( maxDepth, deferred, Identity, special ), 20460 resolve( maxDepth, deferred, Thrower, special ) 20461 ); 20462 20463 // Normal processors (resolve) also hook into progress 20464 } else { 20465 20466 // ...and disregard older resolution values 20467 maxDepth++; 20468 20469 then.call( 20470 returned, 20471 resolve( maxDepth, deferred, Identity, special ), 20472 resolve( maxDepth, deferred, Thrower, special ), 20473 resolve( maxDepth, deferred, Identity, 20474 deferred.notifyWith ) 20475 ); 20476 } 20477 20478 // Handle all other returned values 20479 } else { 20480 20481 // Only substitute handlers pass on context 20482 // and multiple values (non-spec behavior) 20483 if ( handler !== Identity ) { 20484 that = undefined; 20485 args = [ returned ]; 20486 } 20487 20488 // Process the value(s) 20489 // Default process is resolve 20490 ( special || deferred.resolveWith )( that, args ); 20491 } 20492 }, 20493 20494 // Only normal processors (resolve) catch and reject exceptions 20495 process = special ? 20496 mightThrow : 20497 function() { 20498 try { 20499 mightThrow(); 20500 } catch ( e ) { 20501 20502 if ( jQuery.Deferred.exceptionHook ) { 20503 jQuery.Deferred.exceptionHook( e, 20504 process.stackTrace ); 20505 } 20506 20507 // Support: Promises/A+ section 2.3.3.3.4.1 20508 // https://promisesaplus.com/#point-61 20509 // Ignore post-resolution exceptions 20510 if ( depth + 1 >= maxDepth ) { 20511 20512 // Only substitute handlers pass on context 20513 // and multiple values (non-spec behavior) 20514 if ( handler !== Thrower ) { 20515 that = undefined; 20516 args = [ e ]; 20517 } 20518 20519 deferred.rejectWith( that, args ); 20520 } 20521 } 20522 }; 20523 20524 // Support: Promises/A+ section 2.3.3.3.1 20525 // https://promisesaplus.com/#point-57 20526 // Re-resolve promises immediately to dodge false rejection from 20527 // subsequent errors 20528 if ( depth ) { 20529 process(); 20530 } else { 20531 20532 // Call an optional hook to record the stack, in case of exception 20533 // since it's otherwise lost when execution goes async 20534 if ( jQuery.Deferred.getStackHook ) { 20535 process.stackTrace = jQuery.Deferred.getStackHook(); 20536 } 20537 window.setTimeout( process ); 20538 } 20539 }; 20540 } 20541 20542 return jQuery.Deferred( function( newDefer ) { 20543 20544 // progress_handlers.add( ... ) 20545 tuples[ 0 ][ 3 ].add( 20546 resolve( 20547 0, 20548 newDefer, 20549 isFunction( onProgress ) ? 20550 onProgress : 20551 Identity, 20552 newDefer.notifyWith 20553 ) 20554 ); 20555 20556 // fulfilled_handlers.add( ... ) 20557 tuples[ 1 ][ 3 ].add( 20558 resolve( 20559 0, 20560 newDefer, 20561 isFunction( onFulfilled ) ? 20562 onFulfilled : 20563 Identity 20564 ) 20565 ); 20566 20567 // rejected_handlers.add( ... ) 20568 tuples[ 2 ][ 3 ].add( 20569 resolve( 20570 0, 20571 newDefer, 20572 isFunction( onRejected ) ? 20573 onRejected : 20574 Thrower 20575 ) 20576 ); 20577 } ).promise(); 20578 }, 20579 20580 // Get a promise for this deferred 20581 // If obj is provided, the promise aspect is added to the object 20582 promise: function( obj ) { 20583 return obj != null ? jQuery.extend( obj, promise ) : promise; 20584 } 20585 }, 20586 deferred = {}; 20587 20588 // Add list-specific methods 20589 jQuery.each( tuples, function( i, tuple ) { 20590 var list = tuple[ 2 ], 20591 stateString = tuple[ 5 ]; 20592 20593 // promise.progress = list.add 20594 // promise.done = list.add 20595 // promise.fail = list.add 20596 promise[ tuple[ 1 ] ] = list.add; 20597 20598 // Handle state 20599 if ( stateString ) { 20600 list.add( 20601 function() { 20602 20603 // state = "resolved" (i.e., fulfilled) 20604 // state = "rejected" 20605 state = stateString; 20606 }, 20607 20608 // rejected_callbacks.disable 20609 // fulfilled_callbacks.disable 20610 tuples[ 3 - i ][ 2 ].disable, 20611 20612 // rejected_handlers.disable 20613 // fulfilled_handlers.disable 20614 tuples[ 3 - i ][ 3 ].disable, 20615 20616 // progress_callbacks.lock 20617 tuples[ 0 ][ 2 ].lock, 20618 20619 // progress_handlers.lock 20620 tuples[ 0 ][ 3 ].lock 20621 ); 20622 } 20623 20624 // progress_handlers.fire 20625 // fulfilled_handlers.fire 20626 // rejected_handlers.fire 20627 list.add( tuple[ 3 ].fire ); 20628 20629 // deferred.notify = function() { deferred.notifyWith(...) } 20630 // deferred.resolve = function() { deferred.resolveWith(...) } 20631 // deferred.reject = function() { deferred.rejectWith(...) } 20632 deferred[ tuple[ 0 ] ] = function() { 20633 deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); 20634 return this; 20635 }; 20636 20637 // deferred.notifyWith = list.fireWith 20638 // deferred.resolveWith = list.fireWith 20639 // deferred.rejectWith = list.fireWith 20640 deferred[ tuple[ 0 ] + "With" ] = list.fireWith; 20641 } ); 20642 20643 // Make the deferred a promise 20644 promise.promise( deferred ); 20645 20646 // Call given func if any 20647 if ( func ) { 20648 func.call( deferred, deferred ); 20649 } 20650 20651 // All done! 20652 return deferred; 20653 }, 20654 20655 // Deferred helper 20656 when: function( singleValue ) { 20657 var 20658 20659 // count of uncompleted subordinates 20660 remaining = arguments.length, 20661 20662 // count of unprocessed arguments 20663 i = remaining, 20664 20665 // subordinate fulfillment data 20666 resolveContexts = Array( i ), 20667 resolveValues = slice.call( arguments ), 20668 20669 // the primary Deferred 20670 primary = jQuery.Deferred(), 20671 20672 // subordinate callback factory 20673 updateFunc = function( i ) { 20674 return function( value ) { 20675 resolveContexts[ i ] = this; 20676 resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; 20677 if ( !( --remaining ) ) { 20678 primary.resolveWith( resolveContexts, resolveValues ); 20679 } 20680 }; 20681 }; 20682 20683 // Single- and empty arguments are adopted like Promise.resolve 20684 if ( remaining <= 1 ) { 20685 adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, 20686 !remaining ); 20687 20688 // Use .then() to unwrap secondary thenables (cf. gh-3000) 20689 if ( primary.state() === "pending" || 20690 isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { 20691 20692 return primary.then(); 20693 } 20694 } 20695 20696 // Multiple arguments are aggregated like Promise.all array elements 20697 while ( i-- ) { 20698 adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); 20699 } 20700 20701 return primary.promise(); 20702 } 20703} ); 20704 20705 20706// These usually indicate a programmer mistake during development, 20707// warn about them ASAP rather than swallowing them by default. 20708var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; 20709 20710jQuery.Deferred.exceptionHook = function( error, stack ) { 20711 20712 // Support: IE 8 - 9 only 20713 // Console exists when dev tools are open, which can happen at any time 20714 if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { 20715 window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); 20716 } 20717}; 20718 20719 20720 20721 20722jQuery.readyException = function( error ) { 20723 window.setTimeout( function() { 20724 throw error; 20725 } ); 20726}; 20727 20728 20729 20730 20731// The deferred used on DOM ready 20732var readyList = jQuery.Deferred(); 20733 20734jQuery.fn.ready = function( fn ) { 20735 20736 readyList 20737 .then( fn ) 20738 20739 // Wrap jQuery.readyException in a function so that the lookup 20740 // happens at the time of error handling instead of callback 20741 // registration. 20742 .catch( function( error ) { 20743 jQuery.readyException( error ); 20744 } ); 20745 20746 return this; 20747}; 20748 20749jQuery.extend( { 20750 20751 // Is the DOM ready to be used? Set to true once it occurs. 20752 isReady: false, 20753 20754 // A counter to track how many items to wait for before 20755 // the ready event fires. See #6781 20756 readyWait: 1, 20757 20758 // Handle when the DOM is ready 20759 ready: function( wait ) { 20760 20761 // Abort if there are pending holds or we're already ready 20762 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { 20763 return; 20764 } 20765 20766 // Remember that the DOM is ready 20767 jQuery.isReady = true; 20768 20769 // If a normal DOM Ready event fired, decrement, and wait if need be 20770 if ( wait !== true && --jQuery.readyWait > 0 ) { 20771 return; 20772 } 20773 20774 // If there are functions bound, to execute 20775 readyList.resolveWith( document, [ jQuery ] ); 20776 } 20777} ); 20778 20779jQuery.ready.then = readyList.then; 20780 20781// The ready event handler and self cleanup method 20782function completed() { 20783 document.removeEventListener( "DOMContentLoaded", completed ); 20784 window.removeEventListener( "load", completed ); 20785 jQuery.ready(); 20786} 20787 20788// Catch cases where $(document).ready() is called 20789// after the browser event has already occurred. 20790// Support: IE <=9 - 10 only 20791// Older IE sometimes signals "interactive" too soon 20792if ( document.readyState === "complete" || 20793 ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { 20794 20795 // Handle it asynchronously to allow scripts the opportunity to delay ready 20796 window.setTimeout( jQuery.ready ); 20797 20798} else { 20799 20800 // Use the handy event callback 20801 document.addEventListener( "DOMContentLoaded", completed ); 20802 20803 // A fallback to window.onload, that will always work 20804 window.addEventListener( "load", completed ); 20805} 20806 20807 20808 20809 20810// Multifunctional method to get and set values of a collection 20811// The value/s can optionally be executed if it's a function 20812var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { 20813 var i = 0, 20814 len = elems.length, 20815 bulk = key == null; 20816 20817 // Sets many values 20818 if ( toType( key ) === "object" ) { 20819 chainable = true; 20820 for ( i in key ) { 20821 access( elems, fn, i, key[ i ], true, emptyGet, raw ); 20822 } 20823 20824 // Sets one value 20825 } else if ( value !== undefined ) { 20826 chainable = true; 20827 20828 if ( !isFunction( value ) ) { 20829 raw = true; 20830 } 20831 20832 if ( bulk ) { 20833 20834 // Bulk operations run against the entire set 20835 if ( raw ) { 20836 fn.call( elems, value ); 20837 fn = null; 20838 20839 // ...except when executing function values 20840 } else { 20841 bulk = fn; 20842 fn = function( elem, _key, value ) { 20843 return bulk.call( jQuery( elem ), value ); 20844 }; 20845 } 20846 } 20847 20848 if ( fn ) { 20849 for ( ; i < len; i++ ) { 20850 fn( 20851 elems[ i ], key, raw ? 20852 value : 20853 value.call( elems[ i ], i, fn( elems[ i ], key ) ) 20854 ); 20855 } 20856 } 20857 } 20858 20859 if ( chainable ) { 20860 return elems; 20861 } 20862 20863 // Gets 20864 if ( bulk ) { 20865 return fn.call( elems ); 20866 } 20867 20868 return len ? fn( elems[ 0 ], key ) : emptyGet; 20869}; 20870 20871 20872// Matches dashed string for camelizing 20873var rmsPrefix = /^-ms-/, 20874 rdashAlpha = /-([a-z])/g; 20875 20876// Used by camelCase as callback to replace() 20877function fcamelCase( _all, letter ) { 20878 return letter.toUpperCase(); 20879} 20880 20881// Convert dashed to camelCase; used by the css and data modules 20882// Support: IE <=9 - 11, Edge 12 - 15 20883// Microsoft forgot to hump their vendor prefix (#9572) 20884function camelCase( string ) { 20885 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); 20886} 20887var acceptData = function( owner ) { 20888 20889 // Accepts only: 20890 // - Node 20891 // - Node.ELEMENT_NODE 20892 // - Node.DOCUMENT_NODE 20893 // - Object 20894 // - Any 20895 return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); 20896}; 20897 20898 20899 20900 20901function Data() { 20902 this.expando = jQuery.expando + Data.uid++; 20903} 20904 20905Data.uid = 1; 20906 20907Data.prototype = { 20908 20909 cache: function( owner ) { 20910 20911 // Check if the owner object already has a cache 20912 var value = owner[ this.expando ]; 20913 20914 // If not, create one 20915 if ( !value ) { 20916 value = {}; 20917 20918 // We can accept data for non-element nodes in modern browsers, 20919 // but we should not, see #8335. 20920 // Always return an empty object. 20921 if ( acceptData( owner ) ) { 20922 20923 // If it is a node unlikely to be stringify-ed or looped over 20924 // use plain assignment 20925 if ( owner.nodeType ) { 20926 owner[ this.expando ] = value; 20927 20928 // Otherwise secure it in a non-enumerable property 20929 // configurable must be true to allow the property to be 20930 // deleted when data is removed 20931 } else { 20932 Object.defineProperty( owner, this.expando, { 20933 value: value, 20934 configurable: true 20935 } ); 20936 } 20937 } 20938 } 20939 20940 return value; 20941 }, 20942 set: function( owner, data, value ) { 20943 var prop, 20944 cache = this.cache( owner ); 20945 20946 // Handle: [ owner, key, value ] args 20947 // Always use camelCase key (gh-2257) 20948 if ( typeof data === "string" ) { 20949 cache[ camelCase( data ) ] = value; 20950 20951 // Handle: [ owner, { properties } ] args 20952 } else { 20953 20954 // Copy the properties one-by-one to the cache object 20955 for ( prop in data ) { 20956 cache[ camelCase( prop ) ] = data[ prop ]; 20957 } 20958 } 20959 return cache; 20960 }, 20961 get: function( owner, key ) { 20962 return key === undefined ? 20963 this.cache( owner ) : 20964 20965 // Always use camelCase key (gh-2257) 20966 owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; 20967 }, 20968 access: function( owner, key, value ) { 20969 20970 // In cases where either: 20971 // 20972 // 1. No key was specified 20973 // 2. A string key was specified, but no value provided 20974 // 20975 // Take the "read" path and allow the get method to determine 20976 // which value to return, respectively either: 20977 // 20978 // 1. The entire cache object 20979 // 2. The data stored at the key 20980 // 20981 if ( key === undefined || 20982 ( ( key && typeof key === "string" ) && value === undefined ) ) { 20983 20984 return this.get( owner, key ); 20985 } 20986 20987 // When the key is not a string, or both a key and value 20988 // are specified, set or extend (existing objects) with either: 20989 // 20990 // 1. An object of properties 20991 // 2. A key and value 20992 // 20993 this.set( owner, key, value ); 20994 20995 // Since the "set" path can have two possible entry points 20996 // return the expected data based on which path was taken[*] 20997 return value !== undefined ? value : key; 20998 }, 20999 remove: function( owner, key ) { 21000 var i, 21001 cache = owner[ this.expando ]; 21002 21003 if ( cache === undefined ) { 21004 return; 21005 } 21006 21007 if ( key !== undefined ) { 21008 21009 // Support array or space separated string of keys 21010 if ( Array.isArray( key ) ) { 21011 21012 // If key is an array of keys... 21013 // We always set camelCase keys, so remove that. 21014 key = key.map( camelCase ); 21015 } else { 21016 key = camelCase( key ); 21017 21018 // If a key with the spaces exists, use it. 21019 // Otherwise, create an array by matching non-whitespace 21020 key = key in cache ? 21021 [ key ] : 21022 ( key.match( rnothtmlwhite ) || [] ); 21023 } 21024 21025 i = key.length; 21026 21027 while ( i-- ) { 21028 delete cache[ key[ i ] ]; 21029 } 21030 } 21031 21032 // Remove the expando if there's no more data 21033 if ( key === undefined || jQuery.isEmptyObject( cache ) ) { 21034 21035 // Support: Chrome <=35 - 45 21036 // Webkit & Blink performance suffers when deleting properties 21037 // from DOM nodes, so set to undefined instead 21038 // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) 21039 if ( owner.nodeType ) { 21040 owner[ this.expando ] = undefined; 21041 } else { 21042 delete owner[ this.expando ]; 21043 } 21044 } 21045 }, 21046 hasData: function( owner ) { 21047 var cache = owner[ this.expando ]; 21048 return cache !== undefined && !jQuery.isEmptyObject( cache ); 21049 } 21050}; 21051var dataPriv = new Data(); 21052 21053var dataUser = new Data(); 21054 21055 21056 21057// Implementation Summary 21058// 21059// 1. Enforce API surface and semantic compatibility with 1.9.x branch 21060// 2. Improve the module's maintainability by reducing the storage 21061// paths to a single mechanism. 21062// 3. Use the same single mechanism to support "private" and "user" data. 21063// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) 21064// 5. Avoid exposing implementation details on user objects (eg. expando properties) 21065// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 21066 21067var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, 21068 rmultiDash = /[A-Z]/g; 21069 21070function getData( data ) { 21071 if ( data === "true" ) { 21072 return true; 21073 } 21074 21075 if ( data === "false" ) { 21076 return false; 21077 } 21078 21079 if ( data === "null" ) { 21080 return null; 21081 } 21082 21083 // Only convert to a number if it doesn't change the string 21084 if ( data === +data + "" ) { 21085 return +data; 21086 } 21087 21088 if ( rbrace.test( data ) ) { 21089 return JSON.parse( data ); 21090 } 21091 21092 return data; 21093} 21094 21095function dataAttr( elem, key, data ) { 21096 var name; 21097 21098 // If nothing was found internally, try to fetch any 21099 // data from the HTML5 data-* attribute 21100 if ( data === undefined && elem.nodeType === 1 ) { 21101 name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); 21102 data = elem.getAttribute( name ); 21103 21104 if ( typeof data === "string" ) { 21105 try { 21106 data = getData( data ); 21107 } catch ( e ) {} 21108 21109 // Make sure we set the data so it isn't changed later 21110 dataUser.set( elem, key, data ); 21111 } else { 21112 data = undefined; 21113 } 21114 } 21115 return data; 21116} 21117 21118jQuery.extend( { 21119 hasData: function( elem ) { 21120 return dataUser.hasData( elem ) || dataPriv.hasData( elem ); 21121 }, 21122 21123 data: function( elem, name, data ) { 21124 return dataUser.access( elem, name, data ); 21125 }, 21126 21127 removeData: function( elem, name ) { 21128 dataUser.remove( elem, name ); 21129 }, 21130 21131 // TODO: Now that all calls to _data and _removeData have been replaced 21132 // with direct calls to dataPriv methods, these can be deprecated. 21133 _data: function( elem, name, data ) { 21134 return dataPriv.access( elem, name, data ); 21135 }, 21136 21137 _removeData: function( elem, name ) { 21138 dataPriv.remove( elem, name ); 21139 } 21140} ); 21141 21142jQuery.fn.extend( { 21143 data: function( key, value ) { 21144 var i, name, data, 21145 elem = this[ 0 ], 21146 attrs = elem && elem.attributes; 21147 21148 // Gets all values 21149 if ( key === undefined ) { 21150 if ( this.length ) { 21151 data = dataUser.get( elem ); 21152 21153 if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { 21154 i = attrs.length; 21155 while ( i-- ) { 21156 21157 // Support: IE 11 only 21158 // The attrs elements can be null (#14894) 21159 if ( attrs[ i ] ) { 21160 name = attrs[ i ].name; 21161 if ( name.indexOf( "data-" ) === 0 ) { 21162 name = camelCase( name.slice( 5 ) ); 21163 dataAttr( elem, name, data[ name ] ); 21164 } 21165 } 21166 } 21167 dataPriv.set( elem, "hasDataAttrs", true ); 21168 } 21169 } 21170 21171 return data; 21172 } 21173 21174 // Sets multiple values 21175 if ( typeof key === "object" ) { 21176 return this.each( function() { 21177 dataUser.set( this, key ); 21178 } ); 21179 } 21180 21181 return access( this, function( value ) { 21182 var data; 21183 21184 // The calling jQuery object (element matches) is not empty 21185 // (and therefore has an element appears at this[ 0 ]) and the 21186 // `value` parameter was not undefined. An empty jQuery object 21187 // will result in `undefined` for elem = this[ 0 ] which will 21188 // throw an exception if an attempt to read a data cache is made. 21189 if ( elem && value === undefined ) { 21190 21191 // Attempt to get data from the cache 21192 // The key will always be camelCased in Data 21193 data = dataUser.get( elem, key ); 21194 if ( data !== undefined ) { 21195 return data; 21196 } 21197 21198 // Attempt to "discover" the data in 21199 // HTML5 custom data-* attrs 21200 data = dataAttr( elem, key ); 21201 if ( data !== undefined ) { 21202 return data; 21203 } 21204 21205 // We tried really hard, but the data doesn't exist. 21206 return; 21207 } 21208 21209 // Set the data... 21210 this.each( function() { 21211 21212 // We always store the camelCased key 21213 dataUser.set( this, key, value ); 21214 } ); 21215 }, null, value, arguments.length > 1, null, true ); 21216 }, 21217 21218 removeData: function( key ) { 21219 return this.each( function() { 21220 dataUser.remove( this, key ); 21221 } ); 21222 } 21223} ); 21224 21225 21226jQuery.extend( { 21227 queue: function( elem, type, data ) { 21228 var queue; 21229 21230 if ( elem ) { 21231 type = ( type || "fx" ) + "queue"; 21232 queue = dataPriv.get( elem, type ); 21233 21234 // Speed up dequeue by getting out quickly if this is just a lookup 21235 if ( data ) { 21236 if ( !queue || Array.isArray( data ) ) { 21237 queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); 21238 } else { 21239 queue.push( data ); 21240 } 21241 } 21242 return queue || []; 21243 } 21244 }, 21245 21246 dequeue: function( elem, type ) { 21247 type = type || "fx"; 21248 21249 var queue = jQuery.queue( elem, type ), 21250 startLength = queue.length, 21251 fn = queue.shift(), 21252 hooks = jQuery._queueHooks( elem, type ), 21253 next = function() { 21254 jQuery.dequeue( elem, type ); 21255 }; 21256 21257 // If the fx queue is dequeued, always remove the progress sentinel 21258 if ( fn === "inprogress" ) { 21259 fn = queue.shift(); 21260 startLength--; 21261 } 21262 21263 if ( fn ) { 21264 21265 // Add a progress sentinel to prevent the fx queue from being 21266 // automatically dequeued 21267 if ( type === "fx" ) { 21268 queue.unshift( "inprogress" ); 21269 } 21270 21271 // Clear up the last queue stop function 21272 delete hooks.stop; 21273 fn.call( elem, next, hooks ); 21274 } 21275 21276 if ( !startLength && hooks ) { 21277 hooks.empty.fire(); 21278 } 21279 }, 21280 21281 // Not public - generate a queueHooks object, or return the current one 21282 _queueHooks: function( elem, type ) { 21283 var key = type + "queueHooks"; 21284 return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { 21285 empty: jQuery.Callbacks( "once memory" ).add( function() { 21286 dataPriv.remove( elem, [ type + "queue", key ] ); 21287 } ) 21288 } ); 21289 } 21290} ); 21291 21292jQuery.fn.extend( { 21293 queue: function( type, data ) { 21294 var setter = 2; 21295 21296 if ( typeof type !== "string" ) { 21297 data = type; 21298 type = "fx"; 21299 setter--; 21300 } 21301 21302 if ( arguments.length < setter ) { 21303 return jQuery.queue( this[ 0 ], type ); 21304 } 21305 21306 return data === undefined ? 21307 this : 21308 this.each( function() { 21309 var queue = jQuery.queue( this, type, data ); 21310 21311 // Ensure a hooks for this queue 21312 jQuery._queueHooks( this, type ); 21313 21314 if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { 21315 jQuery.dequeue( this, type ); 21316 } 21317 } ); 21318 }, 21319 dequeue: function( type ) { 21320 return this.each( function() { 21321 jQuery.dequeue( this, type ); 21322 } ); 21323 }, 21324 clearQueue: function( type ) { 21325 return this.queue( type || "fx", [] ); 21326 }, 21327 21328 // Get a promise resolved when queues of a certain type 21329 // are emptied (fx is the type by default) 21330 promise: function( type, obj ) { 21331 var tmp, 21332 count = 1, 21333 defer = jQuery.Deferred(), 21334 elements = this, 21335 i = this.length, 21336 resolve = function() { 21337 if ( !( --count ) ) { 21338 defer.resolveWith( elements, [ elements ] ); 21339 } 21340 }; 21341 21342 if ( typeof type !== "string" ) { 21343 obj = type; 21344 type = undefined; 21345 } 21346 type = type || "fx"; 21347 21348 while ( i-- ) { 21349 tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); 21350 if ( tmp && tmp.empty ) { 21351 count++; 21352 tmp.empty.add( resolve ); 21353 } 21354 } 21355 resolve(); 21356 return defer.promise( obj ); 21357 } 21358} ); 21359var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; 21360 21361var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); 21362 21363 21364var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; 21365 21366var documentElement = document.documentElement; 21367 21368 21369 21370 var isAttached = function( elem ) { 21371 return jQuery.contains( elem.ownerDocument, elem ); 21372 }, 21373 composed = { composed: true }; 21374 21375 // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only 21376 // Check attachment across shadow DOM boundaries when possible (gh-3504) 21377 // Support: iOS 10.0-10.2 only 21378 // Early iOS 10 versions support `attachShadow` but not `getRootNode`, 21379 // leading to errors. We need to check for `getRootNode`. 21380 if ( documentElement.getRootNode ) { 21381 isAttached = function( elem ) { 21382 return jQuery.contains( elem.ownerDocument, elem ) || 21383 elem.getRootNode( composed ) === elem.ownerDocument; 21384 }; 21385 } 21386var isHiddenWithinTree = function( elem, el ) { 21387 21388 // isHiddenWithinTree might be called from jQuery#filter function; 21389 // in that case, element will be second argument 21390 elem = el || elem; 21391 21392 // Inline style trumps all 21393 return elem.style.display === "none" || 21394 elem.style.display === "" && 21395 21396 // Otherwise, check computed style 21397 // Support: Firefox <=43 - 45 21398 // Disconnected elements can have computed display: none, so first confirm that elem is 21399 // in the document. 21400 isAttached( elem ) && 21401 21402 jQuery.css( elem, "display" ) === "none"; 21403 }; 21404 21405 21406 21407function adjustCSS( elem, prop, valueParts, tween ) { 21408 var adjusted, scale, 21409 maxIterations = 20, 21410 currentValue = tween ? 21411 function() { 21412 return tween.cur(); 21413 } : 21414 function() { 21415 return jQuery.css( elem, prop, "" ); 21416 }, 21417 initial = currentValue(), 21418 unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), 21419 21420 // Starting value computation is required for potential unit mismatches 21421 initialInUnit = elem.nodeType && 21422 ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && 21423 rcssNum.exec( jQuery.css( elem, prop ) ); 21424 21425 if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { 21426 21427 // Support: Firefox <=54 21428 // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) 21429 initial = initial / 2; 21430 21431 // Trust units reported by jQuery.css 21432 unit = unit || initialInUnit[ 3 ]; 21433 21434 // Iteratively approximate from a nonzero starting point 21435 initialInUnit = +initial || 1; 21436 21437 while ( maxIterations-- ) { 21438 21439 // Evaluate and update our best guess (doubling guesses that zero out). 21440 // Finish if the scale equals or crosses 1 (making the old*new product non-positive). 21441 jQuery.style( elem, prop, initialInUnit + unit ); 21442 if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { 21443 maxIterations = 0; 21444 } 21445 initialInUnit = initialInUnit / scale; 21446 21447 } 21448 21449 initialInUnit = initialInUnit * 2; 21450 jQuery.style( elem, prop, initialInUnit + unit ); 21451 21452 // Make sure we update the tween properties later on 21453 valueParts = valueParts || []; 21454 } 21455 21456 if ( valueParts ) { 21457 initialInUnit = +initialInUnit || +initial || 0; 21458 21459 // Apply relative offset (+=/-=) if specified 21460 adjusted = valueParts[ 1 ] ? 21461 initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : 21462 +valueParts[ 2 ]; 21463 if ( tween ) { 21464 tween.unit = unit; 21465 tween.start = initialInUnit; 21466 tween.end = adjusted; 21467 } 21468 } 21469 return adjusted; 21470} 21471 21472 21473var defaultDisplayMap = {}; 21474 21475function getDefaultDisplay( elem ) { 21476 var temp, 21477 doc = elem.ownerDocument, 21478 nodeName = elem.nodeName, 21479 display = defaultDisplayMap[ nodeName ]; 21480 21481 if ( display ) { 21482 return display; 21483 } 21484 21485 temp = doc.body.appendChild( doc.createElement( nodeName ) ); 21486 display = jQuery.css( temp, "display" ); 21487 21488 temp.parentNode.removeChild( temp ); 21489 21490 if ( display === "none" ) { 21491 display = "block"; 21492 } 21493 defaultDisplayMap[ nodeName ] = display; 21494 21495 return display; 21496} 21497 21498function showHide( elements, show ) { 21499 var display, elem, 21500 values = [], 21501 index = 0, 21502 length = elements.length; 21503 21504 // Determine new display value for elements that need to change 21505 for ( ; index < length; index++ ) { 21506 elem = elements[ index ]; 21507 if ( !elem.style ) { 21508 continue; 21509 } 21510 21511 display = elem.style.display; 21512 if ( show ) { 21513 21514 // Since we force visibility upon cascade-hidden elements, an immediate (and slow) 21515 // check is required in this first loop unless we have a nonempty display value (either 21516 // inline or about-to-be-restored) 21517 if ( display === "none" ) { 21518 values[ index ] = dataPriv.get( elem, "display" ) || null; 21519 if ( !values[ index ] ) { 21520 elem.style.display = ""; 21521 } 21522 } 21523 if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { 21524 values[ index ] = getDefaultDisplay( elem ); 21525 } 21526 } else { 21527 if ( display !== "none" ) { 21528 values[ index ] = "none"; 21529 21530 // Remember what we're overwriting 21531 dataPriv.set( elem, "display", display ); 21532 } 21533 } 21534 } 21535 21536 // Set the display of the elements in a second loop to avoid constant reflow 21537 for ( index = 0; index < length; index++ ) { 21538 if ( values[ index ] != null ) { 21539 elements[ index ].style.display = values[ index ]; 21540 } 21541 } 21542 21543 return elements; 21544} 21545 21546jQuery.fn.extend( { 21547 show: function() { 21548 return showHide( this, true ); 21549 }, 21550 hide: function() { 21551 return showHide( this ); 21552 }, 21553 toggle: function( state ) { 21554 if ( typeof state === "boolean" ) { 21555 return state ? this.show() : this.hide(); 21556 } 21557 21558 return this.each( function() { 21559 if ( isHiddenWithinTree( this ) ) { 21560 jQuery( this ).show(); 21561 } else { 21562 jQuery( this ).hide(); 21563 } 21564 } ); 21565 } 21566} ); 21567var rcheckableType = ( /^(?:checkbox|radio)$/i ); 21568 21569var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); 21570 21571var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); 21572 21573 21574 21575( function() { 21576 var fragment = document.createDocumentFragment(), 21577 div = fragment.appendChild( document.createElement( "div" ) ), 21578 input = document.createElement( "input" ); 21579 21580 // Support: Android 4.0 - 4.3 only 21581 // Check state lost if the name is set (#11217) 21582 // Support: Windows Web Apps (WWA) 21583 // `name` and `type` must use .setAttribute for WWA (#14901) 21584 input.setAttribute( "type", "radio" ); 21585 input.setAttribute( "checked", "checked" ); 21586 input.setAttribute( "name", "t" ); 21587 21588 div.appendChild( input ); 21589 21590 // Support: Android <=4.1 only 21591 // Older WebKit doesn't clone checked state correctly in fragments 21592 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; 21593 21594 // Support: IE <=11 only 21595 // Make sure textarea (and checkbox) defaultValue is properly cloned 21596 div.innerHTML = "<textarea>x</textarea>"; 21597 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; 21598 21599 // Support: IE <=9 only 21600 // IE <=9 replaces <option> tags with their contents when inserted outside of 21601 // the select element. 21602 div.innerHTML = "<option></option>"; 21603 support.option = !!div.lastChild; 21604} )(); 21605 21606 21607// We have to close these tags to support XHTML (#13200) 21608var wrapMap = { 21609 21610 // XHTML parsers do not magically insert elements in the 21611 // same way that tag soup parsers do. So we cannot shorten 21612 // this by omitting <tbody> or other required elements. 21613 thead: [ 1, "<table>", "</table>" ], 21614 col: [ 2, "<table><colgroup>", "</colgroup></table>" ], 21615 tr: [ 2, "<table><tbody>", "</tbody></table>" ], 21616 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], 21617 21618 _default: [ 0, "", "" ] 21619}; 21620 21621wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; 21622wrapMap.th = wrapMap.td; 21623 21624// Support: IE <=9 only 21625if ( !support.option ) { 21626 wrapMap.optgroup = wrapMap.option = [ 1, "<select multiple='multiple'>", "</select>" ]; 21627} 21628 21629 21630function getAll( context, tag ) { 21631 21632 // Support: IE <=9 - 11 only 21633 // Use typeof to avoid zero-argument method invocation on host objects (#15151) 21634 var ret; 21635 21636 if ( typeof context.getElementsByTagName !== "undefined" ) { 21637 ret = context.getElementsByTagName( tag || "*" ); 21638 21639 } else if ( typeof context.querySelectorAll !== "undefined" ) { 21640 ret = context.querySelectorAll( tag || "*" ); 21641 21642 } else { 21643 ret = []; 21644 } 21645 21646 if ( tag === undefined || tag && nodeName( context, tag ) ) { 21647 return jQuery.merge( [ context ], ret ); 21648 } 21649 21650 return ret; 21651} 21652 21653 21654// Mark scripts as having already been evaluated 21655function setGlobalEval( elems, refElements ) { 21656 var i = 0, 21657 l = elems.length; 21658 21659 for ( ; i < l; i++ ) { 21660 dataPriv.set( 21661 elems[ i ], 21662 "globalEval", 21663 !refElements || dataPriv.get( refElements[ i ], "globalEval" ) 21664 ); 21665 } 21666} 21667 21668 21669var rhtml = /<|&#?\w+;/; 21670 21671function buildFragment( elems, context, scripts, selection, ignored ) { 21672 var elem, tmp, tag, wrap, attached, j, 21673 fragment = context.createDocumentFragment(), 21674 nodes = [], 21675 i = 0, 21676 l = elems.length; 21677 21678 for ( ; i < l; i++ ) { 21679 elem = elems[ i ]; 21680 21681 if ( elem || elem === 0 ) { 21682 21683 // Add nodes directly 21684 if ( toType( elem ) === "object" ) { 21685 21686 // Support: Android <=4.0 only, PhantomJS 1 only 21687 // push.apply(_, arraylike) throws on ancient WebKit 21688 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); 21689 21690 // Convert non-html into a text node 21691 } else if ( !rhtml.test( elem ) ) { 21692 nodes.push( context.createTextNode( elem ) ); 21693 21694 // Convert html into DOM nodes 21695 } else { 21696 tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); 21697 21698 // Deserialize a standard representation 21699 tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); 21700 wrap = wrapMap[ tag ] || wrapMap._default; 21701 tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; 21702 21703 // Descend through wrappers to the right content 21704 j = wrap[ 0 ]; 21705 while ( j-- ) { 21706 tmp = tmp.lastChild; 21707 } 21708 21709 // Support: Android <=4.0 only, PhantomJS 1 only 21710 // push.apply(_, arraylike) throws on ancient WebKit 21711 jQuery.merge( nodes, tmp.childNodes ); 21712 21713 // Remember the top-level container 21714 tmp = fragment.firstChild; 21715 21716 // Ensure the created nodes are orphaned (#12392) 21717 tmp.textContent = ""; 21718 } 21719 } 21720 } 21721 21722 // Remove wrapper from fragment 21723 fragment.textContent = ""; 21724 21725 i = 0; 21726 while ( ( elem = nodes[ i++ ] ) ) { 21727 21728 // Skip elements already in the context collection (trac-4087) 21729 if ( selection && jQuery.inArray( elem, selection ) > -1 ) { 21730 if ( ignored ) { 21731 ignored.push( elem ); 21732 } 21733 continue; 21734 } 21735 21736 attached = isAttached( elem ); 21737 21738 // Append to fragment 21739 tmp = getAll( fragment.appendChild( elem ), "script" ); 21740 21741 // Preserve script evaluation history 21742 if ( attached ) { 21743 setGlobalEval( tmp ); 21744 } 21745 21746 // Capture executables 21747 if ( scripts ) { 21748 j = 0; 21749 while ( ( elem = tmp[ j++ ] ) ) { 21750 if ( rscriptType.test( elem.type || "" ) ) { 21751 scripts.push( elem ); 21752 } 21753 } 21754 } 21755 } 21756 21757 return fragment; 21758} 21759 21760 21761var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; 21762 21763function returnTrue() { 21764 return true; 21765} 21766 21767function returnFalse() { 21768 return false; 21769} 21770 21771// Support: IE <=9 - 11+ 21772// focus() and blur() are asynchronous, except when they are no-op. 21773// So expect focus to be synchronous when the element is already active, 21774// and blur to be synchronous when the element is not already active. 21775// (focus and blur are always synchronous in other supported browsers, 21776// this just defines when we can count on it). 21777function expectSync( elem, type ) { 21778 return ( elem === safeActiveElement() ) === ( type === "focus" ); 21779} 21780 21781// Support: IE <=9 only 21782// Accessing document.activeElement can throw unexpectedly 21783// https://bugs.jquery.com/ticket/13393 21784function safeActiveElement() { 21785 try { 21786 return document.activeElement; 21787 } catch ( err ) { } 21788} 21789 21790function on( elem, types, selector, data, fn, one ) { 21791 var origFn, type; 21792 21793 // Types can be a map of types/handlers 21794 if ( typeof types === "object" ) { 21795 21796 // ( types-Object, selector, data ) 21797 if ( typeof selector !== "string" ) { 21798 21799 // ( types-Object, data ) 21800 data = data || selector; 21801 selector = undefined; 21802 } 21803 for ( type in types ) { 21804 on( elem, type, selector, data, types[ type ], one ); 21805 } 21806 return elem; 21807 } 21808 21809 if ( data == null && fn == null ) { 21810 21811 // ( types, fn ) 21812 fn = selector; 21813 data = selector = undefined; 21814 } else if ( fn == null ) { 21815 if ( typeof selector === "string" ) { 21816 21817 // ( types, selector, fn ) 21818 fn = data; 21819 data = undefined; 21820 } else { 21821 21822 // ( types, data, fn ) 21823 fn = data; 21824 data = selector; 21825 selector = undefined; 21826 } 21827 } 21828 if ( fn === false ) { 21829 fn = returnFalse; 21830 } else if ( !fn ) { 21831 return elem; 21832 } 21833 21834 if ( one === 1 ) { 21835 origFn = fn; 21836 fn = function( event ) { 21837 21838 // Can use an empty set, since event contains the info 21839 jQuery().off( event ); 21840 return origFn.apply( this, arguments ); 21841 }; 21842 21843 // Use same guid so caller can remove using origFn 21844 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); 21845 } 21846 return elem.each( function() { 21847 jQuery.event.add( this, types, fn, data, selector ); 21848 } ); 21849} 21850 21851/* 21852 * Helper functions for managing events -- not part of the public interface. 21853 * Props to Dean Edwards' addEvent library for many of the ideas. 21854 */ 21855jQuery.event = { 21856 21857 global: {}, 21858 21859 add: function( elem, types, handler, data, selector ) { 21860 21861 var handleObjIn, eventHandle, tmp, 21862 events, t, handleObj, 21863 special, handlers, type, namespaces, origType, 21864 elemData = dataPriv.get( elem ); 21865 21866 // Only attach events to objects that accept data 21867 if ( !acceptData( elem ) ) { 21868 return; 21869 } 21870 21871 // Caller can pass in an object of custom data in lieu of the handler 21872 if ( handler.handler ) { 21873 handleObjIn = handler; 21874 handler = handleObjIn.handler; 21875 selector = handleObjIn.selector; 21876 } 21877 21878 // Ensure that invalid selectors throw exceptions at attach time 21879 // Evaluate against documentElement in case elem is a non-element node (e.g., document) 21880 if ( selector ) { 21881 jQuery.find.matchesSelector( documentElement, selector ); 21882 } 21883 21884 // Make sure that the handler has a unique ID, used to find/remove it later 21885 if ( !handler.guid ) { 21886 handler.guid = jQuery.guid++; 21887 } 21888 21889 // Init the element's event structure and main handler, if this is the first 21890 if ( !( events = elemData.events ) ) { 21891 events = elemData.events = Object.create( null ); 21892 } 21893 if ( !( eventHandle = elemData.handle ) ) { 21894 eventHandle = elemData.handle = function( e ) { 21895 21896 // Discard the second event of a jQuery.event.trigger() and 21897 // when an event is called after a page has unloaded 21898 return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? 21899 jQuery.event.dispatch.apply( elem, arguments ) : undefined; 21900 }; 21901 } 21902 21903 // Handle multiple events separated by a space 21904 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 21905 t = types.length; 21906 while ( t-- ) { 21907 tmp = rtypenamespace.exec( types[ t ] ) || []; 21908 type = origType = tmp[ 1 ]; 21909 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 21910 21911 // There *must* be a type, no attaching namespace-only handlers 21912 if ( !type ) { 21913 continue; 21914 } 21915 21916 // If event changes its type, use the special event handlers for the changed type 21917 special = jQuery.event.special[ type ] || {}; 21918 21919 // If selector defined, determine special event api type, otherwise given type 21920 type = ( selector ? special.delegateType : special.bindType ) || type; 21921 21922 // Update special based on newly reset type 21923 special = jQuery.event.special[ type ] || {}; 21924 21925 // handleObj is passed to all event handlers 21926 handleObj = jQuery.extend( { 21927 type: type, 21928 origType: origType, 21929 data: data, 21930 handler: handler, 21931 guid: handler.guid, 21932 selector: selector, 21933 needsContext: selector && jQuery.expr.match.needsContext.test( selector ), 21934 namespace: namespaces.join( "." ) 21935 }, handleObjIn ); 21936 21937 // Init the event handler queue if we're the first 21938 if ( !( handlers = events[ type ] ) ) { 21939 handlers = events[ type ] = []; 21940 handlers.delegateCount = 0; 21941 21942 // Only use addEventListener if the special events handler returns false 21943 if ( !special.setup || 21944 special.setup.call( elem, data, namespaces, eventHandle ) === false ) { 21945 21946 if ( elem.addEventListener ) { 21947 elem.addEventListener( type, eventHandle ); 21948 } 21949 } 21950 } 21951 21952 if ( special.add ) { 21953 special.add.call( elem, handleObj ); 21954 21955 if ( !handleObj.handler.guid ) { 21956 handleObj.handler.guid = handler.guid; 21957 } 21958 } 21959 21960 // Add to the element's handler list, delegates in front 21961 if ( selector ) { 21962 handlers.splice( handlers.delegateCount++, 0, handleObj ); 21963 } else { 21964 handlers.push( handleObj ); 21965 } 21966 21967 // Keep track of which events have ever been used, for event optimization 21968 jQuery.event.global[ type ] = true; 21969 } 21970 21971 }, 21972 21973 // Detach an event or set of events from an element 21974 remove: function( elem, types, handler, selector, mappedTypes ) { 21975 21976 var j, origCount, tmp, 21977 events, t, handleObj, 21978 special, handlers, type, namespaces, origType, 21979 elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); 21980 21981 if ( !elemData || !( events = elemData.events ) ) { 21982 return; 21983 } 21984 21985 // Once for each type.namespace in types; type may be omitted 21986 types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; 21987 t = types.length; 21988 while ( t-- ) { 21989 tmp = rtypenamespace.exec( types[ t ] ) || []; 21990 type = origType = tmp[ 1 ]; 21991 namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); 21992 21993 // Unbind all events (on this namespace, if provided) for the element 21994 if ( !type ) { 21995 for ( type in events ) { 21996 jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); 21997 } 21998 continue; 21999 } 22000 22001 special = jQuery.event.special[ type ] || {}; 22002 type = ( selector ? special.delegateType : special.bindType ) || type; 22003 handlers = events[ type ] || []; 22004 tmp = tmp[ 2 ] && 22005 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); 22006 22007 // Remove matching events 22008 origCount = j = handlers.length; 22009 while ( j-- ) { 22010 handleObj = handlers[ j ]; 22011 22012 if ( ( mappedTypes || origType === handleObj.origType ) && 22013 ( !handler || handler.guid === handleObj.guid ) && 22014 ( !tmp || tmp.test( handleObj.namespace ) ) && 22015 ( !selector || selector === handleObj.selector || 22016 selector === "**" && handleObj.selector ) ) { 22017 handlers.splice( j, 1 ); 22018 22019 if ( handleObj.selector ) { 22020 handlers.delegateCount--; 22021 } 22022 if ( special.remove ) { 22023 special.remove.call( elem, handleObj ); 22024 } 22025 } 22026 } 22027 22028 // Remove generic event handler if we removed something and no more handlers exist 22029 // (avoids potential for endless recursion during removal of special event handlers) 22030 if ( origCount && !handlers.length ) { 22031 if ( !special.teardown || 22032 special.teardown.call( elem, namespaces, elemData.handle ) === false ) { 22033 22034 jQuery.removeEvent( elem, type, elemData.handle ); 22035 } 22036 22037 delete events[ type ]; 22038 } 22039 } 22040 22041 // Remove data and the expando if it's no longer used 22042 if ( jQuery.isEmptyObject( events ) ) { 22043 dataPriv.remove( elem, "handle events" ); 22044 } 22045 }, 22046 22047 dispatch: function( nativeEvent ) { 22048 22049 var i, j, ret, matched, handleObj, handlerQueue, 22050 args = new Array( arguments.length ), 22051 22052 // Make a writable jQuery.Event from the native event object 22053 event = jQuery.event.fix( nativeEvent ), 22054 22055 handlers = ( 22056 dataPriv.get( this, "events" ) || Object.create( null ) 22057 )[ event.type ] || [], 22058 special = jQuery.event.special[ event.type ] || {}; 22059 22060 // Use the fix-ed jQuery.Event rather than the (read-only) native event 22061 args[ 0 ] = event; 22062 22063 for ( i = 1; i < arguments.length; i++ ) { 22064 args[ i ] = arguments[ i ]; 22065 } 22066 22067 event.delegateTarget = this; 22068 22069 // Call the preDispatch hook for the mapped type, and let it bail if desired 22070 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { 22071 return; 22072 } 22073 22074 // Determine handlers 22075 handlerQueue = jQuery.event.handlers.call( this, event, handlers ); 22076 22077 // Run delegates first; they may want to stop propagation beneath us 22078 i = 0; 22079 while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { 22080 event.currentTarget = matched.elem; 22081 22082 j = 0; 22083 while ( ( handleObj = matched.handlers[ j++ ] ) && 22084 !event.isImmediatePropagationStopped() ) { 22085 22086 // If the event is namespaced, then each handler is only invoked if it is 22087 // specially universal or its namespaces are a superset of the event's. 22088 if ( !event.rnamespace || handleObj.namespace === false || 22089 event.rnamespace.test( handleObj.namespace ) ) { 22090 22091 event.handleObj = handleObj; 22092 event.data = handleObj.data; 22093 22094 ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || 22095 handleObj.handler ).apply( matched.elem, args ); 22096 22097 if ( ret !== undefined ) { 22098 if ( ( event.result = ret ) === false ) { 22099 event.preventDefault(); 22100 event.stopPropagation(); 22101 } 22102 } 22103 } 22104 } 22105 } 22106 22107 // Call the postDispatch hook for the mapped type 22108 if ( special.postDispatch ) { 22109 special.postDispatch.call( this, event ); 22110 } 22111 22112 return event.result; 22113 }, 22114 22115 handlers: function( event, handlers ) { 22116 var i, handleObj, sel, matchedHandlers, matchedSelectors, 22117 handlerQueue = [], 22118 delegateCount = handlers.delegateCount, 22119 cur = event.target; 22120 22121 // Find delegate handlers 22122 if ( delegateCount && 22123 22124 // Support: IE <=9 22125 // Black-hole SVG <use> instance trees (trac-13180) 22126 cur.nodeType && 22127 22128 // Support: Firefox <=42 22129 // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) 22130 // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click 22131 // Support: IE 11 only 22132 // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) 22133 !( event.type === "click" && event.button >= 1 ) ) { 22134 22135 for ( ; cur !== this; cur = cur.parentNode || this ) { 22136 22137 // Don't check non-elements (#13208) 22138 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) 22139 if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { 22140 matchedHandlers = []; 22141 matchedSelectors = {}; 22142 for ( i = 0; i < delegateCount; i++ ) { 22143 handleObj = handlers[ i ]; 22144 22145 // Don't conflict with Object.prototype properties (#13203) 22146 sel = handleObj.selector + " "; 22147 22148 if ( matchedSelectors[ sel ] === undefined ) { 22149 matchedSelectors[ sel ] = handleObj.needsContext ? 22150 jQuery( sel, this ).index( cur ) > -1 : 22151 jQuery.find( sel, this, null, [ cur ] ).length; 22152 } 22153 if ( matchedSelectors[ sel ] ) { 22154 matchedHandlers.push( handleObj ); 22155 } 22156 } 22157 if ( matchedHandlers.length ) { 22158 handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); 22159 } 22160 } 22161 } 22162 } 22163 22164 // Add the remaining (directly-bound) handlers 22165 cur = this; 22166 if ( delegateCount < handlers.length ) { 22167 handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); 22168 } 22169 22170 return handlerQueue; 22171 }, 22172 22173 addProp: function( name, hook ) { 22174 Object.defineProperty( jQuery.Event.prototype, name, { 22175 enumerable: true, 22176 configurable: true, 22177 22178 get: isFunction( hook ) ? 22179 function() { 22180 if ( this.originalEvent ) { 22181 return hook( this.originalEvent ); 22182 } 22183 } : 22184 function() { 22185 if ( this.originalEvent ) { 22186 return this.originalEvent[ name ]; 22187 } 22188 }, 22189 22190 set: function( value ) { 22191 Object.defineProperty( this, name, { 22192 enumerable: true, 22193 configurable: true, 22194 writable: true, 22195 value: value 22196 } ); 22197 } 22198 } ); 22199 }, 22200 22201 fix: function( originalEvent ) { 22202 return originalEvent[ jQuery.expando ] ? 22203 originalEvent : 22204 new jQuery.Event( originalEvent ); 22205 }, 22206 22207 special: { 22208 load: { 22209 22210 // Prevent triggered image.load events from bubbling to window.load 22211 noBubble: true 22212 }, 22213 click: { 22214 22215 // Utilize native event to ensure correct state for checkable inputs 22216 setup: function( data ) { 22217 22218 // For mutual compressibility with _default, replace `this` access with a local var. 22219 // `|| data` is dead code meant only to preserve the variable through minification. 22220 var el = this || data; 22221 22222 // Claim the first handler 22223 if ( rcheckableType.test( el.type ) && 22224 el.click && nodeName( el, "input" ) ) { 22225 22226 // dataPriv.set( el, "click", ... ) 22227 leverageNative( el, "click", returnTrue ); 22228 } 22229 22230 // Return false to allow normal processing in the caller 22231 return false; 22232 }, 22233 trigger: function( data ) { 22234 22235 // For mutual compressibility with _default, replace `this` access with a local var. 22236 // `|| data` is dead code meant only to preserve the variable through minification. 22237 var el = this || data; 22238 22239 // Force setup before triggering a click 22240 if ( rcheckableType.test( el.type ) && 22241 el.click && nodeName( el, "input" ) ) { 22242 22243 leverageNative( el, "click" ); 22244 } 22245 22246 // Return non-false to allow normal event-path propagation 22247 return true; 22248 }, 22249 22250 // For cross-browser consistency, suppress native .click() on links 22251 // Also prevent it if we're currently inside a leveraged native-event stack 22252 _default: function( event ) { 22253 var target = event.target; 22254 return rcheckableType.test( target.type ) && 22255 target.click && nodeName( target, "input" ) && 22256 dataPriv.get( target, "click" ) || 22257 nodeName( target, "a" ); 22258 } 22259 }, 22260 22261 beforeunload: { 22262 postDispatch: function( event ) { 22263 22264 // Support: Firefox 20+ 22265 // Firefox doesn't alert if the returnValue field is not set. 22266 if ( event.result !== undefined && event.originalEvent ) { 22267 event.originalEvent.returnValue = event.result; 22268 } 22269 } 22270 } 22271 } 22272}; 22273 22274// Ensure the presence of an event listener that handles manually-triggered 22275// synthetic events by interrupting progress until reinvoked in response to 22276// *native* events that it fires directly, ensuring that state changes have 22277// already occurred before other listeners are invoked. 22278function leverageNative( el, type, expectSync ) { 22279 22280 // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add 22281 if ( !expectSync ) { 22282 if ( dataPriv.get( el, type ) === undefined ) { 22283 jQuery.event.add( el, type, returnTrue ); 22284 } 22285 return; 22286 } 22287 22288 // Register the controller as a special universal handler for all event namespaces 22289 dataPriv.set( el, type, false ); 22290 jQuery.event.add( el, type, { 22291 namespace: false, 22292 handler: function( event ) { 22293 var notAsync, result, 22294 saved = dataPriv.get( this, type ); 22295 22296 if ( ( event.isTrigger & 1 ) && this[ type ] ) { 22297 22298 // Interrupt processing of the outer synthetic .trigger()ed event 22299 // Saved data should be false in such cases, but might be a leftover capture object 22300 // from an async native handler (gh-4350) 22301 if ( !saved.length ) { 22302 22303 // Store arguments for use when handling the inner native event 22304 // There will always be at least one argument (an event object), so this array 22305 // will not be confused with a leftover capture object. 22306 saved = slice.call( arguments ); 22307 dataPriv.set( this, type, saved ); 22308 22309 // Trigger the native event and capture its result 22310 // Support: IE <=9 - 11+ 22311 // focus() and blur() are asynchronous 22312 notAsync = expectSync( this, type ); 22313 this[ type ](); 22314 result = dataPriv.get( this, type ); 22315 if ( saved !== result || notAsync ) { 22316 dataPriv.set( this, type, false ); 22317 } else { 22318 result = {}; 22319 } 22320 if ( saved !== result ) { 22321 22322 // Cancel the outer synthetic event 22323 event.stopImmediatePropagation(); 22324 event.preventDefault(); 22325 22326 // Support: Chrome 86+ 22327 // In Chrome, if an element having a focusout handler is blurred by 22328 // clicking outside of it, it invokes the handler synchronously. If 22329 // that handler calls `.remove()` on the element, the data is cleared, 22330 // leaving `result` undefined. We need to guard against this. 22331 return result && result.value; 22332 } 22333 22334 // If this is an inner synthetic event for an event with a bubbling surrogate 22335 // (focus or blur), assume that the surrogate already propagated from triggering the 22336 // native event and prevent that from happening again here. 22337 // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the 22338 // bubbling surrogate propagates *after* the non-bubbling base), but that seems 22339 // less bad than duplication. 22340 } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { 22341 event.stopPropagation(); 22342 } 22343 22344 // If this is a native event triggered above, everything is now in order 22345 // Fire an inner synthetic event with the original arguments 22346 } else if ( saved.length ) { 22347 22348 // ...and capture the result 22349 dataPriv.set( this, type, { 22350 value: jQuery.event.trigger( 22351 22352 // Support: IE <=9 - 11+ 22353 // Extend with the prototype to reset the above stopImmediatePropagation() 22354 jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), 22355 saved.slice( 1 ), 22356 this 22357 ) 22358 } ); 22359 22360 // Abort handling of the native event 22361 event.stopImmediatePropagation(); 22362 } 22363 } 22364 } ); 22365} 22366 22367jQuery.removeEvent = function( elem, type, handle ) { 22368 22369 // This "if" is needed for plain objects 22370 if ( elem.removeEventListener ) { 22371 elem.removeEventListener( type, handle ); 22372 } 22373}; 22374 22375jQuery.Event = function( src, props ) { 22376 22377 // Allow instantiation without the 'new' keyword 22378 if ( !( this instanceof jQuery.Event ) ) { 22379 return new jQuery.Event( src, props ); 22380 } 22381 22382 // Event object 22383 if ( src && src.type ) { 22384 this.originalEvent = src; 22385 this.type = src.type; 22386 22387 // Events bubbling up the document may have been marked as prevented 22388 // by a handler lower down the tree; reflect the correct value. 22389 this.isDefaultPrevented = src.defaultPrevented || 22390 src.defaultPrevented === undefined && 22391 22392 // Support: Android <=2.3 only 22393 src.returnValue === false ? 22394 returnTrue : 22395 returnFalse; 22396 22397 // Create target properties 22398 // Support: Safari <=6 - 7 only 22399 // Target should not be a text node (#504, #13143) 22400 this.target = ( src.target && src.target.nodeType === 3 ) ? 22401 src.target.parentNode : 22402 src.target; 22403 22404 this.currentTarget = src.currentTarget; 22405 this.relatedTarget = src.relatedTarget; 22406 22407 // Event type 22408 } else { 22409 this.type = src; 22410 } 22411 22412 // Put explicitly provided properties onto the event object 22413 if ( props ) { 22414 jQuery.extend( this, props ); 22415 } 22416 22417 // Create a timestamp if incoming event doesn't have one 22418 this.timeStamp = src && src.timeStamp || Date.now(); 22419 22420 // Mark it as fixed 22421 this[ jQuery.expando ] = true; 22422}; 22423 22424// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding 22425// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html 22426jQuery.Event.prototype = { 22427 constructor: jQuery.Event, 22428 isDefaultPrevented: returnFalse, 22429 isPropagationStopped: returnFalse, 22430 isImmediatePropagationStopped: returnFalse, 22431 isSimulated: false, 22432 22433 preventDefault: function() { 22434 var e = this.originalEvent; 22435 22436 this.isDefaultPrevented = returnTrue; 22437 22438 if ( e && !this.isSimulated ) { 22439 e.preventDefault(); 22440 } 22441 }, 22442 stopPropagation: function() { 22443 var e = this.originalEvent; 22444 22445 this.isPropagationStopped = returnTrue; 22446 22447 if ( e && !this.isSimulated ) { 22448 e.stopPropagation(); 22449 } 22450 }, 22451 stopImmediatePropagation: function() { 22452 var e = this.originalEvent; 22453 22454 this.isImmediatePropagationStopped = returnTrue; 22455 22456 if ( e && !this.isSimulated ) { 22457 e.stopImmediatePropagation(); 22458 } 22459 22460 this.stopPropagation(); 22461 } 22462}; 22463 22464// Includes all common event props including KeyEvent and MouseEvent specific props 22465jQuery.each( { 22466 altKey: true, 22467 bubbles: true, 22468 cancelable: true, 22469 changedTouches: true, 22470 ctrlKey: true, 22471 detail: true, 22472 eventPhase: true, 22473 metaKey: true, 22474 pageX: true, 22475 pageY: true, 22476 shiftKey: true, 22477 view: true, 22478 "char": true, 22479 code: true, 22480 charCode: true, 22481 key: true, 22482 keyCode: true, 22483 button: true, 22484 buttons: true, 22485 clientX: true, 22486 clientY: true, 22487 offsetX: true, 22488 offsetY: true, 22489 pointerId: true, 22490 pointerType: true, 22491 screenX: true, 22492 screenY: true, 22493 targetTouches: true, 22494 toElement: true, 22495 touches: true, 22496 which: true 22497}, jQuery.event.addProp ); 22498 22499jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { 22500 jQuery.event.special[ type ] = { 22501 22502 // Utilize native event if possible so blur/focus sequence is correct 22503 setup: function() { 22504 22505 // Claim the first handler 22506 // dataPriv.set( this, "focus", ... ) 22507 // dataPriv.set( this, "blur", ... ) 22508 leverageNative( this, type, expectSync ); 22509 22510 // Return false to allow normal processing in the caller 22511 return false; 22512 }, 22513 trigger: function() { 22514 22515 // Force setup before trigger 22516 leverageNative( this, type ); 22517 22518 // Return non-false to allow normal event-path propagation 22519 return true; 22520 }, 22521 22522 // Suppress native focus or blur as it's already being fired 22523 // in leverageNative. 22524 _default: function() { 22525 return true; 22526 }, 22527 22528 delegateType: delegateType 22529 }; 22530} ); 22531 22532// Create mouseenter/leave events using mouseover/out and event-time checks 22533// so that event delegation works in jQuery. 22534// Do the same for pointerenter/pointerleave and pointerover/pointerout 22535// 22536// Support: Safari 7 only 22537// Safari sends mouseenter too often; see: 22538// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 22539// for the description of the bug (it existed in older Chrome versions as well). 22540jQuery.each( { 22541 mouseenter: "mouseover", 22542 mouseleave: "mouseout", 22543 pointerenter: "pointerover", 22544 pointerleave: "pointerout" 22545}, function( orig, fix ) { 22546 jQuery.event.special[ orig ] = { 22547 delegateType: fix, 22548 bindType: fix, 22549 22550 handle: function( event ) { 22551 var ret, 22552 target = this, 22553 related = event.relatedTarget, 22554 handleObj = event.handleObj; 22555 22556 // For mouseenter/leave call the handler if related is outside the target. 22557 // NB: No relatedTarget if the mouse left/entered the browser window 22558 if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { 22559 event.type = handleObj.origType; 22560 ret = handleObj.handler.apply( this, arguments ); 22561 event.type = fix; 22562 } 22563 return ret; 22564 } 22565 }; 22566} ); 22567 22568jQuery.fn.extend( { 22569 22570 on: function( types, selector, data, fn ) { 22571 return on( this, types, selector, data, fn ); 22572 }, 22573 one: function( types, selector, data, fn ) { 22574 return on( this, types, selector, data, fn, 1 ); 22575 }, 22576 off: function( types, selector, fn ) { 22577 var handleObj, type; 22578 if ( types && types.preventDefault && types.handleObj ) { 22579 22580 // ( event ) dispatched jQuery.Event 22581 handleObj = types.handleObj; 22582 jQuery( types.delegateTarget ).off( 22583 handleObj.namespace ? 22584 handleObj.origType + "." + handleObj.namespace : 22585 handleObj.origType, 22586 handleObj.selector, 22587 handleObj.handler 22588 ); 22589 return this; 22590 } 22591 if ( typeof types === "object" ) { 22592 22593 // ( types-object [, selector] ) 22594 for ( type in types ) { 22595 this.off( type, selector, types[ type ] ); 22596 } 22597 return this; 22598 } 22599 if ( selector === false || typeof selector === "function" ) { 22600 22601 // ( types [, fn] ) 22602 fn = selector; 22603 selector = undefined; 22604 } 22605 if ( fn === false ) { 22606 fn = returnFalse; 22607 } 22608 return this.each( function() { 22609 jQuery.event.remove( this, types, fn, selector ); 22610 } ); 22611 } 22612} ); 22613 22614 22615var 22616 22617 // Support: IE <=10 - 11, Edge 12 - 13 only 22618 // In IE/Edge using regex groups here causes severe slowdowns. 22619 // See https://connect.microsoft.com/IE/feedback/details/1736512/ 22620 rnoInnerhtml = /<script|<style|<link/i, 22621 22622 // checked="checked" or checked 22623 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, 22624 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g; 22625 22626// Prefer a tbody over its parent table for containing new rows 22627function manipulationTarget( elem, content ) { 22628 if ( nodeName( elem, "table" ) && 22629 nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { 22630 22631 return jQuery( elem ).children( "tbody" )[ 0 ] || elem; 22632 } 22633 22634 return elem; 22635} 22636 22637// Replace/restore the type attribute of script elements for safe DOM manipulation 22638function disableScript( elem ) { 22639 elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; 22640 return elem; 22641} 22642function restoreScript( elem ) { 22643 if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { 22644 elem.type = elem.type.slice( 5 ); 22645 } else { 22646 elem.removeAttribute( "type" ); 22647 } 22648 22649 return elem; 22650} 22651 22652function cloneCopyEvent( src, dest ) { 22653 var i, l, type, pdataOld, udataOld, udataCur, events; 22654 22655 if ( dest.nodeType !== 1 ) { 22656 return; 22657 } 22658 22659 // 1. Copy private data: events, handlers, etc. 22660 if ( dataPriv.hasData( src ) ) { 22661 pdataOld = dataPriv.get( src ); 22662 events = pdataOld.events; 22663 22664 if ( events ) { 22665 dataPriv.remove( dest, "handle events" ); 22666 22667 for ( type in events ) { 22668 for ( i = 0, l = events[ type ].length; i < l; i++ ) { 22669 jQuery.event.add( dest, type, events[ type ][ i ] ); 22670 } 22671 } 22672 } 22673 } 22674 22675 // 2. Copy user data 22676 if ( dataUser.hasData( src ) ) { 22677 udataOld = dataUser.access( src ); 22678 udataCur = jQuery.extend( {}, udataOld ); 22679 22680 dataUser.set( dest, udataCur ); 22681 } 22682} 22683 22684// Fix IE bugs, see support tests 22685function fixInput( src, dest ) { 22686 var nodeName = dest.nodeName.toLowerCase(); 22687 22688 // Fails to persist the checked state of a cloned checkbox or radio button. 22689 if ( nodeName === "input" && rcheckableType.test( src.type ) ) { 22690 dest.checked = src.checked; 22691 22692 // Fails to return the selected option to the default selected state when cloning options 22693 } else if ( nodeName === "input" || nodeName === "textarea" ) { 22694 dest.defaultValue = src.defaultValue; 22695 } 22696} 22697 22698function domManip( collection, args, callback, ignored ) { 22699 22700 // Flatten any nested arrays 22701 args = flat( args ); 22702 22703 var fragment, first, scripts, hasScripts, node, doc, 22704 i = 0, 22705 l = collection.length, 22706 iNoClone = l - 1, 22707 value = args[ 0 ], 22708 valueIsFunction = isFunction( value ); 22709 22710 // We can't cloneNode fragments that contain checked, in WebKit 22711 if ( valueIsFunction || 22712 ( l > 1 && typeof value === "string" && 22713 !support.checkClone && rchecked.test( value ) ) ) { 22714 return collection.each( function( index ) { 22715 var self = collection.eq( index ); 22716 if ( valueIsFunction ) { 22717 args[ 0 ] = value.call( this, index, self.html() ); 22718 } 22719 domManip( self, args, callback, ignored ); 22720 } ); 22721 } 22722 22723 if ( l ) { 22724 fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); 22725 first = fragment.firstChild; 22726 22727 if ( fragment.childNodes.length === 1 ) { 22728 fragment = first; 22729 } 22730 22731 // Require either new content or an interest in ignored elements to invoke the callback 22732 if ( first || ignored ) { 22733 scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); 22734 hasScripts = scripts.length; 22735 22736 // Use the original fragment for the last item 22737 // instead of the first because it can end up 22738 // being emptied incorrectly in certain situations (#8070). 22739 for ( ; i < l; i++ ) { 22740 node = fragment; 22741 22742 if ( i !== iNoClone ) { 22743 node = jQuery.clone( node, true, true ); 22744 22745 // Keep references to cloned scripts for later restoration 22746 if ( hasScripts ) { 22747 22748 // Support: Android <=4.0 only, PhantomJS 1 only 22749 // push.apply(_, arraylike) throws on ancient WebKit 22750 jQuery.merge( scripts, getAll( node, "script" ) ); 22751 } 22752 } 22753 22754 callback.call( collection[ i ], node, i ); 22755 } 22756 22757 if ( hasScripts ) { 22758 doc = scripts[ scripts.length - 1 ].ownerDocument; 22759 22760 // Reenable scripts 22761 jQuery.map( scripts, restoreScript ); 22762 22763 // Evaluate executable scripts on first document insertion 22764 for ( i = 0; i < hasScripts; i++ ) { 22765 node = scripts[ i ]; 22766 if ( rscriptType.test( node.type || "" ) && 22767 !dataPriv.access( node, "globalEval" ) && 22768 jQuery.contains( doc, node ) ) { 22769 22770 if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { 22771 22772 // Optional AJAX dependency, but won't run scripts if not present 22773 if ( jQuery._evalUrl && !node.noModule ) { 22774 jQuery._evalUrl( node.src, { 22775 nonce: node.nonce || node.getAttribute( "nonce" ) 22776 }, doc ); 22777 } 22778 } else { 22779 DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); 22780 } 22781 } 22782 } 22783 } 22784 } 22785 } 22786 22787 return collection; 22788} 22789 22790function remove( elem, selector, keepData ) { 22791 var node, 22792 nodes = selector ? jQuery.filter( selector, elem ) : elem, 22793 i = 0; 22794 22795 for ( ; ( node = nodes[ i ] ) != null; i++ ) { 22796 if ( !keepData && node.nodeType === 1 ) { 22797 jQuery.cleanData( getAll( node ) ); 22798 } 22799 22800 if ( node.parentNode ) { 22801 if ( keepData && isAttached( node ) ) { 22802 setGlobalEval( getAll( node, "script" ) ); 22803 } 22804 node.parentNode.removeChild( node ); 22805 } 22806 } 22807 22808 return elem; 22809} 22810 22811jQuery.extend( { 22812 htmlPrefilter: function( html ) { 22813 return html; 22814 }, 22815 22816 clone: function( elem, dataAndEvents, deepDataAndEvents ) { 22817 var i, l, srcElements, destElements, 22818 clone = elem.cloneNode( true ), 22819 inPage = isAttached( elem ); 22820 22821 // Fix IE cloning issues 22822 if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && 22823 !jQuery.isXMLDoc( elem ) ) { 22824 22825 // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 22826 destElements = getAll( clone ); 22827 srcElements = getAll( elem ); 22828 22829 for ( i = 0, l = srcElements.length; i < l; i++ ) { 22830 fixInput( srcElements[ i ], destElements[ i ] ); 22831 } 22832 } 22833 22834 // Copy the events from the original to the clone 22835 if ( dataAndEvents ) { 22836 if ( deepDataAndEvents ) { 22837 srcElements = srcElements || getAll( elem ); 22838 destElements = destElements || getAll( clone ); 22839 22840 for ( i = 0, l = srcElements.length; i < l; i++ ) { 22841 cloneCopyEvent( srcElements[ i ], destElements[ i ] ); 22842 } 22843 } else { 22844 cloneCopyEvent( elem, clone ); 22845 } 22846 } 22847 22848 // Preserve script evaluation history 22849 destElements = getAll( clone, "script" ); 22850 if ( destElements.length > 0 ) { 22851 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); 22852 } 22853 22854 // Return the cloned set 22855 return clone; 22856 }, 22857 22858 cleanData: function( elems ) { 22859 var data, elem, type, 22860 special = jQuery.event.special, 22861 i = 0; 22862 22863 for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { 22864 if ( acceptData( elem ) ) { 22865 if ( ( data = elem[ dataPriv.expando ] ) ) { 22866 if ( data.events ) { 22867 for ( type in data.events ) { 22868 if ( special[ type ] ) { 22869 jQuery.event.remove( elem, type ); 22870 22871 // This is a shortcut to avoid jQuery.event.remove's overhead 22872 } else { 22873 jQuery.removeEvent( elem, type, data.handle ); 22874 } 22875 } 22876 } 22877 22878 // Support: Chrome <=35 - 45+ 22879 // Assign undefined instead of using delete, see Data#remove 22880 elem[ dataPriv.expando ] = undefined; 22881 } 22882 if ( elem[ dataUser.expando ] ) { 22883 22884 // Support: Chrome <=35 - 45+ 22885 // Assign undefined instead of using delete, see Data#remove 22886 elem[ dataUser.expando ] = undefined; 22887 } 22888 } 22889 } 22890 } 22891} ); 22892 22893jQuery.fn.extend( { 22894 detach: function( selector ) { 22895 return remove( this, selector, true ); 22896 }, 22897 22898 remove: function( selector ) { 22899 return remove( this, selector ); 22900 }, 22901 22902 text: function( value ) { 22903 return access( this, function( value ) { 22904 return value === undefined ? 22905 jQuery.text( this ) : 22906 this.empty().each( function() { 22907 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 22908 this.textContent = value; 22909 } 22910 } ); 22911 }, null, value, arguments.length ); 22912 }, 22913 22914 append: function() { 22915 return domManip( this, arguments, function( elem ) { 22916 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 22917 var target = manipulationTarget( this, elem ); 22918 target.appendChild( elem ); 22919 } 22920 } ); 22921 }, 22922 22923 prepend: function() { 22924 return domManip( this, arguments, function( elem ) { 22925 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { 22926 var target = manipulationTarget( this, elem ); 22927 target.insertBefore( elem, target.firstChild ); 22928 } 22929 } ); 22930 }, 22931 22932 before: function() { 22933 return domManip( this, arguments, function( elem ) { 22934 if ( this.parentNode ) { 22935 this.parentNode.insertBefore( elem, this ); 22936 } 22937 } ); 22938 }, 22939 22940 after: function() { 22941 return domManip( this, arguments, function( elem ) { 22942 if ( this.parentNode ) { 22943 this.parentNode.insertBefore( elem, this.nextSibling ); 22944 } 22945 } ); 22946 }, 22947 22948 empty: function() { 22949 var elem, 22950 i = 0; 22951 22952 for ( ; ( elem = this[ i ] ) != null; i++ ) { 22953 if ( elem.nodeType === 1 ) { 22954 22955 // Prevent memory leaks 22956 jQuery.cleanData( getAll( elem, false ) ); 22957 22958 // Remove any remaining nodes 22959 elem.textContent = ""; 22960 } 22961 } 22962 22963 return this; 22964 }, 22965 22966 clone: function( dataAndEvents, deepDataAndEvents ) { 22967 dataAndEvents = dataAndEvents == null ? false : dataAndEvents; 22968 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; 22969 22970 return this.map( function() { 22971 return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); 22972 } ); 22973 }, 22974 22975 html: function( value ) { 22976 return access( this, function( value ) { 22977 var elem = this[ 0 ] || {}, 22978 i = 0, 22979 l = this.length; 22980 22981 if ( value === undefined && elem.nodeType === 1 ) { 22982 return elem.innerHTML; 22983 } 22984 22985 // See if we can take a shortcut and just use innerHTML 22986 if ( typeof value === "string" && !rnoInnerhtml.test( value ) && 22987 !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { 22988 22989 value = jQuery.htmlPrefilter( value ); 22990 22991 try { 22992 for ( ; i < l; i++ ) { 22993 elem = this[ i ] || {}; 22994 22995 // Remove element nodes and prevent memory leaks 22996 if ( elem.nodeType === 1 ) { 22997 jQuery.cleanData( getAll( elem, false ) ); 22998 elem.innerHTML = value; 22999 } 23000 } 23001 23002 elem = 0; 23003 23004 // If using innerHTML throws an exception, use the fallback method 23005 } catch ( e ) {} 23006 } 23007 23008 if ( elem ) { 23009 this.empty().append( value ); 23010 } 23011 }, null, value, arguments.length ); 23012 }, 23013 23014 replaceWith: function() { 23015 var ignored = []; 23016 23017 // Make the changes, replacing each non-ignored context element with the new content 23018 return domManip( this, arguments, function( elem ) { 23019 var parent = this.parentNode; 23020 23021 if ( jQuery.inArray( this, ignored ) < 0 ) { 23022 jQuery.cleanData( getAll( this ) ); 23023 if ( parent ) { 23024 parent.replaceChild( elem, this ); 23025 } 23026 } 23027 23028 // Force callback invocation 23029 }, ignored ); 23030 } 23031} ); 23032 23033jQuery.each( { 23034 appendTo: "append", 23035 prependTo: "prepend", 23036 insertBefore: "before", 23037 insertAfter: "after", 23038 replaceAll: "replaceWith" 23039}, function( name, original ) { 23040 jQuery.fn[ name ] = function( selector ) { 23041 var elems, 23042 ret = [], 23043 insert = jQuery( selector ), 23044 last = insert.length - 1, 23045 i = 0; 23046 23047 for ( ; i <= last; i++ ) { 23048 elems = i === last ? this : this.clone( true ); 23049 jQuery( insert[ i ] )[ original ]( elems ); 23050 23051 // Support: Android <=4.0 only, PhantomJS 1 only 23052 // .get() because push.apply(_, arraylike) throws on ancient WebKit 23053 push.apply( ret, elems.get() ); 23054 } 23055 23056 return this.pushStack( ret ); 23057 }; 23058} ); 23059var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); 23060 23061var getStyles = function( elem ) { 23062 23063 // Support: IE <=11 only, Firefox <=30 (#15098, #14150) 23064 // IE throws on elements created in popups 23065 // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" 23066 var view = elem.ownerDocument.defaultView; 23067 23068 if ( !view || !view.opener ) { 23069 view = window; 23070 } 23071 23072 return view.getComputedStyle( elem ); 23073 }; 23074 23075var swap = function( elem, options, callback ) { 23076 var ret, name, 23077 old = {}; 23078 23079 // Remember the old values, and insert the new ones 23080 for ( name in options ) { 23081 old[ name ] = elem.style[ name ]; 23082 elem.style[ name ] = options[ name ]; 23083 } 23084 23085 ret = callback.call( elem ); 23086 23087 // Revert the old values 23088 for ( name in options ) { 23089 elem.style[ name ] = old[ name ]; 23090 } 23091 23092 return ret; 23093}; 23094 23095 23096var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); 23097 23098 23099 23100( function() { 23101 23102 // Executing both pixelPosition & boxSizingReliable tests require only one layout 23103 // so they're executed at the same time to save the second computation. 23104 function computeStyleTests() { 23105 23106 // This is a singleton, we need to execute it only once 23107 if ( !div ) { 23108 return; 23109 } 23110 23111 container.style.cssText = "position:absolute;left:-11111px;width:60px;" + 23112 "margin-top:1px;padding:0;border:0"; 23113 div.style.cssText = 23114 "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + 23115 "margin:auto;border:1px;padding:1px;" + 23116 "width:60%;top:1%"; 23117 documentElement.appendChild( container ).appendChild( div ); 23118 23119 var divStyle = window.getComputedStyle( div ); 23120 pixelPositionVal = divStyle.top !== "1%"; 23121 23122 // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 23123 reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; 23124 23125 // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 23126 // Some styles come back with percentage values, even though they shouldn't 23127 div.style.right = "60%"; 23128 pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; 23129 23130 // Support: IE 9 - 11 only 23131 // Detect misreporting of content dimensions for box-sizing:border-box elements 23132 boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; 23133 23134 // Support: IE 9 only 23135 // Detect overflow:scroll screwiness (gh-3699) 23136 // Support: Chrome <=64 23137 // Don't get tricked when zoom affects offsetWidth (gh-4029) 23138 div.style.position = "absolute"; 23139 scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; 23140 23141 documentElement.removeChild( container ); 23142 23143 // Nullify the div so it wouldn't be stored in the memory and 23144 // it will also be a sign that checks already performed 23145 div = null; 23146 } 23147 23148 function roundPixelMeasures( measure ) { 23149 return Math.round( parseFloat( measure ) ); 23150 } 23151 23152 var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, 23153 reliableTrDimensionsVal, reliableMarginLeftVal, 23154 container = document.createElement( "div" ), 23155 div = document.createElement( "div" ); 23156 23157 // Finish early in limited (non-browser) environments 23158 if ( !div.style ) { 23159 return; 23160 } 23161 23162 // Support: IE <=9 - 11 only 23163 // Style of cloned element affects source element cloned (#8908) 23164 div.style.backgroundClip = "content-box"; 23165 div.cloneNode( true ).style.backgroundClip = ""; 23166 support.clearCloneStyle = div.style.backgroundClip === "content-box"; 23167 23168 jQuery.extend( support, { 23169 boxSizingReliable: function() { 23170 computeStyleTests(); 23171 return boxSizingReliableVal; 23172 }, 23173 pixelBoxStyles: function() { 23174 computeStyleTests(); 23175 return pixelBoxStylesVal; 23176 }, 23177 pixelPosition: function() { 23178 computeStyleTests(); 23179 return pixelPositionVal; 23180 }, 23181 reliableMarginLeft: function() { 23182 computeStyleTests(); 23183 return reliableMarginLeftVal; 23184 }, 23185 scrollboxSize: function() { 23186 computeStyleTests(); 23187 return scrollboxSizeVal; 23188 }, 23189 23190 // Support: IE 9 - 11+, Edge 15 - 18+ 23191 // IE/Edge misreport `getComputedStyle` of table rows with width/height 23192 // set in CSS while `offset*` properties report correct values. 23193 // Behavior in IE 9 is more subtle than in newer versions & it passes 23194 // some versions of this test; make sure not to make it pass there! 23195 // 23196 // Support: Firefox 70+ 23197 // Only Firefox includes border widths 23198 // in computed dimensions. (gh-4529) 23199 reliableTrDimensions: function() { 23200 var table, tr, trChild, trStyle; 23201 if ( reliableTrDimensionsVal == null ) { 23202 table = document.createElement( "table" ); 23203 tr = document.createElement( "tr" ); 23204 trChild = document.createElement( "div" ); 23205 23206 table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate"; 23207 tr.style.cssText = "border:1px solid"; 23208 23209 // Support: Chrome 86+ 23210 // Height set through cssText does not get applied. 23211 // Computed height then comes back as 0. 23212 tr.style.height = "1px"; 23213 trChild.style.height = "9px"; 23214 23215 // Support: Android 8 Chrome 86+ 23216 // In our bodyBackground.html iframe, 23217 // display for all div elements is set to "inline", 23218 // which causes a problem only in Android 8 Chrome 86. 23219 // Ensuring the div is display: block 23220 // gets around this issue. 23221 trChild.style.display = "block"; 23222 23223 documentElement 23224 .appendChild( table ) 23225 .appendChild( tr ) 23226 .appendChild( trChild ); 23227 23228 trStyle = window.getComputedStyle( tr ); 23229 reliableTrDimensionsVal = ( parseInt( trStyle.height, 10 ) + 23230 parseInt( trStyle.borderTopWidth, 10 ) + 23231 parseInt( trStyle.borderBottomWidth, 10 ) ) === tr.offsetHeight; 23232 23233 documentElement.removeChild( table ); 23234 } 23235 return reliableTrDimensionsVal; 23236 } 23237 } ); 23238} )(); 23239 23240 23241function curCSS( elem, name, computed ) { 23242 var width, minWidth, maxWidth, ret, 23243 23244 // Support: Firefox 51+ 23245 // Retrieving style before computed somehow 23246 // fixes an issue with getting wrong values 23247 // on detached elements 23248 style = elem.style; 23249 23250 computed = computed || getStyles( elem ); 23251 23252 // getPropertyValue is needed for: 23253 // .css('filter') (IE 9 only, #12537) 23254 // .css('--customProperty) (#3144) 23255 if ( computed ) { 23256 ret = computed.getPropertyValue( name ) || computed[ name ]; 23257 23258 if ( ret === "" && !isAttached( elem ) ) { 23259 ret = jQuery.style( elem, name ); 23260 } 23261 23262 // A tribute to the "awesome hack by Dean Edwards" 23263 // Android Browser returns percentage for some values, 23264 // but width seems to be reliably pixels. 23265 // This is against the CSSOM draft spec: 23266 // https://drafts.csswg.org/cssom/#resolved-values 23267 if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { 23268 23269 // Remember the original values 23270 width = style.width; 23271 minWidth = style.minWidth; 23272 maxWidth = style.maxWidth; 23273 23274 // Put in the new values to get a computed value out 23275 style.minWidth = style.maxWidth = style.width = ret; 23276 ret = computed.width; 23277 23278 // Revert the changed values 23279 style.width = width; 23280 style.minWidth = minWidth; 23281 style.maxWidth = maxWidth; 23282 } 23283 } 23284 23285 return ret !== undefined ? 23286 23287 // Support: IE <=9 - 11 only 23288 // IE returns zIndex value as an integer. 23289 ret + "" : 23290 ret; 23291} 23292 23293 23294function addGetHookIf( conditionFn, hookFn ) { 23295 23296 // Define the hook, we'll check on the first run if it's really needed. 23297 return { 23298 get: function() { 23299 if ( conditionFn() ) { 23300 23301 // Hook not needed (or it's not possible to use it due 23302 // to missing dependency), remove it. 23303 delete this.get; 23304 return; 23305 } 23306 23307 // Hook needed; redefine it so that the support test is not executed again. 23308 return ( this.get = hookFn ).apply( this, arguments ); 23309 } 23310 }; 23311} 23312 23313 23314var cssPrefixes = [ "Webkit", "Moz", "ms" ], 23315 emptyStyle = document.createElement( "div" ).style, 23316 vendorProps = {}; 23317 23318// Return a vendor-prefixed property or undefined 23319function vendorPropName( name ) { 23320 23321 // Check for vendor prefixed names 23322 var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), 23323 i = cssPrefixes.length; 23324 23325 while ( i-- ) { 23326 name = cssPrefixes[ i ] + capName; 23327 if ( name in emptyStyle ) { 23328 return name; 23329 } 23330 } 23331} 23332 23333// Return a potentially-mapped jQuery.cssProps or vendor prefixed property 23334function finalPropName( name ) { 23335 var final = jQuery.cssProps[ name ] || vendorProps[ name ]; 23336 23337 if ( final ) { 23338 return final; 23339 } 23340 if ( name in emptyStyle ) { 23341 return name; 23342 } 23343 return vendorProps[ name ] = vendorPropName( name ) || name; 23344} 23345 23346 23347var 23348 23349 // Swappable if display is none or starts with table 23350 // except "table", "table-cell", or "table-caption" 23351 // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display 23352 rdisplayswap = /^(none|table(?!-c[ea]).+)/, 23353 rcustomProp = /^--/, 23354 cssShow = { position: "absolute", visibility: "hidden", display: "block" }, 23355 cssNormalTransform = { 23356 letterSpacing: "0", 23357 fontWeight: "400" 23358 }; 23359 23360function setPositiveNumber( _elem, value, subtract ) { 23361 23362 // Any relative (+/-) values have already been 23363 // normalized at this point 23364 var matches = rcssNum.exec( value ); 23365 return matches ? 23366 23367 // Guard against undefined "subtract", e.g., when used as in cssHooks 23368 Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : 23369 value; 23370} 23371 23372function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { 23373 var i = dimension === "width" ? 1 : 0, 23374 extra = 0, 23375 delta = 0; 23376 23377 // Adjustment may not be necessary 23378 if ( box === ( isBorderBox ? "border" : "content" ) ) { 23379 return 0; 23380 } 23381 23382 for ( ; i < 4; i += 2 ) { 23383 23384 // Both box models exclude margin 23385 if ( box === "margin" ) { 23386 delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); 23387 } 23388 23389 // If we get here with a content-box, we're seeking "padding" or "border" or "margin" 23390 if ( !isBorderBox ) { 23391 23392 // Add padding 23393 delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 23394 23395 // For "border" or "margin", add border 23396 if ( box !== "padding" ) { 23397 delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 23398 23399 // But still keep track of it otherwise 23400 } else { 23401 extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 23402 } 23403 23404 // If we get here with a border-box (content + padding + border), we're seeking "content" or 23405 // "padding" or "margin" 23406 } else { 23407 23408 // For "content", subtract padding 23409 if ( box === "content" ) { 23410 delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); 23411 } 23412 23413 // For "content" or "padding", subtract border 23414 if ( box !== "margin" ) { 23415 delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); 23416 } 23417 } 23418 } 23419 23420 // Account for positive content-box scroll gutter when requested by providing computedVal 23421 if ( !isBorderBox && computedVal >= 0 ) { 23422 23423 // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border 23424 // Assuming integer scroll gutter, subtract the rest and round down 23425 delta += Math.max( 0, Math.ceil( 23426 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 23427 computedVal - 23428 delta - 23429 extra - 23430 0.5 23431 23432 // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter 23433 // Use an explicit zero to avoid NaN (gh-3964) 23434 ) ) || 0; 23435 } 23436 23437 return delta; 23438} 23439 23440function getWidthOrHeight( elem, dimension, extra ) { 23441 23442 // Start with computed style 23443 var styles = getStyles( elem ), 23444 23445 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). 23446 // Fake content-box until we know it's needed to know the true value. 23447 boxSizingNeeded = !support.boxSizingReliable() || extra, 23448 isBorderBox = boxSizingNeeded && 23449 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 23450 valueIsBorderBox = isBorderBox, 23451 23452 val = curCSS( elem, dimension, styles ), 23453 offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); 23454 23455 // Support: Firefox <=54 23456 // Return a confounding non-pixel value or feign ignorance, as appropriate. 23457 if ( rnumnonpx.test( val ) ) { 23458 if ( !extra ) { 23459 return val; 23460 } 23461 val = "auto"; 23462 } 23463 23464 23465 // Support: IE 9 - 11 only 23466 // Use offsetWidth/offsetHeight for when box sizing is unreliable. 23467 // In those cases, the computed value can be trusted to be border-box. 23468 if ( ( !support.boxSizingReliable() && isBorderBox || 23469 23470 // Support: IE 10 - 11+, Edge 15 - 18+ 23471 // IE/Edge misreport `getComputedStyle` of table rows with width/height 23472 // set in CSS while `offset*` properties report correct values. 23473 // Interestingly, in some cases IE 9 doesn't suffer from this issue. 23474 !support.reliableTrDimensions() && nodeName( elem, "tr" ) || 23475 23476 // Fall back to offsetWidth/offsetHeight when value is "auto" 23477 // This happens for inline elements with no explicit setting (gh-3571) 23478 val === "auto" || 23479 23480 // Support: Android <=4.1 - 4.3 only 23481 // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) 23482 !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && 23483 23484 // Make sure the element is visible & connected 23485 elem.getClientRects().length ) { 23486 23487 isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; 23488 23489 // Where available, offsetWidth/offsetHeight approximate border box dimensions. 23490 // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the 23491 // retrieved value as a content box dimension. 23492 valueIsBorderBox = offsetProp in elem; 23493 if ( valueIsBorderBox ) { 23494 val = elem[ offsetProp ]; 23495 } 23496 } 23497 23498 // Normalize "" and auto 23499 val = parseFloat( val ) || 0; 23500 23501 // Adjust for the element's box model 23502 return ( val + 23503 boxModelAdjustment( 23504 elem, 23505 dimension, 23506 extra || ( isBorderBox ? "border" : "content" ), 23507 valueIsBorderBox, 23508 styles, 23509 23510 // Provide the current computed size to request scroll gutter calculation (gh-3589) 23511 val 23512 ) 23513 ) + "px"; 23514} 23515 23516jQuery.extend( { 23517 23518 // Add in style property hooks for overriding the default 23519 // behavior of getting and setting a style property 23520 cssHooks: { 23521 opacity: { 23522 get: function( elem, computed ) { 23523 if ( computed ) { 23524 23525 // We should always get a number back from opacity 23526 var ret = curCSS( elem, "opacity" ); 23527 return ret === "" ? "1" : ret; 23528 } 23529 } 23530 } 23531 }, 23532 23533 // Don't automatically add "px" to these possibly-unitless properties 23534 cssNumber: { 23535 "animationIterationCount": true, 23536 "columnCount": true, 23537 "fillOpacity": true, 23538 "flexGrow": true, 23539 "flexShrink": true, 23540 "fontWeight": true, 23541 "gridArea": true, 23542 "gridColumn": true, 23543 "gridColumnEnd": true, 23544 "gridColumnStart": true, 23545 "gridRow": true, 23546 "gridRowEnd": true, 23547 "gridRowStart": true, 23548 "lineHeight": true, 23549 "opacity": true, 23550 "order": true, 23551 "orphans": true, 23552 "widows": true, 23553 "zIndex": true, 23554 "zoom": true 23555 }, 23556 23557 // Add in properties whose names you wish to fix before 23558 // setting or getting the value 23559 cssProps: {}, 23560 23561 // Get and set the style property on a DOM Node 23562 style: function( elem, name, value, extra ) { 23563 23564 // Don't set styles on text and comment nodes 23565 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { 23566 return; 23567 } 23568 23569 // Make sure that we're working with the right name 23570 var ret, type, hooks, 23571 origName = camelCase( name ), 23572 isCustomProp = rcustomProp.test( name ), 23573 style = elem.style; 23574 23575 // Make sure that we're working with the right name. We don't 23576 // want to query the value if it is a CSS custom property 23577 // since they are user-defined. 23578 if ( !isCustomProp ) { 23579 name = finalPropName( origName ); 23580 } 23581 23582 // Gets hook for the prefixed version, then unprefixed version 23583 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 23584 23585 // Check if we're setting a value 23586 if ( value !== undefined ) { 23587 type = typeof value; 23588 23589 // Convert "+=" or "-=" to relative numbers (#7345) 23590 if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { 23591 value = adjustCSS( elem, name, ret ); 23592 23593 // Fixes bug #9237 23594 type = "number"; 23595 } 23596 23597 // Make sure that null and NaN values aren't set (#7116) 23598 if ( value == null || value !== value ) { 23599 return; 23600 } 23601 23602 // If a number was passed in, add the unit (except for certain CSS properties) 23603 // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append 23604 // "px" to a few hardcoded values. 23605 if ( type === "number" && !isCustomProp ) { 23606 value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); 23607 } 23608 23609 // background-* props affect original clone's values 23610 if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { 23611 style[ name ] = "inherit"; 23612 } 23613 23614 // If a hook was provided, use that value, otherwise just set the specified value 23615 if ( !hooks || !( "set" in hooks ) || 23616 ( value = hooks.set( elem, value, extra ) ) !== undefined ) { 23617 23618 if ( isCustomProp ) { 23619 style.setProperty( name, value ); 23620 } else { 23621 style[ name ] = value; 23622 } 23623 } 23624 23625 } else { 23626 23627 // If a hook was provided get the non-computed value from there 23628 if ( hooks && "get" in hooks && 23629 ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { 23630 23631 return ret; 23632 } 23633 23634 // Otherwise just get the value from the style object 23635 return style[ name ]; 23636 } 23637 }, 23638 23639 css: function( elem, name, extra, styles ) { 23640 var val, num, hooks, 23641 origName = camelCase( name ), 23642 isCustomProp = rcustomProp.test( name ); 23643 23644 // Make sure that we're working with the right name. We don't 23645 // want to modify the value if it is a CSS custom property 23646 // since they are user-defined. 23647 if ( !isCustomProp ) { 23648 name = finalPropName( origName ); 23649 } 23650 23651 // Try prefixed name followed by the unprefixed name 23652 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; 23653 23654 // If a hook was provided get the computed value from there 23655 if ( hooks && "get" in hooks ) { 23656 val = hooks.get( elem, true, extra ); 23657 } 23658 23659 // Otherwise, if a way to get the computed value exists, use that 23660 if ( val === undefined ) { 23661 val = curCSS( elem, name, styles ); 23662 } 23663 23664 // Convert "normal" to computed value 23665 if ( val === "normal" && name in cssNormalTransform ) { 23666 val = cssNormalTransform[ name ]; 23667 } 23668 23669 // Make numeric if forced or a qualifier was provided and val looks numeric 23670 if ( extra === "" || extra ) { 23671 num = parseFloat( val ); 23672 return extra === true || isFinite( num ) ? num || 0 : val; 23673 } 23674 23675 return val; 23676 } 23677} ); 23678 23679jQuery.each( [ "height", "width" ], function( _i, dimension ) { 23680 jQuery.cssHooks[ dimension ] = { 23681 get: function( elem, computed, extra ) { 23682 if ( computed ) { 23683 23684 // Certain elements can have dimension info if we invisibly show them 23685 // but it must have a current display style that would benefit 23686 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && 23687 23688 // Support: Safari 8+ 23689 // Table columns in Safari have non-zero offsetWidth & zero 23690 // getBoundingClientRect().width unless display is changed. 23691 // Support: IE <=11 only 23692 // Running getBoundingClientRect on a disconnected node 23693 // in IE throws an error. 23694 ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? 23695 swap( elem, cssShow, function() { 23696 return getWidthOrHeight( elem, dimension, extra ); 23697 } ) : 23698 getWidthOrHeight( elem, dimension, extra ); 23699 } 23700 }, 23701 23702 set: function( elem, value, extra ) { 23703 var matches, 23704 styles = getStyles( elem ), 23705 23706 // Only read styles.position if the test has a chance to fail 23707 // to avoid forcing a reflow. 23708 scrollboxSizeBuggy = !support.scrollboxSize() && 23709 styles.position === "absolute", 23710 23711 // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) 23712 boxSizingNeeded = scrollboxSizeBuggy || extra, 23713 isBorderBox = boxSizingNeeded && 23714 jQuery.css( elem, "boxSizing", false, styles ) === "border-box", 23715 subtract = extra ? 23716 boxModelAdjustment( 23717 elem, 23718 dimension, 23719 extra, 23720 isBorderBox, 23721 styles 23722 ) : 23723 0; 23724 23725 // Account for unreliable border-box dimensions by comparing offset* to computed and 23726 // faking a content-box to get border and padding (gh-3699) 23727 if ( isBorderBox && scrollboxSizeBuggy ) { 23728 subtract -= Math.ceil( 23729 elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - 23730 parseFloat( styles[ dimension ] ) - 23731 boxModelAdjustment( elem, dimension, "border", false, styles ) - 23732 0.5 23733 ); 23734 } 23735 23736 // Convert to pixels if value adjustment is needed 23737 if ( subtract && ( matches = rcssNum.exec( value ) ) && 23738 ( matches[ 3 ] || "px" ) !== "px" ) { 23739 23740 elem.style[ dimension ] = value; 23741 value = jQuery.css( elem, dimension ); 23742 } 23743 23744 return setPositiveNumber( elem, value, subtract ); 23745 } 23746 }; 23747} ); 23748 23749jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, 23750 function( elem, computed ) { 23751 if ( computed ) { 23752 return ( parseFloat( curCSS( elem, "marginLeft" ) ) || 23753 elem.getBoundingClientRect().left - 23754 swap( elem, { marginLeft: 0 }, function() { 23755 return elem.getBoundingClientRect().left; 23756 } ) 23757 ) + "px"; 23758 } 23759 } 23760); 23761 23762// These hooks are used by animate to expand properties 23763jQuery.each( { 23764 margin: "", 23765 padding: "", 23766 border: "Width" 23767}, function( prefix, suffix ) { 23768 jQuery.cssHooks[ prefix + suffix ] = { 23769 expand: function( value ) { 23770 var i = 0, 23771 expanded = {}, 23772 23773 // Assumes a single number if not a string 23774 parts = typeof value === "string" ? value.split( " " ) : [ value ]; 23775 23776 for ( ; i < 4; i++ ) { 23777 expanded[ prefix + cssExpand[ i ] + suffix ] = 23778 parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; 23779 } 23780 23781 return expanded; 23782 } 23783 }; 23784 23785 if ( prefix !== "margin" ) { 23786 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; 23787 } 23788} ); 23789 23790jQuery.fn.extend( { 23791 css: function( name, value ) { 23792 return access( this, function( elem, name, value ) { 23793 var styles, len, 23794 map = {}, 23795 i = 0; 23796 23797 if ( Array.isArray( name ) ) { 23798 styles = getStyles( elem ); 23799 len = name.length; 23800 23801 for ( ; i < len; i++ ) { 23802 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); 23803 } 23804 23805 return map; 23806 } 23807 23808 return value !== undefined ? 23809 jQuery.style( elem, name, value ) : 23810 jQuery.css( elem, name ); 23811 }, name, value, arguments.length > 1 ); 23812 } 23813} ); 23814 23815 23816function Tween( elem, options, prop, end, easing ) { 23817 return new Tween.prototype.init( elem, options, prop, end, easing ); 23818} 23819jQuery.Tween = Tween; 23820 23821Tween.prototype = { 23822 constructor: Tween, 23823 init: function( elem, options, prop, end, easing, unit ) { 23824 this.elem = elem; 23825 this.prop = prop; 23826 this.easing = easing || jQuery.easing._default; 23827 this.options = options; 23828 this.start = this.now = this.cur(); 23829 this.end = end; 23830 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); 23831 }, 23832 cur: function() { 23833 var hooks = Tween.propHooks[ this.prop ]; 23834 23835 return hooks && hooks.get ? 23836 hooks.get( this ) : 23837 Tween.propHooks._default.get( this ); 23838 }, 23839 run: function( percent ) { 23840 var eased, 23841 hooks = Tween.propHooks[ this.prop ]; 23842 23843 if ( this.options.duration ) { 23844 this.pos = eased = jQuery.easing[ this.easing ]( 23845 percent, this.options.duration * percent, 0, 1, this.options.duration 23846 ); 23847 } else { 23848 this.pos = eased = percent; 23849 } 23850 this.now = ( this.end - this.start ) * eased + this.start; 23851 23852 if ( this.options.step ) { 23853 this.options.step.call( this.elem, this.now, this ); 23854 } 23855 23856 if ( hooks && hooks.set ) { 23857 hooks.set( this ); 23858 } else { 23859 Tween.propHooks._default.set( this ); 23860 } 23861 return this; 23862 } 23863}; 23864 23865Tween.prototype.init.prototype = Tween.prototype; 23866 23867Tween.propHooks = { 23868 _default: { 23869 get: function( tween ) { 23870 var result; 23871 23872 // Use a property on the element directly when it is not a DOM element, 23873 // or when there is no matching style property that exists. 23874 if ( tween.elem.nodeType !== 1 || 23875 tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { 23876 return tween.elem[ tween.prop ]; 23877 } 23878 23879 // Passing an empty string as a 3rd parameter to .css will automatically 23880 // attempt a parseFloat and fallback to a string if the parse fails. 23881 // Simple values such as "10px" are parsed to Float; 23882 // complex values such as "rotate(1rad)" are returned as-is. 23883 result = jQuery.css( tween.elem, tween.prop, "" ); 23884 23885 // Empty strings, null, undefined and "auto" are converted to 0. 23886 return !result || result === "auto" ? 0 : result; 23887 }, 23888 set: function( tween ) { 23889 23890 // Use step hook for back compat. 23891 // Use cssHook if its there. 23892 // Use .style if available and use plain properties where available. 23893 if ( jQuery.fx.step[ tween.prop ] ) { 23894 jQuery.fx.step[ tween.prop ]( tween ); 23895 } else if ( tween.elem.nodeType === 1 && ( 23896 jQuery.cssHooks[ tween.prop ] || 23897 tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { 23898 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); 23899 } else { 23900 tween.elem[ tween.prop ] = tween.now; 23901 } 23902 } 23903 } 23904}; 23905 23906// Support: IE <=9 only 23907// Panic based approach to setting things on disconnected nodes 23908Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { 23909 set: function( tween ) { 23910 if ( tween.elem.nodeType && tween.elem.parentNode ) { 23911 tween.elem[ tween.prop ] = tween.now; 23912 } 23913 } 23914}; 23915 23916jQuery.easing = { 23917 linear: function( p ) { 23918 return p; 23919 }, 23920 swing: function( p ) { 23921 return 0.5 - Math.cos( p * Math.PI ) / 2; 23922 }, 23923 _default: "swing" 23924}; 23925 23926jQuery.fx = Tween.prototype.init; 23927 23928// Back compat <1.8 extension point 23929jQuery.fx.step = {}; 23930 23931 23932 23933 23934var 23935 fxNow, inProgress, 23936 rfxtypes = /^(?:toggle|show|hide)$/, 23937 rrun = /queueHooks$/; 23938 23939function schedule() { 23940 if ( inProgress ) { 23941 if ( document.hidden === false && window.requestAnimationFrame ) { 23942 window.requestAnimationFrame( schedule ); 23943 } else { 23944 window.setTimeout( schedule, jQuery.fx.interval ); 23945 } 23946 23947 jQuery.fx.tick(); 23948 } 23949} 23950 23951// Animations created synchronously will run synchronously 23952function createFxNow() { 23953 window.setTimeout( function() { 23954 fxNow = undefined; 23955 } ); 23956 return ( fxNow = Date.now() ); 23957} 23958 23959// Generate parameters to create a standard animation 23960function genFx( type, includeWidth ) { 23961 var which, 23962 i = 0, 23963 attrs = { height: type }; 23964 23965 // If we include width, step value is 1 to do all cssExpand values, 23966 // otherwise step value is 2 to skip over Left and Right 23967 includeWidth = includeWidth ? 1 : 0; 23968 for ( ; i < 4; i += 2 - includeWidth ) { 23969 which = cssExpand[ i ]; 23970 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; 23971 } 23972 23973 if ( includeWidth ) { 23974 attrs.opacity = attrs.width = type; 23975 } 23976 23977 return attrs; 23978} 23979 23980function createTween( value, prop, animation ) { 23981 var tween, 23982 collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), 23983 index = 0, 23984 length = collection.length; 23985 for ( ; index < length; index++ ) { 23986 if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { 23987 23988 // We're done with this property 23989 return tween; 23990 } 23991 } 23992} 23993 23994function defaultPrefilter( elem, props, opts ) { 23995 var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, 23996 isBox = "width" in props || "height" in props, 23997 anim = this, 23998 orig = {}, 23999 style = elem.style, 24000 hidden = elem.nodeType && isHiddenWithinTree( elem ), 24001 dataShow = dataPriv.get( elem, "fxshow" ); 24002 24003 // Queue-skipping animations hijack the fx hooks 24004 if ( !opts.queue ) { 24005 hooks = jQuery._queueHooks( elem, "fx" ); 24006 if ( hooks.unqueued == null ) { 24007 hooks.unqueued = 0; 24008 oldfire = hooks.empty.fire; 24009 hooks.empty.fire = function() { 24010 if ( !hooks.unqueued ) { 24011 oldfire(); 24012 } 24013 }; 24014 } 24015 hooks.unqueued++; 24016 24017 anim.always( function() { 24018 24019 // Ensure the complete handler is called before this completes 24020 anim.always( function() { 24021 hooks.unqueued--; 24022 if ( !jQuery.queue( elem, "fx" ).length ) { 24023 hooks.empty.fire(); 24024 } 24025 } ); 24026 } ); 24027 } 24028 24029 // Detect show/hide animations 24030 for ( prop in props ) { 24031 value = props[ prop ]; 24032 if ( rfxtypes.test( value ) ) { 24033 delete props[ prop ]; 24034 toggle = toggle || value === "toggle"; 24035 if ( value === ( hidden ? "hide" : "show" ) ) { 24036 24037 // Pretend to be hidden if this is a "show" and 24038 // there is still data from a stopped show/hide 24039 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { 24040 hidden = true; 24041 24042 // Ignore all other no-op show/hide data 24043 } else { 24044 continue; 24045 } 24046 } 24047 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); 24048 } 24049 } 24050 24051 // Bail out if this is a no-op like .hide().hide() 24052 propTween = !jQuery.isEmptyObject( props ); 24053 if ( !propTween && jQuery.isEmptyObject( orig ) ) { 24054 return; 24055 } 24056 24057 // Restrict "overflow" and "display" styles during box animations 24058 if ( isBox && elem.nodeType === 1 ) { 24059 24060 // Support: IE <=9 - 11, Edge 12 - 15 24061 // Record all 3 overflow attributes because IE does not infer the shorthand 24062 // from identically-valued overflowX and overflowY and Edge just mirrors 24063 // the overflowX value there. 24064 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; 24065 24066 // Identify a display type, preferring old show/hide data over the CSS cascade 24067 restoreDisplay = dataShow && dataShow.display; 24068 if ( restoreDisplay == null ) { 24069 restoreDisplay = dataPriv.get( elem, "display" ); 24070 } 24071 display = jQuery.css( elem, "display" ); 24072 if ( display === "none" ) { 24073 if ( restoreDisplay ) { 24074 display = restoreDisplay; 24075 } else { 24076 24077 // Get nonempty value(s) by temporarily forcing visibility 24078 showHide( [ elem ], true ); 24079 restoreDisplay = elem.style.display || restoreDisplay; 24080 display = jQuery.css( elem, "display" ); 24081 showHide( [ elem ] ); 24082 } 24083 } 24084 24085 // Animate inline elements as inline-block 24086 if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { 24087 if ( jQuery.css( elem, "float" ) === "none" ) { 24088 24089 // Restore the original display value at the end of pure show/hide animations 24090 if ( !propTween ) { 24091 anim.done( function() { 24092 style.display = restoreDisplay; 24093 } ); 24094 if ( restoreDisplay == null ) { 24095 display = style.display; 24096 restoreDisplay = display === "none" ? "" : display; 24097 } 24098 } 24099 style.display = "inline-block"; 24100 } 24101 } 24102 } 24103 24104 if ( opts.overflow ) { 24105 style.overflow = "hidden"; 24106 anim.always( function() { 24107 style.overflow = opts.overflow[ 0 ]; 24108 style.overflowX = opts.overflow[ 1 ]; 24109 style.overflowY = opts.overflow[ 2 ]; 24110 } ); 24111 } 24112 24113 // Implement show/hide animations 24114 propTween = false; 24115 for ( prop in orig ) { 24116 24117 // General show/hide setup for this element animation 24118 if ( !propTween ) { 24119 if ( dataShow ) { 24120 if ( "hidden" in dataShow ) { 24121 hidden = dataShow.hidden; 24122 } 24123 } else { 24124 dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); 24125 } 24126 24127 // Store hidden/visible for toggle so `.stop().toggle()` "reverses" 24128 if ( toggle ) { 24129 dataShow.hidden = !hidden; 24130 } 24131 24132 // Show elements before animating them 24133 if ( hidden ) { 24134 showHide( [ elem ], true ); 24135 } 24136 24137 /* eslint-disable no-loop-func */ 24138 24139 anim.done( function() { 24140 24141 /* eslint-enable no-loop-func */ 24142 24143 // The final step of a "hide" animation is actually hiding the element 24144 if ( !hidden ) { 24145 showHide( [ elem ] ); 24146 } 24147 dataPriv.remove( elem, "fxshow" ); 24148 for ( prop in orig ) { 24149 jQuery.style( elem, prop, orig[ prop ] ); 24150 } 24151 } ); 24152 } 24153 24154 // Per-property setup 24155 propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); 24156 if ( !( prop in dataShow ) ) { 24157 dataShow[ prop ] = propTween.start; 24158 if ( hidden ) { 24159 propTween.end = propTween.start; 24160 propTween.start = 0; 24161 } 24162 } 24163 } 24164} 24165 24166function propFilter( props, specialEasing ) { 24167 var index, name, easing, value, hooks; 24168 24169 // camelCase, specialEasing and expand cssHook pass 24170 for ( index in props ) { 24171 name = camelCase( index ); 24172 easing = specialEasing[ name ]; 24173 value = props[ index ]; 24174 if ( Array.isArray( value ) ) { 24175 easing = value[ 1 ]; 24176 value = props[ index ] = value[ 0 ]; 24177 } 24178 24179 if ( index !== name ) { 24180 props[ name ] = value; 24181 delete props[ index ]; 24182 } 24183 24184 hooks = jQuery.cssHooks[ name ]; 24185 if ( hooks && "expand" in hooks ) { 24186 value = hooks.expand( value ); 24187 delete props[ name ]; 24188 24189 // Not quite $.extend, this won't overwrite existing keys. 24190 // Reusing 'index' because we have the correct "name" 24191 for ( index in value ) { 24192 if ( !( index in props ) ) { 24193 props[ index ] = value[ index ]; 24194 specialEasing[ index ] = easing; 24195 } 24196 } 24197 } else { 24198 specialEasing[ name ] = easing; 24199 } 24200 } 24201} 24202 24203function Animation( elem, properties, options ) { 24204 var result, 24205 stopped, 24206 index = 0, 24207 length = Animation.prefilters.length, 24208 deferred = jQuery.Deferred().always( function() { 24209 24210 // Don't match elem in the :animated selector 24211 delete tick.elem; 24212 } ), 24213 tick = function() { 24214 if ( stopped ) { 24215 return false; 24216 } 24217 var currentTime = fxNow || createFxNow(), 24218 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), 24219 24220 // Support: Android 2.3 only 24221 // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) 24222 temp = remaining / animation.duration || 0, 24223 percent = 1 - temp, 24224 index = 0, 24225 length = animation.tweens.length; 24226 24227 for ( ; index < length; index++ ) { 24228 animation.tweens[ index ].run( percent ); 24229 } 24230 24231 deferred.notifyWith( elem, [ animation, percent, remaining ] ); 24232 24233 // If there's more to do, yield 24234 if ( percent < 1 && length ) { 24235 return remaining; 24236 } 24237 24238 // If this was an empty animation, synthesize a final progress notification 24239 if ( !length ) { 24240 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 24241 } 24242 24243 // Resolve the animation and report its conclusion 24244 deferred.resolveWith( elem, [ animation ] ); 24245 return false; 24246 }, 24247 animation = deferred.promise( { 24248 elem: elem, 24249 props: jQuery.extend( {}, properties ), 24250 opts: jQuery.extend( true, { 24251 specialEasing: {}, 24252 easing: jQuery.easing._default 24253 }, options ), 24254 originalProperties: properties, 24255 originalOptions: options, 24256 startTime: fxNow || createFxNow(), 24257 duration: options.duration, 24258 tweens: [], 24259 createTween: function( prop, end ) { 24260 var tween = jQuery.Tween( elem, animation.opts, prop, end, 24261 animation.opts.specialEasing[ prop ] || animation.opts.easing ); 24262 animation.tweens.push( tween ); 24263 return tween; 24264 }, 24265 stop: function( gotoEnd ) { 24266 var index = 0, 24267 24268 // If we are going to the end, we want to run all the tweens 24269 // otherwise we skip this part 24270 length = gotoEnd ? animation.tweens.length : 0; 24271 if ( stopped ) { 24272 return this; 24273 } 24274 stopped = true; 24275 for ( ; index < length; index++ ) { 24276 animation.tweens[ index ].run( 1 ); 24277 } 24278 24279 // Resolve when we played the last frame; otherwise, reject 24280 if ( gotoEnd ) { 24281 deferred.notifyWith( elem, [ animation, 1, 0 ] ); 24282 deferred.resolveWith( elem, [ animation, gotoEnd ] ); 24283 } else { 24284 deferred.rejectWith( elem, [ animation, gotoEnd ] ); 24285 } 24286 return this; 24287 } 24288 } ), 24289 props = animation.props; 24290 24291 propFilter( props, animation.opts.specialEasing ); 24292 24293 for ( ; index < length; index++ ) { 24294 result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); 24295 if ( result ) { 24296 if ( isFunction( result.stop ) ) { 24297 jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = 24298 result.stop.bind( result ); 24299 } 24300 return result; 24301 } 24302 } 24303 24304 jQuery.map( props, createTween, animation ); 24305 24306 if ( isFunction( animation.opts.start ) ) { 24307 animation.opts.start.call( elem, animation ); 24308 } 24309 24310 // Attach callbacks from options 24311 animation 24312 .progress( animation.opts.progress ) 24313 .done( animation.opts.done, animation.opts.complete ) 24314 .fail( animation.opts.fail ) 24315 .always( animation.opts.always ); 24316 24317 jQuery.fx.timer( 24318 jQuery.extend( tick, { 24319 elem: elem, 24320 anim: animation, 24321 queue: animation.opts.queue 24322 } ) 24323 ); 24324 24325 return animation; 24326} 24327 24328jQuery.Animation = jQuery.extend( Animation, { 24329 24330 tweeners: { 24331 "*": [ function( prop, value ) { 24332 var tween = this.createTween( prop, value ); 24333 adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); 24334 return tween; 24335 } ] 24336 }, 24337 24338 tweener: function( props, callback ) { 24339 if ( isFunction( props ) ) { 24340 callback = props; 24341 props = [ "*" ]; 24342 } else { 24343 props = props.match( rnothtmlwhite ); 24344 } 24345 24346 var prop, 24347 index = 0, 24348 length = props.length; 24349 24350 for ( ; index < length; index++ ) { 24351 prop = props[ index ]; 24352 Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; 24353 Animation.tweeners[ prop ].unshift( callback ); 24354 } 24355 }, 24356 24357 prefilters: [ defaultPrefilter ], 24358 24359 prefilter: function( callback, prepend ) { 24360 if ( prepend ) { 24361 Animation.prefilters.unshift( callback ); 24362 } else { 24363 Animation.prefilters.push( callback ); 24364 } 24365 } 24366} ); 24367 24368jQuery.speed = function( speed, easing, fn ) { 24369 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { 24370 complete: fn || !fn && easing || 24371 isFunction( speed ) && speed, 24372 duration: speed, 24373 easing: fn && easing || easing && !isFunction( easing ) && easing 24374 }; 24375 24376 // Go to the end state if fx are off 24377 if ( jQuery.fx.off ) { 24378 opt.duration = 0; 24379 24380 } else { 24381 if ( typeof opt.duration !== "number" ) { 24382 if ( opt.duration in jQuery.fx.speeds ) { 24383 opt.duration = jQuery.fx.speeds[ opt.duration ]; 24384 24385 } else { 24386 opt.duration = jQuery.fx.speeds._default; 24387 } 24388 } 24389 } 24390 24391 // Normalize opt.queue - true/undefined/null -> "fx" 24392 if ( opt.queue == null || opt.queue === true ) { 24393 opt.queue = "fx"; 24394 } 24395 24396 // Queueing 24397 opt.old = opt.complete; 24398 24399 opt.complete = function() { 24400 if ( isFunction( opt.old ) ) { 24401 opt.old.call( this ); 24402 } 24403 24404 if ( opt.queue ) { 24405 jQuery.dequeue( this, opt.queue ); 24406 } 24407 }; 24408 24409 return opt; 24410}; 24411 24412jQuery.fn.extend( { 24413 fadeTo: function( speed, to, easing, callback ) { 24414 24415 // Show any hidden elements after setting opacity to 0 24416 return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() 24417 24418 // Animate to the value specified 24419 .end().animate( { opacity: to }, speed, easing, callback ); 24420 }, 24421 animate: function( prop, speed, easing, callback ) { 24422 var empty = jQuery.isEmptyObject( prop ), 24423 optall = jQuery.speed( speed, easing, callback ), 24424 doAnimation = function() { 24425 24426 // Operate on a copy of prop so per-property easing won't be lost 24427 var anim = Animation( this, jQuery.extend( {}, prop ), optall ); 24428 24429 // Empty animations, or finishing resolves immediately 24430 if ( empty || dataPriv.get( this, "finish" ) ) { 24431 anim.stop( true ); 24432 } 24433 }; 24434 24435 doAnimation.finish = doAnimation; 24436 24437 return empty || optall.queue === false ? 24438 this.each( doAnimation ) : 24439 this.queue( optall.queue, doAnimation ); 24440 }, 24441 stop: function( type, clearQueue, gotoEnd ) { 24442 var stopQueue = function( hooks ) { 24443 var stop = hooks.stop; 24444 delete hooks.stop; 24445 stop( gotoEnd ); 24446 }; 24447 24448 if ( typeof type !== "string" ) { 24449 gotoEnd = clearQueue; 24450 clearQueue = type; 24451 type = undefined; 24452 } 24453 if ( clearQueue ) { 24454 this.queue( type || "fx", [] ); 24455 } 24456 24457 return this.each( function() { 24458 var dequeue = true, 24459 index = type != null && type + "queueHooks", 24460 timers = jQuery.timers, 24461 data = dataPriv.get( this ); 24462 24463 if ( index ) { 24464 if ( data[ index ] && data[ index ].stop ) { 24465 stopQueue( data[ index ] ); 24466 } 24467 } else { 24468 for ( index in data ) { 24469 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { 24470 stopQueue( data[ index ] ); 24471 } 24472 } 24473 } 24474 24475 for ( index = timers.length; index--; ) { 24476 if ( timers[ index ].elem === this && 24477 ( type == null || timers[ index ].queue === type ) ) { 24478 24479 timers[ index ].anim.stop( gotoEnd ); 24480 dequeue = false; 24481 timers.splice( index, 1 ); 24482 } 24483 } 24484 24485 // Start the next in the queue if the last step wasn't forced. 24486 // Timers currently will call their complete callbacks, which 24487 // will dequeue but only if they were gotoEnd. 24488 if ( dequeue || !gotoEnd ) { 24489 jQuery.dequeue( this, type ); 24490 } 24491 } ); 24492 }, 24493 finish: function( type ) { 24494 if ( type !== false ) { 24495 type = type || "fx"; 24496 } 24497 return this.each( function() { 24498 var index, 24499 data = dataPriv.get( this ), 24500 queue = data[ type + "queue" ], 24501 hooks = data[ type + "queueHooks" ], 24502 timers = jQuery.timers, 24503 length = queue ? queue.length : 0; 24504 24505 // Enable finishing flag on private data 24506 data.finish = true; 24507 24508 // Empty the queue first 24509 jQuery.queue( this, type, [] ); 24510 24511 if ( hooks && hooks.stop ) { 24512 hooks.stop.call( this, true ); 24513 } 24514 24515 // Look for any active animations, and finish them 24516 for ( index = timers.length; index--; ) { 24517 if ( timers[ index ].elem === this && timers[ index ].queue === type ) { 24518 timers[ index ].anim.stop( true ); 24519 timers.splice( index, 1 ); 24520 } 24521 } 24522 24523 // Look for any animations in the old queue and finish them 24524 for ( index = 0; index < length; index++ ) { 24525 if ( queue[ index ] && queue[ index ].finish ) { 24526 queue[ index ].finish.call( this ); 24527 } 24528 } 24529 24530 // Turn off finishing flag 24531 delete data.finish; 24532 } ); 24533 } 24534} ); 24535 24536jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { 24537 var cssFn = jQuery.fn[ name ]; 24538 jQuery.fn[ name ] = function( speed, easing, callback ) { 24539 return speed == null || typeof speed === "boolean" ? 24540 cssFn.apply( this, arguments ) : 24541 this.animate( genFx( name, true ), speed, easing, callback ); 24542 }; 24543} ); 24544 24545// Generate shortcuts for custom animations 24546jQuery.each( { 24547 slideDown: genFx( "show" ), 24548 slideUp: genFx( "hide" ), 24549 slideToggle: genFx( "toggle" ), 24550 fadeIn: { opacity: "show" }, 24551 fadeOut: { opacity: "hide" }, 24552 fadeToggle: { opacity: "toggle" } 24553}, function( name, props ) { 24554 jQuery.fn[ name ] = function( speed, easing, callback ) { 24555 return this.animate( props, speed, easing, callback ); 24556 }; 24557} ); 24558 24559jQuery.timers = []; 24560jQuery.fx.tick = function() { 24561 var timer, 24562 i = 0, 24563 timers = jQuery.timers; 24564 24565 fxNow = Date.now(); 24566 24567 for ( ; i < timers.length; i++ ) { 24568 timer = timers[ i ]; 24569 24570 // Run the timer and safely remove it when done (allowing for external removal) 24571 if ( !timer() && timers[ i ] === timer ) { 24572 timers.splice( i--, 1 ); 24573 } 24574 } 24575 24576 if ( !timers.length ) { 24577 jQuery.fx.stop(); 24578 } 24579 fxNow = undefined; 24580}; 24581 24582jQuery.fx.timer = function( timer ) { 24583 jQuery.timers.push( timer ); 24584 jQuery.fx.start(); 24585}; 24586 24587jQuery.fx.interval = 13; 24588jQuery.fx.start = function() { 24589 if ( inProgress ) { 24590 return; 24591 } 24592 24593 inProgress = true; 24594 schedule(); 24595}; 24596 24597jQuery.fx.stop = function() { 24598 inProgress = null; 24599}; 24600 24601jQuery.fx.speeds = { 24602 slow: 600, 24603 fast: 200, 24604 24605 // Default speed 24606 _default: 400 24607}; 24608 24609 24610// Based off of the plugin by Clint Helfers, with permission. 24611// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ 24612jQuery.fn.delay = function( time, type ) { 24613 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; 24614 type = type || "fx"; 24615 24616 return this.queue( type, function( next, hooks ) { 24617 var timeout = window.setTimeout( next, time ); 24618 hooks.stop = function() { 24619 window.clearTimeout( timeout ); 24620 }; 24621 } ); 24622}; 24623 24624 24625( function() { 24626 var input = document.createElement( "input" ), 24627 select = document.createElement( "select" ), 24628 opt = select.appendChild( document.createElement( "option" ) ); 24629 24630 input.type = "checkbox"; 24631 24632 // Support: Android <=4.3 only 24633 // Default value for a checkbox should be "on" 24634 support.checkOn = input.value !== ""; 24635 24636 // Support: IE <=11 only 24637 // Must access selectedIndex to make default options select 24638 support.optSelected = opt.selected; 24639 24640 // Support: IE <=11 only 24641 // An input loses its value after becoming a radio 24642 input = document.createElement( "input" ); 24643 input.value = "t"; 24644 input.type = "radio"; 24645 support.radioValue = input.value === "t"; 24646} )(); 24647 24648 24649var boolHook, 24650 attrHandle = jQuery.expr.attrHandle; 24651 24652jQuery.fn.extend( { 24653 attr: function( name, value ) { 24654 return access( this, jQuery.attr, name, value, arguments.length > 1 ); 24655 }, 24656 24657 removeAttr: function( name ) { 24658 return this.each( function() { 24659 jQuery.removeAttr( this, name ); 24660 } ); 24661 } 24662} ); 24663 24664jQuery.extend( { 24665 attr: function( elem, name, value ) { 24666 var ret, hooks, 24667 nType = elem.nodeType; 24668 24669 // Don't get/set attributes on text, comment and attribute nodes 24670 if ( nType === 3 || nType === 8 || nType === 2 ) { 24671 return; 24672 } 24673 24674 // Fallback to prop when attributes are not supported 24675 if ( typeof elem.getAttribute === "undefined" ) { 24676 return jQuery.prop( elem, name, value ); 24677 } 24678 24679 // Attribute hooks are determined by the lowercase version 24680 // Grab necessary hook if one is defined 24681 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 24682 hooks = jQuery.attrHooks[ name.toLowerCase() ] || 24683 ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); 24684 } 24685 24686 if ( value !== undefined ) { 24687 if ( value === null ) { 24688 jQuery.removeAttr( elem, name ); 24689 return; 24690 } 24691 24692 if ( hooks && "set" in hooks && 24693 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 24694 return ret; 24695 } 24696 24697 elem.setAttribute( name, value + "" ); 24698 return value; 24699 } 24700 24701 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 24702 return ret; 24703 } 24704 24705 ret = jQuery.find.attr( elem, name ); 24706 24707 // Non-existent attributes return null, we normalize to undefined 24708 return ret == null ? undefined : ret; 24709 }, 24710 24711 attrHooks: { 24712 type: { 24713 set: function( elem, value ) { 24714 if ( !support.radioValue && value === "radio" && 24715 nodeName( elem, "input" ) ) { 24716 var val = elem.value; 24717 elem.setAttribute( "type", value ); 24718 if ( val ) { 24719 elem.value = val; 24720 } 24721 return value; 24722 } 24723 } 24724 } 24725 }, 24726 24727 removeAttr: function( elem, value ) { 24728 var name, 24729 i = 0, 24730 24731 // Attribute names can contain non-HTML whitespace characters 24732 // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 24733 attrNames = value && value.match( rnothtmlwhite ); 24734 24735 if ( attrNames && elem.nodeType === 1 ) { 24736 while ( ( name = attrNames[ i++ ] ) ) { 24737 elem.removeAttribute( name ); 24738 } 24739 } 24740 } 24741} ); 24742 24743// Hooks for boolean attributes 24744boolHook = { 24745 set: function( elem, value, name ) { 24746 if ( value === false ) { 24747 24748 // Remove boolean attributes when set to false 24749 jQuery.removeAttr( elem, name ); 24750 } else { 24751 elem.setAttribute( name, name ); 24752 } 24753 return name; 24754 } 24755}; 24756 24757jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { 24758 var getter = attrHandle[ name ] || jQuery.find.attr; 24759 24760 attrHandle[ name ] = function( elem, name, isXML ) { 24761 var ret, handle, 24762 lowercaseName = name.toLowerCase(); 24763 24764 if ( !isXML ) { 24765 24766 // Avoid an infinite loop by temporarily removing this function from the getter 24767 handle = attrHandle[ lowercaseName ]; 24768 attrHandle[ lowercaseName ] = ret; 24769 ret = getter( elem, name, isXML ) != null ? 24770 lowercaseName : 24771 null; 24772 attrHandle[ lowercaseName ] = handle; 24773 } 24774 return ret; 24775 }; 24776} ); 24777 24778 24779 24780 24781var rfocusable = /^(?:input|select|textarea|button)$/i, 24782 rclickable = /^(?:a|area)$/i; 24783 24784jQuery.fn.extend( { 24785 prop: function( name, value ) { 24786 return access( this, jQuery.prop, name, value, arguments.length > 1 ); 24787 }, 24788 24789 removeProp: function( name ) { 24790 return this.each( function() { 24791 delete this[ jQuery.propFix[ name ] || name ]; 24792 } ); 24793 } 24794} ); 24795 24796jQuery.extend( { 24797 prop: function( elem, name, value ) { 24798 var ret, hooks, 24799 nType = elem.nodeType; 24800 24801 // Don't get/set properties on text, comment and attribute nodes 24802 if ( nType === 3 || nType === 8 || nType === 2 ) { 24803 return; 24804 } 24805 24806 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { 24807 24808 // Fix name and attach hooks 24809 name = jQuery.propFix[ name ] || name; 24810 hooks = jQuery.propHooks[ name ]; 24811 } 24812 24813 if ( value !== undefined ) { 24814 if ( hooks && "set" in hooks && 24815 ( ret = hooks.set( elem, value, name ) ) !== undefined ) { 24816 return ret; 24817 } 24818 24819 return ( elem[ name ] = value ); 24820 } 24821 24822 if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { 24823 return ret; 24824 } 24825 24826 return elem[ name ]; 24827 }, 24828 24829 propHooks: { 24830 tabIndex: { 24831 get: function( elem ) { 24832 24833 // Support: IE <=9 - 11 only 24834 // elem.tabIndex doesn't always return the 24835 // correct value when it hasn't been explicitly set 24836 // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ 24837 // Use proper attribute retrieval(#12072) 24838 var tabindex = jQuery.find.attr( elem, "tabindex" ); 24839 24840 if ( tabindex ) { 24841 return parseInt( tabindex, 10 ); 24842 } 24843 24844 if ( 24845 rfocusable.test( elem.nodeName ) || 24846 rclickable.test( elem.nodeName ) && 24847 elem.href 24848 ) { 24849 return 0; 24850 } 24851 24852 return -1; 24853 } 24854 } 24855 }, 24856 24857 propFix: { 24858 "for": "htmlFor", 24859 "class": "className" 24860 } 24861} ); 24862 24863// Support: IE <=11 only 24864// Accessing the selectedIndex property 24865// forces the browser to respect setting selected 24866// on the option 24867// The getter ensures a default option is selected 24868// when in an optgroup 24869// eslint rule "no-unused-expressions" is disabled for this code 24870// since it considers such accessions noop 24871if ( !support.optSelected ) { 24872 jQuery.propHooks.selected = { 24873 get: function( elem ) { 24874 24875 /* eslint no-unused-expressions: "off" */ 24876 24877 var parent = elem.parentNode; 24878 if ( parent && parent.parentNode ) { 24879 parent.parentNode.selectedIndex; 24880 } 24881 return null; 24882 }, 24883 set: function( elem ) { 24884 24885 /* eslint no-unused-expressions: "off" */ 24886 24887 var parent = elem.parentNode; 24888 if ( parent ) { 24889 parent.selectedIndex; 24890 24891 if ( parent.parentNode ) { 24892 parent.parentNode.selectedIndex; 24893 } 24894 } 24895 } 24896 }; 24897} 24898 24899jQuery.each( [ 24900 "tabIndex", 24901 "readOnly", 24902 "maxLength", 24903 "cellSpacing", 24904 "cellPadding", 24905 "rowSpan", 24906 "colSpan", 24907 "useMap", 24908 "frameBorder", 24909 "contentEditable" 24910], function() { 24911 jQuery.propFix[ this.toLowerCase() ] = this; 24912} ); 24913 24914 24915 24916 24917 // Strip and collapse whitespace according to HTML spec 24918 // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace 24919 function stripAndCollapse( value ) { 24920 var tokens = value.match( rnothtmlwhite ) || []; 24921 return tokens.join( " " ); 24922 } 24923 24924 24925function getClass( elem ) { 24926 return elem.getAttribute && elem.getAttribute( "class" ) || ""; 24927} 24928 24929function classesToArray( value ) { 24930 if ( Array.isArray( value ) ) { 24931 return value; 24932 } 24933 if ( typeof value === "string" ) { 24934 return value.match( rnothtmlwhite ) || []; 24935 } 24936 return []; 24937} 24938 24939jQuery.fn.extend( { 24940 addClass: function( value ) { 24941 var classes, elem, cur, curValue, clazz, j, finalValue, 24942 i = 0; 24943 24944 if ( isFunction( value ) ) { 24945 return this.each( function( j ) { 24946 jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); 24947 } ); 24948 } 24949 24950 classes = classesToArray( value ); 24951 24952 if ( classes.length ) { 24953 while ( ( elem = this[ i++ ] ) ) { 24954 curValue = getClass( elem ); 24955 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 24956 24957 if ( cur ) { 24958 j = 0; 24959 while ( ( clazz = classes[ j++ ] ) ) { 24960 if ( cur.indexOf( " " + clazz + " " ) < 0 ) { 24961 cur += clazz + " "; 24962 } 24963 } 24964 24965 // Only assign if different to avoid unneeded rendering. 24966 finalValue = stripAndCollapse( cur ); 24967 if ( curValue !== finalValue ) { 24968 elem.setAttribute( "class", finalValue ); 24969 } 24970 } 24971 } 24972 } 24973 24974 return this; 24975 }, 24976 24977 removeClass: function( value ) { 24978 var classes, elem, cur, curValue, clazz, j, finalValue, 24979 i = 0; 24980 24981 if ( isFunction( value ) ) { 24982 return this.each( function( j ) { 24983 jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); 24984 } ); 24985 } 24986 24987 if ( !arguments.length ) { 24988 return this.attr( "class", "" ); 24989 } 24990 24991 classes = classesToArray( value ); 24992 24993 if ( classes.length ) { 24994 while ( ( elem = this[ i++ ] ) ) { 24995 curValue = getClass( elem ); 24996 24997 // This expression is here for better compressibility (see addClass) 24998 cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); 24999 25000 if ( cur ) { 25001 j = 0; 25002 while ( ( clazz = classes[ j++ ] ) ) { 25003 25004 // Remove *all* instances 25005 while ( cur.indexOf( " " + clazz + " " ) > -1 ) { 25006 cur = cur.replace( " " + clazz + " ", " " ); 25007 } 25008 } 25009 25010 // Only assign if different to avoid unneeded rendering. 25011 finalValue = stripAndCollapse( cur ); 25012 if ( curValue !== finalValue ) { 25013 elem.setAttribute( "class", finalValue ); 25014 } 25015 } 25016 } 25017 } 25018 25019 return this; 25020 }, 25021 25022 toggleClass: function( value, stateVal ) { 25023 var type = typeof value, 25024 isValidValue = type === "string" || Array.isArray( value ); 25025 25026 if ( typeof stateVal === "boolean" && isValidValue ) { 25027 return stateVal ? this.addClass( value ) : this.removeClass( value ); 25028 } 25029 25030 if ( isFunction( value ) ) { 25031 return this.each( function( i ) { 25032 jQuery( this ).toggleClass( 25033 value.call( this, i, getClass( this ), stateVal ), 25034 stateVal 25035 ); 25036 } ); 25037 } 25038 25039 return this.each( function() { 25040 var className, i, self, classNames; 25041 25042 if ( isValidValue ) { 25043 25044 // Toggle individual class names 25045 i = 0; 25046 self = jQuery( this ); 25047 classNames = classesToArray( value ); 25048 25049 while ( ( className = classNames[ i++ ] ) ) { 25050 25051 // Check each className given, space separated list 25052 if ( self.hasClass( className ) ) { 25053 self.removeClass( className ); 25054 } else { 25055 self.addClass( className ); 25056 } 25057 } 25058 25059 // Toggle whole class name 25060 } else if ( value === undefined || type === "boolean" ) { 25061 className = getClass( this ); 25062 if ( className ) { 25063 25064 // Store className if set 25065 dataPriv.set( this, "__className__", className ); 25066 } 25067 25068 // If the element has a class name or if we're passed `false`, 25069 // then remove the whole classname (if there was one, the above saved it). 25070 // Otherwise bring back whatever was previously saved (if anything), 25071 // falling back to the empty string if nothing was stored. 25072 if ( this.setAttribute ) { 25073 this.setAttribute( "class", 25074 className || value === false ? 25075 "" : 25076 dataPriv.get( this, "__className__" ) || "" 25077 ); 25078 } 25079 } 25080 } ); 25081 }, 25082 25083 hasClass: function( selector ) { 25084 var className, elem, 25085 i = 0; 25086 25087 className = " " + selector + " "; 25088 while ( ( elem = this[ i++ ] ) ) { 25089 if ( elem.nodeType === 1 && 25090 ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { 25091 return true; 25092 } 25093 } 25094 25095 return false; 25096 } 25097} ); 25098 25099 25100 25101 25102var rreturn = /\r/g; 25103 25104jQuery.fn.extend( { 25105 val: function( value ) { 25106 var hooks, ret, valueIsFunction, 25107 elem = this[ 0 ]; 25108 25109 if ( !arguments.length ) { 25110 if ( elem ) { 25111 hooks = jQuery.valHooks[ elem.type ] || 25112 jQuery.valHooks[ elem.nodeName.toLowerCase() ]; 25113 25114 if ( hooks && 25115 "get" in hooks && 25116 ( ret = hooks.get( elem, "value" ) ) !== undefined 25117 ) { 25118 return ret; 25119 } 25120 25121 ret = elem.value; 25122 25123 // Handle most common string cases 25124 if ( typeof ret === "string" ) { 25125 return ret.replace( rreturn, "" ); 25126 } 25127 25128 // Handle cases where value is null/undef or number 25129 return ret == null ? "" : ret; 25130 } 25131 25132 return; 25133 } 25134 25135 valueIsFunction = isFunction( value ); 25136 25137 return this.each( function( i ) { 25138 var val; 25139 25140 if ( this.nodeType !== 1 ) { 25141 return; 25142 } 25143 25144 if ( valueIsFunction ) { 25145 val = value.call( this, i, jQuery( this ).val() ); 25146 } else { 25147 val = value; 25148 } 25149 25150 // Treat null/undefined as ""; convert numbers to string 25151 if ( val == null ) { 25152 val = ""; 25153 25154 } else if ( typeof val === "number" ) { 25155 val += ""; 25156 25157 } else if ( Array.isArray( val ) ) { 25158 val = jQuery.map( val, function( value ) { 25159 return value == null ? "" : value + ""; 25160 } ); 25161 } 25162 25163 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; 25164 25165 // If set returns undefined, fall back to normal setting 25166 if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { 25167 this.value = val; 25168 } 25169 } ); 25170 } 25171} ); 25172 25173jQuery.extend( { 25174 valHooks: { 25175 option: { 25176 get: function( elem ) { 25177 25178 var val = jQuery.find.attr( elem, "value" ); 25179 return val != null ? 25180 val : 25181 25182 // Support: IE <=10 - 11 only 25183 // option.text throws exceptions (#14686, #14858) 25184 // Strip and collapse whitespace 25185 // https://html.spec.whatwg.org/#strip-and-collapse-whitespace 25186 stripAndCollapse( jQuery.text( elem ) ); 25187 } 25188 }, 25189 select: { 25190 get: function( elem ) { 25191 var value, option, i, 25192 options = elem.options, 25193 index = elem.selectedIndex, 25194 one = elem.type === "select-one", 25195 values = one ? null : [], 25196 max = one ? index + 1 : options.length; 25197 25198 if ( index < 0 ) { 25199 i = max; 25200 25201 } else { 25202 i = one ? index : 0; 25203 } 25204 25205 // Loop through all the selected options 25206 for ( ; i < max; i++ ) { 25207 option = options[ i ]; 25208 25209 // Support: IE <=9 only 25210 // IE8-9 doesn't update selected after form reset (#2551) 25211 if ( ( option.selected || i === index ) && 25212 25213 // Don't return options that are disabled or in a disabled optgroup 25214 !option.disabled && 25215 ( !option.parentNode.disabled || 25216 !nodeName( option.parentNode, "optgroup" ) ) ) { 25217 25218 // Get the specific value for the option 25219 value = jQuery( option ).val(); 25220 25221 // We don't need an array for one selects 25222 if ( one ) { 25223 return value; 25224 } 25225 25226 // Multi-Selects return an array 25227 values.push( value ); 25228 } 25229 } 25230 25231 return values; 25232 }, 25233 25234 set: function( elem, value ) { 25235 var optionSet, option, 25236 options = elem.options, 25237 values = jQuery.makeArray( value ), 25238 i = options.length; 25239 25240 while ( i-- ) { 25241 option = options[ i ]; 25242 25243 /* eslint-disable no-cond-assign */ 25244 25245 if ( option.selected = 25246 jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 25247 ) { 25248 optionSet = true; 25249 } 25250 25251 /* eslint-enable no-cond-assign */ 25252 } 25253 25254 // Force browsers to behave consistently when non-matching value is set 25255 if ( !optionSet ) { 25256 elem.selectedIndex = -1; 25257 } 25258 return values; 25259 } 25260 } 25261 } 25262} ); 25263 25264// Radios and checkboxes getter/setter 25265jQuery.each( [ "radio", "checkbox" ], function() { 25266 jQuery.valHooks[ this ] = { 25267 set: function( elem, value ) { 25268 if ( Array.isArray( value ) ) { 25269 return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); 25270 } 25271 } 25272 }; 25273 if ( !support.checkOn ) { 25274 jQuery.valHooks[ this ].get = function( elem ) { 25275 return elem.getAttribute( "value" ) === null ? "on" : elem.value; 25276 }; 25277 } 25278} ); 25279 25280 25281 25282 25283// Return jQuery for attributes-only inclusion 25284 25285 25286support.focusin = "onfocusin" in window; 25287 25288 25289var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, 25290 stopPropagationCallback = function( e ) { 25291 e.stopPropagation(); 25292 }; 25293 25294jQuery.extend( jQuery.event, { 25295 25296 trigger: function( event, data, elem, onlyHandlers ) { 25297 25298 var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, 25299 eventPath = [ elem || document ], 25300 type = hasOwn.call( event, "type" ) ? event.type : event, 25301 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; 25302 25303 cur = lastElement = tmp = elem = elem || document; 25304 25305 // Don't do events on text and comment nodes 25306 if ( elem.nodeType === 3 || elem.nodeType === 8 ) { 25307 return; 25308 } 25309 25310 // focus/blur morphs to focusin/out; ensure we're not firing them right now 25311 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { 25312 return; 25313 } 25314 25315 if ( type.indexOf( "." ) > -1 ) { 25316 25317 // Namespaced trigger; create a regexp to match event type in handle() 25318 namespaces = type.split( "." ); 25319 type = namespaces.shift(); 25320 namespaces.sort(); 25321 } 25322 ontype = type.indexOf( ":" ) < 0 && "on" + type; 25323 25324 // Caller can pass in a jQuery.Event object, Object, or just an event type string 25325 event = event[ jQuery.expando ] ? 25326 event : 25327 new jQuery.Event( type, typeof event === "object" && event ); 25328 25329 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) 25330 event.isTrigger = onlyHandlers ? 2 : 3; 25331 event.namespace = namespaces.join( "." ); 25332 event.rnamespace = event.namespace ? 25333 new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : 25334 null; 25335 25336 // Clean up the event in case it is being reused 25337 event.result = undefined; 25338 if ( !event.target ) { 25339 event.target = elem; 25340 } 25341 25342 // Clone any incoming data and prepend the event, creating the handler arg list 25343 data = data == null ? 25344 [ event ] : 25345 jQuery.makeArray( data, [ event ] ); 25346 25347 // Allow special events to draw outside the lines 25348 special = jQuery.event.special[ type ] || {}; 25349 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { 25350 return; 25351 } 25352 25353 // Determine event propagation path in advance, per W3C events spec (#9951) 25354 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) 25355 if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { 25356 25357 bubbleType = special.delegateType || type; 25358 if ( !rfocusMorph.test( bubbleType + type ) ) { 25359 cur = cur.parentNode; 25360 } 25361 for ( ; cur; cur = cur.parentNode ) { 25362 eventPath.push( cur ); 25363 tmp = cur; 25364 } 25365 25366 // Only add window if we got to document (e.g., not plain obj or detached DOM) 25367 if ( tmp === ( elem.ownerDocument || document ) ) { 25368 eventPath.push( tmp.defaultView || tmp.parentWindow || window ); 25369 } 25370 } 25371 25372 // Fire handlers on the event path 25373 i = 0; 25374 while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { 25375 lastElement = cur; 25376 event.type = i > 1 ? 25377 bubbleType : 25378 special.bindType || type; 25379 25380 // jQuery handler 25381 handle = ( dataPriv.get( cur, "events" ) || Object.create( null ) )[ event.type ] && 25382 dataPriv.get( cur, "handle" ); 25383 if ( handle ) { 25384 handle.apply( cur, data ); 25385 } 25386 25387 // Native handler 25388 handle = ontype && cur[ ontype ]; 25389 if ( handle && handle.apply && acceptData( cur ) ) { 25390 event.result = handle.apply( cur, data ); 25391 if ( event.result === false ) { 25392 event.preventDefault(); 25393 } 25394 } 25395 } 25396 event.type = type; 25397 25398 // If nobody prevented the default action, do it now 25399 if ( !onlyHandlers && !event.isDefaultPrevented() ) { 25400 25401 if ( ( !special._default || 25402 special._default.apply( eventPath.pop(), data ) === false ) && 25403 acceptData( elem ) ) { 25404 25405 // Call a native DOM method on the target with the same name as the event. 25406 // Don't do default actions on window, that's where global variables be (#6170) 25407 if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { 25408 25409 // Don't re-trigger an onFOO event when we call its FOO() method 25410 tmp = elem[ ontype ]; 25411 25412 if ( tmp ) { 25413 elem[ ontype ] = null; 25414 } 25415 25416 // Prevent re-triggering of the same event, since we already bubbled it above 25417 jQuery.event.triggered = type; 25418 25419 if ( event.isPropagationStopped() ) { 25420 lastElement.addEventListener( type, stopPropagationCallback ); 25421 } 25422 25423 elem[ type ](); 25424 25425 if ( event.isPropagationStopped() ) { 25426 lastElement.removeEventListener( type, stopPropagationCallback ); 25427 } 25428 25429 jQuery.event.triggered = undefined; 25430 25431 if ( tmp ) { 25432 elem[ ontype ] = tmp; 25433 } 25434 } 25435 } 25436 } 25437 25438 return event.result; 25439 }, 25440 25441 // Piggyback on a donor event to simulate a different one 25442 // Used only for `focus(in | out)` events 25443 simulate: function( type, elem, event ) { 25444 var e = jQuery.extend( 25445 new jQuery.Event(), 25446 event, 25447 { 25448 type: type, 25449 isSimulated: true 25450 } 25451 ); 25452 25453 jQuery.event.trigger( e, null, elem ); 25454 } 25455 25456} ); 25457 25458jQuery.fn.extend( { 25459 25460 trigger: function( type, data ) { 25461 return this.each( function() { 25462 jQuery.event.trigger( type, data, this ); 25463 } ); 25464 }, 25465 triggerHandler: function( type, data ) { 25466 var elem = this[ 0 ]; 25467 if ( elem ) { 25468 return jQuery.event.trigger( type, data, elem, true ); 25469 } 25470 } 25471} ); 25472 25473 25474// Support: Firefox <=44 25475// Firefox doesn't have focus(in | out) events 25476// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 25477// 25478// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 25479// focus(in | out) events fire after focus & blur events, 25480// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order 25481// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 25482if ( !support.focusin ) { 25483 jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { 25484 25485 // Attach a single capturing handler on the document while someone wants focusin/focusout 25486 var handler = function( event ) { 25487 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); 25488 }; 25489 25490 jQuery.event.special[ fix ] = { 25491 setup: function() { 25492 25493 // Handle: regular nodes (via `this.ownerDocument`), window 25494 // (via `this.document`) & document (via `this`). 25495 var doc = this.ownerDocument || this.document || this, 25496 attaches = dataPriv.access( doc, fix ); 25497 25498 if ( !attaches ) { 25499 doc.addEventListener( orig, handler, true ); 25500 } 25501 dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); 25502 }, 25503 teardown: function() { 25504 var doc = this.ownerDocument || this.document || this, 25505 attaches = dataPriv.access( doc, fix ) - 1; 25506 25507 if ( !attaches ) { 25508 doc.removeEventListener( orig, handler, true ); 25509 dataPriv.remove( doc, fix ); 25510 25511 } else { 25512 dataPriv.access( doc, fix, attaches ); 25513 } 25514 } 25515 }; 25516 } ); 25517} 25518var location = window.location; 25519 25520var nonce = { guid: Date.now() }; 25521 25522var rquery = ( /\?/ ); 25523 25524 25525 25526// Cross-browser xml parsing 25527jQuery.parseXML = function( data ) { 25528 var xml, parserErrorElem; 25529 if ( !data || typeof data !== "string" ) { 25530 return null; 25531 } 25532 25533 // Support: IE 9 - 11 only 25534 // IE throws on parseFromString with invalid input. 25535 try { 25536 xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); 25537 } catch ( e ) {} 25538 25539 parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ]; 25540 if ( !xml || parserErrorElem ) { 25541 jQuery.error( "Invalid XML: " + ( 25542 parserErrorElem ? 25543 jQuery.map( parserErrorElem.childNodes, function( el ) { 25544 return el.textContent; 25545 } ).join( "\n" ) : 25546 data 25547 ) ); 25548 } 25549 return xml; 25550}; 25551 25552 25553var 25554 rbracket = /\[\]$/, 25555 rCRLF = /\r?\n/g, 25556 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, 25557 rsubmittable = /^(?:input|select|textarea|keygen)/i; 25558 25559function buildParams( prefix, obj, traditional, add ) { 25560 var name; 25561 25562 if ( Array.isArray( obj ) ) { 25563 25564 // Serialize array item. 25565 jQuery.each( obj, function( i, v ) { 25566 if ( traditional || rbracket.test( prefix ) ) { 25567 25568 // Treat each array item as a scalar. 25569 add( prefix, v ); 25570 25571 } else { 25572 25573 // Item is non-scalar (array or object), encode its numeric index. 25574 buildParams( 25575 prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", 25576 v, 25577 traditional, 25578 add 25579 ); 25580 } 25581 } ); 25582 25583 } else if ( !traditional && toType( obj ) === "object" ) { 25584 25585 // Serialize object item. 25586 for ( name in obj ) { 25587 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); 25588 } 25589 25590 } else { 25591 25592 // Serialize scalar item. 25593 add( prefix, obj ); 25594 } 25595} 25596 25597// Serialize an array of form elements or a set of 25598// key/values into a query string 25599jQuery.param = function( a, traditional ) { 25600 var prefix, 25601 s = [], 25602 add = function( key, valueOrFunction ) { 25603 25604 // If value is a function, invoke it and use its return value 25605 var value = isFunction( valueOrFunction ) ? 25606 valueOrFunction() : 25607 valueOrFunction; 25608 25609 s[ s.length ] = encodeURIComponent( key ) + "=" + 25610 encodeURIComponent( value == null ? "" : value ); 25611 }; 25612 25613 if ( a == null ) { 25614 return ""; 25615 } 25616 25617 // If an array was passed in, assume that it is an array of form elements. 25618 if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { 25619 25620 // Serialize the form elements 25621 jQuery.each( a, function() { 25622 add( this.name, this.value ); 25623 } ); 25624 25625 } else { 25626 25627 // If traditional, encode the "old" way (the way 1.3.2 or older 25628 // did it), otherwise encode params recursively. 25629 for ( prefix in a ) { 25630 buildParams( prefix, a[ prefix ], traditional, add ); 25631 } 25632 } 25633 25634 // Return the resulting serialization 25635 return s.join( "&" ); 25636}; 25637 25638jQuery.fn.extend( { 25639 serialize: function() { 25640 return jQuery.param( this.serializeArray() ); 25641 }, 25642 serializeArray: function() { 25643 return this.map( function() { 25644 25645 // Can add propHook for "elements" to filter or add form elements 25646 var elements = jQuery.prop( this, "elements" ); 25647 return elements ? jQuery.makeArray( elements ) : this; 25648 } ).filter( function() { 25649 var type = this.type; 25650 25651 // Use .is( ":disabled" ) so that fieldset[disabled] works 25652 return this.name && !jQuery( this ).is( ":disabled" ) && 25653 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && 25654 ( this.checked || !rcheckableType.test( type ) ); 25655 } ).map( function( _i, elem ) { 25656 var val = jQuery( this ).val(); 25657 25658 if ( val == null ) { 25659 return null; 25660 } 25661 25662 if ( Array.isArray( val ) ) { 25663 return jQuery.map( val, function( val ) { 25664 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 25665 } ); 25666 } 25667 25668 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; 25669 } ).get(); 25670 } 25671} ); 25672 25673 25674var 25675 r20 = /%20/g, 25676 rhash = /#.*$/, 25677 rantiCache = /([?&])_=[^&]*/, 25678 rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, 25679 25680 // #7653, #8125, #8152: local protocol detection 25681 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, 25682 rnoContent = /^(?:GET|HEAD)$/, 25683 rprotocol = /^\/\//, 25684 25685 /* Prefilters 25686 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) 25687 * 2) These are called: 25688 * - BEFORE asking for a transport 25689 * - AFTER param serialization (s.data is a string if s.processData is true) 25690 * 3) key is the dataType 25691 * 4) the catchall symbol "*" can be used 25692 * 5) execution will start with transport dataType and THEN continue down to "*" if needed 25693 */ 25694 prefilters = {}, 25695 25696 /* Transports bindings 25697 * 1) key is the dataType 25698 * 2) the catchall symbol "*" can be used 25699 * 3) selection will start with transport dataType and THEN go to "*" if needed 25700 */ 25701 transports = {}, 25702 25703 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression 25704 allTypes = "*/".concat( "*" ), 25705 25706 // Anchor tag for parsing the document origin 25707 originAnchor = document.createElement( "a" ); 25708 25709originAnchor.href = location.href; 25710 25711// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport 25712function addToPrefiltersOrTransports( structure ) { 25713 25714 // dataTypeExpression is optional and defaults to "*" 25715 return function( dataTypeExpression, func ) { 25716 25717 if ( typeof dataTypeExpression !== "string" ) { 25718 func = dataTypeExpression; 25719 dataTypeExpression = "*"; 25720 } 25721 25722 var dataType, 25723 i = 0, 25724 dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; 25725 25726 if ( isFunction( func ) ) { 25727 25728 // For each dataType in the dataTypeExpression 25729 while ( ( dataType = dataTypes[ i++ ] ) ) { 25730 25731 // Prepend if requested 25732 if ( dataType[ 0 ] === "+" ) { 25733 dataType = dataType.slice( 1 ) || "*"; 25734 ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); 25735 25736 // Otherwise append 25737 } else { 25738 ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); 25739 } 25740 } 25741 } 25742 }; 25743} 25744 25745// Base inspection function for prefilters and transports 25746function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { 25747 25748 var inspected = {}, 25749 seekingTransport = ( structure === transports ); 25750 25751 function inspect( dataType ) { 25752 var selected; 25753 inspected[ dataType ] = true; 25754 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { 25755 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); 25756 if ( typeof dataTypeOrTransport === "string" && 25757 !seekingTransport && !inspected[ dataTypeOrTransport ] ) { 25758 25759 options.dataTypes.unshift( dataTypeOrTransport ); 25760 inspect( dataTypeOrTransport ); 25761 return false; 25762 } else if ( seekingTransport ) { 25763 return !( selected = dataTypeOrTransport ); 25764 } 25765 } ); 25766 return selected; 25767 } 25768 25769 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); 25770} 25771 25772// A special extend for ajax options 25773// that takes "flat" options (not to be deep extended) 25774// Fixes #9887 25775function ajaxExtend( target, src ) { 25776 var key, deep, 25777 flatOptions = jQuery.ajaxSettings.flatOptions || {}; 25778 25779 for ( key in src ) { 25780 if ( src[ key ] !== undefined ) { 25781 ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; 25782 } 25783 } 25784 if ( deep ) { 25785 jQuery.extend( true, target, deep ); 25786 } 25787 25788 return target; 25789} 25790 25791/* Handles responses to an ajax request: 25792 * - finds the right dataType (mediates between content-type and expected dataType) 25793 * - returns the corresponding response 25794 */ 25795function ajaxHandleResponses( s, jqXHR, responses ) { 25796 25797 var ct, type, finalDataType, firstDataType, 25798 contents = s.contents, 25799 dataTypes = s.dataTypes; 25800 25801 // Remove auto dataType and get content-type in the process 25802 while ( dataTypes[ 0 ] === "*" ) { 25803 dataTypes.shift(); 25804 if ( ct === undefined ) { 25805 ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); 25806 } 25807 } 25808 25809 // Check if we're dealing with a known content-type 25810 if ( ct ) { 25811 for ( type in contents ) { 25812 if ( contents[ type ] && contents[ type ].test( ct ) ) { 25813 dataTypes.unshift( type ); 25814 break; 25815 } 25816 } 25817 } 25818 25819 // Check to see if we have a response for the expected dataType 25820 if ( dataTypes[ 0 ] in responses ) { 25821 finalDataType = dataTypes[ 0 ]; 25822 } else { 25823 25824 // Try convertible dataTypes 25825 for ( type in responses ) { 25826 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { 25827 finalDataType = type; 25828 break; 25829 } 25830 if ( !firstDataType ) { 25831 firstDataType = type; 25832 } 25833 } 25834 25835 // Or just use first one 25836 finalDataType = finalDataType || firstDataType; 25837 } 25838 25839 // If we found a dataType 25840 // We add the dataType to the list if needed 25841 // and return the corresponding response 25842 if ( finalDataType ) { 25843 if ( finalDataType !== dataTypes[ 0 ] ) { 25844 dataTypes.unshift( finalDataType ); 25845 } 25846 return responses[ finalDataType ]; 25847 } 25848} 25849 25850/* Chain conversions given the request and the original response 25851 * Also sets the responseXXX fields on the jqXHR instance 25852 */ 25853function ajaxConvert( s, response, jqXHR, isSuccess ) { 25854 var conv2, current, conv, tmp, prev, 25855 converters = {}, 25856 25857 // Work with a copy of dataTypes in case we need to modify it for conversion 25858 dataTypes = s.dataTypes.slice(); 25859 25860 // Create converters map with lowercased keys 25861 if ( dataTypes[ 1 ] ) { 25862 for ( conv in s.converters ) { 25863 converters[ conv.toLowerCase() ] = s.converters[ conv ]; 25864 } 25865 } 25866 25867 current = dataTypes.shift(); 25868 25869 // Convert to each sequential dataType 25870 while ( current ) { 25871 25872 if ( s.responseFields[ current ] ) { 25873 jqXHR[ s.responseFields[ current ] ] = response; 25874 } 25875 25876 // Apply the dataFilter if provided 25877 if ( !prev && isSuccess && s.dataFilter ) { 25878 response = s.dataFilter( response, s.dataType ); 25879 } 25880 25881 prev = current; 25882 current = dataTypes.shift(); 25883 25884 if ( current ) { 25885 25886 // There's only work to do if current dataType is non-auto 25887 if ( current === "*" ) { 25888 25889 current = prev; 25890 25891 // Convert response if prev dataType is non-auto and differs from current 25892 } else if ( prev !== "*" && prev !== current ) { 25893 25894 // Seek a direct converter 25895 conv = converters[ prev + " " + current ] || converters[ "* " + current ]; 25896 25897 // If none found, seek a pair 25898 if ( !conv ) { 25899 for ( conv2 in converters ) { 25900 25901 // If conv2 outputs current 25902 tmp = conv2.split( " " ); 25903 if ( tmp[ 1 ] === current ) { 25904 25905 // If prev can be converted to accepted input 25906 conv = converters[ prev + " " + tmp[ 0 ] ] || 25907 converters[ "* " + tmp[ 0 ] ]; 25908 if ( conv ) { 25909 25910 // Condense equivalence converters 25911 if ( conv === true ) { 25912 conv = converters[ conv2 ]; 25913 25914 // Otherwise, insert the intermediate dataType 25915 } else if ( converters[ conv2 ] !== true ) { 25916 current = tmp[ 0 ]; 25917 dataTypes.unshift( tmp[ 1 ] ); 25918 } 25919 break; 25920 } 25921 } 25922 } 25923 } 25924 25925 // Apply converter (if not an equivalence) 25926 if ( conv !== true ) { 25927 25928 // Unless errors are allowed to bubble, catch and return them 25929 if ( conv && s.throws ) { 25930 response = conv( response ); 25931 } else { 25932 try { 25933 response = conv( response ); 25934 } catch ( e ) { 25935 return { 25936 state: "parsererror", 25937 error: conv ? e : "No conversion from " + prev + " to " + current 25938 }; 25939 } 25940 } 25941 } 25942 } 25943 } 25944 } 25945 25946 return { state: "success", data: response }; 25947} 25948 25949jQuery.extend( { 25950 25951 // Counter for holding the number of active queries 25952 active: 0, 25953 25954 // Last-Modified header cache for next request 25955 lastModified: {}, 25956 etag: {}, 25957 25958 ajaxSettings: { 25959 url: location.href, 25960 type: "GET", 25961 isLocal: rlocalProtocol.test( location.protocol ), 25962 global: true, 25963 processData: true, 25964 async: true, 25965 contentType: "application/x-www-form-urlencoded; charset=UTF-8", 25966 25967 /* 25968 timeout: 0, 25969 data: null, 25970 dataType: null, 25971 username: null, 25972 password: null, 25973 cache: null, 25974 throws: false, 25975 traditional: false, 25976 headers: {}, 25977 */ 25978 25979 accepts: { 25980 "*": allTypes, 25981 text: "text/plain", 25982 html: "text/html", 25983 xml: "application/xml, text/xml", 25984 json: "application/json, text/javascript" 25985 }, 25986 25987 contents: { 25988 xml: /\bxml\b/, 25989 html: /\bhtml/, 25990 json: /\bjson\b/ 25991 }, 25992 25993 responseFields: { 25994 xml: "responseXML", 25995 text: "responseText", 25996 json: "responseJSON" 25997 }, 25998 25999 // Data converters 26000 // Keys separate source (or catchall "*") and destination types with a single space 26001 converters: { 26002 26003 // Convert anything to text 26004 "* text": String, 26005 26006 // Text to html (true = no transformation) 26007 "text html": true, 26008 26009 // Evaluate text as a json expression 26010 "text json": JSON.parse, 26011 26012 // Parse text as xml 26013 "text xml": jQuery.parseXML 26014 }, 26015 26016 // For options that shouldn't be deep extended: 26017 // you can add your own custom options here if 26018 // and when you create one that shouldn't be 26019 // deep extended (see ajaxExtend) 26020 flatOptions: { 26021 url: true, 26022 context: true 26023 } 26024 }, 26025 26026 // Creates a full fledged settings object into target 26027 // with both ajaxSettings and settings fields. 26028 // If target is omitted, writes into ajaxSettings. 26029 ajaxSetup: function( target, settings ) { 26030 return settings ? 26031 26032 // Building a settings object 26033 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : 26034 26035 // Extending ajaxSettings 26036 ajaxExtend( jQuery.ajaxSettings, target ); 26037 }, 26038 26039 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), 26040 ajaxTransport: addToPrefiltersOrTransports( transports ), 26041 26042 // Main method 26043 ajax: function( url, options ) { 26044 26045 // If url is an object, simulate pre-1.5 signature 26046 if ( typeof url === "object" ) { 26047 options = url; 26048 url = undefined; 26049 } 26050 26051 // Force options to be an object 26052 options = options || {}; 26053 26054 var transport, 26055 26056 // URL without anti-cache param 26057 cacheURL, 26058 26059 // Response headers 26060 responseHeadersString, 26061 responseHeaders, 26062 26063 // timeout handle 26064 timeoutTimer, 26065 26066 // Url cleanup var 26067 urlAnchor, 26068 26069 // Request state (becomes false upon send and true upon completion) 26070 completed, 26071 26072 // To know if global events are to be dispatched 26073 fireGlobals, 26074 26075 // Loop variable 26076 i, 26077 26078 // uncached part of the url 26079 uncached, 26080 26081 // Create the final options object 26082 s = jQuery.ajaxSetup( {}, options ), 26083 26084 // Callbacks context 26085 callbackContext = s.context || s, 26086 26087 // Context for global events is callbackContext if it is a DOM node or jQuery collection 26088 globalEventContext = s.context && 26089 ( callbackContext.nodeType || callbackContext.jquery ) ? 26090 jQuery( callbackContext ) : 26091 jQuery.event, 26092 26093 // Deferreds 26094 deferred = jQuery.Deferred(), 26095 completeDeferred = jQuery.Callbacks( "once memory" ), 26096 26097 // Status-dependent callbacks 26098 statusCode = s.statusCode || {}, 26099 26100 // Headers (they are sent all at once) 26101 requestHeaders = {}, 26102 requestHeadersNames = {}, 26103 26104 // Default abort message 26105 strAbort = "canceled", 26106 26107 // Fake xhr 26108 jqXHR = { 26109 readyState: 0, 26110 26111 // Builds headers hashtable if needed 26112 getResponseHeader: function( key ) { 26113 var match; 26114 if ( completed ) { 26115 if ( !responseHeaders ) { 26116 responseHeaders = {}; 26117 while ( ( match = rheaders.exec( responseHeadersString ) ) ) { 26118 responseHeaders[ match[ 1 ].toLowerCase() + " " ] = 26119 ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) 26120 .concat( match[ 2 ] ); 26121 } 26122 } 26123 match = responseHeaders[ key.toLowerCase() + " " ]; 26124 } 26125 return match == null ? null : match.join( ", " ); 26126 }, 26127 26128 // Raw string 26129 getAllResponseHeaders: function() { 26130 return completed ? responseHeadersString : null; 26131 }, 26132 26133 // Caches the header 26134 setRequestHeader: function( name, value ) { 26135 if ( completed == null ) { 26136 name = requestHeadersNames[ name.toLowerCase() ] = 26137 requestHeadersNames[ name.toLowerCase() ] || name; 26138 requestHeaders[ name ] = value; 26139 } 26140 return this; 26141 }, 26142 26143 // Overrides response content-type header 26144 overrideMimeType: function( type ) { 26145 if ( completed == null ) { 26146 s.mimeType = type; 26147 } 26148 return this; 26149 }, 26150 26151 // Status-dependent callbacks 26152 statusCode: function( map ) { 26153 var code; 26154 if ( map ) { 26155 if ( completed ) { 26156 26157 // Execute the appropriate callbacks 26158 jqXHR.always( map[ jqXHR.status ] ); 26159 } else { 26160 26161 // Lazy-add the new callbacks in a way that preserves old ones 26162 for ( code in map ) { 26163 statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; 26164 } 26165 } 26166 } 26167 return this; 26168 }, 26169 26170 // Cancel the request 26171 abort: function( statusText ) { 26172 var finalText = statusText || strAbort; 26173 if ( transport ) { 26174 transport.abort( finalText ); 26175 } 26176 done( 0, finalText ); 26177 return this; 26178 } 26179 }; 26180 26181 // Attach deferreds 26182 deferred.promise( jqXHR ); 26183 26184 // Add protocol if not provided (prefilters might expect it) 26185 // Handle falsy url in the settings object (#10093: consistency with old signature) 26186 // We also use the url parameter if available 26187 s.url = ( ( url || s.url || location.href ) + "" ) 26188 .replace( rprotocol, location.protocol + "//" ); 26189 26190 // Alias method option to type as per ticket #12004 26191 s.type = options.method || options.type || s.method || s.type; 26192 26193 // Extract dataTypes list 26194 s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; 26195 26196 // A cross-domain request is in order when the origin doesn't match the current origin. 26197 if ( s.crossDomain == null ) { 26198 urlAnchor = document.createElement( "a" ); 26199 26200 // Support: IE <=8 - 11, Edge 12 - 15 26201 // IE throws exception on accessing the href property if url is malformed, 26202 // e.g. http://example.com:80x/ 26203 try { 26204 urlAnchor.href = s.url; 26205 26206 // Support: IE <=8 - 11 only 26207 // Anchor's host property isn't correctly set when s.url is relative 26208 urlAnchor.href = urlAnchor.href; 26209 s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== 26210 urlAnchor.protocol + "//" + urlAnchor.host; 26211 } catch ( e ) { 26212 26213 // If there is an error parsing the URL, assume it is crossDomain, 26214 // it can be rejected by the transport if it is invalid 26215 s.crossDomain = true; 26216 } 26217 } 26218 26219 // Convert data if not already a string 26220 if ( s.data && s.processData && typeof s.data !== "string" ) { 26221 s.data = jQuery.param( s.data, s.traditional ); 26222 } 26223 26224 // Apply prefilters 26225 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); 26226 26227 // If request was aborted inside a prefilter, stop there 26228 if ( completed ) { 26229 return jqXHR; 26230 } 26231 26232 // We can fire global events as of now if asked to 26233 // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) 26234 fireGlobals = jQuery.event && s.global; 26235 26236 // Watch for a new set of requests 26237 if ( fireGlobals && jQuery.active++ === 0 ) { 26238 jQuery.event.trigger( "ajaxStart" ); 26239 } 26240 26241 // Uppercase the type 26242 s.type = s.type.toUpperCase(); 26243 26244 // Determine if request has content 26245 s.hasContent = !rnoContent.test( s.type ); 26246 26247 // Save the URL in case we're toying with the If-Modified-Since 26248 // and/or If-None-Match header later on 26249 // Remove hash to simplify url manipulation 26250 cacheURL = s.url.replace( rhash, "" ); 26251 26252 // More options handling for requests with no content 26253 if ( !s.hasContent ) { 26254 26255 // Remember the hash so we can put it back 26256 uncached = s.url.slice( cacheURL.length ); 26257 26258 // If data is available and should be processed, append data to url 26259 if ( s.data && ( s.processData || typeof s.data === "string" ) ) { 26260 cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; 26261 26262 // #9682: remove data so that it's not used in an eventual retry 26263 delete s.data; 26264 } 26265 26266 // Add or update anti-cache param if needed 26267 if ( s.cache === false ) { 26268 cacheURL = cacheURL.replace( rantiCache, "$1" ); 26269 uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + 26270 uncached; 26271 } 26272 26273 // Put hash and anti-cache on the URL that will be requested (gh-1732) 26274 s.url = cacheURL + uncached; 26275 26276 // Change '%20' to '+' if this is encoded form body content (gh-2658) 26277 } else if ( s.data && s.processData && 26278 ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { 26279 s.data = s.data.replace( r20, "+" ); 26280 } 26281 26282 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 26283 if ( s.ifModified ) { 26284 if ( jQuery.lastModified[ cacheURL ] ) { 26285 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); 26286 } 26287 if ( jQuery.etag[ cacheURL ] ) { 26288 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); 26289 } 26290 } 26291 26292 // Set the correct header, if data is being sent 26293 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { 26294 jqXHR.setRequestHeader( "Content-Type", s.contentType ); 26295 } 26296 26297 // Set the Accepts header for the server, depending on the dataType 26298 jqXHR.setRequestHeader( 26299 "Accept", 26300 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? 26301 s.accepts[ s.dataTypes[ 0 ] ] + 26302 ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : 26303 s.accepts[ "*" ] 26304 ); 26305 26306 // Check for headers option 26307 for ( i in s.headers ) { 26308 jqXHR.setRequestHeader( i, s.headers[ i ] ); 26309 } 26310 26311 // Allow custom headers/mimetypes and early abort 26312 if ( s.beforeSend && 26313 ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { 26314 26315 // Abort if not done already and return 26316 return jqXHR.abort(); 26317 } 26318 26319 // Aborting is no longer a cancellation 26320 strAbort = "abort"; 26321 26322 // Install callbacks on deferreds 26323 completeDeferred.add( s.complete ); 26324 jqXHR.done( s.success ); 26325 jqXHR.fail( s.error ); 26326 26327 // Get transport 26328 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); 26329 26330 // If no transport, we auto-abort 26331 if ( !transport ) { 26332 done( -1, "No Transport" ); 26333 } else { 26334 jqXHR.readyState = 1; 26335 26336 // Send global event 26337 if ( fireGlobals ) { 26338 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); 26339 } 26340 26341 // If request was aborted inside ajaxSend, stop there 26342 if ( completed ) { 26343 return jqXHR; 26344 } 26345 26346 // Timeout 26347 if ( s.async && s.timeout > 0 ) { 26348 timeoutTimer = window.setTimeout( function() { 26349 jqXHR.abort( "timeout" ); 26350 }, s.timeout ); 26351 } 26352 26353 try { 26354 completed = false; 26355 transport.send( requestHeaders, done ); 26356 } catch ( e ) { 26357 26358 // Rethrow post-completion exceptions 26359 if ( completed ) { 26360 throw e; 26361 } 26362 26363 // Propagate others as results 26364 done( -1, e ); 26365 } 26366 } 26367 26368 // Callback for when everything is done 26369 function done( status, nativeStatusText, responses, headers ) { 26370 var isSuccess, success, error, response, modified, 26371 statusText = nativeStatusText; 26372 26373 // Ignore repeat invocations 26374 if ( completed ) { 26375 return; 26376 } 26377 26378 completed = true; 26379 26380 // Clear timeout if it exists 26381 if ( timeoutTimer ) { 26382 window.clearTimeout( timeoutTimer ); 26383 } 26384 26385 // Dereference transport for early garbage collection 26386 // (no matter how long the jqXHR object will be used) 26387 transport = undefined; 26388 26389 // Cache response headers 26390 responseHeadersString = headers || ""; 26391 26392 // Set readyState 26393 jqXHR.readyState = status > 0 ? 4 : 0; 26394 26395 // Determine if successful 26396 isSuccess = status >= 200 && status < 300 || status === 304; 26397 26398 // Get response data 26399 if ( responses ) { 26400 response = ajaxHandleResponses( s, jqXHR, responses ); 26401 } 26402 26403 // Use a noop converter for missing script but not if jsonp 26404 if ( !isSuccess && 26405 jQuery.inArray( "script", s.dataTypes ) > -1 && 26406 jQuery.inArray( "json", s.dataTypes ) < 0 ) { 26407 s.converters[ "text script" ] = function() {}; 26408 } 26409 26410 // Convert no matter what (that way responseXXX fields are always set) 26411 response = ajaxConvert( s, response, jqXHR, isSuccess ); 26412 26413 // If successful, handle type chaining 26414 if ( isSuccess ) { 26415 26416 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. 26417 if ( s.ifModified ) { 26418 modified = jqXHR.getResponseHeader( "Last-Modified" ); 26419 if ( modified ) { 26420 jQuery.lastModified[ cacheURL ] = modified; 26421 } 26422 modified = jqXHR.getResponseHeader( "etag" ); 26423 if ( modified ) { 26424 jQuery.etag[ cacheURL ] = modified; 26425 } 26426 } 26427 26428 // if no content 26429 if ( status === 204 || s.type === "HEAD" ) { 26430 statusText = "nocontent"; 26431 26432 // if not modified 26433 } else if ( status === 304 ) { 26434 statusText = "notmodified"; 26435 26436 // If we have data, let's convert it 26437 } else { 26438 statusText = response.state; 26439 success = response.data; 26440 error = response.error; 26441 isSuccess = !error; 26442 } 26443 } else { 26444 26445 // Extract error from statusText and normalize for non-aborts 26446 error = statusText; 26447 if ( status || !statusText ) { 26448 statusText = "error"; 26449 if ( status < 0 ) { 26450 status = 0; 26451 } 26452 } 26453 } 26454 26455 // Set data for the fake xhr object 26456 jqXHR.status = status; 26457 jqXHR.statusText = ( nativeStatusText || statusText ) + ""; 26458 26459 // Success/Error 26460 if ( isSuccess ) { 26461 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); 26462 } else { 26463 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); 26464 } 26465 26466 // Status-dependent callbacks 26467 jqXHR.statusCode( statusCode ); 26468 statusCode = undefined; 26469 26470 if ( fireGlobals ) { 26471 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", 26472 [ jqXHR, s, isSuccess ? success : error ] ); 26473 } 26474 26475 // Complete 26476 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); 26477 26478 if ( fireGlobals ) { 26479 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); 26480 26481 // Handle the global AJAX counter 26482 if ( !( --jQuery.active ) ) { 26483 jQuery.event.trigger( "ajaxStop" ); 26484 } 26485 } 26486 } 26487 26488 return jqXHR; 26489 }, 26490 26491 getJSON: function( url, data, callback ) { 26492 return jQuery.get( url, data, callback, "json" ); 26493 }, 26494 26495 getScript: function( url, callback ) { 26496 return jQuery.get( url, undefined, callback, "script" ); 26497 } 26498} ); 26499 26500jQuery.each( [ "get", "post" ], function( _i, method ) { 26501 jQuery[ method ] = function( url, data, callback, type ) { 26502 26503 // Shift arguments if data argument was omitted 26504 if ( isFunction( data ) ) { 26505 type = type || callback; 26506 callback = data; 26507 data = undefined; 26508 } 26509 26510 // The url can be an options object (which then must have .url) 26511 return jQuery.ajax( jQuery.extend( { 26512 url: url, 26513 type: method, 26514 dataType: type, 26515 data: data, 26516 success: callback 26517 }, jQuery.isPlainObject( url ) && url ) ); 26518 }; 26519} ); 26520 26521jQuery.ajaxPrefilter( function( s ) { 26522 var i; 26523 for ( i in s.headers ) { 26524 if ( i.toLowerCase() === "content-type" ) { 26525 s.contentType = s.headers[ i ] || ""; 26526 } 26527 } 26528} ); 26529 26530 26531jQuery._evalUrl = function( url, options, doc ) { 26532 return jQuery.ajax( { 26533 url: url, 26534 26535 // Make this explicit, since user can override this through ajaxSetup (#11264) 26536 type: "GET", 26537 dataType: "script", 26538 cache: true, 26539 async: false, 26540 global: false, 26541 26542 // Only evaluate the response if it is successful (gh-4126) 26543 // dataFilter is not invoked for failure responses, so using it instead 26544 // of the default converter is kludgy but it works. 26545 converters: { 26546 "text script": function() {} 26547 }, 26548 dataFilter: function( response ) { 26549 jQuery.globalEval( response, options, doc ); 26550 } 26551 } ); 26552}; 26553 26554 26555jQuery.fn.extend( { 26556 wrapAll: function( html ) { 26557 var wrap; 26558 26559 if ( this[ 0 ] ) { 26560 if ( isFunction( html ) ) { 26561 html = html.call( this[ 0 ] ); 26562 } 26563 26564 // The elements to wrap the target around 26565 wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); 26566 26567 if ( this[ 0 ].parentNode ) { 26568 wrap.insertBefore( this[ 0 ] ); 26569 } 26570 26571 wrap.map( function() { 26572 var elem = this; 26573 26574 while ( elem.firstElementChild ) { 26575 elem = elem.firstElementChild; 26576 } 26577 26578 return elem; 26579 } ).append( this ); 26580 } 26581 26582 return this; 26583 }, 26584 26585 wrapInner: function( html ) { 26586 if ( isFunction( html ) ) { 26587 return this.each( function( i ) { 26588 jQuery( this ).wrapInner( html.call( this, i ) ); 26589 } ); 26590 } 26591 26592 return this.each( function() { 26593 var self = jQuery( this ), 26594 contents = self.contents(); 26595 26596 if ( contents.length ) { 26597 contents.wrapAll( html ); 26598 26599 } else { 26600 self.append( html ); 26601 } 26602 } ); 26603 }, 26604 26605 wrap: function( html ) { 26606 var htmlIsFunction = isFunction( html ); 26607 26608 return this.each( function( i ) { 26609 jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); 26610 } ); 26611 }, 26612 26613 unwrap: function( selector ) { 26614 this.parent( selector ).not( "body" ).each( function() { 26615 jQuery( this ).replaceWith( this.childNodes ); 26616 } ); 26617 return this; 26618 } 26619} ); 26620 26621 26622jQuery.expr.pseudos.hidden = function( elem ) { 26623 return !jQuery.expr.pseudos.visible( elem ); 26624}; 26625jQuery.expr.pseudos.visible = function( elem ) { 26626 return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); 26627}; 26628 26629 26630 26631 26632jQuery.ajaxSettings.xhr = function() { 26633 try { 26634 return new window.XMLHttpRequest(); 26635 } catch ( e ) {} 26636}; 26637 26638var xhrSuccessStatus = { 26639 26640 // File protocol always yields status code 0, assume 200 26641 0: 200, 26642 26643 // Support: IE <=9 only 26644 // #1450: sometimes IE returns 1223 when it should be 204 26645 1223: 204 26646 }, 26647 xhrSupported = jQuery.ajaxSettings.xhr(); 26648 26649support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); 26650support.ajax = xhrSupported = !!xhrSupported; 26651 26652jQuery.ajaxTransport( function( options ) { 26653 var callback, errorCallback; 26654 26655 // Cross domain only allowed if supported through XMLHttpRequest 26656 if ( support.cors || xhrSupported && !options.crossDomain ) { 26657 return { 26658 send: function( headers, complete ) { 26659 var i, 26660 xhr = options.xhr(); 26661 26662 xhr.open( 26663 options.type, 26664 options.url, 26665 options.async, 26666 options.username, 26667 options.password 26668 ); 26669 26670 // Apply custom fields if provided 26671 if ( options.xhrFields ) { 26672 for ( i in options.xhrFields ) { 26673 xhr[ i ] = options.xhrFields[ i ]; 26674 } 26675 } 26676 26677 // Override mime type if needed 26678 if ( options.mimeType && xhr.overrideMimeType ) { 26679 xhr.overrideMimeType( options.mimeType ); 26680 } 26681 26682 // X-Requested-With header 26683 // For cross-domain requests, seeing as conditions for a preflight are 26684 // akin to a jigsaw puzzle, we simply never set it to be sure. 26685 // (it can always be set on a per-request basis or even using ajaxSetup) 26686 // For same-domain requests, won't change header if already provided. 26687 if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { 26688 headers[ "X-Requested-With" ] = "XMLHttpRequest"; 26689 } 26690 26691 // Set headers 26692 for ( i in headers ) { 26693 xhr.setRequestHeader( i, headers[ i ] ); 26694 } 26695 26696 // Callback 26697 callback = function( type ) { 26698 return function() { 26699 if ( callback ) { 26700 callback = errorCallback = xhr.onload = 26701 xhr.onerror = xhr.onabort = xhr.ontimeout = 26702 xhr.onreadystatechange = null; 26703 26704 if ( type === "abort" ) { 26705 xhr.abort(); 26706 } else if ( type === "error" ) { 26707 26708 // Support: IE <=9 only 26709 // On a manual native abort, IE9 throws 26710 // errors on any property access that is not readyState 26711 if ( typeof xhr.status !== "number" ) { 26712 complete( 0, "error" ); 26713 } else { 26714 complete( 26715 26716 // File: protocol always yields status 0; see #8605, #14207 26717 xhr.status, 26718 xhr.statusText 26719 ); 26720 } 26721 } else { 26722 complete( 26723 xhrSuccessStatus[ xhr.status ] || xhr.status, 26724 xhr.statusText, 26725 26726 // Support: IE <=9 only 26727 // IE9 has no XHR2 but throws on binary (trac-11426) 26728 // For XHR2 non-text, let the caller handle it (gh-2498) 26729 ( xhr.responseType || "text" ) !== "text" || 26730 typeof xhr.responseText !== "string" ? 26731 { binary: xhr.response } : 26732 { text: xhr.responseText }, 26733 xhr.getAllResponseHeaders() 26734 ); 26735 } 26736 } 26737 }; 26738 }; 26739 26740 // Listen to events 26741 xhr.onload = callback(); 26742 errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); 26743 26744 // Support: IE 9 only 26745 // Use onreadystatechange to replace onabort 26746 // to handle uncaught aborts 26747 if ( xhr.onabort !== undefined ) { 26748 xhr.onabort = errorCallback; 26749 } else { 26750 xhr.onreadystatechange = function() { 26751 26752 // Check readyState before timeout as it changes 26753 if ( xhr.readyState === 4 ) { 26754 26755 // Allow onerror to be called first, 26756 // but that will not handle a native abort 26757 // Also, save errorCallback to a variable 26758 // as xhr.onerror cannot be accessed 26759 window.setTimeout( function() { 26760 if ( callback ) { 26761 errorCallback(); 26762 } 26763 } ); 26764 } 26765 }; 26766 } 26767 26768 // Create the abort callback 26769 callback = callback( "abort" ); 26770 26771 try { 26772 26773 // Do send the request (this may raise an exception) 26774 xhr.send( options.hasContent && options.data || null ); 26775 } catch ( e ) { 26776 26777 // #14683: Only rethrow if this hasn't been notified as an error yet 26778 if ( callback ) { 26779 throw e; 26780 } 26781 } 26782 }, 26783 26784 abort: function() { 26785 if ( callback ) { 26786 callback(); 26787 } 26788 } 26789 }; 26790 } 26791} ); 26792 26793 26794 26795 26796// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) 26797jQuery.ajaxPrefilter( function( s ) { 26798 if ( s.crossDomain ) { 26799 s.contents.script = false; 26800 } 26801} ); 26802 26803// Install script dataType 26804jQuery.ajaxSetup( { 26805 accepts: { 26806 script: "text/javascript, application/javascript, " + 26807 "application/ecmascript, application/x-ecmascript" 26808 }, 26809 contents: { 26810 script: /\b(?:java|ecma)script\b/ 26811 }, 26812 converters: { 26813 "text script": function( text ) { 26814 jQuery.globalEval( text ); 26815 return text; 26816 } 26817 } 26818} ); 26819 26820// Handle cache's special case and crossDomain 26821jQuery.ajaxPrefilter( "script", function( s ) { 26822 if ( s.cache === undefined ) { 26823 s.cache = false; 26824 } 26825 if ( s.crossDomain ) { 26826 s.type = "GET"; 26827 } 26828} ); 26829 26830// Bind script tag hack transport 26831jQuery.ajaxTransport( "script", function( s ) { 26832 26833 // This transport only deals with cross domain or forced-by-attrs requests 26834 if ( s.crossDomain || s.scriptAttrs ) { 26835 var script, callback; 26836 return { 26837 send: function( _, complete ) { 26838 script = jQuery( "<script>" ) 26839 .attr( s.scriptAttrs || {} ) 26840 .prop( { charset: s.scriptCharset, src: s.url } ) 26841 .on( "load error", callback = function( evt ) { 26842 script.remove(); 26843 callback = null; 26844 if ( evt ) { 26845 complete( evt.type === "error" ? 404 : 200, evt.type ); 26846 } 26847 } ); 26848 26849 // Use native DOM manipulation to avoid our domManip AJAX trickery 26850 document.head.appendChild( script[ 0 ] ); 26851 }, 26852 abort: function() { 26853 if ( callback ) { 26854 callback(); 26855 } 26856 } 26857 }; 26858 } 26859} ); 26860 26861 26862 26863 26864var oldCallbacks = [], 26865 rjsonp = /(=)\?(?=&|$)|\?\?/; 26866 26867// Default jsonp settings 26868jQuery.ajaxSetup( { 26869 jsonp: "callback", 26870 jsonpCallback: function() { 26871 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce.guid++ ) ); 26872 this[ callback ] = true; 26873 return callback; 26874 } 26875} ); 26876 26877// Detect, normalize options and install callbacks for jsonp requests 26878jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { 26879 26880 var callbackName, overwritten, responseContainer, 26881 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? 26882 "url" : 26883 typeof s.data === "string" && 26884 ( s.contentType || "" ) 26885 .indexOf( "application/x-www-form-urlencoded" ) === 0 && 26886 rjsonp.test( s.data ) && "data" 26887 ); 26888 26889 // Handle iff the expected data type is "jsonp" or we have a parameter to set 26890 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { 26891 26892 // Get callback name, remembering preexisting value associated with it 26893 callbackName = s.jsonpCallback = isFunction( s.jsonpCallback ) ? 26894 s.jsonpCallback() : 26895 s.jsonpCallback; 26896 26897 // Insert callback into url or form data 26898 if ( jsonProp ) { 26899 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); 26900 } else if ( s.jsonp !== false ) { 26901 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; 26902 } 26903 26904 // Use data converter to retrieve json after script execution 26905 s.converters[ "script json" ] = function() { 26906 if ( !responseContainer ) { 26907 jQuery.error( callbackName + " was not called" ); 26908 } 26909 return responseContainer[ 0 ]; 26910 }; 26911 26912 // Force json dataType 26913 s.dataTypes[ 0 ] = "json"; 26914 26915 // Install callback 26916 overwritten = window[ callbackName ]; 26917 window[ callbackName ] = function() { 26918 responseContainer = arguments; 26919 }; 26920 26921 // Clean-up function (fires after converters) 26922 jqXHR.always( function() { 26923 26924 // If previous value didn't exist - remove it 26925 if ( overwritten === undefined ) { 26926 jQuery( window ).removeProp( callbackName ); 26927 26928 // Otherwise restore preexisting value 26929 } else { 26930 window[ callbackName ] = overwritten; 26931 } 26932 26933 // Save back as free 26934 if ( s[ callbackName ] ) { 26935 26936 // Make sure that re-using the options doesn't screw things around 26937 s.jsonpCallback = originalSettings.jsonpCallback; 26938 26939 // Save the callback name for future use 26940 oldCallbacks.push( callbackName ); 26941 } 26942 26943 // Call if it was a function and we have a response 26944 if ( responseContainer && isFunction( overwritten ) ) { 26945 overwritten( responseContainer[ 0 ] ); 26946 } 26947 26948 responseContainer = overwritten = undefined; 26949 } ); 26950 26951 // Delegate to script 26952 return "script"; 26953 } 26954} ); 26955 26956 26957 26958 26959// Support: Safari 8 only 26960// In Safari 8 documents created via document.implementation.createHTMLDocument 26961// collapse sibling forms: the second one becomes a child of the first one. 26962// Because of that, this security measure has to be disabled in Safari 8. 26963// https://bugs.webkit.org/show_bug.cgi?id=137337 26964support.createHTMLDocument = ( function() { 26965 var body = document.implementation.createHTMLDocument( "" ).body; 26966 body.innerHTML = "<form></form><form></form>"; 26967 return body.childNodes.length === 2; 26968} )(); 26969 26970 26971// Argument "data" should be string of html 26972// context (optional): If specified, the fragment will be created in this context, 26973// defaults to document 26974// keepScripts (optional): If true, will include scripts passed in the html string 26975jQuery.parseHTML = function( data, context, keepScripts ) { 26976 if ( typeof data !== "string" ) { 26977 return []; 26978 } 26979 if ( typeof context === "boolean" ) { 26980 keepScripts = context; 26981 context = false; 26982 } 26983 26984 var base, parsed, scripts; 26985 26986 if ( !context ) { 26987 26988 // Stop scripts or inline event handlers from being executed immediately 26989 // by using document.implementation 26990 if ( support.createHTMLDocument ) { 26991 context = document.implementation.createHTMLDocument( "" ); 26992 26993 // Set the base href for the created document 26994 // so any parsed elements with URLs 26995 // are based on the document's URL (gh-2965) 26996 base = context.createElement( "base" ); 26997 base.href = document.location.href; 26998 context.head.appendChild( base ); 26999 } else { 27000 context = document; 27001 } 27002 } 27003 27004 parsed = rsingleTag.exec( data ); 27005 scripts = !keepScripts && []; 27006 27007 // Single tag 27008 if ( parsed ) { 27009 return [ context.createElement( parsed[ 1 ] ) ]; 27010 } 27011 27012 parsed = buildFragment( [ data ], context, scripts ); 27013 27014 if ( scripts && scripts.length ) { 27015 jQuery( scripts ).remove(); 27016 } 27017 27018 return jQuery.merge( [], parsed.childNodes ); 27019}; 27020 27021 27022/** 27023 * Load a url into a page 27024 */ 27025jQuery.fn.load = function( url, params, callback ) { 27026 var selector, type, response, 27027 self = this, 27028 off = url.indexOf( " " ); 27029 27030 if ( off > -1 ) { 27031 selector = stripAndCollapse( url.slice( off ) ); 27032 url = url.slice( 0, off ); 27033 } 27034 27035 // If it's a function 27036 if ( isFunction( params ) ) { 27037 27038 // We assume that it's the callback 27039 callback = params; 27040 params = undefined; 27041 27042 // Otherwise, build a param string 27043 } else if ( params && typeof params === "object" ) { 27044 type = "POST"; 27045 } 27046 27047 // If we have elements to modify, make the request 27048 if ( self.length > 0 ) { 27049 jQuery.ajax( { 27050 url: url, 27051 27052 // If "type" variable is undefined, then "GET" method will be used. 27053 // Make value of this field explicit since 27054 // user can override it through ajaxSetup method 27055 type: type || "GET", 27056 dataType: "html", 27057 data: params 27058 } ).done( function( responseText ) { 27059 27060 // Save response for use in complete callback 27061 response = arguments; 27062 27063 self.html( selector ? 27064 27065 // If a selector was specified, locate the right elements in a dummy div 27066 // Exclude scripts to avoid IE 'Permission Denied' errors 27067 jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) : 27068 27069 // Otherwise use the full result 27070 responseText ); 27071 27072 // If the request succeeds, this function gets "data", "status", "jqXHR" 27073 // but they are ignored because response was set above. 27074 // If it fails, this function gets "jqXHR", "status", "error" 27075 } ).always( callback && function( jqXHR, status ) { 27076 self.each( function() { 27077 callback.apply( this, response || [ jqXHR.responseText, status, jqXHR ] ); 27078 } ); 27079 } ); 27080 } 27081 27082 return this; 27083}; 27084 27085 27086 27087 27088jQuery.expr.pseudos.animated = function( elem ) { 27089 return jQuery.grep( jQuery.timers, function( fn ) { 27090 return elem === fn.elem; 27091 } ).length; 27092}; 27093 27094 27095 27096 27097jQuery.offset = { 27098 setOffset: function( elem, options, i ) { 27099 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, 27100 position = jQuery.css( elem, "position" ), 27101 curElem = jQuery( elem ), 27102 props = {}; 27103 27104 // Set position first, in-case top/left are set even on static elem 27105 if ( position === "static" ) { 27106 elem.style.position = "relative"; 27107 } 27108 27109 curOffset = curElem.offset(); 27110 curCSSTop = jQuery.css( elem, "top" ); 27111 curCSSLeft = jQuery.css( elem, "left" ); 27112 calculatePosition = ( position === "absolute" || position === "fixed" ) && 27113 ( curCSSTop + curCSSLeft ).indexOf( "auto" ) > -1; 27114 27115 // Need to be able to calculate position if either 27116 // top or left is auto and position is either absolute or fixed 27117 if ( calculatePosition ) { 27118 curPosition = curElem.position(); 27119 curTop = curPosition.top; 27120 curLeft = curPosition.left; 27121 27122 } else { 27123 curTop = parseFloat( curCSSTop ) || 0; 27124 curLeft = parseFloat( curCSSLeft ) || 0; 27125 } 27126 27127 if ( isFunction( options ) ) { 27128 27129 // Use jQuery.extend here to allow modification of coordinates argument (gh-1848) 27130 options = options.call( elem, i, jQuery.extend( {}, curOffset ) ); 27131 } 27132 27133 if ( options.top != null ) { 27134 props.top = ( options.top - curOffset.top ) + curTop; 27135 } 27136 if ( options.left != null ) { 27137 props.left = ( options.left - curOffset.left ) + curLeft; 27138 } 27139 27140 if ( "using" in options ) { 27141 options.using.call( elem, props ); 27142 27143 } else { 27144 curElem.css( props ); 27145 } 27146 } 27147}; 27148 27149jQuery.fn.extend( { 27150 27151 // offset() relates an element's border box to the document origin 27152 offset: function( options ) { 27153 27154 // Preserve chaining for setter 27155 if ( arguments.length ) { 27156 return options === undefined ? 27157 this : 27158 this.each( function( i ) { 27159 jQuery.offset.setOffset( this, options, i ); 27160 } ); 27161 } 27162 27163 var rect, win, 27164 elem = this[ 0 ]; 27165 27166 if ( !elem ) { 27167 return; 27168 } 27169 27170 // Return zeros for disconnected and hidden (display: none) elements (gh-2310) 27171 // Support: IE <=11 only 27172 // Running getBoundingClientRect on a 27173 // disconnected node in IE throws an error 27174 if ( !elem.getClientRects().length ) { 27175 return { top: 0, left: 0 }; 27176 } 27177 27178 // Get document-relative position by adding viewport scroll to viewport-relative gBCR 27179 rect = elem.getBoundingClientRect(); 27180 win = elem.ownerDocument.defaultView; 27181 return { 27182 top: rect.top + win.pageYOffset, 27183 left: rect.left + win.pageXOffset 27184 }; 27185 }, 27186 27187 // position() relates an element's margin box to its offset parent's padding box 27188 // This corresponds to the behavior of CSS absolute positioning 27189 position: function() { 27190 if ( !this[ 0 ] ) { 27191 return; 27192 } 27193 27194 var offsetParent, offset, doc, 27195 elem = this[ 0 ], 27196 parentOffset = { top: 0, left: 0 }; 27197 27198 // position:fixed elements are offset from the viewport, which itself always has zero offset 27199 if ( jQuery.css( elem, "position" ) === "fixed" ) { 27200 27201 // Assume position:fixed implies availability of getBoundingClientRect 27202 offset = elem.getBoundingClientRect(); 27203 27204 } else { 27205 offset = this.offset(); 27206 27207 // Account for the *real* offset parent, which can be the document or its root element 27208 // when a statically positioned element is identified 27209 doc = elem.ownerDocument; 27210 offsetParent = elem.offsetParent || doc.documentElement; 27211 while ( offsetParent && 27212 ( offsetParent === doc.body || offsetParent === doc.documentElement ) && 27213 jQuery.css( offsetParent, "position" ) === "static" ) { 27214 27215 offsetParent = offsetParent.parentNode; 27216 } 27217 if ( offsetParent && offsetParent !== elem && offsetParent.nodeType === 1 ) { 27218 27219 // Incorporate borders into its offset, since they are outside its content origin 27220 parentOffset = jQuery( offsetParent ).offset(); 27221 parentOffset.top += jQuery.css( offsetParent, "borderTopWidth", true ); 27222 parentOffset.left += jQuery.css( offsetParent, "borderLeftWidth", true ); 27223 } 27224 } 27225 27226 // Subtract parent offsets and element margins 27227 return { 27228 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), 27229 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true ) 27230 }; 27231 }, 27232 27233 // This method will return documentElement in the following cases: 27234 // 1) For the element inside the iframe without offsetParent, this method will return 27235 // documentElement of the parent window 27236 // 2) For the hidden or detached element 27237 // 3) For body or html element, i.e. in case of the html node - it will return itself 27238 // 27239 // but those exceptions were never presented as a real life use-cases 27240 // and might be considered as more preferable results. 27241 // 27242 // This logic, however, is not guaranteed and can change at any point in the future 27243 offsetParent: function() { 27244 return this.map( function() { 27245 var offsetParent = this.offsetParent; 27246 27247 while ( offsetParent && jQuery.css( offsetParent, "position" ) === "static" ) { 27248 offsetParent = offsetParent.offsetParent; 27249 } 27250 27251 return offsetParent || documentElement; 27252 } ); 27253 } 27254} ); 27255 27256// Create scrollLeft and scrollTop methods 27257jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { 27258 var top = "pageYOffset" === prop; 27259 27260 jQuery.fn[ method ] = function( val ) { 27261 return access( this, function( elem, method, val ) { 27262 27263 // Coalesce documents and windows 27264 var win; 27265 if ( isWindow( elem ) ) { 27266 win = elem; 27267 } else if ( elem.nodeType === 9 ) { 27268 win = elem.defaultView; 27269 } 27270 27271 if ( val === undefined ) { 27272 return win ? win[ prop ] : elem[ method ]; 27273 } 27274 27275 if ( win ) { 27276 win.scrollTo( 27277 !top ? val : win.pageXOffset, 27278 top ? val : win.pageYOffset 27279 ); 27280 27281 } else { 27282 elem[ method ] = val; 27283 } 27284 }, method, val, arguments.length ); 27285 }; 27286} ); 27287 27288// Support: Safari <=7 - 9.1, Chrome <=37 - 49 27289// Add the top/left cssHooks using jQuery.fn.position 27290// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 27291// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347 27292// getComputedStyle returns percent when specified for top/left/bottom/right; 27293// rather than make the css module depend on the offset module, just check for it here 27294jQuery.each( [ "top", "left" ], function( _i, prop ) { 27295 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, 27296 function( elem, computed ) { 27297 if ( computed ) { 27298 computed = curCSS( elem, prop ); 27299 27300 // If curCSS returns percentage, fallback to offset 27301 return rnumnonpx.test( computed ) ? 27302 jQuery( elem ).position()[ prop ] + "px" : 27303 computed; 27304 } 27305 } 27306 ); 27307} ); 27308 27309 27310// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods 27311jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { 27312 jQuery.each( { 27313 padding: "inner" + name, 27314 content: type, 27315 "": "outer" + name 27316 }, function( defaultExtra, funcName ) { 27317 27318 // Margin is only for outerHeight, outerWidth 27319 jQuery.fn[ funcName ] = function( margin, value ) { 27320 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), 27321 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); 27322 27323 return access( this, function( elem, type, value ) { 27324 var doc; 27325 27326 if ( isWindow( elem ) ) { 27327 27328 // $( window ).outerWidth/Height return w/h including scrollbars (gh-1729) 27329 return funcName.indexOf( "outer" ) === 0 ? 27330 elem[ "inner" + name ] : 27331 elem.document.documentElement[ "client" + name ]; 27332 } 27333 27334 // Get document width or height 27335 if ( elem.nodeType === 9 ) { 27336 doc = elem.documentElement; 27337 27338 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], 27339 // whichever is greatest 27340 return Math.max( 27341 elem.body[ "scroll" + name ], doc[ "scroll" + name ], 27342 elem.body[ "offset" + name ], doc[ "offset" + name ], 27343 doc[ "client" + name ] 27344 ); 27345 } 27346 27347 return value === undefined ? 27348 27349 // Get width or height on the element, requesting but not forcing parseFloat 27350 jQuery.css( elem, type, extra ) : 27351 27352 // Set width or height on the element 27353 jQuery.style( elem, type, value, extra ); 27354 }, type, chainable ? margin : undefined, chainable ); 27355 }; 27356 } ); 27357} ); 27358 27359 27360jQuery.each( [ 27361 "ajaxStart", 27362 "ajaxStop", 27363 "ajaxComplete", 27364 "ajaxError", 27365 "ajaxSuccess", 27366 "ajaxSend" 27367], function( _i, type ) { 27368 jQuery.fn[ type ] = function( fn ) { 27369 return this.on( type, fn ); 27370 }; 27371} ); 27372 27373 27374 27375 27376jQuery.fn.extend( { 27377 27378 bind: function( types, data, fn ) { 27379 return this.on( types, null, data, fn ); 27380 }, 27381 unbind: function( types, fn ) { 27382 return this.off( types, null, fn ); 27383 }, 27384 27385 delegate: function( selector, types, data, fn ) { 27386 return this.on( types, selector, data, fn ); 27387 }, 27388 undelegate: function( selector, types, fn ) { 27389 27390 // ( namespace ) or ( selector, types [, fn] ) 27391 return arguments.length === 1 ? 27392 this.off( selector, "**" ) : 27393 this.off( types, selector || "**", fn ); 27394 }, 27395 27396 hover: function( fnOver, fnOut ) { 27397 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); 27398 } 27399} ); 27400 27401jQuery.each( 27402 ( "blur focus focusin focusout resize scroll click dblclick " + 27403 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + 27404 "change select submit keydown keypress keyup contextmenu" ).split( " " ), 27405 function( _i, name ) { 27406 27407 // Handle event binding 27408 jQuery.fn[ name ] = function( data, fn ) { 27409 return arguments.length > 0 ? 27410 this.on( name, null, data, fn ) : 27411 this.trigger( name ); 27412 }; 27413 } 27414); 27415 27416 27417 27418 27419// Support: Android <=4.0 only 27420// Make sure we trim BOM and NBSP 27421var rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g; 27422 27423// Bind a function to a context, optionally partially applying any 27424// arguments. 27425// jQuery.proxy is deprecated to promote standards (specifically Function#bind) 27426// However, it is not slated for removal any time soon 27427jQuery.proxy = function( fn, context ) { 27428 var tmp, args, proxy; 27429 27430 if ( typeof context === "string" ) { 27431 tmp = fn[ context ]; 27432 context = fn; 27433 fn = tmp; 27434 } 27435 27436 // Quick check to determine if target is callable, in the spec 27437 // this throws a TypeError, but we will just return undefined. 27438 if ( !isFunction( fn ) ) { 27439 return undefined; 27440 } 27441 27442 // Simulated bind 27443 args = slice.call( arguments, 2 ); 27444 proxy = function() { 27445 return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); 27446 }; 27447 27448 // Set the guid of unique handler to the same of original handler, so it can be removed 27449 proxy.guid = fn.guid = fn.guid || jQuery.guid++; 27450 27451 return proxy; 27452}; 27453 27454jQuery.holdReady = function( hold ) { 27455 if ( hold ) { 27456 jQuery.readyWait++; 27457 } else { 27458 jQuery.ready( true ); 27459 } 27460}; 27461jQuery.isArray = Array.isArray; 27462jQuery.parseJSON = JSON.parse; 27463jQuery.nodeName = nodeName; 27464jQuery.isFunction = isFunction; 27465jQuery.isWindow = isWindow; 27466jQuery.camelCase = camelCase; 27467jQuery.type = toType; 27468 27469jQuery.now = Date.now; 27470 27471jQuery.isNumeric = function( obj ) { 27472 27473 // As of jQuery 3.0, isNumeric is limited to 27474 // strings and numbers (primitives or objects) 27475 // that can be coerced to finite numbers (gh-2662) 27476 var type = jQuery.type( obj ); 27477 return ( type === "number" || type === "string" ) && 27478 27479 // parseFloat NaNs numeric-cast false positives ("") 27480 // ...but misinterprets leading-number strings, particularly hex literals ("0x...") 27481 // subtraction forces infinities to NaN 27482 !isNaN( obj - parseFloat( obj ) ); 27483}; 27484 27485jQuery.trim = function( text ) { 27486 return text == null ? 27487 "" : 27488 ( text + "" ).replace( rtrim, "" ); 27489}; 27490 27491 27492 27493// Register as a named AMD module, since jQuery can be concatenated with other 27494// files that may use define, but not via a proper concatenation script that 27495// understands anonymous AMD modules. A named AMD is safest and most robust 27496// way to register. Lowercase jquery is used because AMD module names are 27497// derived from file names, and jQuery is normally delivered in a lowercase 27498// file name. Do this after creating the global so that if an AMD module wants 27499// to call noConflict to hide this version of jQuery, it will work. 27500 27501// Note that for maximum portability, libraries that are not jQuery should 27502// declare themselves as anonymous modules, and avoid setting a global if an 27503// AMD loader is present. jQuery is a special case. For more information, see 27504// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon 27505 27506if ( true ) { 27507 !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = (function() { 27508 return jQuery; 27509 }).apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), 27510 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 27511} 27512 27513 27514 27515 27516var 27517 27518 // Map over jQuery in case of overwrite 27519 _jQuery = window.jQuery, 27520 27521 // Map over the $ in case of overwrite 27522 _$ = window.$; 27523 27524jQuery.noConflict = function( deep ) { 27525 if ( window.$ === jQuery ) { 27526 window.$ = _$; 27527 } 27528 27529 if ( deep && window.jQuery === jQuery ) { 27530 window.jQuery = _jQuery; 27531 } 27532 27533 return jQuery; 27534}; 27535 27536// Expose jQuery and $ identifiers, even in AMD 27537// (#7102#comment:10, https://github.com/jquery/jquery/pull/557) 27538// and CommonJS for browser emulators (#13566) 27539if ( typeof noGlobal === "undefined" ) { 27540 window.jQuery = window.$ = jQuery; 27541} 27542 27543 27544 27545 27546return jQuery; 27547} ); 27548 27549 27550/***/ }), 27551
vendor: 544,602 bytes, lines 27552-44764
27552/***/ "./node_modules/lodash/lodash.js": 27553/*!***************************************!*\ 27554 !*** ./node_modules/lodash/lodash.js ***! 27555 \***************************************/ 27556/*! no static exports found */ 27557/***/ (function(module, exports, __webpack_require__) { 27558 27559/* WEBPACK VAR INJECTION */(function(global, module) {var __WEBPACK_AMD_DEFINE_RESULT__;/** 27560 * @license 27561 * Lodash <https://lodash.com/> 27562 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 27563 * Released under MIT license <https://lodash.com/license> 27564 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 27565 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 27566 */ 27567;(function() { 27568 27569 /** Used as a safe reference for `undefined` in pre-ES5 environments. */ 27570 var undefined; 27571 27572 /** Used as the semantic version number. */ 27573 var VERSION = '4.17.21'; 27574 27575 /** Used as the size to enable large array optimizations. */ 27576 var LARGE_ARRAY_SIZE = 200; 27577 27578 /** Error message constants. */ 27579 var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://npms.io/search?q=ponyfill.', 27580 FUNC_ERROR_TEXT = 'Expected a function', 27581 INVALID_TEMPL_VAR_ERROR_TEXT = 'Invalid `variable` option passed into `_.template`'; 27582 27583 /** Used to stand-in for `undefined` hash values. */ 27584 var HASH_UNDEFINED = '__lodash_hash_undefined__'; 27585 27586 /** Used as the maximum memoize cache size. */ 27587 var MAX_MEMOIZE_SIZE = 500; 27588 27589 /** Used as the internal argument placeholder. */ 27590 var PLACEHOLDER = '__lodash_placeholder__'; 27591 27592 /** Used to compose bitmasks for cloning. */ 27593 var CLONE_DEEP_FLAG = 1, 27594 CLONE_FLAT_FLAG = 2, 27595 CLONE_SYMBOLS_FLAG = 4; 27596 27597 /** Used to compose bitmasks for value comparisons. */ 27598 var COMPARE_PARTIAL_FLAG = 1, 27599 COMPARE_UNORDERED_FLAG = 2; 27600 27601 /** Used to compose bitmasks for function metadata. */ 27602 var WRAP_BIND_FLAG = 1, 27603 WRAP_BIND_KEY_FLAG = 2, 27604 WRAP_CURRY_BOUND_FLAG = 4, 27605 WRAP_CURRY_FLAG = 8, 27606 WRAP_CURRY_RIGHT_FLAG = 16, 27607 WRAP_PARTIAL_FLAG = 32, 27608 WRAP_PARTIAL_RIGHT_FLAG = 64, 27609 WRAP_ARY_FLAG = 128, 27610 WRAP_REARG_FLAG = 256, 27611 WRAP_FLIP_FLAG = 512; 27612 27613 /** Used as default options for `_.truncate`. */ 27614 var DEFAULT_TRUNC_LENGTH = 30, 27615 DEFAULT_TRUNC_OMISSION = '...'; 27616 27617 /** Used to detect hot functions by number of calls within a span of milliseconds. */ 27618 var HOT_COUNT = 800, 27619 HOT_SPAN = 16; 27620 27621 /** Used to indicate the type of lazy iteratees. */ 27622 var LAZY_FILTER_FLAG = 1, 27623 LAZY_MAP_FLAG = 2, 27624 LAZY_WHILE_FLAG = 3; 27625 27626 /** Used as references for various `Number` constants. */ 27627 var INFINITY = 1 / 0, 27628 MAX_SAFE_INTEGER = 9007199254740991, 27629 MAX_INTEGER = 1.7976931348623157e+308, 27630 NAN = 0 / 0; 27631 27632 /** Used as references for the maximum length and index of an array. */ 27633 var MAX_ARRAY_LENGTH = 4294967295, 27634 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, 27635 HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 27636 27637 /** Used to associate wrap methods with their bit flags. */ 27638 var wrapFlags = [ 27639 ['ary', WRAP_ARY_FLAG], 27640 ['bind', WRAP_BIND_FLAG], 27641 ['bindKey', WRAP_BIND_KEY_FLAG], 27642 ['curry', WRAP_CURRY_FLAG], 27643 ['curryRight', WRAP_CURRY_RIGHT_FLAG], 27644 ['flip', WRAP_FLIP_FLAG], 27645 ['partial', WRAP_PARTIAL_FLAG], 27646 ['partialRight', WRAP_PARTIAL_RIGHT_FLAG], 27647 ['rearg', WRAP_REARG_FLAG] 27648 ]; 27649 27650 /** `Object#toString` result references. */ 27651 var argsTag = '[object Arguments]', 27652 arrayTag = '[object Array]', 27653 asyncTag = '[object AsyncFunction]', 27654 boolTag = '[object Boolean]', 27655 dateTag = '[object Date]', 27656 domExcTag = '[object DOMException]', 27657 errorTag = '[object Error]', 27658 funcTag = '[object Function]', 27659 genTag = '[object GeneratorFunction]', 27660 mapTag = '[object Map]', 27661 numberTag = '[object Number]', 27662 nullTag = '[object Null]', 27663 objectTag = '[object Object]', 27664 promiseTag = '[object Promise]', 27665 proxyTag = '[object Proxy]', 27666 regexpTag = '[object RegExp]', 27667 setTag = '[object Set]', 27668 stringTag = '[object String]', 27669 symbolTag = '[object Symbol]', 27670 undefinedTag = '[object Undefined]', 27671 weakMapTag = '[object WeakMap]', 27672 weakSetTag = '[object WeakSet]'; 27673 27674 var arrayBufferTag = '[object ArrayBuffer]', 27675 dataViewTag = '[object DataView]', 27676 float32Tag = '[object Float32Array]', 27677 float64Tag = '[object Float64Array]', 27678 int8Tag = '[object Int8Array]', 27679 int16Tag = '[object Int16Array]', 27680 int32Tag = '[object Int32Array]', 27681 uint8Tag = '[object Uint8Array]', 27682 uint8ClampedTag = '[object Uint8ClampedArray]', 27683 uint16Tag = '[object Uint16Array]', 27684 uint32Tag = '[object Uint32Array]'; 27685 27686 /** Used to match empty string literals in compiled template source. */ 27687 var reEmptyStringLeading = /\b__p \+= '';/g, 27688 reEmptyStringMiddle = /\b(__p \+=) '' \+/g, 27689 reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 27690 27691 /** Used to match HTML entities and HTML characters. */ 27692 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, 27693 reUnescapedHtml = /[&<>"']/g, 27694 reHasEscapedHtml = RegExp(reEscapedHtml.source), 27695 reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 27696 27697 /** Used to match template delimiters. */ 27698 var reEscape = /<%-([\s\S]+?)%>/g, 27699 reEvaluate = /<%([\s\S]+?)%>/g, 27700 reInterpolate = /<%=([\s\S]+?)%>/g; 27701 27702 /** Used to match property names within property paths. */ 27703 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, 27704 reIsPlainProp = /^\w*$/, 27705 rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 27706 27707 /** 27708 * Used to match `RegExp` 27709 * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). 27710 */ 27711 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, 27712 reHasRegExpChar = RegExp(reRegExpChar.source); 27713 27714 /** Used to match leading whitespace. */ 27715 var reTrimStart = /^\s+/; 27716 27717 /** Used to match a single whitespace character. */ 27718 var reWhitespace = /\s/; 27719 27720 /** Used to match wrap detail comments. */ 27721 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, 27722 reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, 27723 reSplitDetails = /,? & /; 27724 27725 /** Used to match words composed of alphanumeric characters. */ 27726 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 27727 27728 /** 27729 * Used to validate the `validate` option in `_.template` variable. 27730 * 27731 * Forbids characters which could potentially change the meaning of the function argument definition: 27732 * - "()," (modification of function parameters) 27733 * - "=" (default value) 27734 * - "[]{}" (destructuring of function parameters) 27735 * - "/" (beginning of a comment) 27736 * - whitespace 27737 */ 27738 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; 27739 27740 /** Used to match backslashes in property paths. */ 27741 var reEscapeChar = /\\(\\)?/g; 27742 27743 /** 27744 * Used to match 27745 * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). 27746 */ 27747 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 27748 27749 /** Used to match `RegExp` flags from their coerced string values. */ 27750 var reFlags = /\w*$/; 27751 27752 /** Used to detect bad signed hexadecimal string values. */ 27753 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 27754 27755 /** Used to detect binary string values. */ 27756 var reIsBinary = /^0b[01]+$/i; 27757 27758 /** Used to detect host constructors (Safari). */ 27759 var reIsHostCtor = /^\[object .+?Constructor\]$/; 27760 27761 /** Used to detect octal string values. */ 27762 var reIsOctal = /^0o[0-7]+$/i; 27763 27764 /** Used to detect unsigned integer values. */ 27765 var reIsUint = /^(?:0|[1-9]\d*)$/; 27766 27767 /** Used to match Latin Unicode letters (excluding mathematical operators). */ 27768 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 27769 27770 /** Used to ensure capturing order of template delimiters. */ 27771 var reNoMatch = /($^)/; 27772 27773 /** Used to match unescaped characters in compiled string literals. */ 27774 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 27775 27776 /** Used to compose unicode character classes. */ 27777 var rsAstralRange = '\\ud800-\\udfff', 27778 rsComboMarksRange = '\\u0300-\\u036f', 27779 reComboHalfMarksRange = '\\ufe20-\\ufe2f', 27780 rsComboSymbolsRange = '\\u20d0-\\u20ff', 27781 rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, 27782 rsDingbatRange = '\\u2700-\\u27bf', 27783 rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', 27784 rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', 27785 rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', 27786 rsPunctuationRange = '\\u2000-\\u206f', 27787 rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', 27788 rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', 27789 rsVarRange = '\\ufe0e\\ufe0f', 27790 rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 27791 27792 /** Used to compose unicode capture groups. */ 27793 var rsApos = "['\u2019]", 27794 rsAstral = '[' + rsAstralRange + ']', 27795 rsBreak = '[' + rsBreakRange + ']', 27796 rsCombo = '[' + rsComboRange + ']', 27797 rsDigits = '\\d+', 27798 rsDingbat = '[' + rsDingbatRange + ']', 27799 rsLower = '[' + rsLowerRange + ']', 27800 rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', 27801 rsFitz = '\\ud83c[\\udffb-\\udfff]', 27802 rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', 27803 rsNonAstral = '[^' + rsAstralRange + ']', 27804 rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', 27805 rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', 27806 rsUpper = '[' + rsUpperRange + ']', 27807 rsZWJ = '\\u200d'; 27808 27809 /** Used to compose unicode regexes. */ 27810 var rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')', 27811 rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')', 27812 rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?', 27813 rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?', 27814 reOptMod = rsModifier + '?', 27815 rsOptVar = '[' + rsVarRange + ']?', 27816 rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', 27817 rsOrdLower = '\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])', 27818 rsOrdUpper = '\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])', 27819 rsSeq = rsOptVar + reOptMod + rsOptJoin, 27820 rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, 27821 rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; 27822 27823 /** Used to match apostrophes. */ 27824 var reApos = RegExp(rsApos, 'g'); 27825 27826 /** 27827 * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and 27828 * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). 27829 */ 27830 var reComboMark = RegExp(rsCombo, 'g'); 27831 27832 /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ 27833 var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); 27834 27835 /** Used to match complex or compound words. */ 27836 var reUnicodeWord = RegExp([ 27837 rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', 27838 rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')', 27839 rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower, 27840 rsUpper + '+' + rsOptContrUpper, 27841 rsOrdUpper, 27842 rsOrdLower, 27843 rsDigits, 27844 rsEmoji 27845 ].join('|'), 'g'); 27846 27847 /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ 27848 var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']'); 27849 27850 /** Used to detect strings that need a more robust regexp to match words. */ 27851 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; 27852 27853 /** Used to assign default `context` object properties. */ 27854 var contextProps = [ 27855 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 27856 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', 27857 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', 27858 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', 27859 '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' 27860 ]; 27861 27862 /** Used to make template sourceURLs easier to identify. */ 27863 var templateCounter = -1; 27864 27865 /** Used to identify `toStringTag` values of typed arrays. */ 27866 var typedArrayTags = {}; 27867 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = 27868 typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = 27869 typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = 27870 typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = 27871 typedArrayTags[uint32Tag] = true; 27872 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = 27873 typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = 27874 typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = 27875 typedArrayTags[errorTag] = typedArrayTags[funcTag] = 27876 typedArrayTags[mapTag] = typedArrayTags[numberTag] = 27877 typedArrayTags[objectTag] = typedArrayTags[regexpTag] = 27878 typedArrayTags[setTag] = typedArrayTags[stringTag] = 27879 typedArrayTags[weakMapTag] = false; 27880 27881 /** Used to identify `toStringTag` values supported by `_.clone`. */ 27882 var cloneableTags = {}; 27883 cloneableTags[argsTag] = cloneableTags[arrayTag] = 27884 cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = 27885 cloneableTags[boolTag] = cloneableTags[dateTag] = 27886 cloneableTags[float32Tag] = cloneableTags[float64Tag] = 27887 cloneableTags[int8Tag] = cloneableTags[int16Tag] = 27888 cloneableTags[int32Tag] = cloneableTags[mapTag] = 27889 cloneableTags[numberTag] = cloneableTags[objectTag] = 27890 cloneableTags[regexpTag] = cloneableTags[setTag] = 27891 cloneableTags[stringTag] = cloneableTags[symbolTag] = 27892 cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = 27893 cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 27894 cloneableTags[errorTag] = cloneableTags[funcTag] = 27895 cloneableTags[weakMapTag] = false; 27896 27897 /** Used to map Latin Unicode letters to basic Latin letters. */ 27898 var deburredLetters = { 27899 // Latin-1 Supplement block. 27900 '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', 27901 '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', 27902 '\xc7': 'C', '\xe7': 'c', 27903 '\xd0': 'D', '\xf0': 'd', 27904 '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', 27905 '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', 27906 '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', 27907 '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', 27908 '\xd1': 'N', '\xf1': 'n', 27909 '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', 27910 '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', 27911 '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', 27912 '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', 27913 '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', 27914 '\xc6': 'Ae', '\xe6': 'ae', 27915 '\xde': 'Th', '\xfe': 'th', 27916 '\xdf': 'ss', 27917 // Latin Extended-A block. 27918 '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', 27919 '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', 27920 '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', 27921 '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', 27922 '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', 27923 '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', 27924 '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', 27925 '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', 27926 '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', 27927 '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', 27928 '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', 27929 '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', 27930 '\u0134': 'J', '\u0135': 'j', 27931 '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', 27932 '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', 27933 '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', 27934 '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', 27935 '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', 27936 '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', 27937 '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', 27938 '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', 27939 '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', 27940 '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', 27941 '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', 27942 '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', 27943 '\u0163': 't', '\u0165': 't', '\u0167': 't', 27944 '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', 27945 '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', 27946 '\u0174': 'W', '\u0175': 'w', 27947 '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', 27948 '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', 27949 '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', 27950 '\u0132': 'IJ', '\u0133': 'ij', 27951 '\u0152': 'Oe', '\u0153': 'oe', 27952 '\u0149': "'n", '\u017f': 's' 27953 }; 27954 27955 /** Used to map characters to HTML entities. */ 27956 var htmlEscapes = { 27957 '&': '&', 27958 '<': '<', 27959 '>': '>', 27960 '"': '"', 27961 "'": ''' 27962 }; 27963 27964 /** Used to map HTML entities to characters. */ 27965 var htmlUnescapes = { 27966 '&': '&', 27967 '<': '<', 27968 '>': '>', 27969 '"': '"', 27970 ''': "'" 27971 }; 27972 27973 /** Used to escape characters for inclusion in compiled string literals. */ 27974 var stringEscapes = { 27975 '\\': '\\', 27976 "'": "'", 27977 '\n': 'n', 27978 '\r': 'r', 27979 '\u2028': 'u2028', 27980 '\u2029': 'u2029' 27981 }; 27982 27983 /** Built-in method references without a dependency on `root`. */ 27984 var freeParseFloat = parseFloat, 27985 freeParseInt = parseInt; 27986 27987 /** Detect free variable `global` from Node.js. */ 27988 var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; 27989 27990 /** Detect free variable `self`. */ 27991 var freeSelf = typeof self == 'object' && self && self.Object === Object && self; 27992 27993 /** Used as a reference to the global object. */ 27994 var root = freeGlobal || freeSelf || Function('return this')(); 27995 27996 /** Detect free variable `exports`. */ 27997 var freeExports = true && exports && !exports.nodeType && exports; 27998 27999 /** Detect free variable `module`. */ 28000 var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; 28001 28002 /** Detect the popular CommonJS extension `module.exports`. */ 28003 var moduleExports = freeModule && freeModule.exports === freeExports; 28004 28005 /** Detect free variable `process` from Node.js. */ 28006 var freeProcess = moduleExports && freeGlobal.process; 28007 28008 /** Used to access faster Node.js helpers. */ 28009 var nodeUtil = (function() { 28010 try { 28011 // Use `util.types` for Node.js 10+. 28012 var types = freeModule && freeModule.require && freeModule.require('util').types; 28013 28014 if (types) { 28015 return types; 28016 } 28017 28018 // Legacy `process.binding('util')` for Node.js < 10. 28019 return freeProcess && freeProcess.binding && freeProcess.binding('util'); 28020 } catch (e) {} 28021 }()); 28022 28023 /* Node.js helper references. */ 28024 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, 28025 nodeIsDate = nodeUtil && nodeUtil.isDate, 28026 nodeIsMap = nodeUtil && nodeUtil.isMap, 28027 nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, 28028 nodeIsSet = nodeUtil && nodeUtil.isSet, 28029 nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 28030 28031 /*--------------------------------------------------------------------------*/ 28032 28033 /** 28034 * A faster alternative to `Function#apply`, this function invokes `func` 28035 * with the `this` binding of `thisArg` and the arguments of `args`. 28036 * 28037 * @private 28038 * @param {Function} func The function to invoke. 28039 * @param {*} thisArg The `this` binding of `func`. 28040 * @param {Array} args The arguments to invoke `func` with. 28041 * @returns {*} Returns the result of `func`. 28042 */ 28043 function apply(func, thisArg, args) { 28044 switch (args.length) { 28045 case 0: return func.call(thisArg); 28046 case 1: return func.call(thisArg, args[0]); 28047 case 2: return func.call(thisArg, args[0], args[1]); 28048 case 3: return func.call(thisArg, args[0], args[1], args[2]); 28049 } 28050 return func.apply(thisArg, args); 28051 } 28052 28053 /** 28054 * A specialized version of `baseAggregator` for arrays. 28055 * 28056 * @private 28057 * @param {Array} [array] The array to iterate over. 28058 * @param {Function} setter The function to set `accumulator` values. 28059 * @param {Function} iteratee The iteratee to transform keys. 28060 * @param {Object} accumulator The initial aggregated object. 28061 * @returns {Function} Returns `accumulator`. 28062 */ 28063 function arrayAggregator(array, setter, iteratee, accumulator) { 28064 var index = -1, 28065 length = array == null ? 0 : array.length; 28066 28067 while (++index < length) { 28068 var value = array[index]; 28069 setter(accumulator, value, iteratee(value), array); 28070 } 28071 return accumulator; 28072 } 28073 28074 /** 28075 * A specialized version of `_.forEach` for arrays without support for 28076 * iteratee shorthands. 28077 * 28078 * @private 28079 * @param {Array} [array] The array to iterate over. 28080 * @param {Function} iteratee The function invoked per iteration. 28081 * @returns {Array} Returns `array`. 28082 */ 28083 function arrayEach(array, iteratee) { 28084 var index = -1, 28085 length = array == null ? 0 : array.length; 28086 28087 while (++index < length) { 28088 if (iteratee(array[index], index, array) === false) { 28089 break; 28090 } 28091 } 28092 return array; 28093 } 28094 28095 /** 28096 * A specialized version of `_.forEachRight` for arrays without support for 28097 * iteratee shorthands. 28098 * 28099 * @private 28100 * @param {Array} [array] The array to iterate over. 28101 * @param {Function} iteratee The function invoked per iteration. 28102 * @returns {Array} Returns `array`. 28103 */ 28104 function arrayEachRight(array, iteratee) { 28105 var length = array == null ? 0 : array.length; 28106 28107 while (length--) { 28108 if (iteratee(array[length], length, array) === false) { 28109 break; 28110 } 28111 } 28112 return array; 28113 } 28114 28115 /** 28116 * A specialized version of `_.every` for arrays without support for 28117 * iteratee shorthands. 28118 * 28119 * @private 28120 * @param {Array} [array] The array to iterate over. 28121 * @param {Function} predicate The function invoked per iteration. 28122 * @returns {boolean} Returns `true` if all elements pass the predicate check, 28123 * else `false`. 28124 */ 28125 function arrayEvery(array, predicate) { 28126 var index = -1, 28127 length = array == null ? 0 : array.length; 28128 28129 while (++index < length) { 28130 if (!predicate(array[index], index, array)) { 28131 return false; 28132 } 28133 } 28134 return true; 28135 } 28136 28137 /** 28138 * A specialized version of `_.filter` for arrays without support for 28139 * iteratee shorthands. 28140 * 28141 * @private 28142 * @param {Array} [array] The array to iterate over. 28143 * @param {Function} predicate The function invoked per iteration. 28144 * @returns {Array} Returns the new filtered array. 28145 */ 28146 function arrayFilter(array, predicate) { 28147 var index = -1, 28148 length = array == null ? 0 : array.length, 28149 resIndex = 0, 28150 result = []; 28151 28152 while (++index < length) { 28153 var value = array[index]; 28154 if (predicate(value, index, array)) { 28155 result[resIndex++] = value; 28156 } 28157 } 28158 return result; 28159 } 28160 28161 /** 28162 * A specialized version of `_.includes` for arrays without support for 28163 * specifying an index to search from. 28164 * 28165 * @private 28166 * @param {Array} [array] The array to inspect. 28167 * @param {*} target The value to search for. 28168 * @returns {boolean} Returns `true` if `target` is found, else `false`. 28169 */ 28170 function arrayIncludes(array, value) { 28171 var length = array == null ? 0 : array.length; 28172 return !!length && baseIndexOf(array, value, 0) > -1; 28173 } 28174 28175 /** 28176 * This function is like `arrayIncludes` except that it accepts a comparator. 28177 * 28178 * @private 28179 * @param {Array} [array] The array to inspect. 28180 * @param {*} target The value to search for. 28181 * @param {Function} comparator The comparator invoked per element. 28182 * @returns {boolean} Returns `true` if `target` is found, else `false`. 28183 */ 28184 function arrayIncludesWith(array, value, comparator) { 28185 var index = -1, 28186 length = array == null ? 0 : array.length; 28187 28188 while (++index < length) { 28189 if (comparator(value, array[index])) { 28190 return true; 28191 } 28192 } 28193 return false; 28194 } 28195 28196 /** 28197 * A specialized version of `_.map` for arrays without support for iteratee 28198 * shorthands. 28199 * 28200 * @private 28201 * @param {Array} [array] The array to iterate over. 28202 * @param {Function} iteratee The function invoked per iteration. 28203 * @returns {Array} Returns the new mapped array. 28204 */ 28205 function arrayMap(array, iteratee) { 28206 var index = -1, 28207 length = array == null ? 0 : array.length, 28208 result = Array(length); 28209 28210 while (++index < length) { 28211 result[index] = iteratee(array[index], index, array); 28212 } 28213 return result; 28214 } 28215 28216 /** 28217 * Appends the elements of `values` to `array`. 28218 * 28219 * @private 28220 * @param {Array} array The array to modify. 28221 * @param {Array} values The values to append. 28222 * @returns {Array} Returns `array`. 28223 */ 28224 function arrayPush(array, values) { 28225 var index = -1, 28226 length = values.length, 28227 offset = array.length; 28228 28229 while (++index < length) { 28230 array[offset + index] = values[index]; 28231 } 28232 return array; 28233 } 28234 28235 /** 28236 * A specialized version of `_.reduce` for arrays without support for 28237 * iteratee shorthands. 28238 * 28239 * @private 28240 * @param {Array} [array] The array to iterate over. 28241 * @param {Function} iteratee The function invoked per iteration. 28242 * @param {*} [accumulator] The initial value. 28243 * @param {boolean} [initAccum] Specify using the first element of `array` as 28244 * the initial value. 28245 * @returns {*} Returns the accumulated value. 28246 */ 28247 function arrayReduce(array, iteratee, accumulator, initAccum) { 28248 var index = -1, 28249 length = array == null ? 0 : array.length; 28250 28251 if (initAccum && length) { 28252 accumulator = array[++index]; 28253 } 28254 while (++index < length) { 28255 accumulator = iteratee(accumulator, array[index], index, array); 28256 } 28257 return accumulator; 28258 } 28259 28260 /** 28261 * A specialized version of `_.reduceRight` for arrays without support for 28262 * iteratee shorthands. 28263 * 28264 * @private 28265 * @param {Array} [array] The array to iterate over. 28266 * @param {Function} iteratee The function invoked per iteration. 28267 * @param {*} [accumulator] The initial value. 28268 * @param {boolean} [initAccum] Specify using the last element of `array` as 28269 * the initial value. 28270 * @returns {*} Returns the accumulated value. 28271 */ 28272 function arrayReduceRight(array, iteratee, accumulator, initAccum) { 28273 var length = array == null ? 0 : array.length; 28274 if (initAccum && length) { 28275 accumulator = array[--length]; 28276 } 28277 while (length--) { 28278 accumulator = iteratee(accumulator, array[length], length, array); 28279 } 28280 return accumulator; 28281 } 28282 28283 /** 28284 * A specialized version of `_.some` for arrays without support for iteratee 28285 * shorthands. 28286 * 28287 * @private 28288 * @param {Array} [array] The array to iterate over. 28289 * @param {Function} predicate The function invoked per iteration. 28290 * @returns {boolean} Returns `true` if any element passes the predicate check, 28291 * else `false`. 28292 */ 28293 function arraySome(array, predicate) { 28294 var index = -1, 28295 length = array == null ? 0 : array.length; 28296 28297 while (++index < length) { 28298 if (predicate(array[index], index, array)) { 28299 return true; 28300 } 28301 } 28302 return false; 28303 } 28304 28305 /** 28306 * Gets the size of an ASCII `string`. 28307 * 28308 * @private 28309 * @param {string} string The string inspect. 28310 * @returns {number} Returns the string size. 28311 */ 28312 var asciiSize = baseProperty('length'); 28313 28314 /** 28315 * Converts an ASCII `string` to an array. 28316 * 28317 * @private 28318 * @param {string} string The string to convert. 28319 * @returns {Array} Returns the converted array. 28320 */ 28321 function asciiToArray(string) { 28322 return string.split(''); 28323 } 28324 28325 /** 28326 * Splits an ASCII `string` into an array of its words. 28327 * 28328 * @private 28329 * @param {string} The string to inspect. 28330 * @returns {Array} Returns the words of `string`. 28331 */ 28332 function asciiWords(string) { 28333 return string.match(reAsciiWord) || []; 28334 } 28335 28336 /** 28337 * The base implementation of methods like `_.findKey` and `_.findLastKey`, 28338 * without support for iteratee shorthands, which iterates over `collection` 28339 * using `eachFunc`. 28340 * 28341 * @private 28342 * @param {Array|Object} collection The collection to inspect. 28343 * @param {Function} predicate The function invoked per iteration. 28344 * @param {Function} eachFunc The function to iterate over `collection`. 28345 * @returns {*} Returns the found element or its key, else `undefined`. 28346 */ 28347 function baseFindKey(collection, predicate, eachFunc) { 28348 var result; 28349 eachFunc(collection, function(value, key, collection) { 28350 if (predicate(value, key, collection)) { 28351 result = key; 28352 return false; 28353 } 28354 }); 28355 return result; 28356 } 28357 28358 /** 28359 * The base implementation of `_.findIndex` and `_.findLastIndex` without 28360 * support for iteratee shorthands. 28361 * 28362 * @private 28363 * @param {Array} array The array to inspect. 28364 * @param {Function} predicate The function invoked per iteration. 28365 * @param {number} fromIndex The index to search from. 28366 * @param {boolean} [fromRight] Specify iterating from right to left. 28367 * @returns {number} Returns the index of the matched value, else `-1`. 28368 */ 28369 function baseFindIndex(array, predicate, fromIndex, fromRight) { 28370 var length = array.length, 28371 index = fromIndex + (fromRight ? 1 : -1); 28372 28373 while ((fromRight ? index-- : ++index < length)) { 28374 if (predicate(array[index], index, array)) { 28375 return index; 28376 } 28377 } 28378 return -1; 28379 } 28380 28381 /** 28382 * The base implementation of `_.indexOf` without `fromIndex` bounds checks. 28383 * 28384 * @private 28385 * @param {Array} array The array to inspect. 28386 * @param {*} value The value to search for. 28387 * @param {number} fromIndex The index to search from. 28388 * @returns {number} Returns the index of the matched value, else `-1`. 28389 */ 28390 function baseIndexOf(array, value, fromIndex) { 28391 return value === value 28392 ? strictIndexOf(array, value, fromIndex) 28393 : baseFindIndex(array, baseIsNaN, fromIndex); 28394 } 28395 28396 /** 28397 * This function is like `baseIndexOf` except that it accepts a comparator. 28398 * 28399 * @private 28400 * @param {Array} array The array to inspect. 28401 * @param {*} value The value to search for. 28402 * @param {number} fromIndex The index to search from. 28403 * @param {Function} comparator The comparator invoked per element. 28404 * @returns {number} Returns the index of the matched value, else `-1`. 28405 */ 28406 function baseIndexOfWith(array, value, fromIndex, comparator) { 28407 var index = fromIndex - 1, 28408 length = array.length; 28409 28410 while (++index < length) { 28411 if (comparator(array[index], value)) { 28412 return index; 28413 } 28414 } 28415 return -1; 28416 } 28417 28418 /** 28419 * The base implementation of `_.isNaN` without support for number objects. 28420 * 28421 * @private 28422 * @param {*} value The value to check. 28423 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 28424 */ 28425 function baseIsNaN(value) { 28426 return value !== value; 28427 } 28428 28429 /** 28430 * The base implementation of `_.mean` and `_.meanBy` without support for 28431 * iteratee shorthands. 28432 * 28433 * @private 28434 * @param {Array} array The array to iterate over. 28435 * @param {Function} iteratee The function invoked per iteration. 28436 * @returns {number} Returns the mean. 28437 */ 28438 function baseMean(array, iteratee) { 28439 var length = array == null ? 0 : array.length; 28440 return length ? (baseSum(array, iteratee) / length) : NAN; 28441 } 28442 28443 /** 28444 * The base implementation of `_.property` without support for deep paths. 28445 * 28446 * @private 28447 * @param {string} key The key of the property to get. 28448 * @returns {Function} Returns the new accessor function. 28449 */ 28450 function baseProperty(key) { 28451 return function(object) { 28452 return object == null ? undefined : object[key]; 28453 }; 28454 } 28455 28456 /** 28457 * The base implementation of `_.propertyOf` without support for deep paths. 28458 * 28459 * @private 28460 * @param {Object} object The object to query. 28461 * @returns {Function} Returns the new accessor function. 28462 */ 28463 function basePropertyOf(object) { 28464 return function(key) { 28465 return object == null ? undefined : object[key]; 28466 }; 28467 } 28468 28469 /** 28470 * The base implementation of `_.reduce` and `_.reduceRight`, without support 28471 * for iteratee shorthands, which iterates over `collection` using `eachFunc`. 28472 * 28473 * @private 28474 * @param {Array|Object} collection The collection to iterate over. 28475 * @param {Function} iteratee The function invoked per iteration. 28476 * @param {*} accumulator The initial value. 28477 * @param {boolean} initAccum Specify using the first or last element of 28478 * `collection` as the initial value. 28479 * @param {Function} eachFunc The function to iterate over `collection`. 28480 * @returns {*} Returns the accumulated value. 28481 */ 28482 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 28483 eachFunc(collection, function(value, index, collection) { 28484 accumulator = initAccum 28485 ? (initAccum = false, value) 28486 : iteratee(accumulator, value, index, collection); 28487 }); 28488 return accumulator; 28489 } 28490 28491 /** 28492 * The base implementation of `_.sortBy` which uses `comparer` to define the 28493 * sort order of `array` and replaces criteria objects with their corresponding 28494 * values. 28495 * 28496 * @private 28497 * @param {Array} array The array to sort. 28498 * @param {Function} comparer The function to define sort order. 28499 * @returns {Array} Returns `array`. 28500 */ 28501 function baseSortBy(array, comparer) { 28502 var length = array.length; 28503 28504 array.sort(comparer); 28505 while (length--) { 28506 array[length] = array[length].value; 28507 } 28508 return array; 28509 } 28510 28511 /** 28512 * The base implementation of `_.sum` and `_.sumBy` without support for 28513 * iteratee shorthands. 28514 * 28515 * @private 28516 * @param {Array} array The array to iterate over. 28517 * @param {Function} iteratee The function invoked per iteration. 28518 * @returns {number} Returns the sum. 28519 */ 28520 function baseSum(array, iteratee) { 28521 var result, 28522 index = -1, 28523 length = array.length; 28524 28525 while (++index < length) { 28526 var current = iteratee(array[index]); 28527 if (current !== undefined) { 28528 result = result === undefined ? current : (result + current); 28529 } 28530 } 28531 return result; 28532 } 28533 28534 /** 28535 * The base implementation of `_.times` without support for iteratee shorthands 28536 * or max array length checks. 28537 * 28538 * @private 28539 * @param {number} n The number of times to invoke `iteratee`. 28540 * @param {Function} iteratee The function invoked per iteration. 28541 * @returns {Array} Returns the array of results. 28542 */ 28543 function baseTimes(n, iteratee) { 28544 var index = -1, 28545 result = Array(n); 28546 28547 while (++index < n) { 28548 result[index] = iteratee(index); 28549 } 28550 return result; 28551 } 28552 28553 /** 28554 * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array 28555 * of key-value pairs for `object` corresponding to the property names of `props`. 28556 * 28557 * @private 28558 * @param {Object} object The object to query. 28559 * @param {Array} props The property names to get values for. 28560 * @returns {Object} Returns the key-value pairs. 28561 */ 28562 function baseToPairs(object, props) { 28563 return arrayMap(props, function(key) { 28564 return [key, object[key]]; 28565 }); 28566 } 28567 28568 /** 28569 * The base implementation of `_.trim`. 28570 * 28571 * @private 28572 * @param {string} string The string to trim. 28573 * @returns {string} Returns the trimmed string. 28574 */ 28575 function baseTrim(string) { 28576 return string 28577 ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '') 28578 : string; 28579 } 28580 28581 /** 28582 * The base implementation of `_.unary` without support for storing metadata. 28583 * 28584 * @private 28585 * @param {Function} func The function to cap arguments for. 28586 * @returns {Function} Returns the new capped function. 28587 */ 28588 function baseUnary(func) { 28589 return function(value) { 28590 return func(value); 28591 }; 28592 } 28593 28594 /** 28595 * The base implementation of `_.values` and `_.valuesIn` which creates an 28596 * array of `object` property values corresponding to the property names 28597 * of `props`. 28598 * 28599 * @private 28600 * @param {Object} object The object to query. 28601 * @param {Array} props The property names to get values for. 28602 * @returns {Object} Returns the array of property values. 28603 */ 28604 function baseValues(object, props) { 28605 return arrayMap(props, function(key) { 28606 return object[key]; 28607 }); 28608 } 28609 28610 /** 28611 * Checks if a `cache` value for `key` exists. 28612 * 28613 * @private 28614 * @param {Object} cache The cache to query. 28615 * @param {string} key The key of the entry to check. 28616 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 28617 */ 28618 function cacheHas(cache, key) { 28619 return cache.has(key); 28620 } 28621 28622 /** 28623 * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol 28624 * that is not found in the character symbols. 28625 * 28626 * @private 28627 * @param {Array} strSymbols The string symbols to inspect. 28628 * @param {Array} chrSymbols The character symbols to find. 28629 * @returns {number} Returns the index of the first unmatched string symbol. 28630 */ 28631 function charsStartIndex(strSymbols, chrSymbols) { 28632 var index = -1, 28633 length = strSymbols.length; 28634 28635 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 28636 return index; 28637 } 28638 28639 /** 28640 * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol 28641 * that is not found in the character symbols. 28642 * 28643 * @private 28644 * @param {Array} strSymbols The string symbols to inspect. 28645 * @param {Array} chrSymbols The character symbols to find. 28646 * @returns {number} Returns the index of the last unmatched string symbol. 28647 */ 28648 function charsEndIndex(strSymbols, chrSymbols) { 28649 var index = strSymbols.length; 28650 28651 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} 28652 return index; 28653 } 28654 28655 /** 28656 * Gets the number of `placeholder` occurrences in `array`. 28657 * 28658 * @private 28659 * @param {Array} array The array to inspect. 28660 * @param {*} placeholder The placeholder to search for. 28661 * @returns {number} Returns the placeholder count. 28662 */ 28663 function countHolders(array, placeholder) { 28664 var length = array.length, 28665 result = 0; 28666 28667 while (length--) { 28668 if (array[length] === placeholder) { 28669 ++result; 28670 } 28671 } 28672 return result; 28673 } 28674 28675 /** 28676 * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A 28677 * letters to basic Latin letters. 28678 * 28679 * @private 28680 * @param {string} letter The matched letter to deburr. 28681 * @returns {string} Returns the deburred letter. 28682 */ 28683 var deburrLetter = basePropertyOf(deburredLetters); 28684 28685 /** 28686 * Used by `_.escape` to convert characters to HTML entities. 28687 * 28688 * @private 28689 * @param {string} chr The matched character to escape. 28690 * @returns {string} Returns the escaped character. 28691 */ 28692 var escapeHtmlChar = basePropertyOf(htmlEscapes); 28693 28694 /** 28695 * Used by `_.template` to escape characters for inclusion in compiled string literals. 28696 * 28697 * @private 28698 * @param {string} chr The matched character to escape. 28699 * @returns {string} Returns the escaped character. 28700 */ 28701 function escapeStringChar(chr) { 28702 return '\\' + stringEscapes[chr]; 28703 } 28704 28705 /** 28706 * Gets the value at `key` of `object`. 28707 * 28708 * @private 28709 * @param {Object} [object] The object to query. 28710 * @param {string} key The key of the property to get. 28711 * @returns {*} Returns the property value. 28712 */ 28713 function getValue(object, key) { 28714 return object == null ? undefined : object[key]; 28715 } 28716 28717 /** 28718 * Checks if `string` contains Unicode symbols. 28719 * 28720 * @private 28721 * @param {string} string The string to inspect. 28722 * @returns {boolean} Returns `true` if a symbol is found, else `false`. 28723 */ 28724 function hasUnicode(string) { 28725 return reHasUnicode.test(string); 28726 } 28727 28728 /** 28729 * Checks if `string` contains a word composed of Unicode symbols. 28730 * 28731 * @private 28732 * @param {string} string The string to inspect. 28733 * @returns {boolean} Returns `true` if a word is found, else `false`. 28734 */ 28735 function hasUnicodeWord(string) { 28736 return reHasUnicodeWord.test(string); 28737 } 28738 28739 /** 28740 * Converts `iterator` to an array. 28741 * 28742 * @private 28743 * @param {Object} iterator The iterator to convert. 28744 * @returns {Array} Returns the converted array. 28745 */ 28746 function iteratorToArray(iterator) { 28747 var data, 28748 result = []; 28749 28750 while (!(data = iterator.next()).done) { 28751 result.push(data.value); 28752 } 28753 return result; 28754 } 28755 28756 /** 28757 * Converts `map` to its key-value pairs. 28758 * 28759 * @private 28760 * @param {Object} map The map to convert. 28761 * @returns {Array} Returns the key-value pairs. 28762 */ 28763 function mapToArray(map) { 28764 var index = -1, 28765 result = Array(map.size); 28766 28767 map.forEach(function(value, key) { 28768 result[++index] = [key, value]; 28769 }); 28770 return result; 28771 } 28772 28773 /** 28774 * Creates a unary function that invokes `func` with its argument transformed. 28775 * 28776 * @private 28777 * @param {Function} func The function to wrap. 28778 * @param {Function} transform The argument transform. 28779 * @returns {Function} Returns the new function. 28780 */ 28781 function overArg(func, transform) { 28782 return function(arg) { 28783 return func(transform(arg)); 28784 }; 28785 } 28786 28787 /** 28788 * Replaces all `placeholder` elements in `array` with an internal placeholder 28789 * and returns an array of their indexes. 28790 * 28791 * @private 28792 * @param {Array} array The array to modify. 28793 * @param {*} placeholder The placeholder to replace. 28794 * @returns {Array} Returns the new array of placeholder indexes. 28795 */ 28796 function replaceHolders(array, placeholder) { 28797 var index = -1, 28798 length = array.length, 28799 resIndex = 0, 28800 result = []; 28801 28802 while (++index < length) { 28803 var value = array[index]; 28804 if (value === placeholder || value === PLACEHOLDER) { 28805 array[index] = PLACEHOLDER; 28806 result[resIndex++] = index; 28807 } 28808 } 28809 return result; 28810 } 28811 28812 /** 28813 * Converts `set` to an array of its values. 28814 * 28815 * @private 28816 * @param {Object} set The set to convert. 28817 * @returns {Array} Returns the values. 28818 */ 28819 function setToArray(set) { 28820 var index = -1, 28821 result = Array(set.size); 28822 28823 set.forEach(function(value) { 28824 result[++index] = value; 28825 }); 28826 return result; 28827 } 28828 28829 /** 28830 * Converts `set` to its value-value pairs. 28831 * 28832 * @private 28833 * @param {Object} set The set to convert. 28834 * @returns {Array} Returns the value-value pairs. 28835 */ 28836 function setToPairs(set) { 28837 var index = -1, 28838 result = Array(set.size); 28839 28840 set.forEach(function(value) { 28841 result[++index] = [value, value]; 28842 }); 28843 return result; 28844 } 28845 28846 /** 28847 * A specialized version of `_.indexOf` which performs strict equality 28848 * comparisons of values, i.e. `===`. 28849 * 28850 * @private 28851 * @param {Array} array The array to inspect. 28852 * @param {*} value The value to search for. 28853 * @param {number} fromIndex The index to search from. 28854 * @returns {number} Returns the index of the matched value, else `-1`. 28855 */ 28856 function strictIndexOf(array, value, fromIndex) { 28857 var index = fromIndex - 1, 28858 length = array.length; 28859 28860 while (++index < length) { 28861 if (array[index] === value) { 28862 return index; 28863 } 28864 } 28865 return -1; 28866 } 28867 28868 /** 28869 * A specialized version of `_.lastIndexOf` which performs strict equality 28870 * comparisons of values, i.e. `===`. 28871 * 28872 * @private 28873 * @param {Array} array The array to inspect. 28874 * @param {*} value The value to search for. 28875 * @param {number} fromIndex The index to search from. 28876 * @returns {number} Returns the index of the matched value, else `-1`. 28877 */ 28878 function strictLastIndexOf(array, value, fromIndex) { 28879 var index = fromIndex + 1; 28880 while (index--) { 28881 if (array[index] === value) { 28882 return index; 28883 } 28884 } 28885 return index; 28886 } 28887 28888 /** 28889 * Gets the number of symbols in `string`. 28890 * 28891 * @private 28892 * @param {string} string The string to inspect. 28893 * @returns {number} Returns the string size. 28894 */ 28895 function stringSize(string) { 28896 return hasUnicode(string) 28897 ? unicodeSize(string) 28898 : asciiSize(string); 28899 } 28900 28901 /** 28902 * Converts `string` to an array. 28903 * 28904 * @private 28905 * @param {string} string The string to convert. 28906 * @returns {Array} Returns the converted array. 28907 */ 28908 function stringToArray(string) { 28909 return hasUnicode(string) 28910 ? unicodeToArray(string) 28911 : asciiToArray(string); 28912 } 28913 28914 /** 28915 * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace 28916 * character of `string`. 28917 * 28918 * @private 28919 * @param {string} string The string to inspect. 28920 * @returns {number} Returns the index of the last non-whitespace character. 28921 */ 28922 function trimmedEndIndex(string) { 28923 var index = string.length; 28924 28925 while (index-- && reWhitespace.test(string.charAt(index))) {} 28926 return index; 28927 } 28928 28929 /** 28930 * Used by `_.unescape` to convert HTML entities to characters. 28931 * 28932 * @private 28933 * @param {string} chr The matched character to unescape. 28934 * @returns {string} Returns the unescaped character. 28935 */ 28936 var unescapeHtmlChar = basePropertyOf(htmlUnescapes); 28937 28938 /** 28939 * Gets the size of a Unicode `string`. 28940 * 28941 * @private 28942 * @param {string} string The string inspect. 28943 * @returns {number} Returns the string size. 28944 */ 28945 function unicodeSize(string) { 28946 var result = reUnicode.lastIndex = 0; 28947 while (reUnicode.test(string)) { 28948 ++result; 28949 } 28950 return result; 28951 } 28952 28953 /** 28954 * Converts a Unicode `string` to an array. 28955 * 28956 * @private 28957 * @param {string} string The string to convert. 28958 * @returns {Array} Returns the converted array. 28959 */ 28960 function unicodeToArray(string) { 28961 return string.match(reUnicode) || []; 28962 } 28963 28964 /** 28965 * Splits a Unicode `string` into an array of its words. 28966 * 28967 * @private 28968 * @param {string} The string to inspect. 28969 * @returns {Array} Returns the words of `string`. 28970 */ 28971 function unicodeWords(string) { 28972 return string.match(reUnicodeWord) || []; 28973 } 28974 28975 /*--------------------------------------------------------------------------*/ 28976 28977 /** 28978 * Create a new pristine `lodash` function using the `context` object. 28979 * 28980 * @static 28981 * @memberOf _ 28982 * @since 1.1.0 28983 * @category Util 28984 * @param {Object} [context=root] The context object. 28985 * @returns {Function} Returns a new `lodash` function. 28986 * @example 28987 * 28988 * _.mixin({ 'foo': _.constant('foo') }); 28989 * 28990 * var lodash = _.runInContext(); 28991 * lodash.mixin({ 'bar': lodash.constant('bar') }); 28992 * 28993 * _.isFunction(_.foo); 28994 * // => true 28995 * _.isFunction(_.bar); 28996 * // => false 28997 * 28998 * lodash.isFunction(lodash.foo); 28999 * // => false 29000 * lodash.isFunction(lodash.bar); 29001 * // => true 29002 * 29003 * // Create a suped-up `defer` in Node.js. 29004 * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; 29005 */ 29006 var runInContext = (function runInContext(context) { 29007 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); 29008 29009 /** Built-in constructor references. */ 29010 var Array = context.Array, 29011 Date = context.Date, 29012 Error = context.Error, 29013 Function = context.Function, 29014 Math = context.Math, 29015 Object = context.Object, 29016 RegExp = context.RegExp, 29017 String = context.String, 29018 TypeError = context.TypeError; 29019 29020 /** Used for built-in method references. */ 29021 var arrayProto = Array.prototype, 29022 funcProto = Function.prototype, 29023 objectProto = Object.prototype; 29024 29025 /** Used to detect overreaching core-js shims. */ 29026 var coreJsData = context['__core-js_shared__']; 29027 29028 /** Used to resolve the decompiled source of functions. */ 29029 var funcToString = funcProto.toString; 29030 29031 /** Used to check objects for own properties. */ 29032 var hasOwnProperty = objectProto.hasOwnProperty; 29033 29034 /** Used to generate unique IDs. */ 29035 var idCounter = 0; 29036 29037 /** Used to detect methods masquerading as native. */ 29038 var maskSrcKey = (function() { 29039 var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); 29040 return uid ? ('Symbol(src)_1.' + uid) : ''; 29041 }()); 29042 29043 /** 29044 * Used to resolve the 29045 * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) 29046 * of values. 29047 */ 29048 var nativeObjectToString = objectProto.toString; 29049 29050 /** Used to infer the `Object` constructor. */ 29051 var objectCtorString = funcToString.call(Object); 29052 29053 /** Used to restore the original `_` reference in `_.noConflict`. */ 29054 var oldDash = root._; 29055 29056 /** Used to detect if a method is native. */ 29057 var reIsNative = RegExp('^' + 29058 funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') 29059 .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' 29060 ); 29061 29062 /** Built-in value references. */ 29063 var Buffer = moduleExports ? context.Buffer : undefined, 29064 Symbol = context.Symbol, 29065 Uint8Array = context.Uint8Array, 29066 allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, 29067 getPrototype = overArg(Object.getPrototypeOf, Object), 29068 objectCreate = Object.create, 29069 propertyIsEnumerable = objectProto.propertyIsEnumerable, 29070 splice = arrayProto.splice, 29071 spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined, 29072 symIterator = Symbol ? Symbol.iterator : undefined, 29073 symToStringTag = Symbol ? Symbol.toStringTag : undefined; 29074 29075 var defineProperty = (function() { 29076 try { 29077 var func = getNative(Object, 'defineProperty'); 29078 func({}, '', {}); 29079 return func; 29080 } catch (e) {} 29081 }()); 29082 29083 /** Mocked built-ins. */ 29084 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, 29085 ctxNow = Date && Date.now !== root.Date.now && Date.now, 29086 ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; 29087 29088 /* Built-in method references for those with the same name as other `lodash` methods. */ 29089 var nativeCeil = Math.ceil, 29090 nativeFloor = Math.floor, 29091 nativeGetSymbols = Object.getOwnPropertySymbols, 29092 nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, 29093 nativeIsFinite = context.isFinite, 29094 nativeJoin = arrayProto.join, 29095 nativeKeys = overArg(Object.keys, Object), 29096 nativeMax = Math.max, 29097 nativeMin = Math.min, 29098 nativeNow = Date.now, 29099 nativeParseInt = context.parseInt, 29100 nativeRandom = Math.random, 29101 nativeReverse = arrayProto.reverse; 29102 29103 /* Built-in method references that are verified to be native. */ 29104 var DataView = getNative(context, 'DataView'), 29105 Map = getNative(context, 'Map'), 29106 Promise = getNative(context, 'Promise'), 29107 Set = getNative(context, 'Set'), 29108 WeakMap = getNative(context, 'WeakMap'), 29109 nativeCreate = getNative(Object, 'create'); 29110 29111 /** Used to store function metadata. */ 29112 var metaMap = WeakMap && new WeakMap; 29113 29114 /** Used to lookup unminified function names. */ 29115 var realNames = {}; 29116 29117 /** Used to detect maps, sets, and weakmaps. */ 29118 var dataViewCtorString = toSource(DataView), 29119 mapCtorString = toSource(Map), 29120 promiseCtorString = toSource(Promise), 29121 setCtorString = toSource(Set), 29122 weakMapCtorString = toSource(WeakMap); 29123 29124 /** Used to convert symbols to primitives and strings. */ 29125 var symbolProto = Symbol ? Symbol.prototype : undefined, 29126 symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, 29127 symbolToString = symbolProto ? symbolProto.toString : undefined; 29128 29129 /*------------------------------------------------------------------------*/ 29130 29131 /** 29132 * Creates a `lodash` object which wraps `value` to enable implicit method 29133 * chain sequences. Methods that operate on and return arrays, collections, 29134 * and functions can be chained together. Methods that retrieve a single value 29135 * or may return a primitive value will automatically end the chain sequence 29136 * and return the unwrapped value. Otherwise, the value must be unwrapped 29137 * with `_#value`. 29138 * 29139 * Explicit chain sequences, which must be unwrapped with `_#value`, may be 29140 * enabled using `_.chain`. 29141 * 29142 * The execution of chained methods is lazy, that is, it's deferred until 29143 * `_#value` is implicitly or explicitly called. 29144 * 29145 * Lazy evaluation allows several methods to support shortcut fusion. 29146 * Shortcut fusion is an optimization to merge iteratee calls; this avoids 29147 * the creation of intermediate arrays and can greatly reduce the number of 29148 * iteratee executions. Sections of a chain sequence qualify for shortcut 29149 * fusion if the section is applied to an array and iteratees accept only 29150 * one argument. The heuristic for whether a section qualifies for shortcut 29151 * fusion is subject to change. 29152 * 29153 * Chaining is supported in custom builds as long as the `_#value` method is 29154 * directly or indirectly included in the build. 29155 * 29156 * In addition to lodash methods, wrappers have `Array` and `String` methods. 29157 * 29158 * The wrapper `Array` methods are: 29159 * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` 29160 * 29161 * The wrapper `String` methods are: 29162 * `replace` and `split` 29163 * 29164 * The wrapper methods that support shortcut fusion are: 29165 * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, 29166 * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, 29167 * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` 29168 * 29169 * The chainable wrapper methods are: 29170 * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, 29171 * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, 29172 * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, 29173 * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, 29174 * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, 29175 * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, 29176 * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, 29177 * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, 29178 * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, 29179 * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, 29180 * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, 29181 * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, 29182 * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, 29183 * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, 29184 * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, 29185 * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, 29186 * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, 29187 * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, 29188 * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, 29189 * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, 29190 * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, 29191 * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, 29192 * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, 29193 * `zipObject`, `zipObjectDeep`, and `zipWith` 29194 * 29195 * The wrapper methods that are **not** chainable by default are: 29196 * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, 29197 * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, 29198 * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, 29199 * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, 29200 * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, 29201 * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, 29202 * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, 29203 * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, 29204 * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, 29205 * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, 29206 * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, 29207 * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, 29208 * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, 29209 * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, 29210 * `lowerCase`, `lowerFirst`, `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, 29211 * `min`, `minBy`, `multiply`, `noConflict`, `noop`, `now`, `nth`, `pad`, 29212 * `padEnd`, `padStart`, `parseInt`, `pop`, `random`, `reduce`, `reduceRight`, 29213 * `repeat`, `result`, `round`, `runInContext`, `sample`, `shift`, `size`, 29214 * `snakeCase`, `some`, `sortedIndex`, `sortedIndexBy`, `sortedLastIndex`, 29215 * `sortedLastIndexBy`, `startCase`, `startsWith`, `stubArray`, `stubFalse`, 29216 * `stubObject`, `stubString`, `stubTrue`, `subtract`, `sum`, `sumBy`, 29217 * `template`, `times`, `toFinite`, `toInteger`, `toJSON`, `toLength`, 29218 * `toLower`, `toNumber`, `toSafeInteger`, `toString`, `toUpper`, `trim`, 29219 * `trimEnd`, `trimStart`, `truncate`, `unescape`, `uniqueId`, `upperCase`, 29220 * `upperFirst`, `value`, and `words` 29221 * 29222 * @name _ 29223 * @constructor 29224 * @category Seq 29225 * @param {*} value The value to wrap in a `lodash` instance. 29226 * @returns {Object} Returns the new `lodash` wrapper instance. 29227 * @example 29228 * 29229 * function square(n) { 29230 * return n * n; 29231 * } 29232 * 29233 * var wrapped = _([1, 2, 3]); 29234 * 29235 * // Returns an unwrapped value. 29236 * wrapped.reduce(_.add); 29237 * // => 6 29238 * 29239 * // Returns a wrapped value. 29240 * var squares = wrapped.map(square); 29241 * 29242 * _.isArray(squares); 29243 * // => false 29244 * 29245 * _.isArray(squares.value()); 29246 * // => true 29247 */ 29248 function lodash(value) { 29249 if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { 29250 if (value instanceof LodashWrapper) { 29251 return value; 29252 } 29253 if (hasOwnProperty.call(value, '__wrapped__')) { 29254 return wrapperClone(value); 29255 } 29256 } 29257 return new LodashWrapper(value); 29258 } 29259 29260 /** 29261 * The base implementation of `_.create` without support for assigning 29262 * properties to the created object. 29263 * 29264 * @private 29265 * @param {Object} proto The object to inherit from. 29266 * @returns {Object} Returns the new object. 29267 */ 29268 var baseCreate = (function() { 29269 function object() {} 29270 return function(proto) { 29271 if (!isObject(proto)) { 29272 return {}; 29273 } 29274 if (objectCreate) { 29275 return objectCreate(proto); 29276 } 29277 object.prototype = proto; 29278 var result = new object; 29279 object.prototype = undefined; 29280 return result; 29281 }; 29282 }()); 29283 29284 /** 29285 * The function whose prototype chain sequence wrappers inherit from. 29286 * 29287 * @private 29288 */ 29289 function baseLodash() { 29290 // No operation performed. 29291 } 29292 29293 /** 29294 * The base constructor for creating `lodash` wrapper objects. 29295 * 29296 * @private 29297 * @param {*} value The value to wrap. 29298 * @param {boolean} [chainAll] Enable explicit method chain sequences. 29299 */ 29300 function LodashWrapper(value, chainAll) { 29301 this.__wrapped__ = value; 29302 this.__actions__ = []; 29303 this.__chain__ = !!chainAll; 29304 this.__index__ = 0; 29305 this.__values__ = undefined; 29306 } 29307 29308 /** 29309 * By default, the template delimiters used by lodash are like those in 29310 * embedded Ruby (ERB) as well as ES2015 template strings. Change the 29311 * following template settings to use alternative delimiters. 29312 * 29313 * @static 29314 * @memberOf _ 29315 * @type {Object} 29316 */ 29317 lodash.templateSettings = { 29318 29319 /** 29320 * Used to detect `data` property values to be HTML-escaped. 29321 * 29322 * @memberOf _.templateSettings 29323 * @type {RegExp} 29324 */ 29325 'escape': reEscape, 29326 29327 /** 29328 * Used to detect code to be evaluated. 29329 * 29330 * @memberOf _.templateSettings 29331 * @type {RegExp} 29332 */ 29333 'evaluate': reEvaluate, 29334 29335 /** 29336 * Used to detect `data` property values to inject. 29337 * 29338 * @memberOf _.templateSettings 29339 * @type {RegExp} 29340 */ 29341 'interpolate': reInterpolate, 29342 29343 /** 29344 * Used to reference the data object in the template text. 29345 * 29346 * @memberOf _.templateSettings 29347 * @type {string} 29348 */ 29349 'variable': '', 29350 29351 /** 29352 * Used to import variables into the compiled template. 29353 * 29354 * @memberOf _.templateSettings 29355 * @type {Object} 29356 */ 29357 'imports': { 29358 29359 /** 29360 * A reference to the `lodash` function. 29361 * 29362 * @memberOf _.templateSettings.imports 29363 * @type {Function} 29364 */ 29365 '_': lodash 29366 } 29367 }; 29368 29369 // Ensure wrappers are instances of `baseLodash`. 29370 lodash.prototype = baseLodash.prototype; 29371 lodash.prototype.constructor = lodash; 29372 29373 LodashWrapper.prototype = baseCreate(baseLodash.prototype); 29374 LodashWrapper.prototype.constructor = LodashWrapper; 29375 29376 /*------------------------------------------------------------------------*/ 29377 29378 /** 29379 * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. 29380 * 29381 * @private 29382 * @constructor 29383 * @param {*} value The value to wrap. 29384 */ 29385 function LazyWrapper(value) { 29386 this.__wrapped__ = value; 29387 this.__actions__ = []; 29388 this.__dir__ = 1; 29389 this.__filtered__ = false; 29390 this.__iteratees__ = []; 29391 this.__takeCount__ = MAX_ARRAY_LENGTH; 29392 this.__views__ = []; 29393 } 29394 29395 /** 29396 * Creates a clone of the lazy wrapper object. 29397 * 29398 * @private 29399 * @name clone 29400 * @memberOf LazyWrapper 29401 * @returns {Object} Returns the cloned `LazyWrapper` object. 29402 */ 29403 function lazyClone() { 29404 var result = new LazyWrapper(this.__wrapped__); 29405 result.__actions__ = copyArray(this.__actions__); 29406 result.__dir__ = this.__dir__; 29407 result.__filtered__ = this.__filtered__; 29408 result.__iteratees__ = copyArray(this.__iteratees__); 29409 result.__takeCount__ = this.__takeCount__; 29410 result.__views__ = copyArray(this.__views__); 29411 return result; 29412 } 29413 29414 /** 29415 * Reverses the direction of lazy iteration. 29416 * 29417 * @private 29418 * @name reverse 29419 * @memberOf LazyWrapper 29420 * @returns {Object} Returns the new reversed `LazyWrapper` object. 29421 */ 29422 function lazyReverse() { 29423 if (this.__filtered__) { 29424 var result = new LazyWrapper(this); 29425 result.__dir__ = -1; 29426 result.__filtered__ = true; 29427 } else { 29428 result = this.clone(); 29429 result.__dir__ *= -1; 29430 } 29431 return result; 29432 } 29433 29434 /** 29435 * Extracts the unwrapped value from its lazy wrapper. 29436 * 29437 * @private 29438 * @name value 29439 * @memberOf LazyWrapper 29440 * @returns {*} Returns the unwrapped value. 29441 */ 29442 function lazyValue() { 29443 var array = this.__wrapped__.value(), 29444 dir = this.__dir__, 29445 isArr = isArray(array), 29446 isRight = dir < 0, 29447 arrLength = isArr ? array.length : 0, 29448 view = getView(0, arrLength, this.__views__), 29449 start = view.start, 29450 end = view.end, 29451 length = end - start, 29452 index = isRight ? end : (start - 1), 29453 iteratees = this.__iteratees__, 29454 iterLength = iteratees.length, 29455 resIndex = 0, 29456 takeCount = nativeMin(length, this.__takeCount__); 29457 29458 if (!isArr || (!isRight && arrLength == length && takeCount == length)) { 29459 return baseWrapperValue(array, this.__actions__); 29460 } 29461 var result = []; 29462 29463 outer: 29464 while (length-- && resIndex < takeCount) { 29465 index += dir; 29466 29467 var iterIndex = -1, 29468 value = array[index]; 29469 29470 while (++iterIndex < iterLength) { 29471 var data = iteratees[iterIndex], 29472 iteratee = data.iteratee, 29473 type = data.type, 29474 computed = iteratee(value); 29475 29476 if (type == LAZY_MAP_FLAG) { 29477 value = computed; 29478 } else if (!computed) { 29479 if (type == LAZY_FILTER_FLAG) { 29480 continue outer; 29481 } else { 29482 break outer; 29483 } 29484 } 29485 } 29486 result[resIndex++] = value; 29487 } 29488 return result; 29489 } 29490 29491 // Ensure `LazyWrapper` is an instance of `baseLodash`. 29492 LazyWrapper.prototype = baseCreate(baseLodash.prototype); 29493 LazyWrapper.prototype.constructor = LazyWrapper; 29494 29495 /*------------------------------------------------------------------------*/ 29496 29497 /** 29498 * Creates a hash object. 29499 * 29500 * @private 29501 * @constructor 29502 * @param {Array} [entries] The key-value pairs to cache. 29503 */ 29504 function Hash(entries) { 29505 var index = -1, 29506 length = entries == null ? 0 : entries.length; 29507 29508 this.clear(); 29509 while (++index < length) { 29510 var entry = entries[index]; 29511 this.set(entry[0], entry[1]); 29512 } 29513 } 29514 29515 /** 29516 * Removes all key-value entries from the hash. 29517 * 29518 * @private 29519 * @name clear 29520 * @memberOf Hash 29521 */ 29522 function hashClear() { 29523 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 29524 this.size = 0; 29525 } 29526 29527 /** 29528 * Removes `key` and its value from the hash. 29529 * 29530 * @private 29531 * @name delete 29532 * @memberOf Hash 29533 * @param {Object} hash The hash to modify. 29534 * @param {string} key The key of the value to remove. 29535 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29536 */ 29537 function hashDelete(key) { 29538 var result = this.has(key) && delete this.__data__[key]; 29539 this.size -= result ? 1 : 0; 29540 return result; 29541 } 29542 29543 /** 29544 * Gets the hash value for `key`. 29545 * 29546 * @private 29547 * @name get 29548 * @memberOf Hash 29549 * @param {string} key The key of the value to get. 29550 * @returns {*} Returns the entry value. 29551 */ 29552 function hashGet(key) { 29553 var data = this.__data__; 29554 if (nativeCreate) { 29555 var result = data[key]; 29556 return result === HASH_UNDEFINED ? undefined : result; 29557 } 29558 return hasOwnProperty.call(data, key) ? data[key] : undefined; 29559 } 29560 29561 /** 29562 * Checks if a hash value for `key` exists. 29563 * 29564 * @private 29565 * @name has 29566 * @memberOf Hash 29567 * @param {string} key The key of the entry to check. 29568 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29569 */ 29570 function hashHas(key) { 29571 var data = this.__data__; 29572 return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key); 29573 } 29574 29575 /** 29576 * Sets the hash `key` to `value`. 29577 * 29578 * @private 29579 * @name set 29580 * @memberOf Hash 29581 * @param {string} key The key of the value to set. 29582 * @param {*} value The value to set. 29583 * @returns {Object} Returns the hash instance. 29584 */ 29585 function hashSet(key, value) { 29586 var data = this.__data__; 29587 this.size += this.has(key) ? 0 : 1; 29588 data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; 29589 return this; 29590 } 29591 29592 // Add methods to `Hash`. 29593 Hash.prototype.clear = hashClear; 29594 Hash.prototype['delete'] = hashDelete; 29595 Hash.prototype.get = hashGet; 29596 Hash.prototype.has = hashHas; 29597 Hash.prototype.set = hashSet; 29598 29599 /*------------------------------------------------------------------------*/ 29600 29601 /** 29602 * Creates an list cache object. 29603 * 29604 * @private 29605 * @constructor 29606 * @param {Array} [entries] The key-value pairs to cache. 29607 */ 29608 function ListCache(entries) { 29609 var index = -1, 29610 length = entries == null ? 0 : entries.length; 29611 29612 this.clear(); 29613 while (++index < length) { 29614 var entry = entries[index]; 29615 this.set(entry[0], entry[1]); 29616 } 29617 } 29618 29619 /** 29620 * Removes all key-value entries from the list cache. 29621 * 29622 * @private 29623 * @name clear 29624 * @memberOf ListCache 29625 */ 29626 function listCacheClear() { 29627 this.__data__ = []; 29628 this.size = 0; 29629 } 29630 29631 /** 29632 * Removes `key` and its value from the list cache. 29633 * 29634 * @private 29635 * @name delete 29636 * @memberOf ListCache 29637 * @param {string} key The key of the value to remove. 29638 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29639 */ 29640 function listCacheDelete(key) { 29641 var data = this.__data__, 29642 index = assocIndexOf(data, key); 29643 29644 if (index < 0) { 29645 return false; 29646 } 29647 var lastIndex = data.length - 1; 29648 if (index == lastIndex) { 29649 data.pop(); 29650 } else { 29651 splice.call(data, index, 1); 29652 } 29653 --this.size; 29654 return true; 29655 } 29656 29657 /** 29658 * Gets the list cache value for `key`. 29659 * 29660 * @private 29661 * @name get 29662 * @memberOf ListCache 29663 * @param {string} key The key of the value to get. 29664 * @returns {*} Returns the entry value. 29665 */ 29666 function listCacheGet(key) { 29667 var data = this.__data__, 29668 index = assocIndexOf(data, key); 29669 29670 return index < 0 ? undefined : data[index][1]; 29671 } 29672 29673 /** 29674 * Checks if a list cache value for `key` exists. 29675 * 29676 * @private 29677 * @name has 29678 * @memberOf ListCache 29679 * @param {string} key The key of the entry to check. 29680 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29681 */ 29682 function listCacheHas(key) { 29683 return assocIndexOf(this.__data__, key) > -1; 29684 } 29685 29686 /** 29687 * Sets the list cache `key` to `value`. 29688 * 29689 * @private 29690 * @name set 29691 * @memberOf ListCache 29692 * @param {string} key The key of the value to set. 29693 * @param {*} value The value to set. 29694 * @returns {Object} Returns the list cache instance. 29695 */ 29696 function listCacheSet(key, value) { 29697 var data = this.__data__, 29698 index = assocIndexOf(data, key); 29699 29700 if (index < 0) { 29701 ++this.size; 29702 data.push([key, value]); 29703 } else { 29704 data[index][1] = value; 29705 } 29706 return this; 29707 } 29708 29709 // Add methods to `ListCache`. 29710 ListCache.prototype.clear = listCacheClear; 29711 ListCache.prototype['delete'] = listCacheDelete; 29712 ListCache.prototype.get = listCacheGet; 29713 ListCache.prototype.has = listCacheHas; 29714 ListCache.prototype.set = listCacheSet; 29715 29716 /*------------------------------------------------------------------------*/ 29717 29718 /** 29719 * Creates a map cache object to store key-value pairs. 29720 * 29721 * @private 29722 * @constructor 29723 * @param {Array} [entries] The key-value pairs to cache. 29724 */ 29725 function MapCache(entries) { 29726 var index = -1, 29727 length = entries == null ? 0 : entries.length; 29728 29729 this.clear(); 29730 while (++index < length) { 29731 var entry = entries[index]; 29732 this.set(entry[0], entry[1]); 29733 } 29734 } 29735 29736 /** 29737 * Removes all key-value entries from the map. 29738 * 29739 * @private 29740 * @name clear 29741 * @memberOf MapCache 29742 */ 29743 function mapCacheClear() { 29744 this.size = 0; 29745 this.__data__ = { 29746 'hash': new Hash, 29747 'map': new (Map || ListCache), 29748 'string': new Hash 29749 }; 29750 } 29751 29752 /** 29753 * Removes `key` and its value from the map. 29754 * 29755 * @private 29756 * @name delete 29757 * @memberOf MapCache 29758 * @param {string} key The key of the value to remove. 29759 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29760 */ 29761 function mapCacheDelete(key) { 29762 var result = getMapData(this, key)['delete'](key); 29763 this.size -= result ? 1 : 0; 29764 return result; 29765 } 29766 29767 /** 29768 * Gets the map value for `key`. 29769 * 29770 * @private 29771 * @name get 29772 * @memberOf MapCache 29773 * @param {string} key The key of the value to get. 29774 * @returns {*} Returns the entry value. 29775 */ 29776 function mapCacheGet(key) { 29777 return getMapData(this, key).get(key); 29778 } 29779 29780 /** 29781 * Checks if a map value for `key` exists. 29782 * 29783 * @private 29784 * @name has 29785 * @memberOf MapCache 29786 * @param {string} key The key of the entry to check. 29787 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29788 */ 29789 function mapCacheHas(key) { 29790 return getMapData(this, key).has(key); 29791 } 29792 29793 /** 29794 * Sets the map `key` to `value`. 29795 * 29796 * @private 29797 * @name set 29798 * @memberOf MapCache 29799 * @param {string} key The key of the value to set. 29800 * @param {*} value The value to set. 29801 * @returns {Object} Returns the map cache instance. 29802 */ 29803 function mapCacheSet(key, value) { 29804 var data = getMapData(this, key), 29805 size = data.size; 29806 29807 data.set(key, value); 29808 this.size += data.size == size ? 0 : 1; 29809 return this; 29810 } 29811 29812 // Add methods to `MapCache`. 29813 MapCache.prototype.clear = mapCacheClear; 29814 MapCache.prototype['delete'] = mapCacheDelete; 29815 MapCache.prototype.get = mapCacheGet; 29816 MapCache.prototype.has = mapCacheHas; 29817 MapCache.prototype.set = mapCacheSet; 29818 29819 /*------------------------------------------------------------------------*/ 29820 29821 /** 29822 * 29823 * Creates an array cache object to store unique values. 29824 * 29825 * @private 29826 * @constructor 29827 * @param {Array} [values] The values to cache. 29828 */ 29829 function SetCache(values) { 29830 var index = -1, 29831 length = values == null ? 0 : values.length; 29832 29833 this.__data__ = new MapCache; 29834 while (++index < length) { 29835 this.add(values[index]); 29836 } 29837 } 29838 29839 /** 29840 * Adds `value` to the array cache. 29841 * 29842 * @private 29843 * @name add 29844 * @memberOf SetCache 29845 * @alias push 29846 * @param {*} value The value to cache. 29847 * @returns {Object} Returns the cache instance. 29848 */ 29849 function setCacheAdd(value) { 29850 this.__data__.set(value, HASH_UNDEFINED); 29851 return this; 29852 } 29853 29854 /** 29855 * Checks if `value` is in the array cache. 29856 * 29857 * @private 29858 * @name has 29859 * @memberOf SetCache 29860 * @param {*} value The value to search for. 29861 * @returns {number} Returns `true` if `value` is found, else `false`. 29862 */ 29863 function setCacheHas(value) { 29864 return this.__data__.has(value); 29865 } 29866 29867 // Add methods to `SetCache`. 29868 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 29869 SetCache.prototype.has = setCacheHas; 29870 29871 /*------------------------------------------------------------------------*/ 29872 29873 /** 29874 * Creates a stack cache object to store key-value pairs. 29875 * 29876 * @private 29877 * @constructor 29878 * @param {Array} [entries] The key-value pairs to cache. 29879 */ 29880 function Stack(entries) { 29881 var data = this.__data__ = new ListCache(entries); 29882 this.size = data.size; 29883 } 29884 29885 /** 29886 * Removes all key-value entries from the stack. 29887 * 29888 * @private 29889 * @name clear 29890 * @memberOf Stack 29891 */ 29892 function stackClear() { 29893 this.__data__ = new ListCache; 29894 this.size = 0; 29895 } 29896 29897 /** 29898 * Removes `key` and its value from the stack. 29899 * 29900 * @private 29901 * @name delete 29902 * @memberOf Stack 29903 * @param {string} key The key of the value to remove. 29904 * @returns {boolean} Returns `true` if the entry was removed, else `false`. 29905 */ 29906 function stackDelete(key) { 29907 var data = this.__data__, 29908 result = data['delete'](key); 29909 29910 this.size = data.size; 29911 return result; 29912 } 29913 29914 /** 29915 * Gets the stack value for `key`. 29916 * 29917 * @private 29918 * @name get 29919 * @memberOf Stack 29920 * @param {string} key The key of the value to get. 29921 * @returns {*} Returns the entry value. 29922 */ 29923 function stackGet(key) { 29924 return this.__data__.get(key); 29925 } 29926 29927 /** 29928 * Checks if a stack value for `key` exists. 29929 * 29930 * @private 29931 * @name has 29932 * @memberOf Stack 29933 * @param {string} key The key of the entry to check. 29934 * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. 29935 */ 29936 function stackHas(key) { 29937 return this.__data__.has(key); 29938 } 29939 29940 /** 29941 * Sets the stack `key` to `value`. 29942 * 29943 * @private 29944 * @name set 29945 * @memberOf Stack 29946 * @param {string} key The key of the value to set. 29947 * @param {*} value The value to set. 29948 * @returns {Object} Returns the stack cache instance. 29949 */ 29950 function stackSet(key, value) { 29951 var data = this.__data__; 29952 if (data instanceof ListCache) { 29953 var pairs = data.__data__; 29954 if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { 29955 pairs.push([key, value]); 29956 this.size = ++data.size; 29957 return this; 29958 } 29959 data = this.__data__ = new MapCache(pairs); 29960 } 29961 data.set(key, value); 29962 this.size = data.size; 29963 return this; 29964 } 29965 29966 // Add methods to `Stack`. 29967 Stack.prototype.clear = stackClear; 29968 Stack.prototype['delete'] = stackDelete; 29969 Stack.prototype.get = stackGet; 29970 Stack.prototype.has = stackHas; 29971 Stack.prototype.set = stackSet; 29972 29973 /*------------------------------------------------------------------------*/ 29974 29975 /** 29976 * Creates an array of the enumerable property names of the array-like `value`. 29977 * 29978 * @private 29979 * @param {*} value The value to query. 29980 * @param {boolean} inherited Specify returning inherited property names. 29981 * @returns {Array} Returns the array of property names. 29982 */ 29983 function arrayLikeKeys(value, inherited) { 29984 var isArr = isArray(value), 29985 isArg = !isArr && isArguments(value), 29986 isBuff = !isArr && !isArg && isBuffer(value), 29987 isType = !isArr && !isArg && !isBuff && isTypedArray(value), 29988 skipIndexes = isArr || isArg || isBuff || isType, 29989 result = skipIndexes ? baseTimes(value.length, String) : [], 29990 length = result.length; 29991 29992 for (var key in value) { 29993 if ((inherited || hasOwnProperty.call(value, key)) && 29994 !(skipIndexes && ( 29995 // Safari 9 has enumerable `arguments.length` in strict mode. 29996 key == 'length' || 29997 // Node.js 0.10 has enumerable non-index properties on buffers. 29998 (isBuff && (key == 'offset' || key == 'parent')) || 29999 // PhantomJS 2 has enumerable non-index properties on typed arrays. 30000 (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || 30001 // Skip index properties. 30002 isIndex(key, length) 30003 ))) { 30004 result.push(key); 30005 } 30006 } 30007 return result; 30008 } 30009 30010 /** 30011 * A specialized version of `_.sample` for arrays. 30012 * 30013 * @private 30014 * @param {Array} array The array to sample. 30015 * @returns {*} Returns the random element. 30016 */ 30017 function arraySample(array) { 30018 var length = array.length; 30019 return length ? array[baseRandom(0, length - 1)] : undefined; 30020 } 30021 30022 /** 30023 * A specialized version of `_.sampleSize` for arrays. 30024 * 30025 * @private 30026 * @param {Array} array The array to sample. 30027 * @param {number} n The number of elements to sample. 30028 * @returns {Array} Returns the random elements. 30029 */ 30030 function arraySampleSize(array, n) { 30031 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); 30032 } 30033 30034 /** 30035 * A specialized version of `_.shuffle` for arrays. 30036 * 30037 * @private 30038 * @param {Array} array The array to shuffle. 30039 * @returns {Array} Returns the new shuffled array. 30040 */ 30041 function arrayShuffle(array) { 30042 return shuffleSelf(copyArray(array)); 30043 } 30044 30045 /** 30046 * This function is like `assignValue` except that it doesn't assign 30047 * `undefined` values. 30048 * 30049 * @private 30050 * @param {Object} object The object to modify. 30051 * @param {string} key The key of the property to assign. 30052 * @param {*} value The value to assign. 30053 */ 30054 function assignMergeValue(object, key, value) { 30055 if ((value !== undefined && !eq(object[key], value)) || 30056 (value === undefined && !(key in object))) { 30057 baseAssignValue(object, key, value); 30058 } 30059 } 30060 30061 /** 30062 * Assigns `value` to `key` of `object` if the existing value is not equivalent 30063 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 30064 * for equality comparisons. 30065 * 30066 * @private 30067 * @param {Object} object The object to modify. 30068 * @param {string} key The key of the property to assign. 30069 * @param {*} value The value to assign. 30070 */ 30071 function assignValue(object, key, value) { 30072 var objValue = object[key]; 30073 if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || 30074 (value === undefined && !(key in object))) { 30075 baseAssignValue(object, key, value); 30076 } 30077 } 30078 30079 /** 30080 * Gets the index at which the `key` is found in `array` of key-value pairs. 30081 * 30082 * @private 30083 * @param {Array} array The array to inspect. 30084 * @param {*} key The key to search for. 30085 * @returns {number} Returns the index of the matched value, else `-1`. 30086 */ 30087 function assocIndexOf(array, key) { 30088 var length = array.length; 30089 while (length--) { 30090 if (eq(array[length][0], key)) { 30091 return length; 30092 } 30093 } 30094 return -1; 30095 } 30096 30097 /** 30098 * Aggregates elements of `collection` on `accumulator` with keys transformed 30099 * by `iteratee` and values set by `setter`. 30100 * 30101 * @private 30102 * @param {Array|Object} collection The collection to iterate over. 30103 * @param {Function} setter The function to set `accumulator` values. 30104 * @param {Function} iteratee The iteratee to transform keys. 30105 * @param {Object} accumulator The initial aggregated object. 30106 * @returns {Function} Returns `accumulator`. 30107 */ 30108 function baseAggregator(collection, setter, iteratee, accumulator) { 30109 baseEach(collection, function(value, key, collection) { 30110 setter(accumulator, value, iteratee(value), collection); 30111 }); 30112 return accumulator; 30113 } 30114 30115 /** 30116 * The base implementation of `_.assign` without support for multiple sources 30117 * or `customizer` functions. 30118 * 30119 * @private 30120 * @param {Object} object The destination object. 30121 * @param {Object} source The source object. 30122 * @returns {Object} Returns `object`. 30123 */ 30124 function baseAssign(object, source) { 30125 return object && copyObject(source, keys(source), object); 30126 } 30127 30128 /** 30129 * The base implementation of `_.assignIn` without support for multiple sources 30130 * or `customizer` functions. 30131 * 30132 * @private 30133 * @param {Object} object The destination object. 30134 * @param {Object} source The source object. 30135 * @returns {Object} Returns `object`. 30136 */ 30137 function baseAssignIn(object, source) { 30138 return object && copyObject(source, keysIn(source), object); 30139 } 30140 30141 /** 30142 * The base implementation of `assignValue` and `assignMergeValue` without 30143 * value checks. 30144 * 30145 * @private 30146 * @param {Object} object The object to modify. 30147 * @param {string} key The key of the property to assign. 30148 * @param {*} value The value to assign. 30149 */ 30150 function baseAssignValue(object, key, value) { 30151 if (key == '__proto__' && defineProperty) { 30152 defineProperty(object, key, { 30153 'configurable': true, 30154 'enumerable': true, 30155 'value': value, 30156 'writable': true 30157 }); 30158 } else { 30159 object[key] = value; 30160 } 30161 } 30162 30163 /** 30164 * The base implementation of `_.at` without support for individual paths. 30165 * 30166 * @private 30167 * @param {Object} object The object to iterate over. 30168 * @param {string[]} paths The property paths to pick. 30169 * @returns {Array} Returns the picked elements. 30170 */ 30171 function baseAt(object, paths) { 30172 var index = -1, 30173 length = paths.length, 30174 result = Array(length), 30175 skip = object == null; 30176 30177 while (++index < length) { 30178 result[index] = skip ? undefined : get(object, paths[index]); 30179 } 30180 return result; 30181 } 30182 30183 /** 30184 * The base implementation of `_.clamp` which doesn't coerce arguments. 30185 * 30186 * @private 30187 * @param {number} number The number to clamp. 30188 * @param {number} [lower] The lower bound. 30189 * @param {number} upper The upper bound. 30190 * @returns {number} Returns the clamped number. 30191 */ 30192 function baseClamp(number, lower, upper) { 30193 if (number === number) { 30194 if (upper !== undefined) { 30195 number = number <= upper ? number : upper; 30196 } 30197 if (lower !== undefined) { 30198 number = number >= lower ? number : lower; 30199 } 30200 } 30201 return number; 30202 } 30203 30204 /** 30205 * The base implementation of `_.clone` and `_.cloneDeep` which tracks 30206 * traversed objects. 30207 * 30208 * @private 30209 * @param {*} value The value to clone. 30210 * @param {boolean} bitmask The bitmask flags. 30211 * 1 - Deep clone 30212 * 2 - Flatten inherited properties 30213 * 4 - Clone symbols 30214 * @param {Function} [customizer] The function to customize cloning. 30215 * @param {string} [key] The key of `value`. 30216 * @param {Object} [object] The parent object of `value`. 30217 * @param {Object} [stack] Tracks traversed objects and their clone counterparts. 30218 * @returns {*} Returns the cloned value. 30219 */ 30220 function baseClone(value, bitmask, customizer, key, object, stack) { 30221 var result, 30222 isDeep = bitmask & CLONE_DEEP_FLAG, 30223 isFlat = bitmask & CLONE_FLAT_FLAG, 30224 isFull = bitmask & CLONE_SYMBOLS_FLAG; 30225 30226 if (customizer) { 30227 result = object ? customizer(value, key, object, stack) : customizer(value); 30228 } 30229 if (result !== undefined) { 30230 return result; 30231 } 30232 if (!isObject(value)) { 30233 return value; 30234 } 30235 var isArr = isArray(value); 30236 if (isArr) { 30237 result = initCloneArray(value); 30238 if (!isDeep) { 30239 return copyArray(value, result); 30240 } 30241 } else { 30242 var tag = getTag(value), 30243 isFunc = tag == funcTag || tag == genTag; 30244 30245 if (isBuffer(value)) { 30246 return cloneBuffer(value, isDeep); 30247 } 30248 if (tag == objectTag || tag == argsTag || (isFunc && !object)) { 30249 result = (isFlat || isFunc) ? {} : initCloneObject(value); 30250 if (!isDeep) { 30251 return isFlat 30252 ? copySymbolsIn(value, baseAssignIn(result, value)) 30253 : copySymbols(value, baseAssign(result, value)); 30254 } 30255 } else { 30256 if (!cloneableTags[tag]) { 30257 return object ? value : {}; 30258 } 30259 result = initCloneByTag(value, tag, isDeep); 30260 } 30261 } 30262 // Check for circular references and return its corresponding clone. 30263 stack || (stack = new Stack); 30264 var stacked = stack.get(value); 30265 if (stacked) { 30266 return stacked; 30267 } 30268 stack.set(value, result); 30269 30270 if (isSet(value)) { 30271 value.forEach(function(subValue) { 30272 result.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); 30273 }); 30274 } else if (isMap(value)) { 30275 value.forEach(function(subValue, key) { 30276 result.set(key, baseClone(subValue, bitmask, customizer, key, value, stack)); 30277 }); 30278 } 30279 30280 var keysFunc = isFull 30281 ? (isFlat ? getAllKeysIn : getAllKeys) 30282 : (isFlat ? keysIn : keys); 30283 30284 var props = isArr ? undefined : keysFunc(value); 30285 arrayEach(props || value, function(subValue, key) { 30286 if (props) { 30287 key = subValue; 30288 subValue = value[key]; 30289 } 30290 // Recursively populate clone (susceptible to call stack limits). 30291 assignValue(result, key, baseClone(subValue, bitmask, customizer, key, value, stack)); 30292 }); 30293 return result; 30294 } 30295 30296 /** 30297 * The base implementation of `_.conforms` which doesn't clone `source`. 30298 * 30299 * @private 30300 * @param {Object} source The object of property predicates to conform to. 30301 * @returns {Function} Returns the new spec function. 30302 */ 30303 function baseConforms(source) { 30304 var props = keys(source); 30305 return function(object) { 30306 return baseConformsTo(object, source, props); 30307 }; 30308 } 30309 30310 /** 30311 * The base implementation of `_.conformsTo` which accepts `props` to check. 30312 * 30313 * @private 30314 * @param {Object} object The object to inspect. 30315 * @param {Object} source The object of property predicates to conform to. 30316 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 30317 */ 30318 function baseConformsTo(object, source, props) { 30319 var length = props.length; 30320 if (object == null) { 30321 return !length; 30322 } 30323 object = Object(object); 30324 while (length--) { 30325 var key = props[length], 30326 predicate = source[key], 30327 value = object[key]; 30328 30329 if ((value === undefined && !(key in object)) || !predicate(value)) { 30330 return false; 30331 } 30332 } 30333 return true; 30334 } 30335 30336 /** 30337 * The base implementation of `_.delay` and `_.defer` which accepts `args` 30338 * to provide to `func`. 30339 * 30340 * @private 30341 * @param {Function} func The function to delay. 30342 * @param {number} wait The number of milliseconds to delay invocation. 30343 * @param {Array} args The arguments to provide to `func`. 30344 * @returns {number|Object} Returns the timer id or timeout object. 30345 */ 30346 function baseDelay(func, wait, args) { 30347 if (typeof func != 'function') { 30348 throw new TypeError(FUNC_ERROR_TEXT); 30349 } 30350 return setTimeout(function() { func.apply(undefined, args); }, wait); 30351 } 30352 30353 /** 30354 * The base implementation of methods like `_.difference` without support 30355 * for excluding multiple arrays or iteratee shorthands. 30356 * 30357 * @private 30358 * @param {Array} array The array to inspect. 30359 * @param {Array} values The values to exclude. 30360 * @param {Function} [iteratee] The iteratee invoked per element. 30361 * @param {Function} [comparator] The comparator invoked per element. 30362 * @returns {Array} Returns the new array of filtered values. 30363 */ 30364 function baseDifference(array, values, iteratee, comparator) { 30365 var index = -1, 30366 includes = arrayIncludes, 30367 isCommon = true, 30368 length = array.length, 30369 result = [], 30370 valuesLength = values.length; 30371 30372 if (!length) { 30373 return result; 30374 } 30375 if (iteratee) { 30376 values = arrayMap(values, baseUnary(iteratee)); 30377 } 30378 if (comparator) { 30379 includes = arrayIncludesWith; 30380 isCommon = false; 30381 } 30382 else if (values.length >= LARGE_ARRAY_SIZE) { 30383 includes = cacheHas; 30384 isCommon = false; 30385 values = new SetCache(values); 30386 } 30387 outer: 30388 while (++index < length) { 30389 var value = array[index], 30390 computed = iteratee == null ? value : iteratee(value); 30391 30392 value = (comparator || value !== 0) ? value : 0; 30393 if (isCommon && computed === computed) { 30394 var valuesIndex = valuesLength; 30395 while (valuesIndex--) { 30396 if (values[valuesIndex] === computed) { 30397 continue outer; 30398 } 30399 } 30400 result.push(value); 30401 } 30402 else if (!includes(values, computed, comparator)) { 30403 result.push(value); 30404 } 30405 } 30406 return result; 30407 } 30408 30409 /** 30410 * The base implementation of `_.forEach` without support for iteratee shorthands. 30411 * 30412 * @private 30413 * @param {Array|Object} collection The collection to iterate over. 30414 * @param {Function} iteratee The function invoked per iteration. 30415 * @returns {Array|Object} Returns `collection`. 30416 */ 30417 var baseEach = createBaseEach(baseForOwn); 30418 30419 /** 30420 * The base implementation of `_.forEachRight` without support for iteratee shorthands. 30421 * 30422 * @private 30423 * @param {Array|Object} collection The collection to iterate over. 30424 * @param {Function} iteratee The function invoked per iteration. 30425 * @returns {Array|Object} Returns `collection`. 30426 */ 30427 var baseEachRight = createBaseEach(baseForOwnRight, true); 30428 30429 /** 30430 * The base implementation of `_.every` without support for iteratee shorthands. 30431 * 30432 * @private 30433 * @param {Array|Object} collection The collection to iterate over. 30434 * @param {Function} predicate The function invoked per iteration. 30435 * @returns {boolean} Returns `true` if all elements pass the predicate check, 30436 * else `false` 30437 */ 30438 function baseEvery(collection, predicate) { 30439 var result = true; 30440 baseEach(collection, function(value, index, collection) { 30441 result = !!predicate(value, index, collection); 30442 return result; 30443 }); 30444 return result; 30445 } 30446 30447 /** 30448 * The base implementation of methods like `_.max` and `_.min` which accepts a 30449 * `comparator` to determine the extremum value. 30450 * 30451 * @private 30452 * @param {Array} array The array to iterate over. 30453 * @param {Function} iteratee The iteratee invoked per iteration. 30454 * @param {Function} comparator The comparator used to compare values. 30455 * @returns {*} Returns the extremum value. 30456 */ 30457 function baseExtremum(array, iteratee, comparator) { 30458 var index = -1, 30459 length = array.length; 30460 30461 while (++index < length) { 30462 var value = array[index], 30463 current = iteratee(value); 30464 30465 if (current != null && (computed === undefined 30466 ? (current === current && !isSymbol(current)) 30467 : comparator(current, computed) 30468 )) { 30469 var computed = current, 30470 result = value; 30471 } 30472 } 30473 return result; 30474 } 30475 30476 /** 30477 * The base implementation of `_.fill` without an iteratee call guard. 30478 * 30479 * @private 30480 * @param {Array} array The array to fill. 30481 * @param {*} value The value to fill `array` with. 30482 * @param {number} [start=0] The start position. 30483 * @param {number} [end=array.length] The end position. 30484 * @returns {Array} Returns `array`. 30485 */ 30486 function baseFill(array, value, start, end) { 30487 var length = array.length; 30488 30489 start = toInteger(start); 30490 if (start < 0) { 30491 start = -start > length ? 0 : (length + start); 30492 } 30493 end = (end === undefined || end > length) ? length : toInteger(end); 30494 if (end < 0) { 30495 end += length; 30496 } 30497 end = start > end ? 0 : toLength(end); 30498 while (start < end) { 30499 array[start++] = value; 30500 } 30501 return array; 30502 } 30503 30504 /** 30505 * The base implementation of `_.filter` without support for iteratee shorthands. 30506 * 30507 * @private 30508 * @param {Array|Object} collection The collection to iterate over. 30509 * @param {Function} predicate The function invoked per iteration. 30510 * @returns {Array} Returns the new filtered array. 30511 */ 30512 function baseFilter(collection, predicate) { 30513 var result = []; 30514 baseEach(collection, function(value, index, collection) { 30515 if (predicate(value, index, collection)) { 30516 result.push(value); 30517 } 30518 }); 30519 return result; 30520 } 30521 30522 /** 30523 * The base implementation of `_.flatten` with support for restricting flattening. 30524 * 30525 * @private 30526 * @param {Array} array The array to flatten. 30527 * @param {number} depth The maximum recursion depth. 30528 * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. 30529 * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. 30530 * @param {Array} [result=[]] The initial result value. 30531 * @returns {Array} Returns the new flattened array. 30532 */ 30533 function baseFlatten(array, depth, predicate, isStrict, result) { 30534 var index = -1, 30535 length = array.length; 30536 30537 predicate || (predicate = isFlattenable); 30538 result || (result = []); 30539 30540 while (++index < length) { 30541 var value = array[index]; 30542 if (depth > 0 && predicate(value)) { 30543 if (depth > 1) { 30544 // Recursively flatten arrays (susceptible to call stack limits). 30545 baseFlatten(value, depth - 1, predicate, isStrict, result); 30546 } else { 30547 arrayPush(result, value); 30548 } 30549 } else if (!isStrict) { 30550 result[result.length] = value; 30551 } 30552 } 30553 return result; 30554 } 30555 30556 /** 30557 * The base implementation of `baseForOwn` which iterates over `object` 30558 * properties returned by `keysFunc` and invokes `iteratee` for each property. 30559 * Iteratee functions may exit iteration early by explicitly returning `false`. 30560 * 30561 * @private 30562 * @param {Object} object The object to iterate over. 30563 * @param {Function} iteratee The function invoked per iteration. 30564 * @param {Function} keysFunc The function to get the keys of `object`. 30565 * @returns {Object} Returns `object`. 30566 */ 30567 var baseFor = createBaseFor(); 30568 30569 /** 30570 * This function is like `baseFor` except that it iterates over properties 30571 * in the opposite order. 30572 * 30573 * @private 30574 * @param {Object} object The object to iterate over. 30575 * @param {Function} iteratee The function invoked per iteration. 30576 * @param {Function} keysFunc The function to get the keys of `object`. 30577 * @returns {Object} Returns `object`. 30578 */ 30579 var baseForRight = createBaseFor(true); 30580 30581 /** 30582 * The base implementation of `_.forOwn` without support for iteratee shorthands. 30583 * 30584 * @private 30585 * @param {Object} object The object to iterate over. 30586 * @param {Function} iteratee The function invoked per iteration. 30587 * @returns {Object} Returns `object`. 30588 */ 30589 function baseForOwn(object, iteratee) { 30590 return object && baseFor(object, iteratee, keys); 30591 } 30592 30593 /** 30594 * The base implementation of `_.forOwnRight` without support for iteratee shorthands. 30595 * 30596 * @private 30597 * @param {Object} object The object to iterate over. 30598 * @param {Function} iteratee The function invoked per iteration. 30599 * @returns {Object} Returns `object`. 30600 */ 30601 function baseForOwnRight(object, iteratee) { 30602 return object && baseForRight(object, iteratee, keys); 30603 } 30604 30605 /** 30606 * The base implementation of `_.functions` which creates an array of 30607 * `object` function property names filtered from `props`. 30608 * 30609 * @private 30610 * @param {Object} object The object to inspect. 30611 * @param {Array} props The property names to filter. 30612 * @returns {Array} Returns the function names. 30613 */ 30614 function baseFunctions(object, props) { 30615 return arrayFilter(props, function(key) { 30616 return isFunction(object[key]); 30617 }); 30618 } 30619 30620 /** 30621 * The base implementation of `_.get` without support for default values. 30622 * 30623 * @private 30624 * @param {Object} object The object to query. 30625 * @param {Array|string} path The path of the property to get. 30626 * @returns {*} Returns the resolved value. 30627 */ 30628 function baseGet(object, path) { 30629 path = castPath(path, object); 30630 30631 var index = 0, 30632 length = path.length; 30633 30634 while (object != null && index < length) { 30635 object = object[toKey(path[index++])]; 30636 } 30637 return (index && index == length) ? object : undefined; 30638 } 30639 30640 /** 30641 * The base implementation of `getAllKeys` and `getAllKeysIn` which uses 30642 * `keysFunc` and `symbolsFunc` to get the enumerable property names and 30643 * symbols of `object`. 30644 * 30645 * @private 30646 * @param {Object} object The object to query. 30647 * @param {Function} keysFunc The function to get the keys of `object`. 30648 * @param {Function} symbolsFunc The function to get the symbols of `object`. 30649 * @returns {Array} Returns the array of property names and symbols. 30650 */ 30651 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 30652 var result = keysFunc(object); 30653 return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); 30654 } 30655 30656 /** 30657 * The base implementation of `getTag` without fallbacks for buggy environments. 30658 * 30659 * @private 30660 * @param {*} value The value to query. 30661 * @returns {string} Returns the `toStringTag`. 30662 */ 30663 function baseGetTag(value) { 30664 if (value == null) { 30665 return value === undefined ? undefinedTag : nullTag; 30666 } 30667 return (symToStringTag && symToStringTag in Object(value)) 30668 ? getRawTag(value) 30669 : objectToString(value); 30670 } 30671 30672 /** 30673 * The base implementation of `_.gt` which doesn't coerce arguments. 30674 * 30675 * @private 30676 * @param {*} value The value to compare. 30677 * @param {*} other The other value to compare. 30678 * @returns {boolean} Returns `true` if `value` is greater than `other`, 30679 * else `false`. 30680 */ 30681 function baseGt(value, other) { 30682 return value > other; 30683 } 30684 30685 /** 30686 * The base implementation of `_.has` without support for deep paths. 30687 * 30688 * @private 30689 * @param {Object} [object] The object to query. 30690 * @param {Array|string} key The key to check. 30691 * @returns {boolean} Returns `true` if `key` exists, else `false`. 30692 */ 30693 function baseHas(object, key) { 30694 return object != null && hasOwnProperty.call(object, key); 30695 } 30696 30697 /** 30698 * The base implementation of `_.hasIn` without support for deep paths. 30699 * 30700 * @private 30701 * @param {Object} [object] The object to query. 30702 * @param {Array|string} key The key to check. 30703 * @returns {boolean} Returns `true` if `key` exists, else `false`. 30704 */ 30705 function baseHasIn(object, key) { 30706 return object != null && key in Object(object); 30707 } 30708 30709 /** 30710 * The base implementation of `_.inRange` which doesn't coerce arguments. 30711 * 30712 * @private 30713 * @param {number} number The number to check. 30714 * @param {number} start The start of the range. 30715 * @param {number} end The end of the range. 30716 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 30717 */ 30718 function baseInRange(number, start, end) { 30719 return number >= nativeMin(start, end) && number < nativeMax(start, end); 30720 } 30721 30722 /** 30723 * The base implementation of methods like `_.intersection`, without support 30724 * for iteratee shorthands, that accepts an array of arrays to inspect. 30725 * 30726 * @private 30727 * @param {Array} arrays The arrays to inspect. 30728 * @param {Function} [iteratee] The iteratee invoked per element. 30729 * @param {Function} [comparator] The comparator invoked per element. 30730 * @returns {Array} Returns the new array of shared values. 30731 */ 30732 function baseIntersection(arrays, iteratee, comparator) { 30733 var includes = comparator ? arrayIncludesWith : arrayIncludes, 30734 length = arrays[0].length, 30735 othLength = arrays.length, 30736 othIndex = othLength, 30737 caches = Array(othLength), 30738 maxLength = Infinity, 30739 result = []; 30740 30741 while (othIndex--) { 30742 var array = arrays[othIndex]; 30743 if (othIndex && iteratee) { 30744 array = arrayMap(array, baseUnary(iteratee)); 30745 } 30746 maxLength = nativeMin(array.length, maxLength); 30747 caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) 30748 ? new SetCache(othIndex && array) 30749 : undefined; 30750 } 30751 array = arrays[0]; 30752 30753 var index = -1, 30754 seen = caches[0]; 30755 30756 outer: 30757 while (++index < length && result.length < maxLength) { 30758 var value = array[index], 30759 computed = iteratee ? iteratee(value) : value; 30760 30761 value = (comparator || value !== 0) ? value : 0; 30762 if (!(seen 30763 ? cacheHas(seen, computed) 30764 : includes(result, computed, comparator) 30765 )) { 30766 othIndex = othLength; 30767 while (--othIndex) { 30768 var cache = caches[othIndex]; 30769 if (!(cache 30770 ? cacheHas(cache, computed) 30771 : includes(arrays[othIndex], computed, comparator)) 30772 ) { 30773 continue outer; 30774 } 30775 } 30776 if (seen) { 30777 seen.push(computed); 30778 } 30779 result.push(value); 30780 } 30781 } 30782 return result; 30783 } 30784 30785 /** 30786 * The base implementation of `_.invert` and `_.invertBy` which inverts 30787 * `object` with values transformed by `iteratee` and set by `setter`. 30788 * 30789 * @private 30790 * @param {Object} object The object to iterate over. 30791 * @param {Function} setter The function to set `accumulator` values. 30792 * @param {Function} iteratee The iteratee to transform values. 30793 * @param {Object} accumulator The initial inverted object. 30794 * @returns {Function} Returns `accumulator`. 30795 */ 30796 function baseInverter(object, setter, iteratee, accumulator) { 30797 baseForOwn(object, function(value, key, object) { 30798 setter(accumulator, iteratee(value), key, object); 30799 }); 30800 return accumulator; 30801 } 30802 30803 /** 30804 * The base implementation of `_.invoke` without support for individual 30805 * method arguments. 30806 * 30807 * @private 30808 * @param {Object} object The object to query. 30809 * @param {Array|string} path The path of the method to invoke. 30810 * @param {Array} args The arguments to invoke the method with. 30811 * @returns {*} Returns the result of the invoked method. 30812 */ 30813 function baseInvoke(object, path, args) { 30814 path = castPath(path, object); 30815 object = parent(object, path); 30816 var func = object == null ? object : object[toKey(last(path))]; 30817 return func == null ? undefined : apply(func, object, args); 30818 } 30819 30820 /** 30821 * The base implementation of `_.isArguments`. 30822 * 30823 * @private 30824 * @param {*} value The value to check. 30825 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 30826 */ 30827 function baseIsArguments(value) { 30828 return isObjectLike(value) && baseGetTag(value) == argsTag; 30829 } 30830 30831 /** 30832 * The base implementation of `_.isArrayBuffer` without Node.js optimizations. 30833 * 30834 * @private 30835 * @param {*} value The value to check. 30836 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 30837 */ 30838 function baseIsArrayBuffer(value) { 30839 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; 30840 } 30841 30842 /** 30843 * The base implementation of `_.isDate` without Node.js optimizations. 30844 * 30845 * @private 30846 * @param {*} value The value to check. 30847 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 30848 */ 30849 function baseIsDate(value) { 30850 return isObjectLike(value) && baseGetTag(value) == dateTag; 30851 } 30852 30853 /** 30854 * The base implementation of `_.isEqual` which supports partial comparisons 30855 * and tracks traversed objects. 30856 * 30857 * @private 30858 * @param {*} value The value to compare. 30859 * @param {*} other The other value to compare. 30860 * @param {boolean} bitmask The bitmask flags. 30861 * 1 - Unordered comparison 30862 * 2 - Partial comparison 30863 * @param {Function} [customizer] The function to customize comparisons. 30864 * @param {Object} [stack] Tracks traversed `value` and `other` objects. 30865 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 30866 */ 30867 function baseIsEqual(value, other, bitmask, customizer, stack) { 30868 if (value === other) { 30869 return true; 30870 } 30871 if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) { 30872 return value !== value && other !== other; 30873 } 30874 return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); 30875 } 30876 30877 /** 30878 * A specialized version of `baseIsEqual` for arrays and objects which performs 30879 * deep comparisons and tracks traversed objects enabling objects with circular 30880 * references to be compared. 30881 * 30882 * @private 30883 * @param {Object} object The object to compare. 30884 * @param {Object} other The other object to compare. 30885 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 30886 * @param {Function} customizer The function to customize comparisons. 30887 * @param {Function} equalFunc The function to determine equivalents of values. 30888 * @param {Object} [stack] Tracks traversed `object` and `other` objects. 30889 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 30890 */ 30891 function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { 30892 var objIsArr = isArray(object), 30893 othIsArr = isArray(other), 30894 objTag = objIsArr ? arrayTag : getTag(object), 30895 othTag = othIsArr ? arrayTag : getTag(other); 30896 30897 objTag = objTag == argsTag ? objectTag : objTag; 30898 othTag = othTag == argsTag ? objectTag : othTag; 30899 30900 var objIsObj = objTag == objectTag, 30901 othIsObj = othTag == objectTag, 30902 isSameTag = objTag == othTag; 30903 30904 if (isSameTag && isBuffer(object)) { 30905 if (!isBuffer(other)) { 30906 return false; 30907 } 30908 objIsArr = true; 30909 objIsObj = false; 30910 } 30911 if (isSameTag && !objIsObj) { 30912 stack || (stack = new Stack); 30913 return (objIsArr || isTypedArray(object)) 30914 ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) 30915 : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); 30916 } 30917 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 30918 var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), 30919 othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); 30920 30921 if (objIsWrapped || othIsWrapped) { 30922 var objUnwrapped = objIsWrapped ? object.value() : object, 30923 othUnwrapped = othIsWrapped ? other.value() : other; 30924 30925 stack || (stack = new Stack); 30926 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); 30927 } 30928 } 30929 if (!isSameTag) { 30930 return false; 30931 } 30932 stack || (stack = new Stack); 30933 return equalObjects(object, other, bitmask, customizer, equalFunc, stack); 30934 } 30935 30936 /** 30937 * The base implementation of `_.isMap` without Node.js optimizations. 30938 * 30939 * @private 30940 * @param {*} value The value to check. 30941 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 30942 */ 30943 function baseIsMap(value) { 30944 return isObjectLike(value) && getTag(value) == mapTag; 30945 } 30946 30947 /** 30948 * The base implementation of `_.isMatch` without support for iteratee shorthands. 30949 * 30950 * @private 30951 * @param {Object} object The object to inspect. 30952 * @param {Object} source The object of property values to match. 30953 * @param {Array} matchData The property names, values, and compare flags to match. 30954 * @param {Function} [customizer] The function to customize comparisons. 30955 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 30956 */ 30957 function baseIsMatch(object, source, matchData, customizer) { 30958 var index = matchData.length, 30959 length = index, 30960 noCustomizer = !customizer; 30961 30962 if (object == null) { 30963 return !length; 30964 } 30965 object = Object(object); 30966 while (index--) { 30967 var data = matchData[index]; 30968 if ((noCustomizer && data[2]) 30969 ? data[1] !== object[data[0]] 30970 : !(data[0] in object) 30971 ) { 30972 return false; 30973 } 30974 } 30975 while (++index < length) { 30976 data = matchData[index]; 30977 var key = data[0], 30978 objValue = object[key], 30979 srcValue = data[1]; 30980 30981 if (noCustomizer && data[2]) { 30982 if (objValue === undefined && !(key in object)) { 30983 return false; 30984 } 30985 } else { 30986 var stack = new Stack; 30987 if (customizer) { 30988 var result = customizer(objValue, srcValue, key, object, source, stack); 30989 } 30990 if (!(result === undefined 30991 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) 30992 : result 30993 )) { 30994 return false; 30995 } 30996 } 30997 } 30998 return true; 30999 } 31000 31001 /** 31002 * The base implementation of `_.isNative` without bad shim checks. 31003 * 31004 * @private 31005 * @param {*} value The value to check. 31006 * @returns {boolean} Returns `true` if `value` is a native function, 31007 * else `false`. 31008 */ 31009 function baseIsNative(value) { 31010 if (!isObject(value) || isMasked(value)) { 31011 return false; 31012 } 31013 var pattern = isFunction(value) ? reIsNative : reIsHostCtor; 31014 return pattern.test(toSource(value)); 31015 } 31016 31017 /** 31018 * The base implementation of `_.isRegExp` without Node.js optimizations. 31019 * 31020 * @private 31021 * @param {*} value The value to check. 31022 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 31023 */ 31024 function baseIsRegExp(value) { 31025 return isObjectLike(value) && baseGetTag(value) == regexpTag; 31026 } 31027 31028 /** 31029 * The base implementation of `_.isSet` without Node.js optimizations. 31030 * 31031 * @private 31032 * @param {*} value The value to check. 31033 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 31034 */ 31035 function baseIsSet(value) { 31036 return isObjectLike(value) && getTag(value) == setTag; 31037 } 31038 31039 /** 31040 * The base implementation of `_.isTypedArray` without Node.js optimizations. 31041 * 31042 * @private 31043 * @param {*} value The value to check. 31044 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 31045 */ 31046 function baseIsTypedArray(value) { 31047 return isObjectLike(value) && 31048 isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 31049 } 31050 31051 /** 31052 * The base implementation of `_.iteratee`. 31053 * 31054 * @private 31055 * @param {*} [value=_.identity] The value to convert to an iteratee. 31056 * @returns {Function} Returns the iteratee. 31057 */ 31058 function baseIteratee(value) { 31059 // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. 31060 // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. 31061 if (typeof value == 'function') { 31062 return value; 31063 } 31064 if (value == null) { 31065 return identity; 31066 } 31067 if (typeof value == 'object') { 31068 return isArray(value) 31069 ? baseMatchesProperty(value[0], value[1]) 31070 : baseMatches(value); 31071 } 31072 return property(value); 31073 } 31074 31075 /** 31076 * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. 31077 * 31078 * @private 31079 * @param {Object} object The object to query. 31080 * @returns {Array} Returns the array of property names. 31081 */ 31082 function baseKeys(object) { 31083 if (!isPrototype(object)) { 31084 return nativeKeys(object); 31085 } 31086 var result = []; 31087 for (var key in Object(object)) { 31088 if (hasOwnProperty.call(object, key) && key != 'constructor') { 31089 result.push(key); 31090 } 31091 } 31092 return result; 31093 } 31094 31095 /** 31096 * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. 31097 * 31098 * @private 31099 * @param {Object} object The object to query. 31100 * @returns {Array} Returns the array of property names. 31101 */ 31102 function baseKeysIn(object) { 31103 if (!isObject(object)) { 31104 return nativeKeysIn(object); 31105 } 31106 var isProto = isPrototype(object), 31107 result = []; 31108 31109 for (var key in object) { 31110 if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { 31111 result.push(key); 31112 } 31113 } 31114 return result; 31115 } 31116 31117 /** 31118 * The base implementation of `_.lt` which doesn't coerce arguments. 31119 * 31120 * @private 31121 * @param {*} value The value to compare. 31122 * @param {*} other The other value to compare. 31123 * @returns {boolean} Returns `true` if `value` is less than `other`, 31124 * else `false`. 31125 */ 31126 function baseLt(value, other) { 31127 return value < other; 31128 } 31129 31130 /** 31131 * The base implementation of `_.map` without support for iteratee shorthands. 31132 * 31133 * @private 31134 * @param {Array|Object} collection The collection to iterate over. 31135 * @param {Function} iteratee The function invoked per iteration. 31136 * @returns {Array} Returns the new mapped array. 31137 */ 31138 function baseMap(collection, iteratee) { 31139 var index = -1, 31140 result = isArrayLike(collection) ? Array(collection.length) : []; 31141 31142 baseEach(collection, function(value, key, collection) { 31143 result[++index] = iteratee(value, key, collection); 31144 }); 31145 return result; 31146 } 31147 31148 /** 31149 * The base implementation of `_.matches` which doesn't clone `source`. 31150 * 31151 * @private 31152 * @param {Object} source The object of property values to match. 31153 * @returns {Function} Returns the new spec function. 31154 */ 31155 function baseMatches(source) { 31156 var matchData = getMatchData(source); 31157 if (matchData.length == 1 && matchData[0][2]) { 31158 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 31159 } 31160 return function(object) { 31161 return object === source || baseIsMatch(object, source, matchData); 31162 }; 31163 } 31164 31165 /** 31166 * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. 31167 * 31168 * @private 31169 * @param {string} path The path of the property to get. 31170 * @param {*} srcValue The value to match. 31171 * @returns {Function} Returns the new spec function. 31172 */ 31173 function baseMatchesProperty(path, srcValue) { 31174 if (isKey(path) && isStrictComparable(srcValue)) { 31175 return matchesStrictComparable(toKey(path), srcValue); 31176 } 31177 return function(object) { 31178 var objValue = get(object, path); 31179 return (objValue === undefined && objValue === srcValue) 31180 ? hasIn(object, path) 31181 : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 31182 }; 31183 } 31184 31185 /** 31186 * The base implementation of `_.merge` without support for multiple sources. 31187 * 31188 * @private 31189 * @param {Object} object The destination object. 31190 * @param {Object} source The source object. 31191 * @param {number} srcIndex The index of `source`. 31192 * @param {Function} [customizer] The function to customize merged values. 31193 * @param {Object} [stack] Tracks traversed source values and their merged 31194 * counterparts. 31195 */ 31196 function baseMerge(object, source, srcIndex, customizer, stack) { 31197 if (object === source) { 31198 return; 31199 } 31200 baseFor(source, function(srcValue, key) { 31201 stack || (stack = new Stack); 31202 if (isObject(srcValue)) { 31203 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); 31204 } 31205 else { 31206 var newValue = customizer 31207 ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack) 31208 : undefined; 31209 31210 if (newValue === undefined) { 31211 newValue = srcValue; 31212 } 31213 assignMergeValue(object, key, newValue); 31214 } 31215 }, keysIn); 31216 } 31217 31218 /** 31219 * A specialized version of `baseMerge` for arrays and objects which performs 31220 * deep merges and tracks traversed objects enabling objects with circular 31221 * references to be merged. 31222 * 31223 * @private 31224 * @param {Object} object The destination object. 31225 * @param {Object} source The source object. 31226 * @param {string} key The key of the value to merge. 31227 * @param {number} srcIndex The index of `source`. 31228 * @param {Function} mergeFunc The function to merge values. 31229 * @param {Function} [customizer] The function to customize assigned values. 31230 * @param {Object} [stack] Tracks traversed source values and their merged 31231 * counterparts. 31232 */ 31233 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { 31234 var objValue = safeGet(object, key), 31235 srcValue = safeGet(source, key), 31236 stacked = stack.get(srcValue); 31237 31238 if (stacked) { 31239 assignMergeValue(object, key, stacked); 31240 return; 31241 } 31242 var newValue = customizer 31243 ? customizer(objValue, srcValue, (key + ''), object, source, stack) 31244 : undefined; 31245 31246 var isCommon = newValue === undefined; 31247 31248 if (isCommon) { 31249 var isArr = isArray(srcValue), 31250 isBuff = !isArr && isBuffer(srcValue), 31251 isTyped = !isArr && !isBuff && isTypedArray(srcValue); 31252 31253 newValue = srcValue; 31254 if (isArr || isBuff || isTyped) { 31255 if (isArray(objValue)) { 31256 newValue = objValue; 31257 } 31258 else if (isArrayLikeObject(objValue)) { 31259 newValue = copyArray(objValue); 31260 } 31261 else if (isBuff) { 31262 isCommon = false; 31263 newValue = cloneBuffer(srcValue, true); 31264 } 31265 else if (isTyped) { 31266 isCommon = false; 31267 newValue = cloneTypedArray(srcValue, true); 31268 } 31269 else { 31270 newValue = []; 31271 } 31272 } 31273 else if (isPlainObject(srcValue) || isArguments(srcValue)) { 31274 newValue = objValue; 31275 if (isArguments(objValue)) { 31276 newValue = toPlainObject(objValue); 31277 } 31278 else if (!isObject(objValue) || isFunction(objValue)) { 31279 newValue = initCloneObject(srcValue); 31280 } 31281 } 31282 else { 31283 isCommon = false; 31284 } 31285 } 31286 if (isCommon) { 31287 // Recursively merge objects and arrays (susceptible to call stack limits). 31288 stack.set(srcValue, newValue); 31289 mergeFunc(newValue, srcValue, srcIndex, customizer, stack); 31290 stack['delete'](srcValue); 31291 } 31292 assignMergeValue(object, key, newValue); 31293 } 31294 31295 /** 31296 * The base implementation of `_.nth` which doesn't coerce arguments. 31297 * 31298 * @private 31299 * @param {Array} array The array to query. 31300 * @param {number} n The index of the element to return. 31301 * @returns {*} Returns the nth element of `array`. 31302 */ 31303 function baseNth(array, n) { 31304 var length = array.length; 31305 if (!length) { 31306 return; 31307 } 31308 n += n < 0 ? length : 0; 31309 return isIndex(n, length) ? array[n] : undefined; 31310 } 31311 31312 /** 31313 * The base implementation of `_.orderBy` without param guards. 31314 * 31315 * @private 31316 * @param {Array|Object} collection The collection to iterate over. 31317 * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. 31318 * @param {string[]} orders The sort orders of `iteratees`. 31319 * @returns {Array} Returns the new sorted array. 31320 */ 31321 function baseOrderBy(collection, iteratees, orders) { 31322 if (iteratees.length) { 31323 iteratees = arrayMap(iteratees, function(iteratee) { 31324 if (isArray(iteratee)) { 31325 return function(value) { 31326 return baseGet(value, iteratee.length === 1 ? iteratee[0] : iteratee); 31327 } 31328 } 31329 return iteratee; 31330 }); 31331 } else { 31332 iteratees = [identity]; 31333 } 31334 31335 var index = -1; 31336 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 31337 31338 var result = baseMap(collection, function(value, key, collection) { 31339 var criteria = arrayMap(iteratees, function(iteratee) { 31340 return iteratee(value); 31341 }); 31342 return { 'criteria': criteria, 'index': ++index, 'value': value }; 31343 }); 31344 31345 return baseSortBy(result, function(object, other) { 31346 return compareMultiple(object, other, orders); 31347 }); 31348 } 31349 31350 /** 31351 * The base implementation of `_.pick` without support for individual 31352 * property identifiers. 31353 * 31354 * @private 31355 * @param {Object} object The source object. 31356 * @param {string[]} paths The property paths to pick. 31357 * @returns {Object} Returns the new object. 31358 */ 31359 function basePick(object, paths) { 31360 return basePickBy(object, paths, function(value, path) { 31361 return hasIn(object, path); 31362 }); 31363 } 31364 31365 /** 31366 * The base implementation of `_.pickBy` without support for iteratee shorthands. 31367 * 31368 * @private 31369 * @param {Object} object The source object. 31370 * @param {string[]} paths The property paths to pick. 31371 * @param {Function} predicate The function invoked per property. 31372 * @returns {Object} Returns the new object. 31373 */ 31374 function basePickBy(object, paths, predicate) { 31375 var index = -1, 31376 length = paths.length, 31377 result = {}; 31378 31379 while (++index < length) { 31380 var path = paths[index], 31381 value = baseGet(object, path); 31382 31383 if (predicate(value, path)) { 31384 baseSet(result, castPath(path, object), value); 31385 } 31386 } 31387 return result; 31388 } 31389 31390 /** 31391 * A specialized version of `baseProperty` which supports deep paths. 31392 * 31393 * @private 31394 * @param {Array|string} path The path of the property to get. 31395 * @returns {Function} Returns the new accessor function. 31396 */ 31397 function basePropertyDeep(path) { 31398 return function(object) { 31399 return baseGet(object, path); 31400 }; 31401 } 31402 31403 /** 31404 * The base implementation of `_.pullAllBy` without support for iteratee 31405 * shorthands. 31406 * 31407 * @private 31408 * @param {Array} array The array to modify. 31409 * @param {Array} values The values to remove. 31410 * @param {Function} [iteratee] The iteratee invoked per element. 31411 * @param {Function} [comparator] The comparator invoked per element. 31412 * @returns {Array} Returns `array`. 31413 */ 31414 function basePullAll(array, values, iteratee, comparator) { 31415 var indexOf = comparator ? baseIndexOfWith : baseIndexOf, 31416 index = -1, 31417 length = values.length, 31418 seen = array; 31419 31420 if (array === values) { 31421 values = copyArray(values); 31422 } 31423 if (iteratee) { 31424 seen = arrayMap(array, baseUnary(iteratee)); 31425 } 31426 while (++index < length) { 31427 var fromIndex = 0, 31428 value = values[index], 31429 computed = iteratee ? iteratee(value) : value; 31430 31431 while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { 31432 if (seen !== array) { 31433 splice.call(seen, fromIndex, 1); 31434 } 31435 splice.call(array, fromIndex, 1); 31436 } 31437 } 31438 return array; 31439 } 31440 31441 /** 31442 * The base implementation of `_.pullAt` without support for individual 31443 * indexes or capturing the removed elements. 31444 * 31445 * @private 31446 * @param {Array} array The array to modify. 31447 * @param {number[]} indexes The indexes of elements to remove. 31448 * @returns {Array} Returns `array`. 31449 */ 31450 function basePullAt(array, indexes) { 31451 var length = array ? indexes.length : 0, 31452 lastIndex = length - 1; 31453 31454 while (length--) { 31455 var index = indexes[length]; 31456 if (length == lastIndex || index !== previous) { 31457 var previous = index; 31458 if (isIndex(index)) { 31459 splice.call(array, index, 1); 31460 } else { 31461 baseUnset(array, index); 31462 } 31463 } 31464 } 31465 return array; 31466 } 31467 31468 /** 31469 * The base implementation of `_.random` without support for returning 31470 * floating-point numbers. 31471 * 31472 * @private 31473 * @param {number} lower The lower bound. 31474 * @param {number} upper The upper bound. 31475 * @returns {number} Returns the random number. 31476 */ 31477 function baseRandom(lower, upper) { 31478 return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); 31479 } 31480 31481 /** 31482 * The base implementation of `_.range` and `_.rangeRight` which doesn't 31483 * coerce arguments. 31484 * 31485 * @private 31486 * @param {number} start The start of the range. 31487 * @param {number} end The end of the range. 31488 * @param {number} step The value to increment or decrement by. 31489 * @param {boolean} [fromRight] Specify iterating from right to left. 31490 * @returns {Array} Returns the range of numbers. 31491 */ 31492 function baseRange(start, end, step, fromRight) { 31493 var index = -1, 31494 length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), 31495 result = Array(length); 31496 31497 while (length--) { 31498 result[fromRight ? length : ++index] = start; 31499 start += step; 31500 } 31501 return result; 31502 } 31503 31504 /** 31505 * The base implementation of `_.repeat` which doesn't coerce arguments. 31506 * 31507 * @private 31508 * @param {string} string The string to repeat. 31509 * @param {number} n The number of times to repeat the string. 31510 * @returns {string} Returns the repeated string. 31511 */ 31512 function baseRepeat(string, n) { 31513 var result = ''; 31514 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 31515 return result; 31516 } 31517 // Leverage the exponentiation by squaring algorithm for a faster repeat. 31518 // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. 31519 do { 31520 if (n % 2) { 31521 result += string; 31522 } 31523 n = nativeFloor(n / 2); 31524 if (n) { 31525 string += string; 31526 } 31527 } while (n); 31528 31529 return result; 31530 } 31531 31532 /** 31533 * The base implementation of `_.rest` which doesn't validate or coerce arguments. 31534 * 31535 * @private 31536 * @param {Function} func The function to apply a rest parameter to. 31537 * @param {number} [start=func.length-1] The start position of the rest parameter. 31538 * @returns {Function} Returns the new function. 31539 */ 31540 function baseRest(func, start) { 31541 return setToString(overRest(func, start, identity), func + ''); 31542 } 31543 31544 /** 31545 * The base implementation of `_.sample`. 31546 * 31547 * @private 31548 * @param {Array|Object} collection The collection to sample. 31549 * @returns {*} Returns the random element. 31550 */ 31551 function baseSample(collection) { 31552 return arraySample(values(collection)); 31553 } 31554 31555 /** 31556 * The base implementation of `_.sampleSize` without param guards. 31557 * 31558 * @private 31559 * @param {Array|Object} collection The collection to sample. 31560 * @param {number} n The number of elements to sample. 31561 * @returns {Array} Returns the random elements. 31562 */ 31563 function baseSampleSize(collection, n) { 31564 var array = values(collection); 31565 return shuffleSelf(array, baseClamp(n, 0, array.length)); 31566 } 31567 31568 /** 31569 * The base implementation of `_.set`. 31570 * 31571 * @private 31572 * @param {Object} object The object to modify. 31573 * @param {Array|string} path The path of the property to set. 31574 * @param {*} value The value to set. 31575 * @param {Function} [customizer] The function to customize path creation. 31576 * @returns {Object} Returns `object`. 31577 */ 31578 function baseSet(object, path, value, customizer) { 31579 if (!isObject(object)) { 31580 return object; 31581 } 31582 path = castPath(path, object); 31583 31584 var index = -1, 31585 length = path.length, 31586 lastIndex = length - 1, 31587 nested = object; 31588 31589 while (nested != null && ++index < length) { 31590 var key = toKey(path[index]), 31591 newValue = value; 31592 31593 if (key === '__proto__' || key === 'constructor' || key === 'prototype') { 31594 return object; 31595 } 31596 31597 if (index != lastIndex) { 31598 var objValue = nested[key]; 31599 newValue = customizer ? customizer(objValue, key, nested) : undefined; 31600 if (newValue === undefined) { 31601 newValue = isObject(objValue) 31602 ? objValue 31603 : (isIndex(path[index + 1]) ? [] : {}); 31604 } 31605 } 31606 assignValue(nested, key, newValue); 31607 nested = nested[key]; 31608 } 31609 return object; 31610 } 31611 31612 /** 31613 * The base implementation of `setData` without support for hot loop shorting. 31614 * 31615 * @private 31616 * @param {Function} func The function to associate metadata with. 31617 * @param {*} data The metadata. 31618 * @returns {Function} Returns `func`. 31619 */ 31620 var baseSetData = !metaMap ? identity : function(func, data) { 31621 metaMap.set(func, data); 31622 return func; 31623 }; 31624 31625 /** 31626 * The base implementation of `setToString` without support for hot loop shorting. 31627 * 31628 * @private 31629 * @param {Function} func The function to modify. 31630 * @param {Function} string The `toString` result. 31631 * @returns {Function} Returns `func`. 31632 */ 31633 var baseSetToString = !defineProperty ? identity : function(func, string) { 31634 return defineProperty(func, 'toString', { 31635 'configurable': true, 31636 'enumerable': false, 31637 'value': constant(string), 31638 'writable': true 31639 }); 31640 }; 31641 31642 /** 31643 * The base implementation of `_.shuffle`. 31644 * 31645 * @private 31646 * @param {Array|Object} collection The collection to shuffle. 31647 * @returns {Array} Returns the new shuffled array. 31648 */ 31649 function baseShuffle(collection) { 31650 return shuffleSelf(values(collection)); 31651 } 31652 31653 /** 31654 * The base implementation of `_.slice` without an iteratee call guard. 31655 * 31656 * @private 31657 * @param {Array} array The array to slice. 31658 * @param {number} [start=0] The start position. 31659 * @param {number} [end=array.length] The end position. 31660 * @returns {Array} Returns the slice of `array`. 31661 */ 31662 function baseSlice(array, start, end) { 31663 var index = -1, 31664 length = array.length; 31665 31666 if (start < 0) { 31667 start = -start > length ? 0 : (length + start); 31668 } 31669 end = end > length ? length : end; 31670 if (end < 0) { 31671 end += length; 31672 } 31673 length = start > end ? 0 : ((end - start) >>> 0); 31674 start >>>= 0; 31675 31676 var result = Array(length); 31677 while (++index < length) { 31678 result[index] = array[index + start]; 31679 } 31680 return result; 31681 } 31682 31683 /** 31684 * The base implementation of `_.some` without support for iteratee shorthands. 31685 * 31686 * @private 31687 * @param {Array|Object} collection The collection to iterate over. 31688 * @param {Function} predicate The function invoked per iteration. 31689 * @returns {boolean} Returns `true` if any element passes the predicate check, 31690 * else `false`. 31691 */ 31692 function baseSome(collection, predicate) { 31693 var result; 31694 31695 baseEach(collection, function(value, index, collection) { 31696 result = predicate(value, index, collection); 31697 return !result; 31698 }); 31699 return !!result; 31700 } 31701 31702 /** 31703 * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which 31704 * performs a binary search of `array` to determine the index at which `value` 31705 * should be inserted into `array` in order to maintain its sort order. 31706 * 31707 * @private 31708 * @param {Array} array The sorted array to inspect. 31709 * @param {*} value The value to evaluate. 31710 * @param {boolean} [retHighest] Specify returning the highest qualified index. 31711 * @returns {number} Returns the index at which `value` should be inserted 31712 * into `array`. 31713 */ 31714 function baseSortedIndex(array, value, retHighest) { 31715 var low = 0, 31716 high = array == null ? low : array.length; 31717 31718 if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 31719 while (low < high) { 31720 var mid = (low + high) >>> 1, 31721 computed = array[mid]; 31722 31723 if (computed !== null && !isSymbol(computed) && 31724 (retHighest ? (computed <= value) : (computed < value))) { 31725 low = mid + 1; 31726 } else { 31727 high = mid; 31728 } 31729 } 31730 return high; 31731 } 31732 return baseSortedIndexBy(array, value, identity, retHighest); 31733 } 31734 31735 /** 31736 * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` 31737 * which invokes `iteratee` for `value` and each element of `array` to compute 31738 * their sort ranking. The iteratee is invoked with one argument; (value). 31739 * 31740 * @private 31741 * @param {Array} array The sorted array to inspect. 31742 * @param {*} value The value to evaluate. 31743 * @param {Function} iteratee The iteratee invoked per element. 31744 * @param {boolean} [retHighest] Specify returning the highest qualified index. 31745 * @returns {number} Returns the index at which `value` should be inserted 31746 * into `array`. 31747 */ 31748 function baseSortedIndexBy(array, value, iteratee, retHighest) { 31749 var low = 0, 31750 high = array == null ? 0 : array.length; 31751 if (high === 0) { 31752 return 0; 31753 } 31754 31755 value = iteratee(value); 31756 var valIsNaN = value !== value, 31757 valIsNull = value === null, 31758 valIsSymbol = isSymbol(value), 31759 valIsUndefined = value === undefined; 31760 31761 while (low < high) { 31762 var mid = nativeFloor((low + high) / 2), 31763 computed = iteratee(array[mid]), 31764 othIsDefined = computed !== undefined, 31765 othIsNull = computed === null, 31766 othIsReflexive = computed === computed, 31767 othIsSymbol = isSymbol(computed); 31768 31769 if (valIsNaN) { 31770 var setLow = retHighest || othIsReflexive; 31771 } else if (valIsUndefined) { 31772 setLow = othIsReflexive && (retHighest || othIsDefined); 31773 } else if (valIsNull) { 31774 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); 31775 } else if (valIsSymbol) { 31776 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); 31777 } else if (othIsNull || othIsSymbol) { 31778 setLow = false; 31779 } else { 31780 setLow = retHighest ? (computed <= value) : (computed < value); 31781 } 31782 if (setLow) { 31783 low = mid + 1; 31784 } else { 31785 high = mid; 31786 } 31787 } 31788 return nativeMin(high, MAX_ARRAY_INDEX); 31789 } 31790 31791 /** 31792 * The base implementation of `_.sortedUniq` and `_.sortedUniqBy` without 31793 * support for iteratee shorthands. 31794 * 31795 * @private 31796 * @param {Array} array The array to inspect. 31797 * @param {Function} [iteratee] The iteratee invoked per element. 31798 * @returns {Array} Returns the new duplicate free array. 31799 */ 31800 function baseSortedUniq(array, iteratee) { 31801 var index = -1, 31802 length = array.length, 31803 resIndex = 0, 31804 result = []; 31805 31806 while (++index < length) { 31807 var value = array[index], 31808 computed = iteratee ? iteratee(value) : value; 31809 31810 if (!index || !eq(computed, seen)) { 31811 var seen = computed; 31812 result[resIndex++] = value === 0 ? 0 : value; 31813 } 31814 } 31815 return result; 31816 } 31817 31818 /** 31819 * The base implementation of `_.toNumber` which doesn't ensure correct 31820 * conversions of binary, hexadecimal, or octal string values. 31821 * 31822 * @private 31823 * @param {*} value The value to process. 31824 * @returns {number} Returns the number. 31825 */ 31826 function baseToNumber(value) { 31827 if (typeof value == 'number') { 31828 return value; 31829 } 31830 if (isSymbol(value)) { 31831 return NAN; 31832 } 31833 return +value; 31834 } 31835 31836 /** 31837 * The base implementation of `_.toString` which doesn't convert nullish 31838 * values to empty strings. 31839 * 31840 * @private 31841 * @param {*} value The value to process. 31842 * @returns {string} Returns the string. 31843 */ 31844 function baseToString(value) { 31845 // Exit early for strings to avoid a performance hit in some environments. 31846 if (typeof value == 'string') { 31847 return value; 31848 } 31849 if (isArray(value)) { 31850 // Recursively convert values (susceptible to call stack limits). 31851 return arrayMap(value, baseToString) + ''; 31852 } 31853 if (isSymbol(value)) { 31854 return symbolToString ? symbolToString.call(value) : ''; 31855 } 31856 var result = (value + ''); 31857 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 31858 } 31859 31860 /** 31861 * The base implementation of `_.uniqBy` without support for iteratee shorthands. 31862 * 31863 * @private 31864 * @param {Array} array The array to inspect. 31865 * @param {Function} [iteratee] The iteratee invoked per element. 31866 * @param {Function} [comparator] The comparator invoked per element. 31867 * @returns {Array} Returns the new duplicate free array. 31868 */ 31869 function baseUniq(array, iteratee, comparator) { 31870 var index = -1, 31871 includes = arrayIncludes, 31872 length = array.length, 31873 isCommon = true, 31874 result = [], 31875 seen = result; 31876 31877 if (comparator) { 31878 isCommon = false; 31879 includes = arrayIncludesWith; 31880 } 31881 else if (length >= LARGE_ARRAY_SIZE) { 31882 var set = iteratee ? null : createSet(array); 31883 if (set) { 31884 return setToArray(set); 31885 } 31886 isCommon = false; 31887 includes = cacheHas; 31888 seen = new SetCache; 31889 } 31890 else { 31891 seen = iteratee ? [] : result; 31892 } 31893 outer: 31894 while (++index < length) { 31895 var value = array[index], 31896 computed = iteratee ? iteratee(value) : value; 31897 31898 value = (comparator || value !== 0) ? value : 0; 31899 if (isCommon && computed === computed) { 31900 var seenIndex = seen.length; 31901 while (seenIndex--) { 31902 if (seen[seenIndex] === computed) { 31903 continue outer; 31904 } 31905 } 31906 if (iteratee) { 31907 seen.push(computed); 31908 } 31909 result.push(value); 31910 } 31911 else if (!includes(seen, computed, comparator)) { 31912 if (seen !== result) { 31913 seen.push(computed); 31914 } 31915 result.push(value); 31916 } 31917 } 31918 return result; 31919 } 31920 31921 /** 31922 * The base implementation of `_.unset`. 31923 * 31924 * @private 31925 * @param {Object} object The object to modify. 31926 * @param {Array|string} path The property path to unset. 31927 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 31928 */ 31929 function baseUnset(object, path) { 31930 path = castPath(path, object); 31931 object = parent(object, path); 31932 return object == null || delete object[toKey(last(path))]; 31933 } 31934 31935 /** 31936 * The base implementation of `_.update`. 31937 * 31938 * @private 31939 * @param {Object} object The object to modify. 31940 * @param {Array|string} path The path of the property to update. 31941 * @param {Function} updater The function to produce the updated value. 31942 * @param {Function} [customizer] The function to customize path creation. 31943 * @returns {Object} Returns `object`. 31944 */ 31945 function baseUpdate(object, path, updater, customizer) { 31946 return baseSet(object, path, updater(baseGet(object, path)), customizer); 31947 } 31948 31949 /** 31950 * The base implementation of methods like `_.dropWhile` and `_.takeWhile` 31951 * without support for iteratee shorthands. 31952 * 31953 * @private 31954 * @param {Array} array The array to query. 31955 * @param {Function} predicate The function invoked per iteration. 31956 * @param {boolean} [isDrop] Specify dropping elements instead of taking them. 31957 * @param {boolean} [fromRight] Specify iterating from right to left. 31958 * @returns {Array} Returns the slice of `array`. 31959 */ 31960 function baseWhile(array, predicate, isDrop, fromRight) { 31961 var length = array.length, 31962 index = fromRight ? length : -1; 31963 31964 while ((fromRight ? index-- : ++index < length) && 31965 predicate(array[index], index, array)) {} 31966 31967 return isDrop 31968 ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) 31969 : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); 31970 } 31971 31972 /** 31973 * The base implementation of `wrapperValue` which returns the result of 31974 * performing a sequence of actions on the unwrapped `value`, where each 31975 * successive action is supplied the return value of the previous. 31976 * 31977 * @private 31978 * @param {*} value The unwrapped value. 31979 * @param {Array} actions Actions to perform to resolve the unwrapped value. 31980 * @returns {*} Returns the resolved value. 31981 */ 31982 function baseWrapperValue(value, actions) { 31983 var result = value; 31984 if (result instanceof LazyWrapper) { 31985 result = result.value(); 31986 } 31987 return arrayReduce(actions, function(result, action) { 31988 return action.func.apply(action.thisArg, arrayPush([result], action.args)); 31989 }, result); 31990 } 31991 31992 /** 31993 * The base implementation of methods like `_.xor`, without support for 31994 * iteratee shorthands, that accepts an array of arrays to inspect. 31995 * 31996 * @private 31997 * @param {Array} arrays The arrays to inspect. 31998 * @param {Function} [iteratee] The iteratee invoked per element. 31999 * @param {Function} [comparator] The comparator invoked per element. 32000 * @returns {Array} Returns the new array of values. 32001 */ 32002 function baseXor(arrays, iteratee, comparator) { 32003 var length = arrays.length; 32004 if (length < 2) { 32005 return length ? baseUniq(arrays[0]) : []; 32006 } 32007 var index = -1, 32008 result = Array(length); 32009 32010 while (++index < length) { 32011 var array = arrays[index], 32012 othIndex = -1; 32013 32014 while (++othIndex < length) { 32015 if (othIndex != index) { 32016 result[index] = baseDifference(result[index] || array, arrays[othIndex], iteratee, comparator); 32017 } 32018 } 32019 } 32020 return baseUniq(baseFlatten(result, 1), iteratee, comparator); 32021 } 32022 32023 /** 32024 * This base implementation of `_.zipObject` which assigns values using `assignFunc`. 32025 * 32026 * @private 32027 * @param {Array} props The property identifiers. 32028 * @param {Array} values The property values. 32029 * @param {Function} assignFunc The function to assign values. 32030 * @returns {Object} Returns the new object. 32031 */ 32032 function baseZipObject(props, values, assignFunc) { 32033 var index = -1, 32034 length = props.length, 32035 valsLength = values.length, 32036 result = {}; 32037 32038 while (++index < length) { 32039 var value = index < valsLength ? values[index] : undefined; 32040 assignFunc(result, props[index], value); 32041 } 32042 return result; 32043 } 32044 32045 /** 32046 * Casts `value` to an empty array if it's not an array like object. 32047 * 32048 * @private 32049 * @param {*} value The value to inspect. 32050 * @returns {Array|Object} Returns the cast array-like object. 32051 */ 32052 function castArrayLikeObject(value) { 32053 return isArrayLikeObject(value) ? value : []; 32054 } 32055 32056 /** 32057 * Casts `value` to `identity` if it's not a function. 32058 * 32059 * @private 32060 * @param {*} value The value to inspect. 32061 * @returns {Function} Returns cast function. 32062 */ 32063 function castFunction(value) { 32064 return typeof value == 'function' ? value : identity; 32065 } 32066 32067 /** 32068 * Casts `value` to a path array if it's not one. 32069 * 32070 * @private 32071 * @param {*} value The value to inspect. 32072 * @param {Object} [object] The object to query keys on. 32073 * @returns {Array} Returns the cast property path array. 32074 */ 32075 function castPath(value, object) { 32076 if (isArray(value)) { 32077 return value; 32078 } 32079 return isKey(value, object) ? [value] : stringToPath(toString(value)); 32080 } 32081 32082 /** 32083 * A `baseRest` alias which can be replaced with `identity` by module 32084 * replacement plugins. 32085 * 32086 * @private 32087 * @type {Function} 32088 * @param {Function} func The function to apply a rest parameter to. 32089 * @returns {Function} Returns the new function. 32090 */ 32091 var castRest = baseRest; 32092 32093 /** 32094 * Casts `array` to a slice if it's needed. 32095 * 32096 * @private 32097 * @param {Array} array The array to inspect. 32098 * @param {number} start The start position. 32099 * @param {number} [end=array.length] The end position. 32100 * @returns {Array} Returns the cast slice. 32101 */ 32102 function castSlice(array, start, end) { 32103 var length = array.length; 32104 end = end === undefined ? length : end; 32105 return (!start && end >= length) ? array : baseSlice(array, start, end); 32106 } 32107 32108 /** 32109 * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). 32110 * 32111 * @private 32112 * @param {number|Object} id The timer id or timeout object of the timer to clear. 32113 */ 32114 var clearTimeout = ctxClearTimeout || function(id) { 32115 return root.clearTimeout(id); 32116 }; 32117 32118 /** 32119 * Creates a clone of `buffer`. 32120 * 32121 * @private 32122 * @param {Buffer} buffer The buffer to clone. 32123 * @param {boolean} [isDeep] Specify a deep clone. 32124 * @returns {Buffer} Returns the cloned buffer. 32125 */ 32126 function cloneBuffer(buffer, isDeep) { 32127 if (isDeep) { 32128 return buffer.slice(); 32129 } 32130 var length = buffer.length, 32131 result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); 32132 32133 buffer.copy(result); 32134 return result; 32135 } 32136 32137 /** 32138 * Creates a clone of `arrayBuffer`. 32139 * 32140 * @private 32141 * @param {ArrayBuffer} arrayBuffer The array buffer to clone. 32142 * @returns {ArrayBuffer} Returns the cloned array buffer. 32143 */ 32144 function cloneArrayBuffer(arrayBuffer) { 32145 var result = new arrayBuffer.constructor(arrayBuffer.byteLength); 32146 new Uint8Array(result).set(new Uint8Array(arrayBuffer)); 32147 return result; 32148 } 32149 32150 /** 32151 * Creates a clone of `dataView`. 32152 * 32153 * @private 32154 * @param {Object} dataView The data view to clone. 32155 * @param {boolean} [isDeep] Specify a deep clone. 32156 * @returns {Object} Returns the cloned data view. 32157 */ 32158 function cloneDataView(dataView, isDeep) { 32159 var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 32160 return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); 32161 } 32162 32163 /** 32164 * Creates a clone of `regexp`. 32165 * 32166 * @private 32167 * @param {Object} regexp The regexp to clone. 32168 * @returns {Object} Returns the cloned regexp. 32169 */ 32170 function cloneRegExp(regexp) { 32171 var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 32172 result.lastIndex = regexp.lastIndex; 32173 return result; 32174 } 32175 32176 /** 32177 * Creates a clone of the `symbol` object. 32178 * 32179 * @private 32180 * @param {Object} symbol The symbol object to clone. 32181 * @returns {Object} Returns the cloned symbol object. 32182 */ 32183 function cloneSymbol(symbol) { 32184 return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; 32185 } 32186 32187 /** 32188 * Creates a clone of `typedArray`. 32189 * 32190 * @private 32191 * @param {Object} typedArray The typed array to clone. 32192 * @param {boolean} [isDeep] Specify a deep clone. 32193 * @returns {Object} Returns the cloned typed array. 32194 */ 32195 function cloneTypedArray(typedArray, isDeep) { 32196 var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 32197 return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); 32198 } 32199 32200 /** 32201 * Compares values to sort them in ascending order. 32202 * 32203 * @private 32204 * @param {*} value The value to compare. 32205 * @param {*} other The other value to compare. 32206 * @returns {number} Returns the sort order indicator for `value`. 32207 */ 32208 function compareAscending(value, other) { 32209 if (value !== other) { 32210 var valIsDefined = value !== undefined, 32211 valIsNull = value === null, 32212 valIsReflexive = value === value, 32213 valIsSymbol = isSymbol(value); 32214 32215 var othIsDefined = other !== undefined, 32216 othIsNull = other === null, 32217 othIsReflexive = other === other, 32218 othIsSymbol = isSymbol(other); 32219 32220 if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) || 32221 (valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) || 32222 (valIsNull && othIsDefined && othIsReflexive) || 32223 (!valIsDefined && othIsReflexive) || 32224 !valIsReflexive) { 32225 return 1; 32226 } 32227 if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) || 32228 (othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) || 32229 (othIsNull && valIsDefined && valIsReflexive) || 32230 (!othIsDefined && valIsReflexive) || 32231 !othIsReflexive) { 32232 return -1; 32233 } 32234 } 32235 return 0; 32236 } 32237 32238 /** 32239 * Used by `_.orderBy` to compare multiple properties of a value to another 32240 * and stable sort them. 32241 * 32242 * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, 32243 * specify an order of "desc" for descending or "asc" for ascending sort order 32244 * of corresponding values. 32245 * 32246 * @private 32247 * @param {Object} object The object to compare. 32248 * @param {Object} other The other object to compare. 32249 * @param {boolean[]|string[]} orders The order to sort by for each property. 32250 * @returns {number} Returns the sort order indicator for `object`. 32251 */ 32252 function compareMultiple(object, other, orders) { 32253 var index = -1, 32254 objCriteria = object.criteria, 32255 othCriteria = other.criteria, 32256 length = objCriteria.length, 32257 ordersLength = orders.length; 32258 32259 while (++index < length) { 32260 var result = compareAscending(objCriteria[index], othCriteria[index]); 32261 if (result) { 32262 if (index >= ordersLength) { 32263 return result; 32264 } 32265 var order = orders[index]; 32266 return result * (order == 'desc' ? -1 : 1); 32267 } 32268 } 32269 // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications 32270 // that causes it, under certain circumstances, to provide the same value for 32271 // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 32272 // for more details. 32273 // 32274 // This also ensures a stable sort in V8 and other engines. 32275 // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. 32276 return object.index - other.index; 32277 } 32278 32279 /** 32280 * Creates an array that is the composition of partially applied arguments, 32281 * placeholders, and provided arguments into a single array of arguments. 32282 * 32283 * @private 32284 * @param {Array} args The provided arguments. 32285 * @param {Array} partials The arguments to prepend to those provided. 32286 * @param {Array} holders The `partials` placeholder indexes. 32287 * @params {boolean} [isCurried] Specify composing for a curried function. 32288 * @returns {Array} Returns the new array of composed arguments. 32289 */ 32290 function composeArgs(args, partials, holders, isCurried) { 32291 var argsIndex = -1, 32292 argsLength = args.length, 32293 holdersLength = holders.length, 32294 leftIndex = -1, 32295 leftLength = partials.length, 32296 rangeLength = nativeMax(argsLength - holdersLength, 0), 32297 result = Array(leftLength + rangeLength), 32298 isUncurried = !isCurried; 32299 32300 while (++leftIndex < leftLength) { 32301 result[leftIndex] = partials[leftIndex]; 32302 } 32303 while (++argsIndex < holdersLength) { 32304 if (isUncurried || argsIndex < argsLength) { 32305 result[holders[argsIndex]] = args[argsIndex]; 32306 } 32307 } 32308 while (rangeLength--) { 32309 result[leftIndex++] = args[argsIndex++]; 32310 } 32311 return result; 32312 } 32313 32314 /** 32315 * This function is like `composeArgs` except that the arguments composition 32316 * is tailored for `_.partialRight`. 32317 * 32318 * @private 32319 * @param {Array} args The provided arguments. 32320 * @param {Array} partials The arguments to append to those provided. 32321 * @param {Array} holders The `partials` placeholder indexes. 32322 * @params {boolean} [isCurried] Specify composing for a curried function. 32323 * @returns {Array} Returns the new array of composed arguments. 32324 */ 32325 function composeArgsRight(args, partials, holders, isCurried) { 32326 var argsIndex = -1, 32327 argsLength = args.length, 32328 holdersIndex = -1, 32329 holdersLength = holders.length, 32330 rightIndex = -1, 32331 rightLength = partials.length, 32332 rangeLength = nativeMax(argsLength - holdersLength, 0), 32333 result = Array(rangeLength + rightLength), 32334 isUncurried = !isCurried; 32335 32336 while (++argsIndex < rangeLength) { 32337 result[argsIndex] = args[argsIndex]; 32338 } 32339 var offset = argsIndex; 32340 while (++rightIndex < rightLength) { 32341 result[offset + rightIndex] = partials[rightIndex]; 32342 } 32343 while (++holdersIndex < holdersLength) { 32344 if (isUncurried || argsIndex < argsLength) { 32345 result[offset + holders[holdersIndex]] = args[argsIndex++]; 32346 } 32347 } 32348 return result; 32349 } 32350 32351 /** 32352 * Copies the values of `source` to `array`. 32353 * 32354 * @private 32355 * @param {Array} source The array to copy values from. 32356 * @param {Array} [array=[]] The array to copy values to. 32357 * @returns {Array} Returns `array`. 32358 */ 32359 function copyArray(source, array) { 32360 var index = -1, 32361 length = source.length; 32362 32363 array || (array = Array(length)); 32364 while (++index < length) { 32365 array[index] = source[index]; 32366 } 32367 return array; 32368 } 32369 32370 /** 32371 * Copies properties of `source` to `object`. 32372 * 32373 * @private 32374 * @param {Object} source The object to copy properties from. 32375 * @param {Array} props The property identifiers to copy. 32376 * @param {Object} [object={}] The object to copy properties to. 32377 * @param {Function} [customizer] The function to customize copied values. 32378 * @returns {Object} Returns `object`. 32379 */ 32380 function copyObject(source, props, object, customizer) { 32381 var isNew = !object; 32382 object || (object = {}); 32383 32384 var index = -1, 32385 length = props.length; 32386 32387 while (++index < length) { 32388 var key = props[index]; 32389 32390 var newValue = customizer 32391 ? customizer(object[key], source[key], key, object, source) 32392 : undefined; 32393 32394 if (newValue === undefined) { 32395 newValue = source[key]; 32396 } 32397 if (isNew) { 32398 baseAssignValue(object, key, newValue); 32399 } else { 32400 assignValue(object, key, newValue); 32401 } 32402 } 32403 return object; 32404 } 32405 32406 /** 32407 * Copies own symbols of `source` to `object`. 32408 * 32409 * @private 32410 * @param {Object} source The object to copy symbols from. 32411 * @param {Object} [object={}] The object to copy symbols to. 32412 * @returns {Object} Returns `object`. 32413 */ 32414 function copySymbols(source, object) { 32415 return copyObject(source, getSymbols(source), object); 32416 } 32417 32418 /** 32419 * Copies own and inherited symbols of `source` to `object`. 32420 * 32421 * @private 32422 * @param {Object} source The object to copy symbols from. 32423 * @param {Object} [object={}] The object to copy symbols to. 32424 * @returns {Object} Returns `object`. 32425 */ 32426 function copySymbolsIn(source, object) { 32427 return copyObject(source, getSymbolsIn(source), object); 32428 } 32429 32430 /** 32431 * Creates a function like `_.groupBy`. 32432 * 32433 * @private 32434 * @param {Function} setter The function to set accumulator values. 32435 * @param {Function} [initializer] The accumulator object initializer. 32436 * @returns {Function} Returns the new aggregator function. 32437 */ 32438 function createAggregator(setter, initializer) { 32439 return function(collection, iteratee) { 32440 var func = isArray(collection) ? arrayAggregator : baseAggregator, 32441 accumulator = initializer ? initializer() : {}; 32442 32443 return func(collection, setter, getIteratee(iteratee, 2), accumulator); 32444 }; 32445 } 32446 32447 /** 32448 * Creates a function like `_.assign`. 32449 * 32450 * @private 32451 * @param {Function} assigner The function to assign values. 32452 * @returns {Function} Returns the new assigner function. 32453 */ 32454 function createAssigner(assigner) { 32455 return baseRest(function(object, sources) { 32456 var index = -1, 32457 length = sources.length, 32458 customizer = length > 1 ? sources[length - 1] : undefined, 32459 guard = length > 2 ? sources[2] : undefined; 32460 32461 customizer = (assigner.length > 3 && typeof customizer == 'function') 32462 ? (length--, customizer) 32463 : undefined; 32464 32465 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 32466 customizer = length < 3 ? undefined : customizer; 32467 length = 1; 32468 } 32469 object = Object(object); 32470 while (++index < length) { 32471 var source = sources[index]; 32472 if (source) { 32473 assigner(object, source, index, customizer); 32474 } 32475 } 32476 return object; 32477 }); 32478 } 32479 32480 /** 32481 * Creates a `baseEach` or `baseEachRight` function. 32482 * 32483 * @private 32484 * @param {Function} eachFunc The function to iterate over a collection. 32485 * @param {boolean} [fromRight] Specify iterating from right to left. 32486 * @returns {Function} Returns the new base function. 32487 */ 32488 function createBaseEach(eachFunc, fromRight) { 32489 return function(collection, iteratee) { 32490 if (collection == null) { 32491 return collection; 32492 } 32493 if (!isArrayLike(collection)) { 32494 return eachFunc(collection, iteratee); 32495 } 32496 var length = collection.length, 32497 index = fromRight ? length : -1, 32498 iterable = Object(collection); 32499 32500 while ((fromRight ? index-- : ++index < length)) { 32501 if (iteratee(iterable[index], index, iterable) === false) { 32502 break; 32503 } 32504 } 32505 return collection; 32506 }; 32507 } 32508 32509 /** 32510 * Creates a base function for methods like `_.forIn` and `_.forOwn`. 32511 * 32512 * @private 32513 * @param {boolean} [fromRight] Specify iterating from right to left. 32514 * @returns {Function} Returns the new base function. 32515 */ 32516 function createBaseFor(fromRight) { 32517 return function(object, iteratee, keysFunc) { 32518 var index = -1, 32519 iterable = Object(object), 32520 props = keysFunc(object), 32521 length = props.length; 32522 32523 while (length--) { 32524 var key = props[fromRight ? length : ++index]; 32525 if (iteratee(iterable[key], key, iterable) === false) { 32526 break; 32527 } 32528 } 32529 return object; 32530 }; 32531 } 32532 32533 /** 32534 * Creates a function that wraps `func` to invoke it with the optional `this` 32535 * binding of `thisArg`. 32536 * 32537 * @private 32538 * @param {Function} func The function to wrap. 32539 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32540 * @param {*} [thisArg] The `this` binding of `func`. 32541 * @returns {Function} Returns the new wrapped function. 32542 */ 32543 function createBind(func, bitmask, thisArg) { 32544 var isBind = bitmask & WRAP_BIND_FLAG, 32545 Ctor = createCtor(func); 32546 32547 function wrapper() { 32548 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 32549 return fn.apply(isBind ? thisArg : this, arguments); 32550 } 32551 return wrapper; 32552 } 32553 32554 /** 32555 * Creates a function like `_.lowerFirst`. 32556 * 32557 * @private 32558 * @param {string} methodName The name of the `String` case method to use. 32559 * @returns {Function} Returns the new case function. 32560 */ 32561 function createCaseFirst(methodName) { 32562 return function(string) { 32563 string = toString(string); 32564 32565 var strSymbols = hasUnicode(string) 32566 ? stringToArray(string) 32567 : undefined; 32568 32569 var chr = strSymbols 32570 ? strSymbols[0] 32571 : string.charAt(0); 32572 32573 var trailing = strSymbols 32574 ? castSlice(strSymbols, 1).join('') 32575 : string.slice(1); 32576 32577 return chr[methodName]() + trailing; 32578 }; 32579 } 32580 32581 /** 32582 * Creates a function like `_.camelCase`. 32583 * 32584 * @private 32585 * @param {Function} callback The function to combine each word. 32586 * @returns {Function} Returns the new compounder function. 32587 */ 32588 function createCompounder(callback) { 32589 return function(string) { 32590 return arrayReduce(words(deburr(string).replace(reApos, '')), callback, ''); 32591 }; 32592 } 32593 32594 /** 32595 * Creates a function that produces an instance of `Ctor` regardless of 32596 * whether it was invoked as part of a `new` expression or by `call` or `apply`. 32597 * 32598 * @private 32599 * @param {Function} Ctor The constructor to wrap. 32600 * @returns {Function} Returns the new wrapped function. 32601 */ 32602 function createCtor(Ctor) { 32603 return function() { 32604 // Use a `switch` statement to work with class constructors. See 32605 // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist 32606 // for more details. 32607 var args = arguments; 32608 switch (args.length) { 32609 case 0: return new Ctor; 32610 case 1: return new Ctor(args[0]); 32611 case 2: return new Ctor(args[0], args[1]); 32612 case 3: return new Ctor(args[0], args[1], args[2]); 32613 case 4: return new Ctor(args[0], args[1], args[2], args[3]); 32614 case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); 32615 case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 32616 case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 32617 } 32618 var thisBinding = baseCreate(Ctor.prototype), 32619 result = Ctor.apply(thisBinding, args); 32620 32621 // Mimic the constructor's `return` behavior. 32622 // See https://es5.github.io/#x13.2.2 for more details. 32623 return isObject(result) ? result : thisBinding; 32624 }; 32625 } 32626 32627 /** 32628 * Creates a function that wraps `func` to enable currying. 32629 * 32630 * @private 32631 * @param {Function} func The function to wrap. 32632 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32633 * @param {number} arity The arity of `func`. 32634 * @returns {Function} Returns the new wrapped function. 32635 */ 32636 function createCurry(func, bitmask, arity) { 32637 var Ctor = createCtor(func); 32638 32639 function wrapper() { 32640 var length = arguments.length, 32641 args = Array(length), 32642 index = length, 32643 placeholder = getHolder(wrapper); 32644 32645 while (index--) { 32646 args[index] = arguments[index]; 32647 } 32648 var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) 32649 ? [] 32650 : replaceHolders(args, placeholder); 32651 32652 length -= holders.length; 32653 if (length < arity) { 32654 return createRecurry( 32655 func, bitmask, createHybrid, wrapper.placeholder, undefined, 32656 args, holders, undefined, undefined, arity - length); 32657 } 32658 var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 32659 return apply(fn, this, args); 32660 } 32661 return wrapper; 32662 } 32663 32664 /** 32665 * Creates a `_.find` or `_.findLast` function. 32666 * 32667 * @private 32668 * @param {Function} findIndexFunc The function to find the collection index. 32669 * @returns {Function} Returns the new find function. 32670 */ 32671 function createFind(findIndexFunc) { 32672 return function(collection, predicate, fromIndex) { 32673 var iterable = Object(collection); 32674 if (!isArrayLike(collection)) { 32675 var iteratee = getIteratee(predicate, 3); 32676 collection = keys(collection); 32677 predicate = function(key) { return iteratee(iterable[key], key, iterable); }; 32678 } 32679 var index = findIndexFunc(collection, predicate, fromIndex); 32680 return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; 32681 }; 32682 } 32683 32684 /** 32685 * Creates a `_.flow` or `_.flowRight` function. 32686 * 32687 * @private 32688 * @param {boolean} [fromRight] Specify iterating from right to left. 32689 * @returns {Function} Returns the new flow function. 32690 */ 32691 function createFlow(fromRight) { 32692 return flatRest(function(funcs) { 32693 var length = funcs.length, 32694 index = length, 32695 prereq = LodashWrapper.prototype.thru; 32696 32697 if (fromRight) { 32698 funcs.reverse(); 32699 } 32700 while (index--) { 32701 var func = funcs[index]; 32702 if (typeof func != 'function') { 32703 throw new TypeError(FUNC_ERROR_TEXT); 32704 } 32705 if (prereq && !wrapper && getFuncName(func) == 'wrapper') { 32706 var wrapper = new LodashWrapper([], true); 32707 } 32708 } 32709 index = wrapper ? index : length; 32710 while (++index < length) { 32711 func = funcs[index]; 32712 32713 var funcName = getFuncName(func), 32714 data = funcName == 'wrapper' ? getData(func) : undefined; 32715 32716 if (data && isLaziable(data[0]) && 32717 data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && 32718 !data[4].length && data[9] == 1 32719 ) { 32720 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); 32721 } else { 32722 wrapper = (func.length == 1 && isLaziable(func)) 32723 ? wrapper[funcName]() 32724 : wrapper.thru(func); 32725 } 32726 } 32727 return function() { 32728 var args = arguments, 32729 value = args[0]; 32730 32731 if (wrapper && args.length == 1 && isArray(value)) { 32732 return wrapper.plant(value).value(); 32733 } 32734 var index = 0, 32735 result = length ? funcs[index].apply(this, args) : value; 32736 32737 while (++index < length) { 32738 result = funcs[index].call(this, result); 32739 } 32740 return result; 32741 }; 32742 }); 32743 } 32744 32745 /** 32746 * Creates a function that wraps `func` to invoke it with optional `this` 32747 * binding of `thisArg`, partial application, and currying. 32748 * 32749 * @private 32750 * @param {Function|string} func The function or method name to wrap. 32751 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32752 * @param {*} [thisArg] The `this` binding of `func`. 32753 * @param {Array} [partials] The arguments to prepend to those provided to 32754 * the new function. 32755 * @param {Array} [holders] The `partials` placeholder indexes. 32756 * @param {Array} [partialsRight] The arguments to append to those provided 32757 * to the new function. 32758 * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. 32759 * @param {Array} [argPos] The argument positions of the new function. 32760 * @param {number} [ary] The arity cap of `func`. 32761 * @param {number} [arity] The arity of `func`. 32762 * @returns {Function} Returns the new wrapped function. 32763 */ 32764 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { 32765 var isAry = bitmask & WRAP_ARY_FLAG, 32766 isBind = bitmask & WRAP_BIND_FLAG, 32767 isBindKey = bitmask & WRAP_BIND_KEY_FLAG, 32768 isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), 32769 isFlip = bitmask & WRAP_FLIP_FLAG, 32770 Ctor = isBindKey ? undefined : createCtor(func); 32771 32772 function wrapper() { 32773 var length = arguments.length, 32774 args = Array(length), 32775 index = length; 32776 32777 while (index--) { 32778 args[index] = arguments[index]; 32779 } 32780 if (isCurried) { 32781 var placeholder = getHolder(wrapper), 32782 holdersCount = countHolders(args, placeholder); 32783 } 32784 if (partials) { 32785 args = composeArgs(args, partials, holders, isCurried); 32786 } 32787 if (partialsRight) { 32788 args = composeArgsRight(args, partialsRight, holdersRight, isCurried); 32789 } 32790 length -= holdersCount; 32791 if (isCurried && length < arity) { 32792 var newHolders = replaceHolders(args, placeholder); 32793 return createRecurry( 32794 func, bitmask, createHybrid, wrapper.placeholder, thisArg, 32795 args, newHolders, argPos, ary, arity - length 32796 ); 32797 } 32798 var thisBinding = isBind ? thisArg : this, 32799 fn = isBindKey ? thisBinding[func] : func; 32800 32801 length = args.length; 32802 if (argPos) { 32803 args = reorder(args, argPos); 32804 } else if (isFlip && length > 1) { 32805 args.reverse(); 32806 } 32807 if (isAry && ary < length) { 32808 args.length = ary; 32809 } 32810 if (this && this !== root && this instanceof wrapper) { 32811 fn = Ctor || createCtor(fn); 32812 } 32813 return fn.apply(thisBinding, args); 32814 } 32815 return wrapper; 32816 } 32817 32818 /** 32819 * Creates a function like `_.invertBy`. 32820 * 32821 * @private 32822 * @param {Function} setter The function to set accumulator values. 32823 * @param {Function} toIteratee The function to resolve iteratees. 32824 * @returns {Function} Returns the new inverter function. 32825 */ 32826 function createInverter(setter, toIteratee) { 32827 return function(object, iteratee) { 32828 return baseInverter(object, setter, toIteratee(iteratee), {}); 32829 }; 32830 } 32831 32832 /** 32833 * Creates a function that performs a mathematical operation on two values. 32834 * 32835 * @private 32836 * @param {Function} operator The function to perform the operation. 32837 * @param {number} [defaultValue] The value used for `undefined` arguments. 32838 * @returns {Function} Returns the new mathematical operation function. 32839 */ 32840 function createMathOperation(operator, defaultValue) { 32841 return function(value, other) { 32842 var result; 32843 if (value === undefined && other === undefined) { 32844 return defaultValue; 32845 } 32846 if (value !== undefined) { 32847 result = value; 32848 } 32849 if (other !== undefined) { 32850 if (result === undefined) { 32851 return other; 32852 } 32853 if (typeof value == 'string' || typeof other == 'string') { 32854 value = baseToString(value); 32855 other = baseToString(other); 32856 } else { 32857 value = baseToNumber(value); 32858 other = baseToNumber(other); 32859 } 32860 result = operator(value, other); 32861 } 32862 return result; 32863 }; 32864 } 32865 32866 /** 32867 * Creates a function like `_.over`. 32868 * 32869 * @private 32870 * @param {Function} arrayFunc The function to iterate over iteratees. 32871 * @returns {Function} Returns the new over function. 32872 */ 32873 function createOver(arrayFunc) { 32874 return flatRest(function(iteratees) { 32875 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 32876 return baseRest(function(args) { 32877 var thisArg = this; 32878 return arrayFunc(iteratees, function(iteratee) { 32879 return apply(iteratee, thisArg, args); 32880 }); 32881 }); 32882 }); 32883 } 32884 32885 /** 32886 * Creates the padding for `string` based on `length`. The `chars` string 32887 * is truncated if the number of characters exceeds `length`. 32888 * 32889 * @private 32890 * @param {number} length The padding length. 32891 * @param {string} [chars=' '] The string used as padding. 32892 * @returns {string} Returns the padding for `string`. 32893 */ 32894 function createPadding(length, chars) { 32895 chars = chars === undefined ? ' ' : baseToString(chars); 32896 32897 var charsLength = chars.length; 32898 if (charsLength < 2) { 32899 return charsLength ? baseRepeat(chars, length) : chars; 32900 } 32901 var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); 32902 return hasUnicode(chars) 32903 ? castSlice(stringToArray(result), 0, length).join('') 32904 : result.slice(0, length); 32905 } 32906 32907 /** 32908 * Creates a function that wraps `func` to invoke it with the `this` binding 32909 * of `thisArg` and `partials` prepended to the arguments it receives. 32910 * 32911 * @private 32912 * @param {Function} func The function to wrap. 32913 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32914 * @param {*} thisArg The `this` binding of `func`. 32915 * @param {Array} partials The arguments to prepend to those provided to 32916 * the new function. 32917 * @returns {Function} Returns the new wrapped function. 32918 */ 32919 function createPartial(func, bitmask, thisArg, partials) { 32920 var isBind = bitmask & WRAP_BIND_FLAG, 32921 Ctor = createCtor(func); 32922 32923 function wrapper() { 32924 var argsIndex = -1, 32925 argsLength = arguments.length, 32926 leftIndex = -1, 32927 leftLength = partials.length, 32928 args = Array(leftLength + argsLength), 32929 fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; 32930 32931 while (++leftIndex < leftLength) { 32932 args[leftIndex] = partials[leftIndex]; 32933 } 32934 while (argsLength--) { 32935 args[leftIndex++] = arguments[++argsIndex]; 32936 } 32937 return apply(fn, isBind ? thisArg : this, args); 32938 } 32939 return wrapper; 32940 } 32941 32942 /** 32943 * Creates a `_.range` or `_.rangeRight` function. 32944 * 32945 * @private 32946 * @param {boolean} [fromRight] Specify iterating from right to left. 32947 * @returns {Function} Returns the new range function. 32948 */ 32949 function createRange(fromRight) { 32950 return function(start, end, step) { 32951 if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { 32952 end = step = undefined; 32953 } 32954 // Ensure the sign of `-0` is preserved. 32955 start = toFinite(start); 32956 if (end === undefined) { 32957 end = start; 32958 start = 0; 32959 } else { 32960 end = toFinite(end); 32961 } 32962 step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); 32963 return baseRange(start, end, step, fromRight); 32964 }; 32965 } 32966 32967 /** 32968 * Creates a function that performs a relational operation on two values. 32969 * 32970 * @private 32971 * @param {Function} operator The function to perform the operation. 32972 * @returns {Function} Returns the new relational operation function. 32973 */ 32974 function createRelationalOperation(operator) { 32975 return function(value, other) { 32976 if (!(typeof value == 'string' && typeof other == 'string')) { 32977 value = toNumber(value); 32978 other = toNumber(other); 32979 } 32980 return operator(value, other); 32981 }; 32982 } 32983 32984 /** 32985 * Creates a function that wraps `func` to continue currying. 32986 * 32987 * @private 32988 * @param {Function} func The function to wrap. 32989 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 32990 * @param {Function} wrapFunc The function to create the `func` wrapper. 32991 * @param {*} placeholder The placeholder value. 32992 * @param {*} [thisArg] The `this` binding of `func`. 32993 * @param {Array} [partials] The arguments to prepend to those provided to 32994 * the new function. 32995 * @param {Array} [holders] The `partials` placeholder indexes. 32996 * @param {Array} [argPos] The argument positions of the new function. 32997 * @param {number} [ary] The arity cap of `func`. 32998 * @param {number} [arity] The arity of `func`. 32999 * @returns {Function} Returns the new wrapped function. 33000 */ 33001 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { 33002 var isCurry = bitmask & WRAP_CURRY_FLAG, 33003 newHolders = isCurry ? holders : undefined, 33004 newHoldersRight = isCurry ? undefined : holders, 33005 newPartials = isCurry ? partials : undefined, 33006 newPartialsRight = isCurry ? undefined : partials; 33007 33008 bitmask |= (isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG); 33009 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); 33010 33011 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { 33012 bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); 33013 } 33014 var newData = [ 33015 func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, 33016 newHoldersRight, argPos, ary, arity 33017 ]; 33018 33019 var result = wrapFunc.apply(undefined, newData); 33020 if (isLaziable(func)) { 33021 setData(result, newData); 33022 } 33023 result.placeholder = placeholder; 33024 return setWrapToString(result, func, bitmask); 33025 } 33026 33027 /** 33028 * Creates a function like `_.round`. 33029 * 33030 * @private 33031 * @param {string} methodName The name of the `Math` method to use when rounding. 33032 * @returns {Function} Returns the new round function. 33033 */ 33034 function createRound(methodName) { 33035 var func = Math[methodName]; 33036 return function(number, precision) { 33037 number = toNumber(number); 33038 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); 33039 if (precision && nativeIsFinite(number)) { 33040 // Shift with exponential notation to avoid floating-point issues. 33041 // See [MDN](https://mdn.io/round#Examples) for more details. 33042 var pair = (toString(number) + 'e').split('e'), 33043 value = func(pair[0] + 'e' + (+pair[1] + precision)); 33044 33045 pair = (toString(value) + 'e').split('e'); 33046 return +(pair[0] + 'e' + (+pair[1] - precision)); 33047 } 33048 return func(number); 33049 }; 33050 } 33051 33052 /** 33053 * Creates a set object of `values`. 33054 * 33055 * @private 33056 * @param {Array} values The values to add to the set. 33057 * @returns {Object} Returns the new set. 33058 */ 33059 var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { 33060 return new Set(values); 33061 }; 33062 33063 /** 33064 * Creates a `_.toPairs` or `_.toPairsIn` function. 33065 * 33066 * @private 33067 * @param {Function} keysFunc The function to get the keys of a given object. 33068 * @returns {Function} Returns the new pairs function. 33069 */ 33070 function createToPairs(keysFunc) { 33071 return function(object) { 33072 var tag = getTag(object); 33073 if (tag == mapTag) { 33074 return mapToArray(object); 33075 } 33076 if (tag == setTag) { 33077 return setToPairs(object); 33078 } 33079 return baseToPairs(object, keysFunc(object)); 33080 }; 33081 } 33082 33083 /** 33084 * Creates a function that either curries or invokes `func` with optional 33085 * `this` binding and partially applied arguments. 33086 * 33087 * @private 33088 * @param {Function|string} func The function or method name to wrap. 33089 * @param {number} bitmask The bitmask flags. 33090 * 1 - `_.bind` 33091 * 2 - `_.bindKey` 33092 * 4 - `_.curry` or `_.curryRight` of a bound function 33093 * 8 - `_.curry` 33094 * 16 - `_.curryRight` 33095 * 32 - `_.partial` 33096 * 64 - `_.partialRight` 33097 * 128 - `_.rearg` 33098 * 256 - `_.ary` 33099 * 512 - `_.flip` 33100 * @param {*} [thisArg] The `this` binding of `func`. 33101 * @param {Array} [partials] The arguments to be partially applied. 33102 * @param {Array} [holders] The `partials` placeholder indexes. 33103 * @param {Array} [argPos] The argument positions of the new function. 33104 * @param {number} [ary] The arity cap of `func`. 33105 * @param {number} [arity] The arity of `func`. 33106 * @returns {Function} Returns the new wrapped function. 33107 */ 33108 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { 33109 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; 33110 if (!isBindKey && typeof func != 'function') { 33111 throw new TypeError(FUNC_ERROR_TEXT); 33112 } 33113 var length = partials ? partials.length : 0; 33114 if (!length) { 33115 bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); 33116 partials = holders = undefined; 33117 } 33118 ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); 33119 arity = arity === undefined ? arity : toInteger(arity); 33120 length -= holders ? holders.length : 0; 33121 33122 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { 33123 var partialsRight = partials, 33124 holdersRight = holders; 33125 33126 partials = holders = undefined; 33127 } 33128 var data = isBindKey ? undefined : getData(func); 33129 33130 var newData = [ 33131 func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, 33132 argPos, ary, arity 33133 ]; 33134 33135 if (data) { 33136 mergeData(newData, data); 33137 } 33138 func = newData[0]; 33139 bitmask = newData[1]; 33140 thisArg = newData[2]; 33141 partials = newData[3]; 33142 holders = newData[4]; 33143 arity = newData[9] = newData[9] === undefined 33144 ? (isBindKey ? 0 : func.length) 33145 : nativeMax(newData[9] - length, 0); 33146 33147 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { 33148 bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); 33149 } 33150 if (!bitmask || bitmask == WRAP_BIND_FLAG) { 33151 var result = createBind(func, bitmask, thisArg); 33152 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { 33153 result = createCurry(func, bitmask, arity); 33154 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { 33155 result = createPartial(func, bitmask, thisArg, partials); 33156 } else { 33157 result = createHybrid.apply(undefined, newData); 33158 } 33159 var setter = data ? baseSetData : setData; 33160 return setWrapToString(setter(result, newData), func, bitmask); 33161 } 33162 33163 /** 33164 * Used by `_.defaults` to customize its `_.assignIn` use to assign properties 33165 * of source objects to the destination object for all destination properties 33166 * that resolve to `undefined`. 33167 * 33168 * @private 33169 * @param {*} objValue The destination value. 33170 * @param {*} srcValue The source value. 33171 * @param {string} key The key of the property to assign. 33172 * @param {Object} object The parent object of `objValue`. 33173 * @returns {*} Returns the value to assign. 33174 */ 33175 function customDefaultsAssignIn(objValue, srcValue, key, object) { 33176 if (objValue === undefined || 33177 (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { 33178 return srcValue; 33179 } 33180 return objValue; 33181 } 33182 33183 /** 33184 * Used by `_.defaultsDeep` to customize its `_.merge` use to merge source 33185 * objects into destination objects that are passed thru. 33186 * 33187 * @private 33188 * @param {*} objValue The destination value. 33189 * @param {*} srcValue The source value. 33190 * @param {string} key The key of the property to merge. 33191 * @param {Object} object The parent object of `objValue`. 33192 * @param {Object} source The parent object of `srcValue`. 33193 * @param {Object} [stack] Tracks traversed source values and their merged 33194 * counterparts. 33195 * @returns {*} Returns the value to assign. 33196 */ 33197 function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { 33198 if (isObject(objValue) && isObject(srcValue)) { 33199 // Recursively merge objects and arrays (susceptible to call stack limits). 33200 stack.set(srcValue, objValue); 33201 baseMerge(objValue, srcValue, undefined, customDefaultsMerge, stack); 33202 stack['delete'](srcValue); 33203 } 33204 return objValue; 33205 } 33206 33207 /** 33208 * Used by `_.omit` to customize its `_.cloneDeep` use to only clone plain 33209 * objects. 33210 * 33211 * @private 33212 * @param {*} value The value to inspect. 33213 * @param {string} key The key of the property to inspect. 33214 * @returns {*} Returns the uncloned value or `undefined` to defer cloning to `_.cloneDeep`. 33215 */ 33216 function customOmitClone(value) { 33217 return isPlainObject(value) ? undefined : value; 33218 } 33219 33220 /** 33221 * A specialized version of `baseIsEqualDeep` for arrays with support for 33222 * partial deep comparisons. 33223 * 33224 * @private 33225 * @param {Array} array The array to compare. 33226 * @param {Array} other The other array to compare. 33227 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 33228 * @param {Function} customizer The function to customize comparisons. 33229 * @param {Function} equalFunc The function to determine equivalents of values. 33230 * @param {Object} stack Tracks traversed `array` and `other` objects. 33231 * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. 33232 */ 33233 function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { 33234 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 33235 arrLength = array.length, 33236 othLength = other.length; 33237 33238 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 33239 return false; 33240 } 33241 // Check that cyclic values are equal. 33242 var arrStacked = stack.get(array); 33243 var othStacked = stack.get(other); 33244 if (arrStacked && othStacked) { 33245 return arrStacked == other && othStacked == array; 33246 } 33247 var index = -1, 33248 result = true, 33249 seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined; 33250 33251 stack.set(array, other); 33252 stack.set(other, array); 33253 33254 // Ignore non-index properties. 33255 while (++index < arrLength) { 33256 var arrValue = array[index], 33257 othValue = other[index]; 33258 33259 if (customizer) { 33260 var compared = isPartial 33261 ? customizer(othValue, arrValue, index, other, array, stack) 33262 : customizer(arrValue, othValue, index, array, other, stack); 33263 } 33264 if (compared !== undefined) { 33265 if (compared) { 33266 continue; 33267 } 33268 result = false; 33269 break; 33270 } 33271 // Recursively compare arrays (susceptible to call stack limits). 33272 if (seen) { 33273 if (!arraySome(other, function(othValue, othIndex) { 33274 if (!cacheHas(seen, othIndex) && 33275 (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { 33276 return seen.push(othIndex); 33277 } 33278 })) { 33279 result = false; 33280 break; 33281 } 33282 } else if (!( 33283 arrValue === othValue || 33284 equalFunc(arrValue, othValue, bitmask, customizer, stack) 33285 )) { 33286 result = false; 33287 break; 33288 } 33289 } 33290 stack['delete'](array); 33291 stack['delete'](other); 33292 return result; 33293 } 33294 33295 /** 33296 * A specialized version of `baseIsEqualDeep` for comparing objects of 33297 * the same `toStringTag`. 33298 * 33299 * **Note:** This function only supports comparing values with tags of 33300 * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. 33301 * 33302 * @private 33303 * @param {Object} object The object to compare. 33304 * @param {Object} other The other object to compare. 33305 * @param {string} tag The `toStringTag` of the objects to compare. 33306 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 33307 * @param {Function} customizer The function to customize comparisons. 33308 * @param {Function} equalFunc The function to determine equivalents of values. 33309 * @param {Object} stack Tracks traversed `object` and `other` objects. 33310 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 33311 */ 33312 function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { 33313 switch (tag) { 33314 case dataViewTag: 33315 if ((object.byteLength != other.byteLength) || 33316 (object.byteOffset != other.byteOffset)) { 33317 return false; 33318 } 33319 object = object.buffer; 33320 other = other.buffer; 33321 33322 case arrayBufferTag: 33323 if ((object.byteLength != other.byteLength) || 33324 !equalFunc(new Uint8Array(object), new Uint8Array(other))) { 33325 return false; 33326 } 33327 return true; 33328 33329 case boolTag: 33330 case dateTag: 33331 case numberTag: 33332 // Coerce booleans to `1` or `0` and dates to milliseconds. 33333 // Invalid dates are coerced to `NaN`. 33334 return eq(+object, +other); 33335 33336 case errorTag: 33337 return object.name == other.name && object.message == other.message; 33338 33339 case regexpTag: 33340 case stringTag: 33341 // Coerce regexes to strings and treat strings, primitives and objects, 33342 // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring 33343 // for more details. 33344 return object == (other + ''); 33345 33346 case mapTag: 33347 var convert = mapToArray; 33348 33349 case setTag: 33350 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 33351 convert || (convert = setToArray); 33352 33353 if (object.size != other.size && !isPartial) { 33354 return false; 33355 } 33356 // Assume cyclic values are equal. 33357 var stacked = stack.get(object); 33358 if (stacked) { 33359 return stacked == other; 33360 } 33361 bitmask |= COMPARE_UNORDERED_FLAG; 33362 33363 // Recursively compare objects (susceptible to call stack limits). 33364 stack.set(object, other); 33365 var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); 33366 stack['delete'](object); 33367 return result; 33368 33369 case symbolTag: 33370 if (symbolValueOf) { 33371 return symbolValueOf.call(object) == symbolValueOf.call(other); 33372 } 33373 } 33374 return false; 33375 } 33376 33377 /** 33378 * A specialized version of `baseIsEqualDeep` for objects with support for 33379 * partial deep comparisons. 33380 * 33381 * @private 33382 * @param {Object} object The object to compare. 33383 * @param {Object} other The other object to compare. 33384 * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details. 33385 * @param {Function} customizer The function to customize comparisons. 33386 * @param {Function} equalFunc The function to determine equivalents of values. 33387 * @param {Object} stack Tracks traversed `object` and `other` objects. 33388 * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. 33389 */ 33390 function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { 33391 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, 33392 objProps = getAllKeys(object), 33393 objLength = objProps.length, 33394 othProps = getAllKeys(other), 33395 othLength = othProps.length; 33396 33397 if (objLength != othLength && !isPartial) { 33398 return false; 33399 } 33400 var index = objLength; 33401 while (index--) { 33402 var key = objProps[index]; 33403 if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { 33404 return false; 33405 } 33406 } 33407 // Check that cyclic values are equal. 33408 var objStacked = stack.get(object); 33409 var othStacked = stack.get(other); 33410 if (objStacked && othStacked) { 33411 return objStacked == other && othStacked == object; 33412 } 33413 var result = true; 33414 stack.set(object, other); 33415 stack.set(other, object); 33416 33417 var skipCtor = isPartial; 33418 while (++index < objLength) { 33419 key = objProps[index]; 33420 var objValue = object[key], 33421 othValue = other[key]; 33422 33423 if (customizer) { 33424 var compared = isPartial 33425 ? customizer(othValue, objValue, key, other, object, stack) 33426 : customizer(objValue, othValue, key, object, other, stack); 33427 } 33428 // Recursively compare objects (susceptible to call stack limits). 33429 if (!(compared === undefined 33430 ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack)) 33431 : compared 33432 )) { 33433 result = false; 33434 break; 33435 } 33436 skipCtor || (skipCtor = key == 'constructor'); 33437 } 33438 if (result && !skipCtor) { 33439 var objCtor = object.constructor, 33440 othCtor = other.constructor; 33441 33442 // Non `Object` object instances with different constructors are not equal. 33443 if (objCtor != othCtor && 33444 ('constructor' in object && 'constructor' in other) && 33445 !(typeof objCtor == 'function' && objCtor instanceof objCtor && 33446 typeof othCtor == 'function' && othCtor instanceof othCtor)) { 33447 result = false; 33448 } 33449 } 33450 stack['delete'](object); 33451 stack['delete'](other); 33452 return result; 33453 } 33454 33455 /** 33456 * A specialized version of `baseRest` which flattens the rest array. 33457 * 33458 * @private 33459 * @param {Function} func The function to apply a rest parameter to. 33460 * @returns {Function} Returns the new function. 33461 */ 33462 function flatRest(func) { 33463 return setToString(overRest(func, undefined, flatten), func + ''); 33464 } 33465 33466 /** 33467 * Creates an array of own enumerable property names and symbols of `object`. 33468 * 33469 * @private 33470 * @param {Object} object The object to query. 33471 * @returns {Array} Returns the array of property names and symbols. 33472 */ 33473 function getAllKeys(object) { 33474 return baseGetAllKeys(object, keys, getSymbols); 33475 } 33476 33477 /** 33478 * Creates an array of own and inherited enumerable property names and 33479 * symbols of `object`. 33480 * 33481 * @private 33482 * @param {Object} object The object to query. 33483 * @returns {Array} Returns the array of property names and symbols. 33484 */ 33485 function getAllKeysIn(object) { 33486 return baseGetAllKeys(object, keysIn, getSymbolsIn); 33487 } 33488 33489 /** 33490 * Gets metadata for `func`. 33491 * 33492 * @private 33493 * @param {Function} func The function to query. 33494 * @returns {*} Returns the metadata for `func`. 33495 */ 33496 var getData = !metaMap ? noop : function(func) { 33497 return metaMap.get(func); 33498 }; 33499 33500 /** 33501 * Gets the name of `func`. 33502 * 33503 * @private 33504 * @param {Function} func The function to query. 33505 * @returns {string} Returns the function name. 33506 */ 33507 function getFuncName(func) { 33508 var result = (func.name + ''), 33509 array = realNames[result], 33510 length = hasOwnProperty.call(realNames, result) ? array.length : 0; 33511 33512 while (length--) { 33513 var data = array[length], 33514 otherFunc = data.func; 33515 if (otherFunc == null || otherFunc == func) { 33516 return data.name; 33517 } 33518 } 33519 return result; 33520 } 33521 33522 /** 33523 * Gets the argument placeholder value for `func`. 33524 * 33525 * @private 33526 * @param {Function} func The function to inspect. 33527 * @returns {*} Returns the placeholder value. 33528 */ 33529 function getHolder(func) { 33530 var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; 33531 return object.placeholder; 33532 } 33533 33534 /** 33535 * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, 33536 * this function returns the custom method, otherwise it returns `baseIteratee`. 33537 * If arguments are provided, the chosen function is invoked with them and 33538 * its result is returned. 33539 * 33540 * @private 33541 * @param {*} [value] The value to convert to an iteratee. 33542 * @param {number} [arity] The arity of the created iteratee. 33543 * @returns {Function} Returns the chosen function or its result. 33544 */ 33545 function getIteratee() { 33546 var result = lodash.iteratee || iteratee; 33547 result = result === iteratee ? baseIteratee : result; 33548 return arguments.length ? result(arguments[0], arguments[1]) : result; 33549 } 33550 33551 /** 33552 * Gets the data for `map`. 33553 * 33554 * @private 33555 * @param {Object} map The map to query. 33556 * @param {string} key The reference key. 33557 * @returns {*} Returns the map data. 33558 */ 33559 function getMapData(map, key) { 33560 var data = map.__data__; 33561 return isKeyable(key) 33562 ? data[typeof key == 'string' ? 'string' : 'hash'] 33563 : data.map; 33564 } 33565 33566 /** 33567 * Gets the property names, values, and compare flags of `object`. 33568 * 33569 * @private 33570 * @param {Object} object The object to query. 33571 * @returns {Array} Returns the match data of `object`. 33572 */ 33573 function getMatchData(object) { 33574 var result = keys(object), 33575 length = result.length; 33576 33577 while (length--) { 33578 var key = result[length], 33579 value = object[key]; 33580 33581 result[length] = [key, value, isStrictComparable(value)]; 33582 } 33583 return result; 33584 } 33585 33586 /** 33587 * Gets the native function at `key` of `object`. 33588 * 33589 * @private 33590 * @param {Object} object The object to query. 33591 * @param {string} key The key of the method to get. 33592 * @returns {*} Returns the function if it's native, else `undefined`. 33593 */ 33594 function getNative(object, key) { 33595 var value = getValue(object, key); 33596 return baseIsNative(value) ? value : undefined; 33597 } 33598 33599 /** 33600 * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values. 33601 * 33602 * @private 33603 * @param {*} value The value to query. 33604 * @returns {string} Returns the raw `toStringTag`. 33605 */ 33606 function getRawTag(value) { 33607 var isOwn = hasOwnProperty.call(value, symToStringTag), 33608 tag = value[symToStringTag]; 33609 33610 try { 33611 value[symToStringTag] = undefined; 33612 var unmasked = true; 33613 } catch (e) {} 33614 33615 var result = nativeObjectToString.call(value); 33616 if (unmasked) { 33617 if (isOwn) { 33618 value[symToStringTag] = tag; 33619 } else { 33620 delete value[symToStringTag]; 33621 } 33622 } 33623 return result; 33624 } 33625 33626 /** 33627 * Creates an array of the own enumerable symbols of `object`. 33628 * 33629 * @private 33630 * @param {Object} object The object to query. 33631 * @returns {Array} Returns the array of symbols. 33632 */ 33633 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 33634 if (object == null) { 33635 return []; 33636 } 33637 object = Object(object); 33638 return arrayFilter(nativeGetSymbols(object), function(symbol) { 33639 return propertyIsEnumerable.call(object, symbol); 33640 }); 33641 }; 33642 33643 /** 33644 * Creates an array of the own and inherited enumerable symbols of `object`. 33645 * 33646 * @private 33647 * @param {Object} object The object to query. 33648 * @returns {Array} Returns the array of symbols. 33649 */ 33650 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 33651 var result = []; 33652 while (object) { 33653 arrayPush(result, getSymbols(object)); 33654 object = getPrototype(object); 33655 } 33656 return result; 33657 }; 33658 33659 /** 33660 * Gets the `toStringTag` of `value`. 33661 * 33662 * @private 33663 * @param {*} value The value to query. 33664 * @returns {string} Returns the `toStringTag`. 33665 */ 33666 var getTag = baseGetTag; 33667 33668 // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. 33669 if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || 33670 (Map && getTag(new Map) != mapTag) || 33671 (Promise && getTag(Promise.resolve()) != promiseTag) || 33672 (Set && getTag(new Set) != setTag) || 33673 (WeakMap && getTag(new WeakMap) != weakMapTag)) { 33674 getTag = function(value) { 33675 var result = baseGetTag(value), 33676 Ctor = result == objectTag ? value.constructor : undefined, 33677 ctorString = Ctor ? toSource(Ctor) : ''; 33678 33679 if (ctorString) { 33680 switch (ctorString) { 33681 case dataViewCtorString: return dataViewTag; 33682 case mapCtorString: return mapTag; 33683 case promiseCtorString: return promiseTag; 33684 case setCtorString: return setTag; 33685 case weakMapCtorString: return weakMapTag; 33686 } 33687 } 33688 return result; 33689 }; 33690 } 33691 33692 /** 33693 * Gets the view, applying any `transforms` to the `start` and `end` positions. 33694 * 33695 * @private 33696 * @param {number} start The start of the view. 33697 * @param {number} end The end of the view. 33698 * @param {Array} transforms The transformations to apply to the view. 33699 * @returns {Object} Returns an object containing the `start` and `end` 33700 * positions of the view. 33701 */ 33702 function getView(start, end, transforms) { 33703 var index = -1, 33704 length = transforms.length; 33705 33706 while (++index < length) { 33707 var data = transforms[index], 33708 size = data.size; 33709 33710 switch (data.type) { 33711 case 'drop': start += size; break; 33712 case 'dropRight': end -= size; break; 33713 case 'take': end = nativeMin(end, start + size); break; 33714 case 'takeRight': start = nativeMax(start, end - size); break; 33715 } 33716 } 33717 return { 'start': start, 'end': end }; 33718 } 33719 33720 /** 33721 * Extracts wrapper details from the `source` body comment. 33722 * 33723 * @private 33724 * @param {string} source The source to inspect. 33725 * @returns {Array} Returns the wrapper details. 33726 */ 33727 function getWrapDetails(source) { 33728 var match = source.match(reWrapDetails); 33729 return match ? match[1].split(reSplitDetails) : []; 33730 } 33731 33732 /** 33733 * Checks if `path` exists on `object`. 33734 * 33735 * @private 33736 * @param {Object} object The object to query. 33737 * @param {Array|string} path The path to check. 33738 * @param {Function} hasFunc The function to check properties. 33739 * @returns {boolean} Returns `true` if `path` exists, else `false`. 33740 */ 33741 function hasPath(object, path, hasFunc) { 33742 path = castPath(path, object); 33743 33744 var index = -1, 33745 length = path.length, 33746 result = false; 33747 33748 while (++index < length) { 33749 var key = toKey(path[index]); 33750 if (!(result = object != null && hasFunc(object, key))) { 33751 break; 33752 } 33753 object = object[key]; 33754 } 33755 if (result || ++index != length) { 33756 return result; 33757 } 33758 length = object == null ? 0 : object.length; 33759 return !!length && isLength(length) && isIndex(key, length) && 33760 (isArray(object) || isArguments(object)); 33761 } 33762 33763 /** 33764 * Initializes an array clone. 33765 * 33766 * @private 33767 * @param {Array} array The array to clone. 33768 * @returns {Array} Returns the initialized clone. 33769 */ 33770 function initCloneArray(array) { 33771 var length = array.length, 33772 result = new array.constructor(length); 33773 33774 // Add properties assigned by `RegExp#exec`. 33775 if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { 33776 result.index = array.index; 33777 result.input = array.input; 33778 } 33779 return result; 33780 } 33781 33782 /** 33783 * Initializes an object clone. 33784 * 33785 * @private 33786 * @param {Object} object The object to clone. 33787 * @returns {Object} Returns the initialized clone. 33788 */ 33789 function initCloneObject(object) { 33790 return (typeof object.constructor == 'function' && !isPrototype(object)) 33791 ? baseCreate(getPrototype(object)) 33792 : {}; 33793 } 33794 33795 /** 33796 * Initializes an object clone based on its `toStringTag`. 33797 * 33798 * **Note:** This function only supports cloning values with tags of 33799 * `Boolean`, `Date`, `Error`, `Map`, `Number`, `RegExp`, `Set`, or `String`. 33800 * 33801 * @private 33802 * @param {Object} object The object to clone. 33803 * @param {string} tag The `toStringTag` of the object to clone. 33804 * @param {boolean} [isDeep] Specify a deep clone. 33805 * @returns {Object} Returns the initialized clone. 33806 */ 33807 function initCloneByTag(object, tag, isDeep) { 33808 var Ctor = object.constructor; 33809 switch (tag) { 33810 case arrayBufferTag: 33811 return cloneArrayBuffer(object); 33812 33813 case boolTag: 33814 case dateTag: 33815 return new Ctor(+object); 33816 33817 case dataViewTag: 33818 return cloneDataView(object, isDeep); 33819 33820 case float32Tag: case float64Tag: 33821 case int8Tag: case int16Tag: case int32Tag: 33822 case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: 33823 return cloneTypedArray(object, isDeep); 33824 33825 case mapTag: 33826 return new Ctor; 33827 33828 case numberTag: 33829 case stringTag: 33830 return new Ctor(object); 33831 33832 case regexpTag: 33833 return cloneRegExp(object); 33834 33835 case setTag: 33836 return new Ctor; 33837 33838 case symbolTag: 33839 return cloneSymbol(object); 33840 } 33841 } 33842 33843 /** 33844 * Inserts wrapper `details` in a comment at the top of the `source` body. 33845 * 33846 * @private 33847 * @param {string} source The source to modify. 33848 * @returns {Array} details The details to insert. 33849 * @returns {string} Returns the modified source. 33850 */ 33851 function insertWrapDetails(source, details) { 33852 var length = details.length; 33853 if (!length) { 33854 return source; 33855 } 33856 var lastIndex = length - 1; 33857 details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; 33858 details = details.join(length > 2 ? ', ' : ' '); 33859 return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); 33860 } 33861 33862 /** 33863 * Checks if `value` is a flattenable `arguments` object or array. 33864 * 33865 * @private 33866 * @param {*} value The value to check. 33867 * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. 33868 */ 33869 function isFlattenable(value) { 33870 return isArray(value) || isArguments(value) || 33871 !!(spreadableSymbol && value && value[spreadableSymbol]); 33872 } 33873 33874 /** 33875 * Checks if `value` is a valid array-like index. 33876 * 33877 * @private 33878 * @param {*} value The value to check. 33879 * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. 33880 * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. 33881 */ 33882 function isIndex(value, length) { 33883 var type = typeof value; 33884 length = length == null ? MAX_SAFE_INTEGER : length; 33885 33886 return !!length && 33887 (type == 'number' || 33888 (type != 'symbol' && reIsUint.test(value))) && 33889 (value > -1 && value % 1 == 0 && value < length); 33890 } 33891 33892 /** 33893 * Checks if the given arguments are from an iteratee call. 33894 * 33895 * @private 33896 * @param {*} value The potential iteratee value argument. 33897 * @param {*} index The potential iteratee index or key argument. 33898 * @param {*} object The potential iteratee object argument. 33899 * @returns {boolean} Returns `true` if the arguments are from an iteratee call, 33900 * else `false`. 33901 */ 33902 function isIterateeCall(value, index, object) { 33903 if (!isObject(object)) { 33904 return false; 33905 } 33906 var type = typeof index; 33907 if (type == 'number' 33908 ? (isArrayLike(object) && isIndex(index, object.length)) 33909 : (type == 'string' && index in object) 33910 ) { 33911 return eq(object[index], value); 33912 } 33913 return false; 33914 } 33915 33916 /** 33917 * Checks if `value` is a property name and not a property path. 33918 * 33919 * @private 33920 * @param {*} value The value to check. 33921 * @param {Object} [object] The object to query keys on. 33922 * @returns {boolean} Returns `true` if `value` is a property name, else `false`. 33923 */ 33924 function isKey(value, object) { 33925 if (isArray(value)) { 33926 return false; 33927 } 33928 var type = typeof value; 33929 if (type == 'number' || type == 'symbol' || type == 'boolean' || 33930 value == null || isSymbol(value)) { 33931 return true; 33932 } 33933 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || 33934 (object != null && value in Object(object)); 33935 } 33936 33937 /** 33938 * Checks if `value` is suitable for use as unique object key. 33939 * 33940 * @private 33941 * @param {*} value The value to check. 33942 * @returns {boolean} Returns `true` if `value` is suitable, else `false`. 33943 */ 33944 function isKeyable(value) { 33945 var type = typeof value; 33946 return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') 33947 ? (value !== '__proto__') 33948 : (value === null); 33949 } 33950 33951 /** 33952 * Checks if `func` has a lazy counterpart. 33953 * 33954 * @private 33955 * @param {Function} func The function to check. 33956 * @returns {boolean} Returns `true` if `func` has a lazy counterpart, 33957 * else `false`. 33958 */ 33959 function isLaziable(func) { 33960 var funcName = getFuncName(func), 33961 other = lodash[funcName]; 33962 33963 if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { 33964 return false; 33965 } 33966 if (func === other) { 33967 return true; 33968 } 33969 var data = getData(other); 33970 return !!data && func === data[0]; 33971 } 33972 33973 /** 33974 * Checks if `func` has its source masked. 33975 * 33976 * @private 33977 * @param {Function} func The function to check. 33978 * @returns {boolean} Returns `true` if `func` is masked, else `false`. 33979 */ 33980 function isMasked(func) { 33981 return !!maskSrcKey && (maskSrcKey in func); 33982 } 33983 33984 /** 33985 * Checks if `func` is capable of being masked. 33986 * 33987 * @private 33988 * @param {*} value The value to check. 33989 * @returns {boolean} Returns `true` if `func` is maskable, else `false`. 33990 */ 33991 var isMaskable = coreJsData ? isFunction : stubFalse; 33992 33993 /** 33994 * Checks if `value` is likely a prototype object. 33995 * 33996 * @private 33997 * @param {*} value The value to check. 33998 * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. 33999 */ 34000 function isPrototype(value) { 34001 var Ctor = value && value.constructor, 34002 proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; 34003 34004 return value === proto; 34005 } 34006 34007 /** 34008 * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. 34009 * 34010 * @private 34011 * @param {*} value The value to check. 34012 * @returns {boolean} Returns `true` if `value` if suitable for strict 34013 * equality comparisons, else `false`. 34014 */ 34015 function isStrictComparable(value) { 34016 return value === value && !isObject(value); 34017 } 34018 34019 /** 34020 * A specialized version of `matchesProperty` for source values suitable 34021 * for strict equality comparisons, i.e. `===`. 34022 * 34023 * @private 34024 * @param {string} key The key of the property to get. 34025 * @param {*} srcValue The value to match. 34026 * @returns {Function} Returns the new spec function. 34027 */ 34028 function matchesStrictComparable(key, srcValue) { 34029 return function(object) { 34030 if (object == null) { 34031 return false; 34032 } 34033 return object[key] === srcValue && 34034 (srcValue !== undefined || (key in Object(object))); 34035 }; 34036 } 34037 34038 /** 34039 * A specialized version of `_.memoize` which clears the memoized function's 34040 * cache when it exceeds `MAX_MEMOIZE_SIZE`. 34041 * 34042 * @private 34043 * @param {Function} func The function to have its output memoized. 34044 * @returns {Function} Returns the new memoized function. 34045 */ 34046 function memoizeCapped(func) { 34047 var result = memoize(func, function(key) { 34048 if (cache.size === MAX_MEMOIZE_SIZE) { 34049 cache.clear(); 34050 } 34051 return key; 34052 }); 34053 34054 var cache = result.cache; 34055 return result; 34056 } 34057 34058 /** 34059 * Merges the function metadata of `source` into `data`. 34060 * 34061 * Merging metadata reduces the number of wrappers used to invoke a function. 34062 * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` 34063 * may be applied regardless of execution order. Methods like `_.ary` and 34064 * `_.rearg` modify function arguments, making the order in which they are 34065 * executed important, preventing the merging of metadata. However, we make 34066 * an exception for a safe combined case where curried functions have `_.ary` 34067 * and or `_.rearg` applied. 34068 * 34069 * @private 34070 * @param {Array} data The destination metadata. 34071 * @param {Array} source The source metadata. 34072 * @returns {Array} Returns `data`. 34073 */ 34074 function mergeData(data, source) { 34075 var bitmask = data[1], 34076 srcBitmask = source[1], 34077 newBitmask = bitmask | srcBitmask, 34078 isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); 34079 34080 var isCombo = 34081 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_CURRY_FLAG)) || 34082 ((srcBitmask == WRAP_ARY_FLAG) && (bitmask == WRAP_REARG_FLAG) && (data[7].length <= source[8])) || 34083 ((srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == WRAP_CURRY_FLAG)); 34084 34085 // Exit early if metadata can't be merged. 34086 if (!(isCommon || isCombo)) { 34087 return data; 34088 } 34089 // Use source `thisArg` if available. 34090 if (srcBitmask & WRAP_BIND_FLAG) { 34091 data[2] = source[2]; 34092 // Set when currying a bound function. 34093 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; 34094 } 34095 // Compose partial arguments. 34096 var value = source[3]; 34097 if (value) { 34098 var partials = data[3]; 34099 data[3] = partials ? composeArgs(partials, value, source[4]) : value; 34100 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; 34101 } 34102 // Compose partial right arguments. 34103 value = source[5]; 34104 if (value) { 34105 partials = data[5]; 34106 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; 34107 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; 34108 } 34109 // Use source `argPos` if available. 34110 value = source[7]; 34111 if (value) { 34112 data[7] = value; 34113 } 34114 // Use source `ary` if it's smaller. 34115 if (srcBitmask & WRAP_ARY_FLAG) { 34116 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 34117 } 34118 // Use source `arity` if one is not provided. 34119 if (data[9] == null) { 34120 data[9] = source[9]; 34121 } 34122 // Use source `func` and merge bitmasks. 34123 data[0] = source[0]; 34124 data[1] = newBitmask; 34125 34126 return data; 34127 } 34128 34129 /** 34130 * This function is like 34131 * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 34132 * except that it includes inherited enumerable properties. 34133 * 34134 * @private 34135 * @param {Object} object The object to query. 34136 * @returns {Array} Returns the array of property names. 34137 */ 34138 function nativeKeysIn(object) { 34139 var result = []; 34140 if (object != null) { 34141 for (var key in Object(object)) { 34142 result.push(key); 34143 } 34144 } 34145 return result; 34146 } 34147 34148 /** 34149 * Converts `value` to a string using `Object.prototype.toString`. 34150 * 34151 * @private 34152 * @param {*} value The value to convert. 34153 * @returns {string} Returns the converted string. 34154 */ 34155 function objectToString(value) { 34156 return nativeObjectToString.call(value); 34157 } 34158 34159 /** 34160 * A specialized version of `baseRest` which transforms the rest array. 34161 * 34162 * @private 34163 * @param {Function} func The function to apply a rest parameter to. 34164 * @param {number} [start=func.length-1] The start position of the rest parameter. 34165 * @param {Function} transform The rest array transform. 34166 * @returns {Function} Returns the new function. 34167 */ 34168 function overRest(func, start, transform) { 34169 start = nativeMax(start === undefined ? (func.length - 1) : start, 0); 34170 return function() { 34171 var args = arguments, 34172 index = -1, 34173 length = nativeMax(args.length - start, 0), 34174 array = Array(length); 34175 34176 while (++index < length) { 34177 array[index] = args[start + index]; 34178 } 34179 index = -1; 34180 var otherArgs = Array(start + 1); 34181 while (++index < start) { 34182 otherArgs[index] = args[index]; 34183 } 34184 otherArgs[start] = transform(array); 34185 return apply(func, this, otherArgs); 34186 }; 34187 } 34188 34189 /** 34190 * Gets the parent value at `path` of `object`. 34191 * 34192 * @private 34193 * @param {Object} object The object to query. 34194 * @param {Array} path The path to get the parent value of. 34195 * @returns {*} Returns the parent value. 34196 */ 34197 function parent(object, path) { 34198 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); 34199 } 34200 34201 /** 34202 * Reorder `array` according to the specified indexes where the element at 34203 * the first index is assigned as the first element, the element at 34204 * the second index is assigned as the second element, and so on. 34205 * 34206 * @private 34207 * @param {Array} array The array to reorder. 34208 * @param {Array} indexes The arranged array indexes. 34209 * @returns {Array} Returns `array`. 34210 */ 34211 function reorder(array, indexes) { 34212 var arrLength = array.length, 34213 length = nativeMin(indexes.length, arrLength), 34214 oldArray = copyArray(array); 34215 34216 while (length--) { 34217 var index = indexes[length]; 34218 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; 34219 } 34220 return array; 34221 } 34222 34223 /** 34224 * Gets the value at `key`, unless `key` is "__proto__" or "constructor". 34225 * 34226 * @private 34227 * @param {Object} object The object to query. 34228 * @param {string} key The key of the property to get. 34229 * @returns {*} Returns the property value. 34230 */ 34231 function safeGet(object, key) { 34232 if (key === 'constructor' && typeof object[key] === 'function') { 34233 return; 34234 } 34235 34236 if (key == '__proto__') { 34237 return; 34238 } 34239 34240 return object[key]; 34241 } 34242 34243 /** 34244 * Sets metadata for `func`. 34245 * 34246 * **Note:** If this function becomes hot, i.e. is invoked a lot in a short 34247 * period of time, it will trip its breaker and transition to an identity 34248 * function to avoid garbage collection pauses in V8. See 34249 * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) 34250 * for more details. 34251 * 34252 * @private 34253 * @param {Function} func The function to associate metadata with. 34254 * @param {*} data The metadata. 34255 * @returns {Function} Returns `func`. 34256 */ 34257 var setData = shortOut(baseSetData); 34258 34259 /** 34260 * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). 34261 * 34262 * @private 34263 * @param {Function} func The function to delay. 34264 * @param {number} wait The number of milliseconds to delay invocation. 34265 * @returns {number|Object} Returns the timer id or timeout object. 34266 */ 34267 var setTimeout = ctxSetTimeout || function(func, wait) { 34268 return root.setTimeout(func, wait); 34269 }; 34270 34271 /** 34272 * Sets the `toString` method of `func` to return `string`. 34273 * 34274 * @private 34275 * @param {Function} func The function to modify. 34276 * @param {Function} string The `toString` result. 34277 * @returns {Function} Returns `func`. 34278 */ 34279 var setToString = shortOut(baseSetToString); 34280 34281 /** 34282 * Sets the `toString` method of `wrapper` to mimic the source of `reference` 34283 * with wrapper details in a comment at the top of the source body. 34284 * 34285 * @private 34286 * @param {Function} wrapper The function to modify. 34287 * @param {Function} reference The reference function. 34288 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 34289 * @returns {Function} Returns `wrapper`. 34290 */ 34291 function setWrapToString(wrapper, reference, bitmask) { 34292 var source = (reference + ''); 34293 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); 34294 } 34295 34296 /** 34297 * Creates a function that'll short out and invoke `identity` instead 34298 * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` 34299 * milliseconds. 34300 * 34301 * @private 34302 * @param {Function} func The function to restrict. 34303 * @returns {Function} Returns the new shortable function. 34304 */ 34305 function shortOut(func) { 34306 var count = 0, 34307 lastCalled = 0; 34308 34309 return function() { 34310 var stamp = nativeNow(), 34311 remaining = HOT_SPAN - (stamp - lastCalled); 34312 34313 lastCalled = stamp; 34314 if (remaining > 0) { 34315 if (++count >= HOT_COUNT) { 34316 return arguments[0]; 34317 } 34318 } else { 34319 count = 0; 34320 } 34321 return func.apply(undefined, arguments); 34322 }; 34323 } 34324 34325 /** 34326 * A specialized version of `_.shuffle` which mutates and sets the size of `array`. 34327 * 34328 * @private 34329 * @param {Array} array The array to shuffle. 34330 * @param {number} [size=array.length] The size of `array`. 34331 * @returns {Array} Returns `array`. 34332 */ 34333 function shuffleSelf(array, size) { 34334 var index = -1, 34335 length = array.length, 34336 lastIndex = length - 1; 34337 34338 size = size === undefined ? length : size; 34339 while (++index < size) { 34340 var rand = baseRandom(index, lastIndex), 34341 value = array[rand]; 34342 34343 array[rand] = array[index]; 34344 array[index] = value; 34345 } 34346 array.length = size; 34347 return array; 34348 } 34349 34350 /** 34351 * Converts `string` to a property path array. 34352 * 34353 * @private 34354 * @param {string} string The string to convert. 34355 * @returns {Array} Returns the property path array. 34356 */ 34357 var stringToPath = memoizeCapped(function(string) { 34358 var result = []; 34359 if (string.charCodeAt(0) === 46 /* . */) { 34360 result.push(''); 34361 } 34362 string.replace(rePropName, function(match, number, quote, subString) { 34363 result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match)); 34364 }); 34365 return result; 34366 }); 34367 34368 /** 34369 * Converts `value` to a string key if it's not a string or symbol. 34370 * 34371 * @private 34372 * @param {*} value The value to inspect. 34373 * @returns {string|symbol} Returns the key. 34374 */ 34375 function toKey(value) { 34376 if (typeof value == 'string' || isSymbol(value)) { 34377 return value; 34378 } 34379 var result = (value + ''); 34380 return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; 34381 } 34382 34383 /** 34384 * Converts `func` to its source code. 34385 * 34386 * @private 34387 * @param {Function} func The function to convert. 34388 * @returns {string} Returns the source code. 34389 */ 34390 function toSource(func) { 34391 if (func != null) { 34392 try { 34393 return funcToString.call(func); 34394 } catch (e) {} 34395 try { 34396 return (func + ''); 34397 } catch (e) {} 34398 } 34399 return ''; 34400 } 34401 34402 /** 34403 * Updates wrapper `details` based on `bitmask` flags. 34404 * 34405 * @private 34406 * @returns {Array} details The details to modify. 34407 * @param {number} bitmask The bitmask flags. See `createWrap` for more details. 34408 * @returns {Array} Returns `details`. 34409 */ 34410 function updateWrapDetails(details, bitmask) { 34411 arrayEach(wrapFlags, function(pair) { 34412 var value = '_.' + pair[0]; 34413 if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { 34414 details.push(value); 34415 } 34416 }); 34417 return details.sort(); 34418 } 34419 34420 /** 34421 * Creates a clone of `wrapper`. 34422 * 34423 * @private 34424 * @param {Object} wrapper The wrapper to clone. 34425 * @returns {Object} Returns the cloned wrapper. 34426 */ 34427 function wrapperClone(wrapper) { 34428 if (wrapper instanceof LazyWrapper) { 34429 return wrapper.clone(); 34430 } 34431 var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); 34432 result.__actions__ = copyArray(wrapper.__actions__); 34433 result.__index__ = wrapper.__index__; 34434 result.__values__ = wrapper.__values__; 34435 return result; 34436 } 34437 34438 /*------------------------------------------------------------------------*/ 34439 34440 /** 34441 * Creates an array of elements split into groups the length of `size`. 34442 * If `array` can't be split evenly, the final chunk will be the remaining 34443 * elements. 34444 * 34445 * @static 34446 * @memberOf _ 34447 * @since 3.0.0 34448 * @category Array 34449 * @param {Array} array The array to process. 34450 * @param {number} [size=1] The length of each chunk 34451 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 34452 * @returns {Array} Returns the new array of chunks. 34453 * @example 34454 * 34455 * _.chunk(['a', 'b', 'c', 'd'], 2); 34456 * // => [['a', 'b'], ['c', 'd']] 34457 * 34458 * _.chunk(['a', 'b', 'c', 'd'], 3); 34459 * // => [['a', 'b', 'c'], ['d']] 34460 */ 34461 function chunk(array, size, guard) { 34462 if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { 34463 size = 1; 34464 } else { 34465 size = nativeMax(toInteger(size), 0); 34466 } 34467 var length = array == null ? 0 : array.length; 34468 if (!length || size < 1) { 34469 return []; 34470 } 34471 var index = 0, 34472 resIndex = 0, 34473 result = Array(nativeCeil(length / size)); 34474 34475 while (index < length) { 34476 result[resIndex++] = baseSlice(array, index, (index += size)); 34477 } 34478 return result; 34479 } 34480 34481 /** 34482 * Creates an array with all falsey values removed. The values `false`, `null`, 34483 * `0`, `""`, `undefined`, and `NaN` are falsey. 34484 * 34485 * @static 34486 * @memberOf _ 34487 * @since 0.1.0 34488 * @category Array 34489 * @param {Array} array The array to compact. 34490 * @returns {Array} Returns the new array of filtered values. 34491 * @example 34492 * 34493 * _.compact([0, 1, false, 2, '', 3]); 34494 * // => [1, 2, 3] 34495 */ 34496 function compact(array) { 34497 var index = -1, 34498 length = array == null ? 0 : array.length, 34499 resIndex = 0, 34500 result = []; 34501 34502 while (++index < length) { 34503 var value = array[index]; 34504 if (value) { 34505 result[resIndex++] = value; 34506 } 34507 } 34508 return result; 34509 } 34510 34511 /** 34512 * Creates a new array concatenating `array` with any additional arrays 34513 * and/or values. 34514 * 34515 * @static 34516 * @memberOf _ 34517 * @since 4.0.0 34518 * @category Array 34519 * @param {Array} array The array to concatenate. 34520 * @param {...*} [values] The values to concatenate. 34521 * @returns {Array} Returns the new concatenated array. 34522 * @example 34523 * 34524 * var array = [1]; 34525 * var other = _.concat(array, 2, [3], [[4]]); 34526 * 34527 * console.log(other); 34528 * // => [1, 2, 3, [4]] 34529 * 34530 * console.log(array); 34531 * // => [1] 34532 */ 34533 function concat() { 34534 var length = arguments.length; 34535 if (!length) { 34536 return []; 34537 } 34538 var args = Array(length - 1), 34539 array = arguments[0], 34540 index = length; 34541 34542 while (index--) { 34543 args[index - 1] = arguments[index]; 34544 } 34545 return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 34546 } 34547 34548 /** 34549 * Creates an array of `array` values not included in the other given arrays 34550 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 34551 * for equality comparisons. The order and references of result values are 34552 * determined by the first array. 34553 * 34554 * **Note:** Unlike `_.pullAll`, this method returns a new array. 34555 * 34556 * @static 34557 * @memberOf _ 34558 * @since 0.1.0 34559 * @category Array 34560 * @param {Array} array The array to inspect. 34561 * @param {...Array} [values] The values to exclude. 34562 * @returns {Array} Returns the new array of filtered values. 34563 * @see _.without, _.xor 34564 * @example 34565 * 34566 * _.difference([2, 1], [2, 3]); 34567 * // => [1] 34568 */ 34569 var difference = baseRest(function(array, values) { 34570 return isArrayLikeObject(array) 34571 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) 34572 : []; 34573 }); 34574 34575 /** 34576 * This method is like `_.difference` except that it accepts `iteratee` which 34577 * is invoked for each element of `array` and `values` to generate the criterion 34578 * by which they're compared. The order and references of result values are 34579 * determined by the first array. The iteratee is invoked with one argument: 34580 * (value). 34581 * 34582 * **Note:** Unlike `_.pullAllBy`, this method returns a new array. 34583 * 34584 * @static 34585 * @memberOf _ 34586 * @since 4.0.0 34587 * @category Array 34588 * @param {Array} array The array to inspect. 34589 * @param {...Array} [values] The values to exclude. 34590 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 34591 * @returns {Array} Returns the new array of filtered values. 34592 * @example 34593 * 34594 * _.differenceBy([2.1, 1.2], [2.3, 3.4], Math.floor); 34595 * // => [1.2] 34596 * 34597 * // The `_.property` iteratee shorthand. 34598 * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); 34599 * // => [{ 'x': 2 }] 34600 */ 34601 var differenceBy = baseRest(function(array, values) { 34602 var iteratee = last(values); 34603 if (isArrayLikeObject(iteratee)) { 34604 iteratee = undefined; 34605 } 34606 return isArrayLikeObject(array) 34607 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) 34608 : []; 34609 }); 34610 34611 /** 34612 * This method is like `_.difference` except that it accepts `comparator` 34613 * which is invoked to compare elements of `array` to `values`. The order and 34614 * references of result values are determined by the first array. The comparator 34615 * is invoked with two arguments: (arrVal, othVal). 34616 * 34617 * **Note:** Unlike `_.pullAllWith`, this method returns a new array. 34618 * 34619 * @static 34620 * @memberOf _ 34621 * @since 4.0.0 34622 * @category Array 34623 * @param {Array} array The array to inspect. 34624 * @param {...Array} [values] The values to exclude. 34625 * @param {Function} [comparator] The comparator invoked per element. 34626 * @returns {Array} Returns the new array of filtered values. 34627 * @example 34628 * 34629 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 34630 * 34631 * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); 34632 * // => [{ 'x': 2, 'y': 1 }] 34633 */ 34634 var differenceWith = baseRest(function(array, values) { 34635 var comparator = last(values); 34636 if (isArrayLikeObject(comparator)) { 34637 comparator = undefined; 34638 } 34639 return isArrayLikeObject(array) 34640 ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) 34641 : []; 34642 }); 34643 34644 /** 34645 * Creates a slice of `array` with `n` elements dropped from the beginning. 34646 * 34647 * @static 34648 * @memberOf _ 34649 * @since 0.5.0 34650 * @category Array 34651 * @param {Array} array The array to query. 34652 * @param {number} [n=1] The number of elements to drop. 34653 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 34654 * @returns {Array} Returns the slice of `array`. 34655 * @example 34656 * 34657 * _.drop([1, 2, 3]); 34658 * // => [2, 3] 34659 * 34660 * _.drop([1, 2, 3], 2); 34661 * // => [3] 34662 * 34663 * _.drop([1, 2, 3], 5); 34664 * // => [] 34665 * 34666 * _.drop([1, 2, 3], 0); 34667 * // => [1, 2, 3] 34668 */ 34669 function drop(array, n, guard) { 34670 var length = array == null ? 0 : array.length; 34671 if (!length) { 34672 return []; 34673 } 34674 n = (guard || n === undefined) ? 1 : toInteger(n); 34675 return baseSlice(array, n < 0 ? 0 : n, length); 34676 } 34677 34678 /** 34679 * Creates a slice of `array` with `n` elements dropped from the end. 34680 * 34681 * @static 34682 * @memberOf _ 34683 * @since 3.0.0 34684 * @category Array 34685 * @param {Array} array The array to query. 34686 * @param {number} [n=1] The number of elements to drop. 34687 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 34688 * @returns {Array} Returns the slice of `array`. 34689 * @example 34690 * 34691 * _.dropRight([1, 2, 3]); 34692 * // => [1, 2] 34693 * 34694 * _.dropRight([1, 2, 3], 2); 34695 * // => [1] 34696 * 34697 * _.dropRight([1, 2, 3], 5); 34698 * // => [] 34699 * 34700 * _.dropRight([1, 2, 3], 0); 34701 * // => [1, 2, 3] 34702 */ 34703 function dropRight(array, n, guard) { 34704 var length = array == null ? 0 : array.length; 34705 if (!length) { 34706 return []; 34707 } 34708 n = (guard || n === undefined) ? 1 : toInteger(n); 34709 n = length - n; 34710 return baseSlice(array, 0, n < 0 ? 0 : n); 34711 } 34712 34713 /** 34714 * Creates a slice of `array` excluding elements dropped from the end. 34715 * Elements are dropped until `predicate` returns falsey. The predicate is 34716 * invoked with three arguments: (value, index, array). 34717 * 34718 * @static 34719 * @memberOf _ 34720 * @since 3.0.0 34721 * @category Array 34722 * @param {Array} array The array to query. 34723 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34724 * @returns {Array} Returns the slice of `array`. 34725 * @example 34726 * 34727 * var users = [ 34728 * { 'user': 'barney', 'active': true }, 34729 * { 'user': 'fred', 'active': false }, 34730 * { 'user': 'pebbles', 'active': false } 34731 * ]; 34732 * 34733 * _.dropRightWhile(users, function(o) { return !o.active; }); 34734 * // => objects for ['barney'] 34735 * 34736 * // The `_.matches` iteratee shorthand. 34737 * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); 34738 * // => objects for ['barney', 'fred'] 34739 * 34740 * // The `_.matchesProperty` iteratee shorthand. 34741 * _.dropRightWhile(users, ['active', false]); 34742 * // => objects for ['barney'] 34743 * 34744 * // The `_.property` iteratee shorthand. 34745 * _.dropRightWhile(users, 'active'); 34746 * // => objects for ['barney', 'fred', 'pebbles'] 34747 */ 34748 function dropRightWhile(array, predicate) { 34749 return (array && array.length) 34750 ? baseWhile(array, getIteratee(predicate, 3), true, true) 34751 : []; 34752 } 34753 34754 /** 34755 * Creates a slice of `array` excluding elements dropped from the beginning. 34756 * Elements are dropped until `predicate` returns falsey. The predicate is 34757 * invoked with three arguments: (value, index, array). 34758 * 34759 * @static 34760 * @memberOf _ 34761 * @since 3.0.0 34762 * @category Array 34763 * @param {Array} array The array to query. 34764 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34765 * @returns {Array} Returns the slice of `array`. 34766 * @example 34767 * 34768 * var users = [ 34769 * { 'user': 'barney', 'active': false }, 34770 * { 'user': 'fred', 'active': false }, 34771 * { 'user': 'pebbles', 'active': true } 34772 * ]; 34773 * 34774 * _.dropWhile(users, function(o) { return !o.active; }); 34775 * // => objects for ['pebbles'] 34776 * 34777 * // The `_.matches` iteratee shorthand. 34778 * _.dropWhile(users, { 'user': 'barney', 'active': false }); 34779 * // => objects for ['fred', 'pebbles'] 34780 * 34781 * // The `_.matchesProperty` iteratee shorthand. 34782 * _.dropWhile(users, ['active', false]); 34783 * // => objects for ['pebbles'] 34784 * 34785 * // The `_.property` iteratee shorthand. 34786 * _.dropWhile(users, 'active'); 34787 * // => objects for ['barney', 'fred', 'pebbles'] 34788 */ 34789 function dropWhile(array, predicate) { 34790 return (array && array.length) 34791 ? baseWhile(array, getIteratee(predicate, 3), true) 34792 : []; 34793 } 34794 34795 /** 34796 * Fills elements of `array` with `value` from `start` up to, but not 34797 * including, `end`. 34798 * 34799 * **Note:** This method mutates `array`. 34800 * 34801 * @static 34802 * @memberOf _ 34803 * @since 3.2.0 34804 * @category Array 34805 * @param {Array} array The array to fill. 34806 * @param {*} value The value to fill `array` with. 34807 * @param {number} [start=0] The start position. 34808 * @param {number} [end=array.length] The end position. 34809 * @returns {Array} Returns `array`. 34810 * @example 34811 * 34812 * var array = [1, 2, 3]; 34813 * 34814 * _.fill(array, 'a'); 34815 * console.log(array); 34816 * // => ['a', 'a', 'a'] 34817 * 34818 * _.fill(Array(3), 2); 34819 * // => [2, 2, 2] 34820 * 34821 * _.fill([4, 6, 8, 10], '*', 1, 3); 34822 * // => [4, '*', '*', 10] 34823 */ 34824 function fill(array, value, start, end) { 34825 var length = array == null ? 0 : array.length; 34826 if (!length) { 34827 return []; 34828 } 34829 if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { 34830 start = 0; 34831 end = length; 34832 } 34833 return baseFill(array, value, start, end); 34834 } 34835 34836 /** 34837 * This method is like `_.find` except that it returns the index of the first 34838 * element `predicate` returns truthy for instead of the element itself. 34839 * 34840 * @static 34841 * @memberOf _ 34842 * @since 1.1.0 34843 * @category Array 34844 * @param {Array} array The array to inspect. 34845 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34846 * @param {number} [fromIndex=0] The index to search from. 34847 * @returns {number} Returns the index of the found element, else `-1`. 34848 * @example 34849 * 34850 * var users = [ 34851 * { 'user': 'barney', 'active': false }, 34852 * { 'user': 'fred', 'active': false }, 34853 * { 'user': 'pebbles', 'active': true } 34854 * ]; 34855 * 34856 * _.findIndex(users, function(o) { return o.user == 'barney'; }); 34857 * // => 0 34858 * 34859 * // The `_.matches` iteratee shorthand. 34860 * _.findIndex(users, { 'user': 'fred', 'active': false }); 34861 * // => 1 34862 * 34863 * // The `_.matchesProperty` iteratee shorthand. 34864 * _.findIndex(users, ['active', false]); 34865 * // => 0 34866 * 34867 * // The `_.property` iteratee shorthand. 34868 * _.findIndex(users, 'active'); 34869 * // => 2 34870 */ 34871 function findIndex(array, predicate, fromIndex) { 34872 var length = array == null ? 0 : array.length; 34873 if (!length) { 34874 return -1; 34875 } 34876 var index = fromIndex == null ? 0 : toInteger(fromIndex); 34877 if (index < 0) { 34878 index = nativeMax(length + index, 0); 34879 } 34880 return baseFindIndex(array, getIteratee(predicate, 3), index); 34881 } 34882 34883 /** 34884 * This method is like `_.findIndex` except that it iterates over elements 34885 * of `collection` from right to left. 34886 * 34887 * @static 34888 * @memberOf _ 34889 * @since 2.0.0 34890 * @category Array 34891 * @param {Array} array The array to inspect. 34892 * @param {Function} [predicate=_.identity] The function invoked per iteration. 34893 * @param {number} [fromIndex=array.length-1] The index to search from. 34894 * @returns {number} Returns the index of the found element, else `-1`. 34895 * @example 34896 * 34897 * var users = [ 34898 * { 'user': 'barney', 'active': true }, 34899 * { 'user': 'fred', 'active': false }, 34900 * { 'user': 'pebbles', 'active': false } 34901 * ]; 34902 * 34903 * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); 34904 * // => 2 34905 * 34906 * // The `_.matches` iteratee shorthand. 34907 * _.findLastIndex(users, { 'user': 'barney', 'active': true }); 34908 * // => 0 34909 * 34910 * // The `_.matchesProperty` iteratee shorthand. 34911 * _.findLastIndex(users, ['active', false]); 34912 * // => 2 34913 * 34914 * // The `_.property` iteratee shorthand. 34915 * _.findLastIndex(users, 'active'); 34916 * // => 0 34917 */ 34918 function findLastIndex(array, predicate, fromIndex) { 34919 var length = array == null ? 0 : array.length; 34920 if (!length) { 34921 return -1; 34922 } 34923 var index = length - 1; 34924 if (fromIndex !== undefined) { 34925 index = toInteger(fromIndex); 34926 index = fromIndex < 0 34927 ? nativeMax(length + index, 0) 34928 : nativeMin(index, length - 1); 34929 } 34930 return baseFindIndex(array, getIteratee(predicate, 3), index, true); 34931 } 34932 34933 /** 34934 * Flattens `array` a single level deep. 34935 * 34936 * @static 34937 * @memberOf _ 34938 * @since 0.1.0 34939 * @category Array 34940 * @param {Array} array The array to flatten. 34941 * @returns {Array} Returns the new flattened array. 34942 * @example 34943 * 34944 * _.flatten([1, [2, [3, [4]], 5]]); 34945 * // => [1, 2, [3, [4]], 5] 34946 */ 34947 function flatten(array) { 34948 var length = array == null ? 0 : array.length; 34949 return length ? baseFlatten(array, 1) : []; 34950 } 34951 34952 /** 34953 * Recursively flattens `array`. 34954 * 34955 * @static 34956 * @memberOf _ 34957 * @since 3.0.0 34958 * @category Array 34959 * @param {Array} array The array to flatten. 34960 * @returns {Array} Returns the new flattened array. 34961 * @example 34962 * 34963 * _.flattenDeep([1, [2, [3, [4]], 5]]); 34964 * // => [1, 2, 3, 4, 5] 34965 */ 34966 function flattenDeep(array) { 34967 var length = array == null ? 0 : array.length; 34968 return length ? baseFlatten(array, INFINITY) : []; 34969 } 34970 34971 /** 34972 * Recursively flatten `array` up to `depth` times. 34973 * 34974 * @static 34975 * @memberOf _ 34976 * @since 4.4.0 34977 * @category Array 34978 * @param {Array} array The array to flatten. 34979 * @param {number} [depth=1] The maximum recursion depth. 34980 * @returns {Array} Returns the new flattened array. 34981 * @example 34982 * 34983 * var array = [1, [2, [3, [4]], 5]]; 34984 * 34985 * _.flattenDepth(array, 1); 34986 * // => [1, 2, [3, [4]], 5] 34987 * 34988 * _.flattenDepth(array, 2); 34989 * // => [1, 2, 3, [4], 5] 34990 */ 34991 function flattenDepth(array, depth) { 34992 var length = array == null ? 0 : array.length; 34993 if (!length) { 34994 return []; 34995 } 34996 depth = depth === undefined ? 1 : toInteger(depth); 34997 return baseFlatten(array, depth); 34998 } 34999 35000 /** 35001 * The inverse of `_.toPairs`; this method returns an object composed 35002 * from key-value `pairs`. 35003 * 35004 * @static 35005 * @memberOf _ 35006 * @since 4.0.0 35007 * @category Array 35008 * @param {Array} pairs The key-value pairs. 35009 * @returns {Object} Returns the new object. 35010 * @example 35011 * 35012 * _.fromPairs([['a', 1], ['b', 2]]); 35013 * // => { 'a': 1, 'b': 2 } 35014 */ 35015 function fromPairs(pairs) { 35016 var index = -1, 35017 length = pairs == null ? 0 : pairs.length, 35018 result = {}; 35019 35020 while (++index < length) { 35021 var pair = pairs[index]; 35022 result[pair[0]] = pair[1]; 35023 } 35024 return result; 35025 } 35026 35027 /** 35028 * Gets the first element of `array`. 35029 * 35030 * @static 35031 * @memberOf _ 35032 * @since 0.1.0 35033 * @alias first 35034 * @category Array 35035 * @param {Array} array The array to query. 35036 * @returns {*} Returns the first element of `array`. 35037 * @example 35038 * 35039 * _.head([1, 2, 3]); 35040 * // => 1 35041 * 35042 * _.head([]); 35043 * // => undefined 35044 */ 35045 function head(array) { 35046 return (array && array.length) ? array[0] : undefined; 35047 } 35048 35049 /** 35050 * Gets the index at which the first occurrence of `value` is found in `array` 35051 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35052 * for equality comparisons. If `fromIndex` is negative, it's used as the 35053 * offset from the end of `array`. 35054 * 35055 * @static 35056 * @memberOf _ 35057 * @since 0.1.0 35058 * @category Array 35059 * @param {Array} array The array to inspect. 35060 * @param {*} value The value to search for. 35061 * @param {number} [fromIndex=0] The index to search from. 35062 * @returns {number} Returns the index of the matched value, else `-1`. 35063 * @example 35064 * 35065 * _.indexOf([1, 2, 1, 2], 2); 35066 * // => 1 35067 * 35068 * // Search from the `fromIndex`. 35069 * _.indexOf([1, 2, 1, 2], 2, 2); 35070 * // => 3 35071 */ 35072 function indexOf(array, value, fromIndex) { 35073 var length = array == null ? 0 : array.length; 35074 if (!length) { 35075 return -1; 35076 } 35077 var index = fromIndex == null ? 0 : toInteger(fromIndex); 35078 if (index < 0) { 35079 index = nativeMax(length + index, 0); 35080 } 35081 return baseIndexOf(array, value, index); 35082 } 35083 35084 /** 35085 * Gets all but the last element of `array`. 35086 * 35087 * @static 35088 * @memberOf _ 35089 * @since 0.1.0 35090 * @category Array 35091 * @param {Array} array The array to query. 35092 * @returns {Array} Returns the slice of `array`. 35093 * @example 35094 * 35095 * _.initial([1, 2, 3]); 35096 * // => [1, 2] 35097 */ 35098 function initial(array) { 35099 var length = array == null ? 0 : array.length; 35100 return length ? baseSlice(array, 0, -1) : []; 35101 } 35102 35103 /** 35104 * Creates an array of unique values that are included in all given arrays 35105 * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35106 * for equality comparisons. The order and references of result values are 35107 * determined by the first array. 35108 * 35109 * @static 35110 * @memberOf _ 35111 * @since 0.1.0 35112 * @category Array 35113 * @param {...Array} [arrays] The arrays to inspect. 35114 * @returns {Array} Returns the new array of intersecting values. 35115 * @example 35116 * 35117 * _.intersection([2, 1], [2, 3]); 35118 * // => [2] 35119 */ 35120 var intersection = baseRest(function(arrays) { 35121 var mapped = arrayMap(arrays, castArrayLikeObject); 35122 return (mapped.length && mapped[0] === arrays[0]) 35123 ? baseIntersection(mapped) 35124 : []; 35125 }); 35126 35127 /** 35128 * This method is like `_.intersection` except that it accepts `iteratee` 35129 * which is invoked for each element of each `arrays` to generate the criterion 35130 * by which they're compared. The order and references of result values are 35131 * determined by the first array. The iteratee is invoked with one argument: 35132 * (value). 35133 * 35134 * @static 35135 * @memberOf _ 35136 * @since 4.0.0 35137 * @category Array 35138 * @param {...Array} [arrays] The arrays to inspect. 35139 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35140 * @returns {Array} Returns the new array of intersecting values. 35141 * @example 35142 * 35143 * _.intersectionBy([2.1, 1.2], [2.3, 3.4], Math.floor); 35144 * // => [2.1] 35145 * 35146 * // The `_.property` iteratee shorthand. 35147 * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 35148 * // => [{ 'x': 1 }] 35149 */ 35150 var intersectionBy = baseRest(function(arrays) { 35151 var iteratee = last(arrays), 35152 mapped = arrayMap(arrays, castArrayLikeObject); 35153 35154 if (iteratee === last(mapped)) { 35155 iteratee = undefined; 35156 } else { 35157 mapped.pop(); 35158 } 35159 return (mapped.length && mapped[0] === arrays[0]) 35160 ? baseIntersection(mapped, getIteratee(iteratee, 2)) 35161 : []; 35162 }); 35163 35164 /** 35165 * This method is like `_.intersection` except that it accepts `comparator` 35166 * which is invoked to compare elements of `arrays`. The order and references 35167 * of result values are determined by the first array. The comparator is 35168 * invoked with two arguments: (arrVal, othVal). 35169 * 35170 * @static 35171 * @memberOf _ 35172 * @since 4.0.0 35173 * @category Array 35174 * @param {...Array} [arrays] The arrays to inspect. 35175 * @param {Function} [comparator] The comparator invoked per element. 35176 * @returns {Array} Returns the new array of intersecting values. 35177 * @example 35178 * 35179 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 35180 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 35181 * 35182 * _.intersectionWith(objects, others, _.isEqual); 35183 * // => [{ 'x': 1, 'y': 2 }] 35184 */ 35185 var intersectionWith = baseRest(function(arrays) { 35186 var comparator = last(arrays), 35187 mapped = arrayMap(arrays, castArrayLikeObject); 35188 35189 comparator = typeof comparator == 'function' ? comparator : undefined; 35190 if (comparator) { 35191 mapped.pop(); 35192 } 35193 return (mapped.length && mapped[0] === arrays[0]) 35194 ? baseIntersection(mapped, undefined, comparator) 35195 : []; 35196 }); 35197 35198 /** 35199 * Converts all elements in `array` into a string separated by `separator`. 35200 * 35201 * @static 35202 * @memberOf _ 35203 * @since 4.0.0 35204 * @category Array 35205 * @param {Array} array The array to convert. 35206 * @param {string} [separator=','] The element separator. 35207 * @returns {string} Returns the joined string. 35208 * @example 35209 * 35210 * _.join(['a', 'b', 'c'], '~'); 35211 * // => 'a~b~c' 35212 */ 35213 function join(array, separator) { 35214 return array == null ? '' : nativeJoin.call(array, separator); 35215 } 35216 35217 /** 35218 * Gets the last element of `array`. 35219 * 35220 * @static 35221 * @memberOf _ 35222 * @since 0.1.0 35223 * @category Array 35224 * @param {Array} array The array to query. 35225 * @returns {*} Returns the last element of `array`. 35226 * @example 35227 * 35228 * _.last([1, 2, 3]); 35229 * // => 3 35230 */ 35231 function last(array) { 35232 var length = array == null ? 0 : array.length; 35233 return length ? array[length - 1] : undefined; 35234 } 35235 35236 /** 35237 * This method is like `_.indexOf` except that it iterates over elements of 35238 * `array` from right to left. 35239 * 35240 * @static 35241 * @memberOf _ 35242 * @since 0.1.0 35243 * @category Array 35244 * @param {Array} array The array to inspect. 35245 * @param {*} value The value to search for. 35246 * @param {number} [fromIndex=array.length-1] The index to search from. 35247 * @returns {number} Returns the index of the matched value, else `-1`. 35248 * @example 35249 * 35250 * _.lastIndexOf([1, 2, 1, 2], 2); 35251 * // => 3 35252 * 35253 * // Search from the `fromIndex`. 35254 * _.lastIndexOf([1, 2, 1, 2], 2, 2); 35255 * // => 1 35256 */ 35257 function lastIndexOf(array, value, fromIndex) { 35258 var length = array == null ? 0 : array.length; 35259 if (!length) { 35260 return -1; 35261 } 35262 var index = length; 35263 if (fromIndex !== undefined) { 35264 index = toInteger(fromIndex); 35265 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 35266 } 35267 return value === value 35268 ? strictLastIndexOf(array, value, index) 35269 : baseFindIndex(array, baseIsNaN, index, true); 35270 } 35271 35272 /** 35273 * Gets the element at index `n` of `array`. If `n` is negative, the nth 35274 * element from the end is returned. 35275 * 35276 * @static 35277 * @memberOf _ 35278 * @since 4.11.0 35279 * @category Array 35280 * @param {Array} array The array to query. 35281 * @param {number} [n=0] The index of the element to return. 35282 * @returns {*} Returns the nth element of `array`. 35283 * @example 35284 * 35285 * var array = ['a', 'b', 'c', 'd']; 35286 * 35287 * _.nth(array, 1); 35288 * // => 'b' 35289 * 35290 * _.nth(array, -2); 35291 * // => 'c'; 35292 */ 35293 function nth(array, n) { 35294 return (array && array.length) ? baseNth(array, toInteger(n)) : undefined; 35295 } 35296 35297 /** 35298 * Removes all given values from `array` using 35299 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35300 * for equality comparisons. 35301 * 35302 * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` 35303 * to remove elements from an array by predicate. 35304 * 35305 * @static 35306 * @memberOf _ 35307 * @since 2.0.0 35308 * @category Array 35309 * @param {Array} array The array to modify. 35310 * @param {...*} [values] The values to remove. 35311 * @returns {Array} Returns `array`. 35312 * @example 35313 * 35314 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 35315 * 35316 * _.pull(array, 'a', 'c'); 35317 * console.log(array); 35318 * // => ['b', 'b'] 35319 */ 35320 var pull = baseRest(pullAll); 35321 35322 /** 35323 * This method is like `_.pull` except that it accepts an array of values to remove. 35324 * 35325 * **Note:** Unlike `_.difference`, this method mutates `array`. 35326 * 35327 * @static 35328 * @memberOf _ 35329 * @since 4.0.0 35330 * @category Array 35331 * @param {Array} array The array to modify. 35332 * @param {Array} values The values to remove. 35333 * @returns {Array} Returns `array`. 35334 * @example 35335 * 35336 * var array = ['a', 'b', 'c', 'a', 'b', 'c']; 35337 * 35338 * _.pullAll(array, ['a', 'c']); 35339 * console.log(array); 35340 * // => ['b', 'b'] 35341 */ 35342 function pullAll(array, values) { 35343 return (array && array.length && values && values.length) 35344 ? basePullAll(array, values) 35345 : array; 35346 } 35347 35348 /** 35349 * This method is like `_.pullAll` except that it accepts `iteratee` which is 35350 * invoked for each element of `array` and `values` to generate the criterion 35351 * by which they're compared. The iteratee is invoked with one argument: (value). 35352 * 35353 * **Note:** Unlike `_.differenceBy`, this method mutates `array`. 35354 * 35355 * @static 35356 * @memberOf _ 35357 * @since 4.0.0 35358 * @category Array 35359 * @param {Array} array The array to modify. 35360 * @param {Array} values The values to remove. 35361 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35362 * @returns {Array} Returns `array`. 35363 * @example 35364 * 35365 * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; 35366 * 35367 * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); 35368 * console.log(array); 35369 * // => [{ 'x': 2 }] 35370 */ 35371 function pullAllBy(array, values, iteratee) { 35372 return (array && array.length && values && values.length) 35373 ? basePullAll(array, values, getIteratee(iteratee, 2)) 35374 : array; 35375 } 35376 35377 /** 35378 * This method is like `_.pullAll` except that it accepts `comparator` which 35379 * is invoked to compare elements of `array` to `values`. The comparator is 35380 * invoked with two arguments: (arrVal, othVal). 35381 * 35382 * **Note:** Unlike `_.differenceWith`, this method mutates `array`. 35383 * 35384 * @static 35385 * @memberOf _ 35386 * @since 4.6.0 35387 * @category Array 35388 * @param {Array} array The array to modify. 35389 * @param {Array} values The values to remove. 35390 * @param {Function} [comparator] The comparator invoked per element. 35391 * @returns {Array} Returns `array`. 35392 * @example 35393 * 35394 * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; 35395 * 35396 * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); 35397 * console.log(array); 35398 * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] 35399 */ 35400 function pullAllWith(array, values, comparator) { 35401 return (array && array.length && values && values.length) 35402 ? basePullAll(array, values, undefined, comparator) 35403 : array; 35404 } 35405 35406 /** 35407 * Removes elements from `array` corresponding to `indexes` and returns an 35408 * array of removed elements. 35409 * 35410 * **Note:** Unlike `_.at`, this method mutates `array`. 35411 * 35412 * @static 35413 * @memberOf _ 35414 * @since 3.0.0 35415 * @category Array 35416 * @param {Array} array The array to modify. 35417 * @param {...(number|number[])} [indexes] The indexes of elements to remove. 35418 * @returns {Array} Returns the new array of removed elements. 35419 * @example 35420 * 35421 * var array = ['a', 'b', 'c', 'd']; 35422 * var pulled = _.pullAt(array, [1, 3]); 35423 * 35424 * console.log(array); 35425 * // => ['a', 'c'] 35426 * 35427 * console.log(pulled); 35428 * // => ['b', 'd'] 35429 */ 35430 var pullAt = flatRest(function(array, indexes) { 35431 var length = array == null ? 0 : array.length, 35432 result = baseAt(array, indexes); 35433 35434 basePullAt(array, arrayMap(indexes, function(index) { 35435 return isIndex(index, length) ? +index : index; 35436 }).sort(compareAscending)); 35437 35438 return result; 35439 }); 35440 35441 /** 35442 * Removes all elements from `array` that `predicate` returns truthy for 35443 * and returns an array of the removed elements. The predicate is invoked 35444 * with three arguments: (value, index, array). 35445 * 35446 * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` 35447 * to pull elements from an array by value. 35448 * 35449 * @static 35450 * @memberOf _ 35451 * @since 2.0.0 35452 * @category Array 35453 * @param {Array} array The array to modify. 35454 * @param {Function} [predicate=_.identity] The function invoked per iteration. 35455 * @returns {Array} Returns the new array of removed elements. 35456 * @example 35457 * 35458 * var array = [1, 2, 3, 4]; 35459 * var evens = _.remove(array, function(n) { 35460 * return n % 2 == 0; 35461 * }); 35462 * 35463 * console.log(array); 35464 * // => [1, 3] 35465 * 35466 * console.log(evens); 35467 * // => [2, 4] 35468 */ 35469 function remove(array, predicate) { 35470 var result = []; 35471 if (!(array && array.length)) { 35472 return result; 35473 } 35474 var index = -1, 35475 indexes = [], 35476 length = array.length; 35477 35478 predicate = getIteratee(predicate, 3); 35479 while (++index < length) { 35480 var value = array[index]; 35481 if (predicate(value, index, array)) { 35482 result.push(value); 35483 indexes.push(index); 35484 } 35485 } 35486 basePullAt(array, indexes); 35487 return result; 35488 } 35489 35490 /** 35491 * Reverses `array` so that the first element becomes the last, the second 35492 * element becomes the second to last, and so on. 35493 * 35494 * **Note:** This method mutates `array` and is based on 35495 * [`Array#reverse`](https://mdn.io/Array/reverse). 35496 * 35497 * @static 35498 * @memberOf _ 35499 * @since 4.0.0 35500 * @category Array 35501 * @param {Array} array The array to modify. 35502 * @returns {Array} Returns `array`. 35503 * @example 35504 * 35505 * var array = [1, 2, 3]; 35506 * 35507 * _.reverse(array); 35508 * // => [3, 2, 1] 35509 * 35510 * console.log(array); 35511 * // => [3, 2, 1] 35512 */ 35513 function reverse(array) { 35514 return array == null ? array : nativeReverse.call(array); 35515 } 35516 35517 /** 35518 * Creates a slice of `array` from `start` up to, but not including, `end`. 35519 * 35520 * **Note:** This method is used instead of 35521 * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are 35522 * returned. 35523 * 35524 * @static 35525 * @memberOf _ 35526 * @since 3.0.0 35527 * @category Array 35528 * @param {Array} array The array to slice. 35529 * @param {number} [start=0] The start position. 35530 * @param {number} [end=array.length] The end position. 35531 * @returns {Array} Returns the slice of `array`. 35532 */ 35533 function slice(array, start, end) { 35534 var length = array == null ? 0 : array.length; 35535 if (!length) { 35536 return []; 35537 } 35538 if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { 35539 start = 0; 35540 end = length; 35541 } 35542 else { 35543 start = start == null ? 0 : toInteger(start); 35544 end = end === undefined ? length : toInteger(end); 35545 } 35546 return baseSlice(array, start, end); 35547 } 35548 35549 /** 35550 * Uses a binary search to determine the lowest index at which `value` 35551 * should be inserted into `array` in order to maintain its sort order. 35552 * 35553 * @static 35554 * @memberOf _ 35555 * @since 0.1.0 35556 * @category Array 35557 * @param {Array} array The sorted array to inspect. 35558 * @param {*} value The value to evaluate. 35559 * @returns {number} Returns the index at which `value` should be inserted 35560 * into `array`. 35561 * @example 35562 * 35563 * _.sortedIndex([30, 50], 40); 35564 * // => 1 35565 */ 35566 function sortedIndex(array, value) { 35567 return baseSortedIndex(array, value); 35568 } 35569 35570 /** 35571 * This method is like `_.sortedIndex` except that it accepts `iteratee` 35572 * which is invoked for `value` and each element of `array` to compute their 35573 * sort ranking. The iteratee is invoked with one argument: (value). 35574 * 35575 * @static 35576 * @memberOf _ 35577 * @since 4.0.0 35578 * @category Array 35579 * @param {Array} array The sorted array to inspect. 35580 * @param {*} value The value to evaluate. 35581 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35582 * @returns {number} Returns the index at which `value` should be inserted 35583 * into `array`. 35584 * @example 35585 * 35586 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 35587 * 35588 * _.sortedIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 35589 * // => 0 35590 * 35591 * // The `_.property` iteratee shorthand. 35592 * _.sortedIndexBy(objects, { 'x': 4 }, 'x'); 35593 * // => 0 35594 */ 35595 function sortedIndexBy(array, value, iteratee) { 35596 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); 35597 } 35598 35599 /** 35600 * This method is like `_.indexOf` except that it performs a binary 35601 * search on a sorted `array`. 35602 * 35603 * @static 35604 * @memberOf _ 35605 * @since 4.0.0 35606 * @category Array 35607 * @param {Array} array The array to inspect. 35608 * @param {*} value The value to search for. 35609 * @returns {number} Returns the index of the matched value, else `-1`. 35610 * @example 35611 * 35612 * _.sortedIndexOf([4, 5, 5, 5, 6], 5); 35613 * // => 1 35614 */ 35615 function sortedIndexOf(array, value) { 35616 var length = array == null ? 0 : array.length; 35617 if (length) { 35618 var index = baseSortedIndex(array, value); 35619 if (index < length && eq(array[index], value)) { 35620 return index; 35621 } 35622 } 35623 return -1; 35624 } 35625 35626 /** 35627 * This method is like `_.sortedIndex` except that it returns the highest 35628 * index at which `value` should be inserted into `array` in order to 35629 * maintain its sort order. 35630 * 35631 * @static 35632 * @memberOf _ 35633 * @since 3.0.0 35634 * @category Array 35635 * @param {Array} array The sorted array to inspect. 35636 * @param {*} value The value to evaluate. 35637 * @returns {number} Returns the index at which `value` should be inserted 35638 * into `array`. 35639 * @example 35640 * 35641 * _.sortedLastIndex([4, 5, 5, 5, 6], 5); 35642 * // => 4 35643 */ 35644 function sortedLastIndex(array, value) { 35645 return baseSortedIndex(array, value, true); 35646 } 35647 35648 /** 35649 * This method is like `_.sortedLastIndex` except that it accepts `iteratee` 35650 * which is invoked for `value` and each element of `array` to compute their 35651 * sort ranking. The iteratee is invoked with one argument: (value). 35652 * 35653 * @static 35654 * @memberOf _ 35655 * @since 4.0.0 35656 * @category Array 35657 * @param {Array} array The sorted array to inspect. 35658 * @param {*} value The value to evaluate. 35659 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35660 * @returns {number} Returns the index at which `value` should be inserted 35661 * into `array`. 35662 * @example 35663 * 35664 * var objects = [{ 'x': 4 }, { 'x': 5 }]; 35665 * 35666 * _.sortedLastIndexBy(objects, { 'x': 4 }, function(o) { return o.x; }); 35667 * // => 1 35668 * 35669 * // The `_.property` iteratee shorthand. 35670 * _.sortedLastIndexBy(objects, { 'x': 4 }, 'x'); 35671 * // => 1 35672 */ 35673 function sortedLastIndexBy(array, value, iteratee) { 35674 return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); 35675 } 35676 35677 /** 35678 * This method is like `_.lastIndexOf` except that it performs a binary 35679 * search on a sorted `array`. 35680 * 35681 * @static 35682 * @memberOf _ 35683 * @since 4.0.0 35684 * @category Array 35685 * @param {Array} array The array to inspect. 35686 * @param {*} value The value to search for. 35687 * @returns {number} Returns the index of the matched value, else `-1`. 35688 * @example 35689 * 35690 * _.sortedLastIndexOf([4, 5, 5, 5, 6], 5); 35691 * // => 3 35692 */ 35693 function sortedLastIndexOf(array, value) { 35694 var length = array == null ? 0 : array.length; 35695 if (length) { 35696 var index = baseSortedIndex(array, value, true) - 1; 35697 if (eq(array[index], value)) { 35698 return index; 35699 } 35700 } 35701 return -1; 35702 } 35703 35704 /** 35705 * This method is like `_.uniq` except that it's designed and optimized 35706 * for sorted arrays. 35707 * 35708 * @static 35709 * @memberOf _ 35710 * @since 4.0.0 35711 * @category Array 35712 * @param {Array} array The array to inspect. 35713 * @returns {Array} Returns the new duplicate free array. 35714 * @example 35715 * 35716 * _.sortedUniq([1, 1, 2]); 35717 * // => [1, 2] 35718 */ 35719 function sortedUniq(array) { 35720 return (array && array.length) 35721 ? baseSortedUniq(array) 35722 : []; 35723 } 35724 35725 /** 35726 * This method is like `_.uniqBy` except that it's designed and optimized 35727 * for sorted arrays. 35728 * 35729 * @static 35730 * @memberOf _ 35731 * @since 4.0.0 35732 * @category Array 35733 * @param {Array} array The array to inspect. 35734 * @param {Function} [iteratee] The iteratee invoked per element. 35735 * @returns {Array} Returns the new duplicate free array. 35736 * @example 35737 * 35738 * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); 35739 * // => [1.1, 2.3] 35740 */ 35741 function sortedUniqBy(array, iteratee) { 35742 return (array && array.length) 35743 ? baseSortedUniq(array, getIteratee(iteratee, 2)) 35744 : []; 35745 } 35746 35747 /** 35748 * Gets all but the first element of `array`. 35749 * 35750 * @static 35751 * @memberOf _ 35752 * @since 4.0.0 35753 * @category Array 35754 * @param {Array} array The array to query. 35755 * @returns {Array} Returns the slice of `array`. 35756 * @example 35757 * 35758 * _.tail([1, 2, 3]); 35759 * // => [2, 3] 35760 */ 35761 function tail(array) { 35762 var length = array == null ? 0 : array.length; 35763 return length ? baseSlice(array, 1, length) : []; 35764 } 35765 35766 /** 35767 * Creates a slice of `array` with `n` elements taken from the beginning. 35768 * 35769 * @static 35770 * @memberOf _ 35771 * @since 0.1.0 35772 * @category Array 35773 * @param {Array} array The array to query. 35774 * @param {number} [n=1] The number of elements to take. 35775 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 35776 * @returns {Array} Returns the slice of `array`. 35777 * @example 35778 * 35779 * _.take([1, 2, 3]); 35780 * // => [1] 35781 * 35782 * _.take([1, 2, 3], 2); 35783 * // => [1, 2] 35784 * 35785 * _.take([1, 2, 3], 5); 35786 * // => [1, 2, 3] 35787 * 35788 * _.take([1, 2, 3], 0); 35789 * // => [] 35790 */ 35791 function take(array, n, guard) { 35792 if (!(array && array.length)) { 35793 return []; 35794 } 35795 n = (guard || n === undefined) ? 1 : toInteger(n); 35796 return baseSlice(array, 0, n < 0 ? 0 : n); 35797 } 35798 35799 /** 35800 * Creates a slice of `array` with `n` elements taken from the end. 35801 * 35802 * @static 35803 * @memberOf _ 35804 * @since 3.0.0 35805 * @category Array 35806 * @param {Array} array The array to query. 35807 * @param {number} [n=1] The number of elements to take. 35808 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 35809 * @returns {Array} Returns the slice of `array`. 35810 * @example 35811 * 35812 * _.takeRight([1, 2, 3]); 35813 * // => [3] 35814 * 35815 * _.takeRight([1, 2, 3], 2); 35816 * // => [2, 3] 35817 * 35818 * _.takeRight([1, 2, 3], 5); 35819 * // => [1, 2, 3] 35820 * 35821 * _.takeRight([1, 2, 3], 0); 35822 * // => [] 35823 */ 35824 function takeRight(array, n, guard) { 35825 var length = array == null ? 0 : array.length; 35826 if (!length) { 35827 return []; 35828 } 35829 n = (guard || n === undefined) ? 1 : toInteger(n); 35830 n = length - n; 35831 return baseSlice(array, n < 0 ? 0 : n, length); 35832 } 35833 35834 /** 35835 * Creates a slice of `array` with elements taken from the end. Elements are 35836 * taken until `predicate` returns falsey. The predicate is invoked with 35837 * three arguments: (value, index, array). 35838 * 35839 * @static 35840 * @memberOf _ 35841 * @since 3.0.0 35842 * @category Array 35843 * @param {Array} array The array to query. 35844 * @param {Function} [predicate=_.identity] The function invoked per iteration. 35845 * @returns {Array} Returns the slice of `array`. 35846 * @example 35847 * 35848 * var users = [ 35849 * { 'user': 'barney', 'active': true }, 35850 * { 'user': 'fred', 'active': false }, 35851 * { 'user': 'pebbles', 'active': false } 35852 * ]; 35853 * 35854 * _.takeRightWhile(users, function(o) { return !o.active; }); 35855 * // => objects for ['fred', 'pebbles'] 35856 * 35857 * // The `_.matches` iteratee shorthand. 35858 * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); 35859 * // => objects for ['pebbles'] 35860 * 35861 * // The `_.matchesProperty` iteratee shorthand. 35862 * _.takeRightWhile(users, ['active', false]); 35863 * // => objects for ['fred', 'pebbles'] 35864 * 35865 * // The `_.property` iteratee shorthand. 35866 * _.takeRightWhile(users, 'active'); 35867 * // => [] 35868 */ 35869 function takeRightWhile(array, predicate) { 35870 return (array && array.length) 35871 ? baseWhile(array, getIteratee(predicate, 3), false, true) 35872 : []; 35873 } 35874 35875 /** 35876 * Creates a slice of `array` with elements taken from the beginning. Elements 35877 * are taken until `predicate` returns falsey. The predicate is invoked with 35878 * three arguments: (value, index, array). 35879 * 35880 * @static 35881 * @memberOf _ 35882 * @since 3.0.0 35883 * @category Array 35884 * @param {Array} array The array to query. 35885 * @param {Function} [predicate=_.identity] The function invoked per iteration. 35886 * @returns {Array} Returns the slice of `array`. 35887 * @example 35888 * 35889 * var users = [ 35890 * { 'user': 'barney', 'active': false }, 35891 * { 'user': 'fred', 'active': false }, 35892 * { 'user': 'pebbles', 'active': true } 35893 * ]; 35894 * 35895 * _.takeWhile(users, function(o) { return !o.active; }); 35896 * // => objects for ['barney', 'fred'] 35897 * 35898 * // The `_.matches` iteratee shorthand. 35899 * _.takeWhile(users, { 'user': 'barney', 'active': false }); 35900 * // => objects for ['barney'] 35901 * 35902 * // The `_.matchesProperty` iteratee shorthand. 35903 * _.takeWhile(users, ['active', false]); 35904 * // => objects for ['barney', 'fred'] 35905 * 35906 * // The `_.property` iteratee shorthand. 35907 * _.takeWhile(users, 'active'); 35908 * // => [] 35909 */ 35910 function takeWhile(array, predicate) { 35911 return (array && array.length) 35912 ? baseWhile(array, getIteratee(predicate, 3)) 35913 : []; 35914 } 35915 35916 /** 35917 * Creates an array of unique values, in order, from all given arrays using 35918 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35919 * for equality comparisons. 35920 * 35921 * @static 35922 * @memberOf _ 35923 * @since 0.1.0 35924 * @category Array 35925 * @param {...Array} [arrays] The arrays to inspect. 35926 * @returns {Array} Returns the new array of combined values. 35927 * @example 35928 * 35929 * _.union([2], [1, 2]); 35930 * // => [2, 1] 35931 */ 35932 var union = baseRest(function(arrays) { 35933 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); 35934 }); 35935 35936 /** 35937 * This method is like `_.union` except that it accepts `iteratee` which is 35938 * invoked for each element of each `arrays` to generate the criterion by 35939 * which uniqueness is computed. Result values are chosen from the first 35940 * array in which the value occurs. The iteratee is invoked with one argument: 35941 * (value). 35942 * 35943 * @static 35944 * @memberOf _ 35945 * @since 4.0.0 35946 * @category Array 35947 * @param {...Array} [arrays] The arrays to inspect. 35948 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 35949 * @returns {Array} Returns the new array of combined values. 35950 * @example 35951 * 35952 * _.unionBy([2.1], [1.2, 2.3], Math.floor); 35953 * // => [2.1, 1.2] 35954 * 35955 * // The `_.property` iteratee shorthand. 35956 * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 35957 * // => [{ 'x': 1 }, { 'x': 2 }] 35958 */ 35959 var unionBy = baseRest(function(arrays) { 35960 var iteratee = last(arrays); 35961 if (isArrayLikeObject(iteratee)) { 35962 iteratee = undefined; 35963 } 35964 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); 35965 }); 35966 35967 /** 35968 * This method is like `_.union` except that it accepts `comparator` which 35969 * is invoked to compare elements of `arrays`. Result values are chosen from 35970 * the first array in which the value occurs. The comparator is invoked 35971 * with two arguments: (arrVal, othVal). 35972 * 35973 * @static 35974 * @memberOf _ 35975 * @since 4.0.0 35976 * @category Array 35977 * @param {...Array} [arrays] The arrays to inspect. 35978 * @param {Function} [comparator] The comparator invoked per element. 35979 * @returns {Array} Returns the new array of combined values. 35980 * @example 35981 * 35982 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 35983 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 35984 * 35985 * _.unionWith(objects, others, _.isEqual); 35986 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 35987 */ 35988 var unionWith = baseRest(function(arrays) { 35989 var comparator = last(arrays); 35990 comparator = typeof comparator == 'function' ? comparator : undefined; 35991 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); 35992 }); 35993 35994 /** 35995 * Creates a duplicate-free version of an array, using 35996 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 35997 * for equality comparisons, in which only the first occurrence of each element 35998 * is kept. The order of result values is determined by the order they occur 35999 * in the array. 36000 * 36001 * @static 36002 * @memberOf _ 36003 * @since 0.1.0 36004 * @category Array 36005 * @param {Array} array The array to inspect. 36006 * @returns {Array} Returns the new duplicate free array. 36007 * @example 36008 * 36009 * _.uniq([2, 1, 2]); 36010 * // => [2, 1] 36011 */ 36012 function uniq(array) { 36013 return (array && array.length) ? baseUniq(array) : []; 36014 } 36015 36016 /** 36017 * This method is like `_.uniq` except that it accepts `iteratee` which is 36018 * invoked for each element in `array` to generate the criterion by which 36019 * uniqueness is computed. The order of result values is determined by the 36020 * order they occur in the array. The iteratee is invoked with one argument: 36021 * (value). 36022 * 36023 * @static 36024 * @memberOf _ 36025 * @since 4.0.0 36026 * @category Array 36027 * @param {Array} array The array to inspect. 36028 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 36029 * @returns {Array} Returns the new duplicate free array. 36030 * @example 36031 * 36032 * _.uniqBy([2.1, 1.2, 2.3], Math.floor); 36033 * // => [2.1, 1.2] 36034 * 36035 * // The `_.property` iteratee shorthand. 36036 * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); 36037 * // => [{ 'x': 1 }, { 'x': 2 }] 36038 */ 36039 function uniqBy(array, iteratee) { 36040 return (array && array.length) ? baseUniq(array, getIteratee(iteratee, 2)) : []; 36041 } 36042 36043 /** 36044 * This method is like `_.uniq` except that it accepts `comparator` which 36045 * is invoked to compare elements of `array`. The order of result values is 36046 * determined by the order they occur in the array.The comparator is invoked 36047 * with two arguments: (arrVal, othVal). 36048 * 36049 * @static 36050 * @memberOf _ 36051 * @since 4.0.0 36052 * @category Array 36053 * @param {Array} array The array to inspect. 36054 * @param {Function} [comparator] The comparator invoked per element. 36055 * @returns {Array} Returns the new duplicate free array. 36056 * @example 36057 * 36058 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; 36059 * 36060 * _.uniqWith(objects, _.isEqual); 36061 * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] 36062 */ 36063 function uniqWith(array, comparator) { 36064 comparator = typeof comparator == 'function' ? comparator : undefined; 36065 return (array && array.length) ? baseUniq(array, undefined, comparator) : []; 36066 } 36067 36068 /** 36069 * This method is like `_.zip` except that it accepts an array of grouped 36070 * elements and creates an array regrouping the elements to their pre-zip 36071 * configuration. 36072 * 36073 * @static 36074 * @memberOf _ 36075 * @since 1.2.0 36076 * @category Array 36077 * @param {Array} array The array of grouped elements to process. 36078 * @returns {Array} Returns the new array of regrouped elements. 36079 * @example 36080 * 36081 * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); 36082 * // => [['a', 1, true], ['b', 2, false]] 36083 * 36084 * _.unzip(zipped); 36085 * // => [['a', 'b'], [1, 2], [true, false]] 36086 */ 36087 function unzip(array) { 36088 if (!(array && array.length)) { 36089 return []; 36090 } 36091 var length = 0; 36092 array = arrayFilter(array, function(group) { 36093 if (isArrayLikeObject(group)) { 36094 length = nativeMax(group.length, length); 36095 return true; 36096 } 36097 }); 36098 return baseTimes(length, function(index) { 36099 return arrayMap(array, baseProperty(index)); 36100 }); 36101 } 36102 36103 /** 36104 * This method is like `_.unzip` except that it accepts `iteratee` to specify 36105 * how regrouped values should be combined. The iteratee is invoked with the 36106 * elements of each group: (...group). 36107 * 36108 * @static 36109 * @memberOf _ 36110 * @since 3.8.0 36111 * @category Array 36112 * @param {Array} array The array of grouped elements to process. 36113 * @param {Function} [iteratee=_.identity] The function to combine 36114 * regrouped values. 36115 * @returns {Array} Returns the new array of regrouped elements. 36116 * @example 36117 * 36118 * var zipped = _.zip([1, 2], [10, 20], [100, 200]); 36119 * // => [[1, 10, 100], [2, 20, 200]] 36120 * 36121 * _.unzipWith(zipped, _.add); 36122 * // => [3, 30, 300] 36123 */ 36124 function unzipWith(array, iteratee) { 36125 if (!(array && array.length)) { 36126 return []; 36127 } 36128 var result = unzip(array); 36129 if (iteratee == null) { 36130 return result; 36131 } 36132 return arrayMap(result, function(group) { 36133 return apply(iteratee, undefined, group); 36134 }); 36135 } 36136 36137 /** 36138 * Creates an array excluding all given values using 36139 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 36140 * for equality comparisons. 36141 * 36142 * **Note:** Unlike `_.pull`, this method returns a new array. 36143 * 36144 * @static 36145 * @memberOf _ 36146 * @since 0.1.0 36147 * @category Array 36148 * @param {Array} array The array to inspect. 36149 * @param {...*} [values] The values to exclude. 36150 * @returns {Array} Returns the new array of filtered values. 36151 * @see _.difference, _.xor 36152 * @example 36153 * 36154 * _.without([2, 1, 2, 3], 1, 2); 36155 * // => [3] 36156 */ 36157 var without = baseRest(function(array, values) { 36158 return isArrayLikeObject(array) 36159 ? baseDifference(array, values) 36160 : []; 36161 }); 36162 36163 /** 36164 * Creates an array of unique values that is the 36165 * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) 36166 * of the given arrays. The order of result values is determined by the order 36167 * they occur in the arrays. 36168 * 36169 * @static 36170 * @memberOf _ 36171 * @since 2.4.0 36172 * @category Array 36173 * @param {...Array} [arrays] The arrays to inspect. 36174 * @returns {Array} Returns the new array of filtered values. 36175 * @see _.difference, _.without 36176 * @example 36177 * 36178 * _.xor([2, 1], [2, 3]); 36179 * // => [1, 3] 36180 */ 36181 var xor = baseRest(function(arrays) { 36182 return baseXor(arrayFilter(arrays, isArrayLikeObject)); 36183 }); 36184 36185 /** 36186 * This method is like `_.xor` except that it accepts `iteratee` which is 36187 * invoked for each element of each `arrays` to generate the criterion by 36188 * which by which they're compared. The order of result values is determined 36189 * by the order they occur in the arrays. The iteratee is invoked with one 36190 * argument: (value). 36191 * 36192 * @static 36193 * @memberOf _ 36194 * @since 4.0.0 36195 * @category Array 36196 * @param {...Array} [arrays] The arrays to inspect. 36197 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 36198 * @returns {Array} Returns the new array of filtered values. 36199 * @example 36200 * 36201 * _.xorBy([2.1, 1.2], [2.3, 3.4], Math.floor); 36202 * // => [1.2, 3.4] 36203 * 36204 * // The `_.property` iteratee shorthand. 36205 * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); 36206 * // => [{ 'x': 2 }] 36207 */ 36208 var xorBy = baseRest(function(arrays) { 36209 var iteratee = last(arrays); 36210 if (isArrayLikeObject(iteratee)) { 36211 iteratee = undefined; 36212 } 36213 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); 36214 }); 36215 36216 /** 36217 * This method is like `_.xor` except that it accepts `comparator` which is 36218 * invoked to compare elements of `arrays`. The order of result values is 36219 * determined by the order they occur in the arrays. The comparator is invoked 36220 * with two arguments: (arrVal, othVal). 36221 * 36222 * @static 36223 * @memberOf _ 36224 * @since 4.0.0 36225 * @category Array 36226 * @param {...Array} [arrays] The arrays to inspect. 36227 * @param {Function} [comparator] The comparator invoked per element. 36228 * @returns {Array} Returns the new array of filtered values. 36229 * @example 36230 * 36231 * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; 36232 * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; 36233 * 36234 * _.xorWith(objects, others, _.isEqual); 36235 * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] 36236 */ 36237 var xorWith = baseRest(function(arrays) { 36238 var comparator = last(arrays); 36239 comparator = typeof comparator == 'function' ? comparator : undefined; 36240 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); 36241 }); 36242 36243 /** 36244 * Creates an array of grouped elements, the first of which contains the 36245 * first elements of the given arrays, the second of which contains the 36246 * second elements of the given arrays, and so on. 36247 * 36248 * @static 36249 * @memberOf _ 36250 * @since 0.1.0 36251 * @category Array 36252 * @param {...Array} [arrays] The arrays to process. 36253 * @returns {Array} Returns the new array of grouped elements. 36254 * @example 36255 * 36256 * _.zip(['a', 'b'], [1, 2], [true, false]); 36257 * // => [['a', 1, true], ['b', 2, false]] 36258 */ 36259 var zip = baseRest(unzip); 36260 36261 /** 36262 * This method is like `_.fromPairs` except that it accepts two arrays, 36263 * one of property identifiers and one of corresponding values. 36264 * 36265 * @static 36266 * @memberOf _ 36267 * @since 0.4.0 36268 * @category Array 36269 * @param {Array} [props=[]] The property identifiers. 36270 * @param {Array} [values=[]] The property values. 36271 * @returns {Object} Returns the new object. 36272 * @example 36273 * 36274 * _.zipObject(['a', 'b'], [1, 2]); 36275 * // => { 'a': 1, 'b': 2 } 36276 */ 36277 function zipObject(props, values) { 36278 return baseZipObject(props || [], values || [], assignValue); 36279 } 36280 36281 /** 36282 * This method is like `_.zipObject` except that it supports property paths. 36283 * 36284 * @static 36285 * @memberOf _ 36286 * @since 4.1.0 36287 * @category Array 36288 * @param {Array} [props=[]] The property identifiers. 36289 * @param {Array} [values=[]] The property values. 36290 * @returns {Object} Returns the new object. 36291 * @example 36292 * 36293 * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); 36294 * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } 36295 */ 36296 function zipObjectDeep(props, values) { 36297 return baseZipObject(props || [], values || [], baseSet); 36298 } 36299 36300 /** 36301 * This method is like `_.zip` except that it accepts `iteratee` to specify 36302 * how grouped values should be combined. The iteratee is invoked with the 36303 * elements of each group: (...group). 36304 * 36305 * @static 36306 * @memberOf _ 36307 * @since 3.8.0 36308 * @category Array 36309 * @param {...Array} [arrays] The arrays to process. 36310 * @param {Function} [iteratee=_.identity] The function to combine 36311 * grouped values. 36312 * @returns {Array} Returns the new array of grouped elements. 36313 * @example 36314 * 36315 * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { 36316 * return a + b + c; 36317 * }); 36318 * // => [111, 222] 36319 */ 36320 var zipWith = baseRest(function(arrays) { 36321 var length = arrays.length, 36322 iteratee = length > 1 ? arrays[length - 1] : undefined; 36323 36324 iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; 36325 return unzipWith(arrays, iteratee); 36326 }); 36327 36328 /*------------------------------------------------------------------------*/ 36329 36330 /** 36331 * Creates a `lodash` wrapper instance that wraps `value` with explicit method 36332 * chain sequences enabled. The result of such sequences must be unwrapped 36333 * with `_#value`. 36334 * 36335 * @static 36336 * @memberOf _ 36337 * @since 1.3.0 36338 * @category Seq 36339 * @param {*} value The value to wrap. 36340 * @returns {Object} Returns the new `lodash` wrapper instance. 36341 * @example 36342 * 36343 * var users = [ 36344 * { 'user': 'barney', 'age': 36 }, 36345 * { 'user': 'fred', 'age': 40 }, 36346 * { 'user': 'pebbles', 'age': 1 } 36347 * ]; 36348 * 36349 * var youngest = _ 36350 * .chain(users) 36351 * .sortBy('age') 36352 * .map(function(o) { 36353 * return o.user + ' is ' + o.age; 36354 * }) 36355 * .head() 36356 * .value(); 36357 * // => 'pebbles is 1' 36358 */ 36359 function chain(value) { 36360 var result = lodash(value); 36361 result.__chain__ = true; 36362 return result; 36363 } 36364 36365 /** 36366 * This method invokes `interceptor` and returns `value`. The interceptor 36367 * is invoked with one argument; (value). The purpose of this method is to 36368 * "tap into" a method chain sequence in order to modify intermediate results. 36369 * 36370 * @static 36371 * @memberOf _ 36372 * @since 0.1.0 36373 * @category Seq 36374 * @param {*} value The value to provide to `interceptor`. 36375 * @param {Function} interceptor The function to invoke. 36376 * @returns {*} Returns `value`. 36377 * @example 36378 * 36379 * _([1, 2, 3]) 36380 * .tap(function(array) { 36381 * // Mutate input array. 36382 * array.pop(); 36383 * }) 36384 * .reverse() 36385 * .value(); 36386 * // => [2, 1] 36387 */ 36388 function tap(value, interceptor) { 36389 interceptor(value); 36390 return value; 36391 } 36392 36393 /** 36394 * This method is like `_.tap` except that it returns the result of `interceptor`. 36395 * The purpose of this method is to "pass thru" values replacing intermediate 36396 * results in a method chain sequence. 36397 * 36398 * @static 36399 * @memberOf _ 36400 * @since 3.0.0 36401 * @category Seq 36402 * @param {*} value The value to provide to `interceptor`. 36403 * @param {Function} interceptor The function to invoke. 36404 * @returns {*} Returns the result of `interceptor`. 36405 * @example 36406 * 36407 * _(' abc ') 36408 * .chain() 36409 * .trim() 36410 * .thru(function(value) { 36411 * return [value]; 36412 * }) 36413 * .value(); 36414 * // => ['abc'] 36415 */ 36416 function thru(value, interceptor) { 36417 return interceptor(value); 36418 } 36419 36420 /** 36421 * This method is the wrapper version of `_.at`. 36422 * 36423 * @name at 36424 * @memberOf _ 36425 * @since 1.0.0 36426 * @category Seq 36427 * @param {...(string|string[])} [paths] The property paths to pick. 36428 * @returns {Object} Returns the new `lodash` wrapper instance. 36429 * @example 36430 * 36431 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 36432 * 36433 * _(object).at(['a[0].b.c', 'a[1]']).value(); 36434 * // => [3, 4] 36435 */ 36436 var wrapperAt = flatRest(function(paths) { 36437 var length = paths.length, 36438 start = length ? paths[0] : 0, 36439 value = this.__wrapped__, 36440 interceptor = function(object) { return baseAt(object, paths); }; 36441 36442 if (length > 1 || this.__actions__.length || 36443 !(value instanceof LazyWrapper) || !isIndex(start)) { 36444 return this.thru(interceptor); 36445 } 36446 value = value.slice(start, +start + (length ? 1 : 0)); 36447 value.__actions__.push({ 36448 'func': thru, 36449 'args': [interceptor], 36450 'thisArg': undefined 36451 }); 36452 return new LodashWrapper(value, this.__chain__).thru(function(array) { 36453 if (length && !array.length) { 36454 array.push(undefined); 36455 } 36456 return array; 36457 }); 36458 }); 36459 36460 /** 36461 * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. 36462 * 36463 * @name chain 36464 * @memberOf _ 36465 * @since 0.1.0 36466 * @category Seq 36467 * @returns {Object} Returns the new `lodash` wrapper instance. 36468 * @example 36469 * 36470 * var users = [ 36471 * { 'user': 'barney', 'age': 36 }, 36472 * { 'user': 'fred', 'age': 40 } 36473 * ]; 36474 * 36475 * // A sequence without explicit chaining. 36476 * _(users).head(); 36477 * // => { 'user': 'barney', 'age': 36 } 36478 * 36479 * // A sequence with explicit chaining. 36480 * _(users) 36481 * .chain() 36482 * .head() 36483 * .pick('user') 36484 * .value(); 36485 * // => { 'user': 'barney' } 36486 */ 36487 function wrapperChain() { 36488 return chain(this); 36489 } 36490 36491 /** 36492 * Executes the chain sequence and returns the wrapped result. 36493 * 36494 * @name commit 36495 * @memberOf _ 36496 * @since 3.2.0 36497 * @category Seq 36498 * @returns {Object} Returns the new `lodash` wrapper instance. 36499 * @example 36500 * 36501 * var array = [1, 2]; 36502 * var wrapped = _(array).push(3); 36503 * 36504 * console.log(array); 36505 * // => [1, 2] 36506 * 36507 * wrapped = wrapped.commit(); 36508 * console.log(array); 36509 * // => [1, 2, 3] 36510 * 36511 * wrapped.last(); 36512 * // => 3 36513 * 36514 * console.log(array); 36515 * // => [1, 2, 3] 36516 */ 36517 function wrapperCommit() { 36518 return new LodashWrapper(this.value(), this.__chain__); 36519 } 36520 36521 /** 36522 * Gets the next value on a wrapped object following the 36523 * [iterator protocol](https://mdn.io/iteration_protocols#iterator). 36524 * 36525 * @name next 36526 * @memberOf _ 36527 * @since 4.0.0 36528 * @category Seq 36529 * @returns {Object} Returns the next iterator value. 36530 * @example 36531 * 36532 * var wrapped = _([1, 2]); 36533 * 36534 * wrapped.next(); 36535 * // => { 'done': false, 'value': 1 } 36536 * 36537 * wrapped.next(); 36538 * // => { 'done': false, 'value': 2 } 36539 * 36540 * wrapped.next(); 36541 * // => { 'done': true, 'value': undefined } 36542 */ 36543 function wrapperNext() { 36544 if (this.__values__ === undefined) { 36545 this.__values__ = toArray(this.value()); 36546 } 36547 var done = this.__index__ >= this.__values__.length, 36548 value = done ? undefined : this.__values__[this.__index__++]; 36549 36550 return { 'done': done, 'value': value }; 36551 } 36552 36553 /** 36554 * Enables the wrapper to be iterable. 36555 * 36556 * @name Symbol.iterator 36557 * @memberOf _ 36558 * @since 4.0.0 36559 * @category Seq 36560 * @returns {Object} Returns the wrapper object. 36561 * @example 36562 * 36563 * var wrapped = _([1, 2]); 36564 * 36565 * wrapped[Symbol.iterator]() === wrapped; 36566 * // => true 36567 * 36568 * Array.from(wrapped); 36569 * // => [1, 2] 36570 */ 36571 function wrapperToIterator() { 36572 return this; 36573 } 36574 36575 /** 36576 * Creates a clone of the chain sequence planting `value` as the wrapped value. 36577 * 36578 * @name plant 36579 * @memberOf _ 36580 * @since 3.2.0 36581 * @category Seq 36582 * @param {*} value The value to plant. 36583 * @returns {Object} Returns the new `lodash` wrapper instance. 36584 * @example 36585 * 36586 * function square(n) { 36587 * return n * n; 36588 * } 36589 * 36590 * var wrapped = _([1, 2]).map(square); 36591 * var other = wrapped.plant([3, 4]); 36592 * 36593 * other.value(); 36594 * // => [9, 16] 36595 * 36596 * wrapped.value(); 36597 * // => [1, 4] 36598 */ 36599 function wrapperPlant(value) { 36600 var result, 36601 parent = this; 36602 36603 while (parent instanceof baseLodash) { 36604 var clone = wrapperClone(parent); 36605 clone.__index__ = 0; 36606 clone.__values__ = undefined; 36607 if (result) { 36608 previous.__wrapped__ = clone; 36609 } else { 36610 result = clone; 36611 } 36612 var previous = clone; 36613 parent = parent.__wrapped__; 36614 } 36615 previous.__wrapped__ = value; 36616 return result; 36617 } 36618 36619 /** 36620 * This method is the wrapper version of `_.reverse`. 36621 * 36622 * **Note:** This method mutates the wrapped array. 36623 * 36624 * @name reverse 36625 * @memberOf _ 36626 * @since 0.1.0 36627 * @category Seq 36628 * @returns {Object} Returns the new `lodash` wrapper instance. 36629 * @example 36630 * 36631 * var array = [1, 2, 3]; 36632 * 36633 * _(array).reverse().value() 36634 * // => [3, 2, 1] 36635 * 36636 * console.log(array); 36637 * // => [3, 2, 1] 36638 */ 36639 function wrapperReverse() { 36640 var value = this.__wrapped__; 36641 if (value instanceof LazyWrapper) { 36642 var wrapped = value; 36643 if (this.__actions__.length) { 36644 wrapped = new LazyWrapper(this); 36645 } 36646 wrapped = wrapped.reverse(); 36647 wrapped.__actions__.push({ 36648 'func': thru, 36649 'args': [reverse], 36650 'thisArg': undefined 36651 }); 36652 return new LodashWrapper(wrapped, this.__chain__); 36653 } 36654 return this.thru(reverse); 36655 } 36656 36657 /** 36658 * Executes the chain sequence to resolve the unwrapped value. 36659 * 36660 * @name value 36661 * @memberOf _ 36662 * @since 0.1.0 36663 * @alias toJSON, valueOf 36664 * @category Seq 36665 * @returns {*} Returns the resolved unwrapped value. 36666 * @example 36667 * 36668 * _([1, 2, 3]).value(); 36669 * // => [1, 2, 3] 36670 */ 36671 function wrapperValue() { 36672 return baseWrapperValue(this.__wrapped__, this.__actions__); 36673 } 36674 36675 /*------------------------------------------------------------------------*/ 36676 36677 /** 36678 * Creates an object composed of keys generated from the results of running 36679 * each element of `collection` thru `iteratee`. The corresponding value of 36680 * each key is the number of times the key was returned by `iteratee`. The 36681 * iteratee is invoked with one argument: (value). 36682 * 36683 * @static 36684 * @memberOf _ 36685 * @since 0.5.0 36686 * @category Collection 36687 * @param {Array|Object} collection The collection to iterate over. 36688 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 36689 * @returns {Object} Returns the composed aggregate object. 36690 * @example 36691 * 36692 * _.countBy([6.1, 4.2, 6.3], Math.floor); 36693 * // => { '4': 1, '6': 2 } 36694 * 36695 * // The `_.property` iteratee shorthand. 36696 * _.countBy(['one', 'two', 'three'], 'length'); 36697 * // => { '3': 2, '5': 1 } 36698 */ 36699 var countBy = createAggregator(function(result, value, key) { 36700 if (hasOwnProperty.call(result, key)) { 36701 ++result[key]; 36702 } else { 36703 baseAssignValue(result, key, 1); 36704 } 36705 }); 36706 36707 /** 36708 * Checks if `predicate` returns truthy for **all** elements of `collection`. 36709 * Iteration is stopped once `predicate` returns falsey. The predicate is 36710 * invoked with three arguments: (value, index|key, collection). 36711 * 36712 * **Note:** This method returns `true` for 36713 * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because 36714 * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of 36715 * elements of empty collections. 36716 * 36717 * @static 36718 * @memberOf _ 36719 * @since 0.1.0 36720 * @category Collection 36721 * @param {Array|Object} collection The collection to iterate over. 36722 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36723 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 36724 * @returns {boolean} Returns `true` if all elements pass the predicate check, 36725 * else `false`. 36726 * @example 36727 * 36728 * _.every([true, 1, null, 'yes'], Boolean); 36729 * // => false 36730 * 36731 * var users = [ 36732 * { 'user': 'barney', 'age': 36, 'active': false }, 36733 * { 'user': 'fred', 'age': 40, 'active': false } 36734 * ]; 36735 * 36736 * // The `_.matches` iteratee shorthand. 36737 * _.every(users, { 'user': 'barney', 'active': false }); 36738 * // => false 36739 * 36740 * // The `_.matchesProperty` iteratee shorthand. 36741 * _.every(users, ['active', false]); 36742 * // => true 36743 * 36744 * // The `_.property` iteratee shorthand. 36745 * _.every(users, 'active'); 36746 * // => false 36747 */ 36748 function every(collection, predicate, guard) { 36749 var func = isArray(collection) ? arrayEvery : baseEvery; 36750 if (guard && isIterateeCall(collection, predicate, guard)) { 36751 predicate = undefined; 36752 } 36753 return func(collection, getIteratee(predicate, 3)); 36754 } 36755 36756 /** 36757 * Iterates over elements of `collection`, returning an array of all elements 36758 * `predicate` returns truthy for. The predicate is invoked with three 36759 * arguments: (value, index|key, collection). 36760 * 36761 * **Note:** Unlike `_.remove`, this method returns a new array. 36762 * 36763 * @static 36764 * @memberOf _ 36765 * @since 0.1.0 36766 * @category Collection 36767 * @param {Array|Object} collection The collection to iterate over. 36768 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36769 * @returns {Array} Returns the new filtered array. 36770 * @see _.reject 36771 * @example 36772 * 36773 * var users = [ 36774 * { 'user': 'barney', 'age': 36, 'active': true }, 36775 * { 'user': 'fred', 'age': 40, 'active': false } 36776 * ]; 36777 * 36778 * _.filter(users, function(o) { return !o.active; }); 36779 * // => objects for ['fred'] 36780 * 36781 * // The `_.matches` iteratee shorthand. 36782 * _.filter(users, { 'age': 36, 'active': true }); 36783 * // => objects for ['barney'] 36784 * 36785 * // The `_.matchesProperty` iteratee shorthand. 36786 * _.filter(users, ['active', false]); 36787 * // => objects for ['fred'] 36788 * 36789 * // The `_.property` iteratee shorthand. 36790 * _.filter(users, 'active'); 36791 * // => objects for ['barney'] 36792 * 36793 * // Combining several predicates using `_.overEvery` or `_.overSome`. 36794 * _.filter(users, _.overSome([{ 'age': 36 }, ['age', 40]])); 36795 * // => objects for ['fred', 'barney'] 36796 */ 36797 function filter(collection, predicate) { 36798 var func = isArray(collection) ? arrayFilter : baseFilter; 36799 return func(collection, getIteratee(predicate, 3)); 36800 } 36801 36802 /** 36803 * Iterates over elements of `collection`, returning the first element 36804 * `predicate` returns truthy for. The predicate is invoked with three 36805 * arguments: (value, index|key, collection). 36806 * 36807 * @static 36808 * @memberOf _ 36809 * @since 0.1.0 36810 * @category Collection 36811 * @param {Array|Object} collection The collection to inspect. 36812 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36813 * @param {number} [fromIndex=0] The index to search from. 36814 * @returns {*} Returns the matched element, else `undefined`. 36815 * @example 36816 * 36817 * var users = [ 36818 * { 'user': 'barney', 'age': 36, 'active': true }, 36819 * { 'user': 'fred', 'age': 40, 'active': false }, 36820 * { 'user': 'pebbles', 'age': 1, 'active': true } 36821 * ]; 36822 * 36823 * _.find(users, function(o) { return o.age < 40; }); 36824 * // => object for 'barney' 36825 * 36826 * // The `_.matches` iteratee shorthand. 36827 * _.find(users, { 'age': 1, 'active': true }); 36828 * // => object for 'pebbles' 36829 * 36830 * // The `_.matchesProperty` iteratee shorthand. 36831 * _.find(users, ['active', false]); 36832 * // => object for 'fred' 36833 * 36834 * // The `_.property` iteratee shorthand. 36835 * _.find(users, 'active'); 36836 * // => object for 'barney' 36837 */ 36838 var find = createFind(findIndex); 36839 36840 /** 36841 * This method is like `_.find` except that it iterates over elements of 36842 * `collection` from right to left. 36843 * 36844 * @static 36845 * @memberOf _ 36846 * @since 2.0.0 36847 * @category Collection 36848 * @param {Array|Object} collection The collection to inspect. 36849 * @param {Function} [predicate=_.identity] The function invoked per iteration. 36850 * @param {number} [fromIndex=collection.length-1] The index to search from. 36851 * @returns {*} Returns the matched element, else `undefined`. 36852 * @example 36853 * 36854 * _.findLast([1, 2, 3, 4], function(n) { 36855 * return n % 2 == 1; 36856 * }); 36857 * // => 3 36858 */ 36859 var findLast = createFind(findLastIndex); 36860 36861 /** 36862 * Creates a flattened array of values by running each element in `collection` 36863 * thru `iteratee` and flattening the mapped results. The iteratee is invoked 36864 * with three arguments: (value, index|key, collection). 36865 * 36866 * @static 36867 * @memberOf _ 36868 * @since 4.0.0 36869 * @category Collection 36870 * @param {Array|Object} collection The collection to iterate over. 36871 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36872 * @returns {Array} Returns the new flattened array. 36873 * @example 36874 * 36875 * function duplicate(n) { 36876 * return [n, n]; 36877 * } 36878 * 36879 * _.flatMap([1, 2], duplicate); 36880 * // => [1, 1, 2, 2] 36881 */ 36882 function flatMap(collection, iteratee) { 36883 return baseFlatten(map(collection, iteratee), 1); 36884 } 36885 36886 /** 36887 * This method is like `_.flatMap` except that it recursively flattens the 36888 * mapped results. 36889 * 36890 * @static 36891 * @memberOf _ 36892 * @since 4.7.0 36893 * @category Collection 36894 * @param {Array|Object} collection The collection to iterate over. 36895 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36896 * @returns {Array} Returns the new flattened array. 36897 * @example 36898 * 36899 * function duplicate(n) { 36900 * return [[[n, n]]]; 36901 * } 36902 * 36903 * _.flatMapDeep([1, 2], duplicate); 36904 * // => [1, 1, 2, 2] 36905 */ 36906 function flatMapDeep(collection, iteratee) { 36907 return baseFlatten(map(collection, iteratee), INFINITY); 36908 } 36909 36910 /** 36911 * This method is like `_.flatMap` except that it recursively flattens the 36912 * mapped results up to `depth` times. 36913 * 36914 * @static 36915 * @memberOf _ 36916 * @since 4.7.0 36917 * @category Collection 36918 * @param {Array|Object} collection The collection to iterate over. 36919 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36920 * @param {number} [depth=1] The maximum recursion depth. 36921 * @returns {Array} Returns the new flattened array. 36922 * @example 36923 * 36924 * function duplicate(n) { 36925 * return [[[n, n]]]; 36926 * } 36927 * 36928 * _.flatMapDepth([1, 2], duplicate, 2); 36929 * // => [[1, 1], [2, 2]] 36930 */ 36931 function flatMapDepth(collection, iteratee, depth) { 36932 depth = depth === undefined ? 1 : toInteger(depth); 36933 return baseFlatten(map(collection, iteratee), depth); 36934 } 36935 36936 /** 36937 * Iterates over elements of `collection` and invokes `iteratee` for each element. 36938 * The iteratee is invoked with three arguments: (value, index|key, collection). 36939 * Iteratee functions may exit iteration early by explicitly returning `false`. 36940 * 36941 * **Note:** As with other "Collections" methods, objects with a "length" 36942 * property are iterated like arrays. To avoid this behavior use `_.forIn` 36943 * or `_.forOwn` for object iteration. 36944 * 36945 * @static 36946 * @memberOf _ 36947 * @since 0.1.0 36948 * @alias each 36949 * @category Collection 36950 * @param {Array|Object} collection The collection to iterate over. 36951 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36952 * @returns {Array|Object} Returns `collection`. 36953 * @see _.forEachRight 36954 * @example 36955 * 36956 * _.forEach([1, 2], function(value) { 36957 * console.log(value); 36958 * }); 36959 * // => Logs `1` then `2`. 36960 * 36961 * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { 36962 * console.log(key); 36963 * }); 36964 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 36965 */ 36966 function forEach(collection, iteratee) { 36967 var func = isArray(collection) ? arrayEach : baseEach; 36968 return func(collection, getIteratee(iteratee, 3)); 36969 } 36970 36971 /** 36972 * This method is like `_.forEach` except that it iterates over elements of 36973 * `collection` from right to left. 36974 * 36975 * @static 36976 * @memberOf _ 36977 * @since 2.0.0 36978 * @alias eachRight 36979 * @category Collection 36980 * @param {Array|Object} collection The collection to iterate over. 36981 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 36982 * @returns {Array|Object} Returns `collection`. 36983 * @see _.forEach 36984 * @example 36985 * 36986 * _.forEachRight([1, 2], function(value) { 36987 * console.log(value); 36988 * }); 36989 * // => Logs `2` then `1`. 36990 */ 36991 function forEachRight(collection, iteratee) { 36992 var func = isArray(collection) ? arrayEachRight : baseEachRight; 36993 return func(collection, getIteratee(iteratee, 3)); 36994 } 36995 36996 /** 36997 * Creates an object composed of keys generated from the results of running 36998 * each element of `collection` thru `iteratee`. The order of grouped values 36999 * is determined by the order they occur in `collection`. The corresponding 37000 * value of each key is an array of elements responsible for generating the 37001 * key. The iteratee is invoked with one argument: (value). 37002 * 37003 * @static 37004 * @memberOf _ 37005 * @since 0.1.0 37006 * @category Collection 37007 * @param {Array|Object} collection The collection to iterate over. 37008 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 37009 * @returns {Object} Returns the composed aggregate object. 37010 * @example 37011 * 37012 * _.groupBy([6.1, 4.2, 6.3], Math.floor); 37013 * // => { '4': [4.2], '6': [6.1, 6.3] } 37014 * 37015 * // The `_.property` iteratee shorthand. 37016 * _.groupBy(['one', 'two', 'three'], 'length'); 37017 * // => { '3': ['one', 'two'], '5': ['three'] } 37018 */ 37019 var groupBy = createAggregator(function(result, value, key) { 37020 if (hasOwnProperty.call(result, key)) { 37021 result[key].push(value); 37022 } else { 37023 baseAssignValue(result, key, [value]); 37024 } 37025 }); 37026 37027 /** 37028 * Checks if `value` is in `collection`. If `collection` is a string, it's 37029 * checked for a substring of `value`, otherwise 37030 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 37031 * is used for equality comparisons. If `fromIndex` is negative, it's used as 37032 * the offset from the end of `collection`. 37033 * 37034 * @static 37035 * @memberOf _ 37036 * @since 0.1.0 37037 * @category Collection 37038 * @param {Array|Object|string} collection The collection to inspect. 37039 * @param {*} value The value to search for. 37040 * @param {number} [fromIndex=0] The index to search from. 37041 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 37042 * @returns {boolean} Returns `true` if `value` is found, else `false`. 37043 * @example 37044 * 37045 * _.includes([1, 2, 3], 1); 37046 * // => true 37047 * 37048 * _.includes([1, 2, 3], 1, 2); 37049 * // => false 37050 * 37051 * _.includes({ 'a': 1, 'b': 2 }, 1); 37052 * // => true 37053 * 37054 * _.includes('abcd', 'bc'); 37055 * // => true 37056 */ 37057 function includes(collection, value, fromIndex, guard) { 37058 collection = isArrayLike(collection) ? collection : values(collection); 37059 fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; 37060 37061 var length = collection.length; 37062 if (fromIndex < 0) { 37063 fromIndex = nativeMax(length + fromIndex, 0); 37064 } 37065 return isString(collection) 37066 ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) 37067 : (!!length && baseIndexOf(collection, value, fromIndex) > -1); 37068 } 37069 37070 /** 37071 * Invokes the method at `path` of each element in `collection`, returning 37072 * an array of the results of each invoked method. Any additional arguments 37073 * are provided to each invoked method. If `path` is a function, it's invoked 37074 * for, and `this` bound to, each element in `collection`. 37075 * 37076 * @static 37077 * @memberOf _ 37078 * @since 4.0.0 37079 * @category Collection 37080 * @param {Array|Object} collection The collection to iterate over. 37081 * @param {Array|Function|string} path The path of the method to invoke or 37082 * the function invoked per iteration. 37083 * @param {...*} [args] The arguments to invoke each method with. 37084 * @returns {Array} Returns the array of results. 37085 * @example 37086 * 37087 * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); 37088 * // => [[1, 5, 7], [1, 2, 3]] 37089 * 37090 * _.invokeMap([123, 456], String.prototype.split, ''); 37091 * // => [['1', '2', '3'], ['4', '5', '6']] 37092 */ 37093 var invokeMap = baseRest(function(collection, path, args) { 37094 var index = -1, 37095 isFunc = typeof path == 'function', 37096 result = isArrayLike(collection) ? Array(collection.length) : []; 37097 37098 baseEach(collection, function(value) { 37099 result[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); 37100 }); 37101 return result; 37102 }); 37103 37104 /** 37105 * Creates an object composed of keys generated from the results of running 37106 * each element of `collection` thru `iteratee`. The corresponding value of 37107 * each key is the last element responsible for generating the key. The 37108 * iteratee is invoked with one argument: (value). 37109 * 37110 * @static 37111 * @memberOf _ 37112 * @since 4.0.0 37113 * @category Collection 37114 * @param {Array|Object} collection The collection to iterate over. 37115 * @param {Function} [iteratee=_.identity] The iteratee to transform keys. 37116 * @returns {Object} Returns the composed aggregate object. 37117 * @example 37118 * 37119 * var array = [ 37120 * { 'dir': 'left', 'code': 97 }, 37121 * { 'dir': 'right', 'code': 100 } 37122 * ]; 37123 * 37124 * _.keyBy(array, function(o) { 37125 * return String.fromCharCode(o.code); 37126 * }); 37127 * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } 37128 * 37129 * _.keyBy(array, 'dir'); 37130 * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } 37131 */ 37132 var keyBy = createAggregator(function(result, value, key) { 37133 baseAssignValue(result, key, value); 37134 }); 37135 37136 /** 37137 * Creates an array of values by running each element in `collection` thru 37138 * `iteratee`. The iteratee is invoked with three arguments: 37139 * (value, index|key, collection). 37140 * 37141 * Many lodash methods are guarded to work as iteratees for methods like 37142 * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. 37143 * 37144 * The guarded methods are: 37145 * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, 37146 * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, 37147 * `sampleSize`, `slice`, `some`, `sortBy`, `split`, `take`, `takeRight`, 37148 * `template`, `trim`, `trimEnd`, `trimStart`, and `words` 37149 * 37150 * @static 37151 * @memberOf _ 37152 * @since 0.1.0 37153 * @category Collection 37154 * @param {Array|Object} collection The collection to iterate over. 37155 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 37156 * @returns {Array} Returns the new mapped array. 37157 * @example 37158 * 37159 * function square(n) { 37160 * return n * n; 37161 * } 37162 * 37163 * _.map([4, 8], square); 37164 * // => [16, 64] 37165 * 37166 * _.map({ 'a': 4, 'b': 8 }, square); 37167 * // => [16, 64] (iteration order is not guaranteed) 37168 * 37169 * var users = [ 37170 * { 'user': 'barney' }, 37171 * { 'user': 'fred' } 37172 * ]; 37173 * 37174 * // The `_.property` iteratee shorthand. 37175 * _.map(users, 'user'); 37176 * // => ['barney', 'fred'] 37177 */ 37178 function map(collection, iteratee) { 37179 var func = isArray(collection) ? arrayMap : baseMap; 37180 return func(collection, getIteratee(iteratee, 3)); 37181 } 37182 37183 /** 37184 * This method is like `_.sortBy` except that it allows specifying the sort 37185 * orders of the iteratees to sort by. If `orders` is unspecified, all values 37186 * are sorted in ascending order. Otherwise, specify an order of "desc" for 37187 * descending or "asc" for ascending sort order of corresponding values. 37188 * 37189 * @static 37190 * @memberOf _ 37191 * @since 4.0.0 37192 * @category Collection 37193 * @param {Array|Object} collection The collection to iterate over. 37194 * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] 37195 * The iteratees to sort by. 37196 * @param {string[]} [orders] The sort orders of `iteratees`. 37197 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. 37198 * @returns {Array} Returns the new sorted array. 37199 * @example 37200 * 37201 * var users = [ 37202 * { 'user': 'fred', 'age': 48 }, 37203 * { 'user': 'barney', 'age': 34 }, 37204 * { 'user': 'fred', 'age': 40 }, 37205 * { 'user': 'barney', 'age': 36 } 37206 * ]; 37207 * 37208 * // Sort by `user` in ascending order and by `age` in descending order. 37209 * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); 37210 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] 37211 */ 37212 function orderBy(collection, iteratees, orders, guard) { 37213 if (collection == null) { 37214 return []; 37215 } 37216 if (!isArray(iteratees)) { 37217 iteratees = iteratees == null ? [] : [iteratees]; 37218 } 37219 orders = guard ? undefined : orders; 37220 if (!isArray(orders)) { 37221 orders = orders == null ? [] : [orders]; 37222 } 37223 return baseOrderBy(collection, iteratees, orders); 37224 } 37225 37226 /** 37227 * Creates an array of elements split into two groups, the first of which 37228 * contains elements `predicate` returns truthy for, the second of which 37229 * contains elements `predicate` returns falsey for. The predicate is 37230 * invoked with one argument: (value). 37231 * 37232 * @static 37233 * @memberOf _ 37234 * @since 3.0.0 37235 * @category Collection 37236 * @param {Array|Object} collection The collection to iterate over. 37237 * @param {Function} [predicate=_.identity] The function invoked per iteration. 37238 * @returns {Array} Returns the array of grouped elements. 37239 * @example 37240 * 37241 * var users = [ 37242 * { 'user': 'barney', 'age': 36, 'active': false }, 37243 * { 'user': 'fred', 'age': 40, 'active': true }, 37244 * { 'user': 'pebbles', 'age': 1, 'active': false } 37245 * ]; 37246 * 37247 * _.partition(users, function(o) { return o.active; }); 37248 * // => objects for [['fred'], ['barney', 'pebbles']] 37249 * 37250 * // The `_.matches` iteratee shorthand. 37251 * _.partition(users, { 'age': 1, 'active': false }); 37252 * // => objects for [['pebbles'], ['barney', 'fred']] 37253 * 37254 * // The `_.matchesProperty` iteratee shorthand. 37255 * _.partition(users, ['active', false]); 37256 * // => objects for [['barney', 'pebbles'], ['fred']] 37257 * 37258 * // The `_.property` iteratee shorthand. 37259 * _.partition(users, 'active'); 37260 * // => objects for [['fred'], ['barney', 'pebbles']] 37261 */ 37262 var partition = createAggregator(function(result, value, key) { 37263 result[key ? 0 : 1].push(value); 37264 }, function() { return [[], []]; }); 37265 37266 /** 37267 * Reduces `collection` to a value which is the accumulated result of running 37268 * each element in `collection` thru `iteratee`, where each successive 37269 * invocation is supplied the return value of the previous. If `accumulator` 37270 * is not given, the first element of `collection` is used as the initial 37271 * value. The iteratee is invoked with four arguments: 37272 * (accumulator, value, index|key, collection). 37273 * 37274 * Many lodash methods are guarded to work as iteratees for methods like 37275 * `_.reduce`, `_.reduceRight`, and `_.transform`. 37276 * 37277 * The guarded methods are: 37278 * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, 37279 * and `sortBy` 37280 * 37281 * @static 37282 * @memberOf _ 37283 * @since 0.1.0 37284 * @category Collection 37285 * @param {Array|Object} collection The collection to iterate over. 37286 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 37287 * @param {*} [accumulator] The initial value. 37288 * @returns {*} Returns the accumulated value. 37289 * @see _.reduceRight 37290 * @example 37291 * 37292 * _.reduce([1, 2], function(sum, n) { 37293 * return sum + n; 37294 * }, 0); 37295 * // => 3 37296 * 37297 * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 37298 * (result[value] || (result[value] = [])).push(key); 37299 * return result; 37300 * }, {}); 37301 * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) 37302 */ 37303 function reduce(collection, iteratee, accumulator) { 37304 var func = isArray(collection) ? arrayReduce : baseReduce, 37305 initAccum = arguments.length < 3; 37306 37307 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); 37308 } 37309 37310 /** 37311 * This method is like `_.reduce` except that it iterates over elements of 37312 * `collection` from right to left. 37313 * 37314 * @static 37315 * @memberOf _ 37316 * @since 0.1.0 37317 * @category Collection 37318 * @param {Array|Object} collection The collection to iterate over. 37319 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 37320 * @param {*} [accumulator] The initial value. 37321 * @returns {*} Returns the accumulated value. 37322 * @see _.reduce 37323 * @example 37324 * 37325 * var array = [[0, 1], [2, 3], [4, 5]]; 37326 * 37327 * _.reduceRight(array, function(flattened, other) { 37328 * return flattened.concat(other); 37329 * }, []); 37330 * // => [4, 5, 2, 3, 0, 1] 37331 */ 37332 function reduceRight(collection, iteratee, accumulator) { 37333 var func = isArray(collection) ? arrayReduceRight : baseReduce, 37334 initAccum = arguments.length < 3; 37335 37336 return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); 37337 } 37338 37339 /** 37340 * The opposite of `_.filter`; this method returns the elements of `collection` 37341 * that `predicate` does **not** return truthy for. 37342 * 37343 * @static 37344 * @memberOf _ 37345 * @since 0.1.0 37346 * @category Collection 37347 * @param {Array|Object} collection The collection to iterate over. 37348 * @param {Function} [predicate=_.identity] The function invoked per iteration. 37349 * @returns {Array} Returns the new filtered array. 37350 * @see _.filter 37351 * @example 37352 * 37353 * var users = [ 37354 * { 'user': 'barney', 'age': 36, 'active': false }, 37355 * { 'user': 'fred', 'age': 40, 'active': true } 37356 * ]; 37357 * 37358 * _.reject(users, function(o) { return !o.active; }); 37359 * // => objects for ['fred'] 37360 * 37361 * // The `_.matches` iteratee shorthand. 37362 * _.reject(users, { 'age': 40, 'active': true }); 37363 * // => objects for ['barney'] 37364 * 37365 * // The `_.matchesProperty` iteratee shorthand. 37366 * _.reject(users, ['active', false]); 37367 * // => objects for ['fred'] 37368 * 37369 * // The `_.property` iteratee shorthand. 37370 * _.reject(users, 'active'); 37371 * // => objects for ['barney'] 37372 */ 37373 function reject(collection, predicate) { 37374 var func = isArray(collection) ? arrayFilter : baseFilter; 37375 return func(collection, negate(getIteratee(predicate, 3))); 37376 } 37377 37378 /** 37379 * Gets a random element from `collection`. 37380 * 37381 * @static 37382 * @memberOf _ 37383 * @since 2.0.0 37384 * @category Collection 37385 * @param {Array|Object} collection The collection to sample. 37386 * @returns {*} Returns the random element. 37387 * @example 37388 * 37389 * _.sample([1, 2, 3, 4]); 37390 * // => 2 37391 */ 37392 function sample(collection) { 37393 var func = isArray(collection) ? arraySample : baseSample; 37394 return func(collection); 37395 } 37396 37397 /** 37398 * Gets `n` random elements at unique keys from `collection` up to the 37399 * size of `collection`. 37400 * 37401 * @static 37402 * @memberOf _ 37403 * @since 4.0.0 37404 * @category Collection 37405 * @param {Array|Object} collection The collection to sample. 37406 * @param {number} [n=1] The number of elements to sample. 37407 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37408 * @returns {Array} Returns the random elements. 37409 * @example 37410 * 37411 * _.sampleSize([1, 2, 3], 2); 37412 * // => [3, 1] 37413 * 37414 * _.sampleSize([1, 2, 3], 4); 37415 * // => [2, 3, 1] 37416 */ 37417 function sampleSize(collection, n, guard) { 37418 if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { 37419 n = 1; 37420 } else { 37421 n = toInteger(n); 37422 } 37423 var func = isArray(collection) ? arraySampleSize : baseSampleSize; 37424 return func(collection, n); 37425 } 37426 37427 /** 37428 * Creates an array of shuffled values, using a version of the 37429 * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). 37430 * 37431 * @static 37432 * @memberOf _ 37433 * @since 0.1.0 37434 * @category Collection 37435 * @param {Array|Object} collection The collection to shuffle. 37436 * @returns {Array} Returns the new shuffled array. 37437 * @example 37438 * 37439 * _.shuffle([1, 2, 3, 4]); 37440 * // => [4, 1, 3, 2] 37441 */ 37442 function shuffle(collection) { 37443 var func = isArray(collection) ? arrayShuffle : baseShuffle; 37444 return func(collection); 37445 } 37446 37447 /** 37448 * Gets the size of `collection` by returning its length for array-like 37449 * values or the number of own enumerable string keyed properties for objects. 37450 * 37451 * @static 37452 * @memberOf _ 37453 * @since 0.1.0 37454 * @category Collection 37455 * @param {Array|Object|string} collection The collection to inspect. 37456 * @returns {number} Returns the collection size. 37457 * @example 37458 * 37459 * _.size([1, 2, 3]); 37460 * // => 3 37461 * 37462 * _.size({ 'a': 1, 'b': 2 }); 37463 * // => 2 37464 * 37465 * _.size('pebbles'); 37466 * // => 7 37467 */ 37468 function size(collection) { 37469 if (collection == null) { 37470 return 0; 37471 } 37472 if (isArrayLike(collection)) { 37473 return isString(collection) ? stringSize(collection) : collection.length; 37474 } 37475 var tag = getTag(collection); 37476 if (tag == mapTag || tag == setTag) { 37477 return collection.size; 37478 } 37479 return baseKeys(collection).length; 37480 } 37481 37482 /** 37483 * Checks if `predicate` returns truthy for **any** element of `collection`. 37484 * Iteration is stopped once `predicate` returns truthy. The predicate is 37485 * invoked with three arguments: (value, index|key, collection). 37486 * 37487 * @static 37488 * @memberOf _ 37489 * @since 0.1.0 37490 * @category Collection 37491 * @param {Array|Object} collection The collection to iterate over. 37492 * @param {Function} [predicate=_.identity] The function invoked per iteration. 37493 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37494 * @returns {boolean} Returns `true` if any element passes the predicate check, 37495 * else `false`. 37496 * @example 37497 * 37498 * _.some([null, 0, 'yes', false], Boolean); 37499 * // => true 37500 * 37501 * var users = [ 37502 * { 'user': 'barney', 'active': true }, 37503 * { 'user': 'fred', 'active': false } 37504 * ]; 37505 * 37506 * // The `_.matches` iteratee shorthand. 37507 * _.some(users, { 'user': 'barney', 'active': false }); 37508 * // => false 37509 * 37510 * // The `_.matchesProperty` iteratee shorthand. 37511 * _.some(users, ['active', false]); 37512 * // => true 37513 * 37514 * // The `_.property` iteratee shorthand. 37515 * _.some(users, 'active'); 37516 * // => true 37517 */ 37518 function some(collection, predicate, guard) { 37519 var func = isArray(collection) ? arraySome : baseSome; 37520 if (guard && isIterateeCall(collection, predicate, guard)) { 37521 predicate = undefined; 37522 } 37523 return func(collection, getIteratee(predicate, 3)); 37524 } 37525 37526 /** 37527 * Creates an array of elements, sorted in ascending order by the results of 37528 * running each element in a collection thru each iteratee. This method 37529 * performs a stable sort, that is, it preserves the original sort order of 37530 * equal elements. The iteratees are invoked with one argument: (value). 37531 * 37532 * @static 37533 * @memberOf _ 37534 * @since 0.1.0 37535 * @category Collection 37536 * @param {Array|Object} collection The collection to iterate over. 37537 * @param {...(Function|Function[])} [iteratees=[_.identity]] 37538 * The iteratees to sort by. 37539 * @returns {Array} Returns the new sorted array. 37540 * @example 37541 * 37542 * var users = [ 37543 * { 'user': 'fred', 'age': 48 }, 37544 * { 'user': 'barney', 'age': 36 }, 37545 * { 'user': 'fred', 'age': 30 }, 37546 * { 'user': 'barney', 'age': 34 } 37547 * ]; 37548 * 37549 * _.sortBy(users, [function(o) { return o.user; }]); 37550 * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 30]] 37551 * 37552 * _.sortBy(users, ['user', 'age']); 37553 * // => objects for [['barney', 34], ['barney', 36], ['fred', 30], ['fred', 48]] 37554 */ 37555 var sortBy = baseRest(function(collection, iteratees) { 37556 if (collection == null) { 37557 return []; 37558 } 37559 var length = iteratees.length; 37560 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 37561 iteratees = []; 37562 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 37563 iteratees = [iteratees[0]]; 37564 } 37565 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 37566 }); 37567 37568 /*------------------------------------------------------------------------*/ 37569 37570 /** 37571 * Gets the timestamp of the number of milliseconds that have elapsed since 37572 * the Unix epoch (1 January 1970 00:00:00 UTC). 37573 * 37574 * @static 37575 * @memberOf _ 37576 * @since 2.4.0 37577 * @category Date 37578 * @returns {number} Returns the timestamp. 37579 * @example 37580 * 37581 * _.defer(function(stamp) { 37582 * console.log(_.now() - stamp); 37583 * }, _.now()); 37584 * // => Logs the number of milliseconds it took for the deferred invocation. 37585 */ 37586 var now = ctxNow || function() { 37587 return root.Date.now(); 37588 }; 37589 37590 /*------------------------------------------------------------------------*/ 37591 37592 /** 37593 * The opposite of `_.before`; this method creates a function that invokes 37594 * `func` once it's called `n` or more times. 37595 * 37596 * @static 37597 * @memberOf _ 37598 * @since 0.1.0 37599 * @category Function 37600 * @param {number} n The number of calls before `func` is invoked. 37601 * @param {Function} func The function to restrict. 37602 * @returns {Function} Returns the new restricted function. 37603 * @example 37604 * 37605 * var saves = ['profile', 'settings']; 37606 * 37607 * var done = _.after(saves.length, function() { 37608 * console.log('done saving!'); 37609 * }); 37610 * 37611 * _.forEach(saves, function(type) { 37612 * asyncSave({ 'type': type, 'complete': done }); 37613 * }); 37614 * // => Logs 'done saving!' after the two async saves have completed. 37615 */ 37616 function after(n, func) { 37617 if (typeof func != 'function') { 37618 throw new TypeError(FUNC_ERROR_TEXT); 37619 } 37620 n = toInteger(n); 37621 return function() { 37622 if (--n < 1) { 37623 return func.apply(this, arguments); 37624 } 37625 }; 37626 } 37627 37628 /** 37629 * Creates a function that invokes `func`, with up to `n` arguments, 37630 * ignoring any additional arguments. 37631 * 37632 * @static 37633 * @memberOf _ 37634 * @since 3.0.0 37635 * @category Function 37636 * @param {Function} func The function to cap arguments for. 37637 * @param {number} [n=func.length] The arity cap. 37638 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37639 * @returns {Function} Returns the new capped function. 37640 * @example 37641 * 37642 * _.map(['6', '8', '10'], _.ary(parseInt, 1)); 37643 * // => [6, 8, 10] 37644 */ 37645 function ary(func, n, guard) { 37646 n = guard ? undefined : n; 37647 n = (func && n == null) ? func.length : n; 37648 return createWrap(func, WRAP_ARY_FLAG, undefined, undefined, undefined, undefined, n); 37649 } 37650 37651 /** 37652 * Creates a function that invokes `func`, with the `this` binding and arguments 37653 * of the created function, while it's called less than `n` times. Subsequent 37654 * calls to the created function return the result of the last `func` invocation. 37655 * 37656 * @static 37657 * @memberOf _ 37658 * @since 3.0.0 37659 * @category Function 37660 * @param {number} n The number of calls at which `func` is no longer invoked. 37661 * @param {Function} func The function to restrict. 37662 * @returns {Function} Returns the new restricted function. 37663 * @example 37664 * 37665 * jQuery(element).on('click', _.before(5, addContactToList)); 37666 * // => Allows adding up to 4 contacts to the list. 37667 */ 37668 function before(n, func) { 37669 var result; 37670 if (typeof func != 'function') { 37671 throw new TypeError(FUNC_ERROR_TEXT); 37672 } 37673 n = toInteger(n); 37674 return function() { 37675 if (--n > 0) { 37676 result = func.apply(this, arguments); 37677 } 37678 if (n <= 1) { 37679 func = undefined; 37680 } 37681 return result; 37682 }; 37683 } 37684 37685 /** 37686 * Creates a function that invokes `func` with the `this` binding of `thisArg` 37687 * and `partials` prepended to the arguments it receives. 37688 * 37689 * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, 37690 * may be used as a placeholder for partially applied arguments. 37691 * 37692 * **Note:** Unlike native `Function#bind`, this method doesn't set the "length" 37693 * property of bound functions. 37694 * 37695 * @static 37696 * @memberOf _ 37697 * @since 0.1.0 37698 * @category Function 37699 * @param {Function} func The function to bind. 37700 * @param {*} thisArg The `this` binding of `func`. 37701 * @param {...*} [partials] The arguments to be partially applied. 37702 * @returns {Function} Returns the new bound function. 37703 * @example 37704 * 37705 * function greet(greeting, punctuation) { 37706 * return greeting + ' ' + this.user + punctuation; 37707 * } 37708 * 37709 * var object = { 'user': 'fred' }; 37710 * 37711 * var bound = _.bind(greet, object, 'hi'); 37712 * bound('!'); 37713 * // => 'hi fred!' 37714 * 37715 * // Bound with placeholders. 37716 * var bound = _.bind(greet, object, _, '!'); 37717 * bound('hi'); 37718 * // => 'hi fred!' 37719 */ 37720 var bind = baseRest(function(func, thisArg, partials) { 37721 var bitmask = WRAP_BIND_FLAG; 37722 if (partials.length) { 37723 var holders = replaceHolders(partials, getHolder(bind)); 37724 bitmask |= WRAP_PARTIAL_FLAG; 37725 } 37726 return createWrap(func, bitmask, thisArg, partials, holders); 37727 }); 37728 37729 /** 37730 * Creates a function that invokes the method at `object[key]` with `partials` 37731 * prepended to the arguments it receives. 37732 * 37733 * This method differs from `_.bind` by allowing bound functions to reference 37734 * methods that may be redefined or don't yet exist. See 37735 * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) 37736 * for more details. 37737 * 37738 * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic 37739 * builds, may be used as a placeholder for partially applied arguments. 37740 * 37741 * @static 37742 * @memberOf _ 37743 * @since 0.10.0 37744 * @category Function 37745 * @param {Object} object The object to invoke the method on. 37746 * @param {string} key The key of the method. 37747 * @param {...*} [partials] The arguments to be partially applied. 37748 * @returns {Function} Returns the new bound function. 37749 * @example 37750 * 37751 * var object = { 37752 * 'user': 'fred', 37753 * 'greet': function(greeting, punctuation) { 37754 * return greeting + ' ' + this.user + punctuation; 37755 * } 37756 * }; 37757 * 37758 * var bound = _.bindKey(object, 'greet', 'hi'); 37759 * bound('!'); 37760 * // => 'hi fred!' 37761 * 37762 * object.greet = function(greeting, punctuation) { 37763 * return greeting + 'ya ' + this.user + punctuation; 37764 * }; 37765 * 37766 * bound('!'); 37767 * // => 'hiya fred!' 37768 * 37769 * // Bound with placeholders. 37770 * var bound = _.bindKey(object, 'greet', _, '!'); 37771 * bound('hi'); 37772 * // => 'hiya fred!' 37773 */ 37774 var bindKey = baseRest(function(object, key, partials) { 37775 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; 37776 if (partials.length) { 37777 var holders = replaceHolders(partials, getHolder(bindKey)); 37778 bitmask |= WRAP_PARTIAL_FLAG; 37779 } 37780 return createWrap(key, bitmask, object, partials, holders); 37781 }); 37782 37783 /** 37784 * Creates a function that accepts arguments of `func` and either invokes 37785 * `func` returning its result, if at least `arity` number of arguments have 37786 * been provided, or returns a function that accepts the remaining `func` 37787 * arguments, and so on. The arity of `func` may be specified if `func.length` 37788 * is not sufficient. 37789 * 37790 * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, 37791 * may be used as a placeholder for provided arguments. 37792 * 37793 * **Note:** This method doesn't set the "length" property of curried functions. 37794 * 37795 * @static 37796 * @memberOf _ 37797 * @since 2.0.0 37798 * @category Function 37799 * @param {Function} func The function to curry. 37800 * @param {number} [arity=func.length] The arity of `func`. 37801 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37802 * @returns {Function} Returns the new curried function. 37803 * @example 37804 * 37805 * var abc = function(a, b, c) { 37806 * return [a, b, c]; 37807 * }; 37808 * 37809 * var curried = _.curry(abc); 37810 * 37811 * curried(1)(2)(3); 37812 * // => [1, 2, 3] 37813 * 37814 * curried(1, 2)(3); 37815 * // => [1, 2, 3] 37816 * 37817 * curried(1, 2, 3); 37818 * // => [1, 2, 3] 37819 * 37820 * // Curried with placeholders. 37821 * curried(1)(_, 3)(2); 37822 * // => [1, 2, 3] 37823 */ 37824 function curry(func, arity, guard) { 37825 arity = guard ? undefined : arity; 37826 var result = createWrap(func, WRAP_CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 37827 result.placeholder = curry.placeholder; 37828 return result; 37829 } 37830 37831 /** 37832 * This method is like `_.curry` except that arguments are applied to `func` 37833 * in the manner of `_.partialRight` instead of `_.partial`. 37834 * 37835 * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic 37836 * builds, may be used as a placeholder for provided arguments. 37837 * 37838 * **Note:** This method doesn't set the "length" property of curried functions. 37839 * 37840 * @static 37841 * @memberOf _ 37842 * @since 3.0.0 37843 * @category Function 37844 * @param {Function} func The function to curry. 37845 * @param {number} [arity=func.length] The arity of `func`. 37846 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 37847 * @returns {Function} Returns the new curried function. 37848 * @example 37849 * 37850 * var abc = function(a, b, c) { 37851 * return [a, b, c]; 37852 * }; 37853 * 37854 * var curried = _.curryRight(abc); 37855 * 37856 * curried(3)(2)(1); 37857 * // => [1, 2, 3] 37858 * 37859 * curried(2, 3)(1); 37860 * // => [1, 2, 3] 37861 * 37862 * curried(1, 2, 3); 37863 * // => [1, 2, 3] 37864 * 37865 * // Curried with placeholders. 37866 * curried(3)(1, _)(2); 37867 * // => [1, 2, 3] 37868 */ 37869 function curryRight(func, arity, guard) { 37870 arity = guard ? undefined : arity; 37871 var result = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); 37872 result.placeholder = curryRight.placeholder; 37873 return result; 37874 } 37875 37876 /** 37877 * Creates a debounced function that delays invoking `func` until after `wait` 37878 * milliseconds have elapsed since the last time the debounced function was 37879 * invoked. The debounced function comes with a `cancel` method to cancel 37880 * delayed `func` invocations and a `flush` method to immediately invoke them. 37881 * Provide `options` to indicate whether `func` should be invoked on the 37882 * leading and/or trailing edge of the `wait` timeout. The `func` is invoked 37883 * with the last arguments provided to the debounced function. Subsequent 37884 * calls to the debounced function return the result of the last `func` 37885 * invocation. 37886 * 37887 * **Note:** If `leading` and `trailing` options are `true`, `func` is 37888 * invoked on the trailing edge of the timeout only if the debounced function 37889 * is invoked more than once during the `wait` timeout. 37890 * 37891 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 37892 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 37893 * 37894 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 37895 * for details over the differences between `_.debounce` and `_.throttle`. 37896 * 37897 * @static 37898 * @memberOf _ 37899 * @since 0.1.0 37900 * @category Function 37901 * @param {Function} func The function to debounce. 37902 * @param {number} [wait=0] The number of milliseconds to delay. 37903 * @param {Object} [options={}] The options object. 37904 * @param {boolean} [options.leading=false] 37905 * Specify invoking on the leading edge of the timeout. 37906 * @param {number} [options.maxWait] 37907 * The maximum time `func` is allowed to be delayed before it's invoked. 37908 * @param {boolean} [options.trailing=true] 37909 * Specify invoking on the trailing edge of the timeout. 37910 * @returns {Function} Returns the new debounced function. 37911 * @example 37912 * 37913 * // Avoid costly calculations while the window size is in flux. 37914 * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); 37915 * 37916 * // Invoke `sendMail` when clicked, debouncing subsequent calls. 37917 * jQuery(element).on('click', _.debounce(sendMail, 300, { 37918 * 'leading': true, 37919 * 'trailing': false 37920 * })); 37921 * 37922 * // Ensure `batchLog` is invoked once after 1 second of debounced calls. 37923 * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); 37924 * var source = new EventSource('/stream'); 37925 * jQuery(source).on('message', debounced); 37926 * 37927 * // Cancel the trailing debounced invocation. 37928 * jQuery(window).on('popstate', debounced.cancel); 37929 */ 37930 function debounce(func, wait, options) { 37931 var lastArgs, 37932 lastThis, 37933 maxWait, 37934 result, 37935 timerId, 37936 lastCallTime, 37937 lastInvokeTime = 0, 37938 leading = false, 37939 maxing = false, 37940 trailing = true; 37941 37942 if (typeof func != 'function') { 37943 throw new TypeError(FUNC_ERROR_TEXT); 37944 } 37945 wait = toNumber(wait) || 0; 37946 if (isObject(options)) { 37947 leading = !!options.leading; 37948 maxing = 'maxWait' in options; 37949 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 37950 trailing = 'trailing' in options ? !!options.trailing : trailing; 37951 } 37952 37953 function invokeFunc(time) { 37954 var args = lastArgs, 37955 thisArg = lastThis; 37956 37957 lastArgs = lastThis = undefined; 37958 lastInvokeTime = time; 37959 result = func.apply(thisArg, args); 37960 return result; 37961 } 37962 37963 function leadingEdge(time) { 37964 // Reset any `maxWait` timer. 37965 lastInvokeTime = time; 37966 // Start the timer for the trailing edge. 37967 timerId = setTimeout(timerExpired, wait); 37968 // Invoke the leading edge. 37969 return leading ? invokeFunc(time) : result; 37970 } 37971 37972 function remainingWait(time) { 37973 var timeSinceLastCall = time - lastCallTime, 37974 timeSinceLastInvoke = time - lastInvokeTime, 37975 timeWaiting = wait - timeSinceLastCall; 37976 37977 return maxing 37978 ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) 37979 : timeWaiting; 37980 } 37981 37982 function shouldInvoke(time) { 37983 var timeSinceLastCall = time - lastCallTime, 37984 timeSinceLastInvoke = time - lastInvokeTime; 37985 37986 // Either this is the first call, activity has stopped and we're at the 37987 // trailing edge, the system time has gone backwards and we're treating 37988 // it as the trailing edge, or we've hit the `maxWait` limit. 37989 return (lastCallTime === undefined || (timeSinceLastCall >= wait) || 37990 (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait)); 37991 } 37992 37993 function timerExpired() { 37994 var time = now(); 37995 if (shouldInvoke(time)) { 37996 return trailingEdge(time); 37997 } 37998 // Restart the timer. 37999 timerId = setTimeout(timerExpired, remainingWait(time)); 38000 } 38001 38002 function trailingEdge(time) { 38003 timerId = undefined; 38004 38005 // Only invoke if we have `lastArgs` which means `func` has been 38006 // debounced at least once. 38007 if (trailing && lastArgs) { 38008 return invokeFunc(time); 38009 } 38010 lastArgs = lastThis = undefined; 38011 return result; 38012 } 38013 38014 function cancel() { 38015 if (timerId !== undefined) { 38016 clearTimeout(timerId); 38017 } 38018 lastInvokeTime = 0; 38019 lastArgs = lastCallTime = lastThis = timerId = undefined; 38020 } 38021 38022 function flush() { 38023 return timerId === undefined ? result : trailingEdge(now()); 38024 } 38025 38026 function debounced() { 38027 var time = now(), 38028 isInvoking = shouldInvoke(time); 38029 38030 lastArgs = arguments; 38031 lastThis = this; 38032 lastCallTime = time; 38033 38034 if (isInvoking) { 38035 if (timerId === undefined) { 38036 return leadingEdge(lastCallTime); 38037 } 38038 if (maxing) { 38039 // Handle invocations in a tight loop. 38040 clearTimeout(timerId); 38041 timerId = setTimeout(timerExpired, wait); 38042 return invokeFunc(lastCallTime); 38043 } 38044 } 38045 if (timerId === undefined) { 38046 timerId = setTimeout(timerExpired, wait); 38047 } 38048 return result; 38049 } 38050 debounced.cancel = cancel; 38051 debounced.flush = flush; 38052 return debounced; 38053 } 38054 38055 /** 38056 * Defers invoking the `func` until the current call stack has cleared. Any 38057 * additional arguments are provided to `func` when it's invoked. 38058 * 38059 * @static 38060 * @memberOf _ 38061 * @since 0.1.0 38062 * @category Function 38063 * @param {Function} func The function to defer. 38064 * @param {...*} [args] The arguments to invoke `func` with. 38065 * @returns {number} Returns the timer id. 38066 * @example 38067 * 38068 * _.defer(function(text) { 38069 * console.log(text); 38070 * }, 'deferred'); 38071 * // => Logs 'deferred' after one millisecond. 38072 */ 38073 var defer = baseRest(function(func, args) { 38074 return baseDelay(func, 1, args); 38075 }); 38076 38077 /** 38078 * Invokes `func` after `wait` milliseconds. Any additional arguments are 38079 * provided to `func` when it's invoked. 38080 * 38081 * @static 38082 * @memberOf _ 38083 * @since 0.1.0 38084 * @category Function 38085 * @param {Function} func The function to delay. 38086 * @param {number} wait The number of milliseconds to delay invocation. 38087 * @param {...*} [args] The arguments to invoke `func` with. 38088 * @returns {number} Returns the timer id. 38089 * @example 38090 * 38091 * _.delay(function(text) { 38092 * console.log(text); 38093 * }, 1000, 'later'); 38094 * // => Logs 'later' after one second. 38095 */ 38096 var delay = baseRest(function(func, wait, args) { 38097 return baseDelay(func, toNumber(wait) || 0, args); 38098 }); 38099 38100 /** 38101 * Creates a function that invokes `func` with arguments reversed. 38102 * 38103 * @static 38104 * @memberOf _ 38105 * @since 4.0.0 38106 * @category Function 38107 * @param {Function} func The function to flip arguments for. 38108 * @returns {Function} Returns the new flipped function. 38109 * @example 38110 * 38111 * var flipped = _.flip(function() { 38112 * return _.toArray(arguments); 38113 * }); 38114 * 38115 * flipped('a', 'b', 'c', 'd'); 38116 * // => ['d', 'c', 'b', 'a'] 38117 */ 38118 function flip(func) { 38119 return createWrap(func, WRAP_FLIP_FLAG); 38120 } 38121 38122 /** 38123 * Creates a function that memoizes the result of `func`. If `resolver` is 38124 * provided, it determines the cache key for storing the result based on the 38125 * arguments provided to the memoized function. By default, the first argument 38126 * provided to the memoized function is used as the map cache key. The `func` 38127 * is invoked with the `this` binding of the memoized function. 38128 * 38129 * **Note:** The cache is exposed as the `cache` property on the memoized 38130 * function. Its creation may be customized by replacing the `_.memoize.Cache` 38131 * constructor with one whose instances implement the 38132 * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) 38133 * method interface of `clear`, `delete`, `get`, `has`, and `set`. 38134 * 38135 * @static 38136 * @memberOf _ 38137 * @since 0.1.0 38138 * @category Function 38139 * @param {Function} func The function to have its output memoized. 38140 * @param {Function} [resolver] The function to resolve the cache key. 38141 * @returns {Function} Returns the new memoized function. 38142 * @example 38143 * 38144 * var object = { 'a': 1, 'b': 2 }; 38145 * var other = { 'c': 3, 'd': 4 }; 38146 * 38147 * var values = _.memoize(_.values); 38148 * values(object); 38149 * // => [1, 2] 38150 * 38151 * values(other); 38152 * // => [3, 4] 38153 * 38154 * object.a = 2; 38155 * values(object); 38156 * // => [1, 2] 38157 * 38158 * // Modify the result cache. 38159 * values.cache.set(object, ['a', 'b']); 38160 * values(object); 38161 * // => ['a', 'b'] 38162 * 38163 * // Replace `_.memoize.Cache`. 38164 * _.memoize.Cache = WeakMap; 38165 */ 38166 function memoize(func, resolver) { 38167 if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) { 38168 throw new TypeError(FUNC_ERROR_TEXT); 38169 } 38170 var memoized = function() { 38171 var args = arguments, 38172 key = resolver ? resolver.apply(this, args) : args[0], 38173 cache = memoized.cache; 38174 38175 if (cache.has(key)) { 38176 return cache.get(key); 38177 } 38178 var result = func.apply(this, args); 38179 memoized.cache = cache.set(key, result) || cache; 38180 return result; 38181 }; 38182 memoized.cache = new (memoize.Cache || MapCache); 38183 return memoized; 38184 } 38185 38186 // Expose `MapCache`. 38187 memoize.Cache = MapCache; 38188 38189 /** 38190 * Creates a function that negates the result of the predicate `func`. The 38191 * `func` predicate is invoked with the `this` binding and arguments of the 38192 * created function. 38193 * 38194 * @static 38195 * @memberOf _ 38196 * @since 3.0.0 38197 * @category Function 38198 * @param {Function} predicate The predicate to negate. 38199 * @returns {Function} Returns the new negated function. 38200 * @example 38201 * 38202 * function isEven(n) { 38203 * return n % 2 == 0; 38204 * } 38205 * 38206 * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); 38207 * // => [1, 3, 5] 38208 */ 38209 function negate(predicate) { 38210 if (typeof predicate != 'function') { 38211 throw new TypeError(FUNC_ERROR_TEXT); 38212 } 38213 return function() { 38214 var args = arguments; 38215 switch (args.length) { 38216 case 0: return !predicate.call(this); 38217 case 1: return !predicate.call(this, args[0]); 38218 case 2: return !predicate.call(this, args[0], args[1]); 38219 case 3: return !predicate.call(this, args[0], args[1], args[2]); 38220 } 38221 return !predicate.apply(this, args); 38222 }; 38223 } 38224 38225 /** 38226 * Creates a function that is restricted to invoking `func` once. Repeat calls 38227 * to the function return the value of the first invocation. The `func` is 38228 * invoked with the `this` binding and arguments of the created function. 38229 * 38230 * @static 38231 * @memberOf _ 38232 * @since 0.1.0 38233 * @category Function 38234 * @param {Function} func The function to restrict. 38235 * @returns {Function} Returns the new restricted function. 38236 * @example 38237 * 38238 * var initialize = _.once(createApplication); 38239 * initialize(); 38240 * initialize(); 38241 * // => `createApplication` is invoked once 38242 */ 38243 function once(func) { 38244 return before(2, func); 38245 } 38246 38247 /** 38248 * Creates a function that invokes `func` with its arguments transformed. 38249 * 38250 * @static 38251 * @since 4.0.0 38252 * @memberOf _ 38253 * @category Function 38254 * @param {Function} func The function to wrap. 38255 * @param {...(Function|Function[])} [transforms=[_.identity]] 38256 * The argument transforms. 38257 * @returns {Function} Returns the new function. 38258 * @example 38259 * 38260 * function doubled(n) { 38261 * return n * 2; 38262 * } 38263 * 38264 * function square(n) { 38265 * return n * n; 38266 * } 38267 * 38268 * var func = _.overArgs(function(x, y) { 38269 * return [x, y]; 38270 * }, [square, doubled]); 38271 * 38272 * func(9, 3); 38273 * // => [81, 6] 38274 * 38275 * func(10, 5); 38276 * // => [100, 10] 38277 */ 38278 var overArgs = castRest(function(func, transforms) { 38279 transforms = (transforms.length == 1 && isArray(transforms[0])) 38280 ? arrayMap(transforms[0], baseUnary(getIteratee())) 38281 : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); 38282 38283 var funcsLength = transforms.length; 38284 return baseRest(function(args) { 38285 var index = -1, 38286 length = nativeMin(args.length, funcsLength); 38287 38288 while (++index < length) { 38289 args[index] = transforms[index].call(this, args[index]); 38290 } 38291 return apply(func, this, args); 38292 }); 38293 }); 38294 38295 /** 38296 * Creates a function that invokes `func` with `partials` prepended to the 38297 * arguments it receives. This method is like `_.bind` except it does **not** 38298 * alter the `this` binding. 38299 * 38300 * The `_.partial.placeholder` value, which defaults to `_` in monolithic 38301 * builds, may be used as a placeholder for partially applied arguments. 38302 * 38303 * **Note:** This method doesn't set the "length" property of partially 38304 * applied functions. 38305 * 38306 * @static 38307 * @memberOf _ 38308 * @since 0.2.0 38309 * @category Function 38310 * @param {Function} func The function to partially apply arguments to. 38311 * @param {...*} [partials] The arguments to be partially applied. 38312 * @returns {Function} Returns the new partially applied function. 38313 * @example 38314 * 38315 * function greet(greeting, name) { 38316 * return greeting + ' ' + name; 38317 * } 38318 * 38319 * var sayHelloTo = _.partial(greet, 'hello'); 38320 * sayHelloTo('fred'); 38321 * // => 'hello fred' 38322 * 38323 * // Partially applied with placeholders. 38324 * var greetFred = _.partial(greet, _, 'fred'); 38325 * greetFred('hi'); 38326 * // => 'hi fred' 38327 */ 38328 var partial = baseRest(function(func, partials) { 38329 var holders = replaceHolders(partials, getHolder(partial)); 38330 return createWrap(func, WRAP_PARTIAL_FLAG, undefined, partials, holders); 38331 }); 38332 38333 /** 38334 * This method is like `_.partial` except that partially applied arguments 38335 * are appended to the arguments it receives. 38336 * 38337 * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic 38338 * builds, may be used as a placeholder for partially applied arguments. 38339 * 38340 * **Note:** This method doesn't set the "length" property of partially 38341 * applied functions. 38342 * 38343 * @static 38344 * @memberOf _ 38345 * @since 1.0.0 38346 * @category Function 38347 * @param {Function} func The function to partially apply arguments to. 38348 * @param {...*} [partials] The arguments to be partially applied. 38349 * @returns {Function} Returns the new partially applied function. 38350 * @example 38351 * 38352 * function greet(greeting, name) { 38353 * return greeting + ' ' + name; 38354 * } 38355 * 38356 * var greetFred = _.partialRight(greet, 'fred'); 38357 * greetFred('hi'); 38358 * // => 'hi fred' 38359 * 38360 * // Partially applied with placeholders. 38361 * var sayHelloTo = _.partialRight(greet, 'hello', _); 38362 * sayHelloTo('fred'); 38363 * // => 'hello fred' 38364 */ 38365 var partialRight = baseRest(function(func, partials) { 38366 var holders = replaceHolders(partials, getHolder(partialRight)); 38367 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined, partials, holders); 38368 }); 38369 38370 /** 38371 * Creates a function that invokes `func` with arguments arranged according 38372 * to the specified `indexes` where the argument value at the first index is 38373 * provided as the first argument, the argument value at the second index is 38374 * provided as the second argument, and so on. 38375 * 38376 * @static 38377 * @memberOf _ 38378 * @since 3.0.0 38379 * @category Function 38380 * @param {Function} func The function to rearrange arguments for. 38381 * @param {...(number|number[])} indexes The arranged argument indexes. 38382 * @returns {Function} Returns the new function. 38383 * @example 38384 * 38385 * var rearged = _.rearg(function(a, b, c) { 38386 * return [a, b, c]; 38387 * }, [2, 0, 1]); 38388 * 38389 * rearged('b', 'c', 'a') 38390 * // => ['a', 'b', 'c'] 38391 */ 38392 var rearg = flatRest(function(func, indexes) { 38393 return createWrap(func, WRAP_REARG_FLAG, undefined, undefined, undefined, indexes); 38394 }); 38395 38396 /** 38397 * Creates a function that invokes `func` with the `this` binding of the 38398 * created function and arguments from `start` and beyond provided as 38399 * an array. 38400 * 38401 * **Note:** This method is based on the 38402 * [rest parameter](https://mdn.io/rest_parameters). 38403 * 38404 * @static 38405 * @memberOf _ 38406 * @since 4.0.0 38407 * @category Function 38408 * @param {Function} func The function to apply a rest parameter to. 38409 * @param {number} [start=func.length-1] The start position of the rest parameter. 38410 * @returns {Function} Returns the new function. 38411 * @example 38412 * 38413 * var say = _.rest(function(what, names) { 38414 * return what + ' ' + _.initial(names).join(', ') + 38415 * (_.size(names) > 1 ? ', & ' : '') + _.last(names); 38416 * }); 38417 * 38418 * say('hello', 'fred', 'barney', 'pebbles'); 38419 * // => 'hello fred, barney, & pebbles' 38420 */ 38421 function rest(func, start) { 38422 if (typeof func != 'function') { 38423 throw new TypeError(FUNC_ERROR_TEXT); 38424 } 38425 start = start === undefined ? start : toInteger(start); 38426 return baseRest(func, start); 38427 } 38428 38429 /** 38430 * Creates a function that invokes `func` with the `this` binding of the 38431 * create function and an array of arguments much like 38432 * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). 38433 * 38434 * **Note:** This method is based on the 38435 * [spread operator](https://mdn.io/spread_operator). 38436 * 38437 * @static 38438 * @memberOf _ 38439 * @since 3.2.0 38440 * @category Function 38441 * @param {Function} func The function to spread arguments over. 38442 * @param {number} [start=0] The start position of the spread. 38443 * @returns {Function} Returns the new function. 38444 * @example 38445 * 38446 * var say = _.spread(function(who, what) { 38447 * return who + ' says ' + what; 38448 * }); 38449 * 38450 * say(['fred', 'hello']); 38451 * // => 'fred says hello' 38452 * 38453 * var numbers = Promise.all([ 38454 * Promise.resolve(40), 38455 * Promise.resolve(36) 38456 * ]); 38457 * 38458 * numbers.then(_.spread(function(x, y) { 38459 * return x + y; 38460 * })); 38461 * // => a Promise of 76 38462 */ 38463 function spread(func, start) { 38464 if (typeof func != 'function') { 38465 throw new TypeError(FUNC_ERROR_TEXT); 38466 } 38467 start = start == null ? 0 : nativeMax(toInteger(start), 0); 38468 return baseRest(function(args) { 38469 var array = args[start], 38470 otherArgs = castSlice(args, 0, start); 38471 38472 if (array) { 38473 arrayPush(otherArgs, array); 38474 } 38475 return apply(func, this, otherArgs); 38476 }); 38477 } 38478 38479 /** 38480 * Creates a throttled function that only invokes `func` at most once per 38481 * every `wait` milliseconds. The throttled function comes with a `cancel` 38482 * method to cancel delayed `func` invocations and a `flush` method to 38483 * immediately invoke them. Provide `options` to indicate whether `func` 38484 * should be invoked on the leading and/or trailing edge of the `wait` 38485 * timeout. The `func` is invoked with the last arguments provided to the 38486 * throttled function. Subsequent calls to the throttled function return the 38487 * result of the last `func` invocation. 38488 * 38489 * **Note:** If `leading` and `trailing` options are `true`, `func` is 38490 * invoked on the trailing edge of the timeout only if the throttled function 38491 * is invoked more than once during the `wait` timeout. 38492 * 38493 * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred 38494 * until to the next tick, similar to `setTimeout` with a timeout of `0`. 38495 * 38496 * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) 38497 * for details over the differences between `_.throttle` and `_.debounce`. 38498 * 38499 * @static 38500 * @memberOf _ 38501 * @since 0.1.0 38502 * @category Function 38503 * @param {Function} func The function to throttle. 38504 * @param {number} [wait=0] The number of milliseconds to throttle invocations to. 38505 * @param {Object} [options={}] The options object. 38506 * @param {boolean} [options.leading=true] 38507 * Specify invoking on the leading edge of the timeout. 38508 * @param {boolean} [options.trailing=true] 38509 * Specify invoking on the trailing edge of the timeout. 38510 * @returns {Function} Returns the new throttled function. 38511 * @example 38512 * 38513 * // Avoid excessively updating the position while scrolling. 38514 * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); 38515 * 38516 * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. 38517 * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); 38518 * jQuery(element).on('click', throttled); 38519 * 38520 * // Cancel the trailing throttled invocation. 38521 * jQuery(window).on('popstate', throttled.cancel); 38522 */ 38523 function throttle(func, wait, options) { 38524 var leading = true, 38525 trailing = true; 38526 38527 if (typeof func != 'function') { 38528 throw new TypeError(FUNC_ERROR_TEXT); 38529 } 38530 if (isObject(options)) { 38531 leading = 'leading' in options ? !!options.leading : leading; 38532 trailing = 'trailing' in options ? !!options.trailing : trailing; 38533 } 38534 return debounce(func, wait, { 38535 'leading': leading, 38536 'maxWait': wait, 38537 'trailing': trailing 38538 }); 38539 } 38540 38541 /** 38542 * Creates a function that accepts up to one argument, ignoring any 38543 * additional arguments. 38544 * 38545 * @static 38546 * @memberOf _ 38547 * @since 4.0.0 38548 * @category Function 38549 * @param {Function} func The function to cap arguments for. 38550 * @returns {Function} Returns the new capped function. 38551 * @example 38552 * 38553 * _.map(['6', '8', '10'], _.unary(parseInt)); 38554 * // => [6, 8, 10] 38555 */ 38556 function unary(func) { 38557 return ary(func, 1); 38558 } 38559 38560 /** 38561 * Creates a function that provides `value` to `wrapper` as its first 38562 * argument. Any additional arguments provided to the function are appended 38563 * to those provided to the `wrapper`. The wrapper is invoked with the `this` 38564 * binding of the created function. 38565 * 38566 * @static 38567 * @memberOf _ 38568 * @since 0.1.0 38569 * @category Function 38570 * @param {*} value The value to wrap. 38571 * @param {Function} [wrapper=identity] The wrapper function. 38572 * @returns {Function} Returns the new function. 38573 * @example 38574 * 38575 * var p = _.wrap(_.escape, function(func, text) { 38576 * return '<p>' + func(text) + '</p>'; 38577 * }); 38578 * 38579 * p('fred, barney, & pebbles'); 38580 * // => '<p>fred, barney, & pebbles</p>' 38581 */ 38582 function wrap(value, wrapper) { 38583 return partial(castFunction(wrapper), value); 38584 } 38585 38586 /*------------------------------------------------------------------------*/ 38587 38588 /** 38589 * Casts `value` as an array if it's not one. 38590 * 38591 * @static 38592 * @memberOf _ 38593 * @since 4.4.0 38594 * @category Lang 38595 * @param {*} value The value to inspect. 38596 * @returns {Array} Returns the cast array. 38597 * @example 38598 * 38599 * _.castArray(1); 38600 * // => [1] 38601 * 38602 * _.castArray({ 'a': 1 }); 38603 * // => [{ 'a': 1 }] 38604 * 38605 * _.castArray('abc'); 38606 * // => ['abc'] 38607 * 38608 * _.castArray(null); 38609 * // => [null] 38610 * 38611 * _.castArray(undefined); 38612 * // => [undefined] 38613 * 38614 * _.castArray(); 38615 * // => [] 38616 * 38617 * var array = [1, 2, 3]; 38618 * console.log(_.castArray(array) === array); 38619 * // => true 38620 */ 38621 function castArray() { 38622 if (!arguments.length) { 38623 return []; 38624 } 38625 var value = arguments[0]; 38626 return isArray(value) ? value : [value]; 38627 } 38628 38629 /** 38630 * Creates a shallow clone of `value`. 38631 * 38632 * **Note:** This method is loosely based on the 38633 * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) 38634 * and supports cloning arrays, array buffers, booleans, date objects, maps, 38635 * numbers, `Object` objects, regexes, sets, strings, symbols, and typed 38636 * arrays. The own enumerable properties of `arguments` objects are cloned 38637 * as plain objects. An empty object is returned for uncloneable values such 38638 * as error objects, functions, DOM nodes, and WeakMaps. 38639 * 38640 * @static 38641 * @memberOf _ 38642 * @since 0.1.0 38643 * @category Lang 38644 * @param {*} value The value to clone. 38645 * @returns {*} Returns the cloned value. 38646 * @see _.cloneDeep 38647 * @example 38648 * 38649 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 38650 * 38651 * var shallow = _.clone(objects); 38652 * console.log(shallow[0] === objects[0]); 38653 * // => true 38654 */ 38655 function clone(value) { 38656 return baseClone(value, CLONE_SYMBOLS_FLAG); 38657 } 38658 38659 /** 38660 * This method is like `_.clone` except that it accepts `customizer` which 38661 * is invoked to produce the cloned value. If `customizer` returns `undefined`, 38662 * cloning is handled by the method instead. The `customizer` is invoked with 38663 * up to four arguments; (value [, index|key, object, stack]). 38664 * 38665 * @static 38666 * @memberOf _ 38667 * @since 4.0.0 38668 * @category Lang 38669 * @param {*} value The value to clone. 38670 * @param {Function} [customizer] The function to customize cloning. 38671 * @returns {*} Returns the cloned value. 38672 * @see _.cloneDeepWith 38673 * @example 38674 * 38675 * function customizer(value) { 38676 * if (_.isElement(value)) { 38677 * return value.cloneNode(false); 38678 * } 38679 * } 38680 * 38681 * var el = _.cloneWith(document.body, customizer); 38682 * 38683 * console.log(el === document.body); 38684 * // => false 38685 * console.log(el.nodeName); 38686 * // => 'BODY' 38687 * console.log(el.childNodes.length); 38688 * // => 0 38689 */ 38690 function cloneWith(value, customizer) { 38691 customizer = typeof customizer == 'function' ? customizer : undefined; 38692 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); 38693 } 38694 38695 /** 38696 * This method is like `_.clone` except that it recursively clones `value`. 38697 * 38698 * @static 38699 * @memberOf _ 38700 * @since 1.0.0 38701 * @category Lang 38702 * @param {*} value The value to recursively clone. 38703 * @returns {*} Returns the deep cloned value. 38704 * @see _.clone 38705 * @example 38706 * 38707 * var objects = [{ 'a': 1 }, { 'b': 2 }]; 38708 * 38709 * var deep = _.cloneDeep(objects); 38710 * console.log(deep[0] === objects[0]); 38711 * // => false 38712 */ 38713 function cloneDeep(value) { 38714 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 38715 } 38716 38717 /** 38718 * This method is like `_.cloneWith` except that it recursively clones `value`. 38719 * 38720 * @static 38721 * @memberOf _ 38722 * @since 4.0.0 38723 * @category Lang 38724 * @param {*} value The value to recursively clone. 38725 * @param {Function} [customizer] The function to customize cloning. 38726 * @returns {*} Returns the deep cloned value. 38727 * @see _.cloneWith 38728 * @example 38729 * 38730 * function customizer(value) { 38731 * if (_.isElement(value)) { 38732 * return value.cloneNode(true); 38733 * } 38734 * } 38735 * 38736 * var el = _.cloneDeepWith(document.body, customizer); 38737 * 38738 * console.log(el === document.body); 38739 * // => false 38740 * console.log(el.nodeName); 38741 * // => 'BODY' 38742 * console.log(el.childNodes.length); 38743 * // => 20 38744 */ 38745 function cloneDeepWith(value, customizer) { 38746 customizer = typeof customizer == 'function' ? customizer : undefined; 38747 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 38748 } 38749 38750 /** 38751 * Checks if `object` conforms to `source` by invoking the predicate 38752 * properties of `source` with the corresponding property values of `object`. 38753 * 38754 * **Note:** This method is equivalent to `_.conforms` when `source` is 38755 * partially applied. 38756 * 38757 * @static 38758 * @memberOf _ 38759 * @since 4.14.0 38760 * @category Lang 38761 * @param {Object} object The object to inspect. 38762 * @param {Object} source The object of property predicates to conform to. 38763 * @returns {boolean} Returns `true` if `object` conforms, else `false`. 38764 * @example 38765 * 38766 * var object = { 'a': 1, 'b': 2 }; 38767 * 38768 * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); 38769 * // => true 38770 * 38771 * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); 38772 * // => false 38773 */ 38774 function conformsTo(object, source) { 38775 return source == null || baseConformsTo(object, source, keys(source)); 38776 } 38777 38778 /** 38779 * Performs a 38780 * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) 38781 * comparison between two values to determine if they are equivalent. 38782 * 38783 * @static 38784 * @memberOf _ 38785 * @since 4.0.0 38786 * @category Lang 38787 * @param {*} value The value to compare. 38788 * @param {*} other The other value to compare. 38789 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 38790 * @example 38791 * 38792 * var object = { 'a': 1 }; 38793 * var other = { 'a': 1 }; 38794 * 38795 * _.eq(object, object); 38796 * // => true 38797 * 38798 * _.eq(object, other); 38799 * // => false 38800 * 38801 * _.eq('a', 'a'); 38802 * // => true 38803 * 38804 * _.eq('a', Object('a')); 38805 * // => false 38806 * 38807 * _.eq(NaN, NaN); 38808 * // => true 38809 */ 38810 function eq(value, other) { 38811 return value === other || (value !== value && other !== other); 38812 } 38813 38814 /** 38815 * Checks if `value` is greater than `other`. 38816 * 38817 * @static 38818 * @memberOf _ 38819 * @since 3.9.0 38820 * @category Lang 38821 * @param {*} value The value to compare. 38822 * @param {*} other The other value to compare. 38823 * @returns {boolean} Returns `true` if `value` is greater than `other`, 38824 * else `false`. 38825 * @see _.lt 38826 * @example 38827 * 38828 * _.gt(3, 1); 38829 * // => true 38830 * 38831 * _.gt(3, 3); 38832 * // => false 38833 * 38834 * _.gt(1, 3); 38835 * // => false 38836 */ 38837 var gt = createRelationalOperation(baseGt); 38838 38839 /** 38840 * Checks if `value` is greater than or equal to `other`. 38841 * 38842 * @static 38843 * @memberOf _ 38844 * @since 3.9.0 38845 * @category Lang 38846 * @param {*} value The value to compare. 38847 * @param {*} other The other value to compare. 38848 * @returns {boolean} Returns `true` if `value` is greater than or equal to 38849 * `other`, else `false`. 38850 * @see _.lte 38851 * @example 38852 * 38853 * _.gte(3, 1); 38854 * // => true 38855 * 38856 * _.gte(3, 3); 38857 * // => true 38858 * 38859 * _.gte(1, 3); 38860 * // => false 38861 */ 38862 var gte = createRelationalOperation(function(value, other) { 38863 return value >= other; 38864 }); 38865 38866 /** 38867 * Checks if `value` is likely an `arguments` object. 38868 * 38869 * @static 38870 * @memberOf _ 38871 * @since 0.1.0 38872 * @category Lang 38873 * @param {*} value The value to check. 38874 * @returns {boolean} Returns `true` if `value` is an `arguments` object, 38875 * else `false`. 38876 * @example 38877 * 38878 * _.isArguments(function() { return arguments; }()); 38879 * // => true 38880 * 38881 * _.isArguments([1, 2, 3]); 38882 * // => false 38883 */ 38884 var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { 38885 return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && 38886 !propertyIsEnumerable.call(value, 'callee'); 38887 }; 38888 38889 /** 38890 * Checks if `value` is classified as an `Array` object. 38891 * 38892 * @static 38893 * @memberOf _ 38894 * @since 0.1.0 38895 * @category Lang 38896 * @param {*} value The value to check. 38897 * @returns {boolean} Returns `true` if `value` is an array, else `false`. 38898 * @example 38899 * 38900 * _.isArray([1, 2, 3]); 38901 * // => true 38902 * 38903 * _.isArray(document.body.children); 38904 * // => false 38905 * 38906 * _.isArray('abc'); 38907 * // => false 38908 * 38909 * _.isArray(_.noop); 38910 * // => false 38911 */ 38912 var isArray = Array.isArray; 38913 38914 /** 38915 * Checks if `value` is classified as an `ArrayBuffer` object. 38916 * 38917 * @static 38918 * @memberOf _ 38919 * @since 4.3.0 38920 * @category Lang 38921 * @param {*} value The value to check. 38922 * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. 38923 * @example 38924 * 38925 * _.isArrayBuffer(new ArrayBuffer(2)); 38926 * // => true 38927 * 38928 * _.isArrayBuffer(new Array(2)); 38929 * // => false 38930 */ 38931 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; 38932 38933 /** 38934 * Checks if `value` is array-like. A value is considered array-like if it's 38935 * not a function and has a `value.length` that's an integer greater than or 38936 * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. 38937 * 38938 * @static 38939 * @memberOf _ 38940 * @since 4.0.0 38941 * @category Lang 38942 * @param {*} value The value to check. 38943 * @returns {boolean} Returns `true` if `value` is array-like, else `false`. 38944 * @example 38945 * 38946 * _.isArrayLike([1, 2, 3]); 38947 * // => true 38948 * 38949 * _.isArrayLike(document.body.children); 38950 * // => true 38951 * 38952 * _.isArrayLike('abc'); 38953 * // => true 38954 * 38955 * _.isArrayLike(_.noop); 38956 * // => false 38957 */ 38958 function isArrayLike(value) { 38959 return value != null && isLength(value.length) && !isFunction(value); 38960 } 38961 38962 /** 38963 * This method is like `_.isArrayLike` except that it also checks if `value` 38964 * is an object. 38965 * 38966 * @static 38967 * @memberOf _ 38968 * @since 4.0.0 38969 * @category Lang 38970 * @param {*} value The value to check. 38971 * @returns {boolean} Returns `true` if `value` is an array-like object, 38972 * else `false`. 38973 * @example 38974 * 38975 * _.isArrayLikeObject([1, 2, 3]); 38976 * // => true 38977 * 38978 * _.isArrayLikeObject(document.body.children); 38979 * // => true 38980 * 38981 * _.isArrayLikeObject('abc'); 38982 * // => false 38983 * 38984 * _.isArrayLikeObject(_.noop); 38985 * // => false 38986 */ 38987 function isArrayLikeObject(value) { 38988 return isObjectLike(value) && isArrayLike(value); 38989 } 38990 38991 /** 38992 * Checks if `value` is classified as a boolean primitive or object. 38993 * 38994 * @static 38995 * @memberOf _ 38996 * @since 0.1.0 38997 * @category Lang 38998 * @param {*} value The value to check. 38999 * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. 39000 * @example 39001 * 39002 * _.isBoolean(false); 39003 * // => true 39004 * 39005 * _.isBoolean(null); 39006 * // => false 39007 */ 39008 function isBoolean(value) { 39009 return value === true || value === false || 39010 (isObjectLike(value) && baseGetTag(value) == boolTag); 39011 } 39012 39013 /** 39014 * Checks if `value` is a buffer. 39015 * 39016 * @static 39017 * @memberOf _ 39018 * @since 4.3.0 39019 * @category Lang 39020 * @param {*} value The value to check. 39021 * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. 39022 * @example 39023 * 39024 * _.isBuffer(new Buffer(2)); 39025 * // => true 39026 * 39027 * _.isBuffer(new Uint8Array(2)); 39028 * // => false 39029 */ 39030 var isBuffer = nativeIsBuffer || stubFalse; 39031 39032 /** 39033 * Checks if `value` is classified as a `Date` object. 39034 * 39035 * @static 39036 * @memberOf _ 39037 * @since 0.1.0 39038 * @category Lang 39039 * @param {*} value The value to check. 39040 * @returns {boolean} Returns `true` if `value` is a date object, else `false`. 39041 * @example 39042 * 39043 * _.isDate(new Date); 39044 * // => true 39045 * 39046 * _.isDate('Mon April 23 2012'); 39047 * // => false 39048 */ 39049 var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; 39050 39051 /** 39052 * Checks if `value` is likely a DOM element. 39053 * 39054 * @static 39055 * @memberOf _ 39056 * @since 0.1.0 39057 * @category Lang 39058 * @param {*} value The value to check. 39059 * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. 39060 * @example 39061 * 39062 * _.isElement(document.body); 39063 * // => true 39064 * 39065 * _.isElement('<body>'); 39066 * // => false 39067 */ 39068 function isElement(value) { 39069 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); 39070 } 39071 39072 /** 39073 * Checks if `value` is an empty object, collection, map, or set. 39074 * 39075 * Objects are considered empty if they have no own enumerable string keyed 39076 * properties. 39077 * 39078 * Array-like values such as `arguments` objects, arrays, buffers, strings, or 39079 * jQuery-like collections are considered empty if they have a `length` of `0`. 39080 * Similarly, maps and sets are considered empty if they have a `size` of `0`. 39081 * 39082 * @static 39083 * @memberOf _ 39084 * @since 0.1.0 39085 * @category Lang 39086 * @param {*} value The value to check. 39087 * @returns {boolean} Returns `true` if `value` is empty, else `false`. 39088 * @example 39089 * 39090 * _.isEmpty(null); 39091 * // => true 39092 * 39093 * _.isEmpty(true); 39094 * // => true 39095 * 39096 * _.isEmpty(1); 39097 * // => true 39098 * 39099 * _.isEmpty([1, 2, 3]); 39100 * // => false 39101 * 39102 * _.isEmpty({ 'a': 1 }); 39103 * // => false 39104 */ 39105 function isEmpty(value) { 39106 if (value == null) { 39107 return true; 39108 } 39109 if (isArrayLike(value) && 39110 (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || 39111 isBuffer(value) || isTypedArray(value) || isArguments(value))) { 39112 return !value.length; 39113 } 39114 var tag = getTag(value); 39115 if (tag == mapTag || tag == setTag) { 39116 return !value.size; 39117 } 39118 if (isPrototype(value)) { 39119 return !baseKeys(value).length; 39120 } 39121 for (var key in value) { 39122 if (hasOwnProperty.call(value, key)) { 39123 return false; 39124 } 39125 } 39126 return true; 39127 } 39128 39129 /** 39130 * Performs a deep comparison between two values to determine if they are 39131 * equivalent. 39132 * 39133 * **Note:** This method supports comparing arrays, array buffers, booleans, 39134 * date objects, error objects, maps, numbers, `Object` objects, regexes, 39135 * sets, strings, symbols, and typed arrays. `Object` objects are compared 39136 * by their own, not inherited, enumerable properties. Functions and DOM 39137 * nodes are compared by strict equality, i.e. `===`. 39138 * 39139 * @static 39140 * @memberOf _ 39141 * @since 0.1.0 39142 * @category Lang 39143 * @param {*} value The value to compare. 39144 * @param {*} other The other value to compare. 39145 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 39146 * @example 39147 * 39148 * var object = { 'a': 1 }; 39149 * var other = { 'a': 1 }; 39150 * 39151 * _.isEqual(object, other); 39152 * // => true 39153 * 39154 * object === other; 39155 * // => false 39156 */ 39157 function isEqual(value, other) { 39158 return baseIsEqual(value, other); 39159 } 39160 39161 /** 39162 * This method is like `_.isEqual` except that it accepts `customizer` which 39163 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 39164 * are handled by the method instead. The `customizer` is invoked with up to 39165 * six arguments: (objValue, othValue [, index|key, object, other, stack]). 39166 * 39167 * @static 39168 * @memberOf _ 39169 * @since 4.0.0 39170 * @category Lang 39171 * @param {*} value The value to compare. 39172 * @param {*} other The other value to compare. 39173 * @param {Function} [customizer] The function to customize comparisons. 39174 * @returns {boolean} Returns `true` if the values are equivalent, else `false`. 39175 * @example 39176 * 39177 * function isGreeting(value) { 39178 * return /^h(?:i|ello)$/.test(value); 39179 * } 39180 * 39181 * function customizer(objValue, othValue) { 39182 * if (isGreeting(objValue) && isGreeting(othValue)) { 39183 * return true; 39184 * } 39185 * } 39186 * 39187 * var array = ['hello', 'goodbye']; 39188 * var other = ['hi', 'goodbye']; 39189 * 39190 * _.isEqualWith(array, other, customizer); 39191 * // => true 39192 */ 39193 function isEqualWith(value, other, customizer) { 39194 customizer = typeof customizer == 'function' ? customizer : undefined; 39195 var result = customizer ? customizer(value, other) : undefined; 39196 return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; 39197 } 39198 39199 /** 39200 * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, 39201 * `SyntaxError`, `TypeError`, or `URIError` object. 39202 * 39203 * @static 39204 * @memberOf _ 39205 * @since 3.0.0 39206 * @category Lang 39207 * @param {*} value The value to check. 39208 * @returns {boolean} Returns `true` if `value` is an error object, else `false`. 39209 * @example 39210 * 39211 * _.isError(new Error); 39212 * // => true 39213 * 39214 * _.isError(Error); 39215 * // => false 39216 */ 39217 function isError(value) { 39218 if (!isObjectLike(value)) { 39219 return false; 39220 } 39221 var tag = baseGetTag(value); 39222 return tag == errorTag || tag == domExcTag || 39223 (typeof value.message == 'string' && typeof value.name == 'string' && !isPlainObject(value)); 39224 } 39225 39226 /** 39227 * Checks if `value` is a finite primitive number. 39228 * 39229 * **Note:** This method is based on 39230 * [`Number.isFinite`](https://mdn.io/Number/isFinite). 39231 * 39232 * @static 39233 * @memberOf _ 39234 * @since 0.1.0 39235 * @category Lang 39236 * @param {*} value The value to check. 39237 * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. 39238 * @example 39239 * 39240 * _.isFinite(3); 39241 * // => true 39242 * 39243 * _.isFinite(Number.MIN_VALUE); 39244 * // => true 39245 * 39246 * _.isFinite(Infinity); 39247 * // => false 39248 * 39249 * _.isFinite('3'); 39250 * // => false 39251 */ 39252 function isFinite(value) { 39253 return typeof value == 'number' && nativeIsFinite(value); 39254 } 39255 39256 /** 39257 * Checks if `value` is classified as a `Function` object. 39258 * 39259 * @static 39260 * @memberOf _ 39261 * @since 0.1.0 39262 * @category Lang 39263 * @param {*} value The value to check. 39264 * @returns {boolean} Returns `true` if `value` is a function, else `false`. 39265 * @example 39266 * 39267 * _.isFunction(_); 39268 * // => true 39269 * 39270 * _.isFunction(/abc/); 39271 * // => false 39272 */ 39273 function isFunction(value) { 39274 if (!isObject(value)) { 39275 return false; 39276 } 39277 // The use of `Object#toString` avoids issues with the `typeof` operator 39278 // in Safari 9 which returns 'object' for typed arrays and other constructors. 39279 var tag = baseGetTag(value); 39280 return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; 39281 } 39282 39283 /** 39284 * Checks if `value` is an integer. 39285 * 39286 * **Note:** This method is based on 39287 * [`Number.isInteger`](https://mdn.io/Number/isInteger). 39288 * 39289 * @static 39290 * @memberOf _ 39291 * @since 4.0.0 39292 * @category Lang 39293 * @param {*} value The value to check. 39294 * @returns {boolean} Returns `true` if `value` is an integer, else `false`. 39295 * @example 39296 * 39297 * _.isInteger(3); 39298 * // => true 39299 * 39300 * _.isInteger(Number.MIN_VALUE); 39301 * // => false 39302 * 39303 * _.isInteger(Infinity); 39304 * // => false 39305 * 39306 * _.isInteger('3'); 39307 * // => false 39308 */ 39309 function isInteger(value) { 39310 return typeof value == 'number' && value == toInteger(value); 39311 } 39312 39313 /** 39314 * Checks if `value` is a valid array-like length. 39315 * 39316 * **Note:** This method is loosely based on 39317 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 39318 * 39319 * @static 39320 * @memberOf _ 39321 * @since 4.0.0 39322 * @category Lang 39323 * @param {*} value The value to check. 39324 * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. 39325 * @example 39326 * 39327 * _.isLength(3); 39328 * // => true 39329 * 39330 * _.isLength(Number.MIN_VALUE); 39331 * // => false 39332 * 39333 * _.isLength(Infinity); 39334 * // => false 39335 * 39336 * _.isLength('3'); 39337 * // => false 39338 */ 39339 function isLength(value) { 39340 return typeof value == 'number' && 39341 value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 39342 } 39343 39344 /** 39345 * Checks if `value` is the 39346 * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) 39347 * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) 39348 * 39349 * @static 39350 * @memberOf _ 39351 * @since 0.1.0 39352 * @category Lang 39353 * @param {*} value The value to check. 39354 * @returns {boolean} Returns `true` if `value` is an object, else `false`. 39355 * @example 39356 * 39357 * _.isObject({}); 39358 * // => true 39359 * 39360 * _.isObject([1, 2, 3]); 39361 * // => true 39362 * 39363 * _.isObject(_.noop); 39364 * // => true 39365 * 39366 * _.isObject(null); 39367 * // => false 39368 */ 39369 function isObject(value) { 39370 var type = typeof value; 39371 return value != null && (type == 'object' || type == 'function'); 39372 } 39373 39374 /** 39375 * Checks if `value` is object-like. A value is object-like if it's not `null` 39376 * and has a `typeof` result of "object". 39377 * 39378 * @static 39379 * @memberOf _ 39380 * @since 4.0.0 39381 * @category Lang 39382 * @param {*} value The value to check. 39383 * @returns {boolean} Returns `true` if `value` is object-like, else `false`. 39384 * @example 39385 * 39386 * _.isObjectLike({}); 39387 * // => true 39388 * 39389 * _.isObjectLike([1, 2, 3]); 39390 * // => true 39391 * 39392 * _.isObjectLike(_.noop); 39393 * // => false 39394 * 39395 * _.isObjectLike(null); 39396 * // => false 39397 */ 39398 function isObjectLike(value) { 39399 return value != null && typeof value == 'object'; 39400 } 39401 39402 /** 39403 * Checks if `value` is classified as a `Map` object. 39404 * 39405 * @static 39406 * @memberOf _ 39407 * @since 4.3.0 39408 * @category Lang 39409 * @param {*} value The value to check. 39410 * @returns {boolean} Returns `true` if `value` is a map, else `false`. 39411 * @example 39412 * 39413 * _.isMap(new Map); 39414 * // => true 39415 * 39416 * _.isMap(new WeakMap); 39417 * // => false 39418 */ 39419 var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 39420 39421 /** 39422 * Performs a partial deep comparison between `object` and `source` to 39423 * determine if `object` contains equivalent property values. 39424 * 39425 * **Note:** This method is equivalent to `_.matches` when `source` is 39426 * partially applied. 39427 * 39428 * Partial comparisons will match empty array and empty object `source` 39429 * values against any array or object value, respectively. See `_.isEqual` 39430 * for a list of supported value comparisons. 39431 * 39432 * @static 39433 * @memberOf _ 39434 * @since 3.0.0 39435 * @category Lang 39436 * @param {Object} object The object to inspect. 39437 * @param {Object} source The object of property values to match. 39438 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 39439 * @example 39440 * 39441 * var object = { 'a': 1, 'b': 2 }; 39442 * 39443 * _.isMatch(object, { 'b': 2 }); 39444 * // => true 39445 * 39446 * _.isMatch(object, { 'b': 1 }); 39447 * // => false 39448 */ 39449 function isMatch(object, source) { 39450 return object === source || baseIsMatch(object, source, getMatchData(source)); 39451 } 39452 39453 /** 39454 * This method is like `_.isMatch` except that it accepts `customizer` which 39455 * is invoked to compare values. If `customizer` returns `undefined`, comparisons 39456 * are handled by the method instead. The `customizer` is invoked with five 39457 * arguments: (objValue, srcValue, index|key, object, source). 39458 * 39459 * @static 39460 * @memberOf _ 39461 * @since 4.0.0 39462 * @category Lang 39463 * @param {Object} object The object to inspect. 39464 * @param {Object} source The object of property values to match. 39465 * @param {Function} [customizer] The function to customize comparisons. 39466 * @returns {boolean} Returns `true` if `object` is a match, else `false`. 39467 * @example 39468 * 39469 * function isGreeting(value) { 39470 * return /^h(?:i|ello)$/.test(value); 39471 * } 39472 * 39473 * function customizer(objValue, srcValue) { 39474 * if (isGreeting(objValue) && isGreeting(srcValue)) { 39475 * return true; 39476 * } 39477 * } 39478 * 39479 * var object = { 'greeting': 'hello' }; 39480 * var source = { 'greeting': 'hi' }; 39481 * 39482 * _.isMatchWith(object, source, customizer); 39483 * // => true 39484 */ 39485 function isMatchWith(object, source, customizer) { 39486 customizer = typeof customizer == 'function' ? customizer : undefined; 39487 return baseIsMatch(object, source, getMatchData(source), customizer); 39488 } 39489 39490 /** 39491 * Checks if `value` is `NaN`. 39492 * 39493 * **Note:** This method is based on 39494 * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as 39495 * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for 39496 * `undefined` and other non-number values. 39497 * 39498 * @static 39499 * @memberOf _ 39500 * @since 0.1.0 39501 * @category Lang 39502 * @param {*} value The value to check. 39503 * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. 39504 * @example 39505 * 39506 * _.isNaN(NaN); 39507 * // => true 39508 * 39509 * _.isNaN(new Number(NaN)); 39510 * // => true 39511 * 39512 * isNaN(undefined); 39513 * // => true 39514 * 39515 * _.isNaN(undefined); 39516 * // => false 39517 */ 39518 function isNaN(value) { 39519 // An `NaN` primitive is the only value that is not equal to itself. 39520 // Perform the `toStringTag` check first to avoid errors with some 39521 // ActiveX objects in IE. 39522 return isNumber(value) && value != +value; 39523 } 39524 39525 /** 39526 * Checks if `value` is a pristine native function. 39527 * 39528 * **Note:** This method can't reliably detect native functions in the presence 39529 * of the core-js package because core-js circumvents this kind of detection. 39530 * Despite multiple requests, the core-js maintainer has made it clear: any 39531 * attempt to fix the detection will be obstructed. As a result, we're left 39532 * with little choice but to throw an error. Unfortunately, this also affects 39533 * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), 39534 * which rely on core-js. 39535 * 39536 * @static 39537 * @memberOf _ 39538 * @since 3.0.0 39539 * @category Lang 39540 * @param {*} value The value to check. 39541 * @returns {boolean} Returns `true` if `value` is a native function, 39542 * else `false`. 39543 * @example 39544 * 39545 * _.isNative(Array.prototype.push); 39546 * // => true 39547 * 39548 * _.isNative(_); 39549 * // => false 39550 */ 39551 function isNative(value) { 39552 if (isMaskable(value)) { 39553 throw new Error(CORE_ERROR_TEXT); 39554 } 39555 return baseIsNative(value); 39556 } 39557 39558 /** 39559 * Checks if `value` is `null`. 39560 * 39561 * @static 39562 * @memberOf _ 39563 * @since 0.1.0 39564 * @category Lang 39565 * @param {*} value The value to check. 39566 * @returns {boolean} Returns `true` if `value` is `null`, else `false`. 39567 * @example 39568 * 39569 * _.isNull(null); 39570 * // => true 39571 * 39572 * _.isNull(void 0); 39573 * // => false 39574 */ 39575 function isNull(value) { 39576 return value === null; 39577 } 39578 39579 /** 39580 * Checks if `value` is `null` or `undefined`. 39581 * 39582 * @static 39583 * @memberOf _ 39584 * @since 4.0.0 39585 * @category Lang 39586 * @param {*} value The value to check. 39587 * @returns {boolean} Returns `true` if `value` is nullish, else `false`. 39588 * @example 39589 * 39590 * _.isNil(null); 39591 * // => true 39592 * 39593 * _.isNil(void 0); 39594 * // => true 39595 * 39596 * _.isNil(NaN); 39597 * // => false 39598 */ 39599 function isNil(value) { 39600 return value == null; 39601 } 39602 39603 /** 39604 * Checks if `value` is classified as a `Number` primitive or object. 39605 * 39606 * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are 39607 * classified as numbers, use the `_.isFinite` method. 39608 * 39609 * @static 39610 * @memberOf _ 39611 * @since 0.1.0 39612 * @category Lang 39613 * @param {*} value The value to check. 39614 * @returns {boolean} Returns `true` if `value` is a number, else `false`. 39615 * @example 39616 * 39617 * _.isNumber(3); 39618 * // => true 39619 * 39620 * _.isNumber(Number.MIN_VALUE); 39621 * // => true 39622 * 39623 * _.isNumber(Infinity); 39624 * // => true 39625 * 39626 * _.isNumber('3'); 39627 * // => false 39628 */ 39629 function isNumber(value) { 39630 return typeof value == 'number' || 39631 (isObjectLike(value) && baseGetTag(value) == numberTag); 39632 } 39633 39634 /** 39635 * Checks if `value` is a plain object, that is, an object created by the 39636 * `Object` constructor or one with a `[[Prototype]]` of `null`. 39637 * 39638 * @static 39639 * @memberOf _ 39640 * @since 0.8.0 39641 * @category Lang 39642 * @param {*} value The value to check. 39643 * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. 39644 * @example 39645 * 39646 * function Foo() { 39647 * this.a = 1; 39648 * } 39649 * 39650 * _.isPlainObject(new Foo); 39651 * // => false 39652 * 39653 * _.isPlainObject([1, 2, 3]); 39654 * // => false 39655 * 39656 * _.isPlainObject({ 'x': 0, 'y': 0 }); 39657 * // => true 39658 * 39659 * _.isPlainObject(Object.create(null)); 39660 * // => true 39661 */ 39662 function isPlainObject(value) { 39663 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 39664 return false; 39665 } 39666 var proto = getPrototype(value); 39667 if (proto === null) { 39668 return true; 39669 } 39670 var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; 39671 return typeof Ctor == 'function' && Ctor instanceof Ctor && 39672 funcToString.call(Ctor) == objectCtorString; 39673 } 39674 39675 /** 39676 * Checks if `value` is classified as a `RegExp` object. 39677 * 39678 * @static 39679 * @memberOf _ 39680 * @since 0.1.0 39681 * @category Lang 39682 * @param {*} value The value to check. 39683 * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. 39684 * @example 39685 * 39686 * _.isRegExp(/abc/); 39687 * // => true 39688 * 39689 * _.isRegExp('/abc/'); 39690 * // => false 39691 */ 39692 var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 39693 39694 /** 39695 * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 39696 * double precision number which isn't the result of a rounded unsafe integer. 39697 * 39698 * **Note:** This method is based on 39699 * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). 39700 * 39701 * @static 39702 * @memberOf _ 39703 * @since 4.0.0 39704 * @category Lang 39705 * @param {*} value The value to check. 39706 * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. 39707 * @example 39708 * 39709 * _.isSafeInteger(3); 39710 * // => true 39711 * 39712 * _.isSafeInteger(Number.MIN_VALUE); 39713 * // => false 39714 * 39715 * _.isSafeInteger(Infinity); 39716 * // => false 39717 * 39718 * _.isSafeInteger('3'); 39719 * // => false 39720 */ 39721 function isSafeInteger(value) { 39722 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; 39723 } 39724 39725 /** 39726 * Checks if `value` is classified as a `Set` object. 39727 * 39728 * @static 39729 * @memberOf _ 39730 * @since 4.3.0 39731 * @category Lang 39732 * @param {*} value The value to check. 39733 * @returns {boolean} Returns `true` if `value` is a set, else `false`. 39734 * @example 39735 * 39736 * _.isSet(new Set); 39737 * // => true 39738 * 39739 * _.isSet(new WeakSet); 39740 * // => false 39741 */ 39742 var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 39743 39744 /** 39745 * Checks if `value` is classified as a `String` primitive or object. 39746 * 39747 * @static 39748 * @since 0.1.0 39749 * @memberOf _ 39750 * @category Lang 39751 * @param {*} value The value to check. 39752 * @returns {boolean} Returns `true` if `value` is a string, else `false`. 39753 * @example 39754 * 39755 * _.isString('abc'); 39756 * // => true 39757 * 39758 * _.isString(1); 39759 * // => false 39760 */ 39761 function isString(value) { 39762 return typeof value == 'string' || 39763 (!isArray(value) && isObjectLike(value) && baseGetTag(value) == stringTag); 39764 } 39765 39766 /** 39767 * Checks if `value` is classified as a `Symbol` primitive or object. 39768 * 39769 * @static 39770 * @memberOf _ 39771 * @since 4.0.0 39772 * @category Lang 39773 * @param {*} value The value to check. 39774 * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. 39775 * @example 39776 * 39777 * _.isSymbol(Symbol.iterator); 39778 * // => true 39779 * 39780 * _.isSymbol('abc'); 39781 * // => false 39782 */ 39783 function isSymbol(value) { 39784 return typeof value == 'symbol' || 39785 (isObjectLike(value) && baseGetTag(value) == symbolTag); 39786 } 39787 39788 /** 39789 * Checks if `value` is classified as a typed array. 39790 * 39791 * @static 39792 * @memberOf _ 39793 * @since 3.0.0 39794 * @category Lang 39795 * @param {*} value The value to check. 39796 * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. 39797 * @example 39798 * 39799 * _.isTypedArray(new Uint8Array); 39800 * // => true 39801 * 39802 * _.isTypedArray([]); 39803 * // => false 39804 */ 39805 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 39806 39807 /** 39808 * Checks if `value` is `undefined`. 39809 * 39810 * @static 39811 * @since 0.1.0 39812 * @memberOf _ 39813 * @category Lang 39814 * @param {*} value The value to check. 39815 * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. 39816 * @example 39817 * 39818 * _.isUndefined(void 0); 39819 * // => true 39820 * 39821 * _.isUndefined(null); 39822 * // => false 39823 */ 39824 function isUndefined(value) { 39825 return value === undefined; 39826 } 39827 39828 /** 39829 * Checks if `value` is classified as a `WeakMap` object. 39830 * 39831 * @static 39832 * @memberOf _ 39833 * @since 4.3.0 39834 * @category Lang 39835 * @param {*} value The value to check. 39836 * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. 39837 * @example 39838 * 39839 * _.isWeakMap(new WeakMap); 39840 * // => true 39841 * 39842 * _.isWeakMap(new Map); 39843 * // => false 39844 */ 39845 function isWeakMap(value) { 39846 return isObjectLike(value) && getTag(value) == weakMapTag; 39847 } 39848 39849 /** 39850 * Checks if `value` is classified as a `WeakSet` object. 39851 * 39852 * @static 39853 * @memberOf _ 39854 * @since 4.3.0 39855 * @category Lang 39856 * @param {*} value The value to check. 39857 * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. 39858 * @example 39859 * 39860 * _.isWeakSet(new WeakSet); 39861 * // => true 39862 * 39863 * _.isWeakSet(new Set); 39864 * // => false 39865 */ 39866 function isWeakSet(value) { 39867 return isObjectLike(value) && baseGetTag(value) == weakSetTag; 39868 } 39869 39870 /** 39871 * Checks if `value` is less than `other`. 39872 * 39873 * @static 39874 * @memberOf _ 39875 * @since 3.9.0 39876 * @category Lang 39877 * @param {*} value The value to compare. 39878 * @param {*} other The other value to compare. 39879 * @returns {boolean} Returns `true` if `value` is less than `other`, 39880 * else `false`. 39881 * @see _.gt 39882 * @example 39883 * 39884 * _.lt(1, 3); 39885 * // => true 39886 * 39887 * _.lt(3, 3); 39888 * // => false 39889 * 39890 * _.lt(3, 1); 39891 * // => false 39892 */ 39893 var lt = createRelationalOperation(baseLt); 39894 39895 /** 39896 * Checks if `value` is less than or equal to `other`. 39897 * 39898 * @static 39899 * @memberOf _ 39900 * @since 3.9.0 39901 * @category Lang 39902 * @param {*} value The value to compare. 39903 * @param {*} other The other value to compare. 39904 * @returns {boolean} Returns `true` if `value` is less than or equal to 39905 * `other`, else `false`. 39906 * @see _.gte 39907 * @example 39908 * 39909 * _.lte(1, 3); 39910 * // => true 39911 * 39912 * _.lte(3, 3); 39913 * // => true 39914 * 39915 * _.lte(3, 1); 39916 * // => false 39917 */ 39918 var lte = createRelationalOperation(function(value, other) { 39919 return value <= other; 39920 }); 39921 39922 /** 39923 * Converts `value` to an array. 39924 * 39925 * @static 39926 * @since 0.1.0 39927 * @memberOf _ 39928 * @category Lang 39929 * @param {*} value The value to convert. 39930 * @returns {Array} Returns the converted array. 39931 * @example 39932 * 39933 * _.toArray({ 'a': 1, 'b': 2 }); 39934 * // => [1, 2] 39935 * 39936 * _.toArray('abc'); 39937 * // => ['a', 'b', 'c'] 39938 * 39939 * _.toArray(1); 39940 * // => [] 39941 * 39942 * _.toArray(null); 39943 * // => [] 39944 */ 39945 function toArray(value) { 39946 if (!value) { 39947 return []; 39948 } 39949 if (isArrayLike(value)) { 39950 return isString(value) ? stringToArray(value) : copyArray(value); 39951 } 39952 if (symIterator && value[symIterator]) { 39953 return iteratorToArray(value[symIterator]()); 39954 } 39955 var tag = getTag(value), 39956 func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); 39957 39958 return func(value); 39959 } 39960 39961 /** 39962 * Converts `value` to a finite number. 39963 * 39964 * @static 39965 * @memberOf _ 39966 * @since 4.12.0 39967 * @category Lang 39968 * @param {*} value The value to convert. 39969 * @returns {number} Returns the converted number. 39970 * @example 39971 * 39972 * _.toFinite(3.2); 39973 * // => 3.2 39974 * 39975 * _.toFinite(Number.MIN_VALUE); 39976 * // => 5e-324 39977 * 39978 * _.toFinite(Infinity); 39979 * // => 1.7976931348623157e+308 39980 * 39981 * _.toFinite('3.2'); 39982 * // => 3.2 39983 */ 39984 function toFinite(value) { 39985 if (!value) { 39986 return value === 0 ? value : 0; 39987 } 39988 value = toNumber(value); 39989 if (value === INFINITY || value === -INFINITY) { 39990 var sign = (value < 0 ? -1 : 1); 39991 return sign * MAX_INTEGER; 39992 } 39993 return value === value ? value : 0; 39994 } 39995 39996 /** 39997 * Converts `value` to an integer. 39998 * 39999 * **Note:** This method is loosely based on 40000 * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). 40001 * 40002 * @static 40003 * @memberOf _ 40004 * @since 4.0.0 40005 * @category Lang 40006 * @param {*} value The value to convert. 40007 * @returns {number} Returns the converted integer. 40008 * @example 40009 * 40010 * _.toInteger(3.2); 40011 * // => 3 40012 * 40013 * _.toInteger(Number.MIN_VALUE); 40014 * // => 0 40015 * 40016 * _.toInteger(Infinity); 40017 * // => 1.7976931348623157e+308 40018 * 40019 * _.toInteger('3.2'); 40020 * // => 3 40021 */ 40022 function toInteger(value) { 40023 var result = toFinite(value), 40024 remainder = result % 1; 40025 40026 return result === result ? (remainder ? result - remainder : result) : 0; 40027 } 40028 40029 /** 40030 * Converts `value` to an integer suitable for use as the length of an 40031 * array-like object. 40032 * 40033 * **Note:** This method is based on 40034 * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). 40035 * 40036 * @static 40037 * @memberOf _ 40038 * @since 4.0.0 40039 * @category Lang 40040 * @param {*} value The value to convert. 40041 * @returns {number} Returns the converted integer. 40042 * @example 40043 * 40044 * _.toLength(3.2); 40045 * // => 3 40046 * 40047 * _.toLength(Number.MIN_VALUE); 40048 * // => 0 40049 * 40050 * _.toLength(Infinity); 40051 * // => 4294967295 40052 * 40053 * _.toLength('3.2'); 40054 * // => 3 40055 */ 40056 function toLength(value) { 40057 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; 40058 } 40059 40060 /** 40061 * Converts `value` to a number. 40062 * 40063 * @static 40064 * @memberOf _ 40065 * @since 4.0.0 40066 * @category Lang 40067 * @param {*} value The value to process. 40068 * @returns {number} Returns the number. 40069 * @example 40070 * 40071 * _.toNumber(3.2); 40072 * // => 3.2 40073 * 40074 * _.toNumber(Number.MIN_VALUE); 40075 * // => 5e-324 40076 * 40077 * _.toNumber(Infinity); 40078 * // => Infinity 40079 * 40080 * _.toNumber('3.2'); 40081 * // => 3.2 40082 */ 40083 function toNumber(value) { 40084 if (typeof value == 'number') { 40085 return value; 40086 } 40087 if (isSymbol(value)) { 40088 return NAN; 40089 } 40090 if (isObject(value)) { 40091 var other = typeof value.valueOf == 'function' ? value.valueOf() : value; 40092 value = isObject(other) ? (other + '') : other; 40093 } 40094 if (typeof value != 'string') { 40095 return value === 0 ? value : +value; 40096 } 40097 value = baseTrim(value); 40098 var isBinary = reIsBinary.test(value); 40099 return (isBinary || reIsOctal.test(value)) 40100 ? freeParseInt(value.slice(2), isBinary ? 2 : 8) 40101 : (reIsBadHex.test(value) ? NAN : +value); 40102 } 40103 40104 /** 40105 * Converts `value` to a plain object flattening inherited enumerable string 40106 * keyed properties of `value` to own properties of the plain object. 40107 * 40108 * @static 40109 * @memberOf _ 40110 * @since 3.0.0 40111 * @category Lang 40112 * @param {*} value The value to convert. 40113 * @returns {Object} Returns the converted plain object. 40114 * @example 40115 * 40116 * function Foo() { 40117 * this.b = 2; 40118 * } 40119 * 40120 * Foo.prototype.c = 3; 40121 * 40122 * _.assign({ 'a': 1 }, new Foo); 40123 * // => { 'a': 1, 'b': 2 } 40124 * 40125 * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); 40126 * // => { 'a': 1, 'b': 2, 'c': 3 } 40127 */ 40128 function toPlainObject(value) { 40129 return copyObject(value, keysIn(value)); 40130 } 40131 40132 /** 40133 * Converts `value` to a safe integer. A safe integer can be compared and 40134 * represented correctly. 40135 * 40136 * @static 40137 * @memberOf _ 40138 * @since 4.0.0 40139 * @category Lang 40140 * @param {*} value The value to convert. 40141 * @returns {number} Returns the converted integer. 40142 * @example 40143 * 40144 * _.toSafeInteger(3.2); 40145 * // => 3 40146 * 40147 * _.toSafeInteger(Number.MIN_VALUE); 40148 * // => 0 40149 * 40150 * _.toSafeInteger(Infinity); 40151 * // => 9007199254740991 40152 * 40153 * _.toSafeInteger('3.2'); 40154 * // => 3 40155 */ 40156 function toSafeInteger(value) { 40157 return value 40158 ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) 40159 : (value === 0 ? value : 0); 40160 } 40161 40162 /** 40163 * Converts `value` to a string. An empty string is returned for `null` 40164 * and `undefined` values. The sign of `-0` is preserved. 40165 * 40166 * @static 40167 * @memberOf _ 40168 * @since 4.0.0 40169 * @category Lang 40170 * @param {*} value The value to convert. 40171 * @returns {string} Returns the converted string. 40172 * @example 40173 * 40174 * _.toString(null); 40175 * // => '' 40176 * 40177 * _.toString(-0); 40178 * // => '-0' 40179 * 40180 * _.toString([1, 2, 3]); 40181 * // => '1,2,3' 40182 */ 40183 function toString(value) { 40184 return value == null ? '' : baseToString(value); 40185 } 40186 40187 /*------------------------------------------------------------------------*/ 40188 40189 /** 40190 * Assigns own enumerable string keyed properties of source objects to the 40191 * destination object. Source objects are applied from left to right. 40192 * Subsequent sources overwrite property assignments of previous sources. 40193 * 40194 * **Note:** This method mutates `object` and is loosely based on 40195 * [`Object.assign`](https://mdn.io/Object/assign). 40196 * 40197 * @static 40198 * @memberOf _ 40199 * @since 0.10.0 40200 * @category Object 40201 * @param {Object} object The destination object. 40202 * @param {...Object} [sources] The source objects. 40203 * @returns {Object} Returns `object`. 40204 * @see _.assignIn 40205 * @example 40206 * 40207 * function Foo() { 40208 * this.a = 1; 40209 * } 40210 * 40211 * function Bar() { 40212 * this.c = 3; 40213 * } 40214 * 40215 * Foo.prototype.b = 2; 40216 * Bar.prototype.d = 4; 40217 * 40218 * _.assign({ 'a': 0 }, new Foo, new Bar); 40219 * // => { 'a': 1, 'c': 3 } 40220 */ 40221 var assign = createAssigner(function(object, source) { 40222 if (isPrototype(source) || isArrayLike(source)) { 40223 copyObject(source, keys(source), object); 40224 return; 40225 } 40226 for (var key in source) { 40227 if (hasOwnProperty.call(source, key)) { 40228 assignValue(object, key, source[key]); 40229 } 40230 } 40231 }); 40232 40233 /** 40234 * This method is like `_.assign` except that it iterates over own and 40235 * inherited source properties. 40236 * 40237 * **Note:** This method mutates `object`. 40238 * 40239 * @static 40240 * @memberOf _ 40241 * @since 4.0.0 40242 * @alias extend 40243 * @category Object 40244 * @param {Object} object The destination object. 40245 * @param {...Object} [sources] The source objects. 40246 * @returns {Object} Returns `object`. 40247 * @see _.assign 40248 * @example 40249 * 40250 * function Foo() { 40251 * this.a = 1; 40252 * } 40253 * 40254 * function Bar() { 40255 * this.c = 3; 40256 * } 40257 * 40258 * Foo.prototype.b = 2; 40259 * Bar.prototype.d = 4; 40260 * 40261 * _.assignIn({ 'a': 0 }, new Foo, new Bar); 40262 * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } 40263 */ 40264 var assignIn = createAssigner(function(object, source) { 40265 copyObject(source, keysIn(source), object); 40266 }); 40267 40268 /** 40269 * This method is like `_.assignIn` except that it accepts `customizer` 40270 * which is invoked to produce the assigned values. If `customizer` returns 40271 * `undefined`, assignment is handled by the method instead. The `customizer` 40272 * is invoked with five arguments: (objValue, srcValue, key, object, source). 40273 * 40274 * **Note:** This method mutates `object`. 40275 * 40276 * @static 40277 * @memberOf _ 40278 * @since 4.0.0 40279 * @alias extendWith 40280 * @category Object 40281 * @param {Object} object The destination object. 40282 * @param {...Object} sources The source objects. 40283 * @param {Function} [customizer] The function to customize assigned values. 40284 * @returns {Object} Returns `object`. 40285 * @see _.assignWith 40286 * @example 40287 * 40288 * function customizer(objValue, srcValue) { 40289 * return _.isUndefined(objValue) ? srcValue : objValue; 40290 * } 40291 * 40292 * var defaults = _.partialRight(_.assignInWith, customizer); 40293 * 40294 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 40295 * // => { 'a': 1, 'b': 2 } 40296 */ 40297 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { 40298 copyObject(source, keysIn(source), object, customizer); 40299 }); 40300 40301 /** 40302 * This method is like `_.assign` except that it accepts `customizer` 40303 * which is invoked to produce the assigned values. If `customizer` returns 40304 * `undefined`, assignment is handled by the method instead. The `customizer` 40305 * is invoked with five arguments: (objValue, srcValue, key, object, source). 40306 * 40307 * **Note:** This method mutates `object`. 40308 * 40309 * @static 40310 * @memberOf _ 40311 * @since 4.0.0 40312 * @category Object 40313 * @param {Object} object The destination object. 40314 * @param {...Object} sources The source objects. 40315 * @param {Function} [customizer] The function to customize assigned values. 40316 * @returns {Object} Returns `object`. 40317 * @see _.assignInWith 40318 * @example 40319 * 40320 * function customizer(objValue, srcValue) { 40321 * return _.isUndefined(objValue) ? srcValue : objValue; 40322 * } 40323 * 40324 * var defaults = _.partialRight(_.assignWith, customizer); 40325 * 40326 * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 40327 * // => { 'a': 1, 'b': 2 } 40328 */ 40329 var assignWith = createAssigner(function(object, source, srcIndex, customizer) { 40330 copyObject(source, keys(source), object, customizer); 40331 }); 40332 40333 /** 40334 * Creates an array of values corresponding to `paths` of `object`. 40335 * 40336 * @static 40337 * @memberOf _ 40338 * @since 1.0.0 40339 * @category Object 40340 * @param {Object} object The object to iterate over. 40341 * @param {...(string|string[])} [paths] The property paths to pick. 40342 * @returns {Array} Returns the picked values. 40343 * @example 40344 * 40345 * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; 40346 * 40347 * _.at(object, ['a[0].b.c', 'a[1]']); 40348 * // => [3, 4] 40349 */ 40350 var at = flatRest(baseAt); 40351 40352 /** 40353 * Creates an object that inherits from the `prototype` object. If a 40354 * `properties` object is given, its own enumerable string keyed properties 40355 * are assigned to the created object. 40356 * 40357 * @static 40358 * @memberOf _ 40359 * @since 2.3.0 40360 * @category Object 40361 * @param {Object} prototype The object to inherit from. 40362 * @param {Object} [properties] The properties to assign to the object. 40363 * @returns {Object} Returns the new object. 40364 * @example 40365 * 40366 * function Shape() { 40367 * this.x = 0; 40368 * this.y = 0; 40369 * } 40370 * 40371 * function Circle() { 40372 * Shape.call(this); 40373 * } 40374 * 40375 * Circle.prototype = _.create(Shape.prototype, { 40376 * 'constructor': Circle 40377 * }); 40378 * 40379 * var circle = new Circle; 40380 * circle instanceof Circle; 40381 * // => true 40382 * 40383 * circle instanceof Shape; 40384 * // => true 40385 */ 40386 function create(prototype, properties) { 40387 var result = baseCreate(prototype); 40388 return properties == null ? result : baseAssign(result, properties); 40389 } 40390 40391 /** 40392 * Assigns own and inherited enumerable string keyed properties of source 40393 * objects to the destination object for all destination properties that 40394 * resolve to `undefined`. Source objects are applied from left to right. 40395 * Once a property is set, additional values of the same property are ignored. 40396 * 40397 * **Note:** This method mutates `object`. 40398 * 40399 * @static 40400 * @since 0.1.0 40401 * @memberOf _ 40402 * @category Object 40403 * @param {Object} object The destination object. 40404 * @param {...Object} [sources] The source objects. 40405 * @returns {Object} Returns `object`. 40406 * @see _.defaultsDeep 40407 * @example 40408 * 40409 * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); 40410 * // => { 'a': 1, 'b': 2 } 40411 */ 40412 var defaults = baseRest(function(object, sources) { 40413 object = Object(object); 40414 40415 var index = -1; 40416 var length = sources.length; 40417 var guard = length > 2 ? sources[2] : undefined; 40418 40419 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 40420 length = 1; 40421 } 40422 40423 while (++index < length) { 40424 var source = sources[index]; 40425 var props = keysIn(source); 40426 var propsIndex = -1; 40427 var propsLength = props.length; 40428 40429 while (++propsIndex < propsLength) { 40430 var key = props[propsIndex]; 40431 var value = object[key]; 40432 40433 if (value === undefined || 40434 (eq(value, objectProto[key]) && !hasOwnProperty.call(object, key))) { 40435 object[key] = source[key]; 40436 } 40437 } 40438 } 40439 40440 return object; 40441 }); 40442 40443 /** 40444 * This method is like `_.defaults` except that it recursively assigns 40445 * default properties. 40446 * 40447 * **Note:** This method mutates `object`. 40448 * 40449 * @static 40450 * @memberOf _ 40451 * @since 3.10.0 40452 * @category Object 40453 * @param {Object} object The destination object. 40454 * @param {...Object} [sources] The source objects. 40455 * @returns {Object} Returns `object`. 40456 * @see _.defaults 40457 * @example 40458 * 40459 * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); 40460 * // => { 'a': { 'b': 2, 'c': 3 } } 40461 */ 40462 var defaultsDeep = baseRest(function(args) { 40463 args.push(undefined, customDefaultsMerge); 40464 return apply(mergeWith, undefined, args); 40465 }); 40466 40467 /** 40468 * This method is like `_.find` except that it returns the key of the first 40469 * element `predicate` returns truthy for instead of the element itself. 40470 * 40471 * @static 40472 * @memberOf _ 40473 * @since 1.1.0 40474 * @category Object 40475 * @param {Object} object The object to inspect. 40476 * @param {Function} [predicate=_.identity] The function invoked per iteration. 40477 * @returns {string|undefined} Returns the key of the matched element, 40478 * else `undefined`. 40479 * @example 40480 * 40481 * var users = { 40482 * 'barney': { 'age': 36, 'active': true }, 40483 * 'fred': { 'age': 40, 'active': false }, 40484 * 'pebbles': { 'age': 1, 'active': true } 40485 * }; 40486 * 40487 * _.findKey(users, function(o) { return o.age < 40; }); 40488 * // => 'barney' (iteration order is not guaranteed) 40489 * 40490 * // The `_.matches` iteratee shorthand. 40491 * _.findKey(users, { 'age': 1, 'active': true }); 40492 * // => 'pebbles' 40493 * 40494 * // The `_.matchesProperty` iteratee shorthand. 40495 * _.findKey(users, ['active', false]); 40496 * // => 'fred' 40497 * 40498 * // The `_.property` iteratee shorthand. 40499 * _.findKey(users, 'active'); 40500 * // => 'barney' 40501 */ 40502 function findKey(object, predicate) { 40503 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); 40504 } 40505 40506 /** 40507 * This method is like `_.findKey` except that it iterates over elements of 40508 * a collection in the opposite order. 40509 * 40510 * @static 40511 * @memberOf _ 40512 * @since 2.0.0 40513 * @category Object 40514 * @param {Object} object The object to inspect. 40515 * @param {Function} [predicate=_.identity] The function invoked per iteration. 40516 * @returns {string|undefined} Returns the key of the matched element, 40517 * else `undefined`. 40518 * @example 40519 * 40520 * var users = { 40521 * 'barney': { 'age': 36, 'active': true }, 40522 * 'fred': { 'age': 40, 'active': false }, 40523 * 'pebbles': { 'age': 1, 'active': true } 40524 * }; 40525 * 40526 * _.findLastKey(users, function(o) { return o.age < 40; }); 40527 * // => returns 'pebbles' assuming `_.findKey` returns 'barney' 40528 * 40529 * // The `_.matches` iteratee shorthand. 40530 * _.findLastKey(users, { 'age': 36, 'active': true }); 40531 * // => 'barney' 40532 * 40533 * // The `_.matchesProperty` iteratee shorthand. 40534 * _.findLastKey(users, ['active', false]); 40535 * // => 'fred' 40536 * 40537 * // The `_.property` iteratee shorthand. 40538 * _.findLastKey(users, 'active'); 40539 * // => 'pebbles' 40540 */ 40541 function findLastKey(object, predicate) { 40542 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); 40543 } 40544 40545 /** 40546 * Iterates over own and inherited enumerable string keyed properties of an 40547 * object and invokes `iteratee` for each property. The iteratee is invoked 40548 * with three arguments: (value, key, object). Iteratee functions may exit 40549 * iteration early by explicitly returning `false`. 40550 * 40551 * @static 40552 * @memberOf _ 40553 * @since 0.3.0 40554 * @category Object 40555 * @param {Object} object The object to iterate over. 40556 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40557 * @returns {Object} Returns `object`. 40558 * @see _.forInRight 40559 * @example 40560 * 40561 * function Foo() { 40562 * this.a = 1; 40563 * this.b = 2; 40564 * } 40565 * 40566 * Foo.prototype.c = 3; 40567 * 40568 * _.forIn(new Foo, function(value, key) { 40569 * console.log(key); 40570 * }); 40571 * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). 40572 */ 40573 function forIn(object, iteratee) { 40574 return object == null 40575 ? object 40576 : baseFor(object, getIteratee(iteratee, 3), keysIn); 40577 } 40578 40579 /** 40580 * This method is like `_.forIn` except that it iterates over properties of 40581 * `object` in the opposite order. 40582 * 40583 * @static 40584 * @memberOf _ 40585 * @since 2.0.0 40586 * @category Object 40587 * @param {Object} object The object to iterate over. 40588 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40589 * @returns {Object} Returns `object`. 40590 * @see _.forIn 40591 * @example 40592 * 40593 * function Foo() { 40594 * this.a = 1; 40595 * this.b = 2; 40596 * } 40597 * 40598 * Foo.prototype.c = 3; 40599 * 40600 * _.forInRight(new Foo, function(value, key) { 40601 * console.log(key); 40602 * }); 40603 * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. 40604 */ 40605 function forInRight(object, iteratee) { 40606 return object == null 40607 ? object 40608 : baseForRight(object, getIteratee(iteratee, 3), keysIn); 40609 } 40610 40611 /** 40612 * Iterates over own enumerable string keyed properties of an object and 40613 * invokes `iteratee` for each property. The iteratee is invoked with three 40614 * arguments: (value, key, object). Iteratee functions may exit iteration 40615 * early by explicitly returning `false`. 40616 * 40617 * @static 40618 * @memberOf _ 40619 * @since 0.3.0 40620 * @category Object 40621 * @param {Object} object The object to iterate over. 40622 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40623 * @returns {Object} Returns `object`. 40624 * @see _.forOwnRight 40625 * @example 40626 * 40627 * function Foo() { 40628 * this.a = 1; 40629 * this.b = 2; 40630 * } 40631 * 40632 * Foo.prototype.c = 3; 40633 * 40634 * _.forOwn(new Foo, function(value, key) { 40635 * console.log(key); 40636 * }); 40637 * // => Logs 'a' then 'b' (iteration order is not guaranteed). 40638 */ 40639 function forOwn(object, iteratee) { 40640 return object && baseForOwn(object, getIteratee(iteratee, 3)); 40641 } 40642 40643 /** 40644 * This method is like `_.forOwn` except that it iterates over properties of 40645 * `object` in the opposite order. 40646 * 40647 * @static 40648 * @memberOf _ 40649 * @since 2.0.0 40650 * @category Object 40651 * @param {Object} object The object to iterate over. 40652 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40653 * @returns {Object} Returns `object`. 40654 * @see _.forOwn 40655 * @example 40656 * 40657 * function Foo() { 40658 * this.a = 1; 40659 * this.b = 2; 40660 * } 40661 * 40662 * Foo.prototype.c = 3; 40663 * 40664 * _.forOwnRight(new Foo, function(value, key) { 40665 * console.log(key); 40666 * }); 40667 * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. 40668 */ 40669 function forOwnRight(object, iteratee) { 40670 return object && baseForOwnRight(object, getIteratee(iteratee, 3)); 40671 } 40672 40673 /** 40674 * Creates an array of function property names from own enumerable properties 40675 * of `object`. 40676 * 40677 * @static 40678 * @since 0.1.0 40679 * @memberOf _ 40680 * @category Object 40681 * @param {Object} object The object to inspect. 40682 * @returns {Array} Returns the function names. 40683 * @see _.functionsIn 40684 * @example 40685 * 40686 * function Foo() { 40687 * this.a = _.constant('a'); 40688 * this.b = _.constant('b'); 40689 * } 40690 * 40691 * Foo.prototype.c = _.constant('c'); 40692 * 40693 * _.functions(new Foo); 40694 * // => ['a', 'b'] 40695 */ 40696 function functions(object) { 40697 return object == null ? [] : baseFunctions(object, keys(object)); 40698 } 40699 40700 /** 40701 * Creates an array of function property names from own and inherited 40702 * enumerable properties of `object`. 40703 * 40704 * @static 40705 * @memberOf _ 40706 * @since 4.0.0 40707 * @category Object 40708 * @param {Object} object The object to inspect. 40709 * @returns {Array} Returns the function names. 40710 * @see _.functions 40711 * @example 40712 * 40713 * function Foo() { 40714 * this.a = _.constant('a'); 40715 * this.b = _.constant('b'); 40716 * } 40717 * 40718 * Foo.prototype.c = _.constant('c'); 40719 * 40720 * _.functionsIn(new Foo); 40721 * // => ['a', 'b', 'c'] 40722 */ 40723 function functionsIn(object) { 40724 return object == null ? [] : baseFunctions(object, keysIn(object)); 40725 } 40726 40727 /** 40728 * Gets the value at `path` of `object`. If the resolved value is 40729 * `undefined`, the `defaultValue` is returned in its place. 40730 * 40731 * @static 40732 * @memberOf _ 40733 * @since 3.7.0 40734 * @category Object 40735 * @param {Object} object The object to query. 40736 * @param {Array|string} path The path of the property to get. 40737 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 40738 * @returns {*} Returns the resolved value. 40739 * @example 40740 * 40741 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 40742 * 40743 * _.get(object, 'a[0].b.c'); 40744 * // => 3 40745 * 40746 * _.get(object, ['a', '0', 'b', 'c']); 40747 * // => 3 40748 * 40749 * _.get(object, 'a.b.c', 'default'); 40750 * // => 'default' 40751 */ 40752 function get(object, path, defaultValue) { 40753 var result = object == null ? undefined : baseGet(object, path); 40754 return result === undefined ? defaultValue : result; 40755 } 40756 40757 /** 40758 * Checks if `path` is a direct property of `object`. 40759 * 40760 * @static 40761 * @since 0.1.0 40762 * @memberOf _ 40763 * @category Object 40764 * @param {Object} object The object to query. 40765 * @param {Array|string} path The path to check. 40766 * @returns {boolean} Returns `true` if `path` exists, else `false`. 40767 * @example 40768 * 40769 * var object = { 'a': { 'b': 2 } }; 40770 * var other = _.create({ 'a': _.create({ 'b': 2 }) }); 40771 * 40772 * _.has(object, 'a'); 40773 * // => true 40774 * 40775 * _.has(object, 'a.b'); 40776 * // => true 40777 * 40778 * _.has(object, ['a', 'b']); 40779 * // => true 40780 * 40781 * _.has(other, 'a'); 40782 * // => false 40783 */ 40784 function has(object, path) { 40785 return object != null && hasPath(object, path, baseHas); 40786 } 40787 40788 /** 40789 * Checks if `path` is a direct or inherited property of `object`. 40790 * 40791 * @static 40792 * @memberOf _ 40793 * @since 4.0.0 40794 * @category Object 40795 * @param {Object} object The object to query. 40796 * @param {Array|string} path The path to check. 40797 * @returns {boolean} Returns `true` if `path` exists, else `false`. 40798 * @example 40799 * 40800 * var object = _.create({ 'a': _.create({ 'b': 2 }) }); 40801 * 40802 * _.hasIn(object, 'a'); 40803 * // => true 40804 * 40805 * _.hasIn(object, 'a.b'); 40806 * // => true 40807 * 40808 * _.hasIn(object, ['a', 'b']); 40809 * // => true 40810 * 40811 * _.hasIn(object, 'b'); 40812 * // => false 40813 */ 40814 function hasIn(object, path) { 40815 return object != null && hasPath(object, path, baseHasIn); 40816 } 40817 40818 /** 40819 * Creates an object composed of the inverted keys and values of `object`. 40820 * If `object` contains duplicate values, subsequent values overwrite 40821 * property assignments of previous values. 40822 * 40823 * @static 40824 * @memberOf _ 40825 * @since 0.7.0 40826 * @category Object 40827 * @param {Object} object The object to invert. 40828 * @returns {Object} Returns the new inverted object. 40829 * @example 40830 * 40831 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 40832 * 40833 * _.invert(object); 40834 * // => { '1': 'c', '2': 'b' } 40835 */ 40836 var invert = createInverter(function(result, value, key) { 40837 if (value != null && 40838 typeof value.toString != 'function') { 40839 value = nativeObjectToString.call(value); 40840 } 40841 40842 result[value] = key; 40843 }, constant(identity)); 40844 40845 /** 40846 * This method is like `_.invert` except that the inverted object is generated 40847 * from the results of running each element of `object` thru `iteratee`. The 40848 * corresponding inverted value of each inverted key is an array of keys 40849 * responsible for generating the inverted value. The iteratee is invoked 40850 * with one argument: (value). 40851 * 40852 * @static 40853 * @memberOf _ 40854 * @since 4.1.0 40855 * @category Object 40856 * @param {Object} object The object to invert. 40857 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 40858 * @returns {Object} Returns the new inverted object. 40859 * @example 40860 * 40861 * var object = { 'a': 1, 'b': 2, 'c': 1 }; 40862 * 40863 * _.invertBy(object); 40864 * // => { '1': ['a', 'c'], '2': ['b'] } 40865 * 40866 * _.invertBy(object, function(value) { 40867 * return 'group' + value; 40868 * }); 40869 * // => { 'group1': ['a', 'c'], 'group2': ['b'] } 40870 */ 40871 var invertBy = createInverter(function(result, value, key) { 40872 if (value != null && 40873 typeof value.toString != 'function') { 40874 value = nativeObjectToString.call(value); 40875 } 40876 40877 if (hasOwnProperty.call(result, value)) { 40878 result[value].push(key); 40879 } else { 40880 result[value] = [key]; 40881 } 40882 }, getIteratee); 40883 40884 /** 40885 * Invokes the method at `path` of `object`. 40886 * 40887 * @static 40888 * @memberOf _ 40889 * @since 4.0.0 40890 * @category Object 40891 * @param {Object} object The object to query. 40892 * @param {Array|string} path The path of the method to invoke. 40893 * @param {...*} [args] The arguments to invoke the method with. 40894 * @returns {*} Returns the result of the invoked method. 40895 * @example 40896 * 40897 * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; 40898 * 40899 * _.invoke(object, 'a[0].b.c.slice', 1, 3); 40900 * // => [2, 3] 40901 */ 40902 var invoke = baseRest(baseInvoke); 40903 40904 /** 40905 * Creates an array of the own enumerable property names of `object`. 40906 * 40907 * **Note:** Non-object values are coerced to objects. See the 40908 * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) 40909 * for more details. 40910 * 40911 * @static 40912 * @since 0.1.0 40913 * @memberOf _ 40914 * @category Object 40915 * @param {Object} object The object to query. 40916 * @returns {Array} Returns the array of property names. 40917 * @example 40918 * 40919 * function Foo() { 40920 * this.a = 1; 40921 * this.b = 2; 40922 * } 40923 * 40924 * Foo.prototype.c = 3; 40925 * 40926 * _.keys(new Foo); 40927 * // => ['a', 'b'] (iteration order is not guaranteed) 40928 * 40929 * _.keys('hi'); 40930 * // => ['0', '1'] 40931 */ 40932 function keys(object) { 40933 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 40934 } 40935 40936 /** 40937 * Creates an array of the own and inherited enumerable property names of `object`. 40938 * 40939 * **Note:** Non-object values are coerced to objects. 40940 * 40941 * @static 40942 * @memberOf _ 40943 * @since 3.0.0 40944 * @category Object 40945 * @param {Object} object The object to query. 40946 * @returns {Array} Returns the array of property names. 40947 * @example 40948 * 40949 * function Foo() { 40950 * this.a = 1; 40951 * this.b = 2; 40952 * } 40953 * 40954 * Foo.prototype.c = 3; 40955 * 40956 * _.keysIn(new Foo); 40957 * // => ['a', 'b', 'c'] (iteration order is not guaranteed) 40958 */ 40959 function keysIn(object) { 40960 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 40961 } 40962 40963 /** 40964 * The opposite of `_.mapValues`; this method creates an object with the 40965 * same values as `object` and keys generated by running each own enumerable 40966 * string keyed property of `object` thru `iteratee`. The iteratee is invoked 40967 * with three arguments: (value, key, object). 40968 * 40969 * @static 40970 * @memberOf _ 40971 * @since 3.8.0 40972 * @category Object 40973 * @param {Object} object The object to iterate over. 40974 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 40975 * @returns {Object} Returns the new mapped object. 40976 * @see _.mapValues 40977 * @example 40978 * 40979 * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { 40980 * return key + value; 40981 * }); 40982 * // => { 'a1': 1, 'b2': 2 } 40983 */ 40984 function mapKeys(object, iteratee) { 40985 var result = {}; 40986 iteratee = getIteratee(iteratee, 3); 40987 40988 baseForOwn(object, function(value, key, object) { 40989 baseAssignValue(result, iteratee(value, key, object), value); 40990 }); 40991 return result; 40992 } 40993 40994 /** 40995 * Creates an object with the same keys as `object` and values generated 40996 * by running each own enumerable string keyed property of `object` thru 40997 * `iteratee`. The iteratee is invoked with three arguments: 40998 * (value, key, object). 40999 * 41000 * @static 41001 * @memberOf _ 41002 * @since 2.4.0 41003 * @category Object 41004 * @param {Object} object The object to iterate over. 41005 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 41006 * @returns {Object} Returns the new mapped object. 41007 * @see _.mapKeys 41008 * @example 41009 * 41010 * var users = { 41011 * 'fred': { 'user': 'fred', 'age': 40 }, 41012 * 'pebbles': { 'user': 'pebbles', 'age': 1 } 41013 * }; 41014 * 41015 * _.mapValues(users, function(o) { return o.age; }); 41016 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 41017 * 41018 * // The `_.property` iteratee shorthand. 41019 * _.mapValues(users, 'age'); 41020 * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) 41021 */ 41022 function mapValues(object, iteratee) { 41023 var result = {}; 41024 iteratee = getIteratee(iteratee, 3); 41025 41026 baseForOwn(object, function(value, key, object) { 41027 baseAssignValue(result, key, iteratee(value, key, object)); 41028 }); 41029 return result; 41030 } 41031 41032 /** 41033 * This method is like `_.assign` except that it recursively merges own and 41034 * inherited enumerable string keyed properties of source objects into the 41035 * destination object. Source properties that resolve to `undefined` are 41036 * skipped if a destination value exists. Array and plain object properties 41037 * are merged recursively. Other objects and value types are overridden by 41038 * assignment. Source objects are applied from left to right. Subsequent 41039 * sources overwrite property assignments of previous sources. 41040 * 41041 * **Note:** This method mutates `object`. 41042 * 41043 * @static 41044 * @memberOf _ 41045 * @since 0.5.0 41046 * @category Object 41047 * @param {Object} object The destination object. 41048 * @param {...Object} [sources] The source objects. 41049 * @returns {Object} Returns `object`. 41050 * @example 41051 * 41052 * var object = { 41053 * 'a': [{ 'b': 2 }, { 'd': 4 }] 41054 * }; 41055 * 41056 * var other = { 41057 * 'a': [{ 'c': 3 }, { 'e': 5 }] 41058 * }; 41059 * 41060 * _.merge(object, other); 41061 * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } 41062 */ 41063 var merge = createAssigner(function(object, source, srcIndex) { 41064 baseMerge(object, source, srcIndex); 41065 }); 41066 41067 /** 41068 * This method is like `_.merge` except that it accepts `customizer` which 41069 * is invoked to produce the merged values of the destination and source 41070 * properties. If `customizer` returns `undefined`, merging is handled by the 41071 * method instead. The `customizer` is invoked with six arguments: 41072 * (objValue, srcValue, key, object, source, stack). 41073 * 41074 * **Note:** This method mutates `object`. 41075 * 41076 * @static 41077 * @memberOf _ 41078 * @since 4.0.0 41079 * @category Object 41080 * @param {Object} object The destination object. 41081 * @param {...Object} sources The source objects. 41082 * @param {Function} customizer The function to customize assigned values. 41083 * @returns {Object} Returns `object`. 41084 * @example 41085 * 41086 * function customizer(objValue, srcValue) { 41087 * if (_.isArray(objValue)) { 41088 * return objValue.concat(srcValue); 41089 * } 41090 * } 41091 * 41092 * var object = { 'a': [1], 'b': [2] }; 41093 * var other = { 'a': [3], 'b': [4] }; 41094 * 41095 * _.mergeWith(object, other, customizer); 41096 * // => { 'a': [1, 3], 'b': [2, 4] } 41097 */ 41098 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { 41099 baseMerge(object, source, srcIndex, customizer); 41100 }); 41101 41102 /** 41103 * The opposite of `_.pick`; this method creates an object composed of the 41104 * own and inherited enumerable property paths of `object` that are not omitted. 41105 * 41106 * **Note:** This method is considerably slower than `_.pick`. 41107 * 41108 * @static 41109 * @since 0.1.0 41110 * @memberOf _ 41111 * @category Object 41112 * @param {Object} object The source object. 41113 * @param {...(string|string[])} [paths] The property paths to omit. 41114 * @returns {Object} Returns the new object. 41115 * @example 41116 * 41117 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41118 * 41119 * _.omit(object, ['a', 'c']); 41120 * // => { 'b': '2' } 41121 */ 41122 var omit = flatRest(function(object, paths) { 41123 var result = {}; 41124 if (object == null) { 41125 return result; 41126 } 41127 var isDeep = false; 41128 paths = arrayMap(paths, function(path) { 41129 path = castPath(path, object); 41130 isDeep || (isDeep = path.length > 1); 41131 return path; 41132 }); 41133 copyObject(object, getAllKeysIn(object), result); 41134 if (isDeep) { 41135 result = baseClone(result, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); 41136 } 41137 var length = paths.length; 41138 while (length--) { 41139 baseUnset(result, paths[length]); 41140 } 41141 return result; 41142 }); 41143 41144 /** 41145 * The opposite of `_.pickBy`; this method creates an object composed of 41146 * the own and inherited enumerable string keyed properties of `object` that 41147 * `predicate` doesn't return truthy for. The predicate is invoked with two 41148 * arguments: (value, key). 41149 * 41150 * @static 41151 * @memberOf _ 41152 * @since 4.0.0 41153 * @category Object 41154 * @param {Object} object The source object. 41155 * @param {Function} [predicate=_.identity] The function invoked per property. 41156 * @returns {Object} Returns the new object. 41157 * @example 41158 * 41159 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41160 * 41161 * _.omitBy(object, _.isNumber); 41162 * // => { 'b': '2' } 41163 */ 41164 function omitBy(object, predicate) { 41165 return pickBy(object, negate(getIteratee(predicate))); 41166 } 41167 41168 /** 41169 * Creates an object composed of the picked `object` properties. 41170 * 41171 * @static 41172 * @since 0.1.0 41173 * @memberOf _ 41174 * @category Object 41175 * @param {Object} object The source object. 41176 * @param {...(string|string[])} [paths] The property paths to pick. 41177 * @returns {Object} Returns the new object. 41178 * @example 41179 * 41180 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41181 * 41182 * _.pick(object, ['a', 'c']); 41183 * // => { 'a': 1, 'c': 3 } 41184 */ 41185 var pick = flatRest(function(object, paths) { 41186 return object == null ? {} : basePick(object, paths); 41187 }); 41188 41189 /** 41190 * Creates an object composed of the `object` properties `predicate` returns 41191 * truthy for. The predicate is invoked with two arguments: (value, key). 41192 * 41193 * @static 41194 * @memberOf _ 41195 * @since 4.0.0 41196 * @category Object 41197 * @param {Object} object The source object. 41198 * @param {Function} [predicate=_.identity] The function invoked per property. 41199 * @returns {Object} Returns the new object. 41200 * @example 41201 * 41202 * var object = { 'a': 1, 'b': '2', 'c': 3 }; 41203 * 41204 * _.pickBy(object, _.isNumber); 41205 * // => { 'a': 1, 'c': 3 } 41206 */ 41207 function pickBy(object, predicate) { 41208 if (object == null) { 41209 return {}; 41210 } 41211 var props = arrayMap(getAllKeysIn(object), function(prop) { 41212 return [prop]; 41213 }); 41214 predicate = getIteratee(predicate); 41215 return basePickBy(object, props, function(value, path) { 41216 return predicate(value, path[0]); 41217 }); 41218 } 41219 41220 /** 41221 * This method is like `_.get` except that if the resolved value is a 41222 * function it's invoked with the `this` binding of its parent object and 41223 * its result is returned. 41224 * 41225 * @static 41226 * @since 0.1.0 41227 * @memberOf _ 41228 * @category Object 41229 * @param {Object} object The object to query. 41230 * @param {Array|string} path The path of the property to resolve. 41231 * @param {*} [defaultValue] The value returned for `undefined` resolved values. 41232 * @returns {*} Returns the resolved value. 41233 * @example 41234 * 41235 * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; 41236 * 41237 * _.result(object, 'a[0].b.c1'); 41238 * // => 3 41239 * 41240 * _.result(object, 'a[0].b.c2'); 41241 * // => 4 41242 * 41243 * _.result(object, 'a[0].b.c3', 'default'); 41244 * // => 'default' 41245 * 41246 * _.result(object, 'a[0].b.c3', _.constant('default')); 41247 * // => 'default' 41248 */ 41249 function result(object, path, defaultValue) { 41250 path = castPath(path, object); 41251 41252 var index = -1, 41253 length = path.length; 41254 41255 // Ensure the loop is entered when path is empty. 41256 if (!length) { 41257 length = 1; 41258 object = undefined; 41259 } 41260 while (++index < length) { 41261 var value = object == null ? undefined : object[toKey(path[index])]; 41262 if (value === undefined) { 41263 index = length; 41264 value = defaultValue; 41265 } 41266 object = isFunction(value) ? value.call(object) : value; 41267 } 41268 return object; 41269 } 41270 41271 /** 41272 * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, 41273 * it's created. Arrays are created for missing index properties while objects 41274 * are created for all other missing properties. Use `_.setWith` to customize 41275 * `path` creation. 41276 * 41277 * **Note:** This method mutates `object`. 41278 * 41279 * @static 41280 * @memberOf _ 41281 * @since 3.7.0 41282 * @category Object 41283 * @param {Object} object The object to modify. 41284 * @param {Array|string} path The path of the property to set. 41285 * @param {*} value The value to set. 41286 * @returns {Object} Returns `object`. 41287 * @example 41288 * 41289 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 41290 * 41291 * _.set(object, 'a[0].b.c', 4); 41292 * console.log(object.a[0].b.c); 41293 * // => 4 41294 * 41295 * _.set(object, ['x', '0', 'y', 'z'], 5); 41296 * console.log(object.x[0].y.z); 41297 * // => 5 41298 */ 41299 function set(object, path, value) { 41300 return object == null ? object : baseSet(object, path, value); 41301 } 41302 41303 /** 41304 * This method is like `_.set` except that it accepts `customizer` which is 41305 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 41306 * path creation is handled by the method instead. The `customizer` is invoked 41307 * with three arguments: (nsValue, key, nsObject). 41308 * 41309 * **Note:** This method mutates `object`. 41310 * 41311 * @static 41312 * @memberOf _ 41313 * @since 4.0.0 41314 * @category Object 41315 * @param {Object} object The object to modify. 41316 * @param {Array|string} path The path of the property to set. 41317 * @param {*} value The value to set. 41318 * @param {Function} [customizer] The function to customize assigned values. 41319 * @returns {Object} Returns `object`. 41320 * @example 41321 * 41322 * var object = {}; 41323 * 41324 * _.setWith(object, '[0][1]', 'a', Object); 41325 * // => { '0': { '1': 'a' } } 41326 */ 41327 function setWith(object, path, value, customizer) { 41328 customizer = typeof customizer == 'function' ? customizer : undefined; 41329 return object == null ? object : baseSet(object, path, value, customizer); 41330 } 41331 41332 /** 41333 * Creates an array of own enumerable string keyed-value pairs for `object` 41334 * which can be consumed by `_.fromPairs`. If `object` is a map or set, its 41335 * entries are returned. 41336 * 41337 * @static 41338 * @memberOf _ 41339 * @since 4.0.0 41340 * @alias entries 41341 * @category Object 41342 * @param {Object} object The object to query. 41343 * @returns {Array} Returns the key-value pairs. 41344 * @example 41345 * 41346 * function Foo() { 41347 * this.a = 1; 41348 * this.b = 2; 41349 * } 41350 * 41351 * Foo.prototype.c = 3; 41352 * 41353 * _.toPairs(new Foo); 41354 * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) 41355 */ 41356 var toPairs = createToPairs(keys); 41357 41358 /** 41359 * Creates an array of own and inherited enumerable string keyed-value pairs 41360 * for `object` which can be consumed by `_.fromPairs`. If `object` is a map 41361 * or set, its entries are returned. 41362 * 41363 * @static 41364 * @memberOf _ 41365 * @since 4.0.0 41366 * @alias entriesIn 41367 * @category Object 41368 * @param {Object} object The object to query. 41369 * @returns {Array} Returns the key-value pairs. 41370 * @example 41371 * 41372 * function Foo() { 41373 * this.a = 1; 41374 * this.b = 2; 41375 * } 41376 * 41377 * Foo.prototype.c = 3; 41378 * 41379 * _.toPairsIn(new Foo); 41380 * // => [['a', 1], ['b', 2], ['c', 3]] (iteration order is not guaranteed) 41381 */ 41382 var toPairsIn = createToPairs(keysIn); 41383 41384 /** 41385 * An alternative to `_.reduce`; this method transforms `object` to a new 41386 * `accumulator` object which is the result of running each of its own 41387 * enumerable string keyed properties thru `iteratee`, with each invocation 41388 * potentially mutating the `accumulator` object. If `accumulator` is not 41389 * provided, a new object with the same `[[Prototype]]` will be used. The 41390 * iteratee is invoked with four arguments: (accumulator, value, key, object). 41391 * Iteratee functions may exit iteration early by explicitly returning `false`. 41392 * 41393 * @static 41394 * @memberOf _ 41395 * @since 1.3.0 41396 * @category Object 41397 * @param {Object} object The object to iterate over. 41398 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 41399 * @param {*} [accumulator] The custom accumulator value. 41400 * @returns {*} Returns the accumulated value. 41401 * @example 41402 * 41403 * _.transform([2, 3, 4], function(result, n) { 41404 * result.push(n *= n); 41405 * return n % 2 == 0; 41406 * }, []); 41407 * // => [4, 9] 41408 * 41409 * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { 41410 * (result[value] || (result[value] = [])).push(key); 41411 * }, {}); 41412 * // => { '1': ['a', 'c'], '2': ['b'] } 41413 */ 41414 function transform(object, iteratee, accumulator) { 41415 var isArr = isArray(object), 41416 isArrLike = isArr || isBuffer(object) || isTypedArray(object); 41417 41418 iteratee = getIteratee(iteratee, 4); 41419 if (accumulator == null) { 41420 var Ctor = object && object.constructor; 41421 if (isArrLike) { 41422 accumulator = isArr ? new Ctor : []; 41423 } 41424 else if (isObject(object)) { 41425 accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; 41426 } 41427 else { 41428 accumulator = {}; 41429 } 41430 } 41431 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { 41432 return iteratee(accumulator, value, index, object); 41433 }); 41434 return accumulator; 41435 } 41436 41437 /** 41438 * Removes the property at `path` of `object`. 41439 * 41440 * **Note:** This method mutates `object`. 41441 * 41442 * @static 41443 * @memberOf _ 41444 * @since 4.0.0 41445 * @category Object 41446 * @param {Object} object The object to modify. 41447 * @param {Array|string} path The path of the property to unset. 41448 * @returns {boolean} Returns `true` if the property is deleted, else `false`. 41449 * @example 41450 * 41451 * var object = { 'a': [{ 'b': { 'c': 7 } }] }; 41452 * _.unset(object, 'a[0].b.c'); 41453 * // => true 41454 * 41455 * console.log(object); 41456 * // => { 'a': [{ 'b': {} }] }; 41457 * 41458 * _.unset(object, ['a', '0', 'b', 'c']); 41459 * // => true 41460 * 41461 * console.log(object); 41462 * // => { 'a': [{ 'b': {} }] }; 41463 */ 41464 function unset(object, path) { 41465 return object == null ? true : baseUnset(object, path); 41466 } 41467 41468 /** 41469 * This method is like `_.set` except that accepts `updater` to produce the 41470 * value to set. Use `_.updateWith` to customize `path` creation. The `updater` 41471 * is invoked with one argument: (value). 41472 * 41473 * **Note:** This method mutates `object`. 41474 * 41475 * @static 41476 * @memberOf _ 41477 * @since 4.6.0 41478 * @category Object 41479 * @param {Object} object The object to modify. 41480 * @param {Array|string} path The path of the property to set. 41481 * @param {Function} updater The function to produce the updated value. 41482 * @returns {Object} Returns `object`. 41483 * @example 41484 * 41485 * var object = { 'a': [{ 'b': { 'c': 3 } }] }; 41486 * 41487 * _.update(object, 'a[0].b.c', function(n) { return n * n; }); 41488 * console.log(object.a[0].b.c); 41489 * // => 9 41490 * 41491 * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); 41492 * console.log(object.x[0].y.z); 41493 * // => 0 41494 */ 41495 function update(object, path, updater) { 41496 return object == null ? object : baseUpdate(object, path, castFunction(updater)); 41497 } 41498 41499 /** 41500 * This method is like `_.update` except that it accepts `customizer` which is 41501 * invoked to produce the objects of `path`. If `customizer` returns `undefined` 41502 * path creation is handled by the method instead. The `customizer` is invoked 41503 * with three arguments: (nsValue, key, nsObject). 41504 * 41505 * **Note:** This method mutates `object`. 41506 * 41507 * @static 41508 * @memberOf _ 41509 * @since 4.6.0 41510 * @category Object 41511 * @param {Object} object The object to modify. 41512 * @param {Array|string} path The path of the property to set. 41513 * @param {Function} updater The function to produce the updated value. 41514 * @param {Function} [customizer] The function to customize assigned values. 41515 * @returns {Object} Returns `object`. 41516 * @example 41517 * 41518 * var object = {}; 41519 * 41520 * _.updateWith(object, '[0][1]', _.constant('a'), Object); 41521 * // => { '0': { '1': 'a' } } 41522 */ 41523 function updateWith(object, path, updater, customizer) { 41524 customizer = typeof customizer == 'function' ? customizer : undefined; 41525 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); 41526 } 41527 41528 /** 41529 * Creates an array of the own enumerable string keyed property values of `object`. 41530 * 41531 * **Note:** Non-object values are coerced to objects. 41532 * 41533 * @static 41534 * @since 0.1.0 41535 * @memberOf _ 41536 * @category Object 41537 * @param {Object} object The object to query. 41538 * @returns {Array} Returns the array of property values. 41539 * @example 41540 * 41541 * function Foo() { 41542 * this.a = 1; 41543 * this.b = 2; 41544 * } 41545 * 41546 * Foo.prototype.c = 3; 41547 * 41548 * _.values(new Foo); 41549 * // => [1, 2] (iteration order is not guaranteed) 41550 * 41551 * _.values('hi'); 41552 * // => ['h', 'i'] 41553 */ 41554 function values(object) { 41555 return object == null ? [] : baseValues(object, keys(object)); 41556 } 41557 41558 /** 41559 * Creates an array of the own and inherited enumerable string keyed property 41560 * values of `object`. 41561 * 41562 * **Note:** Non-object values are coerced to objects. 41563 * 41564 * @static 41565 * @memberOf _ 41566 * @since 3.0.0 41567 * @category Object 41568 * @param {Object} object The object to query. 41569 * @returns {Array} Returns the array of property values. 41570 * @example 41571 * 41572 * function Foo() { 41573 * this.a = 1; 41574 * this.b = 2; 41575 * } 41576 * 41577 * Foo.prototype.c = 3; 41578 * 41579 * _.valuesIn(new Foo); 41580 * // => [1, 2, 3] (iteration order is not guaranteed) 41581 */ 41582 function valuesIn(object) { 41583 return object == null ? [] : baseValues(object, keysIn(object)); 41584 } 41585 41586 /*------------------------------------------------------------------------*/ 41587 41588 /** 41589 * Clamps `number` within the inclusive `lower` and `upper` bounds. 41590 * 41591 * @static 41592 * @memberOf _ 41593 * @since 4.0.0 41594 * @category Number 41595 * @param {number} number The number to clamp. 41596 * @param {number} [lower] The lower bound. 41597 * @param {number} upper The upper bound. 41598 * @returns {number} Returns the clamped number. 41599 * @example 41600 * 41601 * _.clamp(-10, -5, 5); 41602 * // => -5 41603 * 41604 * _.clamp(10, -5, 5); 41605 * // => 5 41606 */ 41607 function clamp(number, lower, upper) { 41608 if (upper === undefined) { 41609 upper = lower; 41610 lower = undefined; 41611 } 41612 if (upper !== undefined) { 41613 upper = toNumber(upper); 41614 upper = upper === upper ? upper : 0; 41615 } 41616 if (lower !== undefined) { 41617 lower = toNumber(lower); 41618 lower = lower === lower ? lower : 0; 41619 } 41620 return baseClamp(toNumber(number), lower, upper); 41621 } 41622 41623 /** 41624 * Checks if `n` is between `start` and up to, but not including, `end`. If 41625 * `end` is not specified, it's set to `start` with `start` then set to `0`. 41626 * If `start` is greater than `end` the params are swapped to support 41627 * negative ranges. 41628 * 41629 * @static 41630 * @memberOf _ 41631 * @since 3.3.0 41632 * @category Number 41633 * @param {number} number The number to check. 41634 * @param {number} [start=0] The start of the range. 41635 * @param {number} end The end of the range. 41636 * @returns {boolean} Returns `true` if `number` is in the range, else `false`. 41637 * @see _.range, _.rangeRight 41638 * @example 41639 * 41640 * _.inRange(3, 2, 4); 41641 * // => true 41642 * 41643 * _.inRange(4, 8); 41644 * // => true 41645 * 41646 * _.inRange(4, 2); 41647 * // => false 41648 * 41649 * _.inRange(2, 2); 41650 * // => false 41651 * 41652 * _.inRange(1.2, 2); 41653 * // => true 41654 * 41655 * _.inRange(5.2, 4); 41656 * // => false 41657 * 41658 * _.inRange(-3, -2, -6); 41659 * // => true 41660 */ 41661 function inRange(number, start, end) { 41662 start = toFinite(start); 41663 if (end === undefined) { 41664 end = start; 41665 start = 0; 41666 } else { 41667 end = toFinite(end); 41668 } 41669 number = toNumber(number); 41670 return baseInRange(number, start, end); 41671 } 41672 41673 /** 41674 * Produces a random number between the inclusive `lower` and `upper` bounds. 41675 * If only one argument is provided a number between `0` and the given number 41676 * is returned. If `floating` is `true`, or either `lower` or `upper` are 41677 * floats, a floating-point number is returned instead of an integer. 41678 * 41679 * **Note:** JavaScript follows the IEEE-754 standard for resolving 41680 * floating-point values which can produce unexpected results. 41681 * 41682 * @static 41683 * @memberOf _ 41684 * @since 0.7.0 41685 * @category Number 41686 * @param {number} [lower=0] The lower bound. 41687 * @param {number} [upper=1] The upper bound. 41688 * @param {boolean} [floating] Specify returning a floating-point number. 41689 * @returns {number} Returns the random number. 41690 * @example 41691 * 41692 * _.random(0, 5); 41693 * // => an integer between 0 and 5 41694 * 41695 * _.random(5); 41696 * // => also an integer between 0 and 5 41697 * 41698 * _.random(5, true); 41699 * // => a floating-point number between 0 and 5 41700 * 41701 * _.random(1.2, 5.2); 41702 * // => a floating-point number between 1.2 and 5.2 41703 */ 41704 function random(lower, upper, floating) { 41705 if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { 41706 upper = floating = undefined; 41707 } 41708 if (floating === undefined) { 41709 if (typeof upper == 'boolean') { 41710 floating = upper; 41711 upper = undefined; 41712 } 41713 else if (typeof lower == 'boolean') { 41714 floating = lower; 41715 lower = undefined; 41716 } 41717 } 41718 if (lower === undefined && upper === undefined) { 41719 lower = 0; 41720 upper = 1; 41721 } 41722 else { 41723 lower = toFinite(lower); 41724 if (upper === undefined) { 41725 upper = lower; 41726 lower = 0; 41727 } else { 41728 upper = toFinite(upper); 41729 } 41730 } 41731 if (lower > upper) { 41732 var temp = lower; 41733 lower = upper; 41734 upper = temp; 41735 } 41736 if (floating || lower % 1 || upper % 1) { 41737 var rand = nativeRandom(); 41738 return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); 41739 } 41740 return baseRandom(lower, upper); 41741 } 41742 41743 /*------------------------------------------------------------------------*/ 41744 41745 /** 41746 * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). 41747 * 41748 * @static 41749 * @memberOf _ 41750 * @since 3.0.0 41751 * @category String 41752 * @param {string} [string=''] The string to convert. 41753 * @returns {string} Returns the camel cased string. 41754 * @example 41755 * 41756 * _.camelCase('Foo Bar'); 41757 * // => 'fooBar' 41758 * 41759 * _.camelCase('--foo-bar--'); 41760 * // => 'fooBar' 41761 * 41762 * _.camelCase('__FOO_BAR__'); 41763 * // => 'fooBar' 41764 */ 41765 var camelCase = createCompounder(function(result, word, index) { 41766 word = word.toLowerCase(); 41767 return result + (index ? capitalize(word) : word); 41768 }); 41769 41770 /** 41771 * Converts the first character of `string` to upper case and the remaining 41772 * to lower case. 41773 * 41774 * @static 41775 * @memberOf _ 41776 * @since 3.0.0 41777 * @category String 41778 * @param {string} [string=''] The string to capitalize. 41779 * @returns {string} Returns the capitalized string. 41780 * @example 41781 * 41782 * _.capitalize('FRED'); 41783 * // => 'Fred' 41784 */ 41785 function capitalize(string) { 41786 return upperFirst(toString(string).toLowerCase()); 41787 } 41788 41789 /** 41790 * Deburrs `string` by converting 41791 * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) 41792 * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) 41793 * letters to basic Latin letters and removing 41794 * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). 41795 * 41796 * @static 41797 * @memberOf _ 41798 * @since 3.0.0 41799 * @category String 41800 * @param {string} [string=''] The string to deburr. 41801 * @returns {string} Returns the deburred string. 41802 * @example 41803 * 41804 * _.deburr('déjà vu'); 41805 * // => 'deja vu' 41806 */ 41807 function deburr(string) { 41808 string = toString(string); 41809 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); 41810 } 41811 41812 /** 41813 * Checks if `string` ends with the given target string. 41814 * 41815 * @static 41816 * @memberOf _ 41817 * @since 3.0.0 41818 * @category String 41819 * @param {string} [string=''] The string to inspect. 41820 * @param {string} [target] The string to search for. 41821 * @param {number} [position=string.length] The position to search up to. 41822 * @returns {boolean} Returns `true` if `string` ends with `target`, 41823 * else `false`. 41824 * @example 41825 * 41826 * _.endsWith('abc', 'c'); 41827 * // => true 41828 * 41829 * _.endsWith('abc', 'b'); 41830 * // => false 41831 * 41832 * _.endsWith('abc', 'b', 2); 41833 * // => true 41834 */ 41835 function endsWith(string, target, position) { 41836 string = toString(string); 41837 target = baseToString(target); 41838 41839 var length = string.length; 41840 position = position === undefined 41841 ? length 41842 : baseClamp(toInteger(position), 0, length); 41843 41844 var end = position; 41845 position -= target.length; 41846 return position >= 0 && string.slice(position, end) == target; 41847 } 41848 41849 /** 41850 * Converts the characters "&", "<", ">", '"', and "'" in `string` to their 41851 * corresponding HTML entities. 41852 * 41853 * **Note:** No other characters are escaped. To escape additional 41854 * characters use a third-party library like [_he_](https://mths.be/he). 41855 * 41856 * Though the ">" character is escaped for symmetry, characters like 41857 * ">" and "/" don't need escaping in HTML and have no special meaning 41858 * unless they're part of a tag or unquoted attribute value. See 41859 * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) 41860 * (under "semi-related fun fact") for more details. 41861 * 41862 * When working with HTML you should always 41863 * [quote attribute values](http://wonko.com/post/html-escaping) to reduce 41864 * XSS vectors. 41865 * 41866 * @static 41867 * @since 0.1.0 41868 * @memberOf _ 41869 * @category String 41870 * @param {string} [string=''] The string to escape. 41871 * @returns {string} Returns the escaped string. 41872 * @example 41873 * 41874 * _.escape('fred, barney, & pebbles'); 41875 * // => 'fred, barney, & pebbles' 41876 */ 41877 function escape(string) { 41878 string = toString(string); 41879 return (string && reHasUnescapedHtml.test(string)) 41880 ? string.replace(reUnescapedHtml, escapeHtmlChar) 41881 : string; 41882 } 41883 41884 /** 41885 * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", 41886 * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. 41887 * 41888 * @static 41889 * @memberOf _ 41890 * @since 3.0.0 41891 * @category String 41892 * @param {string} [string=''] The string to escape. 41893 * @returns {string} Returns the escaped string. 41894 * @example 41895 * 41896 * _.escapeRegExp('[lodash](https://lodash.com/)'); 41897 * // => '\[lodash\]\(https://lodash\.com/\)' 41898 */ 41899 function escapeRegExp(string) { 41900 string = toString(string); 41901 return (string && reHasRegExpChar.test(string)) 41902 ? string.replace(reRegExpChar, '\\$&') 41903 : string; 41904 } 41905 41906 /** 41907 * Converts `string` to 41908 * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). 41909 * 41910 * @static 41911 * @memberOf _ 41912 * @since 3.0.0 41913 * @category String 41914 * @param {string} [string=''] The string to convert. 41915 * @returns {string} Returns the kebab cased string. 41916 * @example 41917 * 41918 * _.kebabCase('Foo Bar'); 41919 * // => 'foo-bar' 41920 * 41921 * _.kebabCase('fooBar'); 41922 * // => 'foo-bar' 41923 * 41924 * _.kebabCase('__FOO_BAR__'); 41925 * // => 'foo-bar' 41926 */ 41927 var kebabCase = createCompounder(function(result, word, index) { 41928 return result + (index ? '-' : '') + word.toLowerCase(); 41929 }); 41930 41931 /** 41932 * Converts `string`, as space separated words, to lower case. 41933 * 41934 * @static 41935 * @memberOf _ 41936 * @since 4.0.0 41937 * @category String 41938 * @param {string} [string=''] The string to convert. 41939 * @returns {string} Returns the lower cased string. 41940 * @example 41941 * 41942 * _.lowerCase('--Foo-Bar--'); 41943 * // => 'foo bar' 41944 * 41945 * _.lowerCase('fooBar'); 41946 * // => 'foo bar' 41947 * 41948 * _.lowerCase('__FOO_BAR__'); 41949 * // => 'foo bar' 41950 */ 41951 var lowerCase = createCompounder(function(result, word, index) { 41952 return result + (index ? ' ' : '') + word.toLowerCase(); 41953 }); 41954 41955 /** 41956 * Converts the first character of `string` to lower case. 41957 * 41958 * @static 41959 * @memberOf _ 41960 * @since 4.0.0 41961 * @category String 41962 * @param {string} [string=''] The string to convert. 41963 * @returns {string} Returns the converted string. 41964 * @example 41965 * 41966 * _.lowerFirst('Fred'); 41967 * // => 'fred' 41968 * 41969 * _.lowerFirst('FRED'); 41970 * // => 'fRED' 41971 */ 41972 var lowerFirst = createCaseFirst('toLowerCase'); 41973 41974 /** 41975 * Pads `string` on the left and right sides if it's shorter than `length`. 41976 * Padding characters are truncated if they can't be evenly divided by `length`. 41977 * 41978 * @static 41979 * @memberOf _ 41980 * @since 3.0.0 41981 * @category String 41982 * @param {string} [string=''] The string to pad. 41983 * @param {number} [length=0] The padding length. 41984 * @param {string} [chars=' '] The string used as padding. 41985 * @returns {string} Returns the padded string. 41986 * @example 41987 * 41988 * _.pad('abc', 8); 41989 * // => ' abc ' 41990 * 41991 * _.pad('abc', 8, '_-'); 41992 * // => '_-abc_-_' 41993 * 41994 * _.pad('abc', 3); 41995 * // => 'abc' 41996 */ 41997 function pad(string, length, chars) { 41998 string = toString(string); 41999 length = toInteger(length); 42000 42001 var strLength = length ? stringSize(string) : 0; 42002 if (!length || strLength >= length) { 42003 return string; 42004 } 42005 var mid = (length - strLength) / 2; 42006 return ( 42007 createPadding(nativeFloor(mid), chars) + 42008 string + 42009 createPadding(nativeCeil(mid), chars) 42010 ); 42011 } 42012 42013 /** 42014 * Pads `string` on the right side if it's shorter than `length`. Padding 42015 * characters are truncated if they exceed `length`. 42016 * 42017 * @static 42018 * @memberOf _ 42019 * @since 4.0.0 42020 * @category String 42021 * @param {string} [string=''] The string to pad. 42022 * @param {number} [length=0] The padding length. 42023 * @param {string} [chars=' '] The string used as padding. 42024 * @returns {string} Returns the padded string. 42025 * @example 42026 * 42027 * _.padEnd('abc', 6); 42028 * // => 'abc ' 42029 * 42030 * _.padEnd('abc', 6, '_-'); 42031 * // => 'abc_-_' 42032 * 42033 * _.padEnd('abc', 3); 42034 * // => 'abc' 42035 */ 42036 function padEnd(string, length, chars) { 42037 string = toString(string); 42038 length = toInteger(length); 42039 42040 var strLength = length ? stringSize(string) : 0; 42041 return (length && strLength < length) 42042 ? (string + createPadding(length - strLength, chars)) 42043 : string; 42044 } 42045 42046 /** 42047 * Pads `string` on the left side if it's shorter than `length`. Padding 42048 * characters are truncated if they exceed `length`. 42049 * 42050 * @static 42051 * @memberOf _ 42052 * @since 4.0.0 42053 * @category String 42054 * @param {string} [string=''] The string to pad. 42055 * @param {number} [length=0] The padding length. 42056 * @param {string} [chars=' '] The string used as padding. 42057 * @returns {string} Returns the padded string. 42058 * @example 42059 * 42060 * _.padStart('abc', 6); 42061 * // => ' abc' 42062 * 42063 * _.padStart('abc', 6, '_-'); 42064 * // => '_-_abc' 42065 * 42066 * _.padStart('abc', 3); 42067 * // => 'abc' 42068 */ 42069 function padStart(string, length, chars) { 42070 string = toString(string); 42071 length = toInteger(length); 42072 42073 var strLength = length ? stringSize(string) : 0; 42074 return (length && strLength < length) 42075 ? (createPadding(length - strLength, chars) + string) 42076 : string; 42077 } 42078 42079 /** 42080 * Converts `string` to an integer of the specified radix. If `radix` is 42081 * `undefined` or `0`, a `radix` of `10` is used unless `value` is a 42082 * hexadecimal, in which case a `radix` of `16` is used. 42083 * 42084 * **Note:** This method aligns with the 42085 * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. 42086 * 42087 * @static 42088 * @memberOf _ 42089 * @since 1.1.0 42090 * @category String 42091 * @param {string} string The string to convert. 42092 * @param {number} [radix=10] The radix to interpret `value` by. 42093 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42094 * @returns {number} Returns the converted integer. 42095 * @example 42096 * 42097 * _.parseInt('08'); 42098 * // => 8 42099 * 42100 * _.map(['6', '08', '10'], _.parseInt); 42101 * // => [6, 8, 10] 42102 */ 42103 function parseInt(string, radix, guard) { 42104 if (guard || radix == null) { 42105 radix = 0; 42106 } else if (radix) { 42107 radix = +radix; 42108 } 42109 return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); 42110 } 42111 42112 /** 42113 * Repeats the given string `n` times. 42114 * 42115 * @static 42116 * @memberOf _ 42117 * @since 3.0.0 42118 * @category String 42119 * @param {string} [string=''] The string to repeat. 42120 * @param {number} [n=1] The number of times to repeat the string. 42121 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42122 * @returns {string} Returns the repeated string. 42123 * @example 42124 * 42125 * _.repeat('*', 3); 42126 * // => '***' 42127 * 42128 * _.repeat('abc', 2); 42129 * // => 'abcabc' 42130 * 42131 * _.repeat('abc', 0); 42132 * // => '' 42133 */ 42134 function repeat(string, n, guard) { 42135 if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { 42136 n = 1; 42137 } else { 42138 n = toInteger(n); 42139 } 42140 return baseRepeat(toString(string), n); 42141 } 42142 42143 /** 42144 * Replaces matches for `pattern` in `string` with `replacement`. 42145 * 42146 * **Note:** This method is based on 42147 * [`String#replace`](https://mdn.io/String/replace). 42148 * 42149 * @static 42150 * @memberOf _ 42151 * @since 4.0.0 42152 * @category String 42153 * @param {string} [string=''] The string to modify. 42154 * @param {RegExp|string} pattern The pattern to replace. 42155 * @param {Function|string} replacement The match replacement. 42156 * @returns {string} Returns the modified string. 42157 * @example 42158 * 42159 * _.replace('Hi Fred', 'Fred', 'Barney'); 42160 * // => 'Hi Barney' 42161 */ 42162 function replace() { 42163 var args = arguments, 42164 string = toString(args[0]); 42165 42166 return args.length < 3 ? string : string.replace(args[1], args[2]); 42167 } 42168 42169 /** 42170 * Converts `string` to 42171 * [snake case](https://en.wikipedia.org/wiki/Snake_case). 42172 * 42173 * @static 42174 * @memberOf _ 42175 * @since 3.0.0 42176 * @category String 42177 * @param {string} [string=''] The string to convert. 42178 * @returns {string} Returns the snake cased string. 42179 * @example 42180 * 42181 * _.snakeCase('Foo Bar'); 42182 * // => 'foo_bar' 42183 * 42184 * _.snakeCase('fooBar'); 42185 * // => 'foo_bar' 42186 * 42187 * _.snakeCase('--FOO-BAR--'); 42188 * // => 'foo_bar' 42189 */ 42190 var snakeCase = createCompounder(function(result, word, index) { 42191 return result + (index ? '_' : '') + word.toLowerCase(); 42192 }); 42193 42194 /** 42195 * Splits `string` by `separator`. 42196 * 42197 * **Note:** This method is based on 42198 * [`String#split`](https://mdn.io/String/split). 42199 * 42200 * @static 42201 * @memberOf _ 42202 * @since 4.0.0 42203 * @category String 42204 * @param {string} [string=''] The string to split. 42205 * @param {RegExp|string} separator The separator pattern to split by. 42206 * @param {number} [limit] The length to truncate results to. 42207 * @returns {Array} Returns the string segments. 42208 * @example 42209 * 42210 * _.split('a-b-c', '-', 2); 42211 * // => ['a', 'b'] 42212 */ 42213 function split(string, separator, limit) { 42214 if (limit && typeof limit != 'number' && isIterateeCall(string, separator, limit)) { 42215 separator = limit = undefined; 42216 } 42217 limit = limit === undefined ? MAX_ARRAY_LENGTH : limit >>> 0; 42218 if (!limit) { 42219 return []; 42220 } 42221 string = toString(string); 42222 if (string && ( 42223 typeof separator == 'string' || 42224 (separator != null && !isRegExp(separator)) 42225 )) { 42226 separator = baseToString(separator); 42227 if (!separator && hasUnicode(string)) { 42228 return castSlice(stringToArray(string), 0, limit); 42229 } 42230 } 42231 return string.split(separator, limit); 42232 } 42233 42234 /** 42235 * Converts `string` to 42236 * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). 42237 * 42238 * @static 42239 * @memberOf _ 42240 * @since 3.1.0 42241 * @category String 42242 * @param {string} [string=''] The string to convert. 42243 * @returns {string} Returns the start cased string. 42244 * @example 42245 * 42246 * _.startCase('--foo-bar--'); 42247 * // => 'Foo Bar' 42248 * 42249 * _.startCase('fooBar'); 42250 * // => 'Foo Bar' 42251 * 42252 * _.startCase('__FOO_BAR__'); 42253 * // => 'FOO BAR' 42254 */ 42255 var startCase = createCompounder(function(result, word, index) { 42256 return result + (index ? ' ' : '') + upperFirst(word); 42257 }); 42258 42259 /** 42260 * Checks if `string` starts with the given target string. 42261 * 42262 * @static 42263 * @memberOf _ 42264 * @since 3.0.0 42265 * @category String 42266 * @param {string} [string=''] The string to inspect. 42267 * @param {string} [target] The string to search for. 42268 * @param {number} [position=0] The position to search from. 42269 * @returns {boolean} Returns `true` if `string` starts with `target`, 42270 * else `false`. 42271 * @example 42272 * 42273 * _.startsWith('abc', 'a'); 42274 * // => true 42275 * 42276 * _.startsWith('abc', 'b'); 42277 * // => false 42278 * 42279 * _.startsWith('abc', 'b', 1); 42280 * // => true 42281 */ 42282 function startsWith(string, target, position) { 42283 string = toString(string); 42284 position = position == null 42285 ? 0 42286 : baseClamp(toInteger(position), 0, string.length); 42287 42288 target = baseToString(target); 42289 return string.slice(position, position + target.length) == target; 42290 } 42291 42292 /** 42293 * Creates a compiled template function that can interpolate data properties 42294 * in "interpolate" delimiters, HTML-escape interpolated data properties in 42295 * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data 42296 * properties may be accessed as free variables in the template. If a setting 42297 * object is given, it takes precedence over `_.templateSettings` values. 42298 * 42299 * **Note:** In the development build `_.template` utilizes 42300 * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) 42301 * for easier debugging. 42302 * 42303 * For more information on precompiling templates see 42304 * [lodash's custom builds documentation](https://lodash.com/custom-builds). 42305 * 42306 * For more information on Chrome extension sandboxes see 42307 * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). 42308 * 42309 * @static 42310 * @since 0.1.0 42311 * @memberOf _ 42312 * @category String 42313 * @param {string} [string=''] The template string. 42314 * @param {Object} [options={}] The options object. 42315 * @param {RegExp} [options.escape=_.templateSettings.escape] 42316 * The HTML "escape" delimiter. 42317 * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] 42318 * The "evaluate" delimiter. 42319 * @param {Object} [options.imports=_.templateSettings.imports] 42320 * An object to import into the template as free variables. 42321 * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] 42322 * The "interpolate" delimiter. 42323 * @param {string} [options.sourceURL='lodash.templateSources[n]'] 42324 * The sourceURL of the compiled template. 42325 * @param {string} [options.variable='obj'] 42326 * The data object variable name. 42327 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42328 * @returns {Function} Returns the compiled template function. 42329 * @example 42330 * 42331 * // Use the "interpolate" delimiter to create a compiled template. 42332 * var compiled = _.template('hello <%= user %>!'); 42333 * compiled({ 'user': 'fred' }); 42334 * // => 'hello fred!' 42335 * 42336 * // Use the HTML "escape" delimiter to escape data property values. 42337 * var compiled = _.template('<b><%- value %></b>'); 42338 * compiled({ 'value': '<script>' }); 42339 * // => '<b><script></b>' 42340 * 42341 * // Use the "evaluate" delimiter to execute JavaScript and generate HTML. 42342 * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>'); 42343 * compiled({ 'users': ['fred', 'barney'] }); 42344 * // => '<li>fred</li><li>barney</li>' 42345 * 42346 * // Use the internal `print` function in "evaluate" delimiters. 42347 * var compiled = _.template('<% print("hello " + user); %>!'); 42348 * compiled({ 'user': 'barney' }); 42349 * // => 'hello barney!' 42350 * 42351 * // Use the ES template literal delimiter as an "interpolate" delimiter. 42352 * // Disable support by replacing the "interpolate" delimiter. 42353 * var compiled = _.template('hello ${ user }!'); 42354 * compiled({ 'user': 'pebbles' }); 42355 * // => 'hello pebbles!' 42356 * 42357 * // Use backslashes to treat delimiters as plain text. 42358 * var compiled = _.template('<%= "\\<%- value %\\>" %>'); 42359 * compiled({ 'value': 'ignored' }); 42360 * // => '<%- value %>' 42361 * 42362 * // Use the `imports` option to import `jQuery` as `jq`. 42363 * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>'; 42364 * var compiled = _.template(text, { 'imports': { 'jq': jQuery } }); 42365 * compiled({ 'users': ['fred', 'barney'] }); 42366 * // => '<li>fred</li><li>barney</li>' 42367 * 42368 * // Use the `sourceURL` option to specify a custom sourceURL for the template. 42369 * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' }); 42370 * compiled(data); 42371 * // => Find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector. 42372 * 42373 * // Use the `variable` option to ensure a with-statement isn't used in the compiled template. 42374 * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' }); 42375 * compiled.source; 42376 * // => function(data) { 42377 * // var __t, __p = ''; 42378 * // __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!'; 42379 * // return __p; 42380 * // } 42381 * 42382 * // Use custom template delimiters. 42383 * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g; 42384 * var compiled = _.template('hello {{ user }}!'); 42385 * compiled({ 'user': 'mustache' }); 42386 * // => 'hello mustache!' 42387 * 42388 * // Use the `source` property to inline compiled templates for meaningful 42389 * // line numbers in error messages and stack traces. 42390 * fs.writeFileSync(path.join(process.cwd(), 'jst.js'), '\ 42391 * var JST = {\ 42392 * "main": ' + _.template(mainText).source + '\ 42393 * };\ 42394 * '); 42395 */ 42396 function template(string, options, guard) { 42397 // Based on John Resig's `tmpl` implementation 42398 // (http://ejohn.org/blog/javascript-micro-templating/) 42399 // and Laura Doktorova's doT.js (https://github.com/olado/doT). 42400 var settings = lodash.templateSettings; 42401 42402 if (guard && isIterateeCall(string, options, guard)) { 42403 options = undefined; 42404 } 42405 string = toString(string); 42406 options = assignInWith({}, options, settings, customDefaultsAssignIn); 42407 42408 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), 42409 importsKeys = keys(imports), 42410 importsValues = baseValues(imports, importsKeys); 42411 42412 var isEscaping, 42413 isEvaluating, 42414 index = 0, 42415 interpolate = options.interpolate || reNoMatch, 42416 source = "__p += '"; 42417 42418 // Compile the regexp to match each delimiter. 42419 var reDelimiters = RegExp( 42420 (options.escape || reNoMatch).source + '|' + 42421 interpolate.source + '|' + 42422 (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + 42423 (options.evaluate || reNoMatch).source + '|$' 42424 , 'g'); 42425 42426 // Use a sourceURL for easier debugging. 42427 // The sourceURL gets injected into the source that's eval-ed, so be careful 42428 // to normalize all kinds of whitespace, so e.g. newlines (and unicode versions of it) can't sneak in 42429 // and escape the comment, thus injecting code that gets evaled. 42430 var sourceURL = '//# sourceURL=' + 42431 (hasOwnProperty.call(options, 'sourceURL') 42432 ? (options.sourceURL + '').replace(/\s/g, ' ') 42433 : ('lodash.templateSources[' + (++templateCounter) + ']') 42434 ) + '\n'; 42435 42436 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 42437 interpolateValue || (interpolateValue = esTemplateValue); 42438 42439 // Escape characters that can't be included in string literals. 42440 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 42441 42442 // Replace delimiters with snippets. 42443 if (escapeValue) { 42444 isEscaping = true; 42445 source += "' +\n__e(" + escapeValue + ") +\n'"; 42446 } 42447 if (evaluateValue) { 42448 isEvaluating = true; 42449 source += "';\n" + evaluateValue + ";\n__p += '"; 42450 } 42451 if (interpolateValue) { 42452 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 42453 } 42454 index = offset + match.length; 42455 42456 // The JS engine embedded in Adobe products needs `match` returned in 42457 // order to produce the correct `offset` value. 42458 return match; 42459 }); 42460 42461 source += "';\n"; 42462 42463 // If `variable` is not specified wrap a with-statement around the generated 42464 // code to add the data object to the top of the scope chain. 42465 var variable = hasOwnProperty.call(options, 'variable') && options.variable; 42466 if (!variable) { 42467 source = 'with (obj) {\n' + source + '\n}\n'; 42468 } 42469 // Throw an error if a forbidden character was found in `variable`, to prevent 42470 // potential command injection attacks. 42471 else if (reForbiddenIdentifierChars.test(variable)) { 42472 throw new Error(INVALID_TEMPL_VAR_ERROR_TEXT); 42473 } 42474 42475 // Cleanup code by stripping empty strings. 42476 source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source) 42477 .replace(reEmptyStringMiddle, '$1') 42478 .replace(reEmptyStringTrailing, '$1;'); 42479 42480 // Frame code as the function body. 42481 source = 'function(' + (variable || 'obj') + ') {\n' + 42482 (variable 42483 ? '' 42484 : 'obj || (obj = {});\n' 42485 ) + 42486 "var __t, __p = ''" + 42487 (isEscaping 42488 ? ', __e = _.escape' 42489 : '' 42490 ) + 42491 (isEvaluating 42492 ? ', __j = Array.prototype.join;\n' + 42493 "function print() { __p += __j.call(arguments, '') }\n" 42494 : ';\n' 42495 ) + 42496 source + 42497 'return __p\n}'; 42498 42499 var result = attempt(function() { 42500 return Function(importsKeys, sourceURL + 'return ' + source) 42501 .apply(undefined, importsValues); 42502 }); 42503 42504 // Provide the compiled function's source by its `toString` method or 42505 // the `source` property as a convenience for inlining compiled templates. 42506 result.source = source; 42507 if (isError(result)) { 42508 throw result; 42509 } 42510 return result; 42511 } 42512 42513 /** 42514 * Converts `string`, as a whole, to lower case just like 42515 * [String#toLowerCase](https://mdn.io/toLowerCase). 42516 * 42517 * @static 42518 * @memberOf _ 42519 * @since 4.0.0 42520 * @category String 42521 * @param {string} [string=''] The string to convert. 42522 * @returns {string} Returns the lower cased string. 42523 * @example 42524 * 42525 * _.toLower('--Foo-Bar--'); 42526 * // => '--foo-bar--' 42527 * 42528 * _.toLower('fooBar'); 42529 * // => 'foobar' 42530 * 42531 * _.toLower('__FOO_BAR__'); 42532 * // => '__foo_bar__' 42533 */ 42534 function toLower(value) { 42535 return toString(value).toLowerCase(); 42536 } 42537 42538 /** 42539 * Converts `string`, as a whole, to upper case just like 42540 * [String#toUpperCase](https://mdn.io/toUpperCase). 42541 * 42542 * @static 42543 * @memberOf _ 42544 * @since 4.0.0 42545 * @category String 42546 * @param {string} [string=''] The string to convert. 42547 * @returns {string} Returns the upper cased string. 42548 * @example 42549 * 42550 * _.toUpper('--foo-bar--'); 42551 * // => '--FOO-BAR--' 42552 * 42553 * _.toUpper('fooBar'); 42554 * // => 'FOOBAR' 42555 * 42556 * _.toUpper('__foo_bar__'); 42557 * // => '__FOO_BAR__' 42558 */ 42559 function toUpper(value) { 42560 return toString(value).toUpperCase(); 42561 } 42562 42563 /** 42564 * Removes leading and trailing whitespace or specified characters from `string`. 42565 * 42566 * @static 42567 * @memberOf _ 42568 * @since 3.0.0 42569 * @category String 42570 * @param {string} [string=''] The string to trim. 42571 * @param {string} [chars=whitespace] The characters to trim. 42572 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42573 * @returns {string} Returns the trimmed string. 42574 * @example 42575 * 42576 * _.trim(' abc '); 42577 * // => 'abc' 42578 * 42579 * _.trim('-_-abc-_-', '_-'); 42580 * // => 'abc' 42581 * 42582 * _.map([' foo ', ' bar '], _.trim); 42583 * // => ['foo', 'bar'] 42584 */ 42585 function trim(string, chars, guard) { 42586 string = toString(string); 42587 if (string && (guard || chars === undefined)) { 42588 return baseTrim(string); 42589 } 42590 if (!string || !(chars = baseToString(chars))) { 42591 return string; 42592 } 42593 var strSymbols = stringToArray(string), 42594 chrSymbols = stringToArray(chars), 42595 start = charsStartIndex(strSymbols, chrSymbols), 42596 end = charsEndIndex(strSymbols, chrSymbols) + 1; 42597 42598 return castSlice(strSymbols, start, end).join(''); 42599 } 42600 42601 /** 42602 * Removes trailing whitespace or specified characters from `string`. 42603 * 42604 * @static 42605 * @memberOf _ 42606 * @since 4.0.0 42607 * @category String 42608 * @param {string} [string=''] The string to trim. 42609 * @param {string} [chars=whitespace] The characters to trim. 42610 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42611 * @returns {string} Returns the trimmed string. 42612 * @example 42613 * 42614 * _.trimEnd(' abc '); 42615 * // => ' abc' 42616 * 42617 * _.trimEnd('-_-abc-_-', '_-'); 42618 * // => '-_-abc' 42619 */ 42620 function trimEnd(string, chars, guard) { 42621 string = toString(string); 42622 if (string && (guard || chars === undefined)) { 42623 return string.slice(0, trimmedEndIndex(string) + 1); 42624 } 42625 if (!string || !(chars = baseToString(chars))) { 42626 return string; 42627 } 42628 var strSymbols = stringToArray(string), 42629 end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; 42630 42631 return castSlice(strSymbols, 0, end).join(''); 42632 } 42633 42634 /** 42635 * Removes leading whitespace or specified characters from `string`. 42636 * 42637 * @static 42638 * @memberOf _ 42639 * @since 4.0.0 42640 * @category String 42641 * @param {string} [string=''] The string to trim. 42642 * @param {string} [chars=whitespace] The characters to trim. 42643 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42644 * @returns {string} Returns the trimmed string. 42645 * @example 42646 * 42647 * _.trimStart(' abc '); 42648 * // => 'abc ' 42649 * 42650 * _.trimStart('-_-abc-_-', '_-'); 42651 * // => 'abc-_-' 42652 */ 42653 function trimStart(string, chars, guard) { 42654 string = toString(string); 42655 if (string && (guard || chars === undefined)) { 42656 return string.replace(reTrimStart, ''); 42657 } 42658 if (!string || !(chars = baseToString(chars))) { 42659 return string; 42660 } 42661 var strSymbols = stringToArray(string), 42662 start = charsStartIndex(strSymbols, stringToArray(chars)); 42663 42664 return castSlice(strSymbols, start).join(''); 42665 } 42666 42667 /** 42668 * Truncates `string` if it's longer than the given maximum string length. 42669 * The last characters of the truncated string are replaced with the omission 42670 * string which defaults to "...". 42671 * 42672 * @static 42673 * @memberOf _ 42674 * @since 4.0.0 42675 * @category String 42676 * @param {string} [string=''] The string to truncate. 42677 * @param {Object} [options={}] The options object. 42678 * @param {number} [options.length=30] The maximum string length. 42679 * @param {string} [options.omission='...'] The string to indicate text is omitted. 42680 * @param {RegExp|string} [options.separator] The separator pattern to truncate to. 42681 * @returns {string} Returns the truncated string. 42682 * @example 42683 * 42684 * _.truncate('hi-diddly-ho there, neighborino'); 42685 * // => 'hi-diddly-ho there, neighbo...' 42686 * 42687 * _.truncate('hi-diddly-ho there, neighborino', { 42688 * 'length': 24, 42689 * 'separator': ' ' 42690 * }); 42691 * // => 'hi-diddly-ho there,...' 42692 * 42693 * _.truncate('hi-diddly-ho there, neighborino', { 42694 * 'length': 24, 42695 * 'separator': /,? +/ 42696 * }); 42697 * // => 'hi-diddly-ho there...' 42698 * 42699 * _.truncate('hi-diddly-ho there, neighborino', { 42700 * 'omission': ' [...]' 42701 * }); 42702 * // => 'hi-diddly-ho there, neig [...]' 42703 */ 42704 function truncate(string, options) { 42705 var length = DEFAULT_TRUNC_LENGTH, 42706 omission = DEFAULT_TRUNC_OMISSION; 42707 42708 if (isObject(options)) { 42709 var separator = 'separator' in options ? options.separator : separator; 42710 length = 'length' in options ? toInteger(options.length) : length; 42711 omission = 'omission' in options ? baseToString(options.omission) : omission; 42712 } 42713 string = toString(string); 42714 42715 var strLength = string.length; 42716 if (hasUnicode(string)) { 42717 var strSymbols = stringToArray(string); 42718 strLength = strSymbols.length; 42719 } 42720 if (length >= strLength) { 42721 return string; 42722 } 42723 var end = length - stringSize(omission); 42724 if (end < 1) { 42725 return omission; 42726 } 42727 var result = strSymbols 42728 ? castSlice(strSymbols, 0, end).join('') 42729 : string.slice(0, end); 42730 42731 if (separator === undefined) { 42732 return result + omission; 42733 } 42734 if (strSymbols) { 42735 end += (result.length - end); 42736 } 42737 if (isRegExp(separator)) { 42738 if (string.slice(end).search(separator)) { 42739 var match, 42740 substring = result; 42741 42742 if (!separator.global) { 42743 separator = RegExp(separator.source, toString(reFlags.exec(separator)) + 'g'); 42744 } 42745 separator.lastIndex = 0; 42746 while ((match = separator.exec(substring))) { 42747 var newEnd = match.index; 42748 } 42749 result = result.slice(0, newEnd === undefined ? end : newEnd); 42750 } 42751 } else if (string.indexOf(baseToString(separator), end) != end) { 42752 var index = result.lastIndexOf(separator); 42753 if (index > -1) { 42754 result = result.slice(0, index); 42755 } 42756 } 42757 return result + omission; 42758 } 42759 42760 /** 42761 * The inverse of `_.escape`; this method converts the HTML entities 42762 * `&`, `<`, `>`, `"`, and `'` in `string` to 42763 * their corresponding characters. 42764 * 42765 * **Note:** No other HTML entities are unescaped. To unescape additional 42766 * HTML entities use a third-party library like [_he_](https://mths.be/he). 42767 * 42768 * @static 42769 * @memberOf _ 42770 * @since 0.6.0 42771 * @category String 42772 * @param {string} [string=''] The string to unescape. 42773 * @returns {string} Returns the unescaped string. 42774 * @example 42775 * 42776 * _.unescape('fred, barney, & pebbles'); 42777 * // => 'fred, barney, & pebbles' 42778 */ 42779 function unescape(string) { 42780 string = toString(string); 42781 return (string && reHasEscapedHtml.test(string)) 42782 ? string.replace(reEscapedHtml, unescapeHtmlChar) 42783 : string; 42784 } 42785 42786 /** 42787 * Converts `string`, as space separated words, to upper case. 42788 * 42789 * @static 42790 * @memberOf _ 42791 * @since 4.0.0 42792 * @category String 42793 * @param {string} [string=''] The string to convert. 42794 * @returns {string} Returns the upper cased string. 42795 * @example 42796 * 42797 * _.upperCase('--foo-bar'); 42798 * // => 'FOO BAR' 42799 * 42800 * _.upperCase('fooBar'); 42801 * // => 'FOO BAR' 42802 * 42803 * _.upperCase('__foo_bar__'); 42804 * // => 'FOO BAR' 42805 */ 42806 var upperCase = createCompounder(function(result, word, index) { 42807 return result + (index ? ' ' : '') + word.toUpperCase(); 42808 }); 42809 42810 /** 42811 * Converts the first character of `string` to upper case. 42812 * 42813 * @static 42814 * @memberOf _ 42815 * @since 4.0.0 42816 * @category String 42817 * @param {string} [string=''] The string to convert. 42818 * @returns {string} Returns the converted string. 42819 * @example 42820 * 42821 * _.upperFirst('fred'); 42822 * // => 'Fred' 42823 * 42824 * _.upperFirst('FRED'); 42825 * // => 'FRED' 42826 */ 42827 var upperFirst = createCaseFirst('toUpperCase'); 42828 42829 /** 42830 * Splits `string` into an array of its words. 42831 * 42832 * @static 42833 * @memberOf _ 42834 * @since 3.0.0 42835 * @category String 42836 * @param {string} [string=''] The string to inspect. 42837 * @param {RegExp|string} [pattern] The pattern to match words. 42838 * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. 42839 * @returns {Array} Returns the words of `string`. 42840 * @example 42841 * 42842 * _.words('fred, barney, & pebbles'); 42843 * // => ['fred', 'barney', 'pebbles'] 42844 * 42845 * _.words('fred, barney, & pebbles', /[^, ]+/g); 42846 * // => ['fred', 'barney', '&', 'pebbles'] 42847 */ 42848 function words(string, pattern, guard) { 42849 string = toString(string); 42850 pattern = guard ? undefined : pattern; 42851 42852 if (pattern === undefined) { 42853 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 42854 } 42855 return string.match(pattern) || []; 42856 } 42857 42858 /*------------------------------------------------------------------------*/ 42859 42860 /** 42861 * Attempts to invoke `func`, returning either the result or the caught error 42862 * object. Any additional arguments are provided to `func` when it's invoked. 42863 * 42864 * @static 42865 * @memberOf _ 42866 * @since 3.0.0 42867 * @category Util 42868 * @param {Function} func The function to attempt. 42869 * @param {...*} [args] The arguments to invoke `func` with. 42870 * @returns {*} Returns the `func` result or error object. 42871 * @example 42872 * 42873 * // Avoid throwing errors for invalid selectors. 42874 * var elements = _.attempt(function(selector) { 42875 * return document.querySelectorAll(selector); 42876 * }, '>_>'); 42877 * 42878 * if (_.isError(elements)) { 42879 * elements = []; 42880 * } 42881 */ 42882 var attempt = baseRest(function(func, args) { 42883 try { 42884 return apply(func, undefined, args); 42885 } catch (e) { 42886 return isError(e) ? e : new Error(e); 42887 } 42888 }); 42889 42890 /** 42891 * Binds methods of an object to the object itself, overwriting the existing 42892 * method. 42893 * 42894 * **Note:** This method doesn't set the "length" property of bound functions. 42895 * 42896 * @static 42897 * @since 0.1.0 42898 * @memberOf _ 42899 * @category Util 42900 * @param {Object} object The object to bind and assign the bound methods to. 42901 * @param {...(string|string[])} methodNames The object method names to bind. 42902 * @returns {Object} Returns `object`. 42903 * @example 42904 * 42905 * var view = { 42906 * 'label': 'docs', 42907 * 'click': function() { 42908 * console.log('clicked ' + this.label); 42909 * } 42910 * }; 42911 * 42912 * _.bindAll(view, ['click']); 42913 * jQuery(element).on('click', view.click); 42914 * // => Logs 'clicked docs' when clicked. 42915 */ 42916 var bindAll = flatRest(function(object, methodNames) { 42917 arrayEach(methodNames, function(key) { 42918 key = toKey(key); 42919 baseAssignValue(object, key, bind(object[key], object)); 42920 }); 42921 return object; 42922 }); 42923 42924 /** 42925 * Creates a function that iterates over `pairs` and invokes the corresponding 42926 * function of the first predicate to return truthy. The predicate-function 42927 * pairs are invoked with the `this` binding and arguments of the created 42928 * function. 42929 * 42930 * @static 42931 * @memberOf _ 42932 * @since 4.0.0 42933 * @category Util 42934 * @param {Array} pairs The predicate-function pairs. 42935 * @returns {Function} Returns the new composite function. 42936 * @example 42937 * 42938 * var func = _.cond([ 42939 * [_.matches({ 'a': 1 }), _.constant('matches A')], 42940 * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], 42941 * [_.stubTrue, _.constant('no match')] 42942 * ]); 42943 * 42944 * func({ 'a': 1, 'b': 2 }); 42945 * // => 'matches A' 42946 * 42947 * func({ 'a': 0, 'b': 1 }); 42948 * // => 'matches B' 42949 * 42950 * func({ 'a': '1', 'b': '2' }); 42951 * // => 'no match' 42952 */ 42953 function cond(pairs) { 42954 var length = pairs == null ? 0 : pairs.length, 42955 toIteratee = getIteratee(); 42956 42957 pairs = !length ? [] : arrayMap(pairs, function(pair) { 42958 if (typeof pair[1] != 'function') { 42959 throw new TypeError(FUNC_ERROR_TEXT); 42960 } 42961 return [toIteratee(pair[0]), pair[1]]; 42962 }); 42963 42964 return baseRest(function(args) { 42965 var index = -1; 42966 while (++index < length) { 42967 var pair = pairs[index]; 42968 if (apply(pair[0], this, args)) { 42969 return apply(pair[1], this, args); 42970 } 42971 } 42972 }); 42973 } 42974 42975 /** 42976 * Creates a function that invokes the predicate properties of `source` with 42977 * the corresponding property values of a given object, returning `true` if 42978 * all predicates return truthy, else `false`. 42979 * 42980 * **Note:** The created function is equivalent to `_.conformsTo` with 42981 * `source` partially applied. 42982 * 42983 * @static 42984 * @memberOf _ 42985 * @since 4.0.0 42986 * @category Util 42987 * @param {Object} source The object of property predicates to conform to. 42988 * @returns {Function} Returns the new spec function. 42989 * @example 42990 * 42991 * var objects = [ 42992 * { 'a': 2, 'b': 1 }, 42993 * { 'a': 1, 'b': 2 } 42994 * ]; 42995 * 42996 * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); 42997 * // => [{ 'a': 1, 'b': 2 }] 42998 */ 42999 function conforms(source) { 43000 return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); 43001 } 43002 43003 /** 43004 * Creates a function that returns `value`. 43005 * 43006 * @static 43007 * @memberOf _ 43008 * @since 2.4.0 43009 * @category Util 43010 * @param {*} value The value to return from the new function. 43011 * @returns {Function} Returns the new constant function. 43012 * @example 43013 * 43014 * var objects = _.times(2, _.constant({ 'a': 1 })); 43015 * 43016 * console.log(objects); 43017 * // => [{ 'a': 1 }, { 'a': 1 }] 43018 * 43019 * console.log(objects[0] === objects[1]); 43020 * // => true 43021 */ 43022 function constant(value) { 43023 return function() { 43024 return value; 43025 }; 43026 } 43027 43028 /** 43029 * Checks `value` to determine whether a default value should be returned in 43030 * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, 43031 * or `undefined`. 43032 * 43033 * @static 43034 * @memberOf _ 43035 * @since 4.14.0 43036 * @category Util 43037 * @param {*} value The value to check. 43038 * @param {*} defaultValue The default value. 43039 * @returns {*} Returns the resolved value. 43040 * @example 43041 * 43042 * _.defaultTo(1, 10); 43043 * // => 1 43044 * 43045 * _.defaultTo(undefined, 10); 43046 * // => 10 43047 */ 43048 function defaultTo(value, defaultValue) { 43049 return (value == null || value !== value) ? defaultValue : value; 43050 } 43051 43052 /** 43053 * Creates a function that returns the result of invoking the given functions 43054 * with the `this` binding of the created function, where each successive 43055 * invocation is supplied the return value of the previous. 43056 * 43057 * @static 43058 * @memberOf _ 43059 * @since 3.0.0 43060 * @category Util 43061 * @param {...(Function|Function[])} [funcs] The functions to invoke. 43062 * @returns {Function} Returns the new composite function. 43063 * @see _.flowRight 43064 * @example 43065 * 43066 * function square(n) { 43067 * return n * n; 43068 * } 43069 * 43070 * var addSquare = _.flow([_.add, square]); 43071 * addSquare(1, 2); 43072 * // => 9 43073 */ 43074 var flow = createFlow(); 43075 43076 /** 43077 * This method is like `_.flow` except that it creates a function that 43078 * invokes the given functions from right to left. 43079 * 43080 * @static 43081 * @since 3.0.0 43082 * @memberOf _ 43083 * @category Util 43084 * @param {...(Function|Function[])} [funcs] The functions to invoke. 43085 * @returns {Function} Returns the new composite function. 43086 * @see _.flow 43087 * @example 43088 * 43089 * function square(n) { 43090 * return n * n; 43091 * } 43092 * 43093 * var addSquare = _.flowRight([square, _.add]); 43094 * addSquare(1, 2); 43095 * // => 9 43096 */ 43097 var flowRight = createFlow(true); 43098 43099 /** 43100 * This method returns the first argument it receives. 43101 * 43102 * @static 43103 * @since 0.1.0 43104 * @memberOf _ 43105 * @category Util 43106 * @param {*} value Any value. 43107 * @returns {*} Returns `value`. 43108 * @example 43109 * 43110 * var object = { 'a': 1 }; 43111 * 43112 * console.log(_.identity(object) === object); 43113 * // => true 43114 */ 43115 function identity(value) { 43116 return value; 43117 } 43118 43119 /** 43120 * Creates a function that invokes `func` with the arguments of the created 43121 * function. If `func` is a property name, the created function returns the 43122 * property value for a given element. If `func` is an array or object, the 43123 * created function returns `true` for elements that contain the equivalent 43124 * source properties, otherwise it returns `false`. 43125 * 43126 * @static 43127 * @since 4.0.0 43128 * @memberOf _ 43129 * @category Util 43130 * @param {*} [func=_.identity] The value to convert to a callback. 43131 * @returns {Function} Returns the callback. 43132 * @example 43133 * 43134 * var users = [ 43135 * { 'user': 'barney', 'age': 36, 'active': true }, 43136 * { 'user': 'fred', 'age': 40, 'active': false } 43137 * ]; 43138 * 43139 * // The `_.matches` iteratee shorthand. 43140 * _.filter(users, _.iteratee({ 'user': 'barney', 'active': true })); 43141 * // => [{ 'user': 'barney', 'age': 36, 'active': true }] 43142 * 43143 * // The `_.matchesProperty` iteratee shorthand. 43144 * _.filter(users, _.iteratee(['user', 'fred'])); 43145 * // => [{ 'user': 'fred', 'age': 40 }] 43146 * 43147 * // The `_.property` iteratee shorthand. 43148 * _.map(users, _.iteratee('user')); 43149 * // => ['barney', 'fred'] 43150 * 43151 * // Create custom iteratee shorthands. 43152 * _.iteratee = _.wrap(_.iteratee, function(iteratee, func) { 43153 * return !_.isRegExp(func) ? iteratee(func) : function(string) { 43154 * return func.test(string); 43155 * }; 43156 * }); 43157 * 43158 * _.filter(['abc', 'def'], /ef/); 43159 * // => ['def'] 43160 */ 43161 function iteratee(func) { 43162 return baseIteratee(typeof func == 'function' ? func : baseClone(func, CLONE_DEEP_FLAG)); 43163 } 43164 43165 /** 43166 * Creates a function that performs a partial deep comparison between a given 43167 * object and `source`, returning `true` if the given object has equivalent 43168 * property values, else `false`. 43169 * 43170 * **Note:** The created function is equivalent to `_.isMatch` with `source` 43171 * partially applied. 43172 * 43173 * Partial comparisons will match empty array and empty object `source` 43174 * values against any array or object value, respectively. See `_.isEqual` 43175 * for a list of supported value comparisons. 43176 * 43177 * **Note:** Multiple values can be checked by combining several matchers 43178 * using `_.overSome` 43179 * 43180 * @static 43181 * @memberOf _ 43182 * @since 3.0.0 43183 * @category Util 43184 * @param {Object} source The object of property values to match. 43185 * @returns {Function} Returns the new spec function. 43186 * @example 43187 * 43188 * var objects = [ 43189 * { 'a': 1, 'b': 2, 'c': 3 }, 43190 * { 'a': 4, 'b': 5, 'c': 6 } 43191 * ]; 43192 * 43193 * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); 43194 * // => [{ 'a': 4, 'b': 5, 'c': 6 }] 43195 * 43196 * // Checking for several possible values 43197 * _.filter(objects, _.overSome([_.matches({ 'a': 1 }), _.matches({ 'a': 4 })])); 43198 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 43199 */ 43200 function matches(source) { 43201 return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); 43202 } 43203 43204 /** 43205 * Creates a function that performs a partial deep comparison between the 43206 * value at `path` of a given object to `srcValue`, returning `true` if the 43207 * object value is equivalent, else `false`. 43208 * 43209 * **Note:** Partial comparisons will match empty array and empty object 43210 * `srcValue` values against any array or object value, respectively. See 43211 * `_.isEqual` for a list of supported value comparisons. 43212 * 43213 * **Note:** Multiple values can be checked by combining several matchers 43214 * using `_.overSome` 43215 * 43216 * @static 43217 * @memberOf _ 43218 * @since 3.2.0 43219 * @category Util 43220 * @param {Array|string} path The path of the property to get. 43221 * @param {*} srcValue The value to match. 43222 * @returns {Function} Returns the new spec function. 43223 * @example 43224 * 43225 * var objects = [ 43226 * { 'a': 1, 'b': 2, 'c': 3 }, 43227 * { 'a': 4, 'b': 5, 'c': 6 } 43228 * ]; 43229 * 43230 * _.find(objects, _.matchesProperty('a', 4)); 43231 * // => { 'a': 4, 'b': 5, 'c': 6 } 43232 * 43233 * // Checking for several possible values 43234 * _.filter(objects, _.overSome([_.matchesProperty('a', 1), _.matchesProperty('a', 4)])); 43235 * // => [{ 'a': 1, 'b': 2, 'c': 3 }, { 'a': 4, 'b': 5, 'c': 6 }] 43236 */ 43237 function matchesProperty(path, srcValue) { 43238 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); 43239 } 43240 43241 /** 43242 * Creates a function that invokes the method at `path` of a given object. 43243 * Any additional arguments are provided to the invoked method. 43244 * 43245 * @static 43246 * @memberOf _ 43247 * @since 3.7.0 43248 * @category Util 43249 * @param {Array|string} path The path of the method to invoke. 43250 * @param {...*} [args] The arguments to invoke the method with. 43251 * @returns {Function} Returns the new invoker function. 43252 * @example 43253 * 43254 * var objects = [ 43255 * { 'a': { 'b': _.constant(2) } }, 43256 * { 'a': { 'b': _.constant(1) } } 43257 * ]; 43258 * 43259 * _.map(objects, _.method('a.b')); 43260 * // => [2, 1] 43261 * 43262 * _.map(objects, _.method(['a', 'b'])); 43263 * // => [2, 1] 43264 */ 43265 var method = baseRest(function(path, args) { 43266 return function(object) { 43267 return baseInvoke(object, path, args); 43268 }; 43269 }); 43270 43271 /** 43272 * The opposite of `_.method`; this method creates a function that invokes 43273 * the method at a given path of `object`. Any additional arguments are 43274 * provided to the invoked method. 43275 * 43276 * @static 43277 * @memberOf _ 43278 * @since 3.7.0 43279 * @category Util 43280 * @param {Object} object The object to query. 43281 * @param {...*} [args] The arguments to invoke the method with. 43282 * @returns {Function} Returns the new invoker function. 43283 * @example 43284 * 43285 * var array = _.times(3, _.constant), 43286 * object = { 'a': array, 'b': array, 'c': array }; 43287 * 43288 * _.map(['a[2]', 'c[0]'], _.methodOf(object)); 43289 * // => [2, 0] 43290 * 43291 * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); 43292 * // => [2, 0] 43293 */ 43294 var methodOf = baseRest(function(object, args) { 43295 return function(path) { 43296 return baseInvoke(object, path, args); 43297 }; 43298 }); 43299 43300 /** 43301 * Adds all own enumerable string keyed function properties of a source 43302 * object to the destination object. If `object` is a function, then methods 43303 * are added to its prototype as well. 43304 * 43305 * **Note:** Use `_.runInContext` to create a pristine `lodash` function to 43306 * avoid conflicts caused by modifying the original. 43307 * 43308 * @static 43309 * @since 0.1.0 43310 * @memberOf _ 43311 * @category Util 43312 * @param {Function|Object} [object=lodash] The destination object. 43313 * @param {Object} source The object of functions to add. 43314 * @param {Object} [options={}] The options object. 43315 * @param {boolean} [options.chain=true] Specify whether mixins are chainable. 43316 * @returns {Function|Object} Returns `object`. 43317 * @example 43318 * 43319 * function vowels(string) { 43320 * return _.filter(string, function(v) { 43321 * return /[aeiou]/i.test(v); 43322 * }); 43323 * } 43324 * 43325 * _.mixin({ 'vowels': vowels }); 43326 * _.vowels('fred'); 43327 * // => ['e'] 43328 * 43329 * _('fred').vowels().value(); 43330 * // => ['e'] 43331 * 43332 * _.mixin({ 'vowels': vowels }, { 'chain': false }); 43333 * _('fred').vowels(); 43334 * // => ['e'] 43335 */ 43336 function mixin(object, source, options) { 43337 var props = keys(source), 43338 methodNames = baseFunctions(source, props); 43339 43340 if (options == null && 43341 !(isObject(source) && (methodNames.length || !props.length))) { 43342 options = source; 43343 source = object; 43344 object = this; 43345 methodNames = baseFunctions(source, keys(source)); 43346 } 43347 var chain = !(isObject(options) && 'chain' in options) || !!options.chain, 43348 isFunc = isFunction(object); 43349 43350 arrayEach(methodNames, function(methodName) { 43351 var func = source[methodName]; 43352 object[methodName] = func; 43353 if (isFunc) { 43354 object.prototype[methodName] = function() { 43355 var chainAll = this.__chain__; 43356 if (chain || chainAll) { 43357 var result = object(this.__wrapped__), 43358 actions = result.__actions__ = copyArray(this.__actions__); 43359 43360 actions.push({ 'func': func, 'args': arguments, 'thisArg': object }); 43361 result.__chain__ = chainAll; 43362 return result; 43363 } 43364 return func.apply(object, arrayPush([this.value()], arguments)); 43365 }; 43366 } 43367 }); 43368 43369 return object; 43370 } 43371 43372 /** 43373 * Reverts the `_` variable to its previous value and returns a reference to 43374 * the `lodash` function. 43375 * 43376 * @static 43377 * @since 0.1.0 43378 * @memberOf _ 43379 * @category Util 43380 * @returns {Function} Returns the `lodash` function. 43381 * @example 43382 * 43383 * var lodash = _.noConflict(); 43384 */ 43385 function noConflict() { 43386 if (root._ === this) { 43387 root._ = oldDash; 43388 } 43389 return this; 43390 } 43391 43392 /** 43393 * This method returns `undefined`. 43394 * 43395 * @static 43396 * @memberOf _ 43397 * @since 2.3.0 43398 * @category Util 43399 * @example 43400 * 43401 * _.times(2, _.noop); 43402 * // => [undefined, undefined] 43403 */ 43404 function noop() { 43405 // No operation performed. 43406 } 43407 43408 /** 43409 * Creates a function that gets the argument at index `n`. If `n` is negative, 43410 * the nth argument from the end is returned. 43411 * 43412 * @static 43413 * @memberOf _ 43414 * @since 4.0.0 43415 * @category Util 43416 * @param {number} [n=0] The index of the argument to return. 43417 * @returns {Function} Returns the new pass-thru function. 43418 * @example 43419 * 43420 * var func = _.nthArg(1); 43421 * func('a', 'b', 'c', 'd'); 43422 * // => 'b' 43423 * 43424 * var func = _.nthArg(-2); 43425 * func('a', 'b', 'c', 'd'); 43426 * // => 'c' 43427 */ 43428 function nthArg(n) { 43429 n = toInteger(n); 43430 return baseRest(function(args) { 43431 return baseNth(args, n); 43432 }); 43433 } 43434 43435 /** 43436 * Creates a function that invokes `iteratees` with the arguments it receives 43437 * and returns their results. 43438 * 43439 * @static 43440 * @memberOf _ 43441 * @since 4.0.0 43442 * @category Util 43443 * @param {...(Function|Function[])} [iteratees=[_.identity]] 43444 * The iteratees to invoke. 43445 * @returns {Function} Returns the new function. 43446 * @example 43447 * 43448 * var func = _.over([Math.max, Math.min]); 43449 * 43450 * func(1, 2, 3, 4); 43451 * // => [4, 1] 43452 */ 43453 var over = createOver(arrayMap); 43454 43455 /** 43456 * Creates a function that checks if **all** of the `predicates` return 43457 * truthy when invoked with the arguments it receives. 43458 * 43459 * Following shorthands are possible for providing predicates. 43460 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 43461 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 43462 * 43463 * @static 43464 * @memberOf _ 43465 * @since 4.0.0 43466 * @category Util 43467 * @param {...(Function|Function[])} [predicates=[_.identity]] 43468 * The predicates to check. 43469 * @returns {Function} Returns the new function. 43470 * @example 43471 * 43472 * var func = _.overEvery([Boolean, isFinite]); 43473 * 43474 * func('1'); 43475 * // => true 43476 * 43477 * func(null); 43478 * // => false 43479 * 43480 * func(NaN); 43481 * // => false 43482 */ 43483 var overEvery = createOver(arrayEvery); 43484 43485 /** 43486 * Creates a function that checks if **any** of the `predicates` return 43487 * truthy when invoked with the arguments it receives. 43488 * 43489 * Following shorthands are possible for providing predicates. 43490 * Pass an `Object` and it will be used as an parameter for `_.matches` to create the predicate. 43491 * Pass an `Array` of parameters for `_.matchesProperty` and the predicate will be created using them. 43492 * 43493 * @static 43494 * @memberOf _ 43495 * @since 4.0.0 43496 * @category Util 43497 * @param {...(Function|Function[])} [predicates=[_.identity]] 43498 * The predicates to check. 43499 * @returns {Function} Returns the new function. 43500 * @example 43501 * 43502 * var func = _.overSome([Boolean, isFinite]); 43503 * 43504 * func('1'); 43505 * // => true 43506 * 43507 * func(null); 43508 * // => true 43509 * 43510 * func(NaN); 43511 * // => false 43512 * 43513 * var matchesFunc = _.overSome([{ 'a': 1 }, { 'a': 2 }]) 43514 * var matchesPropertyFunc = _.overSome([['a', 1], ['a', 2]]) 43515 */ 43516 var overSome = createOver(arraySome); 43517 43518 /** 43519 * Creates a function that returns the value at `path` of a given object. 43520 * 43521 * @static 43522 * @memberOf _ 43523 * @since 2.4.0 43524 * @category Util 43525 * @param {Array|string} path The path of the property to get. 43526 * @returns {Function} Returns the new accessor function. 43527 * @example 43528 * 43529 * var objects = [ 43530 * { 'a': { 'b': 2 } }, 43531 * { 'a': { 'b': 1 } } 43532 * ]; 43533 * 43534 * _.map(objects, _.property('a.b')); 43535 * // => [2, 1] 43536 * 43537 * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b'); 43538 * // => [1, 2] 43539 */ 43540 function property(path) { 43541 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 43542 } 43543 43544 /** 43545 * The opposite of `_.property`; this method creates a function that returns 43546 * the value at a given path of `object`. 43547 * 43548 * @static 43549 * @memberOf _ 43550 * @since 3.0.0 43551 * @category Util 43552 * @param {Object} object The object to query. 43553 * @returns {Function} Returns the new accessor function. 43554 * @example 43555 * 43556 * var array = [0, 1, 2], 43557 * object = { 'a': array, 'b': array, 'c': array }; 43558 * 43559 * _.map(['a[2]', 'c[0]'], _.propertyOf(object)); 43560 * // => [2, 0] 43561 * 43562 * _.map([['a', '2'], ['c', '0']], _.propertyOf(object)); 43563 * // => [2, 0] 43564 */ 43565 function propertyOf(object) { 43566 return function(path) { 43567 return object == null ? undefined : baseGet(object, path); 43568 }; 43569 } 43570 43571 /** 43572 * Creates an array of numbers (positive and/or negative) progressing from 43573 * `start` up to, but not including, `end`. A step of `-1` is used if a negative 43574 * `start` is specified without an `end` or `step`. If `end` is not specified, 43575 * it's set to `start` with `start` then set to `0`. 43576 * 43577 * **Note:** JavaScript follows the IEEE-754 standard for resolving 43578 * floating-point values which can produce unexpected results. 43579 * 43580 * @static 43581 * @since 0.1.0 43582 * @memberOf _ 43583 * @category Util 43584 * @param {number} [start=0] The start of the range. 43585 * @param {number} end The end of the range. 43586 * @param {number} [step=1] The value to increment or decrement by. 43587 * @returns {Array} Returns the range of numbers. 43588 * @see _.inRange, _.rangeRight 43589 * @example 43590 * 43591 * _.range(4); 43592 * // => [0, 1, 2, 3] 43593 * 43594 * _.range(-4); 43595 * // => [0, -1, -2, -3] 43596 * 43597 * _.range(1, 5); 43598 * // => [1, 2, 3, 4] 43599 * 43600 * _.range(0, 20, 5); 43601 * // => [0, 5, 10, 15] 43602 * 43603 * _.range(0, -4, -1); 43604 * // => [0, -1, -2, -3] 43605 * 43606 * _.range(1, 4, 0); 43607 * // => [1, 1, 1] 43608 * 43609 * _.range(0); 43610 * // => [] 43611 */ 43612 var range = createRange(); 43613 43614 /** 43615 * This method is like `_.range` except that it populates values in 43616 * descending order. 43617 * 43618 * @static 43619 * @memberOf _ 43620 * @since 4.0.0 43621 * @category Util 43622 * @param {number} [start=0] The start of the range. 43623 * @param {number} end The end of the range. 43624 * @param {number} [step=1] The value to increment or decrement by. 43625 * @returns {Array} Returns the range of numbers. 43626 * @see _.inRange, _.range 43627 * @example 43628 * 43629 * _.rangeRight(4); 43630 * // => [3, 2, 1, 0] 43631 * 43632 * _.rangeRight(-4); 43633 * // => [-3, -2, -1, 0] 43634 * 43635 * _.rangeRight(1, 5); 43636 * // => [4, 3, 2, 1] 43637 * 43638 * _.rangeRight(0, 20, 5); 43639 * // => [15, 10, 5, 0] 43640 * 43641 * _.rangeRight(0, -4, -1); 43642 * // => [-3, -2, -1, 0] 43643 * 43644 * _.rangeRight(1, 4, 0); 43645 * // => [1, 1, 1] 43646 * 43647 * _.rangeRight(0); 43648 * // => [] 43649 */ 43650 var rangeRight = createRange(true); 43651 43652 /** 43653 * This method returns a new empty array. 43654 * 43655 * @static 43656 * @memberOf _ 43657 * @since 4.13.0 43658 * @category Util 43659 * @returns {Array} Returns the new empty array. 43660 * @example 43661 * 43662 * var arrays = _.times(2, _.stubArray); 43663 * 43664 * console.log(arrays); 43665 * // => [[], []] 43666 * 43667 * console.log(arrays[0] === arrays[1]); 43668 * // => false 43669 */ 43670 function stubArray() { 43671 return []; 43672 } 43673 43674 /** 43675 * This method returns `false`. 43676 * 43677 * @static 43678 * @memberOf _ 43679 * @since 4.13.0 43680 * @category Util 43681 * @returns {boolean} Returns `false`. 43682 * @example 43683 * 43684 * _.times(2, _.stubFalse); 43685 * // => [false, false] 43686 */ 43687 function stubFalse() { 43688 return false; 43689 } 43690 43691 /** 43692 * This method returns a new empty object. 43693 * 43694 * @static 43695 * @memberOf _ 43696 * @since 4.13.0 43697 * @category Util 43698 * @returns {Object} Returns the new empty object. 43699 * @example 43700 * 43701 * var objects = _.times(2, _.stubObject); 43702 * 43703 * console.log(objects); 43704 * // => [{}, {}] 43705 * 43706 * console.log(objects[0] === objects[1]); 43707 * // => false 43708 */ 43709 function stubObject() { 43710 return {}; 43711 } 43712 43713 /** 43714 * This method returns an empty string. 43715 * 43716 * @static 43717 * @memberOf _ 43718 * @since 4.13.0 43719 * @category Util 43720 * @returns {string} Returns the empty string. 43721 * @example 43722 * 43723 * _.times(2, _.stubString); 43724 * // => ['', ''] 43725 */ 43726 function stubString() { 43727 return ''; 43728 } 43729 43730 /** 43731 * This method returns `true`. 43732 * 43733 * @static 43734 * @memberOf _ 43735 * @since 4.13.0 43736 * @category Util 43737 * @returns {boolean} Returns `true`. 43738 * @example 43739 * 43740 * _.times(2, _.stubTrue); 43741 * // => [true, true] 43742 */ 43743 function stubTrue() { 43744 return true; 43745 } 43746 43747 /** 43748 * Invokes the iteratee `n` times, returning an array of the results of 43749 * each invocation. The iteratee is invoked with one argument; (index). 43750 * 43751 * @static 43752 * @since 0.1.0 43753 * @memberOf _ 43754 * @category Util 43755 * @param {number} n The number of times to invoke `iteratee`. 43756 * @param {Function} [iteratee=_.identity] The function invoked per iteration. 43757 * @returns {Array} Returns the array of results. 43758 * @example 43759 * 43760 * _.times(3, String); 43761 * // => ['0', '1', '2'] 43762 * 43763 * _.times(4, _.constant(0)); 43764 * // => [0, 0, 0, 0] 43765 */ 43766 function times(n, iteratee) { 43767 n = toInteger(n); 43768 if (n < 1 || n > MAX_SAFE_INTEGER) { 43769 return []; 43770 } 43771 var index = MAX_ARRAY_LENGTH, 43772 length = nativeMin(n, MAX_ARRAY_LENGTH); 43773 43774 iteratee = getIteratee(iteratee); 43775 n -= MAX_ARRAY_LENGTH; 43776 43777 var result = baseTimes(length, iteratee); 43778 while (++index < n) { 43779 iteratee(index); 43780 } 43781 return result; 43782 } 43783 43784 /** 43785 * Converts `value` to a property path array. 43786 * 43787 * @static 43788 * @memberOf _ 43789 * @since 4.0.0 43790 * @category Util 43791 * @param {*} value The value to convert. 43792 * @returns {Array} Returns the new property path array. 43793 * @example 43794 * 43795 * _.toPath('a.b.c'); 43796 * // => ['a', 'b', 'c'] 43797 * 43798 * _.toPath('a[0].b.c'); 43799 * // => ['a', '0', 'b', 'c'] 43800 */ 43801 function toPath(value) { 43802 if (isArray(value)) { 43803 return arrayMap(value, toKey); 43804 } 43805 return isSymbol(value) ? [value] : copyArray(stringToPath(toString(value))); 43806 } 43807 43808 /** 43809 * Generates a unique ID. If `prefix` is given, the ID is appended to it. 43810 * 43811 * @static 43812 * @since 0.1.0 43813 * @memberOf _ 43814 * @category Util 43815 * @param {string} [prefix=''] The value to prefix the ID with. 43816 * @returns {string} Returns the unique ID. 43817 * @example 43818 * 43819 * _.uniqueId('contact_'); 43820 * // => 'contact_104' 43821 * 43822 * _.uniqueId(); 43823 * // => '105' 43824 */ 43825 function uniqueId(prefix) { 43826 var id = ++idCounter; 43827 return toString(prefix) + id; 43828 } 43829 43830 /*------------------------------------------------------------------------*/ 43831 43832 /** 43833 * Adds two numbers. 43834 * 43835 * @static 43836 * @memberOf _ 43837 * @since 3.4.0 43838 * @category Math 43839 * @param {number} augend The first number in an addition. 43840 * @param {number} addend The second number in an addition. 43841 * @returns {number} Returns the total. 43842 * @example 43843 * 43844 * _.add(6, 4); 43845 * // => 10 43846 */ 43847 var add = createMathOperation(function(augend, addend) { 43848 return augend + addend; 43849 }, 0); 43850 43851 /** 43852 * Computes `number` rounded up to `precision`. 43853 * 43854 * @static 43855 * @memberOf _ 43856 * @since 3.10.0 43857 * @category Math 43858 * @param {number} number The number to round up. 43859 * @param {number} [precision=0] The precision to round up to. 43860 * @returns {number} Returns the rounded up number. 43861 * @example 43862 * 43863 * _.ceil(4.006); 43864 * // => 5 43865 * 43866 * _.ceil(6.004, 2); 43867 * // => 6.01 43868 * 43869 * _.ceil(6040, -2); 43870 * // => 6100 43871 */ 43872 var ceil = createRound('ceil'); 43873 43874 /** 43875 * Divide two numbers. 43876 * 43877 * @static 43878 * @memberOf _ 43879 * @since 4.7.0 43880 * @category Math 43881 * @param {number} dividend The first number in a division. 43882 * @param {number} divisor The second number in a division. 43883 * @returns {number} Returns the quotient. 43884 * @example 43885 * 43886 * _.divide(6, 4); 43887 * // => 1.5 43888 */ 43889 var divide = createMathOperation(function(dividend, divisor) { 43890 return dividend / divisor; 43891 }, 1); 43892 43893 /** 43894 * Computes `number` rounded down to `precision`. 43895 * 43896 * @static 43897 * @memberOf _ 43898 * @since 3.10.0 43899 * @category Math 43900 * @param {number} number The number to round down. 43901 * @param {number} [precision=0] The precision to round down to. 43902 * @returns {number} Returns the rounded down number. 43903 * @example 43904 * 43905 * _.floor(4.006); 43906 * // => 4 43907 * 43908 * _.floor(0.046, 2); 43909 * // => 0.04 43910 * 43911 * _.floor(4060, -2); 43912 * // => 4000 43913 */ 43914 var floor = createRound('floor'); 43915 43916 /** 43917 * Computes the maximum value of `array`. If `array` is empty or falsey, 43918 * `undefined` is returned. 43919 * 43920 * @static 43921 * @since 0.1.0 43922 * @memberOf _ 43923 * @category Math 43924 * @param {Array} array The array to iterate over. 43925 * @returns {*} Returns the maximum value. 43926 * @example 43927 * 43928 * _.max([4, 2, 8, 6]); 43929 * // => 8 43930 * 43931 * _.max([]); 43932 * // => undefined 43933 */ 43934 function max(array) { 43935 return (array && array.length) 43936 ? baseExtremum(array, identity, baseGt) 43937 : undefined; 43938 } 43939 43940 /** 43941 * This method is like `_.max` except that it accepts `iteratee` which is 43942 * invoked for each element in `array` to generate the criterion by which 43943 * the value is ranked. The iteratee is invoked with one argument: (value). 43944 * 43945 * @static 43946 * @memberOf _ 43947 * @since 4.0.0 43948 * @category Math 43949 * @param {Array} array The array to iterate over. 43950 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 43951 * @returns {*} Returns the maximum value. 43952 * @example 43953 * 43954 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 43955 * 43956 * _.maxBy(objects, function(o) { return o.n; }); 43957 * // => { 'n': 2 } 43958 * 43959 * // The `_.property` iteratee shorthand. 43960 * _.maxBy(objects, 'n'); 43961 * // => { 'n': 2 } 43962 */ 43963 function maxBy(array, iteratee) { 43964 return (array && array.length) 43965 ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) 43966 : undefined; 43967 } 43968 43969 /** 43970 * Computes the mean of the values in `array`. 43971 * 43972 * @static 43973 * @memberOf _ 43974 * @since 4.0.0 43975 * @category Math 43976 * @param {Array} array The array to iterate over. 43977 * @returns {number} Returns the mean. 43978 * @example 43979 * 43980 * _.mean([4, 2, 8, 6]); 43981 * // => 5 43982 */ 43983 function mean(array) { 43984 return baseMean(array, identity); 43985 } 43986 43987 /** 43988 * This method is like `_.mean` except that it accepts `iteratee` which is 43989 * invoked for each element in `array` to generate the value to be averaged. 43990 * The iteratee is invoked with one argument: (value). 43991 * 43992 * @static 43993 * @memberOf _ 43994 * @since 4.7.0 43995 * @category Math 43996 * @param {Array} array The array to iterate over. 43997 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 43998 * @returns {number} Returns the mean. 43999 * @example 44000 * 44001 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 44002 * 44003 * _.meanBy(objects, function(o) { return o.n; }); 44004 * // => 5 44005 * 44006 * // The `_.property` iteratee shorthand. 44007 * _.meanBy(objects, 'n'); 44008 * // => 5 44009 */ 44010 function meanBy(array, iteratee) { 44011 return baseMean(array, getIteratee(iteratee, 2)); 44012 } 44013 44014 /** 44015 * Computes the minimum value of `array`. If `array` is empty or falsey, 44016 * `undefined` is returned. 44017 * 44018 * @static 44019 * @since 0.1.0 44020 * @memberOf _ 44021 * @category Math 44022 * @param {Array} array The array to iterate over. 44023 * @returns {*} Returns the minimum value. 44024 * @example 44025 * 44026 * _.min([4, 2, 8, 6]); 44027 * // => 2 44028 * 44029 * _.min([]); 44030 * // => undefined 44031 */ 44032 function min(array) { 44033 return (array && array.length) 44034 ? baseExtremum(array, identity, baseLt) 44035 : undefined; 44036 } 44037 44038 /** 44039 * This method is like `_.min` except that it accepts `iteratee` which is 44040 * invoked for each element in `array` to generate the criterion by which 44041 * the value is ranked. The iteratee is invoked with one argument: (value). 44042 * 44043 * @static 44044 * @memberOf _ 44045 * @since 4.0.0 44046 * @category Math 44047 * @param {Array} array The array to iterate over. 44048 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 44049 * @returns {*} Returns the minimum value. 44050 * @example 44051 * 44052 * var objects = [{ 'n': 1 }, { 'n': 2 }]; 44053 * 44054 * _.minBy(objects, function(o) { return o.n; }); 44055 * // => { 'n': 1 } 44056 * 44057 * // The `_.property` iteratee shorthand. 44058 * _.minBy(objects, 'n'); 44059 * // => { 'n': 1 } 44060 */ 44061 function minBy(array, iteratee) { 44062 return (array && array.length) 44063 ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) 44064 : undefined; 44065 } 44066 44067 /** 44068 * Multiply two numbers. 44069 * 44070 * @static 44071 * @memberOf _ 44072 * @since 4.7.0 44073 * @category Math 44074 * @param {number} multiplier The first number in a multiplication. 44075 * @param {number} multiplicand The second number in a multiplication. 44076 * @returns {number} Returns the product. 44077 * @example 44078 * 44079 * _.multiply(6, 4); 44080 * // => 24 44081 */ 44082 var multiply = createMathOperation(function(multiplier, multiplicand) { 44083 return multiplier * multiplicand; 44084 }, 1); 44085 44086 /** 44087 * Computes `number` rounded to `precision`. 44088 * 44089 * @static 44090 * @memberOf _ 44091 * @since 3.10.0 44092 * @category Math 44093 * @param {number} number The number to round. 44094 * @param {number} [precision=0] The precision to round to. 44095 * @returns {number} Returns the rounded number. 44096 * @example 44097 * 44098 * _.round(4.006); 44099 * // => 4 44100 * 44101 * _.round(4.006, 2); 44102 * // => 4.01 44103 * 44104 * _.round(4060, -2); 44105 * // => 4100 44106 */ 44107 var round = createRound('round'); 44108 44109 /** 44110 * Subtract two numbers. 44111 * 44112 * @static 44113 * @memberOf _ 44114 * @since 4.0.0 44115 * @category Math 44116 * @param {number} minuend The first number in a subtraction. 44117 * @param {number} subtrahend The second number in a subtraction. 44118 * @returns {number} Returns the difference. 44119 * @example 44120 * 44121 * _.subtract(6, 4); 44122 * // => 2 44123 */ 44124 var subtract = createMathOperation(function(minuend, subtrahend) { 44125 return minuend - subtrahend; 44126 }, 0); 44127 44128 /** 44129 * Computes the sum of the values in `array`. 44130 * 44131 * @static 44132 * @memberOf _ 44133 * @since 3.4.0 44134 * @category Math 44135 * @param {Array} array The array to iterate over. 44136 * @returns {number} Returns the sum. 44137 * @example 44138 * 44139 * _.sum([4, 2, 8, 6]); 44140 * // => 20 44141 */ 44142 function sum(array) { 44143 return (array && array.length) 44144 ? baseSum(array, identity) 44145 : 0; 44146 } 44147 44148 /** 44149 * This method is like `_.sum` except that it accepts `iteratee` which is 44150 * invoked for each element in `array` to generate the value to be summed. 44151 * The iteratee is invoked with one argument: (value). 44152 * 44153 * @static 44154 * @memberOf _ 44155 * @since 4.0.0 44156 * @category Math 44157 * @param {Array} array The array to iterate over. 44158 * @param {Function} [iteratee=_.identity] The iteratee invoked per element. 44159 * @returns {number} Returns the sum. 44160 * @example 44161 * 44162 * var objects = [{ 'n': 4 }, { 'n': 2 }, { 'n': 8 }, { 'n': 6 }]; 44163 * 44164 * _.sumBy(objects, function(o) { return o.n; }); 44165 * // => 20 44166 * 44167 * // The `_.property` iteratee shorthand. 44168 * _.sumBy(objects, 'n'); 44169 * // => 20 44170 */ 44171 function sumBy(array, iteratee) { 44172 return (array && array.length) 44173 ? baseSum(array, getIteratee(iteratee, 2)) 44174 : 0; 44175 } 44176 44177 /*------------------------------------------------------------------------*/ 44178 44179 // Add methods that return wrapped values in chain sequences. 44180 lodash.after = after; 44181 lodash.ary = ary; 44182 lodash.assign = assign; 44183 lodash.assignIn = assignIn; 44184 lodash.assignInWith = assignInWith; 44185 lodash.assignWith = assignWith; 44186 lodash.at = at; 44187 lodash.before = before; 44188 lodash.bind = bind; 44189 lodash.bindAll = bindAll; 44190 lodash.bindKey = bindKey; 44191 lodash.castArray = castArray; 44192 lodash.chain = chain; 44193 lodash.chunk = chunk; 44194 lodash.compact = compact; 44195 lodash.concat = concat; 44196 lodash.cond = cond; 44197 lodash.conforms = conforms; 44198 lodash.constant = constant; 44199 lodash.countBy = countBy; 44200 lodash.create = create; 44201 lodash.curry = curry; 44202 lodash.curryRight = curryRight; 44203 lodash.debounce = debounce; 44204 lodash.defaults = defaults; 44205 lodash.defaultsDeep = defaultsDeep; 44206 lodash.defer = defer; 44207 lodash.delay = delay; 44208 lodash.difference = difference; 44209 lodash.differenceBy = differenceBy; 44210 lodash.differenceWith = differenceWith; 44211 lodash.drop = drop; 44212 lodash.dropRight = dropRight; 44213 lodash.dropRightWhile = dropRightWhile; 44214 lodash.dropWhile = dropWhile; 44215 lodash.fill = fill; 44216 lodash.filter = filter; 44217 lodash.flatMap = flatMap; 44218 lodash.flatMapDeep = flatMapDeep; 44219 lodash.flatMapDepth = flatMapDepth; 44220 lodash.flatten = flatten; 44221 lodash.flattenDeep = flattenDeep; 44222 lodash.flattenDepth = flattenDepth; 44223 lodash.flip = flip; 44224 lodash.flow = flow; 44225 lodash.flowRight = flowRight; 44226 lodash.fromPairs = fromPairs; 44227 lodash.functions = functions; 44228 lodash.functionsIn = functionsIn; 44229 lodash.groupBy = groupBy; 44230 lodash.initial = initial; 44231 lodash.intersection = intersection; 44232 lodash.intersectionBy = intersectionBy; 44233 lodash.intersectionWith = intersectionWith; 44234 lodash.invert = invert; 44235 lodash.invertBy = invertBy; 44236 lodash.invokeMap = invokeMap; 44237 lodash.iteratee = iteratee; 44238 lodash.keyBy = keyBy; 44239 lodash.keys = keys; 44240 lodash.keysIn = keysIn; 44241 lodash.map = map; 44242 lodash.mapKeys = mapKeys; 44243 lodash.mapValues = mapValues; 44244 lodash.matches = matches; 44245 lodash.matchesProperty = matchesProperty; 44246 lodash.memoize = memoize; 44247 lodash.merge = merge; 44248 lodash.mergeWith = mergeWith; 44249 lodash.method = method; 44250 lodash.methodOf = methodOf; 44251 lodash.mixin = mixin; 44252 lodash.negate = negate; 44253 lodash.nthArg = nthArg; 44254 lodash.omit = omit; 44255 lodash.omitBy = omitBy; 44256 lodash.once = once; 44257 lodash.orderBy = orderBy; 44258 lodash.over = over; 44259 lodash.overArgs = overArgs; 44260 lodash.overEvery = overEvery; 44261 lodash.overSome = overSome; 44262 lodash.partial = partial; 44263 lodash.partialRight = partialRight; 44264 lodash.partition = partition; 44265 lodash.pick = pick; 44266 lodash.pickBy = pickBy; 44267 lodash.property = property; 44268 lodash.propertyOf = propertyOf; 44269 lodash.pull = pull; 44270 lodash.pullAll = pullAll; 44271 lodash.pullAllBy = pullAllBy; 44272 lodash.pullAllWith = pullAllWith; 44273 lodash.pullAt = pullAt; 44274 lodash.range = range; 44275 lodash.rangeRight = rangeRight; 44276 lodash.rearg = rearg; 44277 lodash.reject = reject; 44278 lodash.remove = remove; 44279 lodash.rest = rest; 44280 lodash.reverse = reverse; 44281 lodash.sampleSize = sampleSize; 44282 lodash.set = set; 44283 lodash.setWith = setWith; 44284 lodash.shuffle = shuffle; 44285 lodash.slice = slice; 44286 lodash.sortBy = sortBy; 44287 lodash.sortedUniq = sortedUniq; 44288 lodash.sortedUniqBy = sortedUniqBy; 44289 lodash.split = split; 44290 lodash.spread = spread; 44291 lodash.tail = tail; 44292 lodash.take = take; 44293 lodash.takeRight = takeRight; 44294 lodash.takeRightWhile = takeRightWhile; 44295 lodash.takeWhile = takeWhile; 44296 lodash.tap = tap; 44297 lodash.throttle = throttle; 44298 lodash.thru = thru; 44299 lodash.toArray = toArray; 44300 lodash.toPairs = toPairs; 44301 lodash.toPairsIn = toPairsIn; 44302 lodash.toPath = toPath; 44303 lodash.toPlainObject = toPlainObject; 44304 lodash.transform = transform; 44305 lodash.unary = unary; 44306 lodash.union = union; 44307 lodash.unionBy = unionBy; 44308 lodash.unionWith = unionWith; 44309 lodash.uniq = uniq; 44310 lodash.uniqBy = uniqBy; 44311 lodash.uniqWith = uniqWith; 44312 lodash.unset = unset; 44313 lodash.unzip = unzip; 44314 lodash.unzipWith = unzipWith; 44315 lodash.update = update; 44316 lodash.updateWith = updateWith; 44317 lodash.values = values; 44318 lodash.valuesIn = valuesIn; 44319 lodash.without = without; 44320 lodash.words = words; 44321 lodash.wrap = wrap; 44322 lodash.xor = xor; 44323 lodash.xorBy = xorBy; 44324 lodash.xorWith = xorWith; 44325 lodash.zip = zip; 44326 lodash.zipObject = zipObject; 44327 lodash.zipObjectDeep = zipObjectDeep; 44328 lodash.zipWith = zipWith; 44329 44330 // Add aliases. 44331 lodash.entries = toPairs; 44332 lodash.entriesIn = toPairsIn; 44333 lodash.extend = assignIn; 44334 lodash.extendWith = assignInWith; 44335 44336 // Add methods to `lodash.prototype`. 44337 mixin(lodash, lodash); 44338 44339 /*------------------------------------------------------------------------*/ 44340 44341 // Add methods that return unwrapped values in chain sequences. 44342 lodash.add = add; 44343 lodash.attempt = attempt; 44344 lodash.camelCase = camelCase; 44345 lodash.capitalize = capitalize; 44346 lodash.ceil = ceil; 44347 lodash.clamp = clamp; 44348 lodash.clone = clone; 44349 lodash.cloneDeep = cloneDeep; 44350 lodash.cloneDeepWith = cloneDeepWith; 44351 lodash.cloneWith = cloneWith; 44352 lodash.conformsTo = conformsTo; 44353 lodash.deburr = deburr; 44354 lodash.defaultTo = defaultTo; 44355 lodash.divide = divide; 44356 lodash.endsWith = endsWith; 44357 lodash.eq = eq; 44358 lodash.escape = escape; 44359 lodash.escapeRegExp = escapeRegExp; 44360 lodash.every = every; 44361 lodash.find = find; 44362 lodash.findIndex = findIndex; 44363 lodash.findKey = findKey; 44364 lodash.findLast = findLast; 44365 lodash.findLastIndex = findLastIndex; 44366 lodash.findLastKey = findLastKey; 44367 lodash.floor = floor; 44368 lodash.forEach = forEach; 44369 lodash.forEachRight = forEachRight; 44370 lodash.forIn = forIn; 44371 lodash.forInRight = forInRight; 44372 lodash.forOwn = forOwn; 44373 lodash.forOwnRight = forOwnRight; 44374 lodash.get = get; 44375 lodash.gt = gt; 44376 lodash.gte = gte; 44377 lodash.has = has; 44378 lodash.hasIn = hasIn; 44379 lodash.head = head; 44380 lodash.identity = identity; 44381 lodash.includes = includes; 44382 lodash.indexOf = indexOf; 44383 lodash.inRange = inRange; 44384 lodash.invoke = invoke; 44385 lodash.isArguments = isArguments; 44386 lodash.isArray = isArray; 44387 lodash.isArrayBuffer = isArrayBuffer; 44388 lodash.isArrayLike = isArrayLike; 44389 lodash.isArrayLikeObject = isArrayLikeObject; 44390 lodash.isBoolean = isBoolean; 44391 lodash.isBuffer = isBuffer; 44392 lodash.isDate = isDate; 44393 lodash.isElement = isElement; 44394 lodash.isEmpty = isEmpty; 44395 lodash.isEqual = isEqual; 44396 lodash.isEqualWith = isEqualWith; 44397 lodash.isError = isError; 44398 lodash.isFinite = isFinite; 44399 lodash.isFunction = isFunction; 44400 lodash.isInteger = isInteger; 44401 lodash.isLength = isLength; 44402 lodash.isMap = isMap; 44403 lodash.isMatch = isMatch; 44404 lodash.isMatchWith = isMatchWith; 44405 lodash.isNaN = isNaN; 44406 lodash.isNative = isNative; 44407 lodash.isNil = isNil; 44408 lodash.isNull = isNull; 44409 lodash.isNumber = isNumber; 44410 lodash.isObject = isObject; 44411 lodash.isObjectLike = isObjectLike; 44412 lodash.isPlainObject = isPlainObject; 44413 lodash.isRegExp = isRegExp; 44414 lodash.isSafeInteger = isSafeInteger; 44415 lodash.isSet = isSet; 44416 lodash.isString = isString; 44417 lodash.isSymbol = isSymbol; 44418 lodash.isTypedArray = isTypedArray; 44419 lodash.isUndefined = isUndefined; 44420 lodash.isWeakMap = isWeakMap; 44421 lodash.isWeakSet = isWeakSet; 44422 lodash.join = join; 44423 lodash.kebabCase = kebabCase; 44424 lodash.last = last; 44425 lodash.lastIndexOf = lastIndexOf; 44426 lodash.lowerCase = lowerCase; 44427 lodash.lowerFirst = lowerFirst; 44428 lodash.lt = lt; 44429 lodash.lte = lte; 44430 lodash.max = max; 44431 lodash.maxBy = maxBy; 44432 lodash.mean = mean; 44433 lodash.meanBy = meanBy; 44434 lodash.min = min; 44435 lodash.minBy = minBy; 44436 lodash.stubArray = stubArray; 44437 lodash.stubFalse = stubFalse; 44438 lodash.stubObject = stubObject; 44439 lodash.stubString = stubString; 44440 lodash.stubTrue = stubTrue; 44441 lodash.multiply = multiply; 44442 lodash.nth = nth; 44443 lodash.noConflict = noConflict; 44444 lodash.noop = noop; 44445 lodash.now = now; 44446 lodash.pad = pad; 44447 lodash.padEnd = padEnd; 44448 lodash.padStart = padStart; 44449 lodash.parseInt = parseInt; 44450 lodash.random = random; 44451 lodash.reduce = reduce; 44452 lodash.reduceRight = reduceRight; 44453 lodash.repeat = repeat; 44454 lodash.replace = replace; 44455 lodash.result = result; 44456 lodash.round = round; 44457 lodash.runInContext = runInContext; 44458 lodash.sample = sample; 44459 lodash.size = size; 44460 lodash.snakeCase = snakeCase; 44461 lodash.some = some; 44462 lodash.sortedIndex = sortedIndex; 44463 lodash.sortedIndexBy = sortedIndexBy; 44464 lodash.sortedIndexOf = sortedIndexOf; 44465 lodash.sortedLastIndex = sortedLastIndex; 44466 lodash.sortedLastIndexBy = sortedLastIndexBy; 44467 lodash.sortedLastIndexOf = sortedLastIndexOf; 44468 lodash.startCase = startCase; 44469 lodash.startsWith = startsWith; 44470 lodash.subtract = subtract; 44471 lodash.sum = sum; 44472 lodash.sumBy = sumBy; 44473 lodash.template = template; 44474 lodash.times = times; 44475 lodash.toFinite = toFinite; 44476 lodash.toInteger = toInteger; 44477 lodash.toLength = toLength; 44478 lodash.toLower = toLower; 44479 lodash.toNumber = toNumber; 44480 lodash.toSafeInteger = toSafeInteger; 44481 lodash.toString = toString; 44482 lodash.toUpper = toUpper; 44483 lodash.trim = trim; 44484 lodash.trimEnd = trimEnd; 44485 lodash.trimStart = trimStart; 44486 lodash.truncate = truncate; 44487 lodash.unescape = unescape; 44488 lodash.uniqueId = uniqueId; 44489 lodash.upperCase = upperCase; 44490 lodash.upperFirst = upperFirst; 44491 44492 // Add aliases. 44493 lodash.each = forEach; 44494 lodash.eachRight = forEachRight; 44495 lodash.first = head; 44496 44497 mixin(lodash, (function() { 44498 var source = {}; 44499 baseForOwn(lodash, function(func, methodName) { 44500 if (!hasOwnProperty.call(lodash.prototype, methodName)) { 44501 source[methodName] = func; 44502 } 44503 }); 44504 return source; 44505 }()), { 'chain': false }); 44506 44507 /*------------------------------------------------------------------------*/ 44508 44509 /** 44510 * The semantic version number. 44511 * 44512 * @static 44513 * @memberOf _ 44514 * @type {string} 44515 */ 44516 lodash.VERSION = VERSION; 44517 44518 // Assign default placeholders. 44519 arrayEach(['bind', 'bindKey', 'curry', 'curryRight', 'partial', 'partialRight'], function(methodName) { 44520 lodash[methodName].placeholder = lodash; 44521 }); 44522 44523 // Add `LazyWrapper` methods for `_.drop` and `_.take` variants. 44524 arrayEach(['drop', 'take'], function(methodName, index) { 44525 LazyWrapper.prototype[methodName] = function(n) { 44526 n = n === undefined ? 1 : nativeMax(toInteger(n), 0); 44527 44528 var result = (this.__filtered__ && !index) 44529 ? new LazyWrapper(this) 44530 : this.clone(); 44531 44532 if (result.__filtered__) { 44533 result.__takeCount__ = nativeMin(n, result.__takeCount__); 44534 } else { 44535 result.__views__.push({ 44536 'size': nativeMin(n, MAX_ARRAY_LENGTH), 44537 'type': methodName + (result.__dir__ < 0 ? 'Right' : '') 44538 }); 44539 } 44540 return result; 44541 }; 44542 44543 LazyWrapper.prototype[methodName + 'Right'] = function(n) { 44544 return this.reverse()[methodName](n).reverse(); 44545 }; 44546 }); 44547 44548 // Add `LazyWrapper` methods that accept an `iteratee` value. 44549 arrayEach(['filter', 'map', 'takeWhile'], function(methodName, index) { 44550 var type = index + 1, 44551 isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; 44552 44553 LazyWrapper.prototype[methodName] = function(iteratee) { 44554 var result = this.clone(); 44555 result.__iteratees__.push({ 44556 'iteratee': getIteratee(iteratee, 3), 44557 'type': type 44558 }); 44559 result.__filtered__ = result.__filtered__ || isFilter; 44560 return result; 44561 }; 44562 }); 44563 44564 // Add `LazyWrapper` methods for `_.head` and `_.last`. 44565 arrayEach(['head', 'last'], function(methodName, index) { 44566 var takeName = 'take' + (index ? 'Right' : ''); 44567 44568 LazyWrapper.prototype[methodName] = function() { 44569 return this[takeName](1).value()[0]; 44570 }; 44571 }); 44572 44573 // Add `LazyWrapper` methods for `_.initial` and `_.tail`. 44574 arrayEach(['initial', 'tail'], function(methodName, index) { 44575 var dropName = 'drop' + (index ? '' : 'Right'); 44576 44577 LazyWrapper.prototype[methodName] = function() { 44578 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); 44579 }; 44580 }); 44581 44582 LazyWrapper.prototype.compact = function() { 44583 return this.filter(identity); 44584 }; 44585 44586 LazyWrapper.prototype.find = function(predicate) { 44587 return this.filter(predicate).head(); 44588 }; 44589 44590 LazyWrapper.prototype.findLast = function(predicate) { 44591 return this.reverse().find(predicate); 44592 }; 44593 44594 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { 44595 if (typeof path == 'function') { 44596 return new LazyWrapper(this); 44597 } 44598 return this.map(function(value) { 44599 return baseInvoke(value, path, args); 44600 }); 44601 }); 44602 44603 LazyWrapper.prototype.reject = function(predicate) { 44604 return this.filter(negate(getIteratee(predicate))); 44605 }; 44606 44607 LazyWrapper.prototype.slice = function(start, end) { 44608 start = toInteger(start); 44609 44610 var result = this; 44611 if (result.__filtered__ && (start > 0 || end < 0)) { 44612 return new LazyWrapper(result); 44613 } 44614 if (start < 0) { 44615 result = result.takeRight(-start); 44616 } else if (start) { 44617 result = result.drop(start); 44618 } 44619 if (end !== undefined) { 44620 end = toInteger(end); 44621 result = end < 0 ? result.dropRight(-end) : result.take(end - start); 44622 } 44623 return result; 44624 }; 44625 44626 LazyWrapper.prototype.takeRightWhile = function(predicate) { 44627 return this.reverse().takeWhile(predicate).reverse(); 44628 }; 44629 44630 LazyWrapper.prototype.toArray = function() { 44631 return this.take(MAX_ARRAY_LENGTH); 44632 }; 44633 44634 // Add `LazyWrapper` methods to `lodash.prototype`. 44635 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 44636 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), 44637 isTaker = /^(?:head|last)$/.test(methodName), 44638 lodashFunc = lodash[isTaker ? ('take' + (methodName == 'last' ? 'Right' : '')) : methodName], 44639 retUnwrapped = isTaker || /^find/.test(methodName); 44640 44641 if (!lodashFunc) { 44642 return; 44643 } 44644 lodash.prototype[methodName] = function() { 44645 var value = this.__wrapped__, 44646 args = isTaker ? [1] : arguments, 44647 isLazy = value instanceof LazyWrapper, 44648 iteratee = args[0], 44649 useLazy = isLazy || isArray(value); 44650 44651 var interceptor = function(value) { 44652 var result = lodashFunc.apply(lodash, arrayPush([value], args)); 44653 return (isTaker && chainAll) ? result[0] : result; 44654 }; 44655 44656 if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) { 44657 // Avoid lazy use if the iteratee has a "length" value other than `1`. 44658 isLazy = useLazy = false; 44659 } 44660 var chainAll = this.__chain__, 44661 isHybrid = !!this.__actions__.length, 44662 isUnwrapped = retUnwrapped && !chainAll, 44663 onlyLazy = isLazy && !isHybrid; 44664 44665 if (!retUnwrapped && useLazy) { 44666 value = onlyLazy ? value : new LazyWrapper(this); 44667 var result = func.apply(value, args); 44668 result.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined }); 44669 return new LodashWrapper(result, chainAll); 44670 } 44671 if (isUnwrapped && onlyLazy) { 44672 return func.apply(this, args); 44673 } 44674 result = this.thru(interceptor); 44675 return isUnwrapped ? (isTaker ? result.value()[0] : result.value()) : result; 44676 }; 44677 }); 44678 44679 // Add `Array` methods to `lodash.prototype`. 44680 arrayEach(['pop', 'push', 'shift', 'sort', 'splice', 'unshift'], function(methodName) { 44681 var func = arrayProto[methodName], 44682 chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', 44683 retUnwrapped = /^(?:pop|shift)$/.test(methodName); 44684 44685 lodash.prototype[methodName] = function() { 44686 var args = arguments; 44687 if (retUnwrapped && !this.__chain__) { 44688 var value = this.value(); 44689 return func.apply(isArray(value) ? value : [], args); 44690 } 44691 return this[chainName](function(value) { 44692 return func.apply(isArray(value) ? value : [], args); 44693 }); 44694 }; 44695 }); 44696 44697 // Map minified method names to their real names. 44698 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 44699 var lodashFunc = lodash[methodName]; 44700 if (lodashFunc) { 44701 var key = lodashFunc.name + ''; 44702 if (!hasOwnProperty.call(realNames, key)) { 44703 realNames[key] = []; 44704 } 44705 realNames[key].push({ 'name': methodName, 'func': lodashFunc }); 44706 } 44707 }); 44708 44709 realNames[createHybrid(undefined, WRAP_BIND_KEY_FLAG).name] = [{ 44710 'name': 'wrapper', 44711 'func': undefined 44712 }]; 44713 44714 // Add methods to `LazyWrapper`. 44715 LazyWrapper.prototype.clone = lazyClone; 44716 LazyWrapper.prototype.reverse = lazyReverse; 44717 LazyWrapper.prototype.value = lazyValue; 44718 44719 // Add chain sequence methods to the `lodash` wrapper. 44720 lodash.prototype.at = wrapperAt; 44721 lodash.prototype.chain = wrapperChain; 44722 lodash.prototype.commit = wrapperCommit; 44723 lodash.prototype.next = wrapperNext; 44724 lodash.prototype.plant = wrapperPlant; 44725 lodash.prototype.reverse = wrapperReverse; 44726 lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; 44727 44728 // Add lazy aliases. 44729 lodash.prototype.first = lodash.prototype.head; 44730 44731 if (symIterator) { 44732 lodash.prototype[symIterator] = wrapperToIterator; 44733 } 44734 return lodash; 44735 }); 44736 44737 /*--------------------------------------------------------------------------*/ 44738 44739 // Export lodash. 44740 var _ = runInContext(); 44741 44742 // Some AMD build optimizers, like r.js, check for condition patterns like: 44743 if (true) { 44744 // Expose Lodash on the global object to prevent errors when Lodash is 44745 // loaded by a script tag in the presence of an AMD loader. 44746 // See http://requirejs.org/docs/errors.html#mismatch for more details. 44747 // Use `_.noConflict` to remove Lodash from the global object. 44748 root._ = _; 44749 44750 // Define as an anonymous module so, through path mapping, it can be 44751 // referenced as the "underscore" module. 44752 !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { 44753 return _; 44754 }).call(exports, __webpack_require__, exports, module), 44755 __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); 44756 } 44757 // Check for `exports` after `define` in case a build optimizer adds it. 44758 else {} 44759}.call(this)); 44760 44761/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../webpack/buildin/module.js */ "./node_modules/webpack/buildin/module.js")(module))) 44762 44763/***/ }), 44764
vendor: 89,123 bytes, lines 44765-47394
44765/***/ "./node_modules/popper.js/dist/esm/popper.js": 44766/*!***************************************************!*\ 44767 !*** ./node_modules/popper.js/dist/esm/popper.js ***! 44768 \***************************************************/ 44769/*! exports provided: default */ 44770/***/ (function(module, __webpack_exports__, __webpack_require__) { 44771 44772"use strict"; 44773__webpack_require__.r(__webpack_exports__); 44774/* WEBPACK VAR INJECTION */(function(global) {/**! 44775 * @fileOverview Kickass library to create and place poppers near their reference elements. 44776 * @version 1.16.1 44777 * @license 44778 * Copyright (c) 2016 Federico Zivolo and contributors 44779 * 44780 * Permission is hereby granted, free of charge, to any person obtaining a copy 44781 * of this software and associated documentation files (the "Software"), to deal 44782 * in the Software without restriction, including without limitation the rights 44783 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 44784 * copies of the Software, and to permit persons to whom the Software is 44785 * furnished to do so, subject to the following conditions: 44786 * 44787 * The above copyright notice and this permission notice shall be included in all 44788 * copies or substantial portions of the Software. 44789 * 44790 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44791 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 44792 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 44793 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 44794 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 44795 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 44796 * SOFTWARE. 44797 */ 44798var isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined'; 44799 44800var timeoutDuration = function () { 44801 var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox']; 44802 for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) { 44803 if (isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) { 44804 return 1; 44805 } 44806 } 44807 return 0; 44808}(); 44809 44810function microtaskDebounce(fn) { 44811 var called = false; 44812 return function () { 44813 if (called) { 44814 return; 44815 } 44816 called = true; 44817 window.Promise.resolve().then(function () { 44818 called = false; 44819 fn(); 44820 }); 44821 }; 44822} 44823 44824function taskDebounce(fn) { 44825 var scheduled = false; 44826 return function () { 44827 if (!scheduled) { 44828 scheduled = true; 44829 setTimeout(function () { 44830 scheduled = false; 44831 fn(); 44832 }, timeoutDuration); 44833 } 44834 }; 44835} 44836 44837var supportsMicroTasks = isBrowser && window.Promise; 44838 44839/** 44840* Create a debounced version of a method, that's asynchronously deferred 44841* but called in the minimum time possible. 44842* 44843* @method 44844* @memberof Popper.Utils 44845* @argument {Function} fn 44846* @returns {Function} 44847*/ 44848var debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce; 44849 44850/** 44851 * Check if the given variable is a function 44852 * @method 44853 * @memberof Popper.Utils 44854 * @argument {Any} functionToCheck - variable to check 44855 * @returns {Boolean} answer to: is a function? 44856 */ 44857function isFunction(functionToCheck) { 44858 var getType = {}; 44859 return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]'; 44860} 44861 44862/** 44863 * Get CSS computed property of the given element 44864 * @method 44865 * @memberof Popper.Utils 44866 * @argument {Eement} element 44867 * @argument {String} property 44868 */ 44869function getStyleComputedProperty(element, property) { 44870 if (element.nodeType !== 1) { 44871 return []; 44872 } 44873 // NOTE: 1 DOM access here 44874 var window = element.ownerDocument.defaultView; 44875 var css = window.getComputedStyle(element, null); 44876 return property ? css[property] : css; 44877} 44878 44879/** 44880 * Returns the parentNode or the host of the element 44881 * @method 44882 * @memberof Popper.Utils 44883 * @argument {Element} element 44884 * @returns {Element} parent 44885 */ 44886function getParentNode(element) { 44887 if (element.nodeName === 'HTML') { 44888 return element; 44889 } 44890 return element.parentNode || element.host; 44891} 44892 44893/** 44894 * Returns the scrolling parent of the given element 44895 * @method 44896 * @memberof Popper.Utils 44897 * @argument {Element} element 44898 * @returns {Element} scroll parent 44899 */ 44900function getScrollParent(element) { 44901 // Return body, `getScroll` will take care to get the correct `scrollTop` from it 44902 if (!element) { 44903 return document.body; 44904 } 44905 44906 switch (element.nodeName) { 44907 case 'HTML': 44908 case 'BODY': 44909 return element.ownerDocument.body; 44910 case '#document': 44911 return element.body; 44912 } 44913 44914 // Firefox want us to check `-x` and `-y` variations as well 44915 44916 var _getStyleComputedProp = getStyleComputedProperty(element), 44917 overflow = _getStyleComputedProp.overflow, 44918 overflowX = _getStyleComputedProp.overflowX, 44919 overflowY = _getStyleComputedProp.overflowY; 44920 44921 if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) { 44922 return element; 44923 } 44924 44925 return getScrollParent(getParentNode(element)); 44926} 44927 44928/** 44929 * Returns the reference node of the reference object, or the reference object itself. 44930 * @method 44931 * @memberof Popper.Utils 44932 * @param {Element|Object} reference - the reference element (the popper will be relative to this) 44933 * @returns {Element} parent 44934 */ 44935function getReferenceNode(reference) { 44936 return reference && reference.referenceNode ? reference.referenceNode : reference; 44937} 44938 44939var isIE11 = isBrowser && !!(window.MSInputMethodContext && document.documentMode); 44940var isIE10 = isBrowser && /MSIE 10/.test(navigator.userAgent); 44941 44942/** 44943 * Determines if the browser is Internet Explorer 44944 * @method 44945 * @memberof Popper.Utils 44946 * @param {Number} version to check 44947 * @returns {Boolean} isIE 44948 */ 44949function isIE(version) { 44950 if (version === 11) { 44951 return isIE11; 44952 } 44953 if (version === 10) { 44954 return isIE10; 44955 } 44956 return isIE11 || isIE10; 44957} 44958 44959/** 44960 * Returns the offset parent of the given element 44961 * @method 44962 * @memberof Popper.Utils 44963 * @argument {Element} element 44964 * @returns {Element} offset parent 44965 */ 44966function getOffsetParent(element) { 44967 if (!element) { 44968 return document.documentElement; 44969 } 44970 44971 var noOffsetParent = isIE(10) ? document.body : null; 44972 44973 // NOTE: 1 DOM access here 44974 var offsetParent = element.offsetParent || null; 44975 // Skip hidden elements which don't have an offsetParent 44976 while (offsetParent === noOffsetParent && element.nextElementSibling) { 44977 offsetParent = (element = element.nextElementSibling).offsetParent; 44978 } 44979 44980 var nodeName = offsetParent && offsetParent.nodeName; 44981 44982 if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') { 44983 return element ? element.ownerDocument.documentElement : document.documentElement; 44984 } 44985 44986 // .offsetParent will return the closest TH, TD or TABLE in case 44987 // no offsetParent is present, I hate this job... 44988 if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') { 44989 return getOffsetParent(offsetParent); 44990 } 44991 44992 return offsetParent; 44993} 44994 44995function isOffsetContainer(element) { 44996 var nodeName = element.nodeName; 44997 44998 if (nodeName === 'BODY') { 44999 return false; 45000 } 45001 return nodeName === 'HTML' || getOffsetParent(element.firstElementChild) === element; 45002} 45003 45004/** 45005 * Finds the root node (document, shadowDOM root) of the given element 45006 * @method 45007 * @memberof Popper.Utils 45008 * @argument {Element} node 45009 * @returns {Element} root node 45010 */ 45011function getRoot(node) { 45012 if (node.parentNode !== null) { 45013 return getRoot(node.parentNode); 45014 } 45015 45016 return node; 45017} 45018 45019/** 45020 * Finds the offset parent common to the two provided nodes 45021 * @method 45022 * @memberof Popper.Utils 45023 * @argument {Element} element1 45024 * @argument {Element} element2 45025 * @returns {Element} common offset parent 45026 */ 45027function findCommonOffsetParent(element1, element2) { 45028 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 45029 if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) { 45030 return document.documentElement; 45031 } 45032 45033 // Here we make sure to give as "start" the element that comes first in the DOM 45034 var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING; 45035 var start = order ? element1 : element2; 45036 var end = order ? element2 : element1; 45037 45038 // Get common ancestor container 45039 var range = document.createRange(); 45040 range.setStart(start, 0); 45041 range.setEnd(end, 0); 45042 var commonAncestorContainer = range.commonAncestorContainer; 45043 45044 // Both nodes are inside #document 45045 45046 if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) { 45047 if (isOffsetContainer(commonAncestorContainer)) { 45048 return commonAncestorContainer; 45049 } 45050 45051 return getOffsetParent(commonAncestorContainer); 45052 } 45053 45054 // one of the nodes is inside shadowDOM, find which one 45055 var element1root = getRoot(element1); 45056 if (element1root.host) { 45057 return findCommonOffsetParent(element1root.host, element2); 45058 } else { 45059 return findCommonOffsetParent(element1, getRoot(element2).host); 45060 } 45061} 45062 45063/** 45064 * Gets the scroll value of the given element in the given side (top and left) 45065 * @method 45066 * @memberof Popper.Utils 45067 * @argument {Element} element 45068 * @argument {String} side `top` or `left` 45069 * @returns {number} amount of scrolled pixels 45070 */ 45071function getScroll(element) { 45072 var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top'; 45073 45074 var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft'; 45075 var nodeName = element.nodeName; 45076 45077 if (nodeName === 'BODY' || nodeName === 'HTML') { 45078 var html = element.ownerDocument.documentElement; 45079 var scrollingElement = element.ownerDocument.scrollingElement || html; 45080 return scrollingElement[upperSide]; 45081 } 45082 45083 return element[upperSide]; 45084} 45085 45086/* 45087 * Sum or subtract the element scroll values (left and top) from a given rect object 45088 * @method 45089 * @memberof Popper.Utils 45090 * @param {Object} rect - Rect object you want to change 45091 * @param {HTMLElement} element - The element from the function reads the scroll values 45092 * @param {Boolean} subtract - set to true if you want to subtract the scroll values 45093 * @return {Object} rect - The modifier rect object 45094 */ 45095function includeScroll(rect, element) { 45096 var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 45097 45098 var scrollTop = getScroll(element, 'top'); 45099 var scrollLeft = getScroll(element, 'left'); 45100 var modifier = subtract ? -1 : 1; 45101 rect.top += scrollTop * modifier; 45102 rect.bottom += scrollTop * modifier; 45103 rect.left += scrollLeft * modifier; 45104 rect.right += scrollLeft * modifier; 45105 return rect; 45106} 45107 45108/* 45109 * Helper to detect borders of a given element 45110 * @method 45111 * @memberof Popper.Utils 45112 * @param {CSSStyleDeclaration} styles 45113 * Result of `getStyleComputedProperty` on the given element 45114 * @param {String} axis - `x` or `y` 45115 * @return {number} borders - The borders size of the given axis 45116 */ 45117 45118function getBordersSize(styles, axis) { 45119 var sideA = axis === 'x' ? 'Left' : 'Top'; 45120 var sideB = sideA === 'Left' ? 'Right' : 'Bottom'; 45121 45122 return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']); 45123} 45124 45125function getSize(axis, body, html, computedStyle) { 45126 return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0); 45127} 45128 45129function getWindowSizes(document) { 45130 var body = document.body; 45131 var html = document.documentElement; 45132 var computedStyle = isIE(10) && getComputedStyle(html); 45133 45134 return { 45135 height: getSize('Height', body, html, computedStyle), 45136 width: getSize('Width', body, html, computedStyle) 45137 }; 45138} 45139 45140var classCallCheck = function (instance, Constructor) { 45141 if (!(instance instanceof Constructor)) { 45142 throw new TypeError("Cannot call a class as a function"); 45143 } 45144}; 45145 45146var createClass = function () { 45147 function defineProperties(target, props) { 45148 for (var i = 0; i < props.length; i++) { 45149 var descriptor = props[i]; 45150 descriptor.enumerable = descriptor.enumerable || false; 45151 descriptor.configurable = true; 45152 if ("value" in descriptor) descriptor.writable = true; 45153 Object.defineProperty(target, descriptor.key, descriptor); 45154 } 45155 } 45156 45157 return function (Constructor, protoProps, staticProps) { 45158 if (protoProps) defineProperties(Constructor.prototype, protoProps); 45159 if (staticProps) defineProperties(Constructor, staticProps); 45160 return Constructor; 45161 }; 45162}(); 45163 45164 45165 45166 45167 45168var defineProperty = function (obj, key, value) { 45169 if (key in obj) { 45170 Object.defineProperty(obj, key, { 45171 value: value, 45172 enumerable: true, 45173 configurable: true, 45174 writable: true 45175 }); 45176 } else { 45177 obj[key] = value; 45178 } 45179 45180 return obj; 45181}; 45182 45183var _extends = Object.assign || function (target) { 45184 for (var i = 1; i < arguments.length; i++) { 45185 var source = arguments[i]; 45186 45187 for (var key in source) { 45188 if (Object.prototype.hasOwnProperty.call(source, key)) { 45189 target[key] = source[key]; 45190 } 45191 } 45192 } 45193 45194 return target; 45195}; 45196 45197/** 45198 * Given element offsets, generate an output similar to getBoundingClientRect 45199 * @method 45200 * @memberof Popper.Utils 45201 * @argument {Object} offsets 45202 * @returns {Object} ClientRect like output 45203 */ 45204function getClientRect(offsets) { 45205 return _extends({}, offsets, { 45206 right: offsets.left + offsets.width, 45207 bottom: offsets.top + offsets.height 45208 }); 45209} 45210 45211/** 45212 * Get bounding client rect of given element 45213 * @method 45214 * @memberof Popper.Utils 45215 * @param {HTMLElement} element 45216 * @return {Object} client rect 45217 */ 45218function getBoundingClientRect(element) { 45219 var rect = {}; 45220 45221 // IE10 10 FIX: Please, don't ask, the element isn't 45222 // considered in DOM in some circumstances... 45223 // This isn't reproducible in IE10 compatibility mode of IE11 45224 try { 45225 if (isIE(10)) { 45226 rect = element.getBoundingClientRect(); 45227 var scrollTop = getScroll(element, 'top'); 45228 var scrollLeft = getScroll(element, 'left'); 45229 rect.top += scrollTop; 45230 rect.left += scrollLeft; 45231 rect.bottom += scrollTop; 45232 rect.right += scrollLeft; 45233 } else { 45234 rect = element.getBoundingClientRect(); 45235 } 45236 } catch (e) {} 45237 45238 var result = { 45239 left: rect.left, 45240 top: rect.top, 45241 width: rect.right - rect.left, 45242 height: rect.bottom - rect.top 45243 }; 45244 45245 // subtract scrollbar size from sizes 45246 var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {}; 45247 var width = sizes.width || element.clientWidth || result.width; 45248 var height = sizes.height || element.clientHeight || result.height; 45249 45250 var horizScrollbar = element.offsetWidth - width; 45251 var vertScrollbar = element.offsetHeight - height; 45252 45253 // if an hypothetical scrollbar is detected, we must be sure it's not a `border` 45254 // we make this check conditional for performance reasons 45255 if (horizScrollbar || vertScrollbar) { 45256 var styles = getStyleComputedProperty(element); 45257 horizScrollbar -= getBordersSize(styles, 'x'); 45258 vertScrollbar -= getBordersSize(styles, 'y'); 45259 45260 result.width -= horizScrollbar; 45261 result.height -= vertScrollbar; 45262 } 45263 45264 return getClientRect(result); 45265} 45266 45267function getOffsetRectRelativeToArbitraryNode(children, parent) { 45268 var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; 45269 45270 var isIE10 = isIE(10); 45271 var isHTML = parent.nodeName === 'HTML'; 45272 var childrenRect = getBoundingClientRect(children); 45273 var parentRect = getBoundingClientRect(parent); 45274 var scrollParent = getScrollParent(children); 45275 45276 var styles = getStyleComputedProperty(parent); 45277 var borderTopWidth = parseFloat(styles.borderTopWidth); 45278 var borderLeftWidth = parseFloat(styles.borderLeftWidth); 45279 45280 // In cases where the parent is fixed, we must ignore negative scroll in offset calc 45281 if (fixedPosition && isHTML) { 45282 parentRect.top = Math.max(parentRect.top, 0); 45283 parentRect.left = Math.max(parentRect.left, 0); 45284 } 45285 var offsets = getClientRect({ 45286 top: childrenRect.top - parentRect.top - borderTopWidth, 45287 left: childrenRect.left - parentRect.left - borderLeftWidth, 45288 width: childrenRect.width, 45289 height: childrenRect.height 45290 }); 45291 offsets.marginTop = 0; 45292 offsets.marginLeft = 0; 45293 45294 // Subtract margins of documentElement in case it's being used as parent 45295 // we do this only on HTML because it's the only element that behaves 45296 // differently when margins are applied to it. The margins are included in 45297 // the box of the documentElement, in the other cases not. 45298 if (!isIE10 && isHTML) { 45299 var marginTop = parseFloat(styles.marginTop); 45300 var marginLeft = parseFloat(styles.marginLeft); 45301 45302 offsets.top -= borderTopWidth - marginTop; 45303 offsets.bottom -= borderTopWidth - marginTop; 45304 offsets.left -= borderLeftWidth - marginLeft; 45305 offsets.right -= borderLeftWidth - marginLeft; 45306 45307 // Attach marginTop and marginLeft because in some circumstances we may need them 45308 offsets.marginTop = marginTop; 45309 offsets.marginLeft = marginLeft; 45310 } 45311 45312 if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') { 45313 offsets = includeScroll(offsets, parent); 45314 } 45315 45316 return offsets; 45317} 45318 45319function getViewportOffsetRectRelativeToArtbitraryNode(element) { 45320 var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 45321 45322 var html = element.ownerDocument.documentElement; 45323 var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html); 45324 var width = Math.max(html.clientWidth, window.innerWidth || 0); 45325 var height = Math.max(html.clientHeight, window.innerHeight || 0); 45326 45327 var scrollTop = !excludeScroll ? getScroll(html) : 0; 45328 var scrollLeft = !excludeScroll ? getScroll(html, 'left') : 0; 45329 45330 var offset = { 45331 top: scrollTop - relativeOffset.top + relativeOffset.marginTop, 45332 left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft, 45333 width: width, 45334 height: height 45335 }; 45336 45337 return getClientRect(offset); 45338} 45339 45340/** 45341 * Check if the given element is fixed or is inside a fixed parent 45342 * @method 45343 * @memberof Popper.Utils 45344 * @argument {Element} element 45345 * @argument {Element} customContainer 45346 * @returns {Boolean} answer to "isFixed?" 45347 */ 45348function isFixed(element) { 45349 var nodeName = element.nodeName; 45350 if (nodeName === 'BODY' || nodeName === 'HTML') { 45351 return false; 45352 } 45353 if (getStyleComputedProperty(element, 'position') === 'fixed') { 45354 return true; 45355 } 45356 var parentNode = getParentNode(element); 45357 if (!parentNode) { 45358 return false; 45359 } 45360 return isFixed(parentNode); 45361} 45362 45363/** 45364 * Finds the first parent of an element that has a transformed property defined 45365 * @method 45366 * @memberof Popper.Utils 45367 * @argument {Element} element 45368 * @returns {Element} first transformed parent or documentElement 45369 */ 45370 45371function getFixedPositionOffsetParent(element) { 45372 // This check is needed to avoid errors in case one of the elements isn't defined for any reason 45373 if (!element || !element.parentElement || isIE()) { 45374 return document.documentElement; 45375 } 45376 var el = element.parentElement; 45377 while (el && getStyleComputedProperty(el, 'transform') === 'none') { 45378 el = el.parentElement; 45379 } 45380 return el || document.documentElement; 45381} 45382 45383/** 45384 * Computed the boundaries limits and return them 45385 * @method 45386 * @memberof Popper.Utils 45387 * @param {HTMLElement} popper 45388 * @param {HTMLElement} reference 45389 * @param {number} padding 45390 * @param {HTMLElement} boundariesElement - Element used to define the boundaries 45391 * @param {Boolean} fixedPosition - Is in fixed position mode 45392 * @returns {Object} Coordinates of the boundaries 45393 */ 45394function getBoundaries(popper, reference, padding, boundariesElement) { 45395 var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false; 45396 45397 // NOTE: 1 DOM access here 45398 45399 var boundaries = { top: 0, left: 0 }; 45400 var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 45401 45402 // Handle viewport case 45403 if (boundariesElement === 'viewport') { 45404 boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition); 45405 } else { 45406 // Handle other cases based on DOM element used as boundaries 45407 var boundariesNode = void 0; 45408 if (boundariesElement === 'scrollParent') { 45409 boundariesNode = getScrollParent(getParentNode(reference)); 45410 if (boundariesNode.nodeName === 'BODY') { 45411 boundariesNode = popper.ownerDocument.documentElement; 45412 } 45413 } else if (boundariesElement === 'window') { 45414 boundariesNode = popper.ownerDocument.documentElement; 45415 } else { 45416 boundariesNode = boundariesElement; 45417 } 45418 45419 var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition); 45420 45421 // In case of HTML, we need a different computation 45422 if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) { 45423 var _getWindowSizes = getWindowSizes(popper.ownerDocument), 45424 height = _getWindowSizes.height, 45425 width = _getWindowSizes.width; 45426 45427 boundaries.top += offsets.top - offsets.marginTop; 45428 boundaries.bottom = height + offsets.top; 45429 boundaries.left += offsets.left - offsets.marginLeft; 45430 boundaries.right = width + offsets.left; 45431 } else { 45432 // for all the other DOM elements, this one is good 45433 boundaries = offsets; 45434 } 45435 } 45436 45437 // Add paddings 45438 padding = padding || 0; 45439 var isPaddingNumber = typeof padding === 'number'; 45440 boundaries.left += isPaddingNumber ? padding : padding.left || 0; 45441 boundaries.top += isPaddingNumber ? padding : padding.top || 0; 45442 boundaries.right -= isPaddingNumber ? padding : padding.right || 0; 45443 boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0; 45444 45445 return boundaries; 45446} 45447 45448function getArea(_ref) { 45449 var width = _ref.width, 45450 height = _ref.height; 45451 45452 return width * height; 45453} 45454 45455/** 45456 * Utility used to transform the `auto` placement to the placement with more 45457 * available space. 45458 * @method 45459 * @memberof Popper.Utils 45460 * @argument {Object} data - The data object generated by update method 45461 * @argument {Object} options - Modifiers configuration and options 45462 * @returns {Object} The data object, properly modified 45463 */ 45464function computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) { 45465 var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0; 45466 45467 if (placement.indexOf('auto') === -1) { 45468 return placement; 45469 } 45470 45471 var boundaries = getBoundaries(popper, reference, padding, boundariesElement); 45472 45473 var rects = { 45474 top: { 45475 width: boundaries.width, 45476 height: refRect.top - boundaries.top 45477 }, 45478 right: { 45479 width: boundaries.right - refRect.right, 45480 height: boundaries.height 45481 }, 45482 bottom: { 45483 width: boundaries.width, 45484 height: boundaries.bottom - refRect.bottom 45485 }, 45486 left: { 45487 width: refRect.left - boundaries.left, 45488 height: boundaries.height 45489 } 45490 }; 45491 45492 var sortedAreas = Object.keys(rects).map(function (key) { 45493 return _extends({ 45494 key: key 45495 }, rects[key], { 45496 area: getArea(rects[key]) 45497 }); 45498 }).sort(function (a, b) { 45499 return b.area - a.area; 45500 }); 45501 45502 var filteredAreas = sortedAreas.filter(function (_ref2) { 45503 var width = _ref2.width, 45504 height = _ref2.height; 45505 return width >= popper.clientWidth && height >= popper.clientHeight; 45506 }); 45507 45508 var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key; 45509 45510 var variation = placement.split('-')[1]; 45511 45512 return computedPlacement + (variation ? '-' + variation : ''); 45513} 45514 45515/** 45516 * Get offsets to the reference element 45517 * @method 45518 * @memberof Popper.Utils 45519 * @param {Object} state 45520 * @param {Element} popper - the popper element 45521 * @param {Element} reference - the reference element (the popper will be relative to this) 45522 * @param {Element} fixedPosition - is in fixed position mode 45523 * @returns {Object} An object containing the offsets which will be applied to the popper 45524 */ 45525function getReferenceOffsets(state, popper, reference) { 45526 var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null; 45527 45528 var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference)); 45529 return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition); 45530} 45531 45532/** 45533 * Get the outer sizes of the given element (offset size + margins) 45534 * @method 45535 * @memberof Popper.Utils 45536 * @argument {Element} element 45537 * @returns {Object} object containing width and height properties 45538 */ 45539function getOuterSizes(element) { 45540 var window = element.ownerDocument.defaultView; 45541 var styles = window.getComputedStyle(element); 45542 var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0); 45543 var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0); 45544 var result = { 45545 width: element.offsetWidth + y, 45546 height: element.offsetHeight + x 45547 }; 45548 return result; 45549} 45550 45551/** 45552 * Get the opposite placement of the given one 45553 * @method 45554 * @memberof Popper.Utils 45555 * @argument {String} placement 45556 * @returns {String} flipped placement 45557 */ 45558function getOppositePlacement(placement) { 45559 var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' }; 45560 return placement.replace(/left|right|bottom|top/g, function (matched) { 45561 return hash[matched]; 45562 }); 45563} 45564 45565/** 45566 * Get offsets to the popper 45567 * @method 45568 * @memberof Popper.Utils 45569 * @param {Object} position - CSS position the Popper will get applied 45570 * @param {HTMLElement} popper - the popper element 45571 * @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this) 45572 * @param {String} placement - one of the valid placement options 45573 * @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper 45574 */ 45575function getPopperOffsets(popper, referenceOffsets, placement) { 45576 placement = placement.split('-')[0]; 45577 45578 // Get popper node sizes 45579 var popperRect = getOuterSizes(popper); 45580 45581 // Add position, width and height to our offsets object 45582 var popperOffsets = { 45583 width: popperRect.width, 45584 height: popperRect.height 45585 }; 45586 45587 // depending by the popper placement we have to compute its offsets slightly differently 45588 var isHoriz = ['right', 'left'].indexOf(placement) !== -1; 45589 var mainSide = isHoriz ? 'top' : 'left'; 45590 var secondarySide = isHoriz ? 'left' : 'top'; 45591 var measurement = isHoriz ? 'height' : 'width'; 45592 var secondaryMeasurement = !isHoriz ? 'height' : 'width'; 45593 45594 popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2; 45595 if (placement === secondarySide) { 45596 popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement]; 45597 } else { 45598 popperOffsets[secondarySide] = referenceOffsets[getOppositePlacement(secondarySide)]; 45599 } 45600 45601 return popperOffsets; 45602} 45603 45604/** 45605 * Mimics the `find` method of Array 45606 * @method 45607 * @memberof Popper.Utils 45608 * @argument {Array} arr 45609 * @argument prop 45610 * @argument value 45611 * @returns index or -1 45612 */ 45613function find(arr, check) { 45614 // use native find if supported 45615 if (Array.prototype.find) { 45616 return arr.find(check); 45617 } 45618 45619 // use `filter` to obtain the same behavior of `find` 45620 return arr.filter(check)[0]; 45621} 45622 45623/** 45624 * Return the index of the matching object 45625 * @method 45626 * @memberof Popper.Utils 45627 * @argument {Array} arr 45628 * @argument prop 45629 * @argument value 45630 * @returns index or -1 45631 */ 45632function findIndex(arr, prop, value) { 45633 // use native findIndex if supported 45634 if (Array.prototype.findIndex) { 45635 return arr.findIndex(function (cur) { 45636 return cur[prop] === value; 45637 }); 45638 } 45639 45640 // use `find` + `indexOf` if `findIndex` isn't supported 45641 var match = find(arr, function (obj) { 45642 return obj[prop] === value; 45643 }); 45644 return arr.indexOf(match); 45645} 45646 45647/** 45648 * Loop trough the list of modifiers and run them in order, 45649 * each of them will then edit the data object. 45650 * @method 45651 * @memberof Popper.Utils 45652 * @param {dataObject} data 45653 * @param {Array} modifiers 45654 * @param {String} ends - Optional modifier name used as stopper 45655 * @returns {dataObject} 45656 */ 45657function runModifiers(modifiers, data, ends) { 45658 var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, findIndex(modifiers, 'name', ends)); 45659 45660 modifiersToRun.forEach(function (modifier) { 45661 if (modifier['function']) { 45662 // eslint-disable-line dot-notation 45663 console.warn('`modifier.function` is deprecated, use `modifier.fn`!'); 45664 } 45665 var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation 45666 if (modifier.enabled && isFunction(fn)) { 45667 // Add properties to offsets to make them a complete clientRect object 45668 // we do this before each modifier to make sure the previous one doesn't 45669 // mess with these values 45670 data.offsets.popper = getClientRect(data.offsets.popper); 45671 data.offsets.reference = getClientRect(data.offsets.reference); 45672 45673 data = fn(data, modifier); 45674 } 45675 }); 45676 45677 return data; 45678} 45679 45680/** 45681 * Updates the position of the popper, computing the new offsets and applying 45682 * the new style.<br /> 45683 * Prefer `scheduleUpdate` over `update` because of performance reasons. 45684 * @method 45685 * @memberof Popper 45686 */ 45687function update() { 45688 // if popper is destroyed, don't perform any further update 45689 if (this.state.isDestroyed) { 45690 return; 45691 } 45692 45693 var data = { 45694 instance: this, 45695 styles: {}, 45696 arrowStyles: {}, 45697 attributes: {}, 45698 flipped: false, 45699 offsets: {} 45700 }; 45701 45702 // compute reference element offsets 45703 data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed); 45704 45705 // compute auto placement, store placement inside the data object, 45706 // modifiers will be able to edit `placement` if needed 45707 // and refer to originalPlacement to know the original value 45708 data.placement = computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding); 45709 45710 // store the computed placement inside `originalPlacement` 45711 data.originalPlacement = data.placement; 45712 45713 data.positionFixed = this.options.positionFixed; 45714 45715 // compute the popper offsets 45716 data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement); 45717 45718 data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute'; 45719 45720 // run the modifiers 45721 data = runModifiers(this.modifiers, data); 45722 45723 // the first `update` will call `onCreate` callback 45724 // the other ones will call `onUpdate` callback 45725 if (!this.state.isCreated) { 45726 this.state.isCreated = true; 45727 this.options.onCreate(data); 45728 } else { 45729 this.options.onUpdate(data); 45730 } 45731} 45732 45733/** 45734 * Helper used to know if the given modifier is enabled. 45735 * @method 45736 * @memberof Popper.Utils 45737 * @returns {Boolean} 45738 */ 45739function isModifierEnabled(modifiers, modifierName) { 45740 return modifiers.some(function (_ref) { 45741 var name = _ref.name, 45742 enabled = _ref.enabled; 45743 return enabled && name === modifierName; 45744 }); 45745} 45746 45747/** 45748 * Get the prefixed supported property name 45749 * @method 45750 * @memberof Popper.Utils 45751 * @argument {String} property (camelCase) 45752 * @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix) 45753 */ 45754function getSupportedPropertyName(property) { 45755 var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O']; 45756 var upperProp = property.charAt(0).toUpperCase() + property.slice(1); 45757 45758 for (var i = 0; i < prefixes.length; i++) { 45759 var prefix = prefixes[i]; 45760 var toCheck = prefix ? '' + prefix + upperProp : property; 45761 if (typeof document.body.style[toCheck] !== 'undefined') { 45762 return toCheck; 45763 } 45764 } 45765 return null; 45766} 45767 45768/** 45769 * Destroys the popper. 45770 * @method 45771 * @memberof Popper 45772 */ 45773function destroy() { 45774 this.state.isDestroyed = true; 45775 45776 // touch DOM only if `applyStyle` modifier is enabled 45777 if (isModifierEnabled(this.modifiers, 'applyStyle')) { 45778 this.popper.removeAttribute('x-placement'); 45779 this.popper.style.position = ''; 45780 this.popper.style.top = ''; 45781 this.popper.style.left = ''; 45782 this.popper.style.right = ''; 45783 this.popper.style.bottom = ''; 45784 this.popper.style.willChange = ''; 45785 this.popper.style[getSupportedPropertyName('transform')] = ''; 45786 } 45787 45788 this.disableEventListeners(); 45789 45790 // remove the popper if user explicitly asked for the deletion on destroy 45791 // do not use `remove` because IE11 doesn't support it 45792 if (this.options.removeOnDestroy) { 45793 this.popper.parentNode.removeChild(this.popper); 45794 } 45795 return this; 45796} 45797 45798/** 45799 * Get the window associated with the element 45800 * @argument {Element} element 45801 * @returns {Window} 45802 */ 45803function getWindow(element) { 45804 var ownerDocument = element.ownerDocument; 45805 return ownerDocument ? ownerDocument.defaultView : window; 45806} 45807 45808function attachToScrollParents(scrollParent, event, callback, scrollParents) { 45809 var isBody = scrollParent.nodeName === 'BODY'; 45810 var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent; 45811 target.addEventListener(event, callback, { passive: true }); 45812 45813 if (!isBody) { 45814 attachToScrollParents(getScrollParent(target.parentNode), event, callback, scrollParents); 45815 } 45816 scrollParents.push(target); 45817} 45818 45819/** 45820 * Setup needed event listeners used to update the popper position 45821 * @method 45822 * @memberof Popper.Utils 45823 * @private 45824 */ 45825function setupEventListeners(reference, options, state, updateBound) { 45826 // Resize event listener on window 45827 state.updateBound = updateBound; 45828 getWindow(reference).addEventListener('resize', state.updateBound, { passive: true }); 45829 45830 // Scroll event listener on scroll parents 45831 var scrollElement = getScrollParent(reference); 45832 attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents); 45833 state.scrollElement = scrollElement; 45834 state.eventsEnabled = true; 45835 45836 return state; 45837} 45838 45839/** 45840 * It will add resize/scroll events and start recalculating 45841 * position of the popper element when they are triggered. 45842 * @method 45843 * @memberof Popper 45844 */ 45845function enableEventListeners() { 45846 if (!this.state.eventsEnabled) { 45847 this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate); 45848 } 45849} 45850 45851/** 45852 * Remove event listeners used to update the popper position 45853 * @method 45854 * @memberof Popper.Utils 45855 * @private 45856 */ 45857function removeEventListeners(reference, state) { 45858 // Remove resize event listener on window 45859 getWindow(reference).removeEventListener('resize', state.updateBound); 45860 45861 // Remove scroll event listener on scroll parents 45862 state.scrollParents.forEach(function (target) { 45863 target.removeEventListener('scroll', state.updateBound); 45864 }); 45865 45866 // Reset state 45867 state.updateBound = null; 45868 state.scrollParents = []; 45869 state.scrollElement = null; 45870 state.eventsEnabled = false; 45871 return state; 45872} 45873 45874/** 45875 * It will remove resize/scroll events and won't recalculate popper position 45876 * when they are triggered. It also won't trigger `onUpdate` callback anymore, 45877 * unless you call `update` method manually. 45878 * @method 45879 * @memberof Popper 45880 */ 45881function disableEventListeners() { 45882 if (this.state.eventsEnabled) { 45883 cancelAnimationFrame(this.scheduleUpdate); 45884 this.state = removeEventListeners(this.reference, this.state); 45885 } 45886} 45887 45888/** 45889 * Tells if a given input is a number 45890 * @method 45891 * @memberof Popper.Utils 45892 * @param {*} input to check 45893 * @return {Boolean} 45894 */ 45895function isNumeric(n) { 45896 return n !== '' && !isNaN(parseFloat(n)) && isFinite(n); 45897} 45898 45899/** 45900 * Set the style to the given popper 45901 * @method 45902 * @memberof Popper.Utils 45903 * @argument {Element} element - Element to apply the style to 45904 * @argument {Object} styles 45905 * Object with a list of properties and values which will be applied to the element 45906 */ 45907function setStyles(element, styles) { 45908 Object.keys(styles).forEach(function (prop) { 45909 var unit = ''; 45910 // add unit if the value is numeric and is one of the following 45911 if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) { 45912 unit = 'px'; 45913 } 45914 element.style[prop] = styles[prop] + unit; 45915 }); 45916} 45917 45918/** 45919 * Set the attributes to the given popper 45920 * @method 45921 * @memberof Popper.Utils 45922 * @argument {Element} element - Element to apply the attributes to 45923 * @argument {Object} styles 45924 * Object with a list of properties and values which will be applied to the element 45925 */ 45926function setAttributes(element, attributes) { 45927 Object.keys(attributes).forEach(function (prop) { 45928 var value = attributes[prop]; 45929 if (value !== false) { 45930 element.setAttribute(prop, attributes[prop]); 45931 } else { 45932 element.removeAttribute(prop); 45933 } 45934 }); 45935} 45936 45937/** 45938 * @function 45939 * @memberof Modifiers 45940 * @argument {Object} data - The data object generated by `update` method 45941 * @argument {Object} data.styles - List of style properties - values to apply to popper element 45942 * @argument {Object} data.attributes - List of attribute properties - values to apply to popper element 45943 * @argument {Object} options - Modifiers configuration and options 45944 * @returns {Object} The same data object 45945 */ 45946function applyStyle(data) { 45947 // any property present in `data.styles` will be applied to the popper, 45948 // in this way we can make the 3rd party modifiers add custom styles to it 45949 // Be aware, modifiers could override the properties defined in the previous 45950 // lines of this modifier! 45951 setStyles(data.instance.popper, data.styles); 45952 45953 // any property present in `data.attributes` will be applied to the popper, 45954 // they will be set as HTML attributes of the element 45955 setAttributes(data.instance.popper, data.attributes); 45956 45957 // if arrowElement is defined and arrowStyles has some properties 45958 if (data.arrowElement && Object.keys(data.arrowStyles).length) { 45959 setStyles(data.arrowElement, data.arrowStyles); 45960 } 45961 45962 return data; 45963} 45964 45965/** 45966 * Set the x-placement attribute before everything else because it could be used 45967 * to add margins to the popper margins needs to be calculated to get the 45968 * correct popper offsets. 45969 * @method 45970 * @memberof Popper.modifiers 45971 * @param {HTMLElement} reference - The reference element used to position the popper 45972 * @param {HTMLElement} popper - The HTML element used as popper 45973 * @param {Object} options - Popper.js options 45974 */ 45975function applyStyleOnLoad(reference, popper, options, modifierOptions, state) { 45976 // compute reference element offsets 45977 var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed); 45978 45979 // compute auto placement, store placement inside the data object, 45980 // modifiers will be able to edit `placement` if needed 45981 // and refer to originalPlacement to know the original value 45982 var placement = computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding); 45983 45984 popper.setAttribute('x-placement', placement); 45985 45986 // Apply `position` to popper before anything else because 45987 // without the position applied we can't guarantee correct computations 45988 setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' }); 45989 45990 return options; 45991} 45992 45993/** 45994 * @function 45995 * @memberof Popper.Utils 45996 * @argument {Object} data - The data object generated by `update` method 45997 * @argument {Boolean} shouldRound - If the offsets should be rounded at all 45998 * @returns {Object} The popper's position offsets rounded 45999 * 46000 * The tale of pixel-perfect positioning. It's still not 100% perfect, but as 46001 * good as it can be within reason. 46002 * Discussion here: https://github.com/FezVrasta/popper.js/pull/715 46003 * 46004 * Low DPI screens cause a popper to be blurry if not using full pixels (Safari 46005 * as well on High DPI screens). 46006 * 46007 * Firefox prefers no rounding for positioning and does not have blurriness on 46008 * high DPI screens. 46009 * 46010 * Only horizontal placement and left/right values need to be considered. 46011 */ 46012function getRoundedOffsets(data, shouldRound) { 46013 var _data$offsets = data.offsets, 46014 popper = _data$offsets.popper, 46015 reference = _data$offsets.reference; 46016 var round = Math.round, 46017 floor = Math.floor; 46018 46019 var noRound = function noRound(v) { 46020 return v; 46021 }; 46022 46023 var referenceWidth = round(reference.width); 46024 var popperWidth = round(popper.width); 46025 46026 var isVertical = ['left', 'right'].indexOf(data.placement) !== -1; 46027 var isVariation = data.placement.indexOf('-') !== -1; 46028 var sameWidthParity = referenceWidth % 2 === popperWidth % 2; 46029 var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1; 46030 46031 var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor; 46032 var verticalToInteger = !shouldRound ? noRound : round; 46033 46034 return { 46035 left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left), 46036 top: verticalToInteger(popper.top), 46037 bottom: verticalToInteger(popper.bottom), 46038 right: horizontalToInteger(popper.right) 46039 }; 46040} 46041 46042var isFirefox = isBrowser && /Firefox/i.test(navigator.userAgent); 46043 46044/** 46045 * @function 46046 * @memberof Modifiers 46047 * @argument {Object} data - The data object generated by `update` method 46048 * @argument {Object} options - Modifiers configuration and options 46049 * @returns {Object} The data object, properly modified 46050 */ 46051function computeStyle(data, options) { 46052 var x = options.x, 46053 y = options.y; 46054 var popper = data.offsets.popper; 46055 46056 // Remove this legacy support in Popper.js v2 46057 46058 var legacyGpuAccelerationOption = find(data.instance.modifiers, function (modifier) { 46059 return modifier.name === 'applyStyle'; 46060 }).gpuAcceleration; 46061 if (legacyGpuAccelerationOption !== undefined) { 46062 console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!'); 46063 } 46064 var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration; 46065 46066 var offsetParent = getOffsetParent(data.instance.popper); 46067 var offsetParentRect = getBoundingClientRect(offsetParent); 46068 46069 // Styles 46070 var styles = { 46071 position: popper.position 46072 }; 46073 46074 var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox); 46075 46076 var sideA = x === 'bottom' ? 'top' : 'bottom'; 46077 var sideB = y === 'right' ? 'left' : 'right'; 46078 46079 // if gpuAcceleration is set to `true` and transform is supported, 46080 // we use `translate3d` to apply the position to the popper we 46081 // automatically use the supported prefixed version if needed 46082 var prefixedProperty = getSupportedPropertyName('transform'); 46083 46084 // now, let's make a step back and look at this code closely (wtf?) 46085 // If the content of the popper grows once it's been positioned, it 46086 // may happen that the popper gets misplaced because of the new content 46087 // overflowing its reference element 46088 // To avoid this problem, we provide two options (x and y), which allow 46089 // the consumer to define the offset origin. 46090 // If we position a popper on top of a reference element, we can set 46091 // `x` to `top` to make the popper grow towards its top instead of 46092 // its bottom. 46093 var left = void 0, 46094 top = void 0; 46095 if (sideA === 'bottom') { 46096 // when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar) 46097 // and not the bottom of the html element 46098 if (offsetParent.nodeName === 'HTML') { 46099 top = -offsetParent.clientHeight + offsets.bottom; 46100 } else { 46101 top = -offsetParentRect.height + offsets.bottom; 46102 } 46103 } else { 46104 top = offsets.top; 46105 } 46106 if (sideB === 'right') { 46107 if (offsetParent.nodeName === 'HTML') { 46108 left = -offsetParent.clientWidth + offsets.right; 46109 } else { 46110 left = -offsetParentRect.width + offsets.right; 46111 } 46112 } else { 46113 left = offsets.left; 46114 } 46115 if (gpuAcceleration && prefixedProperty) { 46116 styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)'; 46117 styles[sideA] = 0; 46118 styles[sideB] = 0; 46119 styles.willChange = 'transform'; 46120 } else { 46121 // othwerise, we use the standard `top`, `left`, `bottom` and `right` properties 46122 var invertTop = sideA === 'bottom' ? -1 : 1; 46123 var invertLeft = sideB === 'right' ? -1 : 1; 46124 styles[sideA] = top * invertTop; 46125 styles[sideB] = left * invertLeft; 46126 styles.willChange = sideA + ', ' + sideB; 46127 } 46128 46129 // Attributes 46130 var attributes = { 46131 'x-placement': data.placement 46132 }; 46133 46134 // Update `data` attributes, styles and arrowStyles 46135 data.attributes = _extends({}, attributes, data.attributes); 46136 data.styles = _extends({}, styles, data.styles); 46137 data.arrowStyles = _extends({}, data.offsets.arrow, data.arrowStyles); 46138 46139 return data; 46140} 46141 46142/** 46143 * Helper used to know if the given modifier depends from another one.<br /> 46144 * It checks if the needed modifier is listed and enabled. 46145 * @method 46146 * @memberof Popper.Utils 46147 * @param {Array} modifiers - list of modifiers 46148 * @param {String} requestingName - name of requesting modifier 46149 * @param {String} requestedName - name of requested modifier 46150 * @returns {Boolean} 46151 */ 46152function isModifierRequired(modifiers, requestingName, requestedName) { 46153 var requesting = find(modifiers, function (_ref) { 46154 var name = _ref.name; 46155 return name === requestingName; 46156 }); 46157 46158 var isRequired = !!requesting && modifiers.some(function (modifier) { 46159 return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order; 46160 }); 46161 46162 if (!isRequired) { 46163 var _requesting = '`' + requestingName + '`'; 46164 var requested = '`' + requestedName + '`'; 46165 console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!'); 46166 } 46167 return isRequired; 46168} 46169 46170/** 46171 * @function 46172 * @memberof Modifiers 46173 * @argument {Object} data - The data object generated by update method 46174 * @argument {Object} options - Modifiers configuration and options 46175 * @returns {Object} The data object, properly modified 46176 */ 46177function arrow(data, options) { 46178 var _data$offsets$arrow; 46179 46180 // arrow depends on keepTogether in order to work 46181 if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) { 46182 return data; 46183 } 46184 46185 var arrowElement = options.element; 46186 46187 // if arrowElement is a string, suppose it's a CSS selector 46188 if (typeof arrowElement === 'string') { 46189 arrowElement = data.instance.popper.querySelector(arrowElement); 46190 46191 // if arrowElement is not found, don't run the modifier 46192 if (!arrowElement) { 46193 return data; 46194 } 46195 } else { 46196 // if the arrowElement isn't a query selector we must check that the 46197 // provided DOM node is child of its popper node 46198 if (!data.instance.popper.contains(arrowElement)) { 46199 console.warn('WARNING: `arrow.element` must be child of its popper element!'); 46200 return data; 46201 } 46202 } 46203 46204 var placement = data.placement.split('-')[0]; 46205 var _data$offsets = data.offsets, 46206 popper = _data$offsets.popper, 46207 reference = _data$offsets.reference; 46208 46209 var isVertical = ['left', 'right'].indexOf(placement) !== -1; 46210 46211 var len = isVertical ? 'height' : 'width'; 46212 var sideCapitalized = isVertical ? 'Top' : 'Left'; 46213 var side = sideCapitalized.toLowerCase(); 46214 var altSide = isVertical ? 'left' : 'top'; 46215 var opSide = isVertical ? 'bottom' : 'right'; 46216 var arrowElementSize = getOuterSizes(arrowElement)[len]; 46217 46218 // 46219 // extends keepTogether behavior making sure the popper and its 46220 // reference have enough pixels in conjunction 46221 // 46222 46223 // top/left side 46224 if (reference[opSide] - arrowElementSize < popper[side]) { 46225 data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize); 46226 } 46227 // bottom/right side 46228 if (reference[side] + arrowElementSize > popper[opSide]) { 46229 data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide]; 46230 } 46231 data.offsets.popper = getClientRect(data.offsets.popper); 46232 46233 // compute center of the popper 46234 var center = reference[side] + reference[len] / 2 - arrowElementSize / 2; 46235 46236 // Compute the sideValue using the updated popper offsets 46237 // take popper margin in account because we don't have this info available 46238 var css = getStyleComputedProperty(data.instance.popper); 46239 var popperMarginSide = parseFloat(css['margin' + sideCapitalized]); 46240 var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']); 46241 var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide; 46242 46243 // prevent arrowElement from being placed not contiguously to its popper 46244 sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0); 46245 46246 data.arrowElement = arrowElement; 46247 data.offsets.arrow = (_data$offsets$arrow = {}, defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow); 46248 46249 return data; 46250} 46251 46252/** 46253 * Get the opposite placement variation of the given one 46254 * @method 46255 * @memberof Popper.Utils 46256 * @argument {String} placement variation 46257 * @returns {String} flipped placement variation 46258 */ 46259function getOppositeVariation(variation) { 46260 if (variation === 'end') { 46261 return 'start'; 46262 } else if (variation === 'start') { 46263 return 'end'; 46264 } 46265 return variation; 46266} 46267 46268/** 46269 * List of accepted placements to use as values of the `placement` option.<br /> 46270 * Valid placements are: 46271 * - `auto` 46272 * - `top` 46273 * - `right` 46274 * - `bottom` 46275 * - `left` 46276 * 46277 * Each placement can have a variation from this list: 46278 * - `-start` 46279 * - `-end` 46280 * 46281 * Variations are interpreted easily if you think of them as the left to right 46282 * written languages. Horizontally (`top` and `bottom`), `start` is left and `end` 46283 * is right.<br /> 46284 * Vertically (`left` and `right`), `start` is top and `end` is bottom. 46285 * 46286 * Some valid examples are: 46287 * - `top-end` (on top of reference, right aligned) 46288 * - `right-start` (on right of reference, top aligned) 46289 * - `bottom` (on bottom, centered) 46290 * - `auto-end` (on the side with more space available, alignment depends by placement) 46291 * 46292 * @static 46293 * @type {Array} 46294 * @enum {String} 46295 * @readonly 46296 * @method placements 46297 * @memberof Popper 46298 */ 46299var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start']; 46300 46301// Get rid of `auto` `auto-start` and `auto-end` 46302var validPlacements = placements.slice(3); 46303 46304/** 46305 * Given an initial placement, returns all the subsequent placements 46306 * clockwise (or counter-clockwise). 46307 * 46308 * @method 46309 * @memberof Popper.Utils 46310 * @argument {String} placement - A valid placement (it accepts variations) 46311 * @argument {Boolean} counter - Set to true to walk the placements counterclockwise 46312 * @returns {Array} placements including their variations 46313 */ 46314function clockwise(placement) { 46315 var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 46316 46317 var index = validPlacements.indexOf(placement); 46318 var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index)); 46319 return counter ? arr.reverse() : arr; 46320} 46321 46322var BEHAVIORS = { 46323 FLIP: 'flip', 46324 CLOCKWISE: 'clockwise', 46325 COUNTERCLOCKWISE: 'counterclockwise' 46326}; 46327 46328/** 46329 * @function 46330 * @memberof Modifiers 46331 * @argument {Object} data - The data object generated by update method 46332 * @argument {Object} options - Modifiers configuration and options 46333 * @returns {Object} The data object, properly modified 46334 */ 46335function flip(data, options) { 46336 // if `inner` modifier is enabled, we can't use the `flip` modifier 46337 if (isModifierEnabled(data.instance.modifiers, 'inner')) { 46338 return data; 46339 } 46340 46341 if (data.flipped && data.placement === data.originalPlacement) { 46342 // seems like flip is trying to loop, probably there's not enough space on any of the flippable sides 46343 return data; 46344 } 46345 46346 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed); 46347 46348 var placement = data.placement.split('-')[0]; 46349 var placementOpposite = getOppositePlacement(placement); 46350 var variation = data.placement.split('-')[1] || ''; 46351 46352 var flipOrder = []; 46353 46354 switch (options.behavior) { 46355 case BEHAVIORS.FLIP: 46356 flipOrder = [placement, placementOpposite]; 46357 break; 46358 case BEHAVIORS.CLOCKWISE: 46359 flipOrder = clockwise(placement); 46360 break; 46361 case BEHAVIORS.COUNTERCLOCKWISE: 46362 flipOrder = clockwise(placement, true); 46363 break; 46364 default: 46365 flipOrder = options.behavior; 46366 } 46367 46368 flipOrder.forEach(function (step, index) { 46369 if (placement !== step || flipOrder.length === index + 1) { 46370 return data; 46371 } 46372 46373 placement = data.placement.split('-')[0]; 46374 placementOpposite = getOppositePlacement(placement); 46375 46376 var popperOffsets = data.offsets.popper; 46377 var refOffsets = data.offsets.reference; 46378 46379 // using floor because the reference offsets may contain decimals we are not going to consider here 46380 var floor = Math.floor; 46381 var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom); 46382 46383 var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left); 46384 var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right); 46385 var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top); 46386 var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom); 46387 46388 var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom; 46389 46390 // flip the variation if required 46391 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 46392 46393 // flips variation if reference element overflows boundaries 46394 var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom); 46395 46396 // flips variation if popper content overflows boundaries 46397 var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop); 46398 46399 var flippedVariation = flippedVariationByRef || flippedVariationByContent; 46400 46401 if (overlapsRef || overflowsBoundaries || flippedVariation) { 46402 // this boolean to detect any flip loop 46403 data.flipped = true; 46404 46405 if (overlapsRef || overflowsBoundaries) { 46406 placement = flipOrder[index + 1]; 46407 } 46408 46409 if (flippedVariation) { 46410 variation = getOppositeVariation(variation); 46411 } 46412 46413 data.placement = placement + (variation ? '-' + variation : ''); 46414 46415 // this object contains `position`, we want to preserve it along with 46416 // any additional property we may add in the future 46417 data.offsets.popper = _extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement)); 46418 46419 data = runModifiers(data.instance.modifiers, data, 'flip'); 46420 } 46421 }); 46422 return data; 46423} 46424 46425/** 46426 * @function 46427 * @memberof Modifiers 46428 * @argument {Object} data - The data object generated by update method 46429 * @argument {Object} options - Modifiers configuration and options 46430 * @returns {Object} The data object, properly modified 46431 */ 46432function keepTogether(data) { 46433 var _data$offsets = data.offsets, 46434 popper = _data$offsets.popper, 46435 reference = _data$offsets.reference; 46436 46437 var placement = data.placement.split('-')[0]; 46438 var floor = Math.floor; 46439 var isVertical = ['top', 'bottom'].indexOf(placement) !== -1; 46440 var side = isVertical ? 'right' : 'bottom'; 46441 var opSide = isVertical ? 'left' : 'top'; 46442 var measurement = isVertical ? 'width' : 'height'; 46443 46444 if (popper[side] < floor(reference[opSide])) { 46445 data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement]; 46446 } 46447 if (popper[opSide] > floor(reference[side])) { 46448 data.offsets.popper[opSide] = floor(reference[side]); 46449 } 46450 46451 return data; 46452} 46453 46454/** 46455 * Converts a string containing value + unit into a px value number 46456 * @function 46457 * @memberof {modifiers~offset} 46458 * @private 46459 * @argument {String} str - Value + unit string 46460 * @argument {String} measurement - `height` or `width` 46461 * @argument {Object} popperOffsets 46462 * @argument {Object} referenceOffsets 46463 * @returns {Number|String} 46464 * Value in pixels, or original string if no values were extracted 46465 */ 46466function toValue(str, measurement, popperOffsets, referenceOffsets) { 46467 // separate value from unit 46468 var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/); 46469 var value = +split[1]; 46470 var unit = split[2]; 46471 46472 // If it's not a number it's an operator, I guess 46473 if (!value) { 46474 return str; 46475 } 46476 46477 if (unit.indexOf('%') === 0) { 46478 var element = void 0; 46479 switch (unit) { 46480 case '%p': 46481 element = popperOffsets; 46482 break; 46483 case '%': 46484 case '%r': 46485 default: 46486 element = referenceOffsets; 46487 } 46488 46489 var rect = getClientRect(element); 46490 return rect[measurement] / 100 * value; 46491 } else if (unit === 'vh' || unit === 'vw') { 46492 // if is a vh or vw, we calculate the size based on the viewport 46493 var size = void 0; 46494 if (unit === 'vh') { 46495 size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); 46496 } else { 46497 size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0); 46498 } 46499 return size / 100 * value; 46500 } else { 46501 // if is an explicit pixel unit, we get rid of the unit and keep the value 46502 // if is an implicit unit, it's px, and we return just the value 46503 return value; 46504 } 46505} 46506 46507/** 46508 * Parse an `offset` string to extrapolate `x` and `y` numeric offsets. 46509 * @function 46510 * @memberof {modifiers~offset} 46511 * @private 46512 * @argument {String} offset 46513 * @argument {Object} popperOffsets 46514 * @argument {Object} referenceOffsets 46515 * @argument {String} basePlacement 46516 * @returns {Array} a two cells array with x and y offsets in numbers 46517 */ 46518function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) { 46519 var offsets = [0, 0]; 46520 46521 // Use height if placement is left or right and index is 0 otherwise use width 46522 // in this way the first offset will use an axis and the second one 46523 // will use the other one 46524 var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1; 46525 46526 // Split the offset string to obtain a list of values and operands 46527 // The regex addresses values with the plus or minus sign in front (+10, -20, etc) 46528 var fragments = offset.split(/(\+|\-)/).map(function (frag) { 46529 return frag.trim(); 46530 }); 46531 46532 // Detect if the offset string contains a pair of values or a single one 46533 // they could be separated by comma or space 46534 var divider = fragments.indexOf(find(fragments, function (frag) { 46535 return frag.search(/,|\s/) !== -1; 46536 })); 46537 46538 if (fragments[divider] && fragments[divider].indexOf(',') === -1) { 46539 console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.'); 46540 } 46541 46542 // If divider is found, we divide the list of values and operands to divide 46543 // them by ofset X and Y. 46544 var splitRegex = /\s*,\s*|\s+/; 46545 var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments]; 46546 46547 // Convert the values with units to absolute pixels to allow our computations 46548 ops = ops.map(function (op, index) { 46549 // Most of the units rely on the orientation of the popper 46550 var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width'; 46551 var mergeWithPrevious = false; 46552 return op 46553 // This aggregates any `+` or `-` sign that aren't considered operators 46554 // e.g.: 10 + +5 => [10, +, +5] 46555 .reduce(function (a, b) { 46556 if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) { 46557 a[a.length - 1] = b; 46558 mergeWithPrevious = true; 46559 return a; 46560 } else if (mergeWithPrevious) { 46561 a[a.length - 1] += b; 46562 mergeWithPrevious = false; 46563 return a; 46564 } else { 46565 return a.concat(b); 46566 } 46567 }, []) 46568 // Here we convert the string values into number values (in px) 46569 .map(function (str) { 46570 return toValue(str, measurement, popperOffsets, referenceOffsets); 46571 }); 46572 }); 46573 46574 // Loop trough the offsets arrays and execute the operations 46575 ops.forEach(function (op, index) { 46576 op.forEach(function (frag, index2) { 46577 if (isNumeric(frag)) { 46578 offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1); 46579 } 46580 }); 46581 }); 46582 return offsets; 46583} 46584 46585/** 46586 * @function 46587 * @memberof Modifiers 46588 * @argument {Object} data - The data object generated by update method 46589 * @argument {Object} options - Modifiers configuration and options 46590 * @argument {Number|String} options.offset=0 46591 * The offset value as described in the modifier description 46592 * @returns {Object} The data object, properly modified 46593 */ 46594function offset(data, _ref) { 46595 var offset = _ref.offset; 46596 var placement = data.placement, 46597 _data$offsets = data.offsets, 46598 popper = _data$offsets.popper, 46599 reference = _data$offsets.reference; 46600 46601 var basePlacement = placement.split('-')[0]; 46602 46603 var offsets = void 0; 46604 if (isNumeric(+offset)) { 46605 offsets = [+offset, 0]; 46606 } else { 46607 offsets = parseOffset(offset, popper, reference, basePlacement); 46608 } 46609 46610 if (basePlacement === 'left') { 46611 popper.top += offsets[0]; 46612 popper.left -= offsets[1]; 46613 } else if (basePlacement === 'right') { 46614 popper.top += offsets[0]; 46615 popper.left += offsets[1]; 46616 } else if (basePlacement === 'top') { 46617 popper.left += offsets[0]; 46618 popper.top -= offsets[1]; 46619 } else if (basePlacement === 'bottom') { 46620 popper.left += offsets[0]; 46621 popper.top += offsets[1]; 46622 } 46623 46624 data.popper = popper; 46625 return data; 46626} 46627 46628/** 46629 * @function 46630 * @memberof Modifiers 46631 * @argument {Object} data - The data object generated by `update` method 46632 * @argument {Object} options - Modifiers configuration and options 46633 * @returns {Object} The data object, properly modified 46634 */ 46635function preventOverflow(data, options) { 46636 var boundariesElement = options.boundariesElement || getOffsetParent(data.instance.popper); 46637 46638 // If offsetParent is the reference element, we really want to 46639 // go one step up and use the next offsetParent as reference to 46640 // avoid to make this modifier completely useless and look like broken 46641 if (data.instance.reference === boundariesElement) { 46642 boundariesElement = getOffsetParent(boundariesElement); 46643 } 46644 46645 // NOTE: DOM access here 46646 // resets the popper's position so that the document size can be calculated excluding 46647 // the size of the popper element itself 46648 var transformProp = getSupportedPropertyName('transform'); 46649 var popperStyles = data.instance.popper.style; // assignment to help minification 46650 var top = popperStyles.top, 46651 left = popperStyles.left, 46652 transform = popperStyles[transformProp]; 46653 46654 popperStyles.top = ''; 46655 popperStyles.left = ''; 46656 popperStyles[transformProp] = ''; 46657 46658 var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed); 46659 46660 // NOTE: DOM access here 46661 // restores the original style properties after the offsets have been computed 46662 popperStyles.top = top; 46663 popperStyles.left = left; 46664 popperStyles[transformProp] = transform; 46665 46666 options.boundaries = boundaries; 46667 46668 var order = options.priority; 46669 var popper = data.offsets.popper; 46670 46671 var check = { 46672 primary: function primary(placement) { 46673 var value = popper[placement]; 46674 if (popper[placement] < boundaries[placement] && !options.escapeWithReference) { 46675 value = Math.max(popper[placement], boundaries[placement]); 46676 } 46677 return defineProperty({}, placement, value); 46678 }, 46679 secondary: function secondary(placement) { 46680 var mainSide = placement === 'right' ? 'left' : 'top'; 46681 var value = popper[mainSide]; 46682 if (popper[placement] > boundaries[placement] && !options.escapeWithReference) { 46683 value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height)); 46684 } 46685 return defineProperty({}, mainSide, value); 46686 } 46687 }; 46688 46689 order.forEach(function (placement) { 46690 var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary'; 46691 popper = _extends({}, popper, check[side](placement)); 46692 }); 46693 46694 data.offsets.popper = popper; 46695 46696 return data; 46697} 46698 46699/** 46700 * @function 46701 * @memberof Modifiers 46702 * @argument {Object} data - The data object generated by `update` method 46703 * @argument {Object} options - Modifiers configuration and options 46704 * @returns {Object} The data object, properly modified 46705 */ 46706function shift(data) { 46707 var placement = data.placement; 46708 var basePlacement = placement.split('-')[0]; 46709 var shiftvariation = placement.split('-')[1]; 46710 46711 // if shift shiftvariation is specified, run the modifier 46712 if (shiftvariation) { 46713 var _data$offsets = data.offsets, 46714 reference = _data$offsets.reference, 46715 popper = _data$offsets.popper; 46716 46717 var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1; 46718 var side = isVertical ? 'left' : 'top'; 46719 var measurement = isVertical ? 'width' : 'height'; 46720 46721 var shiftOffsets = { 46722 start: defineProperty({}, side, reference[side]), 46723 end: defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement]) 46724 }; 46725 46726 data.offsets.popper = _extends({}, popper, shiftOffsets[shiftvariation]); 46727 } 46728 46729 return data; 46730} 46731 46732/** 46733 * @function 46734 * @memberof Modifiers 46735 * @argument {Object} data - The data object generated by update method 46736 * @argument {Object} options - Modifiers configuration and options 46737 * @returns {Object} The data object, properly modified 46738 */ 46739function hide(data) { 46740 if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) { 46741 return data; 46742 } 46743 46744 var refRect = data.offsets.reference; 46745 var bound = find(data.instance.modifiers, function (modifier) { 46746 return modifier.name === 'preventOverflow'; 46747 }).boundaries; 46748 46749 if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) { 46750 // Avoid unnecessary DOM access if visibility hasn't changed 46751 if (data.hide === true) { 46752 return data; 46753 } 46754 46755 data.hide = true; 46756 data.attributes['x-out-of-boundaries'] = ''; 46757 } else { 46758 // Avoid unnecessary DOM access if visibility hasn't changed 46759 if (data.hide === false) { 46760 return data; 46761 } 46762 46763 data.hide = false; 46764 data.attributes['x-out-of-boundaries'] = false; 46765 } 46766 46767 return data; 46768} 46769 46770/** 46771 * @function 46772 * @memberof Modifiers 46773 * @argument {Object} data - The data object generated by `update` method 46774 * @argument {Object} options - Modifiers configuration and options 46775 * @returns {Object} The data object, properly modified 46776 */ 46777function inner(data) { 46778 var placement = data.placement; 46779 var basePlacement = placement.split('-')[0]; 46780 var _data$offsets = data.offsets, 46781 popper = _data$offsets.popper, 46782 reference = _data$offsets.reference; 46783 46784 var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1; 46785 46786 var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1; 46787 46788 popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0); 46789 46790 data.placement = getOppositePlacement(placement); 46791 data.offsets.popper = getClientRect(popper); 46792 46793 return data; 46794} 46795 46796/** 46797 * Modifier function, each modifier can have a function of this type assigned 46798 * to its `fn` property.<br /> 46799 * These functions will be called on each update, this means that you must 46800 * make sure they are performant enough to avoid performance bottlenecks. 46801 * 46802 * @function ModifierFn 46803 * @argument {dataObject} data - The data object generated by `update` method 46804 * @argument {Object} options - Modifiers configuration and options 46805 * @returns {dataObject} The data object, properly modified 46806 */ 46807 46808/** 46809 * Modifiers are plugins used to alter the behavior of your poppers.<br /> 46810 * Popper.js uses a set of 9 modifiers to provide all the basic functionalities 46811 * needed by the library. 46812 * 46813 * Usually you don't want to override the `order`, `fn` and `onLoad` props. 46814 * All the other properties are configurations that could be tweaked. 46815 * @namespace modifiers 46816 */ 46817var modifiers = { 46818 /** 46819 * Modifier used to shift the popper on the start or end of its reference 46820 * element.<br /> 46821 * It will read the variation of the `placement` property.<br /> 46822 * It can be one either `-end` or `-start`. 46823 * @memberof modifiers 46824 * @inner 46825 */ 46826 shift: { 46827 /** @prop {number} order=100 - Index used to define the order of execution */ 46828 order: 100, 46829 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46830 enabled: true, 46831 /** @prop {ModifierFn} */ 46832 fn: shift 46833 }, 46834 46835 /** 46836 * The `offset` modifier can shift your popper on both its axis. 46837 * 46838 * It accepts the following units: 46839 * - `px` or unit-less, interpreted as pixels 46840 * - `%` or `%r`, percentage relative to the length of the reference element 46841 * - `%p`, percentage relative to the length of the popper element 46842 * - `vw`, CSS viewport width unit 46843 * - `vh`, CSS viewport height unit 46844 * 46845 * For length is intended the main axis relative to the placement of the popper.<br /> 46846 * This means that if the placement is `top` or `bottom`, the length will be the 46847 * `width`. In case of `left` or `right`, it will be the `height`. 46848 * 46849 * You can provide a single value (as `Number` or `String`), or a pair of values 46850 * as `String` divided by a comma or one (or more) white spaces.<br /> 46851 * The latter is a deprecated method because it leads to confusion and will be 46852 * removed in v2.<br /> 46853 * Additionally, it accepts additions and subtractions between different units. 46854 * Note that multiplications and divisions aren't supported. 46855 * 46856 * Valid examples are: 46857 * ``` 46858 * 10 46859 * '10%' 46860 * '10, 10' 46861 * '10%, 10' 46862 * '10 + 10%' 46863 * '10 - 5vh + 3%' 46864 * '-10px + 5vh, 5px - 6%' 46865 * ``` 46866 * > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap 46867 * > with their reference element, unfortunately, you will have to disable the `flip` modifier. 46868 * > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373). 46869 * 46870 * @memberof modifiers 46871 * @inner 46872 */ 46873 offset: { 46874 /** @prop {number} order=200 - Index used to define the order of execution */ 46875 order: 200, 46876 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46877 enabled: true, 46878 /** @prop {ModifierFn} */ 46879 fn: offset, 46880 /** @prop {Number|String} offset=0 46881 * The offset value as described in the modifier description 46882 */ 46883 offset: 0 46884 }, 46885 46886 /** 46887 * Modifier used to prevent the popper from being positioned outside the boundary. 46888 * 46889 * A scenario exists where the reference itself is not within the boundaries.<br /> 46890 * We can say it has "escaped the boundaries" â or just "escaped".<br /> 46891 * In this case we need to decide whether the popper should either: 46892 * 46893 * - detach from the reference and remain "trapped" in the boundaries, or 46894 * - if it should ignore the boundary and "escape with its reference" 46895 * 46896 * When `escapeWithReference` is set to`true` and reference is completely 46897 * outside its boundaries, the popper will overflow (or completely leave) 46898 * the boundaries in order to remain attached to the edge of the reference. 46899 * 46900 * @memberof modifiers 46901 * @inner 46902 */ 46903 preventOverflow: { 46904 /** @prop {number} order=300 - Index used to define the order of execution */ 46905 order: 300, 46906 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46907 enabled: true, 46908 /** @prop {ModifierFn} */ 46909 fn: preventOverflow, 46910 /** 46911 * @prop {Array} [priority=['left','right','top','bottom']] 46912 * Popper will try to prevent overflow following these priorities by default, 46913 * then, it could overflow on the left and on top of the `boundariesElement` 46914 */ 46915 priority: ['left', 'right', 'top', 'bottom'], 46916 /** 46917 * @prop {number} padding=5 46918 * Amount of pixel used to define a minimum distance between the boundaries 46919 * and the popper. This makes sure the popper always has a little padding 46920 * between the edges of its container 46921 */ 46922 padding: 5, 46923 /** 46924 * @prop {String|HTMLElement} boundariesElement='scrollParent' 46925 * Boundaries used by the modifier. Can be `scrollParent`, `window`, 46926 * `viewport` or any DOM element. 46927 */ 46928 boundariesElement: 'scrollParent' 46929 }, 46930 46931 /** 46932 * Modifier used to make sure the reference and its popper stay near each other 46933 * without leaving any gap between the two. Especially useful when the arrow is 46934 * enabled and you want to ensure that it points to its reference element. 46935 * It cares only about the first axis. You can still have poppers with margin 46936 * between the popper and its reference element. 46937 * @memberof modifiers 46938 * @inner 46939 */ 46940 keepTogether: { 46941 /** @prop {number} order=400 - Index used to define the order of execution */ 46942 order: 400, 46943 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46944 enabled: true, 46945 /** @prop {ModifierFn} */ 46946 fn: keepTogether 46947 }, 46948 46949 /** 46950 * This modifier is used to move the `arrowElement` of the popper to make 46951 * sure it is positioned between the reference element and its popper element. 46952 * It will read the outer size of the `arrowElement` node to detect how many 46953 * pixels of conjunction are needed. 46954 * 46955 * It has no effect if no `arrowElement` is provided. 46956 * @memberof modifiers 46957 * @inner 46958 */ 46959 arrow: { 46960 /** @prop {number} order=500 - Index used to define the order of execution */ 46961 order: 500, 46962 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46963 enabled: true, 46964 /** @prop {ModifierFn} */ 46965 fn: arrow, 46966 /** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */ 46967 element: '[x-arrow]' 46968 }, 46969 46970 /** 46971 * Modifier used to flip the popper's placement when it starts to overlap its 46972 * reference element. 46973 * 46974 * Requires the `preventOverflow` modifier before it in order to work. 46975 * 46976 * **NOTE:** this modifier will interrupt the current update cycle and will 46977 * restart it if it detects the need to flip the placement. 46978 * @memberof modifiers 46979 * @inner 46980 */ 46981 flip: { 46982 /** @prop {number} order=600 - Index used to define the order of execution */ 46983 order: 600, 46984 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 46985 enabled: true, 46986 /** @prop {ModifierFn} */ 46987 fn: flip, 46988 /** 46989 * @prop {String|Array} behavior='flip' 46990 * The behavior used to change the popper's placement. It can be one of 46991 * `flip`, `clockwise`, `counterclockwise` or an array with a list of valid 46992 * placements (with optional variations) 46993 */ 46994 behavior: 'flip', 46995 /** 46996 * @prop {number} padding=5 46997 * The popper will flip if it hits the edges of the `boundariesElement` 46998 */ 46999 padding: 5, 47000 /** 47001 * @prop {String|HTMLElement} boundariesElement='viewport' 47002 * The element which will define the boundaries of the popper position. 47003 * The popper will never be placed outside of the defined boundaries 47004 * (except if `keepTogether` is enabled) 47005 */ 47006 boundariesElement: 'viewport', 47007 /** 47008 * @prop {Boolean} flipVariations=false 47009 * The popper will switch placement variation between `-start` and `-end` when 47010 * the reference element overlaps its boundaries. 47011 * 47012 * The original placement should have a set variation. 47013 */ 47014 flipVariations: false, 47015 /** 47016 * @prop {Boolean} flipVariationsByContent=false 47017 * The popper will switch placement variation between `-start` and `-end` when 47018 * the popper element overlaps its reference boundaries. 47019 * 47020 * The original placement should have a set variation. 47021 */ 47022 flipVariationsByContent: false 47023 }, 47024 47025 /** 47026 * Modifier used to make the popper flow toward the inner of the reference element. 47027 * By default, when this modifier is disabled, the popper will be placed outside 47028 * the reference element. 47029 * @memberof modifiers 47030 * @inner 47031 */ 47032 inner: { 47033 /** @prop {number} order=700 - Index used to define the order of execution */ 47034 order: 700, 47035 /** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */ 47036 enabled: false, 47037 /** @prop {ModifierFn} */ 47038 fn: inner 47039 }, 47040 47041 /** 47042 * Modifier used to hide the popper when its reference element is outside of the 47043 * popper boundaries. It will set a `x-out-of-boundaries` attribute which can 47044 * be used to hide with a CSS selector the popper when its reference is 47045 * out of boundaries. 47046 * 47047 * Requires the `preventOverflow` modifier before it in order to work. 47048 * @memberof modifiers 47049 * @inner 47050 */ 47051 hide: { 47052 /** @prop {number} order=800 - Index used to define the order of execution */ 47053 order: 800, 47054 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47055 enabled: true, 47056 /** @prop {ModifierFn} */ 47057 fn: hide 47058 }, 47059 47060 /** 47061 * Computes the style that will be applied to the popper element to gets 47062 * properly positioned. 47063 * 47064 * Note that this modifier will not touch the DOM, it just prepares the styles 47065 * so that `applyStyle` modifier can apply it. This separation is useful 47066 * in case you need to replace `applyStyle` with a custom implementation. 47067 * 47068 * This modifier has `850` as `order` value to maintain backward compatibility 47069 * with previous versions of Popper.js. Expect the modifiers ordering method 47070 * to change in future major versions of the library. 47071 * 47072 * @memberof modifiers 47073 * @inner 47074 */ 47075 computeStyle: { 47076 /** @prop {number} order=850 - Index used to define the order of execution */ 47077 order: 850, 47078 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47079 enabled: true, 47080 /** @prop {ModifierFn} */ 47081 fn: computeStyle, 47082 /** 47083 * @prop {Boolean} gpuAcceleration=true 47084 * If true, it uses the CSS 3D transformation to position the popper. 47085 * Otherwise, it will use the `top` and `left` properties 47086 */ 47087 gpuAcceleration: true, 47088 /** 47089 * @prop {string} [x='bottom'] 47090 * Where to anchor the X axis (`bottom` or `top`). AKA X offset origin. 47091 * Change this if your popper should grow in a direction different from `bottom` 47092 */ 47093 x: 'bottom', 47094 /** 47095 * @prop {string} [x='left'] 47096 * Where to anchor the Y axis (`left` or `right`). AKA Y offset origin. 47097 * Change this if your popper should grow in a direction different from `right` 47098 */ 47099 y: 'right' 47100 }, 47101 47102 /** 47103 * Applies the computed styles to the popper element. 47104 * 47105 * All the DOM manipulations are limited to this modifier. This is useful in case 47106 * you want to integrate Popper.js inside a framework or view library and you 47107 * want to delegate all the DOM manipulations to it. 47108 * 47109 * Note that if you disable this modifier, you must make sure the popper element 47110 * has its position set to `absolute` before Popper.js can do its work! 47111 * 47112 * Just disable this modifier and define your own to achieve the desired effect. 47113 * 47114 * @memberof modifiers 47115 * @inner 47116 */ 47117 applyStyle: { 47118 /** @prop {number} order=900 - Index used to define the order of execution */ 47119 order: 900, 47120 /** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */ 47121 enabled: true, 47122 /** @prop {ModifierFn} */ 47123 fn: applyStyle, 47124 /** @prop {Function} */ 47125 onLoad: applyStyleOnLoad, 47126 /** 47127 * @deprecated since version 1.10.0, the property moved to `computeStyle` modifier 47128 * @prop {Boolean} gpuAcceleration=true 47129 * If true, it uses the CSS 3D transformation to position the popper. 47130 * Otherwise, it will use the `top` and `left` properties 47131 */ 47132 gpuAcceleration: undefined 47133 } 47134}; 47135 47136/** 47137 * The `dataObject` is an object containing all the information used by Popper.js. 47138 * This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks. 47139 * @name dataObject 47140 * @property {Object} data.instance The Popper.js instance 47141 * @property {String} data.placement Placement applied to popper 47142 * @property {String} data.originalPlacement Placement originally defined on init 47143 * @property {Boolean} data.flipped True if popper has been flipped by flip modifier 47144 * @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper 47145 * @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier 47146 * @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`) 47147 * @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`) 47148 * @property {Object} data.boundaries Offsets of the popper boundaries 47149 * @property {Object} data.offsets The measurements of popper, reference and arrow elements 47150 * @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values 47151 * @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values 47152 * @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0 47153 */ 47154 47155/** 47156 * Default options provided to Popper.js constructor.<br /> 47157 * These can be overridden using the `options` argument of Popper.js.<br /> 47158 * To override an option, simply pass an object with the same 47159 * structure of the `options` object, as the 3rd argument. For example: 47160 * ``` 47161 * new Popper(ref, pop, { 47162 * modifiers: { 47163 * preventOverflow: { enabled: false } 47164 * } 47165 * }) 47166 * ``` 47167 * @type {Object} 47168 * @static 47169 * @memberof Popper 47170 */ 47171var Defaults = { 47172 /** 47173 * Popper's placement. 47174 * @prop {Popper.placements} placement='bottom' 47175 */ 47176 placement: 'bottom', 47177 47178 /** 47179 * Set this to true if you want popper to position it self in 'fixed' mode 47180 * @prop {Boolean} positionFixed=false 47181 */ 47182 positionFixed: false, 47183 47184 /** 47185 * Whether events (resize, scroll) are initially enabled. 47186 * @prop {Boolean} eventsEnabled=true 47187 */ 47188 eventsEnabled: true, 47189 47190 /** 47191 * Set to true if you want to automatically remove the popper when 47192 * you call the `destroy` method. 47193 * @prop {Boolean} removeOnDestroy=false 47194 */ 47195 removeOnDestroy: false, 47196 47197 /** 47198 * Callback called when the popper is created.<br /> 47199 * By default, it is set to no-op.<br /> 47200 * Access Popper.js instance with `data.instance`. 47201 * @prop {onCreate} 47202 */ 47203 onCreate: function onCreate() {}, 47204 47205 /** 47206 * Callback called when the popper is updated. This callback is not called 47207 * on the initialization/creation of the popper, but only on subsequent 47208 * updates.<br /> 47209 * By default, it is set to no-op.<br /> 47210 * Access Popper.js instance with `data.instance`. 47211 * @prop {onUpdate} 47212 */ 47213 onUpdate: function onUpdate() {}, 47214 47215 /** 47216 * List of modifiers used to modify the offsets before they are applied to the popper. 47217 * They provide most of the functionalities of Popper.js. 47218 * @prop {modifiers} 47219 */ 47220 modifiers: modifiers 47221}; 47222 47223/** 47224 * @callback onCreate 47225 * @param {dataObject} data 47226 */ 47227 47228/** 47229 * @callback onUpdate 47230 * @param {dataObject} data 47231 */ 47232 47233// Utils 47234// Methods 47235var Popper = function () { 47236 /** 47237 * Creates a new Popper.js instance. 47238 * @class Popper 47239 * @param {Element|referenceObject} reference - The reference element used to position the popper 47240 * @param {Element} popper - The HTML / XML element used as the popper 47241 * @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults) 47242 * @return {Object} instance - The generated Popper.js instance 47243 */ 47244 function Popper(reference, popper) { 47245 var _this = this; 47246 47247 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; 47248 classCallCheck(this, Popper); 47249 47250 this.scheduleUpdate = function () { 47251 return requestAnimationFrame(_this.update); 47252 }; 47253 47254 // make update() debounced, so that it only runs at most once-per-tick 47255 this.update = debounce(this.update.bind(this)); 47256 47257 // with {} we create a new object with the options inside it 47258 this.options = _extends({}, Popper.Defaults, options); 47259 47260 // init state 47261 this.state = { 47262 isDestroyed: false, 47263 isCreated: false, 47264 scrollParents: [] 47265 }; 47266 47267 // get reference and popper elements (allow jQuery wrappers) 47268 this.reference = reference && reference.jquery ? reference[0] : reference; 47269 this.popper = popper && popper.jquery ? popper[0] : popper; 47270 47271 // Deep merge modifiers options 47272 this.options.modifiers = {}; 47273 Object.keys(_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) { 47274 _this.options.modifiers[name] = _extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {}); 47275 }); 47276 47277 // Refactoring modifiers' list (Object => Array) 47278 this.modifiers = Object.keys(this.options.modifiers).map(function (name) { 47279 return _extends({ 47280 name: name 47281 }, _this.options.modifiers[name]); 47282 }) 47283 // sort the modifiers by order 47284 .sort(function (a, b) { 47285 return a.order - b.order; 47286 }); 47287 47288 // modifiers have the ability to execute arbitrary code when Popper.js get inited 47289 // such code is executed in the same order of its modifier 47290 // they could add new properties to their options configuration 47291 // BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`! 47292 this.modifiers.forEach(function (modifierOptions) { 47293 if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) { 47294 modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state); 47295 } 47296 }); 47297 47298 // fire the first update to position the popper in the right place 47299 this.update(); 47300 47301 var eventsEnabled = this.options.eventsEnabled; 47302 if (eventsEnabled) { 47303 // setup event listeners, they will take care of update the position in specific situations 47304 this.enableEventListeners(); 47305 } 47306 47307 this.state.eventsEnabled = eventsEnabled; 47308 } 47309 47310 // We can't use class properties because they don't get listed in the 47311 // class prototype and break stuff like Sinon stubs 47312 47313 47314 createClass(Popper, [{ 47315 key: 'update', 47316 value: function update$$1() { 47317 return update.call(this); 47318 } 47319 }, { 47320 key: 'destroy', 47321 value: function destroy$$1() { 47322 return destroy.call(this); 47323 } 47324 }, { 47325 key: 'enableEventListeners', 47326 value: function enableEventListeners$$1() { 47327 return enableEventListeners.call(this); 47328 } 47329 }, { 47330 key: 'disableEventListeners', 47331 value: function disableEventListeners$$1() { 47332 return disableEventListeners.call(this); 47333 } 47334 47335 /** 47336 * Schedules an update. It will run on the next UI update available. 47337 * @method scheduleUpdate 47338 * @memberof Popper 47339 */ 47340 47341 47342 /** 47343 * Collection of utilities useful when writing custom modifiers. 47344 * Starting from version 1.7, this method is available only if you 47345 * include `popper-utils.js` before `popper.js`. 47346 * 47347 * **DEPRECATION**: This way to access PopperUtils is deprecated 47348 * and will be removed in v2! Use the PopperUtils module directly instead. 47349 * Due to the high instability of the methods contained in Utils, we can't 47350 * guarantee them to follow semver. Use them at your own risk! 47351 * @static 47352 * @private 47353 * @type {Object} 47354 * @deprecated since version 1.8 47355 * @member Utils 47356 * @memberof Popper 47357 */ 47358 47359 }]); 47360 return Popper; 47361}(); 47362 47363/** 47364 * The `referenceObject` is an object that provides an interface compatible with Popper.js 47365 * and lets you use it as replacement of a real DOM node.<br /> 47366 * You can use this method to position a popper relatively to a set of coordinates 47367 * in case you don't have a DOM node to use as reference. 47368 * 47369 * ``` 47370 * new Popper(referenceObject, popperNode); 47371 * ``` 47372 * 47373 * NB: This feature isn't supported in Internet Explorer 10. 47374 * @name referenceObject 47375 * @property {Function} data.getBoundingClientRect 47376 * A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method. 47377 * @property {number} data.clientWidth 47378 * An ES6 getter that will return the width of the virtual reference element. 47379 * @property {number} data.clientHeight 47380 * An ES6 getter that will return the height of the virtual reference element. 47381 */ 47382 47383 47384Popper.Utils = (typeof window !== 'undefined' ? window : global).PopperUtils; 47385Popper.placements = placements; 47386Popper.Defaults = Defaults; 47387 47388/* harmony default export */ __webpack_exports__["default"] = (Popper); 47389//# sourceMappingURL=popper.js.map 47390 47391/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 47392 47393/***/ }), 47394
vendor: 5,681 bytes, lines 47395-47589
47395/***/ "./node_modules/process/browser.js": 47396/*!*****************************************!*\ 47397 !*** ./node_modules/process/browser.js ***! 47398 \*****************************************/ 47399/*! no static exports found */ 47400/***/ (function(module, exports) { 47401 47402// shim for using process in browser 47403var process = module.exports = {}; 47404 47405// cached from whatever global is present so that test runners that stub it 47406// don't break things. But we need to wrap it in a try catch in case it is 47407// wrapped in strict mode code which doesn't define any globals. It's inside a 47408// function because try/catches deoptimize in certain engines. 47409 47410var cachedSetTimeout; 47411var cachedClearTimeout; 47412 47413function defaultSetTimout() { 47414 throw new Error('setTimeout has not been defined'); 47415} 47416function defaultClearTimeout () { 47417 throw new Error('clearTimeout has not been defined'); 47418} 47419(function () { 47420 try { 47421 if (typeof setTimeout === 'function') { 47422 cachedSetTimeout = setTimeout; 47423 } else { 47424 cachedSetTimeout = defaultSetTimout; 47425 } 47426 } catch (e) { 47427 cachedSetTimeout = defaultSetTimout; 47428 } 47429 try { 47430 if (typeof clearTimeout === 'function') { 47431 cachedClearTimeout = clearTimeout; 47432 } else { 47433 cachedClearTimeout = defaultClearTimeout; 47434 } 47435 } catch (e) { 47436 cachedClearTimeout = defaultClearTimeout; 47437 } 47438} ()) 47439function runTimeout(fun) { 47440 if (cachedSetTimeout === setTimeout) { 47441 //normal enviroments in sane situations 47442 return setTimeout(fun, 0); 47443 } 47444 // if setTimeout wasn't available but was latter defined 47445 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 47446 cachedSetTimeout = setTimeout; 47447 return setTimeout(fun, 0); 47448 } 47449 try { 47450 // when when somebody has screwed with setTimeout but no I.E. maddness 47451 return cachedSetTimeout(fun, 0); 47452 } catch(e){ 47453 try { 47454 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 47455 return cachedSetTimeout.call(null, fun, 0); 47456 } catch(e){ 47457 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 47458 return cachedSetTimeout.call(this, fun, 0); 47459 } 47460 } 47461 47462 47463} 47464function runClearTimeout(marker) { 47465 if (cachedClearTimeout === clearTimeout) { 47466 //normal enviroments in sane situations 47467 return clearTimeout(marker); 47468 } 47469 // if clearTimeout wasn't available but was latter defined 47470 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 47471 cachedClearTimeout = clearTimeout; 47472 return clearTimeout(marker); 47473 } 47474 try { 47475 // when when somebody has screwed with setTimeout but no I.E. maddness 47476 return cachedClearTimeout(marker); 47477 } catch (e){ 47478 try { 47479 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 47480 return cachedClearTimeout.call(null, marker); 47481 } catch (e){ 47482 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 47483 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 47484 return cachedClearTimeout.call(this, marker); 47485 } 47486 } 47487 47488 47489 47490} 47491var queue = []; 47492var draining = false; 47493var currentQueue; 47494var queueIndex = -1; 47495 47496function cleanUpNextTick() { 47497 if (!draining || !currentQueue) { 47498 return; 47499 } 47500 draining = false; 47501 if (currentQueue.length) { 47502 queue = currentQueue.concat(queue); 47503 } else { 47504 queueIndex = -1; 47505 } 47506 if (queue.length) { 47507 drainQueue(); 47508 } 47509} 47510 47511function drainQueue() { 47512 if (draining) { 47513 return; 47514 } 47515 var timeout = runTimeout(cleanUpNextTick); 47516 draining = true; 47517 47518 var len = queue.length; 47519 while(len) { 47520 currentQueue = queue; 47521 queue = []; 47522 while (++queueIndex < len) { 47523 if (currentQueue) { 47524 currentQueue[queueIndex].run(); 47525 } 47526 } 47527 queueIndex = -1; 47528 len = queue.length; 47529 } 47530 currentQueue = null; 47531 draining = false; 47532 runClearTimeout(timeout); 47533} 47534 47535process.nextTick = function (fun) { 47536 var args = new Array(arguments.length - 1); 47537 if (arguments.length > 1) { 47538 for (var i = 1; i < arguments.length; i++) { 47539 args[i - 1] = arguments[i]; 47540 } 47541 } 47542 queue.push(new Item(fun, args)); 47543 if (queue.length === 1 && !draining) { 47544 runTimeout(drainQueue); 47545 } 47546}; 47547 47548// v8 likes predictible objects 47549function Item(fun, array) { 47550 this.fun = fun; 47551 this.array = array; 47552} 47553Item.prototype.run = function () { 47554 this.fun.apply(null, this.array); 47555}; 47556process.title = 'browser'; 47557process.browser = true; 47558process.env = {}; 47559process.argv = []; 47560process.version = ''; // empty string to avoid regexp issues 47561process.versions = {}; 47562 47563function noop() {} 47564 47565process.on = noop; 47566process.addListener = noop; 47567process.once = noop; 47568process.off = noop; 47569process.removeListener = noop; 47570process.removeAllListeners = noop; 47571process.emit = noop; 47572process.prependListener = noop; 47573process.prependOnceListener = noop; 47574 47575process.listeners = function (name) { return [] } 47576 47577process.binding = function (name) { 47578 throw new Error('process.binding is not supported'); 47579}; 47580 47581process.cwd = function () { return '/' }; 47582process.chdir = function (dir) { 47583 throw new Error('process.chdir is not supported'); 47584}; 47585process.umask = function() { return 0; }; 47586 47587 47588/***/ }), 47589
vendor: 7,087 bytes, lines 47590-47787
47590/***/ "./node_modules/setimmediate/setImmediate.js": 47591/*!***************************************************!*\ 47592 !*** ./node_modules/setimmediate/setImmediate.js ***! 47593 \***************************************************/ 47594/*! no static exports found */ 47595/***/ (function(module, exports, __webpack_require__) { 47596 47597/* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) { 47598 "use strict"; 47599 47600 if (global.setImmediate) { 47601 return; 47602 } 47603 47604 var nextHandle = 1; // Spec says greater than zero 47605 var tasksByHandle = {}; 47606 var currentlyRunningATask = false; 47607 var doc = global.document; 47608 var registerImmediate; 47609 47610 function setImmediate(callback) { 47611 // Callback can either be a function or a string 47612 if (typeof callback !== "function") { 47613 callback = new Function("" + callback); 47614 } 47615 // Copy function arguments 47616 var args = new Array(arguments.length - 1); 47617 for (var i = 0; i < args.length; i++) { 47618 args[i] = arguments[i + 1]; 47619 } 47620 // Store and register the task 47621 var task = { callback: callback, args: args }; 47622 tasksByHandle[nextHandle] = task; 47623 registerImmediate(nextHandle); 47624 return nextHandle++; 47625 } 47626 47627 function clearImmediate(handle) { 47628 delete tasksByHandle[handle]; 47629 } 47630 47631 function run(task) { 47632 var callback = task.callback; 47633 var args = task.args; 47634 switch (args.length) { 47635 case 0: 47636 callback(); 47637 break; 47638 case 1: 47639 callback(args[0]); 47640 break; 47641 case 2: 47642 callback(args[0], args[1]); 47643 break; 47644 case 3: 47645 callback(args[0], args[1], args[2]); 47646 break; 47647 default: 47648 callback.apply(undefined, args); 47649 break; 47650 } 47651 } 47652 47653 function runIfPresent(handle) { 47654 // From the spec: "Wait until any invocations of this algorithm started before this one have completed." 47655 // So if we're currently running a task, we'll need to delay this invocation. 47656 if (currentlyRunningATask) { 47657 // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a 47658 // "too much recursion" error. 47659 setTimeout(runIfPresent, 0, handle); 47660 } else { 47661 var task = tasksByHandle[handle]; 47662 if (task) { 47663 currentlyRunningATask = true; 47664 try { 47665 run(task); 47666 } finally { 47667 clearImmediate(handle); 47668 currentlyRunningATask = false; 47669 } 47670 } 47671 } 47672 } 47673 47674 function installNextTickImplementation() { 47675 registerImmediate = function(handle) { 47676 process.nextTick(function () { runIfPresent(handle); }); 47677 }; 47678 } 47679 47680 function canUsePostMessage() { 47681 // The test against `importScripts` prevents this implementation from being installed inside a web worker, 47682 // where `global.postMessage` means something completely different and can't be used for this purpose. 47683 if (global.postMessage && !global.importScripts) { 47684 var postMessageIsAsynchronous = true; 47685 var oldOnMessage = global.onmessage; 47686 global.onmessage = function() { 47687 postMessageIsAsynchronous = false; 47688 }; 47689 global.postMessage("", "*"); 47690 global.onmessage = oldOnMessage; 47691 return postMessageIsAsynchronous; 47692 } 47693 } 47694 47695 function installPostMessageImplementation() { 47696 // Installs an event handler on `global` for the `message` event: see 47697 // * https://developer.mozilla.org/en/DOM/window.postMessage 47698 // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages 47699 47700 var messagePrefix = "setImmediate$" + Math.random() + "$"; 47701 var onGlobalMessage = function(event) { 47702 if (event.source === global && 47703 typeof event.data === "string" && 47704 event.data.indexOf(messagePrefix) === 0) { 47705 runIfPresent(+event.data.slice(messagePrefix.length)); 47706 } 47707 }; 47708 47709 if (global.addEventListener) { 47710 global.addEventListener("message", onGlobalMessage, false); 47711 } else { 47712 global.attachEvent("onmessage", onGlobalMessage); 47713 } 47714 47715 registerImmediate = function(handle) { 47716 global.postMessage(messagePrefix + handle, "*"); 47717 }; 47718 } 47719 47720 function installMessageChannelImplementation() { 47721 var channel = new MessageChannel(); 47722 channel.port1.onmessage = function(event) { 47723 var handle = event.data; 47724 runIfPresent(handle); 47725 }; 47726 47727 registerImmediate = function(handle) { 47728 channel.port2.postMessage(handle); 47729 }; 47730 } 47731 47732 function installReadyStateChangeImplementation() { 47733 var html = doc.documentElement; 47734 registerImmediate = function(handle) { 47735 // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted 47736 // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called. 47737 var script = doc.createElement("script"); 47738 script.onreadystatechange = function () { 47739 runIfPresent(handle); 47740 script.onreadystatechange = null; 47741 html.removeChild(script); 47742 script = null; 47743 }; 47744 html.appendChild(script); 47745 }; 47746 } 47747 47748 function installSetTimeoutImplementation() { 47749 registerImmediate = function(handle) { 47750 setTimeout(runIfPresent, 0, handle); 47751 }; 47752 } 47753 47754 // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live. 47755 var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global); 47756 attachTo = attachTo && attachTo.setTimeout ? attachTo : global; 47757 47758 // Don't get fooled by e.g. browserify environments. 47759 if ({}.toString.call(global.process) === "[object process]") { 47760 // For Node.js before 0.9 47761 installNextTickImplementation(); 47762 47763 } else if (canUsePostMessage()) { 47764 // For non-IE10 modern browsers 47765 installPostMessageImplementation(); 47766 47767 } else if (global.MessageChannel) { 47768 // For web workers, where supported 47769 installMessageChannelImplementation(); 47770 47771 } else if (doc && "onreadystatechange" in doc.createElement("script")) { 47772 // For IE 6â8 47773 installReadyStateChangeImplementation(); 47774 47775 } else { 47776 // For older browsers 47777 installSetTimeoutImplementation(); 47778 } 47779 47780 attachTo.setImmediate = setImmediate; 47781 attachTo.clearImmediate = clearImmediate; 47782}(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self)); 47783 47784/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../process/browser.js */ "./node_modules/process/browser.js"))) 47785 47786/***/ }), 47787
vendor: 10,739 bytes, lines 47788-48196
47788/***/ "./node_modules/style-loader/lib/addStyles.js": 47789/*!****************************************************!*\ 47790 !*** ./node_modules/style-loader/lib/addStyles.js ***! 47791 \****************************************************/ 47792/*! no static exports found */ 47793/***/ (function(module, exports, __webpack_require__) { 47794 47795/* 47796 MIT License http://www.opensource.org/licenses/mit-license.php 47797 Author Tobias Koppers @sokra 47798*/ 47799 47800var stylesInDom = {}; 47801 47802var memoize = function (fn) { 47803 var memo; 47804 47805 return function () { 47806 if (typeof memo === "undefined") memo = fn.apply(this, arguments); 47807 return memo; 47808 }; 47809}; 47810 47811var isOldIE = memoize(function () { 47812 // Test for IE <= 9 as proposed by Browserhacks 47813 // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805 47814 // Tests for existence of standard globals is to allow style-loader 47815 // to operate correctly into non-standard environments 47816 // @see https://github.com/webpack-contrib/style-loader/issues/177 47817 return window && document && document.all && !window.atob; 47818}); 47819 47820var getTarget = function (target, parent) { 47821 if (parent){ 47822 return parent.querySelector(target); 47823 } 47824 return document.querySelector(target); 47825}; 47826 47827var getElement = (function (fn) { 47828 var memo = {}; 47829 47830 return function(target, parent) { 47831 // If passing function in options, then use it for resolve "head" element. 47832 // Useful for Shadow Root style i.e 47833 // { 47834 // insertInto: function () { return document.querySelector("#foo").shadowRoot } 47835 // } 47836 if (typeof target === 'function') { 47837 return target(); 47838 } 47839 if (typeof memo[target] === "undefined") { 47840 var styleTarget = getTarget.call(this, target, parent); 47841 // Special case to return head of iframe instead of iframe itself 47842 if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) { 47843 try { 47844 // This will throw an exception if access to iframe is blocked 47845 // due to cross-origin restrictions 47846 styleTarget = styleTarget.contentDocument.head; 47847 } catch(e) { 47848 styleTarget = null; 47849 } 47850 } 47851 memo[target] = styleTarget; 47852 } 47853 return memo[target] 47854 }; 47855})(); 47856 47857var singleton = null; 47858var singletonCounter = 0; 47859var stylesInsertedAtTop = []; 47860 47861var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js"); 47862 47863module.exports = function(list, options) { 47864 if (typeof DEBUG !== "undefined" && DEBUG) { 47865 if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment"); 47866 } 47867 47868 options = options || {}; 47869 47870 options.attrs = typeof options.attrs === "object" ? options.attrs : {}; 47871 47872 // Force single-tag solution on IE6-9, which has a hard limit on the # of <style> 47873 // tags it will allow on a page 47874 if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE(); 47875 47876 // By default, add <style> tags to the <head> element 47877 if (!options.insertInto) options.insertInto = "head"; 47878 47879 // By default, add <style> tags to the bottom of the target 47880 if (!options.insertAt) options.insertAt = "bottom"; 47881 47882 var styles = listToStyles(list, options); 47883 47884 addStylesToDom(styles, options); 47885 47886 return function update (newList) { 47887 var mayRemove = []; 47888 47889 for (var i = 0; i < styles.length; i++) { 47890 var item = styles[i]; 47891 var domStyle = stylesInDom[item.id]; 47892 47893 domStyle.refs--; 47894 mayRemove.push(domStyle); 47895 } 47896 47897 if(newList) { 47898 var newStyles = listToStyles(newList, options); 47899 addStylesToDom(newStyles, options); 47900 } 47901 47902 for (var i = 0; i < mayRemove.length; i++) { 47903 var domStyle = mayRemove[i]; 47904 47905 if(domStyle.refs === 0) { 47906 for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j](); 47907 47908 delete stylesInDom[domStyle.id]; 47909 } 47910 } 47911 }; 47912}; 47913 47914function addStylesToDom (styles, options) { 47915 for (var i = 0; i < styles.length; i++) { 47916 var item = styles[i]; 47917 var domStyle = stylesInDom[item.id]; 47918 47919 if(domStyle) { 47920 domStyle.refs++; 47921 47922 for(var j = 0; j < domStyle.parts.length; j++) { 47923 domStyle.parts[j](item.parts[j]); 47924 } 47925 47926 for(; j < item.parts.length; j++) { 47927 domStyle.parts.push(addStyle(item.parts[j], options)); 47928 } 47929 } else { 47930 var parts = []; 47931 47932 for(var j = 0; j < item.parts.length; j++) { 47933 parts.push(addStyle(item.parts[j], options)); 47934 } 47935 47936 stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts}; 47937 } 47938 } 47939} 47940 47941function listToStyles (list, options) { 47942 var styles = []; 47943 var newStyles = {}; 47944 47945 for (var i = 0; i < list.length; i++) { 47946 var item = list[i]; 47947 var id = options.base ? item[0] + options.base : item[0]; 47948 var css = item[1]; 47949 var media = item[2]; 47950 var sourceMap = item[3]; 47951 var part = {css: css, media: media, sourceMap: sourceMap}; 47952 47953 if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]}); 47954 else newStyles[id].parts.push(part); 47955 } 47956 47957 return styles; 47958} 47959 47960function insertStyleElement (options, style) { 47961 var target = getElement(options.insertInto) 47962 47963 if (!target) { 47964 throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid."); 47965 } 47966 47967 var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1]; 47968 47969 if (options.insertAt === "top") { 47970 if (!lastStyleElementInsertedAtTop) { 47971 target.insertBefore(style, target.firstChild); 47972 } else if (lastStyleElementInsertedAtTop.nextSibling) { 47973 target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling); 47974 } else { 47975 target.appendChild(style); 47976 } 47977 stylesInsertedAtTop.push(style); 47978 } else if (options.insertAt === "bottom") { 47979 target.appendChild(style); 47980 } else if (typeof options.insertAt === "object" && options.insertAt.before) { 47981 var nextSibling = getElement(options.insertAt.before, target); 47982 target.insertBefore(style, nextSibling); 47983 } else { 47984 throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n"); 47985 } 47986} 47987 47988function removeStyleElement (style) { 47989 if (style.parentNode === null) return false; 47990 style.parentNode.removeChild(style); 47991 47992 var idx = stylesInsertedAtTop.indexOf(style); 47993 if(idx >= 0) { 47994 stylesInsertedAtTop.splice(idx, 1); 47995 } 47996} 47997 47998function createStyleElement (options) { 47999 var style = document.createElement("style"); 48000 48001 if(options.attrs.type === undefined) { 48002 options.attrs.type = "text/css"; 48003 } 48004 48005 if(options.attrs.nonce === undefined) { 48006 var nonce = getNonce(); 48007 if (nonce) { 48008 options.attrs.nonce = nonce; 48009 } 48010 } 48011 48012 addAttrs(style, options.attrs); 48013 insertStyleElement(options, style); 48014 48015 return style; 48016} 48017 48018function createLinkElement (options) { 48019 var link = document.createElement("link"); 48020 48021 if(options.attrs.type === undefined) { 48022 options.attrs.type = "text/css"; 48023 } 48024 options.attrs.rel = "stylesheet"; 48025 48026 addAttrs(link, options.attrs); 48027 insertStyleElement(options, link); 48028 48029 return link; 48030} 48031 48032function addAttrs (el, attrs) { 48033 Object.keys(attrs).forEach(function (key) { 48034 el.setAttribute(key, attrs[key]); 48035 }); 48036} 48037 48038function getNonce() { 48039 if (false) {} 48040 48041 return __webpack_require__.nc; 48042} 48043 48044function addStyle (obj, options) { 48045 var style, update, remove, result; 48046 48047 // If a transform function was defined, run it on the css 48048 if (options.transform && obj.css) { 48049 result = typeof options.transform === 'function' 48050 ? options.transform(obj.css) 48051 : options.transform.default(obj.css); 48052 48053 if (result) { 48054 // If transform returns a value, use that instead of the original css. 48055 // This allows running runtime transformations on the css. 48056 obj.css = result; 48057 } else { 48058 // If the transform function returns a falsy value, don't add this css. 48059 // This allows conditional loading of css 48060 return function() { 48061 // noop 48062 }; 48063 } 48064 } 48065 48066 if (options.singleton) { 48067 var styleIndex = singletonCounter++; 48068 48069 style = singleton || (singleton = createStyleElement(options)); 48070 48071 update = applyToSingletonTag.bind(null, style, styleIndex, false); 48072 remove = applyToSingletonTag.bind(null, style, styleIndex, true); 48073 48074 } else if ( 48075 obj.sourceMap && 48076 typeof URL === "function" && 48077 typeof URL.createObjectURL === "function" && 48078 typeof URL.revokeObjectURL === "function" && 48079 typeof Blob === "function" && 48080 typeof btoa === "function" 48081 ) { 48082 style = createLinkElement(options); 48083 update = updateLink.bind(null, style, options); 48084 remove = function () { 48085 removeStyleElement(style); 48086 48087 if(style.href) URL.revokeObjectURL(style.href); 48088 }; 48089 } else { 48090 style = createStyleElement(options); 48091 update = applyToTag.bind(null, style); 48092 remove = function () { 48093 removeStyleElement(style); 48094 }; 48095 } 48096 48097 update(obj); 48098 48099 return function updateStyle (newObj) { 48100 if (newObj) { 48101 if ( 48102 newObj.css === obj.css && 48103 newObj.media === obj.media && 48104 newObj.sourceMap === obj.sourceMap 48105 ) { 48106 return; 48107 } 48108 48109 update(obj = newObj); 48110 } else { 48111 remove(); 48112 } 48113 }; 48114} 48115 48116var replaceText = (function () { 48117 var textStore = []; 48118 48119 return function (index, replacement) { 48120 textStore[index] = replacement; 48121 48122 return textStore.filter(Boolean).join('\n'); 48123 }; 48124})(); 48125 48126function applyToSingletonTag (style, index, remove, obj) { 48127 var css = remove ? "" : obj.css; 48128 48129 if (style.styleSheet) { 48130 style.styleSheet.cssText = replaceText(index, css); 48131 } else { 48132 var cssNode = document.createTextNode(css); 48133 var childNodes = style.childNodes; 48134 48135 if (childNodes[index]) style.removeChild(childNodes[index]); 48136 48137 if (childNodes.length) { 48138 style.insertBefore(cssNode, childNodes[index]); 48139 } else { 48140 style.appendChild(cssNode); 48141 } 48142 } 48143} 48144 48145function applyToTag (style, obj) { 48146 var css = obj.css; 48147 var media = obj.media; 48148 48149 if(media) { 48150 style.setAttribute("media", media) 48151 } 48152 48153 if(style.styleSheet) { 48154 style.styleSheet.cssText = css; 48155 } else { 48156 while(style.firstChild) { 48157 style.removeChild(style.firstChild); 48158 } 48159 48160 style.appendChild(document.createTextNode(css)); 48161 } 48162} 48163 48164function updateLink (link, options, obj) { 48165 var css = obj.css; 48166 var sourceMap = obj.sourceMap; 48167 48168 /* 48169 If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled 48170 and there is no publicPath defined then lets turn convertToAbsoluteUrls 48171 on by default. Otherwise default to the convertToAbsoluteUrls option 48172 directly 48173 */ 48174 var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap; 48175 48176 if (options.convertToAbsoluteUrls || autoFixUrls) { 48177 css = fixUrls(css); 48178 } 48179 48180 if (sourceMap) { 48181 // http://stackoverflow.com/a/26603875 48182 css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */"; 48183 } 48184 48185 var blob = new Blob([css], { type: "text/css" }); 48186 48187 var oldSrc = link.href; 48188 48189 link.href = URL.createObjectURL(blob); 48190 48191 if(oldSrc) URL.revokeObjectURL(oldSrc); 48192} 48193 48194 48195/***/ }), 48196
vendor: 3,300 bytes, lines 48197-48296
48197/***/ "./node_modules/style-loader/lib/urls.js": 48198/*!***********************************************!*\ 48199 !*** ./node_modules/style-loader/lib/urls.js ***! 48200 \***********************************************/ 48201/*! no static exports found */ 48202/***/ (function(module, exports) { 48203 48204 48205/** 48206 * When source maps are enabled, `style-loader` uses a link element with a data-uri to 48207 * embed the css on the page. This breaks all relative urls because now they are relative to a 48208 * bundle instead of the current page. 48209 * 48210 * One solution is to only use full urls, but that may be impossible. 48211 * 48212 * Instead, this function "fixes" the relative urls to be absolute according to the current page location. 48213 * 48214 * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command. 48215 * 48216 */ 48217 48218module.exports = function (css) { 48219 // get current location 48220 var location = typeof window !== "undefined" && window.location; 48221 48222 if (!location) { 48223 throw new Error("fixUrls requires window.location"); 48224 } 48225 48226 // blank or null? 48227 if (!css || typeof css !== "string") { 48228 return css; 48229 } 48230 48231 var baseUrl = location.protocol + "//" + location.host; 48232 var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/"); 48233 48234 // convert each url(...) 48235 /* 48236 This regular expression is just a way to recursively match brackets within 48237 a string. 48238 48239 /url\s*\( = Match on the word "url" with any whitespace after it and then a parens 48240 ( = Start a capturing group 48241 (?: = Start a non-capturing group 48242 [^)(] = Match anything that isn't a parentheses 48243 | = OR 48244 \( = Match a start parentheses 48245 (?: = Start another non-capturing groups 48246 [^)(]+ = Match anything that isn't a parentheses 48247 | = OR 48248 \( = Match a start parentheses 48249 [^)(]* = Match anything that isn't a parentheses 48250 \) = Match a end parentheses 48251 ) = End Group 48252 *\) = Match anything and then a close parens 48253 ) = Close non-capturing group 48254 * = Match anything 48255 ) = Close capturing group 48256 \) = Match a close parens 48257 48258 /gi = Get all matches, not the first. Be case insensitive. 48259 */ 48260 var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) { 48261 // strip quotes (if they exist) 48262 var unquotedOrigUrl = origUrl 48263 .trim() 48264 .replace(/^"(.*)"$/, function(o, $1){ return $1; }) 48265 .replace(/^'(.*)'$/, function(o, $1){ return $1; }); 48266 48267 // already a full url? no change 48268 if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) { 48269 return fullMatch; 48270 } 48271 48272 // convert the url to a full url 48273 var newUrl; 48274 48275 if (unquotedOrigUrl.indexOf("//") === 0) { 48276 //TODO: should we add protocol? 48277 newUrl = unquotedOrigUrl; 48278 } else if (unquotedOrigUrl.indexOf("/") === 0) { 48279 // path should be relative to the base url 48280 newUrl = baseUrl + unquotedOrigUrl; // already starts with '/' 48281 } else { 48282 // path should be relative to current directory 48283 newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './' 48284 } 48285 48286 // send back the fixed url(...) 48287 return "url(" + JSON.stringify(newUrl) + ")"; 48288 }); 48289 48290 // send back the fixed css 48291 return fixedCss; 48292}; 48293 48294 48295/***/ }), 48296
vendor: 128,340 bytes, lines 48297-51486
48297/***/ "./node_modules/sweetalert2/dist/sweetalert2.all.js": 48298/*!**********************************************************!*\ 48299 !*** ./node_modules/sweetalert2/dist/sweetalert2.all.js ***! 48300 \**********************************************************/ 48301/*! no static exports found */ 48302/***/ (function(module, exports, __webpack_require__) { 48303 48304/*! 48305* sweetalert2 v9.17.2 48306* Released under the MIT License. 48307*/ 48308(function (global, factory) { 48309 true ? module.exports = factory() : 48310 undefined; 48311}(this, function () { 'use strict'; 48312 48313 function _typeof(obj) { 48314 "@babel/helpers - typeof"; 48315 48316 if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { 48317 _typeof = function (obj) { 48318 return typeof obj; 48319 }; 48320 } else { 48321 _typeof = function (obj) { 48322 return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; 48323 }; 48324 } 48325 48326 return _typeof(obj); 48327 } 48328 48329 function _classCallCheck(instance, Constructor) { 48330 if (!(instance instanceof Constructor)) { 48331 throw new TypeError("Cannot call a class as a function"); 48332 } 48333 } 48334 48335 function _defineProperties(target, props) { 48336 for (var i = 0; i < props.length; i++) { 48337 var descriptor = props[i]; 48338 descriptor.enumerable = descriptor.enumerable || false; 48339 descriptor.configurable = true; 48340 if ("value" in descriptor) descriptor.writable = true; 48341 Object.defineProperty(target, descriptor.key, descriptor); 48342 } 48343 } 48344 48345 function _createClass(Constructor, protoProps, staticProps) { 48346 if (protoProps) _defineProperties(Constructor.prototype, protoProps); 48347 if (staticProps) _defineProperties(Constructor, staticProps); 48348 return Constructor; 48349 } 48350 48351 function _extends() { 48352 _extends = Object.assign || function (target) { 48353 for (var i = 1; i < arguments.length; i++) { 48354 var source = arguments[i]; 48355 48356 for (var key in source) { 48357 if (Object.prototype.hasOwnProperty.call(source, key)) { 48358 target[key] = source[key]; 48359 } 48360 } 48361 } 48362 48363 return target; 48364 }; 48365 48366 return _extends.apply(this, arguments); 48367 } 48368 48369 function _inherits(subClass, superClass) { 48370 if (typeof superClass !== "function" && superClass !== null) { 48371 throw new TypeError("Super expression must either be null or a function"); 48372 } 48373 48374 subClass.prototype = Object.create(superClass && superClass.prototype, { 48375 constructor: { 48376 value: subClass, 48377 writable: true, 48378 configurable: true 48379 } 48380 }); 48381 if (superClass) _setPrototypeOf(subClass, superClass); 48382 } 48383 48384 function _getPrototypeOf(o) { 48385 _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { 48386 return o.__proto__ || Object.getPrototypeOf(o); 48387 }; 48388 return _getPrototypeOf(o); 48389 } 48390 48391 function _setPrototypeOf(o, p) { 48392 _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { 48393 o.__proto__ = p; 48394 return o; 48395 }; 48396 48397 return _setPrototypeOf(o, p); 48398 } 48399 48400 function _isNativeReflectConstruct() { 48401 if (typeof Reflect === "undefined" || !Reflect.construct) return false; 48402 if (Reflect.construct.sham) return false; 48403 if (typeof Proxy === "function") return true; 48404 48405 try { 48406 Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); 48407 return true; 48408 } catch (e) { 48409 return false; 48410 } 48411 } 48412 48413 function _construct(Parent, args, Class) { 48414 if (_isNativeReflectConstruct()) { 48415 _construct = Reflect.construct; 48416 } else { 48417 _construct = function _construct(Parent, args, Class) { 48418 var a = [null]; 48419 a.push.apply(a, args); 48420 var Constructor = Function.bind.apply(Parent, a); 48421 var instance = new Constructor(); 48422 if (Class) _setPrototypeOf(instance, Class.prototype); 48423 return instance; 48424 }; 48425 } 48426 48427 return _construct.apply(null, arguments); 48428 } 48429 48430 function _assertThisInitialized(self) { 48431 if (self === void 0) { 48432 throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); 48433 } 48434 48435 return self; 48436 } 48437 48438 function _possibleConstructorReturn(self, call) { 48439 if (call && (typeof call === "object" || typeof call === "function")) { 48440 return call; 48441 } 48442 48443 return _assertThisInitialized(self); 48444 } 48445 48446 function _createSuper(Derived) { 48447 var hasNativeReflectConstruct = _isNativeReflectConstruct(); 48448 48449 return function _createSuperInternal() { 48450 var Super = _getPrototypeOf(Derived), 48451 result; 48452 48453 if (hasNativeReflectConstruct) { 48454 var NewTarget = _getPrototypeOf(this).constructor; 48455 48456 result = Reflect.construct(Super, arguments, NewTarget); 48457 } else { 48458 result = Super.apply(this, arguments); 48459 } 48460 48461 return _possibleConstructorReturn(this, result); 48462 }; 48463 } 48464 48465 function _superPropBase(object, property) { 48466 while (!Object.prototype.hasOwnProperty.call(object, property)) { 48467 object = _getPrototypeOf(object); 48468 if (object === null) break; 48469 } 48470 48471 return object; 48472 } 48473 48474 function _get(target, property, receiver) { 48475 if (typeof Reflect !== "undefined" && Reflect.get) { 48476 _get = Reflect.get; 48477 } else { 48478 _get = function _get(target, property, receiver) { 48479 var base = _superPropBase(target, property); 48480 48481 if (!base) return; 48482 var desc = Object.getOwnPropertyDescriptor(base, property); 48483 48484 if (desc.get) { 48485 return desc.get.call(receiver); 48486 } 48487 48488 return desc.value; 48489 }; 48490 } 48491 48492 return _get(target, property, receiver || target); 48493 } 48494 48495 var consolePrefix = 'SweetAlert2:'; 48496 /** 48497 * Filter the unique values into a new array 48498 * @param arr 48499 */ 48500 48501 var uniqueArray = function uniqueArray(arr) { 48502 var result = []; 48503 48504 for (var i = 0; i < arr.length; i++) { 48505 if (result.indexOf(arr[i]) === -1) { 48506 result.push(arr[i]); 48507 } 48508 } 48509 48510 return result; 48511 }; 48512 /** 48513 * Capitalize the first letter of a string 48514 * @param str 48515 */ 48516 48517 var capitalizeFirstLetter = function capitalizeFirstLetter(str) { 48518 return str.charAt(0).toUpperCase() + str.slice(1); 48519 }; 48520 /** 48521 * Returns the array of object values (Object.values isn't supported in IE11) 48522 * @param obj 48523 */ 48524 48525 var objectValues = function objectValues(obj) { 48526 return Object.keys(obj).map(function (key) { 48527 return obj[key]; 48528 }); 48529 }; 48530 /** 48531 * Convert NodeList to Array 48532 * @param nodeList 48533 */ 48534 48535 var toArray = function toArray(nodeList) { 48536 return Array.prototype.slice.call(nodeList); 48537 }; 48538 /** 48539 * Standardise console warnings 48540 * @param message 48541 */ 48542 48543 var warn = function warn(message) { 48544 console.warn("".concat(consolePrefix, " ").concat(message)); 48545 }; 48546 /** 48547 * Standardise console errors 48548 * @param message 48549 */ 48550 48551 var error = function error(message) { 48552 console.error("".concat(consolePrefix, " ").concat(message)); 48553 }; 48554 /** 48555 * Private global state for `warnOnce` 48556 * @type {Array} 48557 * @private 48558 */ 48559 48560 var previousWarnOnceMessages = []; 48561 /** 48562 * Show a console warning, but only if it hasn't already been shown 48563 * @param message 48564 */ 48565 48566 var warnOnce = function warnOnce(message) { 48567 if (!(previousWarnOnceMessages.indexOf(message) !== -1)) { 48568 previousWarnOnceMessages.push(message); 48569 warn(message); 48570 } 48571 }; 48572 /** 48573 * Show a one-time console warning about deprecated params/methods 48574 */ 48575 48576 var warnAboutDepreation = function warnAboutDepreation(deprecatedParam, useInstead) { 48577 warnOnce("\"".concat(deprecatedParam, "\" is deprecated and will be removed in the next major release. Please use \"").concat(useInstead, "\" instead.")); 48578 }; 48579 /** 48580 * If `arg` is a function, call it (with no arguments or context) and return the result. 48581 * Otherwise, just pass the value through 48582 * @param arg 48583 */ 48584 48585 var callIfFunction = function callIfFunction(arg) { 48586 return typeof arg === 'function' ? arg() : arg; 48587 }; 48588 var hasToPromiseFn = function hasToPromiseFn(arg) { 48589 return arg && typeof arg.toPromise === 'function'; 48590 }; 48591 var asPromise = function asPromise(arg) { 48592 return hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg); 48593 }; 48594 var isPromise = function isPromise(arg) { 48595 return arg && Promise.resolve(arg) === arg; 48596 }; 48597 48598 var DismissReason = Object.freeze({ 48599 cancel: 'cancel', 48600 backdrop: 'backdrop', 48601 close: 'close', 48602 esc: 'esc', 48603 timer: 'timer' 48604 }); 48605 48606 var isJqueryElement = function isJqueryElement(elem) { 48607 return _typeof(elem) === 'object' && elem.jquery; 48608 }; 48609 48610 var isElement = function isElement(elem) { 48611 return elem instanceof Element || isJqueryElement(elem); 48612 }; 48613 48614 var argsToParams = function argsToParams(args) { 48615 var params = {}; 48616 48617 if (_typeof(args[0]) === 'object' && !isElement(args[0])) { 48618 _extends(params, args[0]); 48619 } else { 48620 ['title', 'html', 'icon'].forEach(function (name, index) { 48621 var arg = args[index]; 48622 48623 if (typeof arg === 'string' || isElement(arg)) { 48624 params[name] = arg; 48625 } else if (arg !== undefined) { 48626 error("Unexpected type of ".concat(name, "! Expected \"string\" or \"Element\", got ").concat(_typeof(arg))); 48627 } 48628 }); 48629 } 48630 48631 return params; 48632 }; 48633 48634 var swalPrefix = 'swal2-'; 48635 var prefix = function prefix(items) { 48636 var result = {}; 48637 48638 for (var i in items) { 48639 result[items[i]] = swalPrefix + items[i]; 48640 } 48641 48642 return result; 48643 }; 48644 var swalClasses = prefix(['container', 'shown', 'height-auto', 'iosfix', 'popup', 'modal', 'no-backdrop', 'no-transition', 'toast', 'toast-shown', 'toast-column', 'show', 'hide', 'close', 'title', 'header', 'content', 'html-container', 'actions', 'confirm', 'cancel', 'footer', 'icon', 'icon-content', 'image', 'input', 'file', 'range', 'select', 'radio', 'checkbox', 'label', 'textarea', 'inputerror', 'validation-message', 'progress-steps', 'active-progress-step', 'progress-step', 'progress-step-line', 'loading', 'styled', 'top', 'top-start', 'top-end', 'top-left', 'top-right', 'center', 'center-start', 'center-end', 'center-left', 'center-right', 'bottom', 'bottom-start', 'bottom-end', 'bottom-left', 'bottom-right', 'grow-row', 'grow-column', 'grow-fullscreen', 'rtl', 'timer-progress-bar', 'timer-progress-bar-container', 'scrollbar-measure', 'icon-success', 'icon-warning', 'icon-info', 'icon-question', 'icon-error']); 48645 var iconTypes = prefix(['success', 'warning', 'info', 'question', 'error']); 48646 48647 var getContainer = function getContainer() { 48648 return document.body.querySelector(".".concat(swalClasses.container)); 48649 }; 48650 var elementBySelector = function elementBySelector(selectorString) { 48651 var container = getContainer(); 48652 return container ? container.querySelector(selectorString) : null; 48653 }; 48654 48655 var elementByClass = function elementByClass(className) { 48656 return elementBySelector(".".concat(className)); 48657 }; 48658 48659 var getPopup = function getPopup() { 48660 return elementByClass(swalClasses.popup); 48661 }; 48662 var getIcons = function getIcons() { 48663 var popup = getPopup(); 48664 return toArray(popup.querySelectorAll(".".concat(swalClasses.icon))); 48665 }; 48666 var getIcon = function getIcon() { 48667 var visibleIcon = getIcons().filter(function (icon) { 48668 return isVisible(icon); 48669 }); 48670 return visibleIcon.length ? visibleIcon[0] : null; 48671 }; 48672 var getTitle = function getTitle() { 48673 return elementByClass(swalClasses.title); 48674 }; 48675 var getContent = function getContent() { 48676 return elementByClass(swalClasses.content); 48677 }; 48678 var getHtmlContainer = function getHtmlContainer() { 48679 return elementByClass(swalClasses['html-container']); 48680 }; 48681 var getImage = function getImage() { 48682 return elementByClass(swalClasses.image); 48683 }; 48684 var getProgressSteps = function getProgressSteps() { 48685 return elementByClass(swalClasses['progress-steps']); 48686 }; 48687 var getValidationMessage = function getValidationMessage() { 48688 return elementByClass(swalClasses['validation-message']); 48689 }; 48690 var getConfirmButton = function getConfirmButton() { 48691 return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.confirm)); 48692 }; 48693 var getCancelButton = function getCancelButton() { 48694 return elementBySelector(".".concat(swalClasses.actions, " .").concat(swalClasses.cancel)); 48695 }; 48696 var getActions = function getActions() { 48697 return elementByClass(swalClasses.actions); 48698 }; 48699 var getHeader = function getHeader() { 48700 return elementByClass(swalClasses.header); 48701 }; 48702 var getFooter = function getFooter() { 48703 return elementByClass(swalClasses.footer); 48704 }; 48705 var getTimerProgressBar = function getTimerProgressBar() { 48706 return elementByClass(swalClasses['timer-progress-bar']); 48707 }; 48708 var getCloseButton = function getCloseButton() { 48709 return elementByClass(swalClasses.close); 48710 }; // https://github.com/jkup/focusable/blob/master/index.js 48711 48712 var focusable = "\n a[href],\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n [tabindex=\"0\"],\n [contenteditable],\n audio[controls],\n video[controls],\n summary\n"; 48713 var getFocusableElements = function getFocusableElements() { 48714 var focusableElementsWithTabindex = toArray(getPopup().querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])')) // sort according to tabindex 48715 .sort(function (a, b) { 48716 a = parseInt(a.getAttribute('tabindex')); 48717 b = parseInt(b.getAttribute('tabindex')); 48718 48719 if (a > b) { 48720 return 1; 48721 } else if (a < b) { 48722 return -1; 48723 } 48724 48725 return 0; 48726 }); 48727 var otherFocusableElements = toArray(getPopup().querySelectorAll(focusable)).filter(function (el) { 48728 return el.getAttribute('tabindex') !== '-1'; 48729 }); 48730 return uniqueArray(focusableElementsWithTabindex.concat(otherFocusableElements)).filter(function (el) { 48731 return isVisible(el); 48732 }); 48733 }; 48734 var isModal = function isModal() { 48735 return !isToast() && !document.body.classList.contains(swalClasses['no-backdrop']); 48736 }; 48737 var isToast = function isToast() { 48738 return document.body.classList.contains(swalClasses['toast-shown']); 48739 }; 48740 var isLoading = function isLoading() { 48741 return getPopup().hasAttribute('data-loading'); 48742 }; 48743 48744 var states = { 48745 previousBodyPadding: null 48746 }; 48747 var setInnerHtml = function setInnerHtml(elem, html) { 48748 // #1926 48749 elem.textContent = ''; 48750 48751 if (html) { 48752 var parser = new DOMParser(); 48753 var parsed = parser.parseFromString(html, "text/html"); 48754 toArray(parsed.querySelector('head').childNodes).forEach(function (child) { 48755 elem.appendChild(child); 48756 }); 48757 toArray(parsed.querySelector('body').childNodes).forEach(function (child) { 48758 elem.appendChild(child); 48759 }); 48760 } 48761 }; 48762 var hasClass = function hasClass(elem, className) { 48763 if (!className) { 48764 return false; 48765 } 48766 48767 var classList = className.split(/\s+/); 48768 48769 for (var i = 0; i < classList.length; i++) { 48770 if (!elem.classList.contains(classList[i])) { 48771 return false; 48772 } 48773 } 48774 48775 return true; 48776 }; 48777 48778 var removeCustomClasses = function removeCustomClasses(elem, params) { 48779 toArray(elem.classList).forEach(function (className) { 48780 if (!(objectValues(swalClasses).indexOf(className) !== -1) && !(objectValues(iconTypes).indexOf(className) !== -1) && !(objectValues(params.showClass).indexOf(className) !== -1)) { 48781 elem.classList.remove(className); 48782 } 48783 }); 48784 }; 48785 48786 var applyCustomClass = function applyCustomClass(elem, params, className) { 48787 removeCustomClasses(elem, params); 48788 48789 if (params.customClass && params.customClass[className]) { 48790 if (typeof params.customClass[className] !== 'string' && !params.customClass[className].forEach) { 48791 return warn("Invalid type of customClass.".concat(className, "! Expected string or iterable object, got \"").concat(_typeof(params.customClass[className]), "\"")); 48792 } 48793 48794 addClass(elem, params.customClass[className]); 48795 } 48796 }; 48797 function getInput(content, inputType) { 48798 if (!inputType) { 48799 return null; 48800 } 48801 48802 switch (inputType) { 48803 case 'select': 48804 case 'textarea': 48805 case 'file': 48806 return getChildByClass(content, swalClasses[inputType]); 48807 48808 case 'checkbox': 48809 return content.querySelector(".".concat(swalClasses.checkbox, " input")); 48810 48811 case 'radio': 48812 return content.querySelector(".".concat(swalClasses.radio, " input:checked")) || content.querySelector(".".concat(swalClasses.radio, " input:first-child")); 48813 48814 case 'range': 48815 return content.querySelector(".".concat(swalClasses.range, " input")); 48816 48817 default: 48818 return getChildByClass(content, swalClasses.input); 48819 } 48820 } 48821 var focusInput = function focusInput(input) { 48822 input.focus(); // place cursor at end of text in text input 48823 48824 if (input.type !== 'file') { 48825 // http://stackoverflow.com/a/2345915 48826 var val = input.value; 48827 input.value = ''; 48828 input.value = val; 48829 } 48830 }; 48831 var toggleClass = function toggleClass(target, classList, condition) { 48832 if (!target || !classList) { 48833 return; 48834 } 48835 48836 if (typeof classList === 'string') { 48837 classList = classList.split(/\s+/).filter(Boolean); 48838 } 48839 48840 classList.forEach(function (className) { 48841 if (target.forEach) { 48842 target.forEach(function (elem) { 48843 condition ? elem.classList.add(className) : elem.classList.remove(className); 48844 }); 48845 } else { 48846 condition ? target.classList.add(className) : target.classList.remove(className); 48847 } 48848 }); 48849 }; 48850 var addClass = function addClass(target, classList) { 48851 toggleClass(target, classList, true); 48852 }; 48853 var removeClass = function removeClass(target, classList) { 48854 toggleClass(target, classList, false); 48855 }; 48856 var getChildByClass = function getChildByClass(elem, className) { 48857 for (var i = 0; i < elem.childNodes.length; i++) { 48858 if (hasClass(elem.childNodes[i], className)) { 48859 return elem.childNodes[i]; 48860 } 48861 } 48862 }; 48863 var applyNumericalStyle = function applyNumericalStyle(elem, property, value) { 48864 if (value || parseInt(value) === 0) { 48865 elem.style[property] = typeof value === 'number' ? "".concat(value, "px") : value; 48866 } else { 48867 elem.style.removeProperty(property); 48868 } 48869 }; 48870 var show = function show(elem) { 48871 var display = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'flex'; 48872 elem.style.opacity = ''; 48873 elem.style.display = display; 48874 }; 48875 var hide = function hide(elem) { 48876 elem.style.opacity = ''; 48877 elem.style.display = 'none'; 48878 }; 48879 var toggle = function toggle(elem, condition, display) { 48880 condition ? show(elem, display) : hide(elem); 48881 }; // borrowed from jquery $(elem).is(':visible') implementation 48882 48883 var isVisible = function isVisible(elem) { 48884 return !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); 48885 }; 48886 /* istanbul ignore next */ 48887 48888 var isScrollable = function isScrollable(elem) { 48889 return !!(elem.scrollHeight > elem.clientHeight); 48890 }; // borrowed from https://stackoverflow.com/a/46352119 48891 48892 var hasCssAnimation = function hasCssAnimation(elem) { 48893 var style = window.getComputedStyle(elem); 48894 var animDuration = parseFloat(style.getPropertyValue('animation-duration') || '0'); 48895 var transDuration = parseFloat(style.getPropertyValue('transition-duration') || '0'); 48896 return animDuration > 0 || transDuration > 0; 48897 }; 48898 var contains = function contains(haystack, needle) { 48899 if (typeof haystack.contains === 'function') { 48900 return haystack.contains(needle); 48901 } 48902 }; 48903 var animateTimerProgressBar = function animateTimerProgressBar(timer) { 48904 var reset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; 48905 var timerProgressBar = getTimerProgressBar(); 48906 48907 if (isVisible(timerProgressBar)) { 48908 if (reset) { 48909 timerProgressBar.style.transition = 'none'; 48910 timerProgressBar.style.width = '100%'; 48911 } 48912 48913 setTimeout(function () { 48914 timerProgressBar.style.transition = "width ".concat(timer / 1000, "s linear"); 48915 timerProgressBar.style.width = '0%'; 48916 }, 10); 48917 } 48918 }; 48919 var stopTimerProgressBar = function stopTimerProgressBar() { 48920 var timerProgressBar = getTimerProgressBar(); 48921 var timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); 48922 timerProgressBar.style.removeProperty('transition'); 48923 timerProgressBar.style.width = '100%'; 48924 var timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); 48925 var timerProgressBarPercent = parseInt(timerProgressBarWidth / timerProgressBarFullWidth * 100); 48926 timerProgressBar.style.removeProperty('transition'); 48927 timerProgressBar.style.width = "".concat(timerProgressBarPercent, "%"); 48928 }; 48929 48930 // Detect Node env 48931 var isNodeEnv = function isNodeEnv() { 48932 return typeof window === 'undefined' || typeof document === 'undefined'; 48933 }; 48934 48935 var sweetHTML = "\n <div aria-labelledby=\"".concat(swalClasses.title, "\" aria-describedby=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses.popup, "\" tabindex=\"-1\">\n <div class=\"").concat(swalClasses.header, "\">\n <ul class=\"").concat(swalClasses['progress-steps'], "\"></ul>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.error, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.question, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.warning, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.info, "\"></div>\n <div class=\"").concat(swalClasses.icon, " ").concat(iconTypes.success, "\"></div>\n <img class=\"").concat(swalClasses.image, "\" />\n <h2 class=\"").concat(swalClasses.title, "\" id=\"").concat(swalClasses.title, "\"></h2>\n <button type=\"button\" class=\"").concat(swalClasses.close, "\"></button>\n </div>\n <div class=\"").concat(swalClasses.content, "\">\n <div id=\"").concat(swalClasses.content, "\" class=\"").concat(swalClasses['html-container'], "\"></div>\n <input class=\"").concat(swalClasses.input, "\" />\n <input type=\"file\" class=\"").concat(swalClasses.file, "\" />\n <div class=\"").concat(swalClasses.range, "\">\n <input type=\"range\" />\n <output></output>\n </div>\n <select class=\"").concat(swalClasses.select, "\"></select>\n <div class=\"").concat(swalClasses.radio, "\"></div>\n <label for=\"").concat(swalClasses.checkbox, "\" class=\"").concat(swalClasses.checkbox, "\">\n <input type=\"checkbox\" />\n <span class=\"").concat(swalClasses.label, "\"></span>\n </label>\n <textarea class=\"").concat(swalClasses.textarea, "\"></textarea>\n <div class=\"").concat(swalClasses['validation-message'], "\" id=\"").concat(swalClasses['validation-message'], "\"></div>\n </div>\n <div class=\"").concat(swalClasses.actions, "\">\n <button type=\"button\" class=\"").concat(swalClasses.confirm, "\">OK</button>\n <button type=\"button\" class=\"").concat(swalClasses.cancel, "\">Cancel</button>\n </div>\n <div class=\"").concat(swalClasses.footer, "\"></div>\n <div class=\"").concat(swalClasses['timer-progress-bar-container'], "\">\n <div class=\"").concat(swalClasses['timer-progress-bar'], "\"></div>\n </div>\n </div>\n").replace(/(^|\n)\s*/g, ''); 48936 48937 var resetOldContainer = function resetOldContainer() { 48938 var oldContainer = getContainer(); 48939 48940 if (!oldContainer) { 48941 return false; 48942 } 48943 48944 oldContainer.parentNode.removeChild(oldContainer); 48945 removeClass([document.documentElement, document.body], [swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['has-column']]); 48946 return true; 48947 }; 48948 48949 var oldInputVal; // IE11 workaround, see #1109 for details 48950 48951 var resetValidationMessage = function resetValidationMessage(e) { 48952 if (Swal.isVisible() && oldInputVal !== e.target.value) { 48953 Swal.resetValidationMessage(); 48954 } 48955 48956 oldInputVal = e.target.value; 48957 }; 48958 48959 var addInputChangeListeners = function addInputChangeListeners() { 48960 var content = getContent(); 48961 var input = getChildByClass(content, swalClasses.input); 48962 var file = getChildByClass(content, swalClasses.file); 48963 var range = content.querySelector(".".concat(swalClasses.range, " input")); 48964 var rangeOutput = content.querySelector(".".concat(swalClasses.range, " output")); 48965 var select = getChildByClass(content, swalClasses.select); 48966 var checkbox = content.querySelector(".".concat(swalClasses.checkbox, " input")); 48967 var textarea = getChildByClass(content, swalClasses.textarea); 48968 input.oninput = resetValidationMessage; 48969 file.onchange = resetValidationMessage; 48970 select.onchange = resetValidationMessage; 48971 checkbox.onchange = resetValidationMessage; 48972 textarea.oninput = resetValidationMessage; 48973 48974 range.oninput = function (e) { 48975 resetValidationMessage(e); 48976 rangeOutput.value = range.value; 48977 }; 48978 48979 range.onchange = function (e) { 48980 resetValidationMessage(e); 48981 range.nextSibling.value = range.value; 48982 }; 48983 }; 48984 48985 var getTarget = function getTarget(target) { 48986 return typeof target === 'string' ? document.querySelector(target) : target; 48987 }; 48988 48989 var setupAccessibility = function setupAccessibility(params) { 48990 var popup = getPopup(); 48991 popup.setAttribute('role', params.toast ? 'alert' : 'dialog'); 48992 popup.setAttribute('aria-live', params.toast ? 'polite' : 'assertive'); 48993 48994 if (!params.toast) { 48995 popup.setAttribute('aria-modal', 'true'); 48996 } 48997 }; 48998 48999 var setupRTL = function setupRTL(targetElement) { 49000 if (window.getComputedStyle(targetElement).direction === 'rtl') { 49001 addClass(getContainer(), swalClasses.rtl); 49002 } 49003 }; 49004 /* 49005 * Add modal + backdrop to DOM 49006 */ 49007 49008 49009 var init = function init(params) { 49010 // Clean up the old popup container if it exists 49011 var oldContainerExisted = resetOldContainer(); 49012 /* istanbul ignore if */ 49013 49014 if (isNodeEnv()) { 49015 error('SweetAlert2 requires document to initialize'); 49016 return; 49017 } 49018 49019 var container = document.createElement('div'); 49020 container.className = swalClasses.container; 49021 49022 if (oldContainerExisted) { 49023 addClass(container, swalClasses['no-transition']); 49024 } 49025 49026 setInnerHtml(container, sweetHTML); 49027 var targetElement = getTarget(params.target); 49028 targetElement.appendChild(container); 49029 setupAccessibility(params); 49030 setupRTL(targetElement); 49031 addInputChangeListeners(); 49032 }; 49033 49034 var parseHtmlToContainer = function parseHtmlToContainer(param, target) { 49035 // DOM element 49036 if (param instanceof HTMLElement) { 49037 target.appendChild(param); // Object 49038 } else if (_typeof(param) === 'object') { 49039 handleObject(param, target); // Plain string 49040 } else if (param) { 49041 setInnerHtml(target, param); 49042 } 49043 }; 49044 49045 var handleObject = function handleObject(param, target) { 49046 // JQuery element(s) 49047 if (param.jquery) { 49048 handleJqueryElem(target, param); // For other objects use their string representation 49049 } else { 49050 setInnerHtml(target, param.toString()); 49051 } 49052 }; 49053 49054 var handleJqueryElem = function handleJqueryElem(target, elem) { 49055 target.textContent = ''; 49056 49057 if (0 in elem) { 49058 for (var i = 0; (i in elem); i++) { 49059 target.appendChild(elem[i].cloneNode(true)); 49060 } 49061 } else { 49062 target.appendChild(elem.cloneNode(true)); 49063 } 49064 }; 49065 49066 var animationEndEvent = function () { 49067 // Prevent run in Node env 49068 49069 /* istanbul ignore if */ 49070 if (isNodeEnv()) { 49071 return false; 49072 } 49073 49074 var testEl = document.createElement('div'); 49075 var transEndEventNames = { 49076 WebkitAnimation: 'webkitAnimationEnd', 49077 OAnimation: 'oAnimationEnd oanimationend', 49078 animation: 'animationend' 49079 }; 49080 49081 for (var i in transEndEventNames) { 49082 if (Object.prototype.hasOwnProperty.call(transEndEventNames, i) && typeof testEl.style[i] !== 'undefined') { 49083 return transEndEventNames[i]; 49084 } 49085 } 49086 49087 return false; 49088 }(); 49089 49090 // https://github.com/twbs/bootstrap/blob/master/js/src/modal.js 49091 49092 var measureScrollbar = function measureScrollbar() { 49093 var scrollDiv = document.createElement('div'); 49094 scrollDiv.className = swalClasses['scrollbar-measure']; 49095 document.body.appendChild(scrollDiv); 49096 var scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 49097 document.body.removeChild(scrollDiv); 49098 return scrollbarWidth; 49099 }; 49100 49101 var renderActions = function renderActions(instance, params) { 49102 var actions = getActions(); 49103 var confirmButton = getConfirmButton(); 49104 var cancelButton = getCancelButton(); // Actions (buttons) wrapper 49105 49106 if (!params.showConfirmButton && !params.showCancelButton) { 49107 hide(actions); 49108 } // Custom class 49109 49110 49111 applyCustomClass(actions, params, 'actions'); // Render confirm button 49112 49113 renderButton(confirmButton, 'confirm', params); // render Cancel Button 49114 49115 renderButton(cancelButton, 'cancel', params); 49116 49117 if (params.buttonsStyling) { 49118 handleButtonsStyling(confirmButton, cancelButton, params); 49119 } else { 49120 removeClass([confirmButton, cancelButton], swalClasses.styled); 49121 confirmButton.style.backgroundColor = confirmButton.style.borderLeftColor = confirmButton.style.borderRightColor = ''; 49122 cancelButton.style.backgroundColor = cancelButton.style.borderLeftColor = cancelButton.style.borderRightColor = ''; 49123 } 49124 49125 if (params.reverseButtons) { 49126 confirmButton.parentNode.insertBefore(cancelButton, confirmButton); 49127 } 49128 }; 49129 49130 function handleButtonsStyling(confirmButton, cancelButton, params) { 49131 addClass([confirmButton, cancelButton], swalClasses.styled); // Buttons background colors 49132 49133 if (params.confirmButtonColor) { 49134 confirmButton.style.backgroundColor = params.confirmButtonColor; 49135 } 49136 49137 if (params.cancelButtonColor) { 49138 cancelButton.style.backgroundColor = params.cancelButtonColor; 49139 } // Loading state 49140 49141 49142 if (!isLoading()) { 49143 var confirmButtonBackgroundColor = window.getComputedStyle(confirmButton).getPropertyValue('background-color'); 49144 confirmButton.style.borderLeftColor = confirmButtonBackgroundColor; 49145 confirmButton.style.borderRightColor = confirmButtonBackgroundColor; 49146 } 49147 } 49148 49149 function renderButton(button, buttonType, params) { 49150 toggle(button, params["show".concat(capitalizeFirstLetter(buttonType), "Button")], 'inline-block'); 49151 setInnerHtml(button, params["".concat(buttonType, "ButtonText")]); // Set caption text 49152 49153 button.setAttribute('aria-label', params["".concat(buttonType, "ButtonAriaLabel")]); // ARIA label 49154 // Add buttons custom classes 49155 49156 button.className = swalClasses[buttonType]; 49157 applyCustomClass(button, params, "".concat(buttonType, "Button")); 49158 addClass(button, params["".concat(buttonType, "ButtonClass")]); 49159 } 49160 49161 function handleBackdropParam(container, backdrop) { 49162 if (typeof backdrop === 'string') { 49163 container.style.background = backdrop; 49164 } else if (!backdrop) { 49165 addClass([document.documentElement, document.body], swalClasses['no-backdrop']); 49166 } 49167 } 49168 49169 function handlePositionParam(container, position) { 49170 if (position in swalClasses) { 49171 addClass(container, swalClasses[position]); 49172 } else { 49173 warn('The "position" parameter is not valid, defaulting to "center"'); 49174 addClass(container, swalClasses.center); 49175 } 49176 } 49177 49178 function handleGrowParam(container, grow) { 49179 if (grow && typeof grow === 'string') { 49180 var growClass = "grow-".concat(grow); 49181 49182 if (growClass in swalClasses) { 49183 addClass(container, swalClasses[growClass]); 49184 } 49185 } 49186 } 49187 49188 var renderContainer = function renderContainer(instance, params) { 49189 var container = getContainer(); 49190 49191 if (!container) { 49192 return; 49193 } 49194 49195 handleBackdropParam(container, params.backdrop); 49196 49197 if (!params.backdrop && params.allowOutsideClick) { 49198 warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); 49199 } 49200 49201 handlePositionParam(container, params.position); 49202 handleGrowParam(container, params.grow); // Custom class 49203 49204 applyCustomClass(container, params, 'container'); // Set queue step attribute for getQueueStep() method 49205 49206 var queueStep = document.body.getAttribute('data-swal2-queue-step'); 49207 49208 if (queueStep) { 49209 container.setAttribute('data-queue-step', queueStep); 49210 document.body.removeAttribute('data-swal2-queue-step'); 49211 } 49212 }; 49213 49214 /** 49215 * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. 49216 * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` 49217 * This is the approach that Babel will probably take to implement private methods/fields 49218 * https://github.com/tc39/proposal-private-methods 49219 * https://github.com/babel/babel/pull/7555 49220 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* 49221 * then we can use that language feature. 49222 */ 49223 var privateProps = { 49224 promise: new WeakMap(), 49225 innerParams: new WeakMap(), 49226 domCache: new WeakMap() 49227 }; 49228 49229 var inputTypes = ['input', 'file', 'range', 'select', 'radio', 'checkbox', 'textarea']; 49230 var renderInput = function renderInput(instance, params) { 49231 var content = getContent(); 49232 var innerParams = privateProps.innerParams.get(instance); 49233 var rerender = !innerParams || params.input !== innerParams.input; 49234 inputTypes.forEach(function (inputType) { 49235 var inputClass = swalClasses[inputType]; 49236 var inputContainer = getChildByClass(content, inputClass); // set attributes 49237 49238 setAttributes(inputType, params.inputAttributes); // set class 49239 49240 inputContainer.className = inputClass; 49241 49242 if (rerender) { 49243 hide(inputContainer); 49244 } 49245 }); 49246 49247 if (params.input) { 49248 if (rerender) { 49249 showInput(params); 49250 } // set custom class 49251 49252 49253 setCustomClass(params); 49254 } 49255 }; 49256 49257 var showInput = function showInput(params) { 49258 if (!renderInputType[params.input]) { 49259 return error("Unexpected type of input! Expected \"text\", \"email\", \"password\", \"number\", \"tel\", \"select\", \"radio\", \"checkbox\", \"textarea\", \"file\" or \"url\", got \"".concat(params.input, "\"")); 49260 } 49261 49262 var inputContainer = getInputContainer(params.input); 49263 var input = renderInputType[params.input](inputContainer, params); 49264 show(input); // input autofocus 49265 49266 setTimeout(function () { 49267 focusInput(input); 49268 }); 49269 }; 49270 49271 var removeAttributes = function removeAttributes(input) { 49272 for (var i = 0; i < input.attributes.length; i++) { 49273 var attrName = input.attributes[i].name; 49274 49275 if (!(['type', 'value', 'style'].indexOf(attrName) !== -1)) { 49276 input.removeAttribute(attrName); 49277 } 49278 } 49279 }; 49280 49281 var setAttributes = function setAttributes(inputType, inputAttributes) { 49282 var input = getInput(getContent(), inputType); 49283 49284 if (!input) { 49285 return; 49286 } 49287 49288 removeAttributes(input); 49289 49290 for (var attr in inputAttributes) { 49291 // Do not set a placeholder for <input type="range"> 49292 // it'll crash Edge, #1298 49293 if (inputType === 'range' && attr === 'placeholder') { 49294 continue; 49295 } 49296 49297 input.setAttribute(attr, inputAttributes[attr]); 49298 } 49299 }; 49300 49301 var setCustomClass = function setCustomClass(params) { 49302 var inputContainer = getInputContainer(params.input); 49303 49304 if (params.customClass) { 49305 addClass(inputContainer, params.customClass.input); 49306 } 49307 }; 49308 49309 var setInputPlaceholder = function setInputPlaceholder(input, params) { 49310 if (!input.placeholder || params.inputPlaceholder) { 49311 input.placeholder = params.inputPlaceholder; 49312 } 49313 }; 49314 49315 var getInputContainer = function getInputContainer(inputType) { 49316 var inputClass = swalClasses[inputType] ? swalClasses[inputType] : swalClasses.input; 49317 return getChildByClass(getContent(), inputClass); 49318 }; 49319 49320 var renderInputType = {}; 49321 49322 renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = function (input, params) { 49323 if (typeof params.inputValue === 'string' || typeof params.inputValue === 'number') { 49324 input.value = params.inputValue; 49325 } else if (!isPromise(params.inputValue)) { 49326 warn("Unexpected type of inputValue! Expected \"string\", \"number\" or \"Promise\", got \"".concat(_typeof(params.inputValue), "\"")); 49327 } 49328 49329 setInputPlaceholder(input, params); 49330 input.type = params.input; 49331 return input; 49332 }; 49333 49334 renderInputType.file = function (input, params) { 49335 setInputPlaceholder(input, params); 49336 return input; 49337 }; 49338 49339 renderInputType.range = function (range, params) { 49340 var rangeInput = range.querySelector('input'); 49341 var rangeOutput = range.querySelector('output'); 49342 rangeInput.value = params.inputValue; 49343 rangeInput.type = params.input; 49344 rangeOutput.value = params.inputValue; 49345 return range; 49346 }; 49347 49348 renderInputType.select = function (select, params) { 49349 select.textContent = ''; 49350 49351 if (params.inputPlaceholder) { 49352 var placeholder = document.createElement('option'); 49353 setInnerHtml(placeholder, params.inputPlaceholder); 49354 placeholder.value = ''; 49355 placeholder.disabled = true; 49356 placeholder.selected = true; 49357 select.appendChild(placeholder); 49358 } 49359 49360 return select; 49361 }; 49362 49363 renderInputType.radio = function (radio) { 49364 radio.textContent = ''; 49365 return radio; 49366 }; 49367 49368 renderInputType.checkbox = function (checkboxContainer, params) { 49369 var checkbox = getInput(getContent(), 'checkbox'); 49370 checkbox.value = 1; 49371 checkbox.id = swalClasses.checkbox; 49372 checkbox.checked = Boolean(params.inputValue); 49373 var label = checkboxContainer.querySelector('span'); 49374 setInnerHtml(label, params.inputPlaceholder); 49375 return checkboxContainer; 49376 }; 49377 49378 renderInputType.textarea = function (textarea, params) { 49379 textarea.value = params.inputValue; 49380 setInputPlaceholder(textarea, params); 49381 49382 if ('MutationObserver' in window) { 49383 // #1699 49384 var initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); 49385 var popupPadding = parseInt(window.getComputedStyle(getPopup()).paddingLeft) + parseInt(window.getComputedStyle(getPopup()).paddingRight); 49386 49387 var outputsize = function outputsize() { 49388 var contentWidth = textarea.offsetWidth + popupPadding; 49389 49390 if (contentWidth > initialPopupWidth) { 49391 getPopup().style.width = "".concat(contentWidth, "px"); 49392 } else { 49393 getPopup().style.width = null; 49394 } 49395 }; 49396 49397 new MutationObserver(outputsize).observe(textarea, { 49398 attributes: true, 49399 attributeFilter: ['style'] 49400 }); 49401 } 49402 49403 return textarea; 49404 }; 49405 49406 var renderContent = function renderContent(instance, params) { 49407 var content = getContent().querySelector("#".concat(swalClasses.content)); // Content as HTML 49408 49409 if (params.html) { 49410 parseHtmlToContainer(params.html, content); 49411 show(content, 'block'); // Content as plain text 49412 } else if (params.text) { 49413 content.textContent = params.text; 49414 show(content, 'block'); // No content 49415 } else { 49416 hide(content); 49417 } 49418 49419 renderInput(instance, params); // Custom class 49420 49421 applyCustomClass(getContent(), params, 'content'); 49422 }; 49423 49424 var renderFooter = function renderFooter(instance, params) { 49425 var footer = getFooter(); 49426 toggle(footer, params.footer); 49427 49428 if (params.footer) { 49429 parseHtmlToContainer(params.footer, footer); 49430 } // Custom class 49431 49432 49433 applyCustomClass(footer, params, 'footer'); 49434 }; 49435 49436 var renderCloseButton = function renderCloseButton(instance, params) { 49437 var closeButton = getCloseButton(); 49438 setInnerHtml(closeButton, params.closeButtonHtml); // Custom class 49439 49440 applyCustomClass(closeButton, params, 'closeButton'); 49441 toggle(closeButton, params.showCloseButton); 49442 closeButton.setAttribute('aria-label', params.closeButtonAriaLabel); 49443 }; 49444 49445 var renderIcon = function renderIcon(instance, params) { 49446 var innerParams = privateProps.innerParams.get(instance); // if the give icon already rendered, apply the custom class without re-rendering the icon 49447 49448 if (innerParams && params.icon === innerParams.icon && getIcon()) { 49449 applyCustomClass(getIcon(), params, 'icon'); 49450 return; 49451 } 49452 49453 hideAllIcons(); 49454 49455 if (!params.icon) { 49456 return; 49457 } 49458 49459 if (Object.keys(iconTypes).indexOf(params.icon) !== -1) { 49460 var icon = elementBySelector(".".concat(swalClasses.icon, ".").concat(iconTypes[params.icon])); 49461 show(icon); // Custom or default content 49462 49463 setContent(icon, params); 49464 adjustSuccessIconBackgoundColor(); // Custom class 49465 49466 applyCustomClass(icon, params, 'icon'); // Animate icon 49467 49468 addClass(icon, params.showClass.icon); 49469 } else { 49470 error("Unknown icon! Expected \"success\", \"error\", \"warning\", \"info\" or \"question\", got \"".concat(params.icon, "\"")); 49471 } 49472 }; 49473 49474 var hideAllIcons = function hideAllIcons() { 49475 var icons = getIcons(); 49476 49477 for (var i = 0; i < icons.length; i++) { 49478 hide(icons[i]); 49479 } 49480 }; // Adjust success icon background color to match the popup background color 49481 49482 49483 var adjustSuccessIconBackgoundColor = function adjustSuccessIconBackgoundColor() { 49484 var popup = getPopup(); 49485 var popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue('background-color'); 49486 var successIconParts = popup.querySelectorAll('[class^=swal2-success-circular-line], .swal2-success-fix'); 49487 49488 for (var i = 0; i < successIconParts.length; i++) { 49489 successIconParts[i].style.backgroundColor = popupBackgroundColor; 49490 } 49491 }; 49492 49493 var setContent = function setContent(icon, params) { 49494 icon.textContent = ''; 49495 49496 if (params.iconHtml) { 49497 setInnerHtml(icon, iconContent(params.iconHtml)); 49498 } else if (params.icon === 'success') { 49499 setInnerHtml(icon, "\n <div class=\"swal2-success-circular-line-left\"></div>\n <span class=\"swal2-success-line-tip\"></span> <span class=\"swal2-success-line-long\"></span>\n <div class=\"swal2-success-ring\"></div> <div class=\"swal2-success-fix\"></div>\n <div class=\"swal2-success-circular-line-right\"></div>\n "); 49500 } else if (params.icon === 'error') { 49501 setInnerHtml(icon, "\n <span class=\"swal2-x-mark\">\n <span class=\"swal2-x-mark-line-left\"></span>\n <span class=\"swal2-x-mark-line-right\"></span>\n </span>\n "); 49502 } else { 49503 var defaultIconHtml = { 49504 question: '?', 49505 warning: '!', 49506 info: 'i' 49507 }; 49508 setInnerHtml(icon, iconContent(defaultIconHtml[params.icon])); 49509 } 49510 }; 49511 49512 var iconContent = function iconContent(content) { 49513 return "<div class=\"".concat(swalClasses['icon-content'], "\">").concat(content, "</div>"); 49514 }; 49515 49516 var renderImage = function renderImage(instance, params) { 49517 var image = getImage(); 49518 49519 if (!params.imageUrl) { 49520 return hide(image); 49521 } 49522 49523 show(image, ''); // Src, alt 49524 49525 image.setAttribute('src', params.imageUrl); 49526 image.setAttribute('alt', params.imageAlt); // Width, height 49527 49528 applyNumericalStyle(image, 'width', params.imageWidth); 49529 applyNumericalStyle(image, 'height', params.imageHeight); // Class 49530 49531 image.className = swalClasses.image; 49532 applyCustomClass(image, params, 'image'); 49533 }; 49534 49535 var currentSteps = []; 49536 /* 49537 * Global function for chaining sweetAlert popups 49538 */ 49539 49540 var queue = function queue(steps) { 49541 var Swal = this; 49542 currentSteps = steps; 49543 49544 var resetAndResolve = function resetAndResolve(resolve, value) { 49545 currentSteps = []; 49546 resolve(value); 49547 }; 49548 49549 var queueResult = []; 49550 return new Promise(function (resolve) { 49551 (function step(i, callback) { 49552 if (i < currentSteps.length) { 49553 document.body.setAttribute('data-swal2-queue-step', i); 49554 Swal.fire(currentSteps[i]).then(function (result) { 49555 if (typeof result.value !== 'undefined') { 49556 queueResult.push(result.value); 49557 step(i + 1, callback); 49558 } else { 49559 resetAndResolve(resolve, { 49560 dismiss: result.dismiss 49561 }); 49562 } 49563 }); 49564 } else { 49565 resetAndResolve(resolve, { 49566 value: queueResult 49567 }); 49568 } 49569 })(0); 49570 }); 49571 }; 49572 /* 49573 * Global function for getting the index of current popup in queue 49574 */ 49575 49576 var getQueueStep = function getQueueStep() { 49577 return getContainer() && getContainer().getAttribute('data-queue-step'); 49578 }; 49579 /* 49580 * Global function for inserting a popup to the queue 49581 */ 49582 49583 var insertQueueStep = function insertQueueStep(step, index) { 49584 if (index && index < currentSteps.length) { 49585 return currentSteps.splice(index, 0, step); 49586 } 49587 49588 return currentSteps.push(step); 49589 }; 49590 /* 49591 * Global function for deleting a popup from the queue 49592 */ 49593 49594 var deleteQueueStep = function deleteQueueStep(index) { 49595 if (typeof currentSteps[index] !== 'undefined') { 49596 currentSteps.splice(index, 1); 49597 } 49598 }; 49599 49600 var createStepElement = function createStepElement(step) { 49601 var stepEl = document.createElement('li'); 49602 addClass(stepEl, swalClasses['progress-step']); 49603 setInnerHtml(stepEl, step); 49604 return stepEl; 49605 }; 49606 49607 var createLineElement = function createLineElement(params) { 49608 var lineEl = document.createElement('li'); 49609 addClass(lineEl, swalClasses['progress-step-line']); 49610 49611 if (params.progressStepsDistance) { 49612 lineEl.style.width = params.progressStepsDistance; 49613 } 49614 49615 return lineEl; 49616 }; 49617 49618 var renderProgressSteps = function renderProgressSteps(instance, params) { 49619 var progressStepsContainer = getProgressSteps(); 49620 49621 if (!params.progressSteps || params.progressSteps.length === 0) { 49622 return hide(progressStepsContainer); 49623 } 49624 49625 show(progressStepsContainer); 49626 progressStepsContainer.textContent = ''; 49627 var currentProgressStep = parseInt(params.currentProgressStep === undefined ? getQueueStep() : params.currentProgressStep); 49628 49629 if (currentProgressStep >= params.progressSteps.length) { 49630 warn('Invalid currentProgressStep parameter, it should be less than progressSteps.length ' + '(currentProgressStep like JS arrays starts from 0)'); 49631 } 49632 49633 params.progressSteps.forEach(function (step, index) { 49634 var stepEl = createStepElement(step); 49635 progressStepsContainer.appendChild(stepEl); 49636 49637 if (index === currentProgressStep) { 49638 addClass(stepEl, swalClasses['active-progress-step']); 49639 } 49640 49641 if (index !== params.progressSteps.length - 1) { 49642 var lineEl = createLineElement(params); 49643 progressStepsContainer.appendChild(lineEl); 49644 } 49645 }); 49646 }; 49647 49648 var renderTitle = function renderTitle(instance, params) { 49649 var title = getTitle(); 49650 toggle(title, params.title || params.titleText); 49651 49652 if (params.title) { 49653 parseHtmlToContainer(params.title, title); 49654 } 49655 49656 if (params.titleText) { 49657 title.innerText = params.titleText; 49658 } // Custom class 49659 49660 49661 applyCustomClass(title, params, 'title'); 49662 }; 49663 49664 var renderHeader = function renderHeader(instance, params) { 49665 var header = getHeader(); // Custom class 49666 49667 applyCustomClass(header, params, 'header'); // Progress steps 49668 49669 renderProgressSteps(instance, params); // Icon 49670 49671 renderIcon(instance, params); // Image 49672 49673 renderImage(instance, params); // Title 49674 49675 renderTitle(instance, params); // Close button 49676 49677 renderCloseButton(instance, params); 49678 }; 49679 49680 var renderPopup = function renderPopup(instance, params) { 49681 var popup = getPopup(); // Width 49682 49683 applyNumericalStyle(popup, 'width', params.width); // Padding 49684 49685 applyNumericalStyle(popup, 'padding', params.padding); // Background 49686 49687 if (params.background) { 49688 popup.style.background = params.background; 49689 } // Classes 49690 49691 49692 addClasses(popup, params); 49693 }; 49694 49695 var addClasses = function addClasses(popup, params) { 49696 // Default Class + showClass when updating Swal.update({}) 49697 popup.className = "".concat(swalClasses.popup, " ").concat(isVisible(popup) ? params.showClass.popup : ''); 49698 49699 if (params.toast) { 49700 addClass([document.documentElement, document.body], swalClasses['toast-shown']); 49701 addClass(popup, swalClasses.toast); 49702 } else { 49703 addClass(popup, swalClasses.modal); 49704 } // Custom class 49705 49706 49707 applyCustomClass(popup, params, 'popup'); 49708 49709 if (typeof params.customClass === 'string') { 49710 addClass(popup, params.customClass); 49711 } // Icon class (#1842) 49712 49713 49714 if (params.icon) { 49715 addClass(popup, swalClasses["icon-".concat(params.icon)]); 49716 } 49717 }; 49718 49719 var render = function render(instance, params) { 49720 renderPopup(instance, params); 49721 renderContainer(instance, params); 49722 renderHeader(instance, params); 49723 renderContent(instance, params); 49724 renderActions(instance, params); 49725 renderFooter(instance, params); 49726 49727 if (typeof params.onRender === 'function') { 49728 params.onRender(getPopup()); 49729 } 49730 }; 49731 49732 /* 49733 * Global function to determine if SweetAlert2 popup is shown 49734 */ 49735 49736 var isVisible$1 = function isVisible$$1() { 49737 return isVisible(getPopup()); 49738 }; 49739 /* 49740 * Global function to click 'Confirm' button 49741 */ 49742 49743 var clickConfirm = function clickConfirm() { 49744 return getConfirmButton() && getConfirmButton().click(); 49745 }; 49746 /* 49747 * Global function to click 'Cancel' button 49748 */ 49749 49750 var clickCancel = function clickCancel() { 49751 return getCancelButton() && getCancelButton().click(); 49752 }; 49753 49754 function fire() { 49755 var Swal = this; 49756 49757 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 49758 args[_key] = arguments[_key]; 49759 } 49760 49761 return _construct(Swal, args); 49762 } 49763 49764 /** 49765 * Returns an extended version of `Swal` containing `params` as defaults. 49766 * Useful for reusing Swal configuration. 49767 * 49768 * For example: 49769 * 49770 * Before: 49771 * const textPromptOptions = { input: 'text', showCancelButton: true } 49772 * const {value: firstName} = await Swal.fire({ ...textPromptOptions, title: 'What is your first name?' }) 49773 * const {value: lastName} = await Swal.fire({ ...textPromptOptions, title: 'What is your last name?' }) 49774 * 49775 * After: 49776 * const TextPrompt = Swal.mixin({ input: 'text', showCancelButton: true }) 49777 * const {value: firstName} = await TextPrompt('What is your first name?') 49778 * const {value: lastName} = await TextPrompt('What is your last name?') 49779 * 49780 * @param mixinParams 49781 */ 49782 function mixin(mixinParams) { 49783 var MixinSwal = /*#__PURE__*/function (_this) { 49784 _inherits(MixinSwal, _this); 49785 49786 var _super = _createSuper(MixinSwal); 49787 49788 function MixinSwal() { 49789 _classCallCheck(this, MixinSwal); 49790 49791 return _super.apply(this, arguments); 49792 } 49793 49794 _createClass(MixinSwal, [{ 49795 key: "_main", 49796 value: function _main(params) { 49797 return _get(_getPrototypeOf(MixinSwal.prototype), "_main", this).call(this, _extends({}, mixinParams, params)); 49798 } 49799 }]); 49800 49801 return MixinSwal; 49802 }(this); 49803 49804 return MixinSwal; 49805 } 49806 49807 /** 49808 * Show spinner instead of Confirm button 49809 */ 49810 49811 var showLoading = function showLoading() { 49812 var popup = getPopup(); 49813 49814 if (!popup) { 49815 Swal.fire(); 49816 } 49817 49818 popup = getPopup(); 49819 var actions = getActions(); 49820 var confirmButton = getConfirmButton(); 49821 show(actions); 49822 show(confirmButton, 'inline-block'); 49823 addClass([popup, actions], swalClasses.loading); 49824 confirmButton.disabled = true; 49825 popup.setAttribute('data-loading', true); 49826 popup.setAttribute('aria-busy', true); 49827 popup.focus(); 49828 }; 49829 49830 var RESTORE_FOCUS_TIMEOUT = 100; 49831 49832 var globalState = {}; 49833 49834 var focusPreviousActiveElement = function focusPreviousActiveElement() { 49835 if (globalState.previousActiveElement && globalState.previousActiveElement.focus) { 49836 globalState.previousActiveElement.focus(); 49837 globalState.previousActiveElement = null; 49838 } else if (document.body) { 49839 document.body.focus(); 49840 } 49841 }; // Restore previous active (focused) element 49842 49843 49844 var restoreActiveElement = function restoreActiveElement() { 49845 return new Promise(function (resolve) { 49846 var x = window.scrollX; 49847 var y = window.scrollY; 49848 globalState.restoreFocusTimeout = setTimeout(function () { 49849 focusPreviousActiveElement(); 49850 resolve(); 49851 }, RESTORE_FOCUS_TIMEOUT); // issues/900 49852 49853 /* istanbul ignore if */ 49854 49855 if (typeof x !== 'undefined' && typeof y !== 'undefined') { 49856 // IE doesn't have scrollX/scrollY support 49857 window.scrollTo(x, y); 49858 } 49859 }); 49860 }; 49861 49862 /** 49863 * If `timer` parameter is set, returns number of milliseconds of timer remained. 49864 * Otherwise, returns undefined. 49865 */ 49866 49867 var getTimerLeft = function getTimerLeft() { 49868 return globalState.timeout && globalState.timeout.getTimerLeft(); 49869 }; 49870 /** 49871 * Stop timer. Returns number of milliseconds of timer remained. 49872 * If `timer` parameter isn't set, returns undefined. 49873 */ 49874 49875 var stopTimer = function stopTimer() { 49876 if (globalState.timeout) { 49877 stopTimerProgressBar(); 49878 return globalState.timeout.stop(); 49879 } 49880 }; 49881 /** 49882 * Resume timer. Returns number of milliseconds of timer remained. 49883 * If `timer` parameter isn't set, returns undefined. 49884 */ 49885 49886 var resumeTimer = function resumeTimer() { 49887 if (globalState.timeout) { 49888 var remaining = globalState.timeout.start(); 49889 animateTimerProgressBar(remaining); 49890 return remaining; 49891 } 49892 }; 49893 /** 49894 * Resume timer. Returns number of milliseconds of timer remained. 49895 * If `timer` parameter isn't set, returns undefined. 49896 */ 49897 49898 var toggleTimer = function toggleTimer() { 49899 var timer = globalState.timeout; 49900 return timer && (timer.running ? stopTimer() : resumeTimer()); 49901 }; 49902 /** 49903 * Increase timer. Returns number of milliseconds of an updated timer. 49904 * If `timer` parameter isn't set, returns undefined. 49905 */ 49906 49907 var increaseTimer = function increaseTimer(n) { 49908 if (globalState.timeout) { 49909 var remaining = globalState.timeout.increase(n); 49910 animateTimerProgressBar(remaining, true); 49911 return remaining; 49912 } 49913 }; 49914 /** 49915 * Check if timer is running. Returns true if timer is running 49916 * or false if timer is paused or stopped. 49917 * If `timer` parameter isn't set, returns undefined 49918 */ 49919 49920 var isTimerRunning = function isTimerRunning() { 49921 return globalState.timeout && globalState.timeout.isRunning(); 49922 }; 49923 49924 var defaultParams = { 49925 title: '', 49926 titleText: '', 49927 text: '', 49928 html: '', 49929 footer: '', 49930 icon: undefined, 49931 iconHtml: undefined, 49932 toast: false, 49933 animation: true, 49934 showClass: { 49935 popup: 'swal2-show', 49936 backdrop: 'swal2-backdrop-show', 49937 icon: 'swal2-icon-show' 49938 }, 49939 hideClass: { 49940 popup: 'swal2-hide', 49941 backdrop: 'swal2-backdrop-hide', 49942 icon: 'swal2-icon-hide' 49943 }, 49944 customClass: undefined, 49945 target: 'body', 49946 backdrop: true, 49947 heightAuto: true, 49948 allowOutsideClick: true, 49949 allowEscapeKey: true, 49950 allowEnterKey: true, 49951 stopKeydownPropagation: true, 49952 keydownListenerCapture: false, 49953 showConfirmButton: true, 49954 showCancelButton: false, 49955 preConfirm: undefined, 49956 confirmButtonText: 'OK', 49957 confirmButtonAriaLabel: '', 49958 confirmButtonColor: undefined, 49959 cancelButtonText: 'Cancel', 49960 cancelButtonAriaLabel: '', 49961 cancelButtonColor: undefined, 49962 buttonsStyling: true, 49963 reverseButtons: false, 49964 focusConfirm: true, 49965 focusCancel: false, 49966 showCloseButton: false, 49967 closeButtonHtml: '×', 49968 closeButtonAriaLabel: 'Close this dialog', 49969 showLoaderOnConfirm: false, 49970 imageUrl: undefined, 49971 imageWidth: undefined, 49972 imageHeight: undefined, 49973 imageAlt: '', 49974 timer: undefined, 49975 timerProgressBar: false, 49976 width: undefined, 49977 padding: undefined, 49978 background: undefined, 49979 input: undefined, 49980 inputPlaceholder: '', 49981 inputValue: '', 49982 inputOptions: {}, 49983 inputAutoTrim: true, 49984 inputAttributes: {}, 49985 inputValidator: undefined, 49986 validationMessage: undefined, 49987 grow: false, 49988 position: 'center', 49989 progressSteps: [], 49990 currentProgressStep: undefined, 49991 progressStepsDistance: undefined, 49992 onBeforeOpen: undefined, 49993 onOpen: undefined, 49994 onRender: undefined, 49995 onClose: undefined, 49996 onAfterClose: undefined, 49997 onDestroy: undefined, 49998 scrollbarPadding: true 49999 }; 50000 var updatableParams = ['allowEscapeKey', 'allowOutsideClick', 'buttonsStyling', 'cancelButtonAriaLabel', 'cancelButtonColor', 'cancelButtonText', 'closeButtonAriaLabel', 'closeButtonHtml', 'confirmButtonAriaLabel', 'confirmButtonColor', 'confirmButtonText', 'currentProgressStep', 'customClass', 'footer', 'hideClass', 'html', 'icon', 'imageAlt', 'imageHeight', 'imageUrl', 'imageWidth', 'onAfterClose', 'onClose', 'onDestroy', 'progressSteps', 'reverseButtons', 'showCancelButton', 'showCloseButton', 'showConfirmButton', 'text', 'title', 'titleText']; 50001 var deprecatedParams = { 50002 animation: 'showClass" and "hideClass' 50003 }; 50004 var toastIncompatibleParams = ['allowOutsideClick', 'allowEnterKey', 'backdrop', 'focusConfirm', 'focusCancel', 'heightAuto', 'keydownListenerCapture']; 50005 /** 50006 * Is valid parameter 50007 * @param {String} paramName 50008 */ 50009 50010 var isValidParameter = function isValidParameter(paramName) { 50011 return Object.prototype.hasOwnProperty.call(defaultParams, paramName); 50012 }; 50013 /** 50014 * Is valid parameter for Swal.update() method 50015 * @param {String} paramName 50016 */ 50017 50018 var isUpdatableParameter = function isUpdatableParameter(paramName) { 50019 return updatableParams.indexOf(paramName) !== -1; 50020 }; 50021 /** 50022 * Is deprecated parameter 50023 * @param {String} paramName 50024 */ 50025 50026 var isDeprecatedParameter = function isDeprecatedParameter(paramName) { 50027 return deprecatedParams[paramName]; 50028 }; 50029 50030 var checkIfParamIsValid = function checkIfParamIsValid(param) { 50031 if (!isValidParameter(param)) { 50032 warn("Unknown parameter \"".concat(param, "\"")); 50033 } 50034 }; 50035 50036 var checkIfToastParamIsValid = function checkIfToastParamIsValid(param) { 50037 if (toastIncompatibleParams.indexOf(param) !== -1) { 50038 warn("The parameter \"".concat(param, "\" is incompatible with toasts")); 50039 } 50040 }; 50041 50042 var checkIfParamIsDeprecated = function checkIfParamIsDeprecated(param) { 50043 if (isDeprecatedParameter(param)) { 50044 warnAboutDepreation(param, isDeprecatedParameter(param)); 50045 } 50046 }; 50047 /** 50048 * Show relevant warnings for given params 50049 * 50050 * @param params 50051 */ 50052 50053 50054 var showWarningsForParams = function showWarningsForParams(params) { 50055 for (var param in params) { 50056 checkIfParamIsValid(param); 50057 50058 if (params.toast) { 50059 checkIfToastParamIsValid(param); 50060 } 50061 50062 checkIfParamIsDeprecated(param); 50063 } 50064 }; 50065 50066 50067 50068 var staticMethods = /*#__PURE__*/Object.freeze({ 50069 isValidParameter: isValidParameter, 50070 isUpdatableParameter: isUpdatableParameter, 50071 isDeprecatedParameter: isDeprecatedParameter, 50072 argsToParams: argsToParams, 50073 isVisible: isVisible$1, 50074 clickConfirm: clickConfirm, 50075 clickCancel: clickCancel, 50076 getContainer: getContainer, 50077 getPopup: getPopup, 50078 getTitle: getTitle, 50079 getContent: getContent, 50080 getHtmlContainer: getHtmlContainer, 50081 getImage: getImage, 50082 getIcon: getIcon, 50083 getIcons: getIcons, 50084 getCloseButton: getCloseButton, 50085 getActions: getActions, 50086 getConfirmButton: getConfirmButton, 50087 getCancelButton: getCancelButton, 50088 getHeader: getHeader, 50089 getFooter: getFooter, 50090 getTimerProgressBar: getTimerProgressBar, 50091 getFocusableElements: getFocusableElements, 50092 getValidationMessage: getValidationMessage, 50093 isLoading: isLoading, 50094 fire: fire, 50095 mixin: mixin, 50096 queue: queue, 50097 getQueueStep: getQueueStep, 50098 insertQueueStep: insertQueueStep, 50099 deleteQueueStep: deleteQueueStep, 50100 showLoading: showLoading, 50101 enableLoading: showLoading, 50102 getTimerLeft: getTimerLeft, 50103 stopTimer: stopTimer, 50104 resumeTimer: resumeTimer, 50105 toggleTimer: toggleTimer, 50106 increaseTimer: increaseTimer, 50107 isTimerRunning: isTimerRunning 50108 }); 50109 50110 /** 50111 * Enables buttons and hide loader. 50112 */ 50113 50114 function hideLoading() { 50115 // do nothing if popup is closed 50116 var innerParams = privateProps.innerParams.get(this); 50117 50118 if (!innerParams) { 50119 return; 50120 } 50121 50122 var domCache = privateProps.domCache.get(this); 50123 50124 if (!innerParams.showConfirmButton) { 50125 hide(domCache.confirmButton); 50126 50127 if (!innerParams.showCancelButton) { 50128 hide(domCache.actions); 50129 } 50130 } 50131 50132 removeClass([domCache.popup, domCache.actions], swalClasses.loading); 50133 domCache.popup.removeAttribute('aria-busy'); 50134 domCache.popup.removeAttribute('data-loading'); 50135 domCache.confirmButton.disabled = false; 50136 domCache.cancelButton.disabled = false; 50137 } 50138 50139 function getInput$1(instance) { 50140 var innerParams = privateProps.innerParams.get(instance || this); 50141 var domCache = privateProps.domCache.get(instance || this); 50142 50143 if (!domCache) { 50144 return null; 50145 } 50146 50147 return getInput(domCache.content, innerParams.input); 50148 } 50149 50150 var fixScrollbar = function fixScrollbar() { 50151 // for queues, do not do this more than once 50152 if (states.previousBodyPadding !== null) { 50153 return; 50154 } // if the body has overflow 50155 50156 50157 if (document.body.scrollHeight > window.innerHeight) { 50158 // add padding so the content doesn't shift after removal of scrollbar 50159 states.previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue('padding-right')); 50160 document.body.style.paddingRight = "".concat(states.previousBodyPadding + measureScrollbar(), "px"); 50161 } 50162 }; 50163 var undoScrollbar = function undoScrollbar() { 50164 if (states.previousBodyPadding !== null) { 50165 document.body.style.paddingRight = "".concat(states.previousBodyPadding, "px"); 50166 states.previousBodyPadding = null; 50167 } 50168 }; 50169 50170 /* istanbul ignore file */ 50171 50172 var iOSfix = function iOSfix() { 50173 var iOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream || navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1; 50174 50175 if (iOS && !hasClass(document.body, swalClasses.iosfix)) { 50176 var offset = document.body.scrollTop; 50177 document.body.style.top = "".concat(offset * -1, "px"); 50178 addClass(document.body, swalClasses.iosfix); 50179 lockBodyScroll(); 50180 addBottomPaddingForTallPopups(); // #1948 50181 } 50182 }; 50183 50184 var addBottomPaddingForTallPopups = function addBottomPaddingForTallPopups() { 50185 var safari = !navigator.userAgent.match(/(CriOS|FxiOS|EdgiOS|YaBrowser|UCBrowser)/i); 50186 50187 if (safari) { 50188 var bottomPanelHeight = 44; 50189 50190 if (getPopup().scrollHeight > window.innerHeight - bottomPanelHeight) { 50191 getContainer().style.paddingBottom = "".concat(bottomPanelHeight, "px"); 50192 } 50193 } 50194 }; 50195 50196 var lockBodyScroll = function lockBodyScroll() { 50197 // #1246 50198 var container = getContainer(); 50199 var preventTouchMove; 50200 50201 container.ontouchstart = function (e) { 50202 preventTouchMove = shouldPreventTouchMove(e.target); 50203 }; 50204 50205 container.ontouchmove = function (e) { 50206 if (preventTouchMove) { 50207 e.preventDefault(); 50208 e.stopPropagation(); 50209 } 50210 }; 50211 }; 50212 50213 var shouldPreventTouchMove = function shouldPreventTouchMove(target) { 50214 var container = getContainer(); 50215 50216 if (target === container) { 50217 return true; 50218 } 50219 50220 if (!isScrollable(container) && target.tagName !== 'INPUT' && // #1603 50221 !(isScrollable(getContent()) && // #1944 50222 getContent().contains(target))) { 50223 return true; 50224 } 50225 50226 return false; 50227 }; 50228 50229 var undoIOSfix = function undoIOSfix() { 50230 if (hasClass(document.body, swalClasses.iosfix)) { 50231 var offset = parseInt(document.body.style.top, 10); 50232 removeClass(document.body, swalClasses.iosfix); 50233 document.body.style.top = ''; 50234 document.body.scrollTop = offset * -1; 50235 } 50236 }; 50237 50238 /* istanbul ignore file */ 50239 50240 var isIE11 = function isIE11() { 50241 return !!window.MSInputMethodContext && !!document.documentMode; 50242 }; // Fix IE11 centering sweetalert2/issues/933 50243 50244 50245 var fixVerticalPositionIE = function fixVerticalPositionIE() { 50246 var container = getContainer(); 50247 var popup = getPopup(); 50248 container.style.removeProperty('align-items'); 50249 50250 if (popup.offsetTop < 0) { 50251 container.style.alignItems = 'flex-start'; 50252 } 50253 }; 50254 50255 var IEfix = function IEfix() { 50256 if (typeof window !== 'undefined' && isIE11()) { 50257 fixVerticalPositionIE(); 50258 window.addEventListener('resize', fixVerticalPositionIE); 50259 } 50260 }; 50261 var undoIEfix = function undoIEfix() { 50262 if (typeof window !== 'undefined' && isIE11()) { 50263 window.removeEventListener('resize', fixVerticalPositionIE); 50264 } 50265 }; 50266 50267 // Adding aria-hidden="true" to elements outside of the active modal dialog ensures that 50268 // elements not within the active modal dialog will not be surfaced if a user opens a screen 50269 // readerâs list of elements (headings, form controls, landmarks, etc.) in the document. 50270 50271 var setAriaHidden = function setAriaHidden() { 50272 var bodyChildren = toArray(document.body.children); 50273 bodyChildren.forEach(function (el) { 50274 if (el === getContainer() || contains(el, getContainer())) { 50275 return; 50276 } 50277 50278 if (el.hasAttribute('aria-hidden')) { 50279 el.setAttribute('data-previous-aria-hidden', el.getAttribute('aria-hidden')); 50280 } 50281 50282 el.setAttribute('aria-hidden', 'true'); 50283 }); 50284 }; 50285 var unsetAriaHidden = function unsetAriaHidden() { 50286 var bodyChildren = toArray(document.body.children); 50287 bodyChildren.forEach(function (el) { 50288 if (el.hasAttribute('data-previous-aria-hidden')) { 50289 el.setAttribute('aria-hidden', el.getAttribute('data-previous-aria-hidden')); 50290 el.removeAttribute('data-previous-aria-hidden'); 50291 } else { 50292 el.removeAttribute('aria-hidden'); 50293 } 50294 }); 50295 }; 50296 50297 /** 50298 * This module containts `WeakMap`s for each effectively-"private property" that a `Swal` has. 50299 * For example, to set the private property "foo" of `this` to "bar", you can `privateProps.foo.set(this, 'bar')` 50300 * This is the approach that Babel will probably take to implement private methods/fields 50301 * https://github.com/tc39/proposal-private-methods 50302 * https://github.com/babel/babel/pull/7555 50303 * Once we have the changes from that PR in Babel, and our core class fits reasonable in *one module* 50304 * then we can use that language feature. 50305 */ 50306 var privateMethods = { 50307 swalPromiseResolve: new WeakMap() 50308 }; 50309 50310 /* 50311 * Instance method to close sweetAlert 50312 */ 50313 50314 function removePopupAndResetState(instance, container, isToast$$1, onAfterClose) { 50315 if (isToast$$1) { 50316 triggerOnAfterCloseAndDispose(instance, onAfterClose); 50317 } else { 50318 restoreActiveElement().then(function () { 50319 return triggerOnAfterCloseAndDispose(instance, onAfterClose); 50320 }); 50321 globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { 50322 capture: globalState.keydownListenerCapture 50323 }); 50324 globalState.keydownHandlerAdded = false; 50325 } 50326 50327 if (container.parentNode && !document.body.getAttribute('data-swal2-queue-step')) { 50328 container.parentNode.removeChild(container); 50329 } 50330 50331 if (isModal()) { 50332 undoScrollbar(); 50333 undoIOSfix(); 50334 undoIEfix(); 50335 unsetAriaHidden(); 50336 } 50337 50338 removeBodyClasses(); 50339 } 50340 50341 function removeBodyClasses() { 50342 removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses['height-auto'], swalClasses['no-backdrop'], swalClasses['toast-shown'], swalClasses['toast-column']]); 50343 } 50344 50345 function close(resolveValue) { 50346 var popup = getPopup(); 50347 50348 if (!popup) { 50349 return; 50350 } 50351 50352 var innerParams = privateProps.innerParams.get(this); 50353 50354 if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { 50355 return; 50356 } 50357 50358 var swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); 50359 removeClass(popup, innerParams.showClass.popup); 50360 addClass(popup, innerParams.hideClass.popup); 50361 var backdrop = getContainer(); 50362 removeClass(backdrop, innerParams.showClass.backdrop); 50363 addClass(backdrop, innerParams.hideClass.backdrop); 50364 handlePopupAnimation(this, popup, innerParams); 50365 50366 if (typeof resolveValue !== 'undefined') { 50367 resolveValue.isDismissed = typeof resolveValue.dismiss !== 'undefined'; 50368 resolveValue.isConfirmed = typeof resolveValue.dismiss === 'undefined'; 50369 } else { 50370 resolveValue = { 50371 isDismissed: true, 50372 isConfirmed: false 50373 }; 50374 } // Resolve Swal promise 50375 50376 50377 swalPromiseResolve(resolveValue || {}); 50378 } 50379 50380 var handlePopupAnimation = function handlePopupAnimation(instance, popup, innerParams) { 50381 var container = getContainer(); // If animation is supported, animate 50382 50383 var animationIsSupported = animationEndEvent && hasCssAnimation(popup); 50384 var onClose = innerParams.onClose, 50385 onAfterClose = innerParams.onAfterClose; 50386 50387 if (onClose !== null && typeof onClose === 'function') { 50388 onClose(popup); 50389 } 50390 50391 if (animationIsSupported) { 50392 animatePopup(instance, popup, container, onAfterClose); 50393 } else { 50394 // Otherwise, remove immediately 50395 removePopupAndResetState(instance, container, isToast(), onAfterClose); 50396 } 50397 }; 50398 50399 var animatePopup = function animatePopup(instance, popup, container, onAfterClose) { 50400 globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, isToast(), onAfterClose); 50401 popup.addEventListener(animationEndEvent, function (e) { 50402 if (e.target === popup) { 50403 globalState.swalCloseEventFinishedCallback(); 50404 delete globalState.swalCloseEventFinishedCallback; 50405 } 50406 }); 50407 }; 50408 50409 var triggerOnAfterCloseAndDispose = function triggerOnAfterCloseAndDispose(instance, onAfterClose) { 50410 setTimeout(function () { 50411 if (typeof onAfterClose === 'function') { 50412 onAfterClose(); 50413 } 50414 50415 instance._destroy(); 50416 }); 50417 }; 50418 50419 function setButtonsDisabled(instance, buttons, disabled) { 50420 var domCache = privateProps.domCache.get(instance); 50421 buttons.forEach(function (button) { 50422 domCache[button].disabled = disabled; 50423 }); 50424 } 50425 50426 function setInputDisabled(input, disabled) { 50427 if (!input) { 50428 return false; 50429 } 50430 50431 if (input.type === 'radio') { 50432 var radiosContainer = input.parentNode.parentNode; 50433 var radios = radiosContainer.querySelectorAll('input'); 50434 50435 for (var i = 0; i < radios.length; i++) { 50436 radios[i].disabled = disabled; 50437 } 50438 } else { 50439 input.disabled = disabled; 50440 } 50441 } 50442 50443 function enableButtons() { 50444 setButtonsDisabled(this, ['confirmButton', 'cancelButton'], false); 50445 } 50446 function disableButtons() { 50447 setButtonsDisabled(this, ['confirmButton', 'cancelButton'], true); 50448 } 50449 function enableInput() { 50450 return setInputDisabled(this.getInput(), false); 50451 } 50452 function disableInput() { 50453 return setInputDisabled(this.getInput(), true); 50454 } 50455 50456 function showValidationMessage(error) { 50457 var domCache = privateProps.domCache.get(this); 50458 setInnerHtml(domCache.validationMessage, error); 50459 var popupComputedStyle = window.getComputedStyle(domCache.popup); 50460 domCache.validationMessage.style.marginLeft = "-".concat(popupComputedStyle.getPropertyValue('padding-left')); 50461 domCache.validationMessage.style.marginRight = "-".concat(popupComputedStyle.getPropertyValue('padding-right')); 50462 show(domCache.validationMessage); 50463 var input = this.getInput(); 50464 50465 if (input) { 50466 input.setAttribute('aria-invalid', true); 50467 input.setAttribute('aria-describedBy', swalClasses['validation-message']); 50468 focusInput(input); 50469 addClass(input, swalClasses.inputerror); 50470 } 50471 } // Hide block with validation message 50472 50473 function resetValidationMessage$1() { 50474 var domCache = privateProps.domCache.get(this); 50475 50476 if (domCache.validationMessage) { 50477 hide(domCache.validationMessage); 50478 } 50479 50480 var input = this.getInput(); 50481 50482 if (input) { 50483 input.removeAttribute('aria-invalid'); 50484 input.removeAttribute('aria-describedBy'); 50485 removeClass(input, swalClasses.inputerror); 50486 } 50487 } 50488 50489 function getProgressSteps$1() { 50490 var domCache = privateProps.domCache.get(this); 50491 return domCache.progressSteps; 50492 } 50493 50494 var Timer = /*#__PURE__*/function () { 50495 function Timer(callback, delay) { 50496 _classCallCheck(this, Timer); 50497 50498 this.callback = callback; 50499 this.remaining = delay; 50500 this.running = false; 50501 this.start(); 50502 } 50503 50504 _createClass(Timer, [{ 50505 key: "start", 50506 value: function start() { 50507 if (!this.running) { 50508 this.running = true; 50509 this.started = new Date(); 50510 this.id = setTimeout(this.callback, this.remaining); 50511 } 50512 50513 return this.remaining; 50514 } 50515 }, { 50516 key: "stop", 50517 value: function stop() { 50518 if (this.running) { 50519 this.running = false; 50520 clearTimeout(this.id); 50521 this.remaining -= new Date() - this.started; 50522 } 50523 50524 return this.remaining; 50525 } 50526 }, { 50527 key: "increase", 50528 value: function increase(n) { 50529 var running = this.running; 50530 50531 if (running) { 50532 this.stop(); 50533 } 50534 50535 this.remaining += n; 50536 50537 if (running) { 50538 this.start(); 50539 } 50540 50541 return this.remaining; 50542 } 50543 }, { 50544 key: "getTimerLeft", 50545 value: function getTimerLeft() { 50546 if (this.running) { 50547 this.stop(); 50548 this.start(); 50549 } 50550 50551 return this.remaining; 50552 } 50553 }, { 50554 key: "isRunning", 50555 value: function isRunning() { 50556 return this.running; 50557 } 50558 }]); 50559 50560 return Timer; 50561 }(); 50562 50563 var defaultInputValidators = { 50564 email: function email(string, validationMessage) { 50565 return /^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]{2,24}$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid email address'); 50566 }, 50567 url: function url(string, validationMessage) { 50568 // taken from https://stackoverflow.com/a/3809435 with a small change from #1306 and #2013 50569 return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || 'Invalid URL'); 50570 } 50571 }; 50572 50573 function setDefaultInputValidators(params) { 50574 // Use default `inputValidator` for supported input types if not provided 50575 if (!params.inputValidator) { 50576 Object.keys(defaultInputValidators).forEach(function (key) { 50577 if (params.input === key) { 50578 params.inputValidator = defaultInputValidators[key]; 50579 } 50580 }); 50581 } 50582 } 50583 50584 function validateCustomTargetElement(params) { 50585 // Determine if the custom target element is valid 50586 if (!params.target || typeof params.target === 'string' && !document.querySelector(params.target) || typeof params.target !== 'string' && !params.target.appendChild) { 50587 warn('Target parameter is not valid, defaulting to "body"'); 50588 params.target = 'body'; 50589 } 50590 } 50591 /** 50592 * Set type, text and actions on popup 50593 * 50594 * @param params 50595 * @returns {boolean} 50596 */ 50597 50598 50599 function setParameters(params) { 50600 setDefaultInputValidators(params); // showLoaderOnConfirm && preConfirm 50601 50602 if (params.showLoaderOnConfirm && !params.preConfirm) { 50603 warn('showLoaderOnConfirm is set to true, but preConfirm is not defined.\n' + 'showLoaderOnConfirm should be used together with preConfirm, see usage example:\n' + 'https://sweetalert2.github.io/#ajax-request'); 50604 } // params.animation will be actually used in renderPopup.js 50605 // but in case when params.animation is a function, we need to call that function 50606 // before popup (re)initialization, so it'll be possible to check Swal.isVisible() 50607 // inside the params.animation function 50608 50609 50610 params.animation = callIfFunction(params.animation); 50611 validateCustomTargetElement(params); // Replace newlines with <br> in title 50612 50613 if (typeof params.title === 'string') { 50614 params.title = params.title.split('\n').join('<br />'); 50615 } 50616 50617 init(params); 50618 } 50619 50620 /** 50621 * Open popup, add necessary classes and styles, fix scrollbar 50622 * 50623 * @param {Array} params 50624 */ 50625 50626 var openPopup = function openPopup(params) { 50627 var container = getContainer(); 50628 var popup = getPopup(); 50629 50630 if (typeof params.onBeforeOpen === 'function') { 50631 params.onBeforeOpen(popup); 50632 } 50633 50634 var bodyStyles = window.getComputedStyle(document.body); 50635 var initialBodyOverflow = bodyStyles.overflowY; 50636 addClasses$1(container, popup, params); // scrolling is 'hidden' until animation is done, after that 'auto' 50637 50638 setScrollingVisibility(container, popup); 50639 50640 if (isModal()) { 50641 fixScrollContainer(container, params.scrollbarPadding, initialBodyOverflow); 50642 setAriaHidden(); 50643 } 50644 50645 if (!isToast() && !globalState.previousActiveElement) { 50646 globalState.previousActiveElement = document.activeElement; 50647 } 50648 50649 if (typeof params.onOpen === 'function') { 50650 setTimeout(function () { 50651 return params.onOpen(popup); 50652 }); 50653 } 50654 50655 removeClass(container, swalClasses['no-transition']); 50656 }; 50657 50658 function swalOpenAnimationFinished(event) { 50659 var popup = getPopup(); 50660 50661 if (event.target !== popup) { 50662 return; 50663 } 50664 50665 var container = getContainer(); 50666 popup.removeEventListener(animationEndEvent, swalOpenAnimationFinished); 50667 container.style.overflowY = 'auto'; 50668 } 50669 50670 var setScrollingVisibility = function setScrollingVisibility(container, popup) { 50671 if (animationEndEvent && hasCssAnimation(popup)) { 50672 container.style.overflowY = 'hidden'; 50673 popup.addEventListener(animationEndEvent, swalOpenAnimationFinished); 50674 } else { 50675 container.style.overflowY = 'auto'; 50676 } 50677 }; 50678 50679 var fixScrollContainer = function fixScrollContainer(container, scrollbarPadding, initialBodyOverflow) { 50680 iOSfix(); 50681 IEfix(); 50682 50683 if (scrollbarPadding && initialBodyOverflow !== 'hidden') { 50684 fixScrollbar(); 50685 } // sweetalert2/issues/1247 50686 50687 50688 setTimeout(function () { 50689 container.scrollTop = 0; 50690 }); 50691 }; 50692 50693 var addClasses$1 = function addClasses(container, popup, params) { 50694 addClass(container, params.showClass.backdrop); 50695 show(popup); // Animate popup right after showing it 50696 50697 addClass(popup, params.showClass.popup); 50698 addClass([document.documentElement, document.body], swalClasses.shown); 50699 50700 if (params.heightAuto && params.backdrop && !params.toast) { 50701 addClass([document.documentElement, document.body], swalClasses['height-auto']); 50702 } 50703 }; 50704 50705 var handleInputOptionsAndValue = function handleInputOptionsAndValue(instance, params) { 50706 if (params.input === 'select' || params.input === 'radio') { 50707 handleInputOptions(instance, params); 50708 } else if (['text', 'email', 'number', 'tel', 'textarea'].indexOf(params.input) !== -1 && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) { 50709 handleInputValue(instance, params); 50710 } 50711 }; 50712 var getInputValue = function getInputValue(instance, innerParams) { 50713 var input = instance.getInput(); 50714 50715 if (!input) { 50716 return null; 50717 } 50718 50719 switch (innerParams.input) { 50720 case 'checkbox': 50721 return getCheckboxValue(input); 50722 50723 case 'radio': 50724 return getRadioValue(input); 50725 50726 case 'file': 50727 return getFileValue(input); 50728 50729 default: 50730 return innerParams.inputAutoTrim ? input.value.trim() : input.value; 50731 } 50732 }; 50733 50734 var getCheckboxValue = function getCheckboxValue(input) { 50735 return input.checked ? 1 : 0; 50736 }; 50737 50738 var getRadioValue = function getRadioValue(input) { 50739 return input.checked ? input.value : null; 50740 }; 50741 50742 var getFileValue = function getFileValue(input) { 50743 return input.files.length ? input.getAttribute('multiple') !== null ? input.files : input.files[0] : null; 50744 }; 50745 50746 var handleInputOptions = function handleInputOptions(instance, params) { 50747 var content = getContent(); 50748 50749 var processInputOptions = function processInputOptions(inputOptions) { 50750 return populateInputOptions[params.input](content, formatInputOptions(inputOptions), params); 50751 }; 50752 50753 if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) { 50754 showLoading(); 50755 asPromise(params.inputOptions).then(function (inputOptions) { 50756 instance.hideLoading(); 50757 processInputOptions(inputOptions); 50758 }); 50759 } else if (_typeof(params.inputOptions) === 'object') { 50760 processInputOptions(params.inputOptions); 50761 } else { 50762 error("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(_typeof(params.inputOptions))); 50763 } 50764 }; 50765 50766 var handleInputValue = function handleInputValue(instance, params) { 50767 var input = instance.getInput(); 50768 hide(input); 50769 asPromise(params.inputValue).then(function (inputValue) { 50770 input.value = params.input === 'number' ? parseFloat(inputValue) || 0 : "".concat(inputValue); 50771 show(input); 50772 input.focus(); 50773 instance.hideLoading(); 50774 })["catch"](function (err) { 50775 error("Error in inputValue promise: ".concat(err)); 50776 input.value = ''; 50777 show(input); 50778 input.focus(); 50779 instance.hideLoading(); 50780 }); 50781 }; 50782 50783 var populateInputOptions = { 50784 select: function select(content, inputOptions, params) { 50785 var select = getChildByClass(content, swalClasses.select); 50786 50787 var renderOption = function renderOption(parent, optionLabel, optionValue) { 50788 var option = document.createElement('option'); 50789 option.value = optionValue; 50790 setInnerHtml(option, optionLabel); 50791 50792 if (params.inputValue.toString() === optionValue.toString()) { 50793 option.selected = true; 50794 } 50795 50796 parent.appendChild(option); 50797 }; 50798 50799 inputOptions.forEach(function (inputOption) { 50800 var optionValue = inputOption[0]; 50801 var optionLabel = inputOption[1]; // <optgroup> spec: 50802 // https://www.w3.org/TR/html401/interact/forms.html#h-17.6 50803 // "...all OPTGROUP elements must be specified directly within a SELECT element (i.e., groups may not be nested)..." 50804 // check whether this is a <optgroup> 50805 50806 if (Array.isArray(optionLabel)) { 50807 // if it is an array, then it is an <optgroup> 50808 var optgroup = document.createElement('optgroup'); 50809 optgroup.label = optionValue; 50810 optgroup.disabled = false; // not configurable for now 50811 50812 select.appendChild(optgroup); 50813 optionLabel.forEach(function (o) { 50814 return renderOption(optgroup, o[1], o[0]); 50815 }); 50816 } else { 50817 // case of <option> 50818 renderOption(select, optionLabel, optionValue); 50819 } 50820 }); 50821 select.focus(); 50822 }, 50823 radio: function radio(content, inputOptions, params) { 50824 var radio = getChildByClass(content, swalClasses.radio); 50825 inputOptions.forEach(function (inputOption) { 50826 var radioValue = inputOption[0]; 50827 var radioLabel = inputOption[1]; 50828 var radioInput = document.createElement('input'); 50829 var radioLabelElement = document.createElement('label'); 50830 radioInput.type = 'radio'; 50831 radioInput.name = swalClasses.radio; 50832 radioInput.value = radioValue; 50833 50834 if (params.inputValue.toString() === radioValue.toString()) { 50835 radioInput.checked = true; 50836 } 50837 50838 var label = document.createElement('span'); 50839 setInnerHtml(label, radioLabel); 50840 label.className = swalClasses.label; 50841 radioLabelElement.appendChild(radioInput); 50842 radioLabelElement.appendChild(label); 50843 radio.appendChild(radioLabelElement); 50844 }); 50845 var radios = radio.querySelectorAll('input'); 50846 50847 if (radios.length) { 50848 radios[0].focus(); 50849 } 50850 } 50851 }; 50852 /** 50853 * Converts `inputOptions` into an array of `[value, label]`s 50854 * @param inputOptions 50855 */ 50856 50857 var formatInputOptions = function formatInputOptions(inputOptions) { 50858 var result = []; 50859 50860 if (typeof Map !== 'undefined' && inputOptions instanceof Map) { 50861 inputOptions.forEach(function (value, key) { 50862 var valueFormatted = value; 50863 50864 if (_typeof(valueFormatted) === 'object') { 50865 // case of <optgroup> 50866 valueFormatted = formatInputOptions(valueFormatted); 50867 } 50868 50869 result.push([key, valueFormatted]); 50870 }); 50871 } else { 50872 Object.keys(inputOptions).forEach(function (key) { 50873 var valueFormatted = inputOptions[key]; 50874 50875 if (_typeof(valueFormatted) === 'object') { 50876 // case of <optgroup> 50877 valueFormatted = formatInputOptions(valueFormatted); 50878 } 50879 50880 result.push([key, valueFormatted]); 50881 }); 50882 } 50883 50884 return result; 50885 }; 50886 50887 var handleConfirmButtonClick = function handleConfirmButtonClick(instance, innerParams) { 50888 instance.disableButtons(); 50889 50890 if (innerParams.input) { 50891 handleConfirmWithInput(instance, innerParams); 50892 } else { 50893 confirm(instance, innerParams, true); 50894 } 50895 }; 50896 var handleCancelButtonClick = function handleCancelButtonClick(instance, dismissWith) { 50897 instance.disableButtons(); 50898 dismissWith(DismissReason.cancel); 50899 }; 50900 50901 var handleConfirmWithInput = function handleConfirmWithInput(instance, innerParams) { 50902 var inputValue = getInputValue(instance, innerParams); 50903 50904 if (innerParams.inputValidator) { 50905 instance.disableInput(); 50906 var validationPromise = Promise.resolve().then(function () { 50907 return asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage)); 50908 }); 50909 validationPromise.then(function (validationMessage) { 50910 instance.enableButtons(); 50911 instance.enableInput(); 50912 50913 if (validationMessage) { 50914 instance.showValidationMessage(validationMessage); 50915 } else { 50916 confirm(instance, innerParams, inputValue); 50917 } 50918 }); 50919 } else if (!instance.getInput().checkValidity()) { 50920 instance.enableButtons(); 50921 instance.showValidationMessage(innerParams.validationMessage); 50922 } else { 50923 confirm(instance, innerParams, inputValue); 50924 } 50925 }; 50926 50927 var succeedWith = function succeedWith(instance, value) { 50928 instance.closePopup({ 50929 value: value 50930 }); 50931 }; 50932 50933 var confirm = function confirm(instance, innerParams, value) { 50934 if (innerParams.showLoaderOnConfirm) { 50935 showLoading(); // TODO: make showLoading an *instance* method 50936 } 50937 50938 if (innerParams.preConfirm) { 50939 instance.resetValidationMessage(); 50940 var preConfirmPromise = Promise.resolve().then(function () { 50941 return asPromise(innerParams.preConfirm(value, innerParams.validationMessage)); 50942 }); 50943 preConfirmPromise.then(function (preConfirmValue) { 50944 if (isVisible(getValidationMessage()) || preConfirmValue === false) { 50945 instance.hideLoading(); 50946 } else { 50947 succeedWith(instance, typeof preConfirmValue === 'undefined' ? value : preConfirmValue); 50948 } 50949 }); 50950 } else { 50951 succeedWith(instance, value); 50952 } 50953 }; 50954 50955 var addKeydownHandler = function addKeydownHandler(instance, globalState, innerParams, dismissWith) { 50956 if (globalState.keydownTarget && globalState.keydownHandlerAdded) { 50957 globalState.keydownTarget.removeEventListener('keydown', globalState.keydownHandler, { 50958 capture: globalState.keydownListenerCapture 50959 }); 50960 globalState.keydownHandlerAdded = false; 50961 } 50962 50963 if (!innerParams.toast) { 50964 globalState.keydownHandler = function (e) { 50965 return keydownHandler(instance, e, dismissWith); 50966 }; 50967 50968 globalState.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); 50969 globalState.keydownListenerCapture = innerParams.keydownListenerCapture; 50970 globalState.keydownTarget.addEventListener('keydown', globalState.keydownHandler, { 50971 capture: globalState.keydownListenerCapture 50972 }); 50973 globalState.keydownHandlerAdded = true; 50974 } 50975 }; // Focus handling 50976 50977 var setFocus = function setFocus(innerParams, index, increment) { 50978 var focusableElements = getFocusableElements(); // search for visible elements and select the next possible match 50979 50980 for (var i = 0; i < focusableElements.length; i++) { 50981 index = index + increment; // rollover to first item 50982 50983 if (index === focusableElements.length) { 50984 index = 0; // go to last item 50985 } else if (index === -1) { 50986 index = focusableElements.length - 1; 50987 } 50988 50989 return focusableElements[index].focus(); 50990 } // no visible focusable elements, focus the popup 50991 50992 50993 getPopup().focus(); 50994 }; 50995 var arrowKeys = ['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown', 'Left', 'Right', 'Up', 'Down' // IE11 50996 ]; 50997 var escKeys = ['Escape', 'Esc' // IE11 50998 ]; 50999 51000 var keydownHandler = function keydownHandler(instance, e, dismissWith) { 51001 var innerParams = privateProps.innerParams.get(instance); 51002 51003 if (innerParams.stopKeydownPropagation) { 51004 e.stopPropagation(); 51005 } // ENTER 51006 51007 51008 if (e.key === 'Enter') { 51009 handleEnter(instance, e, innerParams); // TAB 51010 } else if (e.key === 'Tab') { 51011 handleTab(e, innerParams); // ARROWS - switch focus between buttons 51012 } else if (arrowKeys.indexOf(e.key) !== -1) { 51013 handleArrows(); // ESC 51014 } else if (escKeys.indexOf(e.key) !== -1) { 51015 handleEsc(e, innerParams, dismissWith); 51016 } 51017 }; 51018 51019 var handleEnter = function handleEnter(instance, e, innerParams) { 51020 // #720 #721 51021 if (e.isComposing) { 51022 return; 51023 } 51024 51025 if (e.target && instance.getInput() && e.target.outerHTML === instance.getInput().outerHTML) { 51026 if (['textarea', 'file'].indexOf(innerParams.input) !== -1) { 51027 return; // do not submit 51028 } 51029 51030 clickConfirm(); 51031 e.preventDefault(); 51032 } 51033 }; 51034 51035 var handleTab = function handleTab(e, innerParams) { 51036 var targetElement = e.target; 51037 var focusableElements = getFocusableElements(); 51038 var btnIndex = -1; 51039 51040 for (var i = 0; i < focusableElements.length; i++) { 51041 if (targetElement === focusableElements[i]) { 51042 btnIndex = i; 51043 break; 51044 } 51045 } 51046 51047 if (!e.shiftKey) { 51048 // Cycle to the next button 51049 setFocus(innerParams, btnIndex, 1); 51050 } else { 51051 // Cycle to the prev button 51052 setFocus(innerParams, btnIndex, -1); 51053 } 51054 51055 e.stopPropagation(); 51056 e.preventDefault(); 51057 }; 51058 51059 var handleArrows = function handleArrows() { 51060 var confirmButton = getConfirmButton(); 51061 var cancelButton = getCancelButton(); // focus Cancel button if Confirm button is currently focused 51062 51063 if (document.activeElement === confirmButton && isVisible(cancelButton)) { 51064 cancelButton.focus(); // and vice versa 51065 } else if (document.activeElement === cancelButton && isVisible(confirmButton)) { 51066 confirmButton.focus(); 51067 } 51068 }; 51069 51070 var handleEsc = function handleEsc(e, innerParams, dismissWith) { 51071 if (callIfFunction(innerParams.allowEscapeKey)) { 51072 e.preventDefault(); 51073 dismissWith(DismissReason.esc); 51074 } 51075 }; 51076 51077 var handlePopupClick = function handlePopupClick(instance, domCache, dismissWith) { 51078 var innerParams = privateProps.innerParams.get(instance); 51079 51080 if (innerParams.toast) { 51081 handleToastClick(instance, domCache, dismissWith); 51082 } else { 51083 // Ignore click events that had mousedown on the popup but mouseup on the container 51084 // This can happen when the user drags a slider 51085 handleModalMousedown(domCache); // Ignore click events that had mousedown on the container but mouseup on the popup 51086 51087 handleContainerMousedown(domCache); 51088 handleModalClick(instance, domCache, dismissWith); 51089 } 51090 }; 51091 51092 var handleToastClick = function handleToastClick(instance, domCache, dismissWith) { 51093 // Closing toast by internal click 51094 domCache.popup.onclick = function () { 51095 var innerParams = privateProps.innerParams.get(instance); 51096 51097 if (innerParams.showConfirmButton || innerParams.showCancelButton || innerParams.showCloseButton || innerParams.input) { 51098 return; 51099 } 51100 51101 dismissWith(DismissReason.close); 51102 }; 51103 }; 51104 51105 var ignoreOutsideClick = false; 51106 51107 var handleModalMousedown = function handleModalMousedown(domCache) { 51108 domCache.popup.onmousedown = function () { 51109 domCache.container.onmouseup = function (e) { 51110 domCache.container.onmouseup = undefined; // We only check if the mouseup target is the container because usually it doesn't 51111 // have any other direct children aside of the popup 51112 51113 if (e.target === domCache.container) { 51114 ignoreOutsideClick = true; 51115 } 51116 }; 51117 }; 51118 }; 51119 51120 var handleContainerMousedown = function handleContainerMousedown(domCache) { 51121 domCache.container.onmousedown = function () { 51122 domCache.popup.onmouseup = function (e) { 51123 domCache.popup.onmouseup = undefined; // We also need to check if the mouseup target is a child of the popup 51124 51125 if (e.target === domCache.popup || domCache.popup.contains(e.target)) { 51126 ignoreOutsideClick = true; 51127 } 51128 }; 51129 }; 51130 }; 51131 51132 var handleModalClick = function handleModalClick(instance, domCache, dismissWith) { 51133 domCache.container.onclick = function (e) { 51134 var innerParams = privateProps.innerParams.get(instance); 51135 51136 if (ignoreOutsideClick) { 51137 ignoreOutsideClick = false; 51138 return; 51139 } 51140 51141 if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) { 51142 dismissWith(DismissReason.backdrop); 51143 } 51144 }; 51145 }; 51146 51147 function _main(userParams) { 51148 showWarningsForParams(userParams); 51149 51150 if (globalState.currentInstance) { 51151 globalState.currentInstance._destroy(); 51152 } 51153 51154 globalState.currentInstance = this; 51155 var innerParams = prepareParams(userParams); 51156 setParameters(innerParams); 51157 Object.freeze(innerParams); // clear the previous timer 51158 51159 if (globalState.timeout) { 51160 globalState.timeout.stop(); 51161 delete globalState.timeout; 51162 } // clear the restore focus timeout 51163 51164 51165 clearTimeout(globalState.restoreFocusTimeout); 51166 var domCache = populateDomCache(this); 51167 render(this, innerParams); 51168 privateProps.innerParams.set(this, innerParams); 51169 return swalPromise(this, domCache, innerParams); 51170 } 51171 51172 var prepareParams = function prepareParams(userParams) { 51173 var showClass = _extends({}, defaultParams.showClass, userParams.showClass); 51174 51175 var hideClass = _extends({}, defaultParams.hideClass, userParams.hideClass); 51176 51177 var params = _extends({}, defaultParams, userParams); 51178 51179 params.showClass = showClass; 51180 params.hideClass = hideClass; // @deprecated 51181 51182 if (userParams.animation === false) { 51183 params.showClass = { 51184 popup: 'swal2-noanimation', 51185 backdrop: 'swal2-noanimation' 51186 }; 51187 params.hideClass = {}; 51188 } 51189 51190 return params; 51191 }; 51192 51193 var swalPromise = function swalPromise(instance, domCache, innerParams) { 51194 return new Promise(function (resolve) { 51195 // functions to handle all closings/dismissals 51196 var dismissWith = function dismissWith(dismiss) { 51197 instance.closePopup({ 51198 dismiss: dismiss 51199 }); 51200 }; 51201 51202 privateMethods.swalPromiseResolve.set(instance, resolve); 51203 51204 domCache.confirmButton.onclick = function () { 51205 return handleConfirmButtonClick(instance, innerParams); 51206 }; 51207 51208 domCache.cancelButton.onclick = function () { 51209 return handleCancelButtonClick(instance, dismissWith); 51210 }; 51211 51212 domCache.closeButton.onclick = function () { 51213 return dismissWith(DismissReason.close); 51214 }; 51215 51216 handlePopupClick(instance, domCache, dismissWith); 51217 addKeydownHandler(instance, globalState, innerParams, dismissWith); 51218 51219 if (innerParams.toast && (innerParams.input || innerParams.footer || innerParams.showCloseButton)) { 51220 addClass(document.body, swalClasses['toast-column']); 51221 } else { 51222 removeClass(document.body, swalClasses['toast-column']); 51223 } 51224 51225 handleInputOptionsAndValue(instance, innerParams); 51226 openPopup(innerParams); 51227 setupTimer(globalState, innerParams, dismissWith); 51228 initFocus(domCache, innerParams); // Scroll container to top on open (#1247, #1946) 51229 51230 setTimeout(function () { 51231 domCache.container.scrollTop = 0; 51232 }); 51233 }); 51234 }; 51235 51236 var populateDomCache = function populateDomCache(instance) { 51237 var domCache = { 51238 popup: getPopup(), 51239 container: getContainer(), 51240 content: getContent(), 51241 actions: getActions(), 51242 confirmButton: getConfirmButton(), 51243 cancelButton: getCancelButton(), 51244 closeButton: getCloseButton(), 51245 validationMessage: getValidationMessage(), 51246 progressSteps: getProgressSteps() 51247 }; 51248 privateProps.domCache.set(instance, domCache); 51249 return domCache; 51250 }; 51251 51252 var setupTimer = function setupTimer(globalState$$1, innerParams, dismissWith) { 51253 var timerProgressBar = getTimerProgressBar(); 51254 hide(timerProgressBar); 51255 51256 if (innerParams.timer) { 51257 globalState$$1.timeout = new Timer(function () { 51258 dismissWith('timer'); 51259 delete globalState$$1.timeout; 51260 }, innerParams.timer); 51261 51262 if (innerParams.timerProgressBar) { 51263 show(timerProgressBar); 51264 setTimeout(function () { 51265 if (globalState$$1.timeout.running) { 51266 // timer can be already stopped at this point 51267 animateTimerProgressBar(innerParams.timer); 51268 } 51269 }); 51270 } 51271 } 51272 }; 51273 51274 var initFocus = function initFocus(domCache, innerParams) { 51275 if (innerParams.toast) { 51276 return; 51277 } 51278 51279 if (!callIfFunction(innerParams.allowEnterKey)) { 51280 return blurActiveElement(); 51281 } 51282 51283 if (innerParams.focusCancel && isVisible(domCache.cancelButton)) { 51284 return domCache.cancelButton.focus(); 51285 } 51286 51287 if (innerParams.focusConfirm && isVisible(domCache.confirmButton)) { 51288 return domCache.confirmButton.focus(); 51289 } 51290 51291 setFocus(innerParams, -1, 1); 51292 }; 51293 51294 var blurActiveElement = function blurActiveElement() { 51295 if (document.activeElement && typeof document.activeElement.blur === 'function') { 51296 document.activeElement.blur(); 51297 } 51298 }; 51299 51300 /** 51301 * Updates popup parameters. 51302 */ 51303 51304 function update(params) { 51305 var popup = getPopup(); 51306 var innerParams = privateProps.innerParams.get(this); 51307 51308 if (!popup || hasClass(popup, innerParams.hideClass.popup)) { 51309 return warn("You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup."); 51310 } 51311 51312 var validUpdatableParams = {}; // assign valid params from `params` to `defaults` 51313 51314 Object.keys(params).forEach(function (param) { 51315 if (Swal.isUpdatableParameter(param)) { 51316 validUpdatableParams[param] = params[param]; 51317 } else { 51318 warn("Invalid parameter to update: \"".concat(param, "\". Updatable params are listed here: https://github.com/sweetalert2/sweetalert2/blob/master/src/utils/params.js")); 51319 } 51320 }); 51321 51322 var updatedParams = _extends({}, innerParams, validUpdatableParams); 51323 51324 render(this, updatedParams); 51325 privateProps.innerParams.set(this, updatedParams); 51326 Object.defineProperties(this, { 51327 params: { 51328 value: _extends({}, this.params, params), 51329 writable: false, 51330 enumerable: true 51331 } 51332 }); 51333 } 51334 51335 function _destroy() { 51336 var domCache = privateProps.domCache.get(this); 51337 var innerParams = privateProps.innerParams.get(this); 51338 51339 if (!innerParams) { 51340 return; // This instance has already been destroyed 51341 } // Check if there is another Swal closing 51342 51343 51344 if (domCache.popup && globalState.swalCloseEventFinishedCallback) { 51345 globalState.swalCloseEventFinishedCallback(); 51346 delete globalState.swalCloseEventFinishedCallback; 51347 } // Check if there is a swal disposal defer timer 51348 51349 51350 if (globalState.deferDisposalTimer) { 51351 clearTimeout(globalState.deferDisposalTimer); 51352 delete globalState.deferDisposalTimer; 51353 } 51354 51355 if (typeof innerParams.onDestroy === 'function') { 51356 innerParams.onDestroy(); 51357 } 51358 51359 disposeSwal(this); 51360 } 51361 51362 var disposeSwal = function disposeSwal(instance) { 51363 // Unset this.params so GC will dispose it (#1569) 51364 delete instance.params; // Unset globalState props so GC will dispose globalState (#1569) 51365 51366 delete globalState.keydownHandler; 51367 delete globalState.keydownTarget; // Unset WeakMaps so GC will be able to dispose them (#1569) 51368 51369 unsetWeakMaps(privateProps); 51370 unsetWeakMaps(privateMethods); 51371 }; 51372 51373 var unsetWeakMaps = function unsetWeakMaps(obj) { 51374 for (var i in obj) { 51375 obj[i] = new WeakMap(); 51376 } 51377 }; 51378 51379 51380 51381 var instanceMethods = /*#__PURE__*/Object.freeze({ 51382 hideLoading: hideLoading, 51383 disableLoading: hideLoading, 51384 getInput: getInput$1, 51385 close: close, 51386 closePopup: close, 51387 closeModal: close, 51388 closeToast: close, 51389 enableButtons: enableButtons, 51390 disableButtons: disableButtons, 51391 enableInput: enableInput, 51392 disableInput: disableInput, 51393 showValidationMessage: showValidationMessage, 51394 resetValidationMessage: resetValidationMessage$1, 51395 getProgressSteps: getProgressSteps$1, 51396 _main: _main, 51397 update: update, 51398 _destroy: _destroy 51399 }); 51400 51401 var currentInstance; 51402 51403 var SweetAlert = /*#__PURE__*/function () { 51404 function SweetAlert() { 51405 _classCallCheck(this, SweetAlert); 51406 51407 // Prevent run in Node env 51408 if (typeof window === 'undefined') { 51409 return; 51410 } // Check for the existence of Promise 51411 51412 51413 if (typeof Promise === 'undefined') { 51414 error('This package requires a Promise library, please include a shim to enable it in this browser (See: https://github.com/sweetalert2/sweetalert2/wiki/Migration-from-SweetAlert-to-SweetAlert2#1-ie-support)'); 51415 } 51416 51417 currentInstance = this; 51418 51419 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { 51420 args[_key] = arguments[_key]; 51421 } 51422 51423 var outerParams = Object.freeze(this.constructor.argsToParams(args)); 51424 Object.defineProperties(this, { 51425 params: { 51426 value: outerParams, 51427 writable: false, 51428 enumerable: true, 51429 configurable: true 51430 } 51431 }); 51432 51433 var promise = this._main(this.params); 51434 51435 privateProps.promise.set(this, promise); 51436 } // `catch` cannot be the name of a module export, so we define our thenable methods here instead 51437 51438 51439 _createClass(SweetAlert, [{ 51440 key: "then", 51441 value: function then(onFulfilled) { 51442 var promise = privateProps.promise.get(this); 51443 return promise.then(onFulfilled); 51444 } 51445 }, { 51446 key: "finally", 51447 value: function _finally(onFinally) { 51448 var promise = privateProps.promise.get(this); 51449 return promise["finally"](onFinally); 51450 } 51451 }]); 51452 51453 return SweetAlert; 51454 }(); // Assign instance methods from src/instanceMethods/*.js to prototype 51455 51456 51457 _extends(SweetAlert.prototype, instanceMethods); // Assign static methods from src/staticMethods/*.js to constructor 51458 51459 51460 _extends(SweetAlert, staticMethods); // Proxy to instance methods to constructor, for now, for backwards compatibility 51461 51462 51463 Object.keys(instanceMethods).forEach(function (key) { 51464 SweetAlert[key] = function () { 51465 if (currentInstance) { 51466 var _currentInstance; 51467 51468 return (_currentInstance = currentInstance)[key].apply(_currentInstance, arguments); 51469 } 51470 }; 51471 }); 51472 SweetAlert.DismissReason = DismissReason; 51473 SweetAlert.version = '9.17.2'; 51474 51475 var Swal = SweetAlert; 51476 Swal["default"] = Swal; 51477 51478 return Swal; 51479 51480})); 51481if (typeof this !== 'undefined' && this.Sweetalert2){ this.swal = this.sweetAlert = this.Swal = this.SweetAlert = this.Sweetalert2} 51482 51483"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{flex-direction:row;align-items:center;width:auto;padding:.625em;overflow-y:hidden;background:#fff;box-shadow:0 0 .625em #d9d9d9}.swal2-popup.swal2-toast .swal2-header{flex-direction:row;padding:0}.swal2-popup.swal2-toast .swal2-title{flex-grow:1;justify-content:flex-start;margin:0 .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{position:static;width:.8em;height:.8em;line-height:.8}.swal2-popup.swal2-toast .swal2-content{justify-content:flex-start;padding:0;font-size:1em}.swal2-popup.swal2-toast .swal2-icon{width:2em;min-width:2em;height:2em;margin:0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:700}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{font-size:.25em}}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{flex-basis:auto!important;width:auto;height:auto;margin:0 .3125em}.swal2-popup.swal2-toast .swal2-styled{margin:0 .3125em;padding:.3125em .625em;font-size:1em}.swal2-popup.swal2-toast .swal2-styled:focus{box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;transform:rotate(45deg);border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.8em;left:-.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-toast-animate-success-line-tip .75s;animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-toast-animate-success-line-long .75s;animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{-webkit-animation:swal2-toast-show .5s;animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{-webkit-animation:swal2-toast-hide .1s forwards;animation:swal2-toast-hide .1s forwards}.swal2-container{display:flex;position:fixed;z-index:1060;top:0;right:0;bottom:0;left:0;flex-direction:row;align-items:center;justify-content:center;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}.swal2-container.swal2-backdrop-show,.swal2-container.swal2-noanimation{background:rgba(0,0,0,.4)}.swal2-container.swal2-backdrop-hide{background:0 0!important}.swal2-container.swal2-top{align-items:flex-start}.swal2-container.swal2-top-left,.swal2-container.swal2-top-start{align-items:flex-start;justify-content:flex-start}.swal2-container.swal2-top-end,.swal2-container.swal2-top-right{align-items:flex-start;justify-content:flex-end}.swal2-container.swal2-center{align-items:center}.swal2-container.swal2-center-left,.swal2-container.swal2-center-start{align-items:center;justify-content:flex-start}.swal2-container.swal2-center-end,.swal2-container.swal2-center-right{align-items:center;justify-content:flex-end}.swal2-container.swal2-bottom{align-items:flex-end}.swal2-container.swal2-bottom-left,.swal2-container.swal2-bottom-start{align-items:flex-end;justify-content:flex-start}.swal2-container.swal2-bottom-end,.swal2-container.swal2-bottom-right{align-items:flex-end;justify-content:flex-end}.swal2-container.swal2-bottom-end>:first-child,.swal2-container.swal2-bottom-left>:first-child,.swal2-container.swal2-bottom-right>:first-child,.swal2-container.swal2-bottom-start>:first-child,.swal2-container.swal2-bottom>:first-child{margin-top:auto}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:flex!important;flex:1;align-self:stretch;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-grow-column{flex:1;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-bottom-start,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-center-start,.swal2-container.swal2-grow-column.swal2-top-left,.swal2-container.swal2-grow-column.swal2-top-start{align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-end,.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-end,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-end,.swal2-container.swal2-grow-column.swal2-top-right{align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:flex!important;flex:1;align-content:center;justify-content:center}.swal2-container.swal2-no-transition{transition:none!important}.swal2-container:not(.swal2-top):not(.swal2-top-start):not(.swal2-top-end):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-start):not(.swal2-center-end):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-start):not(.swal2-bottom-end):not(.swal2-bottom-left):not(.swal2-bottom-right):not(.swal2-grow-fullscreen)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-popup{display:none;position:relative;box-sizing:border-box;flex-direction:column;justify-content:center;width:32em;max-width:100%;padding:1.25em;border:none;border-radius:.3125em;background:#fff;font-family:inherit;font-size:1rem}.swal2-popup:focus{outline:0}.swal2-popup.swal2-loading{overflow-y:hidden}.swal2-header{display:flex;flex-direction:column;align-items:center;padding:0 1.8em}.swal2-title{position:relative;max-width:100%;margin:0 0 .4em;padding:0;color:#595959;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}.swal2-actions{display:flex;z-index:1;flex-wrap:wrap;align-items:center;justify-content:center;width:100%;margin:1.25em auto 0}.swal2-actions:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}.swal2-actions:not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0,0,0,.1),rgba(0,0,0,.1))}.swal2-actions:not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0,0,0,.2),rgba(0,0,0,.2))}.swal2-actions.swal2-loading .swal2-styled.swal2-confirm{box-sizing:border-box;width:2.5em;height:2.5em;margin:.46875em;padding:0;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:.25em solid transparent;border-radius:100%;border-color:transparent;background-color:transparent!important;color:transparent!important;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-actions.swal2-loading .swal2-styled.swal2-cancel{margin-right:30px;margin-left:30px}.swal2-actions.swal2-loading :not(.swal2-styled).swal2-confirm::after{content:\"\";display:inline-block;width:15px;height:15px;margin-left:5px;-webkit-animation:swal2-rotate-loading 1.5s linear 0s infinite normal;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border:3px solid #999;border-radius:50%;border-right-color:transparent;box-shadow:1px 1px 1px #fff}.swal2-styled{margin:.3125em;padding:.625em 2em;box-shadow:none;font-weight:500}.swal2-styled:not([disabled]){cursor:pointer}.swal2-styled.swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#3085d6;color:#fff;font-size:1.0625em}.swal2-styled.swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#aaa;color:#fff;font-size:1.0625em}.swal2-styled:focus{outline:0;box-shadow:0 0 0 1px #fff,0 0 0 3px rgba(50,100,150,.4)}.swal2-styled::-moz-focus-inner{border:0}.swal2-footer{justify-content:center;margin:1.25em 0 0;padding:1em 0 0;border-top:1px solid #eee;color:#545454;font-size:1em}.swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;height:.25em;overflow:hidden;border-bottom-right-radius:.3125em;border-bottom-left-radius:.3125em}.swal2-timer-progress-bar{width:100%;height:.25em;background:rgba(0,0,0,.2)}.swal2-image{max-width:100%;margin:1.25em auto}.swal2-close{position:absolute;z-index:2;top:0;right:0;align-items:center;justify-content:center;width:1.2em;height:1.2em;padding:0;overflow:hidden;transition:color .1s ease-out;border:none;border-radius:0;background:0 0;color:#ccc;font-family:serif;font-size:2.5em;line-height:1.2;cursor:pointer}.swal2-close:hover{transform:none;background:0 0;color:#f27474}.swal2-close::-moz-focus-inner{border:0}.swal2-content{z-index:1;justify-content:center;margin:0;padding:0 1.6em;color:#545454;font-size:1.125em;font-weight:400;line-height:normal;text-align:center;word-wrap:break-word}.swal2-checkbox,.swal2-file,.swal2-input,.swal2-radio,.swal2-select,.swal2-textarea{margin:1em auto}.swal2-file,.swal2-input,.swal2-textarea{box-sizing:border-box;width:100%;transition:border-color .3s,box-shadow .3s;border:1px solid #d9d9d9;border-radius:.1875em;background:inherit;box-shadow:inset 0 1px 1px rgba(0,0,0,.06);color:inherit;font-size:1.125em}.swal2-file.swal2-inputerror,.swal2-input.swal2-inputerror,.swal2-textarea.swal2-inputerror{border-color:#f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-file:focus,.swal2-input:focus,.swal2-textarea:focus{border:1px solid #b4dbed;outline:0;box-shadow:0 0 3px #c4e6f5}.swal2-file::-moz-placeholder,.swal2-input::-moz-placeholder,.swal2-textarea::-moz-placeholder{color:#ccc}.swal2-file:-ms-input-placeholder,.swal2-input:-ms-input-placeholder,.swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-file::-ms-input-placeholder,.swal2-input::-ms-input-placeholder,.swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-file::placeholder,.swal2-input::placeholder,.swal2-textarea::placeholder{color:#ccc}.swal2-range{margin:1em auto;background:#fff}.swal2-range input{width:80%}.swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}.swal2-range input,.swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}.swal2-input{height:2.625em;padding:0 .75em}.swal2-input[type=number]{max-width:10em}.swal2-file{background:inherit;font-size:1.125em}.swal2-textarea{height:6.75em;padding:.75em}.swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:inherit;color:inherit;font-size:1.125em}.swal2-checkbox,.swal2-radio{align-items:center;justify-content:center;background:#fff;color:inherit}.swal2-checkbox label,.swal2-radio label{margin:0 .6em;font-size:1.125em}.swal2-checkbox input,.swal2-radio input{margin:0 .4em}.swal2-validation-message{display:none;align-items:center;justify-content:center;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}.swal2-validation-message::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}.swal2-icon{position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:1.25em auto 1.875em;border:.25em solid transparent;border-radius:50%;font-family:inherit;line-height:5em;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}.swal2-icon.swal2-error{border-color:#f27474;color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;flex-grow:1}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}.swal2-icon.swal2-error.swal2-icon-show{-webkit-animation:swal2-animate-error-icon .5s;animation:swal2-animate-error-icon .5s}.swal2-icon.swal2-error.swal2-icon-show .swal2-x-mark{-webkit-animation:swal2-animate-error-x-mark .5s;animation:swal2-animate-error-x-mark .5s}.swal2-icon.swal2-warning{border-color:#facea8;color:#f8bb86}.swal2-icon.swal2-info{border-color:#9de0f6;color:#3fc3ee}.swal2-icon.swal2-question{border-color:#c9dae1;color:#87adbd}.swal2-icon.swal2-success{border-color:#a5dc86;color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;transform:rotate(45deg);border-radius:50%}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{top:-.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{top:-.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}.swal2-icon.swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-.25em;left:-.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}.swal2-icon.swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-tip{-webkit-animation:swal2-animate-success-line-tip .75s;animation:swal2-animate-success-line-tip .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-line-long{-webkit-animation:swal2-animate-success-line-long .75s;animation:swal2-animate-success-line-long .75s}.swal2-icon.swal2-success.swal2-icon-show .swal2-success-circular-line-right{-webkit-animation:swal2-rotate-success-circular-line 4.25s ease-in;animation:swal2-rotate-success-circular-line 4.25s ease-in}.swal2-progress-steps{align-items:center;margin:0 0 1.25em;padding:0;background:inherit;font-weight:600}.swal2-progress-steps li{display:inline-block;position:relative}.swal2-progress-steps .swal2-progress-step{z-index:20;width:2em;height:2em;border-radius:2em;background:#3085d6;color:#fff;line-height:2em;text-align:center}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#3085d6}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}.swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}.swal2-progress-steps .swal2-progress-step-line{z-index:10;width:2.5em;height:.4em;margin:0 -1px;background:#3085d6}[class^=swal2]{-webkit-tap-highlight-color:transparent}.swal2-show{-webkit-animation:swal2-show .3s;animation:swal2-show .3s}.swal2-hide{-webkit-animation:swal2-hide .15s forwards;animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{right:auto;left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@-moz-document url-prefix(){.swal2-close:focus{outline:2px solid rgba(50,100,150,.4)}}@-webkit-keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@keyframes swal2-toast-show{0%{transform:translateY(-.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0)}}@-webkit-keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@-webkit-keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@-webkit-keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@-webkit-keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@keyframes swal2-show{0%{transform:scale(.7)}45%{transform:scale(1.05)}80%{transform:scale(.95)}100%{transform:scale(1)}}@-webkit-keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(.5);opacity:0}}@-webkit-keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@-webkit-keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@-webkit-keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@-webkit-keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(.4);opacity:0}50%{margin-top:1.625em;transform:scale(.4);opacity:0}80%{margin-top:-.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@-webkit-keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0);opacity:1}}@-webkit-keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes swal2-rotate-loading{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto!important}body.swal2-no-backdrop .swal2-container{top:auto;right:auto;bottom:auto;left:auto;max-width:calc(100% - .625em * 2);background-color:transparent!important}body.swal2-no-backdrop .swal2-container>.swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}body.swal2-no-backdrop .swal2-container.swal2-top{top:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-top-left,body.swal2-no-backdrop .swal2-container.swal2-top-start{top:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-top-end,body.swal2-no-backdrop .swal2-container.swal2-top-right{top:0;right:0}body.swal2-no-backdrop .swal2-container.swal2-center{top:50%;left:50%;transform:translate(-50%,-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-left,body.swal2-no-backdrop .swal2-container.swal2-center-start{top:50%;left:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-center-end,body.swal2-no-backdrop .swal2-container.swal2-center-right{top:50%;right:0;transform:translateY(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom{bottom:0;left:50%;transform:translateX(-50%)}body.swal2-no-backdrop .swal2-container.swal2-bottom-left,body.swal2-no-backdrop .swal2-container.swal2-bottom-start{bottom:0;left:0}body.swal2-no-backdrop .swal2-container.swal2-bottom-end,body.swal2-no-backdrop .swal2-container.swal2-bottom-right{right:0;bottom:0}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll!important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static!important}}body.swal2-toast-shown .swal2-container{background-color:transparent}body.swal2-toast-shown .swal2-container.swal2-top{top:0;right:auto;bottom:auto;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{top:0;right:0;bottom:auto;left:auto}body.swal2-toast-shown .swal2-container.swal2-top-left,body.swal2-toast-shown .swal2-container.swal2-top-start{top:0;right:auto;bottom:auto;left:0}body.swal2-toast-shown .swal2-container.swal2-center-left,body.swal2-toast-shown .swal2-container.swal2-center-start{top:50%;right:auto;bottom:auto;left:0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{top:50%;right:0;bottom:auto;left:auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-left,body.swal2-toast-shown .swal2-container.swal2-bottom-start{top:auto;right:auto;bottom:0;left:0}body.swal2-toast-shown .swal2-container.swal2-bottom{top:auto;right:auto;bottom:0;left:50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{top:auto;right:0;bottom:0;left:auto}body.swal2-toast-column .swal2-toast{flex-direction:column;align-items:stretch}body.swal2-toast-column .swal2-toast .swal2-actions{flex:1;align-self:stretch;height:2.2em;margin-top:.3125em}body.swal2-toast-column .swal2-toast .swal2-loading{justify-content:center}body.swal2-toast-column .swal2-toast .swal2-input{height:2em;margin:.3125em auto;font-size:1em}body.swal2-toast-column .swal2-toast .swal2-validation-message{font-size:1em}"); 51484 51485/***/ }), 51486
vendor: 2,587 bytes, lines 51487-51561
51487/***/ "./node_modules/timers-browserify/main.js": 51488/*!************************************************!*\ 51489 !*** ./node_modules/timers-browserify/main.js ***! 51490 \************************************************/ 51491/*! no static exports found */ 51492/***/ (function(module, exports, __webpack_require__) { 51493 51494/* WEBPACK VAR INJECTION */(function(global) {var scope = (typeof global !== "undefined" && global) || 51495 (typeof self !== "undefined" && self) || 51496 window; 51497var apply = Function.prototype.apply; 51498 51499// DOM APIs, for completeness 51500 51501exports.setTimeout = function() { 51502 return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout); 51503}; 51504exports.setInterval = function() { 51505 return new Timeout(apply.call(setInterval, scope, arguments), clearInterval); 51506}; 51507exports.clearTimeout = 51508exports.clearInterval = function(timeout) { 51509 if (timeout) { 51510 timeout.close(); 51511 } 51512}; 51513 51514function Timeout(id, clearFn) { 51515 this._id = id; 51516 this._clearFn = clearFn; 51517} 51518Timeout.prototype.unref = Timeout.prototype.ref = function() {}; 51519Timeout.prototype.close = function() { 51520 this._clearFn.call(scope, this._id); 51521}; 51522 51523// Does not start the time, just sets up the members needed. 51524exports.enroll = function(item, msecs) { 51525 clearTimeout(item._idleTimeoutId); 51526 item._idleTimeout = msecs; 51527}; 51528 51529exports.unenroll = function(item) { 51530 clearTimeout(item._idleTimeoutId); 51531 item._idleTimeout = -1; 51532}; 51533 51534exports._unrefActive = exports.active = function(item) { 51535 clearTimeout(item._idleTimeoutId); 51536 51537 var msecs = item._idleTimeout; 51538 if (msecs >= 0) { 51539 item._idleTimeoutId = setTimeout(function onTimeout() { 51540 if (item._onTimeout) 51541 item._onTimeout(); 51542 }, msecs); 51543 } 51544}; 51545 51546// setimmediate attaches itself to the global object 51547__webpack_require__(/*! setimmediate */ "./node_modules/setimmediate/setImmediate.js"); 51548// On some exotic environments, it's not clear which object `setimmediate` was 51549// able to install onto. Search each possibility in the same order as the 51550// `setimmediate` library. 51551exports.setImmediate = (typeof self !== "undefined" && self.setImmediate) || 51552 (typeof global !== "undefined" && global.setImmediate) || 51553 (this && this.setImmediate); 51554exports.clearImmediate = (typeof self !== "undefined" && self.clearImmediate) || 51555 (typeof global !== "undefined" && global.clearImmediate) || 51556 (this && this.clearImmediate); 51557 51558/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 51559 51560/***/ }), 51561
vendor: 70,355 bytes, lines 51562-53584
51562/***/ "./node_modules/trumbowyg/dist/trumbowyg.js": 51563/*!**************************************************!*\ 51564 !*** ./node_modules/trumbowyg/dist/trumbowyg.js ***! 51565 \**************************************************/ 51566/*! no static exports found */ 51567/***/ (function(module, exports) { 51568 51569/** 51570 * Trumbowyg v2.25.1 - A lightweight WYSIWYG editor 51571 * Trumbowyg core file 51572 * ------------------------ 51573 * @link http://alex-d.github.io/Trumbowyg 51574 * @license MIT 51575 * @author Alexandre Demode (Alex-D) 51576 * Twitter : @AlexandreDemode 51577 * Website : alex-d.fr 51578 */ 51579 51580jQuery.trumbowyg = { 51581 langs: { 51582 en: { 51583 viewHTML: 'View HTML', 51584 51585 undo: 'Undo', 51586 redo: 'Redo', 51587 51588 formatting: 'Formatting', 51589 p: 'Paragraph', 51590 blockquote: 'Quote', 51591 code: 'Code', 51592 header: 'Header', 51593 51594 bold: 'Bold', 51595 italic: 'Italic', 51596 strikethrough: 'Strikethrough', 51597 underline: 'Underline', 51598 51599 strong: 'Strong', 51600 em: 'Emphasis', 51601 del: 'Deleted', 51602 51603 superscript: 'Superscript', 51604 subscript: 'Subscript', 51605 51606 unorderedList: 'Unordered list', 51607 orderedList: 'Ordered list', 51608 51609 insertImage: 'Insert Image', 51610 link: 'Link', 51611 createLink: 'Insert link', 51612 unlink: 'Remove link', 51613 51614 justifyLeft: 'Align Left', 51615 justifyCenter: 'Align Center', 51616 justifyRight: 'Align Right', 51617 justifyFull: 'Align Justify', 51618 51619 horizontalRule: 'Insert horizontal rule', 51620 removeformat: 'Remove format', 51621 51622 fullscreen: 'Fullscreen', 51623 51624 close: 'Close', 51625 51626 submit: 'Confirm', 51627 reset: 'Cancel', 51628 51629 required: 'Required', 51630 description: 'Description', 51631 title: 'Title', 51632 text: 'Text', 51633 target: 'Target', 51634 width: 'Width' 51635 } 51636 }, 51637 51638 // Plugins 51639 plugins: {}, 51640 51641 // SVG Path globally 51642 svgPath: null, 51643 svgAbsoluteUseHref: false, 51644 51645 hideButtonTexts: null 51646}; 51647 51648// Makes default options read-only 51649Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { 51650 value: { 51651 lang: 'en', 51652 51653 fixedBtnPane: false, 51654 fixedFullWidth: false, 51655 autogrow: false, 51656 autogrowOnEnter: false, 51657 imageWidthModalEdit: false, 51658 hideButtonTexts: null, 51659 51660 prefix: 'trumbowyg-', 51661 tagClasses: {}, 51662 semantic: true, 51663 semanticKeepAttributes: false, 51664 resetCss: false, 51665 removeformatPasted: false, 51666 tabToIndent: false, 51667 tagsToRemove: [], 51668 tagsToKeep: ['hr', 'img', 'embed', 'iframe', 'input'], 51669 btns: [ 51670 ['viewHTML'], 51671 ['undo', 'redo'], // Only supported in Blink browsers 51672 ['formatting'], 51673 ['strong', 'em', 'del'], 51674 ['superscript', 'subscript'], 51675 ['link'], 51676 ['insertImage'], 51677 ['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'], 51678 ['unorderedList', 'orderedList'], 51679 ['horizontalRule'], 51680 ['removeformat'], 51681 ['fullscreen'] 51682 ], 51683 // For custom button definitions 51684 btnsDef: {}, 51685 changeActiveDropdownIcon: false, 51686 51687 inlineElementsSelector: 'a,abbr,acronym,b,caption,cite,code,col,dfn,dir,dt,dd,em,font,hr,i,kbd,li,q,span,strikeout,strong,sub,sup,u', 51688 51689 pasteHandlers: [], 51690 51691 // imgDblClickHandler: default is defined in constructor 51692 51693 plugins: {}, 51694 51695 urlProtocol: false, 51696 minimalLinks: false, 51697 defaultLinkTarget: undefined, 51698 51699 svgPath: null 51700 }, 51701 writable: false, 51702 enumerable: true, 51703 configurable: false 51704}); 51705 51706(function (navigator, window, document, $) { 51707 'use strict'; 51708 51709 var CONFIRM_EVENT = 'tbwconfirm', 51710 CANCEL_EVENT = 'tbwcancel'; 51711 51712 $.fn.trumbowyg = function (options, params) { 51713 var trumbowygDataName = 'trumbowyg'; 51714 if (options === Object(options) || !options) { 51715 return this.each(function () { 51716 if (!$(this).data(trumbowygDataName)) { 51717 $(this).data(trumbowygDataName, new Trumbowyg(this, options)); 51718 } 51719 }); 51720 } 51721 if (this.length === 1) { 51722 try { 51723 var t = $(this).data(trumbowygDataName); 51724 switch (options) { 51725 // Exec command 51726 case 'execCmd': 51727 return t.execCmd(params.cmd, params.param, params.forceCss, params.skipTrumbowyg); 51728 51729 // Modal box 51730 case 'openModal': 51731 return t.openModal(params.title, params.content); 51732 case 'closeModal': 51733 return t.closeModal(); 51734 case 'openModalInsert': 51735 return t.openModalInsert(params.title, params.fields, params.callback); 51736 51737 // Range 51738 case 'saveRange': 51739 return t.saveRange(); 51740 case 'getRange': 51741 return t.range; 51742 case 'getRangeText': 51743 return t.getRangeText(); 51744 case 'restoreRange': 51745 return t.restoreRange(); 51746 51747 // Enable/disable 51748 case 'enable': 51749 return t.setDisabled(false); 51750 case 'disable': 51751 return t.setDisabled(true); 51752 51753 // Toggle 51754 case 'toggle': 51755 return t.toggle(); 51756 51757 // Destroy 51758 case 'destroy': 51759 return t.destroy(); 51760 51761 // Empty 51762 case 'empty': 51763 return t.empty(); 51764 51765 // HTML 51766 case 'html': 51767 return t.html(params); 51768 } 51769 } catch (c) { 51770 } 51771 } 51772 51773 return false; 51774 }; 51775 51776 // @param: editorElem is the DOM element 51777 var Trumbowyg = function (editorElem, options) { 51778 var t = this, 51779 trumbowygIconsId = 'trumbowyg-icons', 51780 $trumbowyg = $.trumbowyg; 51781 51782 // Get the document of the element. It use to makes the plugin 51783 // compatible on iframes. 51784 t.doc = editorElem.ownerDocument || document; 51785 51786 // jQuery object of the editor 51787 t.$ta = $(editorElem); // $ta : Textarea 51788 t.$c = $(editorElem); // $c : creator 51789 51790 options = options || {}; 51791 51792 // Localization management 51793 if (options.lang != null || $trumbowyg.langs[options.lang] != null) { 51794 t.lang = $.extend(true, {}, $trumbowyg.langs.en, $trumbowyg.langs[options.lang]); 51795 } else { 51796 t.lang = $trumbowyg.langs.en; 51797 } 51798 51799 t.hideButtonTexts = $trumbowyg.hideButtonTexts != null ? $trumbowyg.hideButtonTexts : options.hideButtonTexts; 51800 51801 // SVG path 51802 var svgPathOption = $trumbowyg.svgPath != null ? $trumbowyg.svgPath : options.svgPath; 51803 t.hasSvg = svgPathOption !== false; 51804 51805 if (svgPathOption !== false && ($trumbowyg.svgAbsoluteUseHref || $('#' + trumbowygIconsId, t.doc).length === 0)) { 51806 if (svgPathOption == null) { 51807 // Hack to get svgPathOption based on trumbowyg.js path 51808 var $scriptElements = $('script[src]'); 51809 $scriptElements.each(function (i, scriptElement) { 51810 var source = scriptElement.src; 51811 var matches = source.match('trumbowyg(\.min)?\.js'); 51812 if (matches != null) { 51813 svgPathOption = source.substring(0, source.indexOf(matches[0])) + 'ui/icons.svg'; 51814 } 51815 }); 51816 } 51817 51818 // Do not merge with previous if block: svgPathOption can be redefined in it. 51819 // Here we are checking that we find a match 51820 if (svgPathOption == null) { 51821 console.warn('You must define svgPath: https://goo.gl/CfTY9U'); // jshint ignore:line 51822 } else if (!$trumbowyg.svgAbsoluteUseHref) { 51823 var div = t.doc.createElement('div'); 51824 div.id = trumbowygIconsId; 51825 t.doc.body.insertBefore(div, t.doc.body.childNodes[0]); 51826 $.ajax({ 51827 async: true, 51828 type: 'GET', 51829 contentType: 'application/x-www-form-urlencoded; charset=UTF-8', 51830 dataType: 'xml', 51831 crossDomain: true, 51832 url: svgPathOption, 51833 data: null, 51834 beforeSend: null, 51835 complete: null, 51836 success: function (data) { 51837 div.innerHTML = new XMLSerializer().serializeToString(data.documentElement); 51838 } 51839 }); 51840 } 51841 } 51842 51843 var baseHref = !!t.doc.querySelector('base') ? window.location.href.split(/[?#]/)[0] : ''; 51844 t.svgPath = $trumbowyg.svgAbsoluteUseHref ? svgPathOption : baseHref; 51845 51846 51847 /** 51848 * When the button is associated to a empty object 51849 * fn and title attributes are defined from the button key value 51850 * 51851 * For example 51852 * foo: {} 51853 * is equivalent to : 51854 * foo: { 51855 * fn: 'foo', 51856 * title: this.lang.foo 51857 * } 51858 */ 51859 var h = t.lang.header, // Header translation 51860 isBlinkFunction = function () { 51861 return (window.chrome || (window.Intl && Intl.v8BreakIterator)) && 'CSS' in window; 51862 }; 51863 t.btnsDef = { 51864 viewHTML: { 51865 fn: 'toggle', 51866 class: 'trumbowyg-not-disable', 51867 }, 51868 51869 undo: { 51870 isSupported: isBlinkFunction, 51871 key: 'Z' 51872 }, 51873 redo: { 51874 isSupported: isBlinkFunction, 51875 key: 'Y' 51876 }, 51877 51878 p: { 51879 fn: 'formatBlock' 51880 }, 51881 blockquote: { 51882 fn: 'formatBlock' 51883 }, 51884 h1: { 51885 fn: 'formatBlock', 51886 title: h + ' 1' 51887 }, 51888 h2: { 51889 fn: 'formatBlock', 51890 title: h + ' 2' 51891 }, 51892 h3: { 51893 fn: 'formatBlock', 51894 title: h + ' 3' 51895 }, 51896 h4: { 51897 fn: 'formatBlock', 51898 title: h + ' 4' 51899 }, 51900 h5: { 51901 fn: 'formatBlock', 51902 title: h + ' 5' 51903 }, 51904 h6: { 51905 fn: 'formatBlock', 51906 title: h + ' 6' 51907 }, 51908 subscript: { 51909 tag: 'sub' 51910 }, 51911 superscript: { 51912 tag: 'sup' 51913 }, 51914 51915 bold: { 51916 key: 'B', 51917 tag: 'b' 51918 }, 51919 italic: { 51920 key: 'I', 51921 tag: 'i' 51922 }, 51923 underline: { 51924 tag: 'u' 51925 }, 51926 strikethrough: { 51927 tag: 'strike' 51928 }, 51929 51930 strong: { 51931 fn: 'bold', 51932 key: 'B' 51933 }, 51934 em: { 51935 fn: 'italic', 51936 key: 'I' 51937 }, 51938 del: { 51939 fn: 'strikethrough' 51940 }, 51941 51942 createLink: { 51943 key: 'K', 51944 tag: 'a' 51945 }, 51946 unlink: {}, 51947 51948 insertImage: {}, 51949 51950 justifyLeft: { 51951 tag: 'left', 51952 forceCss: true 51953 }, 51954 justifyCenter: { 51955 tag: 'center', 51956 forceCss: true 51957 }, 51958 justifyRight: { 51959 tag: 'right', 51960 forceCss: true 51961 }, 51962 justifyFull: { 51963 tag: 'justify', 51964 forceCss: true 51965 }, 51966 51967 unorderedList: { 51968 fn: 'insertUnorderedList', 51969 tag: 'ul' 51970 }, 51971 orderedList: { 51972 fn: 'insertOrderedList', 51973 tag: 'ol' 51974 }, 51975 51976 horizontalRule: { 51977 fn: 'insertHorizontalRule' 51978 }, 51979 51980 removeformat: {}, 51981 51982 fullscreen: { 51983 class: 'trumbowyg-not-disable' 51984 }, 51985 close: { 51986 fn: 'destroy', 51987 class: 'trumbowyg-not-disable' 51988 }, 51989 51990 // Dropdowns 51991 formatting: { 51992 dropdown: ['p', 'blockquote', 'h1', 'h2', 'h3', 'h4'], 51993 ico: 'p' 51994 }, 51995 link: { 51996 dropdown: ['createLink', 'unlink'] 51997 } 51998 }; 51999 52000 // Default Options 52001 t.o = $.extend(true, {}, $trumbowyg.defaultOptions, options); 52002 if (!t.o.hasOwnProperty('imgDblClickHandler')) { 52003 t.o.imgDblClickHandler = t.getDefaultImgDblClickHandler(); 52004 } 52005 52006 t.urlPrefix = t.setupUrlPrefix(); 52007 52008 t.disabled = t.o.disabled || (editorElem.nodeName === 'TEXTAREA' && editorElem.disabled); 52009 52010 if (options.btns) { 52011 t.o.btns = options.btns; 52012 } else if (!t.o.semantic) { 52013 t.o.btns[3] = ['bold', 'italic', 'underline', 'strikethrough']; 52014 } 52015 52016 $.each(t.o.btnsDef, function (btnName, btnDef) { 52017 t.addBtnDef(btnName, btnDef); 52018 }); 52019 52020 // put this here in the event it would be merged in with options 52021 t.eventNamespace = 'trumbowyg-event'; 52022 52023 // Keyboard shortcuts are load in this array 52024 t.keys = []; 52025 52026 // Tag to button dynamically hydrated 52027 t.tagToButton = {}; 52028 t.tagHandlers = []; 52029 52030 // Admit multiple paste handlers 52031 t.pasteHandlers = [].concat(t.o.pasteHandlers); 52032 52033 // Check if browser is IE 52034 t.isIE = navigator.userAgent.indexOf('MSIE') !== -1 || navigator.appVersion.indexOf('Trident/') !== -1; 52035 52036 // Check if we are on macOs 52037 t.isMac = navigator.platform.toUpperCase().indexOf('MAC') !== -1; 52038 52039 t.init(); 52040 }; 52041 52042 Trumbowyg.prototype = { 52043 DEFAULT_SEMANTIC_MAP: { 52044 'b': 'strong', 52045 'i': 'em', 52046 's': 'del', 52047 'strike': 'del', 52048 'div': 'p' 52049 }, 52050 52051 init: function () { 52052 var t = this; 52053 t.height = t.$ta.height(); 52054 52055 t.initPlugins(); 52056 52057 try { 52058 // Disable image resize, try-catch for old IE 52059 t.doc.execCommand('enableObjectResizing', false, false); 52060 t.doc.execCommand('defaultParagraphSeparator', false, 'p'); 52061 } catch (e) { 52062 } 52063 52064 t.buildEditor(); 52065 t.buildBtnPane(); 52066 52067 t.fixedBtnPaneEvents(); 52068 52069 t.buildOverlay(); 52070 52071 setTimeout(function () { 52072 if (t.disabled) { 52073 t.setDisabled(true); 52074 } 52075 t.$c.trigger('tbwinit'); 52076 }); 52077 }, 52078 52079 addBtnDef: function (btnName, btnDef) { 52080 this.btnsDef[btnName] = $.extend(btnDef, this.btnsDef[btnName] || {}); 52081 }, 52082 52083 setupUrlPrefix: function () { 52084 var protocol = this.o.urlProtocol; 52085 if (!protocol) { 52086 return; 52087 } 52088 52089 if (typeof (protocol) !== 'string') { 52090 return 'https://'; 52091 } 52092 return protocol.replace('://', '') + '://'; 52093 }, 52094 52095 buildEditor: function () { 52096 var t = this, 52097 prefix = t.o.prefix, 52098 html = ''; 52099 52100 t.$box = $('<div/>', { 52101 class: prefix + 'box ' + prefix + 'editor-visible ' + prefix + t.o.lang + ' trumbowyg' 52102 }); 52103 52104 // $ta = Textarea 52105 // $ed = Editor 52106 t.isTextarea = t.$ta.is('textarea'); 52107 if (t.isTextarea) { 52108 html = t.$ta.val(); 52109 t.$ed = $('<div/>'); 52110 t.$box 52111 .insertAfter(t.$ta) 52112 .append(t.$ed, t.$ta); 52113 } else { 52114 t.$ed = t.$ta; 52115 html = t.$ed.html(); 52116 52117 t.$ta = $('<textarea/>', { 52118 name: t.$ta.attr('id'), 52119 height: t.height 52120 }).val(html); 52121 52122 t.$box 52123 .insertAfter(t.$ed) 52124 .append(t.$ta, t.$ed); 52125 t.syncCode(); 52126 } 52127 52128 t.$ta 52129 .addClass(prefix + 'textarea') 52130 .attr('tabindex', -1) 52131 ; 52132 52133 t.$ed 52134 .addClass(prefix + 'editor') 52135 .attr({ 52136 contenteditable: true, 52137 dir: t.lang._dir || 'ltr' 52138 }) 52139 .html(html) 52140 ; 52141 52142 if (t.o.tabindex) { 52143 t.$ed.attr('tabindex', t.o.tabindex); 52144 } 52145 52146 if (t.$c.is('[placeholder]')) { 52147 t.$ed.attr('placeholder', t.$c.attr('placeholder')); 52148 } 52149 52150 if (t.$c.is('[spellcheck]')) { 52151 t.$ed.attr('spellcheck', t.$c.attr('spellcheck')); 52152 } 52153 52154 if (t.o.resetCss) { 52155 t.$ed.addClass(prefix + 'reset-css'); 52156 } 52157 52158 if (!t.o.autogrow) { 52159 t.$ta.add(t.$ed).css({ 52160 height: t.height 52161 }); 52162 } 52163 52164 t.semanticCode(); 52165 52166 if (t.o.autogrowOnEnter) { 52167 t.$ed.addClass(prefix + 'autogrow-on-enter'); 52168 } 52169 52170 var ctrl = false, 52171 composition = false, 52172 debounceButtonPaneStatus; 52173 52174 t.$ed 52175 .on('dblclick', 'img', t.o.imgDblClickHandler) 52176 .on('keydown', function (e) { 52177 // append flags to differentiate Chrome spans 52178 var keyCode = e.which; 52179 if (keyCode === 8 || keyCode === 13 || keyCode === 46) { 52180 t.toggleSpan(true); 52181 } 52182 if ((e.ctrlKey || e.metaKey) && !e.altKey) { 52183 ctrl = true; 52184 var key = t.keys[String.fromCharCode(e.which).toUpperCase()]; 52185 52186 try { 52187 t.execCmd(key.fn, key.param); 52188 return false; 52189 } catch (c) { 52190 } 52191 } else { 52192 if (t.o.tabToIndent && e.key === 'Tab') { 52193 try { 52194 if (e.shiftKey) { 52195 t.execCmd('outdent', true, null); 52196 } else { 52197 t.execCmd('indent', true, null); 52198 } 52199 return false; 52200 } catch (c) { 52201 } 52202 } 52203 } 52204 }) 52205 .on('compositionstart compositionupdate', function () { 52206 composition = true; 52207 }) 52208 .on('keyup compositionend', function (e) { 52209 if (e.type === 'compositionend') { 52210 composition = false; 52211 } else if (composition) { 52212 return; 52213 } 52214 52215 var keyCode = e.which; 52216 52217 if (keyCode >= 37 && keyCode <= 40) { 52218 return; 52219 } 52220 52221 // remove Chrome generated span tags 52222 if (keyCode === 8 || keyCode === 13 || keyCode === 46) { 52223 t.toggleSpan(); 52224 } 52225 52226 if ((e.ctrlKey || e.metaKey) && (keyCode === 89 || keyCode === 90)) { 52227 t.semanticCode(false, true); 52228 t.$c.trigger('tbwchange'); 52229 } else if (!ctrl && keyCode !== 17) { 52230 var compositionEndIE = t.isIE ? e.type === 'compositionend' : true; 52231 t.semanticCode(false, compositionEndIE && keyCode === 13); 52232 t.$c.trigger('tbwchange'); 52233 } else if (typeof e.which === 'undefined') { 52234 t.semanticCode(false, false, true); 52235 } 52236 52237 setTimeout(function () { 52238 ctrl = false; 52239 }, 50); 52240 }) 52241 .on('mouseup keydown keyup', function (e) { 52242 if ((!e.ctrlKey && !e.metaKey) || e.altKey) { 52243 setTimeout(function () { // "hold on" to the ctrl key for 50ms 52244 ctrl = false; 52245 }, 50); 52246 } 52247 clearTimeout(debounceButtonPaneStatus); 52248 debounceButtonPaneStatus = setTimeout(function () { 52249 t.updateButtonPaneStatus(); 52250 }, 50); 52251 }) 52252 .on('focus blur', function (e) { 52253 if (e.type === 'blur') { 52254 t.clearButtonPaneStatus(); 52255 } 52256 t.$c.trigger('tbw' + e.type); 52257 if (t.o.autogrowOnEnter) { 52258 if (t.autogrowOnEnterDontClose) { 52259 return; 52260 } 52261 if (e.type === 'focus') { 52262 t.autogrowOnEnterWasFocused = true; 52263 t.autogrowEditorOnEnter(); 52264 } else if (!t.o.autogrow) { 52265 t.$ed.css({height: t.$ed.css('min-height')}); 52266 t.$c.trigger('tbwresize'); 52267 } 52268 } 52269 }) 52270 .on('keyup focus', function () { 52271 if (!t.$ta.val().match(/<.*>/) && !t.$ed.html().match(/<.*>/)) { 52272 setTimeout(function () { 52273 var block = t.isIE ? '<p>' : 'p'; 52274 t.doc.execCommand('formatBlock', false, block); 52275 t.syncCode(); 52276 }, 0); 52277 } 52278 }) 52279 .on('cut drop', function () { 52280 setTimeout(function () { 52281 t.semanticCode(false, true); 52282 t.$c.trigger('tbwchange'); 52283 }, 0); 52284 }) 52285 .on('paste', function (e) { 52286 if (t.o.removeformatPasted) { 52287 e.preventDefault(); 52288 52289 if (window.getSelection && window.getSelection().deleteFromDocument) { 52290 window.getSelection().deleteFromDocument(); 52291 } 52292 52293 try { 52294 // IE 52295 var text = window.clipboardData.getData('Text'); 52296 52297 try { 52298 // <= IE10 52299 t.doc.selection.createRange().pasteHTML(text); 52300 } catch (c) { 52301 // IE 11 52302 t.doc.getSelection().getRangeAt(0).insertNode(t.doc.createTextNode(text)); 52303 } 52304 t.$c.trigger('tbwchange', e); 52305 } catch (d) { 52306 // Not IE 52307 t.execCmd('insertText', (e.originalEvent || e).clipboardData.getData('text/plain')); 52308 } 52309 } 52310 52311 // Call pasteHandlers 52312 $.each(t.pasteHandlers, function (i, pasteHandler) { 52313 pasteHandler(e); 52314 }); 52315 52316 setTimeout(function () { 52317 t.semanticCode(false, true); 52318 t.$c.trigger('tbwpaste', e); 52319 t.$c.trigger('tbwchange'); 52320 }, 0); 52321 }); 52322 52323 t.$ta 52324 .on('keyup', function () { 52325 t.$c.trigger('tbwchange'); 52326 }) 52327 .on('paste', function () { 52328 setTimeout(function () { 52329 t.$c.trigger('tbwchange'); 52330 }, 0); 52331 }); 52332 52333 $(t.doc.body).on('keydown.' + t.eventNamespace, function (e) { 52334 if (e.which === 27 && $('.' + prefix + 'modal-box').length >= 1) { 52335 t.closeModal(); 52336 return false; 52337 } 52338 }); 52339 }, 52340 52341 //autogrow when entering logic 52342 autogrowEditorOnEnter: function () { 52343 var t = this; 52344 t.$ed.removeClass('autogrow-on-enter'); 52345 var oldHeight = t.$ed[0].clientHeight; 52346 t.$ed.height('auto'); 52347 var totalHeight = t.$ed[0].scrollHeight; 52348 t.$ed.addClass('autogrow-on-enter'); 52349 if (oldHeight !== totalHeight) { 52350 t.$ed.height(oldHeight); 52351 setTimeout(function () { 52352 t.$ed.css({height: totalHeight}); 52353 t.$c.trigger('tbwresize'); 52354 }, 0); 52355 } 52356 }, 52357 52358 52359 // Build button pane, use o.btns option 52360 buildBtnPane: function () { 52361 var t = this, 52362 prefix = t.o.prefix; 52363 52364 var $btnPane = t.$btnPane = $('<div/>', { 52365 class: prefix + 'button-pane' 52366 }); 52367 52368 $.each(t.o.btns, function (i, btnGrp) { 52369 if (!$.isArray(btnGrp)) { 52370 btnGrp = [btnGrp]; 52371 } 52372 52373 var $btnGroup = $('<div/>', { 52374 class: prefix + 'button-group ' + ((btnGrp.indexOf('fullscreen') >= 0) ? prefix + 'right' : '') 52375 }); 52376 $.each(btnGrp, function (i, btn) { 52377 try { // Prevent buildBtn error 52378 if (t.isSupportedBtn(btn)) { // It's a supported button 52379 $btnGroup.append(t.buildBtn(btn)); 52380 } 52381 } catch (c) { 52382 } 52383 }); 52384 52385 if ($btnGroup.html().trim().length > 0) { 52386 $btnPane.append($btnGroup); 52387 } 52388 }); 52389 52390 t.$box.prepend($btnPane); 52391 }, 52392 52393 52394 // Build a button and his action 52395 buildBtn: function (btnName) { // btnName is name of the button 52396 var t = this, 52397 prefix = t.o.prefix, 52398 btn = t.btnsDef[btnName], 52399 isDropdown = btn.dropdown, 52400 hasIcon = btn.hasIcon != null ? btn.hasIcon : true, 52401 textDef = t.lang[btnName] || btnName, 52402 52403 $btn = $('<button/>', { 52404 type: 'button', 52405 class: prefix + btnName + '-button ' + (btn.class || '') + (!hasIcon ? ' ' + prefix + 'textual-button' : ''), 52406 html: t.hasSvg && hasIcon ? 52407 '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' : 52408 t.hideButtonTexts ? '' : (btn.text || btn.title || t.lang[btnName] || btnName), 52409 title: (btn.title || btn.text || textDef) + (btn.key ? ' (' + (t.isMac ? 'Cmd' : 'Ctrl') + ' + ' + btn.key + ')' : ''), 52410 tabindex: -1, 52411 mousedown: function () { 52412 if (!isDropdown || $('.' + btnName + '-' + prefix + 'dropdown', t.$box).is(':hidden')) { 52413 $('body', t.doc).trigger('mousedown'); 52414 } 52415 52416 if ((t.$btnPane.hasClass(prefix + 'disable') || t.$box.hasClass(prefix + 'disabled')) && 52417 !$(this).hasClass(prefix + 'active') && 52418 !$(this).hasClass(prefix + 'not-disable')) { 52419 return false; 52420 } 52421 52422 t.execCmd((isDropdown ? 'dropdown' : false) || btn.fn || btnName, btn.param || btnName, btn.forceCss); 52423 52424 return false; 52425 } 52426 }); 52427 52428 if (isDropdown) { 52429 $btn.addClass(prefix + 'open-dropdown'); 52430 var dropdownPrefix = prefix + 'dropdown', 52431 dropdownOptions = { // the dropdown 52432 class: dropdownPrefix + '-' + btnName + ' ' + dropdownPrefix + ' ' + prefix + 'fixed-top ' + (btn.dropdownClass || '') 52433 }; 52434 dropdownOptions['data-' + dropdownPrefix] = btnName; 52435 var $dropdown = $('<div/>', dropdownOptions); 52436 $.each(isDropdown, function (i, def) { 52437 if (t.btnsDef[def] && t.isSupportedBtn(def)) { 52438 $dropdown.append(t.buildSubBtn(def)); 52439 } 52440 }); 52441 t.$box.append($dropdown.hide()); 52442 } else if (btn.key) { 52443 t.keys[btn.key] = { 52444 fn: btn.fn || btnName, 52445 param: btn.param || btnName 52446 }; 52447 } 52448 52449 if (!isDropdown) { 52450 t.tagToButton[(btn.tag || btnName).toLowerCase()] = btnName; 52451 } 52452 52453 return $btn; 52454 }, 52455 // Build a button for dropdown menu 52456 // @param n : name of the subbutton 52457 buildSubBtn: function (btnName) { 52458 var t = this, 52459 prefix = t.o.prefix, 52460 btn = t.btnsDef[btnName], 52461 hasIcon = btn.hasIcon != null ? btn.hasIcon : true; 52462 52463 if (btn.key) { 52464 t.keys[btn.key] = { 52465 fn: btn.fn || btnName, 52466 param: btn.param || btnName 52467 }; 52468 } 52469 52470 t.tagToButton[(btn.tag || btnName).toLowerCase()] = btnName; 52471 52472 return $('<button/>', { 52473 type: 'button', 52474 class: prefix + btnName + '-dropdown-button ' + (btn.class || '') + (btn.ico ? ' ' + prefix + btn.ico + '-button' : ''), 52475 html: t.hasSvg && hasIcon ? 52476 '<svg><use xlink:href="' + t.svgPath + '#' + prefix + (btn.ico || btnName).replace(/([A-Z]+)/g, '-$1').toLowerCase() + '"/></svg>' + (btn.text || btn.title || t.lang[btnName] || btnName) : 52477 (btn.text || btn.title || t.lang[btnName] || btnName), 52478 title: (btn.key ? '(' + (t.isMac ? 'Cmd' : 'Ctrl') + ' + ' + btn.key + ')' : null), 52479 style: btn.style || null, 52480 mousedown: function () { 52481 $('body', t.doc).trigger('mousedown'); 52482 52483 t.execCmd(btn.fn || btnName, btn.param || btnName, btn.forceCss); 52484 52485 return false; 52486 } 52487 }); 52488 }, 52489 // Check if button is supported 52490 isSupportedBtn: function (btnName) { 52491 try { 52492 return this.btnsDef[btnName].isSupported(); 52493 } catch (e) { 52494 } 52495 return true; 52496 }, 52497 52498 // Build overlay for modal box 52499 buildOverlay: function () { 52500 var t = this; 52501 t.$overlay = $('<div/>', { 52502 class: t.o.prefix + 'overlay' 52503 }).appendTo(t.$box); 52504 return t.$overlay; 52505 }, 52506 showOverlay: function () { 52507 var t = this; 52508 $(window).trigger('scroll'); 52509 t.$overlay.fadeIn(200); 52510 t.$box.addClass(t.o.prefix + 'box-blur'); 52511 }, 52512 hideOverlay: function () { 52513 var t = this; 52514 t.$overlay.fadeOut(50); 52515 t.$box.removeClass(t.o.prefix + 'box-blur'); 52516 }, 52517 52518 // Management of fixed button pane 52519 fixedBtnPaneEvents: function () { 52520 var t = this, 52521 fixedFullWidth = t.o.fixedFullWidth, 52522 $box = t.$box; 52523 52524 if (!t.o.fixedBtnPane) { 52525 return; 52526 } 52527 52528 t.isFixed = false; 52529 52530 $(window) 52531 .on('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace, function () { 52532 if (!$box) { 52533 return; 52534 } 52535 52536 t.syncCode(); 52537 52538 var scrollTop = $(window).scrollTop(), 52539 offset = $box.offset().top + 1, 52540 $buttonPane = t.$btnPane, 52541 buttonPaneOuterHeight = $buttonPane.outerHeight() - 2; 52542 52543 if ((scrollTop - offset > 0) && ((scrollTop - offset - t.height) < 0)) { 52544 if (!t.isFixed) { 52545 t.isFixed = true; 52546 $buttonPane.css({ 52547 position: 'fixed', 52548 top: 0, 52549 left: fixedFullWidth ? 0 : 'auto', 52550 zIndex: 7 52551 }); 52552 t.$box.css({paddingTop: $buttonPane.height()}); 52553 } 52554 $buttonPane.css({ 52555 width: fixedFullWidth ? '100%' : (($box.width() - 1)) 52556 }); 52557 52558 $('.' + t.o.prefix + 'fixed-top', $box).css({ 52559 position: fixedFullWidth ? 'fixed' : 'absolute', 52560 top: fixedFullWidth ? buttonPaneOuterHeight : buttonPaneOuterHeight + (scrollTop - offset), 52561 zIndex: 15 52562 }); 52563 } else if (t.isFixed) { 52564 t.isFixed = false; 52565 $buttonPane.removeAttr('style'); 52566 t.$box.css({paddingTop: 0}); 52567 $('.' + t.o.prefix + 'fixed-top', $box).css({ 52568 position: 'absolute', 52569 top: buttonPaneOuterHeight 52570 }); 52571 } 52572 }); 52573 }, 52574 52575 // Disable editor 52576 setDisabled: function (disable) { 52577 var t = this, 52578 prefix = t.o.prefix; 52579 52580 t.disabled = disable; 52581 52582 if (disable) { 52583 t.$ta.attr('disabled', true); 52584 } else { 52585 t.$ta.removeAttr('disabled'); 52586 } 52587 t.$box.toggleClass(prefix + 'disabled', disable); 52588 t.$ed.attr('contenteditable', !disable); 52589 }, 52590 52591 // Destroy the editor 52592 destroy: function () { 52593 var t = this, 52594 prefix = t.o.prefix; 52595 52596 if (t.isTextarea) { 52597 t.$box.after( 52598 t.$ta 52599 .css({height: ''}) 52600 .val(t.html()) 52601 .removeClass(prefix + 'textarea') 52602 .show() 52603 ); 52604 } else { 52605 t.$box.after( 52606 t.$ed 52607 .css({height: ''}) 52608 .removeClass(prefix + 'editor') 52609 .removeAttr('contenteditable') 52610 .removeAttr('dir') 52611 .html(t.html()) 52612 .show() 52613 ); 52614 } 52615 52616 t.$ed.off('dblclick', 'img'); 52617 52618 t.destroyPlugins(); 52619 52620 t.$box.remove(); 52621 t.$c.removeData('trumbowyg'); 52622 $('body').removeClass(prefix + 'body-fullscreen'); 52623 t.$c.trigger('tbwclose'); 52624 $(window).off('scroll.' + t.eventNamespace + ' resize.' + t.eventNamespace); 52625 $(t.doc.body).off('keydown.' + t.eventNamespace); 52626 }, 52627 52628 52629 // Empty the editor 52630 empty: function () { 52631 this.$ta.val(''); 52632 this.syncCode(true); 52633 }, 52634 52635 52636 // Function call when click on viewHTML button 52637 toggle: function () { 52638 var t = this, 52639 prefix = t.o.prefix; 52640 52641 if (t.o.autogrowOnEnter) { 52642 t.autogrowOnEnterDontClose = !t.$box.hasClass(prefix + 'editor-hidden'); 52643 } 52644 52645 t.semanticCode(false, true); 52646 t.$c.trigger('tbwchange'); 52647 52648 setTimeout(function () { 52649 t.doc.activeElement.blur(); 52650 t.$box.toggleClass(prefix + 'editor-hidden ' + prefix + 'editor-visible'); 52651 t.$btnPane.toggleClass(prefix + 'disable'); 52652 $('.' + prefix + 'viewHTML-button', t.$btnPane).toggleClass(prefix + 'active'); 52653 if (t.$box.hasClass(prefix + 'editor-visible')) { 52654 t.$ta.attr('tabindex', -1); 52655 } else { 52656 t.$ta.removeAttr('tabindex'); 52657 } 52658 52659 if (t.o.autogrowOnEnter && !t.autogrowOnEnterDontClose) { 52660 t.autogrowEditorOnEnter(); 52661 } 52662 }, 0); 52663 }, 52664 52665 // Remove or add flags to span tags to remove Chrome generated spans 52666 toggleSpan: function (addFlag) { 52667 var t = this; 52668 t.$ed.find('span').each(function () { 52669 if (addFlag === true) { 52670 $(this).attr('data-tbw-flag', true); 52671 } else { 52672 if ($(this).attr('data-tbw-flag')) { 52673 $(this).removeAttr('data-tbw-flag'); 52674 } else { 52675 $(this).contents().unwrap(); 52676 } 52677 } 52678 }); 52679 }, 52680 52681 // Open dropdown when click on a button which open that 52682 dropdown: function (name) { 52683 var t = this, 52684 $body = $('body', t.doc), 52685 prefix = t.o.prefix, 52686 $dropdown = $('[data-' + prefix + 'dropdown=' + name + ']', t.$box), 52687 $btn = $('.' + prefix + name + '-button', t.$btnPane), 52688 show = $dropdown.is(':hidden'); 52689 52690 $body.trigger('mousedown'); 52691 52692 if (show) { 52693 var btnOffsetLeft = $btn.offset().left; 52694 $btn.addClass(prefix + 'active'); 52695 52696 $dropdown.css({ 52697 position: 'absolute', 52698 top: $btn.offset().top - t.$btnPane.offset().top + $btn.outerHeight(), 52699 left: (t.o.fixedFullWidth && t.isFixed) ? btnOffsetLeft : (btnOffsetLeft - t.$btnPane.offset().left) 52700 }).show(); 52701 52702 $(window).trigger('scroll'); 52703 52704 $body.on('mousedown.' + t.eventNamespace, function (e) { 52705 if (!$dropdown.is(e.target)) { 52706 $('.' + prefix + 'dropdown', t.$box).hide(); 52707 $('.' + prefix + 'active', t.$btnPane).removeClass(prefix + 'active'); 52708 $body.off('mousedown.' + t.eventNamespace); 52709 } 52710 }); 52711 } 52712 }, 52713 52714 52715 // HTML Code management 52716 html: function (html) { 52717 var t = this; 52718 52719 if (html != null) { 52720 t.$ta.val(html); 52721 t.syncCode(true); 52722 t.$c.trigger('tbwchange'); 52723 return t; 52724 } 52725 52726 return t.$ta.val(); 52727 }, 52728 syncTextarea: function () { 52729 var t = this; 52730 t.$ta.val(t.$ed.text().trim().length > 0 || t.$ed.find(t.o.tagsToKeep.join(',')).length > 0 ? t.$ed.html() : ''); 52731 }, 52732 syncCode: function (force) { 52733 var t = this; 52734 if (!force && t.$ed.is(':visible')) { 52735 t.syncTextarea(); 52736 } else { 52737 // wrap the content in a div it's easier to get the inner html 52738 var html = $('<div>').html(t.$ta.val()); 52739 // scrub the html before loading into the doc 52740 var safe = $('<div>').append(html); 52741 $(t.o.tagsToRemove.join(','), safe).remove(); 52742 t.$ed.html(safe.contents().html()); 52743 } 52744 52745 if (t.o.autogrow) { 52746 t.height = t.$ed.height(); 52747 if (t.height !== t.$ta.css('height')) { 52748 t.$ta.css({height: t.height}); 52749 t.$c.trigger('tbwresize'); 52750 } 52751 } 52752 if (t.o.autogrowOnEnter) { 52753 t.$ed.height('auto'); 52754 var totalHeight = t.autogrowOnEnterWasFocused ? t.$ed[0].scrollHeight : t.$ed.css('min-height'); 52755 if (totalHeight !== t.$ta.css('height')) { 52756 t.$ed.css({height: totalHeight}); 52757 t.$c.trigger('tbwresize'); 52758 } 52759 } 52760 }, 52761 52762 // Analyse and update to semantic code 52763 // @param force : force to sync code from textarea 52764 // @param full : wrap text nodes in <p> 52765 // @param keepRange : leave selection range as it is 52766 semanticCode: function (force, full, keepRange) { 52767 var t = this; 52768 t.saveRange(); 52769 t.syncCode(force); 52770 52771 var restoreRange = true; 52772 if (t.range && t.range.collapsed) { 52773 restoreRange = false; 52774 } 52775 52776 if (t.o.semantic) { 52777 t.semanticTag('b', t.o.semanticKeepAttributes); 52778 t.semanticTag('i', t.o.semanticKeepAttributes); 52779 t.semanticTag('s', t.o.semanticKeepAttributes); 52780 t.semanticTag('strike', t.o.semanticKeepAttributes); 52781 52782 if (full) { 52783 var inlineElementsSelector = t.o.inlineElementsSelector, 52784 blockElementsSelector = ':not(' + inlineElementsSelector + ')'; 52785 52786 // Wrap text nodes in span for easier processing 52787 t.$ed.contents().filter(function () { 52788 return this.nodeType === 3 && this.nodeValue.trim().length > 0; 52789 }).wrap('<span data-tbw/>'); 52790 52791 // Wrap groups of inline elements in paragraphs (recursive) 52792 var wrapInlinesInParagraphsFrom = function ($from) { 52793 if ($from.length !== 0) { 52794 var $finalParagraph = $from.nextUntil(blockElementsSelector).addBack().wrapAll('<p/>').parent(), 52795 $nextElement = $finalParagraph.nextAll(inlineElementsSelector).first(); 52796 $finalParagraph.next('br').remove(); 52797 wrapInlinesInParagraphsFrom($nextElement); 52798 } 52799 }; 52800 wrapInlinesInParagraphsFrom(t.$ed.children(inlineElementsSelector).first()); 52801 52802 t.semanticTag('div', true); 52803 52804 // Get rid of temporary span's 52805 $('[data-tbw]', t.$ed).contents().unwrap(); 52806 52807 // Remove empty <p> 52808 t.$ed.find('p:empty').remove(); 52809 } 52810 52811 if (!keepRange && restoreRange) { 52812 t.restoreRange(); 52813 } 52814 52815 t.syncTextarea(); 52816 } 52817 }, 52818 52819 semanticTag: function (oldTag, copyAttributes, revert) { 52820 var newTag, t = this; 52821 var tmpTag = oldTag; 52822 52823 if (this.o.semantic != null && typeof this.o.semantic === 'object' && this.o.semantic.hasOwnProperty(oldTag)) { 52824 newTag = this.o.semantic[oldTag]; 52825 } else if (this.o.semantic === true && this.DEFAULT_SEMANTIC_MAP.hasOwnProperty(oldTag)) { 52826 newTag = this.DEFAULT_SEMANTIC_MAP[oldTag]; 52827 } else { 52828 return; 52829 } 52830 52831 if(revert) { 52832 oldTag = newTag; 52833 newTag = tmpTag; 52834 } 52835 52836 $(oldTag, this.$ed).each(function () { 52837 var resetRange = false; 52838 var $oldTag = $(this); 52839 if ($oldTag.contents().length === 0) { 52840 return false; 52841 } 52842 52843 if (t.range && t.range.startContainer.parentNode === this) { 52844 resetRange = true; 52845 } 52846 var $newTag = $('<' + newTag + '/>'); 52847 $newTag.insertBefore($oldTag); 52848 if (copyAttributes) { 52849 $.each($oldTag.prop('attributes'), function () { 52850 $newTag.attr(this.name, this.value); 52851 }); 52852 } 52853 $newTag.html($oldTag.html()); 52854 $oldTag.remove(); 52855 if(resetRange === true) { 52856 t.range.selectNodeContents($newTag.get(0)); 52857 t.range.collapse(false); 52858 } 52859 }); 52860 }, 52861 52862 // Function call when user click on "Insert Link" 52863 createLink: function () { 52864 var t = this, 52865 documentSelection = t.doc.getSelection(), 52866 selectedRange = documentSelection.getRangeAt(0), 52867 node = documentSelection.focusNode, 52868 text = new XMLSerializer().serializeToString(selectedRange.cloneContents()) || selectedRange + '', 52869 url, 52870 title, 52871 target; 52872 52873 while (['A', 'DIV'].indexOf(node.nodeName) < 0) { 52874 node = node.parentNode; 52875 } 52876 52877 if (node && node.nodeName === 'A') { 52878 var $a = $(node); 52879 text = $a.text(); 52880 url = $a.attr('href'); 52881 if (!t.o.minimalLinks) { 52882 title = $a.attr('title'); 52883 target = $a.attr('target') || t.o.defaultLinkTarget; 52884 } 52885 var range = t.doc.createRange(); 52886 range.selectNode(node); 52887 documentSelection.removeAllRanges(); 52888 documentSelection.addRange(range); 52889 } 52890 52891 t.saveRange(); 52892 52893 var options = { 52894 url: { 52895 label: t.lang.linkUrl || 'URL', 52896 required: true, 52897 value: url 52898 }, 52899 text: { 52900 label: t.lang.text, 52901 value: text 52902 } 52903 }; 52904 if (!t.o.minimalLinks) { 52905 $.extend(options, { 52906 title: { 52907 label: t.lang.title, 52908 value: title 52909 }, 52910 target: { 52911 label: t.lang.target, 52912 value: target 52913 } 52914 }); 52915 } 52916 52917 t.openModalInsert(t.lang.createLink, options, function (v) { // v is value 52918 var url = t.prependUrlPrefix(v.url); 52919 if (!url.length) { 52920 return false; 52921 } 52922 52923 var link = $(['<a href="', url, '">', v.text || v.url, '</a>'].join('')); 52924 52925 if (v.title) { 52926 link.attr('title', v.title); 52927 } 52928 if (v.target || t.o.defaultLinkTarget) { 52929 link.attr('target', v.target || t.o.defaultLinkTarget); 52930 } 52931 t.range.deleteContents(); 52932 t.range.insertNode(link[0]); 52933 t.syncCode(); 52934 t.$c.trigger('tbwchange'); 52935 return true; 52936 }); 52937 }, 52938 prependUrlPrefix: function (url) { 52939 var t = this; 52940 if (!t.urlPrefix) { 52941 return url; 52942 } 52943 52944 var VALID_LINK_PREFIX = /^([a-z][-+.a-z0-9]*:|\/|#)/i; 52945 if (VALID_LINK_PREFIX.test(url)) { 52946 return url; 52947 } 52948 52949 var SIMPLE_EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/; 52950 if (SIMPLE_EMAIL_REGEX.test(url)) { 52951 return 'mailto:' + url; 52952 } 52953 52954 return t.urlPrefix + url; 52955 }, 52956 unlink: function () { 52957 var t = this, 52958 documentSelection = t.doc.getSelection(), 52959 node = documentSelection.focusNode; 52960 52961 if (documentSelection.isCollapsed) { 52962 while (['A', 'DIV'].indexOf(node.nodeName) < 0) { 52963 node = node.parentNode; 52964 } 52965 52966 if (node && node.nodeName === 'A') { 52967 var range = t.doc.createRange(); 52968 range.selectNode(node); 52969 documentSelection.removeAllRanges(); 52970 documentSelection.addRange(range); 52971 } 52972 } 52973 t.execCmd('unlink', undefined, undefined, true); 52974 }, 52975 insertImage: function () { 52976 var t = this; 52977 t.saveRange(); 52978 52979 var options = { 52980 url: { 52981 label: 'URL', 52982 required: true 52983 }, 52984 alt: { 52985 label: t.lang.description, 52986 value: t.getRangeText() 52987 } 52988 }; 52989 52990 if (t.o.imageWidthModalEdit) { 52991 options.width = {}; 52992 } 52993 52994 t.openModalInsert(t.lang.insertImage, options, function (v) { // v are values 52995 t.execCmd('insertImage', v.url, false, true); 52996 var $img = $('img[src="' + v.url + '"]:not([alt])', t.$box); 52997 $img.attr('alt', v.alt); 52998 52999 if (t.o.imageWidthModalEdit) { 53000 $img.attr({ 53001 width: v.width 53002 }); 53003 } 53004 53005 t.syncCode(); 53006 t.$c.trigger('tbwchange'); 53007 53008 return true; 53009 }); 53010 }, 53011 fullscreen: function () { 53012 var t = this, 53013 prefix = t.o.prefix, 53014 fullscreenCssClass = prefix + 'fullscreen', 53015 fullscreenPlaceholderClass = fullscreenCssClass + '-placeholder', 53016 isFullscreen, 53017 editorHeight = t.$box.outerHeight(); 53018 53019 t.$box.toggleClass(fullscreenCssClass); 53020 isFullscreen = t.$box.hasClass(fullscreenCssClass); 53021 53022 if (isFullscreen) { 53023 t.$box.before( 53024 $('<div/>', { 53025 class: fullscreenPlaceholderClass 53026 }).css({ 53027 height: editorHeight 53028 }) 53029 ); 53030 } else { 53031 $('.' + fullscreenPlaceholderClass).remove(); 53032 } 53033 53034 $('body').toggleClass(prefix + 'body-fullscreen', isFullscreen); 53035 $(window).trigger('scroll'); 53036 t.$c.trigger('tbw' + (isFullscreen ? 'open' : 'close') + 'fullscreen'); 53037 }, 53038 53039 53040 /* 53041 * Call method of trumbowyg if exist 53042 * else try to call anonymous function 53043 * and finally native execCommand 53044 */ 53045 execCmd: function (cmd, param, forceCss, skipTrumbowyg) { 53046 var t = this; 53047 skipTrumbowyg = !!skipTrumbowyg || ''; 53048 53049 if (cmd !== 'dropdown') { 53050 t.$ed.focus(); 53051 } 53052 53053 if(cmd === 'strikethrough' && t.o.semantic) { 53054 t.semanticTag('strike', t.o.semanticKeepAttributes, true); // browsers cannot undo e.g. <del> as they expect <strike> 53055 } 53056 53057 try { 53058 t.doc.execCommand('styleWithCSS', false, forceCss || false); 53059 } catch (c) { 53060 } 53061 53062 try { 53063 t[cmd + skipTrumbowyg](param); 53064 } catch (c) { 53065 try { 53066 cmd(param); 53067 } catch (e2) { 53068 if (cmd === 'insertHorizontalRule') { 53069 param = undefined; 53070 } else if (cmd === 'formatBlock' && t.isIE) { 53071 param = '<' + param + '>'; 53072 } 53073 53074 t.doc.execCommand(cmd, false, param); 53075 53076 t.syncCode(); 53077 t.semanticCode(false, true); 53078 try { 53079 var listId = window.getSelection().focusNode; 53080 if(!$(window.getSelection().focusNode.parentNode).hasClass('trumbowyg-editor')){ 53081 listId = window.getSelection().focusNode.parentNode; 53082 } 53083 var classes = t.o.tagClasses[param]; 53084 if (classes) { 53085 $(listId).addClass(classes); 53086 } 53087 } catch (e) { 53088 53089 } 53090 53091 } 53092 53093 if (cmd !== 'dropdown') { 53094 t.updateButtonPaneStatus(); 53095 t.$c.trigger('tbwchange'); 53096 } 53097 } 53098 }, 53099 53100 53101 // Open a modal box 53102 openModal: function (title, content, buildForm) { 53103 var t = this, 53104 prefix = t.o.prefix; 53105 53106 buildForm = buildForm !== false; 53107 53108 // No open a modal box when exist other modal box 53109 if ($('.' + prefix + 'modal-box', t.$box).length > 0) { 53110 return false; 53111 } 53112 if (t.o.autogrowOnEnter) { 53113 t.autogrowOnEnterDontClose = true; 53114 } 53115 53116 t.saveRange(); 53117 t.showOverlay(); 53118 53119 // Disable all btnPane btns 53120 t.$btnPane.addClass(prefix + 'disable'); 53121 53122 // Build out of ModalBox, it's the mask for animations 53123 var $modal = $('<div/>', { 53124 class: prefix + 'modal ' + prefix + 'fixed-top' 53125 }).css({ 53126 top: t.$box.offset().top + t.$btnPane.height(), 53127 zIndex: 99999 53128 }).appendTo($(t.doc.body)); 53129 53130 // Click on overlay close modal by cancelling them 53131 t.$overlay.one('click', function () { 53132 $modal.trigger(CANCEL_EVENT); 53133 return false; 53134 }); 53135 53136 // Build the form 53137 var formOrContent; 53138 if (buildForm) { 53139 formOrContent = $('<form/>', { 53140 action: '', 53141 html: content 53142 }) 53143 .on('submit', function () { 53144 $modal.trigger(CONFIRM_EVENT); 53145 return false; 53146 }) 53147 .on('reset', function () { 53148 $modal.trigger(CANCEL_EVENT); 53149 return false; 53150 }) 53151 .on('submit reset', function () { 53152 if (t.o.autogrowOnEnter) { 53153 t.autogrowOnEnterDontClose = false; 53154 } 53155 }); 53156 } else { 53157 formOrContent = content; 53158 } 53159 53160 53161 // Build ModalBox and animate to show them 53162 var $box = $('<div/>', { 53163 class: prefix + 'modal-box', 53164 html: formOrContent 53165 }) 53166 .css({ 53167 top: '-' + t.$btnPane.outerHeight(), 53168 opacity: 0, 53169 paddingBottom: buildForm ? null : '5%', 53170 }) 53171 .appendTo($modal) 53172 .animate({ 53173 top: 0, 53174 opacity: 1 53175 }, 100); 53176 53177 53178 // Append title 53179 if (title) { 53180 $('<span/>', { 53181 text: title, 53182 class: prefix + 'modal-title' 53183 }).prependTo($box); 53184 } 53185 53186 if (buildForm) { 53187 // Focus in modal box 53188 $(':input:first', $box).focus(); 53189 53190 // Append Confirm and Cancel buttons 53191 t.buildModalBtn('submit', $box); 53192 t.buildModalBtn('reset', $box); 53193 53194 $modal.height($box.outerHeight() + 10); 53195 } 53196 53197 $(window).trigger('scroll'); 53198 t.$c.trigger('tbwmodalopen'); 53199 53200 return $modal; 53201 }, 53202 // @param n is name of modal 53203 buildModalBtn: function (n, $modal) { 53204 var t = this, 53205 prefix = t.o.prefix; 53206 53207 return $('<button/>', { 53208 class: prefix + 'modal-button ' + prefix + 'modal-' + n, 53209 type: n, 53210 text: t.lang[n] || n 53211 }).appendTo($('form', $modal)); 53212 }, 53213 // close current modal box 53214 closeModal: function () { 53215 var t = this, 53216 prefix = t.o.prefix; 53217 53218 t.$btnPane.removeClass(prefix + 'disable'); 53219 t.$overlay.off(); 53220 53221 // Find the modal box 53222 var $modalBox = $('.' + prefix + 'modal-box', $(t.doc.body)); 53223 53224 $modalBox.animate({ 53225 top: '-' + $modalBox.height() 53226 }, 100, function () { 53227 $modalBox.parent().remove(); 53228 t.hideOverlay(); 53229 t.$c.trigger('tbwmodalclose'); 53230 }); 53231 53232 t.restoreRange(); 53233 }, 53234 // Pre-formatted build and management modal 53235 openModalInsert: function (title, fields, cmd) { 53236 var t = this, 53237 prefix = t.o.prefix, 53238 lg = t.lang, 53239 html = '', 53240 idPrefix = prefix + 'form-' + Date.now() + '-'; 53241 53242 $.each(fields, function (fieldName, field) { 53243 var l = field.label || fieldName, 53244 n = field.name || fieldName, 53245 a = field.attributes || {}, 53246 fieldId = idPrefix + fieldName; 53247 53248 var attr = Object.keys(a).map(function (prop) { 53249 return prop + '="' + a[prop] + '"'; 53250 }).join(' '); 53251 53252 if (typeof field.type === 'function') { 53253 if (!field.name) { 53254 field.name = n; 53255 } 53256 html += field.type(field, fieldId, prefix, lg); 53257 } else { 53258 html += '<div class="' + prefix + 'input-row">' + 53259 '<div class="' + prefix + 'input-infos"><label for="' + fieldId + '"><span>' + (lg[l] ? lg[l] : l) + '</span></label></div>' + 53260 '<div class="' + prefix + 'input-html"><input id="' + fieldId + '" type="' + (field.type || 'text') + '" name="' + n + '" ' + attr; 53261 html += (field.type === 'checkbox' && field.value ? ' checked="checked"' : '') + ' value="' + (field.value || '').replace(/"/g, '"') + '"></div>'; 53262 html += '</div>'; 53263 } 53264 }); 53265 53266 return t.openModal(title, html) 53267 .on(CONFIRM_EVENT, function () { 53268 var $form = $('form', $(this)), 53269 valid = true, 53270 values = {}; 53271 53272 $.each(fields, function (fieldName, field) { 53273 var n = field.name || fieldName; 53274 53275 var $field = $(':input[name="' + n + '"]', $form), 53276 inputType = $field[0].type; 53277 53278 switch (inputType.toLowerCase()) { 53279 case 'checkbox': 53280 values[n] = $field.is(':checked'); 53281 break; 53282 case 'radio': 53283 values[n] = $field.filter(':checked').val(); 53284 break; 53285 default: 53286 values[n] = $.trim($field.val()); 53287 break; 53288 } 53289 // Validate value 53290 if (field.required && values[n] === '') { 53291 valid = false; 53292 t.addErrorOnModalField($field, t.lang.required); 53293 } else if (field.pattern && !field.pattern.test(values[n])) { 53294 valid = false; 53295 t.addErrorOnModalField($field, field.patternError); 53296 } 53297 }); 53298 53299 if (valid) { 53300 t.restoreRange(); 53301 53302 if (cmd(values, fields)) { 53303 t.syncCode(); 53304 t.$c.trigger('tbwchange'); 53305 t.closeModal(); 53306 $(this).off(CONFIRM_EVENT); 53307 } 53308 } 53309 }) 53310 .one(CANCEL_EVENT, function () { 53311 $(this).off(CONFIRM_EVENT); 53312 t.closeModal(); 53313 }); 53314 }, 53315 addErrorOnModalField: function ($field, err) { 53316 var prefix = this.o.prefix, 53317 spanErrorClass = prefix + 'msg-error', 53318 $row = $field.closest('.' + prefix + 'input-row'); 53319 53320 $field 53321 .on('change keyup', function () { 53322 $row.removeClass(prefix + 'input-error'); 53323 setTimeout(function () { 53324 $row.find('.' + spanErrorClass).remove(); 53325 }, 150); 53326 }); 53327 53328 $row 53329 .addClass(prefix + 'input-error') 53330 .find('.' + prefix + 'input-infos label') 53331 .append( 53332 $('<span/>', { 53333 class: spanErrorClass, 53334 text: err 53335 }) 53336 ); 53337 }, 53338 53339 getDefaultImgDblClickHandler: function () { 53340 var t = this; 53341 53342 return function () { 53343 var $img = $(this), 53344 src = $img.attr('src'), 53345 base64 = '(Base64)'; 53346 53347 if (src.indexOf('data:image') === 0) { 53348 src = base64; 53349 } 53350 53351 var options = { 53352 url: { 53353 label: 'URL', 53354 value: src, 53355 required: true 53356 }, 53357 alt: { 53358 label: t.lang.description, 53359 value: $img.attr('alt') 53360 } 53361 }; 53362 53363 if (t.o.imageWidthModalEdit) { 53364 options.width = { 53365 value: $img.attr('width') ? $img.attr('width') : '' 53366 }; 53367 } 53368 53369 t.openModalInsert(t.lang.insertImage, options, function (v) { 53370 if (v.url !== base64) { 53371 $img.attr({ 53372 src: v.url 53373 }); 53374 } 53375 $img.attr({ 53376 alt: v.alt 53377 }); 53378 53379 if (t.o.imageWidthModalEdit) { 53380 if (parseInt(v.width) > 0) { 53381 $img.attr({ 53382 width: v.width 53383 }); 53384 } else { 53385 $img.removeAttr('width'); 53386 } 53387 } 53388 53389 return true; 53390 }); 53391 return false; 53392 }; 53393 }, 53394 53395 // Range management 53396 saveRange: function () { 53397 var t = this, 53398 documentSelection = t.doc.getSelection(); 53399 53400 t.range = null; 53401 53402 if (!documentSelection || !documentSelection.rangeCount) { 53403 return; 53404 } 53405 53406 var savedRange = t.range = documentSelection.getRangeAt(0), 53407 range = t.doc.createRange(), 53408 rangeStart; 53409 range.selectNodeContents(t.$ed[0]); 53410 range.setEnd(savedRange.startContainer, savedRange.startOffset); 53411 rangeStart = (range + '').length; 53412 t.metaRange = { 53413 start: rangeStart, 53414 end: rangeStart + (savedRange + '').length 53415 }; 53416 }, 53417 restoreRange: function () { 53418 var t = this, 53419 metaRange = t.metaRange, 53420 savedRange = t.range, 53421 documentSelection = t.doc.getSelection(), 53422 range; 53423 53424 if (!savedRange) { 53425 return; 53426 } 53427 53428 if (metaRange && metaRange.start !== metaRange.end) { // Algorithm from http://jsfiddle.net/WeWy7/3/ 53429 var charIndex = 0, 53430 nodeStack = [t.$ed[0]], 53431 node, 53432 foundStart = false, 53433 stop = false; 53434 53435 range = t.doc.createRange(); 53436 53437 while (!stop && (node = nodeStack.pop())) { 53438 if (node.nodeType === 3) { 53439 var nextCharIndex = charIndex + node.length; 53440 if (!foundStart && metaRange.start >= charIndex && metaRange.start <= nextCharIndex) { 53441 range.setStart(node, metaRange.start - charIndex); 53442 foundStart = true; 53443 } 53444 if (foundStart && metaRange.end >= charIndex && metaRange.end <= nextCharIndex) { 53445 range.setEnd(node, metaRange.end - charIndex); 53446 stop = true; 53447 } 53448 charIndex = nextCharIndex; 53449 } else { 53450 var cn = node.childNodes, 53451 i = cn.length; 53452 53453 while (i > 0) { 53454 i -= 1; 53455 nodeStack.push(cn[i]); 53456 } 53457 } 53458 } 53459 } 53460 53461 // Fix IE11 Error 'Could not complete the operation due to error 800a025e'. 53462 // https://stackoverflow.com/questions/16160996/could-not-complete-the-operation-due-to-error-800a025e 53463 try { 53464 documentSelection.removeAllRanges(); 53465 } catch (e) { 53466 } 53467 53468 documentSelection.addRange(range || savedRange); 53469 }, 53470 getRangeText: function () { 53471 return this.range + ''; 53472 }, 53473 53474 clearButtonPaneStatus: function () { 53475 var t = this, 53476 prefix = t.o.prefix, 53477 activeClasses = prefix + 'active-button ' + prefix + 'active', 53478 originalIconClass = prefix + 'original-icon'; 53479 53480 // Reset all buttons and dropdown state 53481 $('.' + prefix + 'active-button', t.$btnPane).removeClass(activeClasses); 53482 $('.' + originalIconClass, t.$btnPane).each(function () { 53483 $(this).find('svg use').attr('xlink:href', $(this).data(originalIconClass)); 53484 }); 53485 }, 53486 updateButtonPaneStatus: function () { 53487 var t = this, 53488 prefix = t.o.prefix, 53489 activeClasses = prefix + 'active-button ' + prefix + 'active', 53490 originalIconClass = prefix + 'original-icon', 53491 tags = t.getTagsRecursive(t.doc.getSelection().focusNode); 53492 53493 t.clearButtonPaneStatus(); 53494 53495 $.each(tags, function (i, tag) { 53496 var btnName = t.tagToButton[tag.toLowerCase()], 53497 $btn = $('.' + prefix + btnName + '-button', t.$btnPane); 53498 53499 if ($btn.length > 0) { 53500 $btn.addClass(activeClasses); 53501 } else { 53502 try { 53503 $btn = $('.' + prefix + 'dropdown .' + prefix + btnName + '-dropdown-button', t.$box); 53504 var $btnSvgUse = $btn.find('svg use'), 53505 dropdownBtnName = $btn.parent().data(prefix + 'dropdown'), 53506 $dropdownBtn = $('.' + prefix + dropdownBtnName + '-button', t.$box), 53507 $dropdownBtnSvgUse = $dropdownBtn.find('svg use'); 53508 53509 // Highlight the dropdown button 53510 $dropdownBtn.addClass(activeClasses); 53511 53512 // Switch dropdown icon to the active sub-icon one 53513 if (t.o.changeActiveDropdownIcon && $btnSvgUse.length > 0) { 53514 // Save original icon 53515 $dropdownBtn 53516 .addClass(originalIconClass) 53517 .data(originalIconClass, $dropdownBtnSvgUse.attr('xlink:href')); 53518 53519 // Put the active sub-button's icon 53520 $dropdownBtnSvgUse 53521 .attr('xlink:href', $btnSvgUse.attr('xlink:href')); 53522 } 53523 } catch (e) { 53524 } 53525 } 53526 }); 53527 }, 53528 getTagsRecursive: function (element, tags) { 53529 var t = this; 53530 tags = tags || (element && element.tagName ? [element.tagName] : []); 53531 53532 if (element && element.parentNode) { 53533 element = element.parentNode; 53534 } else { 53535 return tags; 53536 } 53537 53538 var tag = element.tagName; 53539 if (tag === 'DIV') { 53540 return tags; 53541 } 53542 if (tag === 'P' && element.style.textAlign !== '') { 53543 tags.push(element.style.textAlign); 53544 } 53545 53546 $.each(t.tagHandlers, function (i, tagHandler) { 53547 tags = tags.concat(tagHandler(element, t)); 53548 }); 53549 53550 tags.push(tag); 53551 53552 return t.getTagsRecursive(element, tags).filter(function (tag) { 53553 return tag != null; 53554 }); 53555 }, 53556 53557 // Plugins 53558 initPlugins: function () { 53559 var t = this; 53560 t.loadedPlugins = []; 53561 $.each($.trumbowyg.plugins, function (name, plugin) { 53562 if (!plugin.shouldInit || plugin.shouldInit(t)) { 53563 plugin.init(t); 53564 if (plugin.tagHandler) { 53565 t.tagHandlers.push(plugin.tagHandler); 53566 } 53567 t.loadedPlugins.push(plugin); 53568 } 53569 }); 53570 }, 53571 destroyPlugins: function () { 53572 var t = this; 53573 $.each(this.loadedPlugins, function (i, plugin) { 53574 if (plugin.destroy) { 53575 plugin.destroy(t); 53576 } 53577 }); 53578 } 53579 }; 53580})(navigator, window, document, jQuery); 53581 53582 53583/***/ }), 53584
vendor: 394 bytes, lines 53585-53595
53585/***/ "./node_modules/trumbowyg/dist/ui/icons.svg": 53586/*!**************************************************!*\ 53587 !*** ./node_modules/trumbowyg/dist/ui/icons.svg ***! 53588 \**************************************************/ 53589/*! no static exports found */ 53590/***/ (function(module, exports) { 53591 53592module.exports = "/images/vendor/trumbowyg/dist/ui/icons.svg?f7eb750e8b2366478e311bd9e15e6f2c"; 53593 53594/***/ }), 53595
vendor: 3,215 bytes, lines 53596-53606
53596/***/ "./node_modules/vue-cleave-component/dist/vue-cleave.min.js": 53597/*!******************************************************************!*\ 53598 !*** ./node_modules/vue-cleave-component/dist/vue-cleave.min.js ***! 53599 \******************************************************************/ 53600/*! no static exports found */ 53601/***/ (function(module, exports, __webpack_require__) { 53602 53603!function(e,t){ true?module.exports=t(__webpack_require__(/*! cleave.js */ "./node_modules/cleave.js/dist/cleave-esm.js")):undefined}("undefined"!=typeof self?self:this,function(e){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([function(t,n){t.exports=e},function(e,t,n){"use strict";n.r(t);var r=n(0),o=n.n(r);function u(){return(u=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var a={name:"cleave",render:function(e){return e("input",{attrs:{type:"text",value:this.value},on:{blur:this.onBlur}})},props:{value:{default:null,required:!0,validator:function(e){return null===e||"string"==typeof e||e instanceof String||"number"==typeof e}},options:{type:Object,default:function(){return{}}},raw:{type:Boolean,default:!0}},data:function(){return{cleave:null,onValueChangedFn:null}},mounted:function(){this.cleave||(this.cleave=new o.a(this.$el,this.getOptions(this.options)))},methods:{getOptions:function(e){return this.onValueChangedFn=e.onValueChanged,u({},e,{onValueChanged:this.onValueChanged})},onValueChanged:function(e){var t=this.raw?e.target.rawValue:e.target.value;this.$emit("input",t),"function"==typeof this.onValueChangedFn&&this.onValueChangedFn.call(this,e)},onBlur:function(e){this.$emit("blur",this.value)}},watch:{options:{deep:!0,handler:function(e){this.cleave.destroy(),this.cleave=new o.a(this.$el,this.getOptions(e)),this.cleave.setRawValue(this.value)}},value:function(e){this.cleave&&(this.raw&&e===this.cleave.getRawValue()||(this.raw||e!==this.$el.value)&&this.cleave.setRawValue(e))}},beforeDestroy:function(){this.cleave&&(this.cleave.destroy(),this.cleave=null,this.onValueChangedFn=null)}};n.d(t,"plugin",function(){return i}),n.d(t,"component",function(){return a});var i=function(e,t){var n="cleave";"string"==typeof t&&(n=t),e.component(n,a)};a.install=i;t.default=a}]).default}); 53604 53605/***/ }), 53606
vendor: 7,154 bytes, lines 53607-53618
53607/***/ "./node_modules/vue-content-placeholders/dist/vue-content-placeholders.common.js": 53608/*!***************************************************************************************!*\ 53609 !*** ./node_modules/vue-content-placeholders/dist/vue-content-placeholders.common.js ***! 53610 \***************************************************************************************/ 53611/*! no static exports found */ 53612/***/ (function(module, exports, __webpack_require__) { 53613 53614/* WEBPACK VAR INJECTION */(function(global) {module.exports=function(modules){function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId]={i:moduleId,l:!1,exports:{}};return modules[moduleId].call(module.exports,module,module.exports,__webpack_require__),module.l=!0,module.exports}var installedModules={};return __webpack_require__.m=modules,__webpack_require__.c=installedModules,__webpack_require__.i=function(value){return value},__webpack_require__.d=function(exports,name,getter){__webpack_require__.o(exports,name)||Object.defineProperty(exports,name,{configurable:!1,enumerable:!0,get:getter})},__webpack_require__.n=function(module){var getter=module&&module.__esModule?function(){return module.default}:function(){return module};return __webpack_require__.d(getter,"a",getter),getter},__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=5)}([function(module,exports){module.exports=function(rawScriptExports,compiledTemplate,scopeId,cssModules){var esModule,scriptExports=rawScriptExports=rawScriptExports||{},type=typeof rawScriptExports.default;"object"!==type&&"function"!==type||(esModule=rawScriptExports,scriptExports=rawScriptExports.default);var options="function"==typeof scriptExports?scriptExports.options:scriptExports;if(compiledTemplate&&(options.render=compiledTemplate.render,options.staticRenderFns=compiledTemplate.staticRenderFns),scopeId&&(options._scopeId=scopeId),cssModules){var computed=options.computed||(options.computed={});Object.keys(cssModules).forEach(function(key){var module=cssModules[key];computed[key]=function(){return module}})}return{esModule:esModule,exports:scriptExports,options:options}}},function(module,exports,__webpack_require__){__webpack_require__(10);var Component=__webpack_require__(0)(__webpack_require__(6),__webpack_require__(12),null,null);module.exports=Component.exports},function(module,exports,__webpack_require__){var Component=__webpack_require__(0)(__webpack_require__(7),__webpack_require__(11),null,null);module.exports=Component.exports},function(module,exports,__webpack_require__){var Component=__webpack_require__(0)(__webpack_require__(8),__webpack_require__(14),null,null);module.exports=Component.exports},function(module,exports,__webpack_require__){var Component=__webpack_require__(0)(__webpack_require__(9),__webpack_require__(13),null,null);module.exports=Component.exports},function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function install(Vue){Vue.component("ContentPlaceholders",_ContentPlaceholders2.default),Vue.component("ContentPlaceholdersHeading",_ContentPlaceholdersHeading2.default),Vue.component("ContentPlaceholdersImg",_ContentPlaceholdersImg2.default),Vue.component("ContentPlaceholdersText",_ContentPlaceholdersText2.default)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.ContentPlaceholdersText=exports.ContentPlaceholdersImg=exports.ContentPlaceholdersHeading=exports.ContentPlaceholders=void 0,exports.install=install;var _ContentPlaceholders=__webpack_require__(1),_ContentPlaceholders2=_interopRequireDefault(_ContentPlaceholders),_ContentPlaceholdersHeading=__webpack_require__(2),_ContentPlaceholdersHeading2=_interopRequireDefault(_ContentPlaceholdersHeading),_ContentPlaceholdersImg=__webpack_require__(3),_ContentPlaceholdersImg2=_interopRequireDefault(_ContentPlaceholdersImg),_ContentPlaceholdersText=__webpack_require__(4),_ContentPlaceholdersText2=_interopRequireDefault(_ContentPlaceholdersText);exports.ContentPlaceholders=_ContentPlaceholders2.default,exports.ContentPlaceholdersHeading=_ContentPlaceholdersHeading2.default,exports.ContentPlaceholdersImg=_ContentPlaceholdersImg2.default,exports.ContentPlaceholdersText=_ContentPlaceholdersText2.default;var plugin={version:"0.2.1",install:install};exports.default=plugin;var GlobalVue=null;"undefined"!=typeof window?GlobalVue=window.Vue:"undefined"!=typeof global&&(GlobalVue=global.Vue),GlobalVue&&GlobalVue.use(plugin)},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={name:"content-placeholders",computed:{classObject:function(){return{"vue-content-placeholders":!0,"vue-content-placeholders-is-rounded":this.rounded,"vue-content-placeholders-is-centered":this.centered,"vue-content-placeholders-is-animated":this.animated}}},props:{rounded:{type:Boolean,default:!1},centered:{type:Boolean,default:!1},animated:{type:Boolean,default:!0}}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={name:"content-placeholders-heading",data:function(){return{className:"vue-content-placeholders-heading"}},props:{img:{type:Boolean,default:!1}}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={name:"content-placeholders-img",data:function(){return{className:"vue-content-placeholders-img"}}}},function(module,exports,__webpack_require__){"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default={name:"content-placeholders-text",data:function(){return{className:"vue-content-placeholders-text"}},props:{lines:{type:Number,default:4}}}},function(module,exports){},function(module,exports){module.exports={render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c("div",{class:_vm.className},[_vm.img?_c("div",{class:_vm.className+"__img"}):_vm._e(),_vm._v(" "),_c("div",{class:_vm.className+"__content"},[_c("div",{class:_vm.className+"__title"}),_vm._v(" "),_c("div",{class:_vm.className+"__subtitle"})])])},staticRenderFns:[]}},function(module,exports){module.exports={render:function(){var _vm=this,_h=_vm.$createElement;return(_vm._self._c||_h)("div",{class:_vm.classObject},[_vm._t("default")],2)},staticRenderFns:[]}},function(module,exports){module.exports={render:function(){var _vm=this,_h=_vm.$createElement,_c=_vm._self._c||_h;return _c("div",{class:_vm.className},_vm._l(_vm.lines,function(n){return _c("div",{key:n,class:_vm.className+"__line"})}))},staticRenderFns:[]}},function(module,exports){module.exports={render:function(){var _vm=this,_h=_vm.$createElement;return(_vm._self._c||_h)("div",{class:_vm.className})},staticRenderFns:[]}}]); 53615/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"))) 53616 53617/***/ }), 53618
vendor: 1,143 bytes, lines 53619-53648
53619/***/ "./node_modules/vue-content-placeholders/dist/vue-content-placeholders.css": 53620/*!*********************************************************************************!*\ 53621 !*** ./node_modules/vue-content-placeholders/dist/vue-content-placeholders.css ***! 53622 \*********************************************************************************/ 53623/*! no static exports found */ 53624/***/ (function(module, exports, __webpack_require__) { 53625 53626 53627var content = __webpack_require__(/*! !../../css-loader??ref--7-1!../../postcss-loader/src??ref--7-2!./vue-content-placeholders.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/vue-content-placeholders/dist/vue-content-placeholders.css"); 53628 53629if(typeof content === 'string') content = [[module.i, content, '']]; 53630 53631var transform; 53632var insertInto; 53633 53634 53635 53636var options = {"hmr":true} 53637 53638options.transform = transform 53639options.insertInto = undefined; 53640 53641var update = __webpack_require__(/*! ../../style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); 53642 53643if(content.locals) module.exports = content.locals; 53644 53645if(false) {} 53646 53647/***/ }), 53648
vendor: 1,881 bytes, lines 53649-53670
53649/***/ "./node_modules/vue-content-placeholders/index.js": 53650/*!********************************************************!*\ 53651 !*** ./node_modules/vue-content-placeholders/index.js ***! 53652 \********************************************************/ 53653/*! no static exports found */ 53654/***/ (function(module, __webpack_exports__, __webpack_require__) { 53655 53656"use strict"; 53657__webpack_require__.r(__webpack_exports__); 53658/* harmony import */ var _dist_vue_content_placeholders_common__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dist/vue-content-placeholders.common */ "./node_modules/vue-content-placeholders/dist/vue-content-placeholders.common.js"); 53659/* harmony import */ var _dist_vue_content_placeholders_common__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_dist_vue_content_placeholders_common__WEBPACK_IMPORTED_MODULE_0__); 53660/* harmony reexport (default from non-harmony) */ __webpack_require__.d(__webpack_exports__, "default", function() { return _dist_vue_content_placeholders_common__WEBPACK_IMPORTED_MODULE_0___default.a; }); 53661/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _dist_vue_content_placeholders_common__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _dist_vue_content_placeholders_common__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__)); 53662/* harmony import */ var _dist_vue_content_placeholders_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dist/vue-content-placeholders.css */ "./node_modules/vue-content-placeholders/dist/vue-content-placeholders.css"); 53663/* harmony import */ var _dist_vue_content_placeholders_css__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_dist_vue_content_placeholders_css__WEBPACK_IMPORTED_MODULE_1__); 53664 53665 53666 53667 53668 53669/***/ }), 53670
vendor: 527,630 bytes, lines 53671-65492
53671/***/ "./node_modules/vue-flatpickr-component/dist/vue-flatpickr.min.js": 53672/*!************************************************************************!*\ 53673 !*** ./node_modules/vue-flatpickr-component/dist/vue-flatpickr.min.js ***! 53674 \************************************************************************/ 53675/*! no static exports found */ 53676/***/ (function(module, exports, __webpack_require__) { 53677 53678!function(t,e){ true?module.exports=e(__webpack_require__(/*! flatpickr */ "./node_modules/flatpickr/dist/esm/index.js")):undefined}("undefined"!=typeof self?self:this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=1)}([function(e,n){e.exports=t},function(t,e,n){"use strict";n.r(e),n.d(e,"Component",(function(){return p})),n.d(e,"Plugin",(function(){return d}));var r=n(0),o=n.n(r),i=["onChange","onClose","onDestroy","onMonthChange","onOpen","onYearChange"];function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}var a=function(t){return t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()},f=function(t){return t&&t.length?t:null},l=function(t){return u({},t)},s=i.concat(["onValueUpdate","onDayCreate","onParseConfig","onReady","onPreCalendarPosition","onKeyDown"]),c=["locale","showMonths"],p={name:"flat-pickr",render:function(t){return t("input",{attrs:{type:"text","data-input":!0},props:{disabled:this.disabled},on:{input:this.onInput}})},props:{value:{default:null,required:!0,validator:function(t){return null===t||t instanceof Date||"string"==typeof t||t instanceof String||t instanceof Array||"number"==typeof t}},config:{type:Object,default:function(){return{wrap:!1,defaultDate:null}}},events:{type:Array,default:function(){return i}},disabled:{type:Boolean,default:!1}},data:function(){return{fp:null}},mounted:function(){var t=this;if(!this.fp){var e=l(this.config);this.events.forEach((function(n){var r,i=o.a.defaultConfig[n]||[];e[n]=(r=e[n]||[],r instanceof Array?r:[r]).concat(i,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];t.$emit.apply(t,[a(n)].concat(r))}))})),e.defaultDate=this.value||e.defaultDate,this.fp=new o.a(this.getElem(),e),this.fpInput().addEventListener("blur",this.onBlur),this.$on("on-close",this.onClose),this.$watch("disabled",this.watchDisabled,{immediate:!0})}},methods:{getElem:function(){return this.config.wrap?this.$el.parentNode:this.$el},onInput:function(t){var e=this,n=t.target;this.$nextTick((function(){e.$emit("input",f(n.value))}))},fpInput:function(){return this.fp.altInput||this.fp.input},onBlur:function(t){this.$emit("blur",f(t.target.value))},onClose:function(t,e){this.$emit("input",f(e))},watchDisabled:function(t){t?this.fpInput().setAttribute("disabled",t):this.fpInput().removeAttribute("disabled")}},watch:{config:{deep:!0,handler:function(t){var e=this,n=l(t);s.forEach((function(t){delete n[t]})),this.fp.set(n),c.forEach((function(t){void 0!==n[t]&&e.fp.set(t,n[t])}))}},value:function(t){t!==f(this.$el.value)&&this.fp&&this.fp.setDate(t,!0)}},beforeDestroy:function(){this.fp&&(this.fpInput().removeEventListener("blur",this.onBlur),this.fp.destroy(),this.fp=null)}},d=function(t,e){var n="flat-pickr";"string"==typeof e&&(n=e),t.component(n,p)};p.install=d;e.default=p}]).default})); 53679 53680/***/ }), 53681 53682/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true&": 53683/*!*********************************************************************************************************************************************************************************************************************************************!*\ 53684 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true& ***! 53685 \*********************************************************************************************************************************************************************************************************************************************/ 53686/*! exports provided: render, staticRenderFns */ 53687/***/ (function(module, __webpack_exports__, __webpack_require__) { 53688 53689"use strict"; 53690__webpack_require__.r(__webpack_exports__); 53691/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 53692/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 53693var render = function () { 53694 var _vm = this 53695 var _h = _vm.$createElement 53696 var _c = _vm._self._c || _h 53697 return _c( 53698 "div", 53699 { staticClass: "card card-bicycle card-product rounded-0" }, 53700 [ 53701 _c("div", { staticClass: "card-header x d-none" }, [ 53702 _c("h3", [_vm._v(_vm._s(_vm.formData.business_name) + " Insurance")]), 53703 ]), 53704 _vm._v(" "), 53705 !_vm.submitting 53706 ? _c("div", { staticClass: "card-body" }, [ 53707 _vm.currentPage === 1 53708 ? _c("div", { attrs: { id: "step-1" } }, [ 53709 _vm._m(0), 53710 _vm._v(" "), 53711 _c("div", { staticClass: "form-group" }, [ 53712 _vm._m(1), 53713 _vm._v(" "), 53714 _c("input", { 53715 directives: [ 53716 { 53717 name: "model", 53718 rawName: "v-model", 53719 value: _vm.formData.first_name, 53720 expression: "formData.first_name", 53721 }, 53722 ], 53723 staticClass: "form-control", 53724 attrs: { type: "text" }, 53725 domProps: { value: _vm.formData.first_name }, 53726 on: { 53727 input: function ($event) { 53728 if ($event.target.composing) { 53729 return 53730 } 53731 _vm.$set( 53732 _vm.formData, 53733 "first_name", 53734 $event.target.value 53735 ) 53736 }, 53737 }, 53738 }), 53739 _vm._v(" "), 53740 _vm.errors.first_name 53741 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 53742 _vm._v(_vm._s(_vm.errors.first_name[0])), 53743 ]) 53744 : _vm._e(), 53745 ]), 53746 _vm._v(" "), 53747 _c("div", { staticClass: "form-group" }, [ 53748 _c("label", [_vm._v("Nama Belakang")]), 53749 _vm._v(" "), 53750 _c("input", { 53751 directives: [ 53752 { 53753 name: "model", 53754 rawName: "v-model", 53755 value: _vm.formData.last_name, 53756 expression: "formData.last_name", 53757 }, 53758 ], 53759 staticClass: "form-control", 53760 attrs: { type: "text" }, 53761 domProps: { value: _vm.formData.last_name }, 53762 on: { 53763 input: function ($event) { 53764 if ($event.target.composing) { 53765 return 53766 } 53767 _vm.$set( 53768 _vm.formData, 53769 "last_name", 53770 $event.target.value 53771 ) 53772 }, 53773 }, 53774 }), 53775 _vm._v(" "), 53776 _vm.errors.last_name 53777 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 53778 _vm._v(_vm._s(_vm.errors.last_name[0])), 53779 ]) 53780 : _vm._e(), 53781 ]), 53782 _vm._v(" "), 53783 _c("div", { staticClass: "form-check form-check-inline" }, [ 53784 _c("input", { 53785 directives: [ 53786 { 53787 name: "model", 53788 rawName: "v-model", 53789 value: _vm.formData.gender, 53790 expression: "formData.gender", 53791 }, 53792 ], 53793 staticClass: "form-check-input", 53794 attrs: { type: "radio", value: "1" }, 53795 domProps: { checked: _vm._q(_vm.formData.gender, "1") }, 53796 on: { 53797 change: function ($event) { 53798 return _vm.$set(_vm.formData, "gender", "1") 53799 }, 53800 }, 53801 }), 53802 _vm._v(" "), 53803 _c("label", { staticClass: "form-check-label" }, [ 53804 _vm._v("Laki-Laki"), 53805 ]), 53806 ]), 53807 _vm._v(" "), 53808 _c("div", { staticClass: "form-check form-check-inline" }, [ 53809 _c("input", { 53810 directives: [ 53811 { 53812 name: "model", 53813 rawName: "v-model", 53814 value: _vm.formData.gender, 53815 expression: "formData.gender", 53816 }, 53817 ], 53818 staticClass: "form-check-input", 53819 attrs: { type: "radio", value: "2" }, 53820 domProps: { checked: _vm._q(_vm.formData.gender, "2") }, 53821 on: { 53822 change: function ($event) { 53823 return _vm.$set(_vm.formData, "gender", "2") 53824 }, 53825 }, 53826 }), 53827 _vm._v(" "), 53828 _c("label", { staticClass: "form-check-label" }, [ 53829 _vm._v("Perempuan"), 53830 ]), 53831 ]), 53832 _vm._v(" "), 53833 _c("div", { staticClass: "form-group" }, [ 53834 _vm._m(2), 53835 _vm._v(" "), 53836 _c("input", { 53837 directives: [ 53838 { 53839 name: "model", 53840 rawName: "v-model", 53841 value: _vm.formData.hand_phone, 53842 expression: "formData.hand_phone", 53843 }, 53844 ], 53845 staticClass: "form-control", 53846 attrs: { type: "text" }, 53847 domProps: { value: _vm.formData.hand_phone }, 53848 on: { 53849 input: function ($event) { 53850 if ($event.target.composing) { 53851 return 53852 } 53853 _vm.$set( 53854 _vm.formData, 53855 "hand_phone", 53856 $event.target.value 53857 ) 53858 }, 53859 }, 53860 }), 53861 _vm._v(" "), 53862 _vm.errors.hand_phone 53863 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 53864 _vm._v( 53865 "\n " + 53866 _vm._s(_vm.errors.hand_phone[0]) + 53867 "\n " 53868 ), 53869 ]) 53870 : _vm._e(), 53871 ]), 53872 _vm._v(" "), 53873 _c("div", { staticClass: "form-group" }, [ 53874 _vm._m(3), 53875 _vm._v(" "), 53876 _c("input", { 53877 directives: [ 53878 { 53879 name: "model", 53880 rawName: "v-model", 53881 value: _vm.formData.email, 53882 expression: "formData.email", 53883 }, 53884 ], 53885 staticClass: "form-control", 53886 attrs: { type: "email" }, 53887 domProps: { value: _vm.formData.email }, 53888 on: { 53889 input: function ($event) { 53890 if ($event.target.composing) { 53891 return 53892 } 53893 _vm.$set(_vm.formData, "email", $event.target.value) 53894 }, 53895 }, 53896 }), 53897 _vm._v(" "), 53898 _vm.errors.email 53899 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 53900 _vm._v( 53901 "\n " + 53902 _vm._s(_vm.errors.email[0]) + 53903 "\n " 53904 ), 53905 ]) 53906 : _vm._e(), 53907 ]), 53908 ]) 53909 : _vm._e(), 53910 _vm._v(" "), 53911 _vm.currentPage === 2 53912 ? _c("div", { attrs: { id: "step-2" } }, [ 53913 _c("div", { staticClass: "row" }, [ 53914 _c("div", { staticClass: "col-md-6" }, [ 53915 _c("div", { staticClass: "form-group" }, [ 53916 _c("label", [_vm._v("Tanggal Mulai")]), 53917 _vm._v(" "), 53918 _c("input", { 53919 directives: [ 53920 { 53921 name: "model", 53922 rawName: "v-model", 53923 value: _vm.formData.start_date, 53924 expression: "formData.start_date", 53925 }, 53926 ], 53927 staticClass: "form-control", 53928 attrs: { type: "text", readonly: "" }, 53929 domProps: { value: _vm.formData.start_date }, 53930 on: { 53931 input: function ($event) { 53932 if ($event.target.composing) { 53933 return 53934 } 53935 _vm.$set( 53936 _vm.formData, 53937 "start_date", 53938 $event.target.value 53939 ) 53940 }, 53941 }, 53942 }), 53943 _vm._v(" "), 53944 _vm.errors.start_date 53945 ? _c( 53946 "small", 53947 { staticClass: "form-text text-danger" }, 53948 [_vm._v(_vm._s(_vm.errors.start_date[0]))] 53949 ) 53950 : _vm._e(), 53951 ]), 53952 ]), 53953 _vm._v(" "), 53954 _c("div", { staticClass: "col-md-6" }, [ 53955 _c("div", { staticClass: "form-group" }, [ 53956 _c("label", [_vm._v("Tanggal Berakhir")]), 53957 _vm._v(" "), 53958 _c("input", { 53959 directives: [ 53960 { 53961 name: "model", 53962 rawName: "v-model", 53963 value: _vm.formData.end_date, 53964 expression: "formData.end_date", 53965 }, 53966 ], 53967 staticClass: "form-control", 53968 attrs: { type: "text", readonly: "" }, 53969 domProps: { value: _vm.formData.end_date }, 53970 on: { 53971 input: function ($event) { 53972 if ($event.target.composing) { 53973 return 53974 } 53975 _vm.$set( 53976 _vm.formData, 53977 "end_date", 53978 $event.target.value 53979 ) 53980 }, 53981 }, 53982 }), 53983 _vm._v(" "), 53984 _vm.errors.end_date 53985 ? _c( 53986 "small", 53987 { staticClass: "form-text text-danger" }, 53988 [_vm._v(_vm._s(_vm.errors.end_date[0]))] 53989 ) 53990 : _vm._e(), 53991 ]), 53992 ]), 53993 ]), 53994 _vm._v(" "), 53995 _c( 53996 "div", 53997 { staticClass: "form-group" }, 53998 [ 53999 _c("label", [_vm._v("Paket")]), 54000 _vm._v(" "), 54001 _c("v-select", { 54002 attrs: { options: _vm.optionPackets }, 54003 model: { 54004 value: _vm.formData.type_of_packet, 54005 callback: function ($$v) { 54006 _vm.$set(_vm.formData, "type_of_packet", $$v) 54007 }, 54008 expression: "formData.type_of_packet", 54009 }, 54010 }), 54011 _vm._v(" "), 54012 _vm.errors.type_of_packet 54013 ? _c( 54014 "div", 54015 { staticClass: "invalid-feedback d-block" }, 54016 [ 54017 _vm._v( 54018 "\n " + 54019 _vm._s(_vm.errors.type_of_packet[0]) + 54020 "\n " 54021 ), 54022 ] 54023 ) 54024 : _vm._e(), 54025 ], 54026 1 54027 ), 54028 _vm._v(" "), 54029 _c( 54030 "div", 54031 { staticClass: "form-group" }, 54032 [ 54033 _c("label", [_vm._v("Spesifikasi Sepeda")]), 54034 _vm._v(" "), 54035 _c("v-select", { 54036 attrs: { options: _vm.optionObjects }, 54037 on: { input: _vm.changeObject }, 54038 model: { 54039 value: _vm.formData.bicycle_name, 54040 callback: function ($$v) { 54041 _vm.$set(_vm.formData, "bicycle_name", $$v) 54042 }, 54043 expression: "formData.bicycle_name", 54044 }, 54045 }), 54046 _vm._v(" "), 54047 _vm.errors.bicycle_name 54048 ? _c( 54049 "div", 54050 { staticClass: "invalid-feedback d-block" }, 54051 [ 54052 _vm._v( 54053 "\n " + 54054 _vm._s(_vm.errors.bicycle_name[0]) + 54055 "\n " 54056 ), 54057 ] 54058 ) 54059 : _vm._e(), 54060 ], 54061 1 54062 ), 54063 _vm._v(" "), 54064 _c( 54065 "div", 54066 { staticClass: "form-group" }, 54067 [ 54068 _c("label", [_vm._v("Merek Sepeda")]), 54069 _vm._v(" "), 54070 _c("v-select", { 54071 attrs: { options: _vm.optionBrands }, 54072 on: { input: _vm.changeBrand }, 54073 model: { 54074 value: _vm.formData.brand_name, 54075 callback: function ($$v) { 54076 _vm.$set(_vm.formData, "brand_name", $$v) 54077 }, 54078 expression: "formData.brand_name", 54079 }, 54080 }), 54081 _vm._v(" "), 54082 _vm.errors.brand_name 54083 ? _c( 54084 "div", 54085 { staticClass: "invalid-feedback d-block" }, 54086 [ 54087 _vm._v( 54088 "\n " + 54089 _vm._s(_vm.errors.brand_name[0]) + 54090 "\n " 54091 ), 54092 ] 54093 ) 54094 : _vm._e(), 54095 ], 54096 1 54097 ), 54098 _vm._v(" "), 54099 _c( 54100 "div", 54101 { staticClass: "form-group" }, 54102 [ 54103 _c("label", [_vm._v("Model Sepeda")]), 54104 _vm._v(" "), 54105 _c("v-select", { 54106 attrs: { options: _vm.optionTypes }, 54107 model: { 54108 value: _vm.formData.type_name, 54109 callback: function ($$v) { 54110 _vm.$set(_vm.formData, "type_name", $$v) 54111 }, 54112 expression: "formData.type_name", 54113 }, 54114 }), 54115 _vm._v(" "), 54116 _vm.errors.type_name 54117 ? _c( 54118 "div", 54119 { staticClass: "invalid-feedback d-block" }, 54120 [ 54121 _vm._v( 54122 "\n " + 54123 _vm._s(_vm.errors.type_name[0]) + 54124 "\n " 54125 ), 54126 ] 54127 ) 54128 : _vm._e(), 54129 ], 54130 1 54131 ), 54132 _vm._v(" "), 54133 _c("div", { staticClass: "form-group" }, [ 54134 _c("label", [_vm._v("Harga Sepeda")]), 54135 _vm._v(" "), 54136 _c("input", { 54137 directives: [ 54138 { 54139 name: "model", 54140 rawName: "v-model", 54141 value: _vm.formData.tsi, 54142 expression: "formData.tsi", 54143 }, 54144 ], 54145 staticClass: "form-control", 54146 attrs: { type: "number" }, 54147 domProps: { value: _vm.formData.tsi }, 54148 on: { 54149 input: function ($event) { 54150 if ($event.target.composing) { 54151 return 54152 } 54153 _vm.$set(_vm.formData, "tsi", $event.target.value) 54154 }, 54155 }, 54156 }), 54157 _vm._v(" "), 54158 !_vm.isValidPrice 54159 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 54160 _vm._v( 54161 "Harga tidak sesuai (minimal 1jt & maksimal 75jt)." 54162 ), 54163 ]) 54164 : _vm._e(), 54165 _vm._v(" "), 54166 _vm.errors.tsi 54167 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 54168 _vm._v( 54169 "\n " + 54170 _vm._s(_vm.errors.tsi[0]) + 54171 "\n " 54172 ), 54173 ]) 54174 : _vm._e(), 54175 ]), 54176 ]) 54177 : _vm._e(), 54178 _vm._v(" "), 54179 _vm.currentPage === 3 54180 ? _c("div", { staticClass: "step-3" }, [ 54181 _c("div", { staticClass: "form-group" }, [ 54182 _c("label", [_vm._v("Jumlah Pembayaran")]), 54183 _vm._v(" "), 54184 _c("div", { staticClass: "input-group" }, [ 54185 _c("input", { 54186 directives: [ 54187 { 54188 name: "model", 54189 rawName: "v-model", 54190 value: _vm.formData.payment_total, 54191 expression: "formData.payment_total", 54192 }, 54193 ], 54194 staticClass: "form-control", 54195 attrs: { type: "text", readonly: "" }, 54196 domProps: { value: _vm.formData.payment_total }, 54197 on: { 54198 input: function ($event) { 54199 if ($event.target.composing) { 54200 return 54201 } 54202 _vm.$set( 54203 _vm.formData, 54204 "payment_total", 54205 $event.target.value 54206 ) 54207 }, 54208 }, 54209 }), 54210 _vm._v(" "), 54211 _c("div", { staticClass: "input-group-append" }, [ 54212 _c( 54213 "button", 54214 { 54215 staticClass: "btn btn-primary", 54216 attrs: { type: "button" }, 54217 on: { 54218 click: function ($event) { 54219 return _vm.copyData(_vm.formData.payment_total) 54220 }, 54221 }, 54222 }, 54223 [_c("i", { staticClass: "fa fa-copy text-white" })] 54224 ), 54225 ]), 54226 ]), 54227 ]), 54228 _vm._v(" "), 54229 _vm.formData.policy_number === "" 54230 ? _c("div", { staticClass: "form-check" }, [ 54231 _c("input", { 54232 directives: [ 54233 { 54234 name: "model", 54235 rawName: "v-model", 54236 value: _vm.isAgreement, 54237 expression: "isAgreement", 54238 }, 54239 ], 54240 staticClass: "form-check-input", 54241 attrs: { type: "checkbox", id: "agreement" }, 54242 domProps: { 54243 checked: Array.isArray(_vm.isAgreement) 54244 ? _vm._i(_vm.isAgreement, null) > -1 54245 : _vm.isAgreement, 54246 }, 54247 on: { 54248 change: function ($event) { 54249 var $$a = _vm.isAgreement, 54250 $$el = $event.target, 54251 $$c = $$el.checked ? true : false 54252 if (Array.isArray($$a)) { 54253 var $$v = null, 54254 $$i = _vm._i($$a, $$v) 54255 if ($$el.checked) { 54256 $$i < 0 && 54257 (_vm.isAgreement = $$a.concat([$$v])) 54258 } else { 54259 $$i > -1 && 54260 (_vm.isAgreement = $$a 54261 .slice(0, $$i) 54262 .concat($$a.slice($$i + 1))) 54263 } 54264 } else { 54265 _vm.isAgreement = $$c 54266 } 54267 }, 54268 }, 54269 }), 54270 _vm._v(" "), 54271 _c( 54272 "label", 54273 { 54274 staticClass: "form-check-label", 54275 attrs: { for: "agreement" }, 54276 }, 54277 [ 54278 _vm._v( 54279 "\n I agree to issue a policy ( Saya setuju untuk menerbitkan polis ).\n " 54280 ), 54281 ] 54282 ), 54283 ]) 54284 : _vm._e(), 54285 ]) 54286 : _vm._e(), 54287 _vm._v(" "), 54288 _vm.currentPage === 4 54289 ? _c( 54290 "div", 54291 { staticClass: "step-4" }, 54292 [ 54293 _c("div", { staticClass: "form-group" }, [ 54294 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 54295 _vm._v(" "), 54296 _c("div", { staticClass: "input-group" }, [ 54297 _c("input", { 54298 directives: [ 54299 { 54300 name: "model", 54301 rawName: "v-model", 54302 value: _vm.formData.policy_number, 54303 expression: "formData.policy_number", 54304 }, 54305 ], 54306 staticClass: "form-control", 54307 attrs: { type: "text", readonly: "" }, 54308 domProps: { value: _vm.formData.policy_number }, 54309 on: { 54310 input: function ($event) { 54311 if ($event.target.composing) { 54312 return 54313 } 54314 _vm.$set( 54315 _vm.formData, 54316 "policy_number", 54317 $event.target.value 54318 ) 54319 }, 54320 }, 54321 }), 54322 _vm._v(" "), 54323 _c("div", { staticClass: "input-group-append" }, [ 54324 _c( 54325 "button", 54326 { 54327 staticClass: "btn btn-primary", 54328 attrs: { type: "button" }, 54329 on: { 54330 click: function ($event) { 54331 return _vm.copyData( 54332 _vm.formData.policy_number, 54333 "Policy Number" 54334 ) 54335 }, 54336 }, 54337 }, 54338 [_c("i", { staticClass: "fa fa-copy text-white" })] 54339 ), 54340 ]), 54341 _vm._v(" "), 54342 _c("div", { staticClass: "valid-feedback d-block" }, [ 54343 _vm._v( 54344 "The policy has been successfully issued, you can complete\n other data.\n " 54345 ), 54346 ]), 54347 ]), 54348 ]), 54349 _vm._v(" "), 54350 _c("div", { staticClass: "form-group" }, [ 54351 _vm._m(4), 54352 _vm._v(" "), 54353 _c("input", { 54354 directives: [ 54355 { 54356 name: "model", 54357 rawName: "v-model", 54358 value: _vm.formData.id_card, 54359 expression: "formData.id_card", 54360 }, 54361 ], 54362 staticClass: "form-control", 54363 attrs: { type: "text" }, 54364 domProps: { value: _vm.formData.id_card }, 54365 on: { 54366 input: function ($event) { 54367 if ($event.target.composing) { 54368 return 54369 } 54370 _vm.$set( 54371 _vm.formData, 54372 "id_card", 54373 $event.target.value 54374 ) 54375 }, 54376 }, 54377 }), 54378 _vm._v(" "), 54379 _vm.errors.id_card 54380 ? _c( 54381 "div", 54382 { staticClass: "invalid-feedback d-block" }, 54383 [ 54384 _vm._v( 54385 "\n " + 54386 _vm._s(_vm.errors.id_card[0]) + 54387 "\n " 54388 ), 54389 ] 54390 ) 54391 : _vm._e(), 54392 ]), 54393 _vm._v(" "), 54394 _c("div", { staticClass: "form-group" }, [ 54395 _c("label", [_vm._v("No NPWP")]), 54396 _vm._v(" "), 54397 _c("input", { 54398 directives: [ 54399 { 54400 name: "model", 54401 rawName: "v-model", 54402 value: _vm.formData.npwp, 54403 expression: "formData.npwp", 54404 }, 54405 ], 54406 staticClass: "form-control", 54407 attrs: { type: "text" }, 54408 domProps: { value: _vm.formData.npwp }, 54409 on: { 54410 input: function ($event) { 54411 if ($event.target.composing) { 54412 return 54413 } 54414 _vm.$set(_vm.formData, "npwp", $event.target.value) 54415 }, 54416 }, 54417 }), 54418 _vm._v(" "), 54419 _vm.errors.npwp 54420 ? _c( 54421 "div", 54422 { staticClass: "invalid-feedback d-block" }, 54423 [ 54424 _vm._v( 54425 "\n " + 54426 _vm._s(_vm.errors.npwp[0]) + 54427 "\n " 54428 ), 54429 ] 54430 ) 54431 : _vm._e(), 54432 ]), 54433 _vm._v(" "), 54434 _vm.formData.customer_type === "personal" 54435 ? [ 54436 _c("div", { staticClass: "form-group" }, [ 54437 _vm._m(5), 54438 _vm._v(" "), 54439 _c("textarea", { 54440 directives: [ 54441 { 54442 name: "model", 54443 rawName: "v-model", 54444 value: _vm.formData.address, 54445 expression: "formData.address", 54446 }, 54447 ], 54448 staticClass: 54449 "form-control form-control-plaintext", 54450 domProps: { value: _vm.formData.address }, 54451 on: { 54452 input: function ($event) { 54453 if ($event.target.composing) { 54454 return 54455 } 54456 _vm.$set( 54457 _vm.formData, 54458 "address", 54459 $event.target.value 54460 ) 54461 }, 54462 }, 54463 }), 54464 _vm._v(" "), 54465 _vm.errors.address 54466 ? _c( 54467 "div", 54468 { staticClass: "invalid-feedback d-block" }, 54469 [ 54470 _vm._v( 54471 "\n " + 54472 _vm._s(_vm.errors.address[0]) + 54473 "\n " 54474 ), 54475 ] 54476 ) 54477 : _vm._e(), 54478 ]), 54479 _vm._v(" "), 54480 _c("div", { staticClass: "form-group" }, [ 54481 _c("label", [_vm._v("Kodepos")]), 54482 _vm._v(" "), 54483 _c("input", { 54484 directives: [ 54485 { 54486 name: "model", 54487 rawName: "v-model", 54488 value: _vm.formData.zip_code, 54489 expression: "formData.zip_code", 54490 }, 54491 ], 54492 staticClass: "form-control", 54493 attrs: { type: "text", maxlength: "5" }, 54494 domProps: { value: _vm.formData.zip_code }, 54495 on: { 54496 input: function ($event) { 54497 if ($event.target.composing) { 54498 return 54499 } 54500 _vm.$set( 54501 _vm.formData, 54502 "zip_code", 54503 $event.target.value 54504 ) 54505 }, 54506 }, 54507 }), 54508 _vm._v(" "), 54509 _vm.errors.zip_code 54510 ? _c( 54511 "div", 54512 { staticClass: "invalid-feedback d-block" }, 54513 [ 54514 _vm._v( 54515 "\n " + 54516 _vm._s(_vm.errors.zip_code[0]) + 54517 "\n " 54518 ), 54519 ] 54520 ) 54521 : _vm._e(), 54522 ]), 54523 _vm._v(" "), 54524 _c("div", { staticClass: "form-group" }, [ 54525 _c("label", [_vm._v("No Telephone")]), 54526 _vm._v(" "), 54527 _c("input", { 54528 directives: [ 54529 { 54530 name: "model", 54531 rawName: "v-model", 54532 value: _vm.formData.telephone, 54533 expression: "formData.telephone", 54534 }, 54535 ], 54536 staticClass: "form-control", 54537 attrs: { type: "text" }, 54538 domProps: { value: _vm.formData.telephone }, 54539 on: { 54540 input: function ($event) { 54541 if ($event.target.composing) { 54542 return 54543 } 54544 _vm.$set( 54545 _vm.formData, 54546 "telephone", 54547 $event.target.value 54548 ) 54549 }, 54550 }, 54551 }), 54552 _vm._v(" "), 54553 _vm.errors.telephone 54554 ? _c( 54555 "div", 54556 { staticClass: "invalid-feedback d-block" }, 54557 [ 54558 _vm._v( 54559 "\n " + 54560 _vm._s(_vm.errors.telephone[0]) + 54561 "\n " 54562 ), 54563 ] 54564 ) 54565 : _vm._e(), 54566 ]), 54567 ] 54568 : [ 54569 _c("div", { staticClass: "form-group" }, [ 54570 _vm._m(6), 54571 _vm._v(" "), 54572 _c("input", { 54573 directives: [ 54574 { 54575 name: "model", 54576 rawName: "v-model", 54577 value: _vm.formData.company, 54578 expression: "formData.company", 54579 }, 54580 ], 54581 staticClass: "form-control", 54582 attrs: { type: "text" }, 54583 domProps: { value: _vm.formData.company }, 54584 on: { 54585 input: function ($event) { 54586 if ($event.target.composing) { 54587 return 54588 } 54589 _vm.$set( 54590 _vm.formData, 54591 "company", 54592 $event.target.value 54593 ) 54594 }, 54595 }, 54596 }), 54597 _vm._v(" "), 54598 _vm.errors.company 54599 ? _c( 54600 "div", 54601 { staticClass: "invalid-feedback d-block" }, 54602 [ 54603 _vm._v( 54604 "\n " + 54605 _vm._s(_vm.errors.company[0]) + 54606 "\n " 54607 ), 54608 ] 54609 ) 54610 : _vm._e(), 54611 ]), 54612 _vm._v(" "), 54613 _c("div", { staticClass: "form-group" }, [ 54614 _vm._m(7), 54615 _vm._v(" "), 54616 _c("textarea", { 54617 directives: [ 54618 { 54619 name: "model", 54620 rawName: "v-model", 54621 value: _vm.formData.office_address, 54622 expression: "formData.office_address", 54623 }, 54624 ], 54625 staticClass: 54626 "form-control form-control-plaintext", 54627 domProps: { value: _vm.formData.office_address }, 54628 on: { 54629 input: function ($event) { 54630 if ($event.target.composing) { 54631 return 54632 } 54633 _vm.$set( 54634 _vm.formData, 54635 "office_address", 54636 $event.target.value 54637 ) 54638 }, 54639 }, 54640 }), 54641 _vm._v(" "), 54642 _vm.errors.office_address 54643 ? _c( 54644 "div", 54645 { staticClass: "invalid-feedback d-block" }, 54646 [ 54647 _vm._v( 54648 "\n " + 54649 _vm._s(_vm.errors.office_address[0]) + 54650 "\n " 54651 ), 54652 ] 54653 ) 54654 : _vm._e(), 54655 ]), 54656 _vm._v(" "), 54657 _c("div", { staticClass: "form-group" }, [ 54658 _c("label", [_vm._v("Kodepos")]), 54659 _vm._v(" "), 54660 _c("input", { 54661 directives: [ 54662 { 54663 name: "model", 54664 rawName: "v-model", 54665 value: _vm.formData.office_zip_code, 54666 expression: "formData.office_zip_code", 54667 }, 54668 ], 54669 staticClass: "form-control", 54670 attrs: { type: "text", maxlength: "5" }, 54671 domProps: { value: _vm.formData.office_zip_code }, 54672 on: { 54673 input: function ($event) { 54674 if ($event.target.composing) { 54675 return 54676 } 54677 _vm.$set( 54678 _vm.formData, 54679 "office_zip_code", 54680 $event.target.value 54681 ) 54682 }, 54683 }, 54684 }), 54685 _vm._v(" "), 54686 _vm.errors.office_zip_code 54687 ? _c( 54688 "div", 54689 { staticClass: "invalid-feedback d-block" }, 54690 [ 54691 _vm._v( 54692 "\n " + 54693 _vm._s(_vm.errors.office_zip_code[0]) + 54694 "\n " 54695 ), 54696 ] 54697 ) 54698 : _vm._e(), 54699 ]), 54700 _vm._v(" "), 54701 _c("div", { staticClass: "form-group" }, [ 54702 _c("label", [_vm._v("No Telephone")]), 54703 _vm._v(" "), 54704 _c("input", { 54705 directives: [ 54706 { 54707 name: "model", 54708 rawName: "v-model", 54709 value: _vm.formData.telephone, 54710 expression: "formData.telephone", 54711 }, 54712 ], 54713 staticClass: "form-control", 54714 attrs: { type: "text" }, 54715 domProps: { value: _vm.formData.telephone }, 54716 on: { 54717 input: function ($event) { 54718 if ($event.target.composing) { 54719 return 54720 } 54721 _vm.$set( 54722 _vm.formData, 54723 "telephone", 54724 $event.target.value 54725 ) 54726 }, 54727 }, 54728 }), 54729 _vm._v(" "), 54730 _vm.errors.telephone 54731 ? _c( 54732 "div", 54733 { staticClass: "invalid-feedback d-block" }, 54734 [ 54735 _vm._v( 54736 "\n " + 54737 _vm._s(_vm.errors.telephone[0]) + 54738 "\n " 54739 ), 54740 ] 54741 ) 54742 : _vm._e(), 54743 ]), 54744 _vm._v(" "), 54745 _c("div", { staticClass: "form-group" }, [ 54746 _c("label", [_vm._v("No Fax")]), 54747 _vm._v(" "), 54748 _c("input", { 54749 directives: [ 54750 { 54751 name: "model", 54752 rawName: "v-model", 54753 value: _vm.formData.office_fax, 54754 expression: "formData.office_fax", 54755 }, 54756 ], 54757 staticClass: "form-control", 54758 attrs: { type: "text" }, 54759 domProps: { value: _vm.formData.office_fax }, 54760 on: { 54761 input: function ($event) { 54762 if ($event.target.composing) { 54763 return 54764 } 54765 _vm.$set( 54766 _vm.formData, 54767 "office_fax", 54768 $event.target.value 54769 ) 54770 }, 54771 }, 54772 }), 54773 _vm._v(" "), 54774 _vm.errors.office_fax 54775 ? _c( 54776 "div", 54777 { staticClass: "invalid-feedback d-block" }, 54778 [ 54779 _vm._v( 54780 "\n " + 54781 _vm._s(_vm.errors.office_fax[0]) + 54782 "\n " 54783 ), 54784 ] 54785 ) 54786 : _vm._e(), 54787 ]), 54788 _vm._v(" "), 54789 _c("div", { staticClass: "form-group" }, [ 54790 _vm._m(8), 54791 _vm._v(" "), 54792 _c("input", { 54793 directives: [ 54794 { 54795 name: "model", 54796 rawName: "v-model", 54797 value: _vm.formData.office_email, 54798 expression: "formData.office_email", 54799 }, 54800 ], 54801 staticClass: "form-control", 54802 attrs: { type: "email" }, 54803 domProps: { value: _vm.formData.office_email }, 54804 on: { 54805 input: function ($event) { 54806 if ($event.target.composing) { 54807 return 54808 } 54809 _vm.$set( 54810 _vm.formData, 54811 "office_email", 54812 $event.target.value 54813 ) 54814 }, 54815 }, 54816 }), 54817 _vm._v(" "), 54818 _vm.errors.office_email 54819 ? _c( 54820 "div", 54821 { staticClass: "invalid-feedback d-block" }, 54822 [ 54823 _vm._v( 54824 "\n " + 54825 _vm._s(_vm.errors.office_email[0]) + 54826 "\n " 54827 ), 54828 ] 54829 ) 54830 : _vm._e(), 54831 ]), 54832 ], 54833 _vm._v(" "), 54834 _c("div", { staticClass: "form-group" }, [ 54835 _vm._m(9), 54836 _vm._v(" "), 54837 _c("input", { 54838 directives: [ 54839 { 54840 name: "model", 54841 rawName: "v-model", 54842 value: _vm.formData.heir_name, 54843 expression: "formData.heir_name", 54844 }, 54845 ], 54846 staticClass: "form-control", 54847 attrs: { type: "text" }, 54848 domProps: { value: _vm.formData.heir_name }, 54849 on: { 54850 input: function ($event) { 54851 if ($event.target.composing) { 54852 return 54853 } 54854 _vm.$set( 54855 _vm.formData, 54856 "heir_name", 54857 $event.target.value 54858 ) 54859 }, 54860 }, 54861 }), 54862 _vm._v(" "), 54863 _vm.errors.heir_name 54864 ? _c( 54865 "div", 54866 { staticClass: "invalid-feedback d-block" }, 54867 [ 54868 _vm._v( 54869 "\n " + 54870 _vm._s(_vm.errors.heir_name[0]) + 54871 "\n " 54872 ), 54873 ] 54874 ) 54875 : _vm._e(), 54876 ]), 54877 _vm._v(" "), 54878 _c("div", { staticClass: "form-check form-check-inline" }, [ 54879 _c("input", { 54880 directives: [ 54881 { 54882 name: "model", 54883 rawName: "v-model", 54884 value: _vm.formData.heir_gender, 54885 expression: "formData.heir_gender", 54886 }, 54887 ], 54888 staticClass: "form-check-input", 54889 attrs: { type: "radio", value: "Laki-Laki" }, 54890 domProps: { 54891 checked: _vm._q( 54892 _vm.formData.heir_gender, 54893 "Laki-Laki" 54894 ), 54895 }, 54896 on: { 54897 change: function ($event) { 54898 return _vm.$set( 54899 _vm.formData, 54900 "heir_gender", 54901 "Laki-Laki" 54902 ) 54903 }, 54904 }, 54905 }), 54906 _vm._v(" "), 54907 _c("label", { staticClass: "form-check-label" }, [ 54908 _vm._v("Laki-Laki"), 54909 ]), 54910 ]), 54911 _vm._v(" "), 54912 _c("div", { staticClass: "form-check form-check-inline" }, [ 54913 _c("input", { 54914 directives: [ 54915 { 54916 name: "model", 54917 rawName: "v-model", 54918 value: _vm.formData.heir_gender, 54919 expression: "formData.heir_gender", 54920 }, 54921 ], 54922 staticClass: "form-check-input", 54923 attrs: { type: "radio", value: "Perempuan" }, 54924 domProps: { 54925 checked: _vm._q( 54926 _vm.formData.heir_gender, 54927 "Perempuan" 54928 ), 54929 }, 54930 on: { 54931 change: function ($event) { 54932 return _vm.$set( 54933 _vm.formData, 54934 "heir_gender", 54935 "Perempuan" 54936 ) 54937 }, 54938 }, 54939 }), 54940 _vm._v(" "), 54941 _c("label", { staticClass: "form-check-label" }, [ 54942 _vm._v("Perempuan"), 54943 ]), 54944 ]), 54945 _vm._v(" "), 54946 _c( 54947 "div", 54948 { staticClass: "form-group" }, 54949 [ 54950 _c("label", [_vm._v("Tanggal Lahir Pewaris")]), 54951 _vm._v(" "), 54952 _c("datetime", { 54953 staticClass: "flatpickr form-control", 54954 class: { "is-invalid": _vm.errors.heir_birth_date }, 54955 attrs: { 54956 config: _vm.datePickerConfig, 54957 id: "heir_birth_date", 54958 name: "heir_birth_date", 54959 placeholder: "Heir Birth Date", 54960 }, 54961 model: { 54962 value: _vm.formData.heir_birth_date, 54963 callback: function ($$v) { 54964 _vm.$set(_vm.formData, "heir_birth_date", $$v) 54965 }, 54966 expression: "formData.heir_birth_date", 54967 }, 54968 }), 54969 _vm._v(" "), 54970 _vm.errors.heir_birth_date 54971 ? _c( 54972 "small", 54973 { staticClass: "form-text text-danger" }, 54974 [_vm._v(_vm._s(_vm.errors.heir_birth_date[0]))] 54975 ) 54976 : _vm._e(), 54977 ], 54978 1 54979 ), 54980 _vm._v(" "), 54981 _c( 54982 "div", 54983 { staticClass: "form-group" }, 54984 [ 54985 _c("label", [_vm._v("Cakupan")]), 54986 _vm._v(" "), 54987 _c("v-select", { 54988 attrs: { options: _vm.optionCoverages }, 54989 model: { 54990 value: _vm.formData.coverage, 54991 callback: function ($$v) { 54992 _vm.$set(_vm.formData, "coverage", $$v) 54993 }, 54994 expression: "formData.coverage", 54995 }, 54996 }), 54997 _vm._v(" "), 54998 _vm.errors.coverage 54999 ? _c( 55000 "div", 55001 { staticClass: "invalid-feedback d-block" }, 55002 [ 55003 _vm._v( 55004 "\n " + 55005 _vm._s(_vm.errors.coverage[0]) + 55006 "\n " 55007 ), 55008 ] 55009 ) 55010 : _vm._e(), 55011 ], 55012 1 55013 ), 55014 _vm._v(" "), 55015 _c("div", { staticClass: "form-check form-check-inline" }, [ 55016 _c("input", { 55017 directives: [ 55018 { 55019 name: "model", 55020 rawName: "v-model", 55021 value: _vm.formData.club, 55022 expression: "formData.club", 55023 }, 55024 ], 55025 staticClass: "form-check-input", 55026 attrs: { type: "radio", value: "1" }, 55027 domProps: { checked: _vm._q(_vm.formData.club, "1") }, 55028 on: { 55029 change: function ($event) { 55030 return _vm.$set(_vm.formData, "club", "1") 55031 }, 55032 }, 55033 }), 55034 _vm._v(" "), 55035 _c("label", { staticClass: "form-check-label" }, [ 55036 _vm._v("Club"), 55037 ]), 55038 ]), 55039 _vm._v(" "), 55040 _c("div", { staticClass: "form-check form-check-inline" }, [ 55041 _c("input", { 55042 directives: [ 55043 { 55044 name: "model", 55045 rawName: "v-model", 55046 value: _vm.formData.club, 55047 expression: "formData.club", 55048 }, 55049 ], 55050 staticClass: "form-check-input", 55051 attrs: { type: "radio", value: "2" }, 55052 domProps: { checked: _vm._q(_vm.formData.club, "2") }, 55053 on: { 55054 change: function ($event) { 55055 return _vm.$set(_vm.formData, "club", "2") 55056 }, 55057 }, 55058 }), 55059 _vm._v(" "), 55060 _c("label", { staticClass: "form-check-label" }, [ 55061 _vm._v("Non Club"), 55062 ]), 55063 ]), 55064 _vm._v(" "), 55065 _c( 55066 "div", 55067 { staticClass: "form-group" }, 55068 [ 55069 _c("label", [_vm._v("Warna Sepeda")]), 55070 _vm._v(" "), 55071 _c( 55072 "v-select", 55073 { 55074 attrs: { 55075 filterable: false, 55076 options: _vm.optionColors, 55077 }, 55078 on: { search: _vm.getOptionColors }, 55079 model: { 55080 value: _vm.formData.color, 55081 callback: function ($$v) { 55082 _vm.$set(_vm.formData, "color", $$v) 55083 }, 55084 expression: "formData.color", 55085 }, 55086 }, 55087 [ 55088 _c("template", { slot: "no-options" }, [ 55089 _vm._v( 55090 "\n type to search colors...\n " 55091 ), 55092 ]), 55093 ], 55094 2 55095 ), 55096 _vm._v(" "), 55097 _c("div", { staticClass: "valid-feedback d-block" }, [ 55098 _vm._v( 55099 "\n Please type for searching color. Ex : KUNING, BLUE, MERAH, BLACK\n " 55100 ), 55101 ]), 55102 _vm._v(" "), 55103 _vm.errors.color 55104 ? _c( 55105 "div", 55106 { staticClass: "invalid-feedback d-block" }, 55107 [ 55108 _vm._v( 55109 "\n " + 55110 _vm._s(_vm.errors.color[0]) + 55111 "\n " 55112 ), 55113 ] 55114 ) 55115 : _vm._e(), 55116 ], 55117 1 55118 ), 55119 _vm._v(" "), 55120 _c("div", { staticClass: "row" }, [ 55121 _c("div", { staticClass: "col-md-8" }, [ 55122 _c( 55123 "div", 55124 { staticClass: "form-group" }, 55125 [ 55126 _c("label", [_vm._v("Tanggal Pembelian")]), 55127 _vm._v(" "), 55128 _c("datetime", { 55129 staticClass: "flatpickr form-control", 55130 class: { "is-invalid": _vm.errors.purchase_date }, 55131 attrs: { 55132 config: _vm.datetimePickerConfig, 55133 id: "purchase_date", 55134 name: "purchase_date", 55135 placeholder: "Purchase Date", 55136 }, 55137 model: { 55138 value: _vm.formData.purchase_date, 55139 callback: function ($$v) { 55140 _vm.$set(_vm.formData, "purchase_date", $$v) 55141 }, 55142 expression: "formData.purchase_date", 55143 }, 55144 }), 55145 _vm._v(" "), 55146 _vm.errors.purchase_date 55147 ? _c( 55148 "small", 55149 { staticClass: "form-text text-danger" }, 55150 [_vm._v(_vm._s(_vm.errors.purchase_date[0]))] 55151 ) 55152 : _vm._e(), 55153 ], 55154 1 55155 ), 55156 ]), 55157 _vm._v(" "), 55158 _c("div", { staticClass: "col-md-4" }, [ 55159 _c("div", { staticClass: "form-group" }, [ 55160 _c("label", [_vm._v("Tahun Pembelian")]), 55161 _vm._v(" "), 55162 _c("input", { 55163 directives: [ 55164 { 55165 name: "model", 55166 rawName: "v-model", 55167 value: _vm.formData.year, 55168 expression: "formData.year", 55169 }, 55170 ], 55171 staticClass: "form-control", 55172 attrs: { type: "number" }, 55173 domProps: { value: _vm.formData.year }, 55174 on: { 55175 input: function ($event) { 55176 if ($event.target.composing) { 55177 return 55178 } 55179 _vm.$set( 55180 _vm.formData, 55181 "year", 55182 $event.target.value 55183 ) 55184 }, 55185 }, 55186 }), 55187 _vm._v(" "), 55188 _vm.errors.year 55189 ? _c( 55190 "div", 55191 { staticClass: "invalid-feedback d-block" }, 55192 [ 55193 _vm._v( 55194 "\n " + 55195 _vm._s(_vm.errors.year[0]) + 55196 "\n " 55197 ), 55198 ] 55199 ) 55200 : _vm._e(), 55201 ]), 55202 ]), 55203 ]), 55204 _vm._v(" "), 55205 _c("div", { staticClass: "form-group" }, [ 55206 _c("label", [_vm._v("No Serial")]), 55207 _vm._v(" "), 55208 _c("input", { 55209 directives: [ 55210 { 55211 name: "model", 55212 rawName: "v-model", 55213 value: _vm.formData.serial_number, 55214 expression: "formData.serial_number", 55215 }, 55216 ], 55217 staticClass: "form-control", 55218 attrs: { type: "text" }, 55219 domProps: { value: _vm.formData.serial_number }, 55220 on: { 55221 input: function ($event) { 55222 if ($event.target.composing) { 55223 return 55224 } 55225 _vm.$set( 55226 _vm.formData, 55227 "serial_number", 55228 $event.target.value 55229 ) 55230 }, 55231 }, 55232 }), 55233 _vm._v(" "), 55234 _vm.errors.serial_number 55235 ? _c( 55236 "div", 55237 { staticClass: "invalid-feedback d-block" }, 55238 [ 55239 _vm._v( 55240 "\n " + 55241 _vm._s(_vm.errors.serial_number[0]) + 55242 "\n " 55243 ), 55244 ] 55245 ) 55246 : _vm._e(), 55247 ]), 55248 _vm._v(" "), 55249 _c("div", { staticClass: "form-group" }, [ 55250 _c("label", [_vm._v("No Garansi")]), 55251 _vm._v(" "), 55252 _c("input", { 55253 directives: [ 55254 { 55255 name: "model", 55256 rawName: "v-model", 55257 value: _vm.formData.warranty_number, 55258 expression: "formData.warranty_number", 55259 }, 55260 ], 55261 staticClass: "form-control", 55262 attrs: { type: "text" }, 55263 domProps: { value: _vm.formData.warranty_number }, 55264 on: { 55265 input: function ($event) { 55266 if ($event.target.composing) { 55267 return 55268 } 55269 _vm.$set( 55270 _vm.formData, 55271 "warranty_number", 55272 $event.target.value 55273 ) 55274 }, 55275 }, 55276 }), 55277 _vm._v(" "), 55278 _vm.errors.warranty_number 55279 ? _c( 55280 "div", 55281 { staticClass: "invalid-feedback d-block" }, 55282 [ 55283 _vm._v( 55284 "\n " + 55285 _vm._s(_vm.errors.warranty_number[0]) + 55286 "\n " 55287 ), 55288 ] 55289 ) 55290 : _vm._e(), 55291 ]), 55292 _vm._v(" "), 55293 _c("div", { staticClass: "form-group" }, [ 55294 _c("label", [_vm._v("No Registrasi")]), 55295 _vm._v(" "), 55296 _c("input", { 55297 directives: [ 55298 { 55299 name: "model", 55300 rawName: "v-model", 55301 value: _vm.formData.registration_number, 55302 expression: "formData.registration_number", 55303 }, 55304 ], 55305 staticClass: "form-control", 55306 attrs: { type: "text" }, 55307 domProps: { value: _vm.formData.registration_number }, 55308 on: { 55309 input: function ($event) { 55310 if ($event.target.composing) { 55311 return 55312 } 55313 _vm.$set( 55314 _vm.formData, 55315 "registration_number", 55316 $event.target.value 55317 ) 55318 }, 55319 }, 55320 }), 55321 _vm._v(" "), 55322 _vm.errors.registration_number 55323 ? _c( 55324 "div", 55325 { staticClass: "invalid-feedback d-block" }, 55326 [ 55327 _vm._v( 55328 "\n " + 55329 _vm._s(_vm.errors.registration_number[0]) + 55330 "\n " 55331 ), 55332 ] 55333 ) 55334 : _vm._e(), 55335 ]), 55336 _vm._v(" "), 55337 _c( 55338 "div", 55339 { staticClass: "form-group" }, 55340 [ 55341 _c("label", [_vm._v("Spesifikasi")]), 55342 _vm._v(" "), 55343 _c("v-select", { 55344 attrs: { 55345 options: _vm.optionSpecifications, 55346 reduce: function (text) { 55347 return text.value 55348 }, 55349 label: "text", 55350 }, 55351 model: { 55352 value: _vm.formData.specification, 55353 callback: function ($$v) { 55354 _vm.$set(_vm.formData, "specification", $$v) 55355 }, 55356 expression: "formData.specification", 55357 }, 55358 }), 55359 _vm._v(" "), 55360 _vm.errors.specification 55361 ? _c( 55362 "div", 55363 { staticClass: "invalid-feedback d-block" }, 55364 [ 55365 _vm._v( 55366 "\n " + 55367 _vm._s(_vm.errors.specification[0]) + 55368 "\n " 55369 ), 55370 ] 55371 ) 55372 : _vm._e(), 55373 ], 55374 1 55375 ), 55376 ], 55377 2 55378 ) 55379 : _vm._e(), 55380 _vm._v(" "), 55381 _vm.currentPage > 4 55382 ? _c("div", { staticClass: "step-5" }, [ 55383 _c("div", { staticClass: "text-center" }, [ 55384 _c("h4", [ 55385 _vm._v( 55386 "Success Published Policy " + 55387 _vm._s(_vm.formData.business_name) 55388 ), 55389 ]), 55390 ]), 55391 _vm._v(" "), 55392 _c("div", { staticClass: "form-group" }, [ 55393 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 55394 _vm._v(" "), 55395 _c("div", { staticClass: "input-group" }, [ 55396 _c("input", { 55397 directives: [ 55398 { 55399 name: "model", 55400 rawName: "v-model", 55401 value: _vm.formData.policy_number, 55402 expression: "formData.policy_number", 55403 }, 55404 ], 55405 staticClass: "form-control", 55406 attrs: { type: "text", readonly: "" }, 55407 domProps: { value: _vm.formData.policy_number }, 55408 on: { 55409 input: function ($event) { 55410 if ($event.target.composing) { 55411 return 55412 } 55413 _vm.$set( 55414 _vm.formData, 55415 "policy_number", 55416 $event.target.value 55417 ) 55418 }, 55419 }, 55420 }), 55421 _vm._v(" "), 55422 _c("div", { staticClass: "input-group-append" }, [ 55423 _c( 55424 "button", 55425 { 55426 staticClass: "btn btn-primary", 55427 attrs: { type: "button" }, 55428 on: { 55429 click: function ($event) { 55430 return _vm.copyData( 55431 _vm.formData.policy_number, 55432 "Policy Number" 55433 ) 55434 }, 55435 }, 55436 }, 55437 [_c("i", { staticClass: "fa fa-copy text-white" })] 55438 ), 55439 ]), 55440 ]), 55441 ]), 55442 _vm._v(" "), 55443 _c("div", { staticClass: "form-group" }, [ 55444 _c("label", [_vm._v("Premi")]), 55445 _vm._v(" "), 55446 _c("div", { staticClass: "input-group" }, [ 55447 _c("input", { 55448 directives: [ 55449 { 55450 name: "model", 55451 rawName: "v-model", 55452 value: _vm.formData.premium, 55453 expression: "formData.premium", 55454 }, 55455 ], 55456 staticClass: "form-control", 55457 attrs: { type: "text", readonly: "" }, 55458 domProps: { value: _vm.formData.premium }, 55459 on: { 55460 input: function ($event) { 55461 if ($event.target.composing) { 55462 return 55463 } 55464 _vm.$set( 55465 _vm.formData, 55466 "premium", 55467 $event.target.value 55468 ) 55469 }, 55470 }, 55471 }), 55472 _vm._v(" "), 55473 _c("div", { staticClass: "input-group-append" }, [ 55474 _c( 55475 "button", 55476 { 55477 staticClass: "btn btn-primary", 55478 attrs: { type: "button" }, 55479 on: { 55480 click: function ($event) { 55481 return _vm.copyData( 55482 _vm.formData.premium, 55483 "Premium" 55484 ) 55485 }, 55486 }, 55487 }, 55488 [_c("i", { staticClass: "fa fa-copy text-white" })] 55489 ), 55490 ]), 55491 ]), 55492 ]), 55493 _vm._v(" "), 55494 _c( 55495 "button", 55496 { 55497 staticClass: "btn btn-success btn-block", 55498 attrs: { type: "button", disabled: _vm.submitting }, 55499 on: { click: _vm.processPayment }, 55500 }, 55501 [_vm._v("BAYAR\n ")] 55502 ), 55503 ]) 55504 : _vm._e(), 55505 ]) 55506 : _c( 55507 "div", 55508 { staticClass: "card-body" }, 55509 [ 55510 _c( 55511 "content-placeholders", 55512 [ 55513 _c("content-placeholders-heading", { attrs: { img: true } }), 55514 _vm._v(" "), 55515 _c("content-placeholders-text", { attrs: { lines: 3 } }), 55516 ], 55517 1 55518 ), 55519 ], 55520 1 55521 ), 55522 _vm._v(" "), 55523 _c("div", { staticClass: "card-footer" }, [ 55524 _vm._m(10), 55525 _vm._v(" "), 55526 _c("div", { staticClass: "row" }, [ 55527 _vm.formData.step < 5 55528 ? _c("div", { staticClass: "col-sm-6" }, [ 55529 _vm.formData.step !== 2 || 55530 (_vm.formData.step === 2 && _vm.isValidPrice) 55531 ? _c( 55532 "button", 55533 { 55534 staticClass: "btn btn-primary", 55535 attrs: { type: "button", disabled: _vm.submitting }, 55536 on: { click: _vm.submitData }, 55537 }, 55538 [_vm._v("Submit\n ")] 55539 ) 55540 : _vm._e(), 55541 _vm._v(" "), 55542 _c( 55543 "button", 55544 { 55545 staticClass: "btn btn-warning", 55546 attrs: { type: "button" }, 55547 on: { click: _vm.resetData }, 55548 }, 55549 [_vm._v("Reset")] 55550 ), 55551 ]) 55552 : _vm._e(), 55553 _vm._v(" "), 55554 _c("div", { staticClass: "col ml-auto d-none" }, [ 55555 _c( 55556 "nav", 55557 { 55558 staticClass: "float-right", 55559 attrs: { "aria-label": "Page navigation example" }, 55560 }, 55561 [ 55562 _c( 55563 "ul", 55564 { staticClass: "pagination" }, 55565 [ 55566 _vm._l(4, function (p) { 55567 return [ 55568 _vm.currentPage === p 55569 ? _c( 55570 "li", 55571 { 55572 staticClass: "page-item active", 55573 attrs: { "aria-current": "page" }, 55574 }, 55575 [ 55576 _c( 55577 "a", 55578 { 55579 staticClass: "page-link", 55580 attrs: { href: "#" }, 55581 on: { 55582 click: function ($event) { 55583 return _vm.changePage(p) 55584 }, 55585 }, 55586 }, 55587 [_vm._v(_vm._s(p))] 55588 ), 55589 ] 55590 ) 55591 : _c( 55592 "li", 55593 { 55594 staticClass: "page-item", 55595 class: { disabled: p > _vm.formData.step }, 55596 }, 55597 [ 55598 _c( 55599 "a", 55600 { 55601 staticClass: "page-link", 55602 attrs: { href: "#" }, 55603 on: { 55604 click: function ($event) { 55605 return _vm.changePage(p) 55606 }, 55607 }, 55608 }, 55609 [_vm._v(_vm._s(p))] 55610 ), 55611 ] 55612 ), 55613 ] 55614 }), 55615 ], 55616 2 55617 ), 55618 ] 55619 ), 55620 ]), 55621 ]), 55622 ]), 55623 ] 55624 ) 55625} 55626var staticRenderFns = [ 55627 function () { 55628 var _vm = this 55629 var _h = _vm.$createElement 55630 var _c = _vm._self._c || _h 55631 return _c("div", { staticClass: "form-group" }, [ 55632 _c("h3", [_vm._v("Form Pembelian Simas Sepeda :")]), 55633 ]) 55634 }, 55635 function () { 55636 var _vm = this 55637 var _h = _vm.$createElement 55638 var _c = _vm._self._c || _h 55639 return _c("label", [ 55640 _vm._v("Nama Depan "), 55641 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 55642 ]) 55643 }, 55644 function () { 55645 var _vm = this 55646 var _h = _vm.$createElement 55647 var _c = _vm._self._c || _h 55648 return _c("label", [ 55649 _vm._v("No Handphone"), 55650 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 55651 ]) 55652 }, 55653 function () { 55654 var _vm = this 55655 var _h = _vm.$createElement 55656 var _c = _vm._self._c || _h 55657 return _c("label", [ 55658 _vm._v("Email"), 55659 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 55660 ]) 55661 }, 55662 function () { 55663 var _vm = this 55664 var _h = _vm.$createElement 55665 var _c = _vm._self._c || _h 55666 return _c("label", [ 55667 _vm._v("No KTP "), 55668 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 55669 ]) 55670 }, 55671 function () { 55672 var _vm = this 55673 var _h = _vm.$createElement 55674 var _c = _vm._self._c || _h 55675 return _c("label", [ 55676 _vm._v("Alamat Rumah "), 55677 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 55678 ]) 55679 }, 55680 function () { 55681 var _vm = this 55682 var _h = _vm.$createElement 55683 var _c = _vm._self._c || _h 55684 return _c("label", [ 55685 _vm._v("Perusahaan "), 55686 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 55687 ]) 55688 }, 55689 function () { 55690 var _vm = this 55691 var _h = _vm.$createElement 55692 var _c = _vm._self._c || _h 55693 return _c("label", [ 55694 _vm._v("Alamat "), 55695 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 55696 ]) 55697 }, 55698 function () { 55699 var _vm = this 55700 var _h = _vm.$createElement 55701 var _c = _vm._self._c || _h 55702 return _c("label", [ 55703 _vm._v("Alamat Email "), 55704 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 55705 ]) 55706 }, 55707 function () { 55708 var _vm = this 55709 var _h = _vm.$createElement 55710 var _c = _vm._self._c || _h 55711 return _c("label", [ 55712 _vm._v("Nama Pewaris"), 55713 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 55714 ]) 55715 }, 55716 function () { 55717 var _vm = this 55718 var _h = _vm.$createElement 55719 var _c = _vm._self._c || _h 55720 return _c("span", { staticClass: "text-danger" }, [ 55721 _c("em", [_vm._v("* Data wajib untuk diisi")]), 55722 ]) 55723 }, 55724] 55725render._withStripped = true 55726 55727 55728 55729/***/ }), 55730 55731/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=template&id=5f8809a3&": 55732/*!*****************************************************************************************************************************************************************************************************************************!*\ 55733 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=template&id=5f8809a3& ***! 55734 \*****************************************************************************************************************************************************************************************************************************/ 55735/*! exports provided: render, staticRenderFns */ 55736/***/ (function(module, __webpack_exports__, __webpack_require__) { 55737 55738"use strict"; 55739__webpack_require__.r(__webpack_exports__); 55740/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 55741/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 55742var render = function () { 55743 var _vm = this 55744 var _h = _vm.$createElement 55745 var _c = _vm._self._c || _h 55746 return _c("div", { staticClass: "card card-car card-product rounded-0" }, [ 55747 _c("div", { staticClass: "card-header x d-none" }, [ 55748 _c("h3", [_vm._v(_vm._s(_vm.formData.business_name) + " Insurance")]), 55749 ]), 55750 _vm._v(" "), 55751 !_vm.submitting 55752 ? _c("div", { staticClass: "card-body" }, [ 55753 _vm.currentPage === 1 55754 ? _c("div", { attrs: { id: "step-1" } }, [ 55755 _vm._m(0), 55756 _vm._v(" "), 55757 _c("div", { staticClass: "form-group" }, [ 55758 _vm._m(1), 55759 _vm._v(" "), 55760 _c("input", { 55761 directives: [ 55762 { 55763 name: "model", 55764 rawName: "v-model", 55765 value: _vm.formData.first_name, 55766 expression: "formData.first_name", 55767 }, 55768 ], 55769 staticClass: "form-control", 55770 attrs: { type: "text" }, 55771 domProps: { value: _vm.formData.first_name }, 55772 on: { 55773 input: function ($event) { 55774 if ($event.target.composing) { 55775 return 55776 } 55777 _vm.$set( 55778 _vm.formData, 55779 "first_name", 55780 $event.target.value 55781 ) 55782 }, 55783 }, 55784 }), 55785 _vm._v(" "), 55786 _vm.errors.first_name 55787 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 55788 _vm._v(_vm._s(_vm.errors.first_name[0])), 55789 ]) 55790 : _vm._e(), 55791 ]), 55792 _vm._v(" "), 55793 _c("div", { staticClass: "form-group" }, [ 55794 _c("label", [_vm._v("Nama Belakang")]), 55795 _vm._v(" "), 55796 _c("input", { 55797 directives: [ 55798 { 55799 name: "model", 55800 rawName: "v-model", 55801 value: _vm.formData.last_name, 55802 expression: "formData.last_name", 55803 }, 55804 ], 55805 staticClass: "form-control", 55806 attrs: { type: "text" }, 55807 domProps: { value: _vm.formData.last_name }, 55808 on: { 55809 input: function ($event) { 55810 if ($event.target.composing) { 55811 return 55812 } 55813 _vm.$set(_vm.formData, "last_name", $event.target.value) 55814 }, 55815 }, 55816 }), 55817 _vm._v(" "), 55818 _vm.errors.last_name 55819 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 55820 _vm._v(_vm._s(_vm.errors.last_name[0])), 55821 ]) 55822 : _vm._e(), 55823 ]), 55824 _vm._v(" "), 55825 _c("div", { staticClass: "form-check form-check-inline" }, [ 55826 _c("input", { 55827 directives: [ 55828 { 55829 name: "model", 55830 rawName: "v-model", 55831 value: _vm.formData.gender, 55832 expression: "formData.gender", 55833 }, 55834 ], 55835 staticClass: "form-check-input", 55836 attrs: { type: "radio", value: "1" }, 55837 domProps: { checked: _vm._q(_vm.formData.gender, "1") }, 55838 on: { 55839 change: function ($event) { 55840 return _vm.$set(_vm.formData, "gender", "1") 55841 }, 55842 }, 55843 }), 55844 _vm._v(" "), 55845 _c("label", { staticClass: "form-check-label" }, [ 55846 _vm._v("Laki-Laki"), 55847 ]), 55848 ]), 55849 _vm._v(" "), 55850 _c("div", { staticClass: "form-check form-check-inline" }, [ 55851 _c("input", { 55852 directives: [ 55853 { 55854 name: "model", 55855 rawName: "v-model", 55856 value: _vm.formData.gender, 55857 expression: "formData.gender", 55858 }, 55859 ], 55860 staticClass: "form-check-input", 55861 attrs: { type: "radio", value: "2" }, 55862 domProps: { checked: _vm._q(_vm.formData.gender, "2") }, 55863 on: { 55864 change: function ($event) { 55865 return _vm.$set(_vm.formData, "gender", "2") 55866 }, 55867 }, 55868 }), 55869 _vm._v(" "), 55870 _c("label", { staticClass: "form-check-label" }, [ 55871 _vm._v("Perempuan"), 55872 ]), 55873 ]), 55874 _vm._v(" "), 55875 _c("div", { staticClass: "form-group" }, [ 55876 _vm._m(2), 55877 _vm._v(" "), 55878 _c("input", { 55879 directives: [ 55880 { 55881 name: "model", 55882 rawName: "v-model", 55883 value: _vm.formData.hand_phone, 55884 expression: "formData.hand_phone", 55885 }, 55886 ], 55887 staticClass: "form-control", 55888 attrs: { type: "text" }, 55889 domProps: { value: _vm.formData.hand_phone }, 55890 on: { 55891 input: function ($event) { 55892 if ($event.target.composing) { 55893 return 55894 } 55895 _vm.$set( 55896 _vm.formData, 55897 "hand_phone", 55898 $event.target.value 55899 ) 55900 }, 55901 }, 55902 }), 55903 _vm._v(" "), 55904 _vm.errors.hand_phone 55905 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 55906 _vm._v( 55907 "\n " + 55908 _vm._s(_vm.errors.hand_phone[0]) + 55909 "\n " 55910 ), 55911 ]) 55912 : _vm._e(), 55913 ]), 55914 _vm._v(" "), 55915 _c("div", { staticClass: "form-group" }, [ 55916 _vm._m(3), 55917 _vm._v(" "), 55918 _c("input", { 55919 directives: [ 55920 { 55921 name: "model", 55922 rawName: "v-model", 55923 value: _vm.formData.email, 55924 expression: "formData.email", 55925 }, 55926 ], 55927 staticClass: "form-control", 55928 attrs: { type: "email" }, 55929 domProps: { value: _vm.formData.email }, 55930 on: { 55931 input: function ($event) { 55932 if ($event.target.composing) { 55933 return 55934 } 55935 _vm.$set(_vm.formData, "email", $event.target.value) 55936 }, 55937 }, 55938 }), 55939 _vm._v(" "), 55940 _vm.errors.email 55941 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 55942 _vm._v( 55943 "\n " + 55944 _vm._s(_vm.errors.email[0]) + 55945 "\n " 55946 ), 55947 ]) 55948 : _vm._e(), 55949 ]), 55950 ]) 55951 : _vm._e(), 55952 _vm._v(" "), 55953 _vm.currentPage === 2 55954 ? _c("div", { attrs: { id: "step-2" } }, [ 55955 _c("div", { staticClass: "row" }, [ 55956 _c("div", { staticClass: "col-md-6" }, [ 55957 _c("div", { staticClass: "form-group" }, [ 55958 _c("label", [_vm._v("Start Date")]), 55959 _vm._v(" "), 55960 _c("input", { 55961 directives: [ 55962 { 55963 name: "model", 55964 rawName: "v-model", 55965 value: _vm.formData.start_date, 55966 expression: "formData.start_date", 55967 }, 55968 ], 55969 staticClass: "form-control", 55970 attrs: { type: "text", readonly: "" }, 55971 domProps: { value: _vm.formData.start_date }, 55972 on: { 55973 input: function ($event) { 55974 if ($event.target.composing) { 55975 return 55976 } 55977 _vm.$set( 55978 _vm.formData, 55979 "start_date", 55980 $event.target.value 55981 ) 55982 }, 55983 }, 55984 }), 55985 _vm._v(" "), 55986 _vm.errors.start_date 55987 ? _c( 55988 "small", 55989 { staticClass: "form-text text-danger" }, 55990 [_vm._v(_vm._s(_vm.errors.start_date[0]))] 55991 ) 55992 : _vm._e(), 55993 ]), 55994 ]), 55995 _vm._v(" "), 55996 _c("div", { staticClass: "col-md-6" }, [ 55997 _c("div", { staticClass: "form-group" }, [ 55998 _c("label", [_vm._v("End Date")]), 55999 _vm._v(" "), 56000 _c("input", { 56001 directives: [ 56002 { 56003 name: "model", 56004 rawName: "v-model", 56005 value: _vm.formData.end_date, 56006 expression: "formData.end_date", 56007 }, 56008 ], 56009 staticClass: "form-control", 56010 attrs: { type: "text", readonly: "" }, 56011 domProps: { value: _vm.formData.end_date }, 56012 on: { 56013 input: function ($event) { 56014 if ($event.target.composing) { 56015 return 56016 } 56017 _vm.$set( 56018 _vm.formData, 56019 "end_date", 56020 $event.target.value 56021 ) 56022 }, 56023 }, 56024 }), 56025 _vm._v(" "), 56026 _vm.errors.end_date 56027 ? _c( 56028 "small", 56029 { staticClass: "form-text text-danger" }, 56030 [_vm._v(_vm._s(_vm.errors.end_date[0]))] 56031 ) 56032 : _vm._e(), 56033 ]), 56034 ]), 56035 ]), 56036 _vm._v(" "), 56037 _c( 56038 "div", 56039 { staticClass: "form-group" }, 56040 [ 56041 _c("label", [_vm._v("Paket")]), 56042 _vm._v(" "), 56043 _vm.formData.business_name === "MBU" 56044 ? [ 56045 _c("v-select", { 56046 attrs: { 56047 options: _vm.optionPackets, 56048 reduce: function (text) { 56049 return text.value 56050 }, 56051 label: "text", 56052 }, 56053 model: { 56054 value: _vm.formData.type_of_packet, 56055 callback: function ($$v) { 56056 _vm.$set(_vm.formData, "type_of_packet", $$v) 56057 }, 56058 expression: "formData.type_of_packet", 56059 }, 56060 }), 56061 ] 56062 : [ 56063 _c("input", { 56064 directives: [ 56065 { 56066 name: "model", 56067 rawName: "v-model", 56068 value: _vm.type_of_packet, 56069 expression: "type_of_packet", 56070 }, 56071 ], 56072 attrs: { type: "text", readonly: "" }, 56073 domProps: { value: _vm.type_of_packet }, 56074 on: { 56075 input: function ($event) { 56076 if ($event.target.composing) { 56077 return 56078 } 56079 _vm.type_of_packet = $event.target.value 56080 }, 56081 }, 56082 }), 56083 ], 56084 _vm._v(" "), 56085 _vm.errors.type_of_packet 56086 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56087 _vm._v( 56088 "\n " + 56089 _vm._s(_vm.errors.type_of_packet[0]) + 56090 "\n " 56091 ), 56092 ]) 56093 : _vm._e(), 56094 ], 56095 2 56096 ), 56097 _vm._v(" "), 56098 _c( 56099 "div", 56100 { staticClass: "form-group" }, 56101 [ 56102 _c("label", [_vm._v("Okupasi")]), 56103 _vm._v(" "), 56104 _c("v-select", { 56105 attrs: { options: _vm.optionOccupations }, 56106 model: { 56107 value: _vm.formData.occupation_name, 56108 callback: function ($$v) { 56109 _vm.$set(_vm.formData, "occupation_name", $$v) 56110 }, 56111 expression: "formData.occupation_name", 56112 }, 56113 }), 56114 _vm._v(" "), 56115 _vm.errors.occupation_name 56116 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56117 _vm._v( 56118 "\n " + 56119 _vm._s(_vm.errors.occupation_name[0]) + 56120 "\n " 56121 ), 56122 ]) 56123 : _vm._e(), 56124 ], 56125 1 56126 ), 56127 _vm._v(" "), 56128 _c( 56129 "div", 56130 { staticClass: "form-group" }, 56131 [ 56132 _c("label", [_vm._v("Coverage")]), 56133 _vm._v(" "), 56134 _c("v-select", { 56135 attrs: { options: _vm.optionCoverages }, 56136 model: { 56137 value: _vm.formData.coverage, 56138 callback: function ($$v) { 56139 _vm.$set(_vm.formData, "coverage", $$v) 56140 }, 56141 expression: "formData.coverage", 56142 }, 56143 }), 56144 _vm._v(" "), 56145 _vm.errors.coverage 56146 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56147 _vm._v( 56148 "\n " + 56149 _vm._s(_vm.errors.coverage[0]) + 56150 "\n " 56151 ), 56152 ]) 56153 : _vm._e(), 56154 ], 56155 1 56156 ), 56157 _vm._v(" "), 56158 _c( 56159 "div", 56160 { staticClass: "form-group" }, 56161 [ 56162 _c("label", [_vm._v("Merek Kendaraan")]), 56163 _vm._v(" "), 56164 _c( 56165 "v-select", 56166 { 56167 attrs: { filterable: false, options: _vm.optionBrands }, 56168 on: { 56169 search: _vm.getOptionBrands, 56170 input: _vm.changeBrand, 56171 }, 56172 model: { 56173 value: _vm.formData.brand_name, 56174 callback: function ($$v) { 56175 _vm.$set(_vm.formData, "brand_name", $$v) 56176 }, 56177 expression: "formData.brand_name", 56178 }, 56179 }, 56180 [ 56181 _c("template", { slot: "no-options" }, [ 56182 _vm._v( 56183 "\n type to search brand...\n " 56184 ), 56185 ]), 56186 ], 56187 2 56188 ), 56189 _vm._v(" "), 56190 _c("div", { staticClass: "valid-feedback d-block" }, [ 56191 _vm._v( 56192 "\n Please type for searching brand. Ex : HONDA, SUZUKI, BMW\n " 56193 ), 56194 ]), 56195 _vm._v(" "), 56196 _vm.errors.brand_name 56197 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56198 _vm._v( 56199 "\n " + 56200 _vm._s(_vm.errors.brand_name[0]) + 56201 "\n " 56202 ), 56203 ]) 56204 : _vm._e(), 56205 ], 56206 1 56207 ), 56208 _vm._v(" "), 56209 _c( 56210 "div", 56211 { staticClass: "form-group" }, 56212 [ 56213 _c("label", [_vm._v("Model Kendaraan")]), 56214 _vm._v(" "), 56215 _c("v-select", { 56216 attrs: { options: _vm.optionTypes }, 56217 model: { 56218 value: _vm.formData.type_name, 56219 callback: function ($$v) { 56220 _vm.$set(_vm.formData, "type_name", $$v) 56221 }, 56222 expression: "formData.type_name", 56223 }, 56224 }), 56225 _vm._v(" "), 56226 _vm.errors.type_name 56227 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56228 _vm._v( 56229 "\n " + 56230 _vm._s(_vm.errors.type_name[0]) + 56231 "\n " 56232 ), 56233 ]) 56234 : _vm._e(), 56235 ], 56236 1 56237 ), 56238 _vm._v(" "), 56239 _c("div", { staticClass: "form-group" }, [ 56240 _c("label", [_vm._v("Plat No")]), 56241 _vm._v(" "), 56242 _c("input", { 56243 directives: [ 56244 { 56245 name: "model", 56246 rawName: "v-model", 56247 value: _vm.formData.licence_plate, 56248 expression: "formData.licence_plate", 56249 }, 56250 ], 56251 staticClass: "form-control", 56252 attrs: { type: "text" }, 56253 domProps: { value: _vm.formData.licence_plate }, 56254 on: { 56255 input: function ($event) { 56256 if ($event.target.composing) { 56257 return 56258 } 56259 _vm.$set( 56260 _vm.formData, 56261 "licence_plate", 56262 $event.target.value 56263 ) 56264 }, 56265 }, 56266 }), 56267 _vm._v(" "), 56268 _vm.errors.licence_plate 56269 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56270 _vm._v( 56271 "\n " + 56272 _vm._s(_vm.errors.licence_plate[0]) + 56273 "\n " 56274 ), 56275 ]) 56276 : _vm._e(), 56277 ]), 56278 _vm._v(" "), 56279 _c( 56280 "div", 56281 { staticClass: "form-group" }, 56282 [ 56283 _c("label", [_vm._v("Tahun")]), 56284 _vm._v(" "), 56285 _c("v-select", { 56286 attrs: { options: _vm.listYears }, 56287 model: { 56288 value: _vm.formData.manufacture_year, 56289 callback: function ($$v) { 56290 _vm.$set(_vm.formData, "manufacture_year", $$v) 56291 }, 56292 expression: "formData.manufacture_year", 56293 }, 56294 }), 56295 _vm._v(" "), 56296 _vm.errors.manufacture_year 56297 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56298 _vm._v( 56299 "\n " + 56300 _vm._s(_vm.errors.manufacture_year[0]) + 56301 "\n " 56302 ), 56303 ]) 56304 : _vm._e(), 56305 ], 56306 1 56307 ), 56308 _vm._v(" "), 56309 _c("div", { staticClass: "form-group" }, [ 56310 _c("label", [_vm._v("Harga Kendaraan")]), 56311 _vm._v(" "), 56312 _c("input", { 56313 directives: [ 56314 { 56315 name: "model", 56316 rawName: "v-model", 56317 value: _vm.formData.tsi, 56318 expression: "formData.tsi", 56319 }, 56320 ], 56321 staticClass: "form-control", 56322 attrs: { type: "number" }, 56323 domProps: { value: _vm.formData.tsi }, 56324 on: { 56325 input: function ($event) { 56326 if ($event.target.composing) { 56327 return 56328 } 56329 _vm.$set(_vm.formData, "tsi", $event.target.value) 56330 }, 56331 }, 56332 }), 56333 _vm._v(" "), 56334 _vm.errors.tsi 56335 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56336 _vm._v( 56337 "\n " + 56338 _vm._s(_vm.errors.tsi[0]) + 56339 "\n " 56340 ), 56341 ]) 56342 : _vm._e(), 56343 ]), 56344 ]) 56345 : _vm._e(), 56346 _vm._v(" "), 56347 _vm.currentPage === 3 56348 ? _c("div", { staticClass: "step-3" }, [ 56349 _c("div", { staticClass: "form-group" }, [ 56350 _c("label", [_vm._v("Jumlah Pembayaran")]), 56351 _vm._v(" "), 56352 _c("div", { staticClass: "input-group" }, [ 56353 _c("input", { 56354 directives: [ 56355 { 56356 name: "model", 56357 rawName: "v-model", 56358 value: _vm.formData.payment_total, 56359 expression: "formData.payment_total", 56360 }, 56361 ], 56362 staticClass: "form-control", 56363 attrs: { type: "text", readonly: "" }, 56364 domProps: { value: _vm.formData.payment_total }, 56365 on: { 56366 input: function ($event) { 56367 if ($event.target.composing) { 56368 return 56369 } 56370 _vm.$set( 56371 _vm.formData, 56372 "payment_total", 56373 $event.target.value 56374 ) 56375 }, 56376 }, 56377 }), 56378 _vm._v(" "), 56379 _c("div", { staticClass: "input-group-append" }, [ 56380 _c( 56381 "button", 56382 { 56383 staticClass: "btn btn-primary", 56384 attrs: { type: "button" }, 56385 on: { 56386 click: function ($event) { 56387 return _vm.copyData(_vm.formData.payment_total) 56388 }, 56389 }, 56390 }, 56391 [_c("i", { staticClass: "fa fa-copy text-white" })] 56392 ), 56393 ]), 56394 ]), 56395 ]), 56396 _vm._v(" "), 56397 _vm.formData.policy_number === "" 56398 ? _c("div", { staticClass: "form-check" }, [ 56399 _c("input", { 56400 directives: [ 56401 { 56402 name: "model", 56403 rawName: "v-model", 56404 value: _vm.isAgreement, 56405 expression: "isAgreement", 56406 }, 56407 ], 56408 staticClass: "form-check-input", 56409 attrs: { type: "checkbox", id: "agreement" }, 56410 domProps: { 56411 checked: Array.isArray(_vm.isAgreement) 56412 ? _vm._i(_vm.isAgreement, null) > -1 56413 : _vm.isAgreement, 56414 }, 56415 on: { 56416 change: function ($event) { 56417 var $$a = _vm.isAgreement, 56418 $$el = $event.target, 56419 $$c = $$el.checked ? true : false 56420 if (Array.isArray($$a)) { 56421 var $$v = null, 56422 $$i = _vm._i($$a, $$v) 56423 if ($$el.checked) { 56424 $$i < 0 && (_vm.isAgreement = $$a.concat([$$v])) 56425 } else { 56426 $$i > -1 && 56427 (_vm.isAgreement = $$a 56428 .slice(0, $$i) 56429 .concat($$a.slice($$i + 1))) 56430 } 56431 } else { 56432 _vm.isAgreement = $$c 56433 } 56434 }, 56435 }, 56436 }), 56437 _vm._v(" "), 56438 _c( 56439 "label", 56440 { 56441 staticClass: "form-check-label", 56442 attrs: { for: "agreement" }, 56443 }, 56444 [ 56445 _vm._v( 56446 "\n I agree to issue a policy ( Saya setuju untuk menerbitkan polis ).\n " 56447 ), 56448 ] 56449 ), 56450 ]) 56451 : _vm._e(), 56452 ]) 56453 : _vm._e(), 56454 _vm._v(" "), 56455 _vm.currentPage === 4 56456 ? _c( 56457 "div", 56458 { staticClass: "step-4" }, 56459 [ 56460 _c("div", { staticClass: "form-group" }, [ 56461 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 56462 _vm._v(" "), 56463 _c("div", { staticClass: "input-group" }, [ 56464 _c("input", { 56465 directives: [ 56466 { 56467 name: "model", 56468 rawName: "v-model", 56469 value: _vm.formData.policy_number, 56470 expression: "formData.policy_number", 56471 }, 56472 ], 56473 staticClass: "form-control", 56474 attrs: { type: "text", readonly: "" }, 56475 domProps: { value: _vm.formData.policy_number }, 56476 on: { 56477 input: function ($event) { 56478 if ($event.target.composing) { 56479 return 56480 } 56481 _vm.$set( 56482 _vm.formData, 56483 "policy_number", 56484 $event.target.value 56485 ) 56486 }, 56487 }, 56488 }), 56489 _vm._v(" "), 56490 _c("div", { staticClass: "input-group-append" }, [ 56491 _c( 56492 "button", 56493 { 56494 staticClass: "btn btn-primary", 56495 attrs: { type: "button" }, 56496 on: { 56497 click: function ($event) { 56498 return _vm.copyData( 56499 _vm.formData.policy_number, 56500 "Policy Number" 56501 ) 56502 }, 56503 }, 56504 }, 56505 [_c("i", { staticClass: "fa fa-copy text-white" })] 56506 ), 56507 ]), 56508 _vm._v(" "), 56509 _c("div", { staticClass: "valid-feedback d-block" }, [ 56510 _vm._v( 56511 "The policy has been successfully issued, you can complete\n other data.\n " 56512 ), 56513 ]), 56514 ]), 56515 ]), 56516 _vm._v(" "), 56517 _c("div", { staticClass: "form-group" }, [ 56518 _vm._m(4), 56519 _vm._v(" "), 56520 _c("input", { 56521 directives: [ 56522 { 56523 name: "model", 56524 rawName: "v-model", 56525 value: _vm.formData.id_card, 56526 expression: "formData.id_card", 56527 }, 56528 ], 56529 staticClass: "form-control", 56530 attrs: { type: "text" }, 56531 domProps: { value: _vm.formData.id_card }, 56532 on: { 56533 input: function ($event) { 56534 if ($event.target.composing) { 56535 return 56536 } 56537 _vm.$set(_vm.formData, "id_card", $event.target.value) 56538 }, 56539 }, 56540 }), 56541 _vm._v(" "), 56542 _vm.errors.id_card 56543 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 56544 _vm._v( 56545 "\n " + 56546 _vm._s(_vm.errors.id_card[0]) + 56547 "\n " 56548 ), 56549 ]) 56550 : _vm._e(), 56551 ]), 56552 _vm._v(" "), 56553 _vm.formData.customer_type === "bisnis" 56554 ? _c("div", { staticClass: "form-group" }, [ 56555 _c("label", [_vm._v("No NPWP")]), 56556 _vm._v(" "), 56557 _c("input", { 56558 directives: [ 56559 { 56560 name: "model", 56561 rawName: "v-model", 56562 value: _vm.formData.npwp, 56563 expression: "formData.npwp", 56564 }, 56565 ], 56566 staticClass: "form-control", 56567 attrs: { type: "text" }, 56568 domProps: { value: _vm.formData.npwp }, 56569 on: { 56570 input: function ($event) { 56571 if ($event.target.composing) { 56572 return 56573 } 56574 _vm.$set( 56575 _vm.formData, 56576 "npwp", 56577 $event.target.value 56578 ) 56579 }, 56580 }, 56581 }), 56582 _vm._v(" "), 56583 _vm.errors.npwp 56584 ? _c( 56585 "div", 56586 { staticClass: "invalid-feedback d-block" }, 56587 [ 56588 _vm._v( 56589 "\n " + 56590 _vm._s(_vm.errors.npwp[0]) + 56591 "\n " 56592 ), 56593 ] 56594 ) 56595 : _vm._e(), 56596 ]) 56597 : _vm._e(), 56598 _vm._v(" "), 56599 _vm.formData.customer_type === "personal" 56600 ? [ 56601 _c("div", { staticClass: "form-group" }, [ 56602 _vm._m(5), 56603 _vm._v(" "), 56604 _c("textarea", { 56605 directives: [ 56606 { 56607 name: "model", 56608 rawName: "v-model", 56609 value: _vm.formData.address, 56610 expression: "formData.address", 56611 }, 56612 ], 56613 staticClass: "form-control form-control-plaintext", 56614 domProps: { value: _vm.formData.address }, 56615 on: { 56616 input: function ($event) { 56617 if ($event.target.composing) { 56618 return 56619 } 56620 _vm.$set( 56621 _vm.formData, 56622 "address", 56623 $event.target.value 56624 ) 56625 }, 56626 }, 56627 }), 56628 _vm._v(" "), 56629 _vm.errors.address 56630 ? _c( 56631 "div", 56632 { staticClass: "invalid-feedback d-block" }, 56633 [ 56634 _vm._v( 56635 "\n " + 56636 _vm._s(_vm.errors.address[0]) + 56637 "\n " 56638 ), 56639 ] 56640 ) 56641 : _vm._e(), 56642 ]), 56643 _vm._v(" "), 56644 _c("div", { staticClass: "form-group" }, [ 56645 _c("label", [_vm._v("Kodepos")]), 56646 _vm._v(" "), 56647 _c("input", { 56648 directives: [ 56649 { 56650 name: "model", 56651 rawName: "v-model", 56652 value: _vm.formData.zip_code, 56653 expression: "formData.zip_code", 56654 }, 56655 ], 56656 staticClass: "form-control", 56657 attrs: { type: "text", maxlength: "5" }, 56658 domProps: { value: _vm.formData.zip_code }, 56659 on: { 56660 input: function ($event) { 56661 if ($event.target.composing) { 56662 return 56663 } 56664 _vm.$set( 56665 _vm.formData, 56666 "zip_code", 56667 $event.target.value 56668 ) 56669 }, 56670 }, 56671 }), 56672 _vm._v(" "), 56673 _vm.errors.zip_code 56674 ? _c( 56675 "div", 56676 { staticClass: "invalid-feedback d-block" }, 56677 [ 56678 _vm._v( 56679 "\n " + 56680 _vm._s(_vm.errors.zip_code[0]) + 56681 "\n " 56682 ), 56683 ] 56684 ) 56685 : _vm._e(), 56686 ]), 56687 ] 56688 : [ 56689 _c("div", { staticClass: "form-group" }, [ 56690 _vm._m(6), 56691 _vm._v(" "), 56692 _c("input", { 56693 directives: [ 56694 { 56695 name: "model", 56696 rawName: "v-model", 56697 value: _vm.formData.company, 56698 expression: "formData.company", 56699 }, 56700 ], 56701 staticClass: "form-control", 56702 attrs: { type: "text" }, 56703 domProps: { value: _vm.formData.company }, 56704 on: { 56705 input: function ($event) { 56706 if ($event.target.composing) { 56707 return 56708 } 56709 _vm.$set( 56710 _vm.formData, 56711 "company", 56712 $event.target.value 56713 ) 56714 }, 56715 }, 56716 }), 56717 _vm._v(" "), 56718 _vm.errors.company 56719 ? _c( 56720 "div", 56721 { staticClass: "invalid-feedback d-block" }, 56722 [ 56723 _vm._v( 56724 "\n " + 56725 _vm._s(_vm.errors.company[0]) + 56726 "\n " 56727 ), 56728 ] 56729 ) 56730 : _vm._e(), 56731 ]), 56732 _vm._v(" "), 56733 _c("div", { staticClass: "form-group" }, [ 56734 _vm._m(7), 56735 _vm._v(" "), 56736 _c("textarea", { 56737 directives: [ 56738 { 56739 name: "model", 56740 rawName: "v-model", 56741 value: _vm.formData.office_address, 56742 expression: "formData.office_address", 56743 }, 56744 ], 56745 staticClass: "form-control form-control-plaintext", 56746 domProps: { value: _vm.formData.office_address }, 56747 on: { 56748 input: function ($event) { 56749 if ($event.target.composing) { 56750 return 56751 } 56752 _vm.$set( 56753 _vm.formData, 56754 "office_address", 56755 $event.target.value 56756 ) 56757 }, 56758 }, 56759 }), 56760 _vm._v(" "), 56761 _vm.errors.office_address 56762 ? _c( 56763 "div", 56764 { staticClass: "invalid-feedback d-block" }, 56765 [ 56766 _vm._v( 56767 "\n " + 56768 _vm._s(_vm.errors.office_address[0]) + 56769 "\n " 56770 ), 56771 ] 56772 ) 56773 : _vm._e(), 56774 ]), 56775 _vm._v(" "), 56776 _c("div", { staticClass: "form-group" }, [ 56777 _c("label", [_vm._v("Kodepos")]), 56778 _vm._v(" "), 56779 _c("input", { 56780 directives: [ 56781 { 56782 name: "model", 56783 rawName: "v-model", 56784 value: _vm.formData.office_zip_code, 56785 expression: "formData.office_zip_code", 56786 }, 56787 ], 56788 staticClass: "form-control", 56789 attrs: { type: "text", maxlength: "5" }, 56790 domProps: { value: _vm.formData.office_zip_code }, 56791 on: { 56792 input: function ($event) { 56793 if ($event.target.composing) { 56794 return 56795 } 56796 _vm.$set( 56797 _vm.formData, 56798 "office_zip_code", 56799 $event.target.value 56800 ) 56801 }, 56802 }, 56803 }), 56804 _vm._v(" "), 56805 _vm.errors.office_zip_code 56806 ? _c( 56807 "div", 56808 { staticClass: "invalid-feedback d-block" }, 56809 [ 56810 _vm._v( 56811 "\n " + 56812 _vm._s(_vm.errors.office_zip_code[0]) + 56813 "\n " 56814 ), 56815 ] 56816 ) 56817 : _vm._e(), 56818 ]), 56819 _vm._v(" "), 56820 _c("div", { staticClass: "form-group" }, [ 56821 _c("label", [_vm._v("No Telephone")]), 56822 _vm._v(" "), 56823 _c("input", { 56824 directives: [ 56825 { 56826 name: "model", 56827 rawName: "v-model", 56828 value: _vm.formData.telephone, 56829 expression: "formData.telephone", 56830 }, 56831 ], 56832 staticClass: "form-control", 56833 attrs: { type: "text" }, 56834 domProps: { value: _vm.formData.telephone }, 56835 on: { 56836 input: function ($event) { 56837 if ($event.target.composing) { 56838 return 56839 } 56840 _vm.$set( 56841 _vm.formData, 56842 "telephone", 56843 $event.target.value 56844 ) 56845 }, 56846 }, 56847 }), 56848 _vm._v(" "), 56849 _vm.errors.telephone 56850 ? _c( 56851 "div", 56852 { staticClass: "invalid-feedback d-block" }, 56853 [ 56854 _vm._v( 56855 "\n " + 56856 _vm._s(_vm.errors.telephone[0]) + 56857 "\n " 56858 ), 56859 ] 56860 ) 56861 : _vm._e(), 56862 ]), 56863 _vm._v(" "), 56864 _c("div", { staticClass: "form-group" }, [ 56865 _c("label", [_vm._v("No Fax")]), 56866 _vm._v(" "), 56867 _c("input", { 56868 directives: [ 56869 { 56870 name: "model", 56871 rawName: "v-model", 56872 value: _vm.formData.office_fax, 56873 expression: "formData.office_fax", 56874 }, 56875 ], 56876 staticClass: "form-control", 56877 attrs: { type: "text" }, 56878 domProps: { value: _vm.formData.office_fax }, 56879 on: { 56880 input: function ($event) { 56881 if ($event.target.composing) { 56882 return 56883 } 56884 _vm.$set( 56885 _vm.formData, 56886 "office_fax", 56887 $event.target.value 56888 ) 56889 }, 56890 }, 56891 }), 56892 _vm._v(" "), 56893 _vm.errors.office_fax 56894 ? _c( 56895 "div", 56896 { staticClass: "invalid-feedback d-block" }, 56897 [ 56898 _vm._v( 56899 "\n " + 56900 _vm._s(_vm.errors.office_fax[0]) + 56901 "\n " 56902 ), 56903 ] 56904 ) 56905 : _vm._e(), 56906 ]), 56907 _vm._v(" "), 56908 _c("div", { staticClass: "form-group" }, [ 56909 _vm._m(8), 56910 _vm._v(" "), 56911 _c("input", { 56912 directives: [ 56913 { 56914 name: "model", 56915 rawName: "v-model", 56916 value: _vm.formData.office_email, 56917 expression: "formData.office_email", 56918 }, 56919 ], 56920 staticClass: "form-control", 56921 attrs: { type: "email" }, 56922 domProps: { value: _vm.formData.office_email }, 56923 on: { 56924 input: function ($event) { 56925 if ($event.target.composing) { 56926 return 56927 } 56928 _vm.$set( 56929 _vm.formData, 56930 "office_email", 56931 $event.target.value 56932 ) 56933 }, 56934 }, 56935 }), 56936 _vm._v(" "), 56937 _vm.errors.office_email 56938 ? _c( 56939 "div", 56940 { staticClass: "invalid-feedback d-block" }, 56941 [ 56942 _vm._v( 56943 "\n " + 56944 _vm._s(_vm.errors.office_email[0]) + 56945 "\n " 56946 ), 56947 ] 56948 ) 56949 : _vm._e(), 56950 ]), 56951 ], 56952 _vm._v(" "), 56953 _c( 56954 "div", 56955 { staticClass: "form-group" }, 56956 [ 56957 _c("label", [_vm._v("Warna Kendaraan")]), 56958 _vm._v(" "), 56959 _c( 56960 "v-select", 56961 { 56962 attrs: { 56963 filterable: false, 56964 options: _vm.optionColors, 56965 }, 56966 on: { search: _vm.getOptionColors }, 56967 model: { 56968 value: _vm.formData.color, 56969 callback: function ($$v) { 56970 _vm.$set(_vm.formData, "color", $$v) 56971 }, 56972 expression: "formData.color", 56973 }, 56974 }, 56975 [ 56976 _c("template", { slot: "no-options" }, [ 56977 _vm._v( 56978 "\n type to search colors...\n " 56979 ), 56980 ]), 56981 ], 56982 2 56983 ), 56984 _vm._v(" "), 56985 _c("div", { staticClass: "valid-feedback d-block" }, [ 56986 _vm._v( 56987 "\n Please type for searching color. Ex : KUNING, BLUE, MERAH, BLACK\n " 56988 ), 56989 ]), 56990 _vm._v(" "), 56991 _vm.errors.color 56992 ? _c( 56993 "div", 56994 { staticClass: "invalid-feedback d-block" }, 56995 [ 56996 _vm._v( 56997 "\n " + 56998 _vm._s(_vm.errors.color[0]) + 56999 "\n " 57000 ), 57001 ] 57002 ) 57003 : _vm._e(), 57004 ], 57005 1 57006 ), 57007 _vm._v(" "), 57008 _c("div", { staticClass: "row" }, [ 57009 _c("div", { staticClass: "col-md-6" }, [ 57010 _c( 57011 "div", 57012 { staticClass: "form-group" }, 57013 [ 57014 _c("label", [_vm._v("Used Vehicle")]), 57015 _vm._v(" "), 57016 _c("v-select", { 57017 attrs: { 57018 options: _vm.optionUsedVehicles, 57019 reduce: function (text) { 57020 return text.value 57021 }, 57022 label: "text", 57023 }, 57024 model: { 57025 value: _vm.formData.used_vehicle, 57026 callback: function ($$v) { 57027 _vm.$set(_vm.formData, "used_vehicle", $$v) 57028 }, 57029 expression: "formData.used_vehicle", 57030 }, 57031 }), 57032 _vm._v(" "), 57033 _vm.errors.used_vehicle 57034 ? _c( 57035 "div", 57036 { staticClass: "invalid-feedback d-block" }, 57037 [ 57038 _vm._v( 57039 "\n " + 57040 _vm._s(_vm.errors.used_vehicle[0]) + 57041 "\n " 57042 ), 57043 ] 57044 ) 57045 : _vm._e(), 57046 ], 57047 1 57048 ), 57049 ]), 57050 _vm._v(" "), 57051 _c("div", { staticClass: "col-md-6" }, [ 57052 _c( 57053 "div", 57054 { staticClass: "form-group" }, 57055 [ 57056 _c("label", [_vm._v("Car Parking")]), 57057 _vm._v(" "), 57058 _c("v-select", { 57059 attrs: { 57060 options: _vm.optionCarParking, 57061 reduce: function (text) { 57062 return text.value 57063 }, 57064 label: "text", 57065 }, 57066 model: { 57067 value: _vm.formData.car_parking, 57068 callback: function ($$v) { 57069 _vm.$set(_vm.formData, "car_parking", $$v) 57070 }, 57071 expression: "formData.car_parking", 57072 }, 57073 }), 57074 _vm._v(" "), 57075 _vm.errors.car_parking 57076 ? _c( 57077 "div", 57078 { staticClass: "invalid-feedback d-block" }, 57079 [ 57080 _vm._v( 57081 "\n " + 57082 _vm._s(_vm.errors.car_parking[0]) + 57083 "\n " 57084 ), 57085 ] 57086 ) 57087 : _vm._e(), 57088 ], 57089 1 57090 ), 57091 ]), 57092 ]), 57093 _vm._v(" "), 57094 _c("div", { staticClass: "form-group" }, [ 57095 _c("label", [_vm._v("No Mesin")]), 57096 _vm._v(" "), 57097 _c("input", { 57098 directives: [ 57099 { 57100 name: "model", 57101 rawName: "v-model", 57102 value: _vm.formData.engine_number, 57103 expression: "formData.engine_number", 57104 }, 57105 ], 57106 staticClass: "form-control", 57107 attrs: { type: "text" }, 57108 domProps: { value: _vm.formData.engine_number }, 57109 on: { 57110 input: function ($event) { 57111 if ($event.target.composing) { 57112 return 57113 } 57114 _vm.$set( 57115 _vm.formData, 57116 "engine_number", 57117 $event.target.value 57118 ) 57119 }, 57120 }, 57121 }), 57122 _vm._v(" "), 57123 _vm.errors.engine_number 57124 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 57125 _vm._v( 57126 "\n " + 57127 _vm._s(_vm.errors.engine_number[0]) + 57128 "\n " 57129 ), 57130 ]) 57131 : _vm._e(), 57132 ]), 57133 _vm._v(" "), 57134 _c("div", { staticClass: "form-group" }, [ 57135 _c("label", [_vm._v("No Rangka")]), 57136 _vm._v(" "), 57137 _c("input", { 57138 directives: [ 57139 { 57140 name: "model", 57141 rawName: "v-model", 57142 value: _vm.formData.chassis_number, 57143 expression: "formData.chassis_number", 57144 }, 57145 ], 57146 staticClass: "form-control", 57147 attrs: { type: "text" }, 57148 domProps: { value: _vm.formData.chassis_number }, 57149 on: { 57150 input: function ($event) { 57151 if ($event.target.composing) { 57152 return 57153 } 57154 _vm.$set( 57155 _vm.formData, 57156 "chassis_number", 57157 $event.target.value 57158 ) 57159 }, 57160 }, 57161 }), 57162 _vm._v(" "), 57163 _vm.errors.chassis_number 57164 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 57165 _vm._v( 57166 "\n " + 57167 _vm._s(_vm.errors.chassis_number[0]) + 57168 "\n " 57169 ), 57170 ]) 57171 : _vm._e(), 57172 ]), 57173 ], 57174 2 57175 ) 57176 : _vm._e(), 57177 _vm._v(" "), 57178 _vm.currentPage > 4 57179 ? _c("div", { staticClass: "step-5" }, [ 57180 _c("div", { staticClass: "text-center" }, [ 57181 _c("h4", [ 57182 _vm._v( 57183 "Success Published Policy " + 57184 _vm._s(_vm.formData.business_name) 57185 ), 57186 ]), 57187 ]), 57188 _vm._v(" "), 57189 _c("div", { staticClass: "form-group" }, [ 57190 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 57191 _vm._v(" "), 57192 _c("div", { staticClass: "input-group" }, [ 57193 _c("input", { 57194 directives: [ 57195 { 57196 name: "model", 57197 rawName: "v-model", 57198 value: _vm.formData.policy_number, 57199 expression: "formData.policy_number", 57200 }, 57201 ], 57202 staticClass: "form-control", 57203 attrs: { type: "text", readonly: "" }, 57204 domProps: { value: _vm.formData.policy_number }, 57205 on: { 57206 input: function ($event) { 57207 if ($event.target.composing) { 57208 return 57209 } 57210 _vm.$set( 57211 _vm.formData, 57212 "policy_number", 57213 $event.target.value 57214 ) 57215 }, 57216 }, 57217 }), 57218 _vm._v(" "), 57219 _c("div", { staticClass: "input-group-append" }, [ 57220 _c( 57221 "button", 57222 { 57223 staticClass: "btn btn-primary", 57224 attrs: { type: "button" }, 57225 on: { 57226 click: function ($event) { 57227 return _vm.copyData( 57228 _vm.formData.policy_number, 57229 "Policy Number" 57230 ) 57231 }, 57232 }, 57233 }, 57234 [_c("i", { staticClass: "fa fa-copy text-white" })] 57235 ), 57236 ]), 57237 ]), 57238 ]), 57239 _vm._v(" "), 57240 _c("div", { staticClass: "form-group" }, [ 57241 _c("label", [_vm._v("Premi")]), 57242 _vm._v(" "), 57243 _c("div", { staticClass: "input-group" }, [ 57244 _c("input", { 57245 directives: [ 57246 { 57247 name: "model", 57248 rawName: "v-model", 57249 value: _vm.formData.premium, 57250 expression: "formData.premium", 57251 }, 57252 ], 57253 staticClass: "form-control", 57254 attrs: { type: "text", readonly: "" }, 57255 domProps: { value: _vm.formData.premium }, 57256 on: { 57257 input: function ($event) { 57258 if ($event.target.composing) { 57259 return 57260 } 57261 _vm.$set(_vm.formData, "premium", $event.target.value) 57262 }, 57263 }, 57264 }), 57265 _vm._v(" "), 57266 _c("div", { staticClass: "input-group-append" }, [ 57267 _c( 57268 "button", 57269 { 57270 staticClass: "btn btn-primary", 57271 attrs: { type: "button" }, 57272 on: { 57273 click: function ($event) { 57274 return _vm.copyData( 57275 _vm.formData.premium, 57276 "Premium" 57277 ) 57278 }, 57279 }, 57280 }, 57281 [_c("i", { staticClass: "fa fa-copy text-white" })] 57282 ), 57283 ]), 57284 ]), 57285 ]), 57286 _vm._v(" "), 57287 _c( 57288 "button", 57289 { 57290 staticClass: "btn btn-success btn-block", 57291 attrs: { type: "button", disabled: _vm.submitting }, 57292 on: { click: _vm.processPayment }, 57293 }, 57294 [_vm._v("BAYAR\n ")] 57295 ), 57296 ]) 57297 : _vm._e(), 57298 ]) 57299 : _c( 57300 "div", 57301 { staticClass: "card-body" }, 57302 [ 57303 _c( 57304 "content-placeholders", 57305 [ 57306 _c("content-placeholders-heading", { attrs: { img: true } }), 57307 _vm._v(" "), 57308 _c("content-placeholders-text", { attrs: { lines: 3 } }), 57309 ], 57310 1 57311 ), 57312 ], 57313 1 57314 ), 57315 _vm._v(" "), 57316 _c("div", { staticClass: "card-footer" }, [ 57317 _vm._m(9), 57318 _vm._v(" "), 57319 _c("div", { staticClass: "row" }, [ 57320 _vm.formData.step < 5 57321 ? _c("div", { staticClass: "col-sm-6" }, [ 57322 _c( 57323 "button", 57324 { 57325 staticClass: "btn btn-primary", 57326 attrs: { type: "button", disabled: _vm.submitting }, 57327 on: { click: _vm.submitData }, 57328 }, 57329 [_vm._v("Submit\n ")] 57330 ), 57331 _vm._v(" "), 57332 _c( 57333 "button", 57334 { 57335 staticClass: "btn btn-warning", 57336 attrs: { type: "button" }, 57337 on: { click: _vm.resetData }, 57338 }, 57339 [_vm._v("Reset\n ")] 57340 ), 57341 ]) 57342 : _vm._e(), 57343 _vm._v(" "), 57344 _c("div", { staticClass: "col ml-auto d-none" }, [ 57345 _c( 57346 "nav", 57347 { 57348 staticClass: "float-right", 57349 attrs: { "aria-label": "Page navigation example" }, 57350 }, 57351 [ 57352 _c( 57353 "ul", 57354 { staticClass: "pagination" }, 57355 [ 57356 _vm._l(4, function (p) { 57357 return [ 57358 _vm.currentPage === p 57359 ? _c( 57360 "li", 57361 { 57362 staticClass: "page-item active", 57363 attrs: { "aria-current": "page" }, 57364 }, 57365 [ 57366 _c( 57367 "a", 57368 { 57369 staticClass: "page-link", 57370 attrs: { href: "#" }, 57371 on: { 57372 click: function ($event) { 57373 return _vm.changePage(p) 57374 }, 57375 }, 57376 }, 57377 [_vm._v(_vm._s(p))] 57378 ), 57379 ] 57380 ) 57381 : _c( 57382 "li", 57383 { 57384 staticClass: "page-item", 57385 class: { disabled: p > _vm.formData.step }, 57386 }, 57387 [ 57388 _c( 57389 "a", 57390 { 57391 staticClass: "page-link", 57392 attrs: { href: "#" }, 57393 on: { 57394 click: function ($event) { 57395 return _vm.changePage(p) 57396 }, 57397 }, 57398 }, 57399 [_vm._v(_vm._s(p))] 57400 ), 57401 ] 57402 ), 57403 ] 57404 }), 57405 ], 57406 2 57407 ), 57408 ] 57409 ), 57410 ]), 57411 ]), 57412 ]), 57413 ]) 57414} 57415var staticRenderFns = [ 57416 function () { 57417 var _vm = this 57418 var _h = _vm.$createElement 57419 var _c = _vm._self._c || _h 57420 return _c("div", { staticClass: "form-group" }, [ 57421 _c("h3", [_vm._v("Form Pembelian Simas Mobil Exclusive :")]), 57422 ]) 57423 }, 57424 function () { 57425 var _vm = this 57426 var _h = _vm.$createElement 57427 var _c = _vm._self._c || _h 57428 return _c("label", [ 57429 _vm._v("Nama Depan "), 57430 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 57431 ]) 57432 }, 57433 function () { 57434 var _vm = this 57435 var _h = _vm.$createElement 57436 var _c = _vm._self._c || _h 57437 return _c("label", [ 57438 _vm._v("No Handphone"), 57439 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 57440 ]) 57441 }, 57442 function () { 57443 var _vm = this 57444 var _h = _vm.$createElement 57445 var _c = _vm._self._c || _h 57446 return _c("label", [ 57447 _vm._v("Email"), 57448 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 57449 ]) 57450 }, 57451 function () { 57452 var _vm = this 57453 var _h = _vm.$createElement 57454 var _c = _vm._self._c || _h 57455 return _c("label", [ 57456 _vm._v("No KTP "), 57457 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 57458 ]) 57459 }, 57460 function () { 57461 var _vm = this 57462 var _h = _vm.$createElement 57463 var _c = _vm._self._c || _h 57464 return _c("label", [ 57465 _vm._v("Alamat "), 57466 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 57467 ]) 57468 }, 57469 function () { 57470 var _vm = this 57471 var _h = _vm.$createElement 57472 var _c = _vm._self._c || _h 57473 return _c("label", [ 57474 _vm._v("Perusahaan "), 57475 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 57476 ]) 57477 }, 57478 function () { 57479 var _vm = this 57480 var _h = _vm.$createElement 57481 var _c = _vm._self._c || _h 57482 return _c("label", [ 57483 _vm._v("Alamat "), 57484 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 57485 ]) 57486 }, 57487 function () { 57488 var _vm = this 57489 var _h = _vm.$createElement 57490 var _c = _vm._self._c || _h 57491 return _c("label", [ 57492 _vm._v("Email Kantor "), 57493 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 57494 ]) 57495 }, 57496 function () { 57497 var _vm = this 57498 var _h = _vm.$createElement 57499 var _c = _vm._self._c || _h 57500 return _c("span", { staticClass: "text-danger" }, [ 57501 _c("em", [_vm._v("* Data wajib untuk diisi")]), 57502 ]) 57503 }, 57504] 57505render._withStripped = true 57506 57507 57508 57509/***/ }), 57510 57511/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CheckPolicy.vue?vue&type=template&id=535d7891&": 57512/*!************************************************************************************************************************************************************************************************************************!*\ 57513 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/CheckPolicy.vue?vue&type=template&id=535d7891& ***! 57514 \************************************************************************************************************************************************************************************************************************/ 57515/*! exports provided: render, staticRenderFns */ 57516/***/ (function(module, __webpack_exports__, __webpack_require__) { 57517 57518"use strict"; 57519__webpack_require__.r(__webpack_exports__); 57520/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 57521/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 57522var render = function () { 57523 var _vm = this 57524 var _h = _vm.$createElement 57525 var _c = _vm._self._c || _h 57526 return _c("div", { staticClass: "row" }, [ 57527 _c("div", { staticClass: "col-lg-12" }, [ 57528 _c("div", { staticClass: "card card-product" }, [ 57529 _c( 57530 "div", 57531 { staticClass: "card-body" }, 57532 [ 57533 !_vm.submitting 57534 ? _c("div", { staticClass: "row" }, [ 57535 _c( 57536 "div", 57537 { staticClass: "col-lg-12" }, 57538 [ 57539 _c( 57540 "div", 57541 { staticClass: "form-group" }, 57542 [ 57543 _c("label", [_vm._v("Pencarian Berdasarkan")]), 57544 _vm._v(" "), 57545 _c("v-select", { 57546 attrs: { 57547 options: _vm.optionSearch, 57548 reduce: function (option) { 57549 return option.value 57550 }, 57551 label: "text", 57552 }, 57553 model: { 57554 value: _vm.formData.jenis_pencarian, 57555 callback: function ($$v) { 57556 _vm.$set(_vm.formData, "jenis_pencarian", $$v) 57557 }, 57558 expression: "formData.jenis_pencarian", 57559 }, 57560 }), 57561 _vm._v(" "), 57562 _vm.errors.jenis_pencarian 57563 ? _c( 57564 "div", 57565 { staticClass: "invalid-feedback d-block" }, 57566 [ 57567 _vm._v( 57568 "\n " + 57569 _vm._s(_vm.errors.jenis_pencarian[0]) + 57570 "\n " 57571 ), 57572 ] 57573 ) 57574 : _vm._e(), 57575 ], 57576 1 57577 ), 57578 _vm._v(" "), 57579 _vm.formData.jenis_pencarian === "email" 57580 ? _c("div", { staticClass: "form-group" }, [ 57581 _c("label", [_vm._v("Email")]), 57582 _vm._v(" "), 57583 _c("input", { 57584 directives: [ 57585 { 57586 name: "model", 57587 rawName: "v-model", 57588 value: _vm.formData.email, 57589 expression: "formData.email", 57590 }, 57591 ], 57592 staticClass: "form-control", 57593 attrs: { 57594 type: "email", 57595 placeholder: _vm.formData.email, 57596 }, 57597 domProps: { value: _vm.formData.email }, 57598 on: { 57599 input: function ($event) { 57600 if ($event.target.composing) { 57601 return 57602 } 57603 _vm.$set( 57604 _vm.formData, 57605 "email", 57606 $event.target.value 57607 ) 57608 }, 57609 }, 57610 }), 57611 _vm._v(" "), 57612 _vm.errors.email 57613 ? _c( 57614 "div", 57615 { staticClass: "invalid-feedback d-block" }, 57616 [ 57617 _vm._v( 57618 "\n " + 57619 _vm._s(_vm.errors.email[0]) + 57620 "\n " 57621 ), 57622 ] 57623 ) 57624 : _vm._e(), 57625 ]) 57626 : _vm._e(), 57627 _vm._v(" "), 57628 _vm.formData.jenis_pencarian === "nopolis" 57629 ? _c("div", { staticClass: "form-group" }, [ 57630 _c("label", [_vm._v("Nomor Polis")]), 57631 _vm._v(" "), 57632 _c("input", { 57633 directives: [ 57634 { 57635 name: "model", 57636 rawName: "v-model", 57637 value: _vm.formData.no_polis, 57638 expression: "formData.no_polis", 57639 }, 57640 ], 57641 staticClass: "form-control", 57642 attrs: { 57643 type: "email", 57644 placeholder: _vm.formData.no_polis, 57645 }, 57646 domProps: { value: _vm.formData.no_polis }, 57647 on: { 57648 input: function ($event) { 57649 if ($event.target.composing) { 57650 return 57651 } 57652 _vm.$set( 57653 _vm.formData, 57654 "no_polis", 57655 $event.target.value 57656 ) 57657 }, 57658 }, 57659 }), 57660 _vm._v(" "), 57661 _vm.errors.no_polis 57662 ? _c( 57663 "div", 57664 { staticClass: "invalid-feedback d-block" }, 57665 [ 57666 _vm._v( 57667 "\n " + 57668 _vm._s(_vm.errors.no_polis[0]) + 57669 "\n " 57670 ), 57671 ] 57672 ) 57673 : _vm._e(), 57674 ]) 57675 : _vm._e(), 57676 _vm._v(" "), 57677 _c( 57678 "div", 57679 { staticClass: "form-group" }, 57680 [ 57681 _c("label", [_vm._v("Group Bisnis")]), 57682 _vm._v(" "), 57683 _c("v-select", { 57684 attrs: { 57685 options: _vm.optionBusinessGroup, 57686 reduce: function (option) { 57687 return option.value 57688 }, 57689 label: "text", 57690 }, 57691 model: { 57692 value: _vm.formData.group_bisnis, 57693 callback: function ($$v) { 57694 _vm.$set(_vm.formData, "group_bisnis", $$v) 57695 }, 57696 expression: "formData.group_bisnis", 57697 }, 57698 }), 57699 _vm._v(" "), 57700 _vm.errors.group_bisnis 57701 ? _c( 57702 "div", 57703 { staticClass: "invalid-feedback d-block" }, 57704 [ 57705 _vm._v( 57706 "\n " + 57707 _vm._s(_vm.errors.group_bisnis[0]) + 57708 "\n " 57709 ), 57710 ] 57711 ) 57712 : _vm._e(), 57713 ], 57714 1 57715 ), 57716 _vm._v(" "), 57717 _vm.formData.group_bisnis === "007" 57718 ? [ 57719 _c( 57720 "div", 57721 { staticClass: "form-group" }, 57722 [ 57723 _c("label", [ 57724 _vm._v("Opsi Pencarian MBU/Motor"), 57725 ]), 57726 _vm._v(" "), 57727 _c("v-select", { 57728 attrs: { 57729 options: _vm.optionMbu, 57730 reduce: function (option) { 57731 return option.value 57732 }, 57733 label: "text", 57734 }, 57735 model: { 57736 value: _vm.formData.opsi, 57737 callback: function ($$v) { 57738 _vm.$set(_vm.formData, "opsi", $$v) 57739 }, 57740 expression: "formData.opsi", 57741 }, 57742 }), 57743 _vm._v(" "), 57744 _vm.errors.opsi 57745 ? _c( 57746 "div", 57747 { 57748 staticClass: "invalid-feedback d-block", 57749 }, 57750 [ 57751 _vm._v( 57752 "\n " + 57753 _vm._s(_vm.errors.opsi[0]) + 57754 "\n " 57755 ), 57756 ] 57757 ) 57758 : _vm._e(), 57759 ], 57760 1 57761 ), 57762 _vm._v(" "), 57763 _c("div", { staticClass: "form-group" }, [ 57764 _c("label", [_vm._v(_vm._s(_vm.mbuLabel))]), 57765 _vm._v(" "), 57766 _c("input", { 57767 directives: [ 57768 { 57769 name: "model", 57770 rawName: "v-model", 57771 value: _vm.formData.opsi_number, 57772 expression: "formData.opsi_number", 57773 }, 57774 ], 57775 staticClass: "form-control", 57776 attrs: { 57777 type: "text", 57778 placeholder: _vm.mbuLabel, 57779 }, 57780 domProps: { value: _vm.formData.opsi_number }, 57781 on: { 57782 input: function ($event) { 57783 if ($event.target.composing) { 57784 return 57785 } 57786 _vm.$set( 57787 _vm.formData, 57788 "opsi_number", 57789 $event.target.value 57790 ) 57791 }, 57792 }, 57793 }), 57794 _vm._v(" "), 57795 _vm.errors.opsi_number 57796 ? _c( 57797 "div", 57798 { staticClass: "invalid-feedback d-block" }, 57799 [ 57800 _vm._v( 57801 "\n " + 57802 _vm._s(_vm.errors.opsi_number[0]) + 57803 "\n " 57804 ), 57805 ] 57806 ) 57807 : _vm._e(), 57808 ]), 57809 ] 57810 : _vm._e(), 57811 _vm._v(" "), 57812 _c( 57813 "button", 57814 { 57815 staticClass: "btn btn-primary btn-block", 57816 attrs: { type: "submit", disabled: _vm.submitting }, 57817 on: { click: _vm.checkPolicy }, 57818 }, 57819 [_vm._v("SUBMIT\n ")] 57820 ), 57821 ], 57822 2 57823 ), 57824 ]) 57825 : _c( 57826 "content-placeholders", 57827 [ 57828 _c("content-placeholders-heading"), 57829 _vm._v(" "), 57830 _c("content-placeholders-text", { attrs: { lines: 5 } }), 57831 ], 57832 1 57833 ), 57834 ], 57835 1 57836 ), 57837 ]), 57838 ]), 57839 _vm._v(" "), 57840 _vm.listData.length > 0 57841 ? _c("div", { staticClass: "col-lg-12" }, [ 57842 _c("div", { staticClass: "card bg-grey" }, [ 57843 _c("div", { staticClass: "card-body" }, [ 57844 _c( 57845 "table", 57846 { staticClass: "table table-sm table-hover table-striped" }, 57847 [ 57848 _c( 57849 "thead", 57850 [ 57851 _vm._m(0), 57852 _vm._v(" "), 57853 _vm._l(_vm.listData, function (policy, idx) { 57854 return _c("tr", { key: idx }, [ 57855 _c("td", [_vm._v(_vm._s(idx + 1))]), 57856 _vm._v(" "), 57857 _c("td", [_vm._v(_vm._s(policy.policy_number))]), 57858 _vm._v(" "), 57859 _c("td", [_vm._v(_vm._s(policy.business_name))]), 57860 _vm._v(" "), 57861 _c("td", [_vm._v(_vm._s(policy.start_period))]), 57862 _vm._v(" "), 57863 _c("td", [_vm._v(_vm._s(policy.end_period))]), 57864 _vm._v(" "), 57865 _c("td", [_vm._v(_vm._s(policy.payment_status))]), 57866 ]) 57867 }), 57868 ], 57869 2 57870 ), 57871 ] 57872 ), 57873 ]), 57874 ]), 57875 ]) 57876 : _vm._e(), 57877 ]) 57878} 57879var staticRenderFns = [ 57880 function () { 57881 var _vm = this 57882 var _h = _vm.$createElement 57883 var _c = _vm._self._c || _h 57884 return _c("tr", { staticClass: "thead-dark" }, [ 57885 _c("th", [_vm._v("#")]), 57886 _vm._v(" "), 57887 _c("th", [_vm._v("No Polis")]), 57888 _vm._v(" "), 57889 _c("th", [_vm._v("Jenis")]), 57890 _vm._v(" "), 57891 _c("th", [_vm._v("Awal periode")]), 57892 _vm._v(" "), 57893 _c("th", [_vm._v("Akhir Periode")]), 57894 _vm._v(" "), 57895 _c("th", [_vm._v("Status")]), 57896 ]) 57897 }, 57898] 57899render._withStripped = true 57900 57901 57902 57903/***/ }), 57904 57905/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d&": 57906/*!***********************************************************************************************************************************************************************************************************************************!*\ 57907 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d& ***! 57908 \***********************************************************************************************************************************************************************************************************************************/ 57909/*! exports provided: render, staticRenderFns */ 57910/***/ (function(module, __webpack_exports__, __webpack_require__) { 57911 57912"use strict"; 57913__webpack_require__.r(__webpack_exports__); 57914/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 57915/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 57916var render = function () { 57917 var _vm = this 57918 var _h = _vm.$createElement 57919 var _c = _vm._self._c || _h 57920 return _c("div", { staticClass: "row justify-content-center" }, [ 57921 _c("div", { staticClass: "col-lg-6" }, [ 57922 _c("div", { staticClass: "card card-product" }, [ 57923 _c( 57924 "div", 57925 { staticClass: "card-body" }, 57926 [ 57927 !_vm.submitting 57928 ? _c("div", { staticClass: "row" }, [ 57929 _c( 57930 "div", 57931 { staticClass: "col-lg-12" }, 57932 [ 57933 _vm.step === 1 57934 ? [ 57935 _c("div", { staticClass: "form-group" }, [ 57936 _c("label", [ 57937 _vm._v("Nomor Registrasi (Reg No)"), 57938 ]), 57939 _vm._v(" "), 57940 _c("input", { 57941 directives: [ 57942 { 57943 name: "model", 57944 rawName: "v-model", 57945 value: _vm.formData.no_reg, 57946 expression: "formData.no_reg", 57947 }, 57948 ], 57949 staticClass: "form-control", 57950 attrs: { 57951 type: "text", 57952 placeholder: _vm.formData.no_reg, 57953 }, 57954 domProps: { value: _vm.formData.no_reg }, 57955 on: { 57956 input: function ($event) { 57957 if ($event.target.composing) { 57958 return 57959 } 57960 _vm.$set( 57961 _vm.formData, 57962 "no_reg", 57963 $event.target.value 57964 ) 57965 }, 57966 }, 57967 }), 57968 _vm._v(" "), 57969 _vm.errors.no_reg 57970 ? _c( 57971 "div", 57972 { staticClass: "invalid-feedback d-block" }, 57973 [ 57974 _vm._v( 57975 "\n " + 57976 _vm._s(_vm.errors.no_reg[0]) + 57977 "\n " 57978 ), 57979 ] 57980 ) 57981 : _vm._e(), 57982 ]), 57983 _vm._v(" "), 57984 _c("div", { staticClass: "form-group" }, [ 57985 _c("label", [_vm._v("Nama")]), 57986 _vm._v(" "), 57987 _c("input", { 57988 directives: [ 57989 { 57990 name: "model", 57991 rawName: "v-model", 57992 value: _vm.formData.nama_tertanggung, 57993 expression: "formData.nama_tertanggung", 57994 }, 57995 ], 57996 staticClass: "form-control", 57997 attrs: { 57998 type: "text", 57999 placeholder: _vm.formData.nama_tertanggung, 58000 }, 58001 domProps: { 58002 value: _vm.formData.nama_tertanggung, 58003 }, 58004 on: { 58005 input: function ($event) { 58006 if ($event.target.composing) { 58007 return 58008 } 58009 _vm.$set( 58010 _vm.formData, 58011 "nama_tertanggung", 58012 $event.target.value 58013 ) 58014 }, 58015 }, 58016 }), 58017 _vm._v(" "), 58018 _vm.errors.nama_tertanggung 58019 ? _c( 58020 "div", 58021 { staticClass: "invalid-feedback d-block" }, 58022 [ 58023 _vm._v( 58024 "\n " + 58025 _vm._s( 58026 _vm.errors.nama_tertanggung[0] 58027 ) + 58028 "\n " 58029 ), 58030 ] 58031 ) 58032 : _vm._e(), 58033 ]), 58034 _vm._v(" "), 58035 _c( 58036 "div", 58037 { staticClass: "form-group" }, 58038 [ 58039 _c("label", [_vm._v("Tanggal Lahir")]), 58040 _vm._v(" "), 58041 _c("datetime", { 58042 staticClass: "flatpickr form-control", 58043 class: { 58044 "is-invalid": _vm.errors.tanggal_lahir, 58045 }, 58046 attrs: { 58047 config: _vm.datePickerConfig, 58048 id: "tanggal_lahir", 58049 name: "tanggal_lahir", 58050 placeholder: "Tanggal lahir", 58051 }, 58052 model: { 58053 value: _vm.formData.tanggal_lahir, 58054 callback: function ($$v) { 58055 _vm.$set( 58056 _vm.formData, 58057 "tanggal_lahir", 58058 $$v 58059 ) 58060 }, 58061 expression: "formData.tanggal_lahir", 58062 }, 58063 }), 58064 _vm._v(" "), 58065 _vm.errors.tanggal_lahir 58066 ? _c( 58067 "small", 58068 { staticClass: "form-text text-danger" }, 58069 [ 58070 _vm._v( 58071 _vm._s(_vm.errors.tanggal_lahir[0]) 58072 ), 58073 ] 58074 ) 58075 : _vm._e(), 58076 ], 58077 1 58078 ), 58079 ] 58080 : _vm._e(), 58081 _vm._v(" "), 58082 _vm.isValidPolicy && _vm.step === 2 58083 ? _vm._l(_vm.dataPolicies, function (pro, idx) { 58084 return _c("div", { staticClass: "mb-3" }, [ 58085 _c("h6", { staticClass: "card-title" }, [ 58086 _vm._v("#" + _vm._s(pro.policy_no)), 58087 ]), 58088 _vm._v(" "), 58089 _c("h5", { staticClass: "card-title m-0" }, [ 58090 _vm._v(_vm._s(pro.participant_name)), 58091 ]), 58092 _vm._v(" "), 58093 _c("p", { staticClass: "mb-3" }, [ 58094 _vm._v(_vm._s(pro.date_of_birth_text_format)), 58095 ]), 58096 _vm._v(" "), 58097 _c("p", { staticClass: "card-text" }, [ 58098 _c("span", { staticClass: "d-none" }, [ 58099 _vm._v("No Reg : " + _vm._s(pro.reg_no)), 58100 ]), 58101 _vm._v( 58102 "No Kartu :\n " + 58103 _vm._s(pro.card_no) 58104 ), 58105 ]), 58106 _vm._v(" "), 58107 _c("p", { staticClass: "card-text" }, [ 58108 _c("small", { staticClass: "text-muted" }, [ 58109 _vm._v( 58110 "Expired :\n " + 58111 _vm._s(pro.expired_note) + 58112 " (" + 58113 _vm._s(pro.end_date_text_format) + 58114 ")" 58115 ), 58116 ]), 58117 ]), 58118 _vm._v(" "), 58119 _c( 58120 "a", 58121 { 58122 staticClass: "btn btn-primary mt-3", 58123 attrs: { href: "#" }, 58124 on: { 58125 click: function ($event) { 58126 return _vm.selectProfile(idx, pro) 58127 }, 58128 }, 58129 }, 58130 [_vm._v("Pilih")] 58131 ), 58132 _vm._v(" "), 58133 _c("div", { staticClass: "card-body mb-3" }, [ 58134 _c( 58135 "div", 58136 { attrs: { id: "accordion" } }, 58137 _vm._l( 58138 pro.sv_plan_list, 58139 function (plan, idx) { 58140 return _c( 58141 "div", 58142 { staticClass: "card" }, 58143 [ 58144 _c( 58145 "div", 58146 { 58147 staticClass: "card-header", 58148 attrs: { id: "heading-" + idx }, 58149 }, 58150 [ 58151 _c( 58152 "h5", 58153 { staticClass: "mb-0" }, 58154 [ 58155 _c( 58156 "button", 58157 { 58158 staticClass: 58159 "btn btn-link", 58160 attrs: { 58161 "data-toggle": 58162 "collapse", 58163 "data-target": 58164 "#collapse-" + idx, 58165 "aria-expanded": 58166 idx === 0 58167 ? "true" 58168 : "false", 58169 "aria-controls": 58170 "collapse-" + idx, 58171 }, 58172 }, 58173 [ 58174 _vm._v( 58175 "\n " + 58176 _vm._s( 58177 plan.CoverageNoteInd 58178 ) + 58179 "\n " 58180 ), 58181 ] 58182 ), 58183 ] 58184 ), 58185 ] 58186 ), 58187 _vm._v(" "), 58188 _c( 58189 "div", 58190 { 58191 staticClass: "collapse", 58192 class: { show: idx === 0 }, 58193 attrs: { 58194 id: "collapse-" + idx, 58195 "aria-labelledby": 58196 "heading-" + idx, 58197 "data-parent": "#accordion", 58198 }, 58199 }, 58200 [ 58201 _c( 58202 "div", 58203 { staticClass: "card-body" }, 58204 [ 58205 _c( 58206 "table", 58207 { 58208 staticClass: 58209 "table table-sm table-bordered table-striped", 58210 }, 58211 [ 58212 _vm._m(0, true), 58213 _vm._v(" "), 58214 _c( 58215 "tbody", 58216 _vm._l( 58217 plan.SvBenefitList, 58218 function ( 58219 benefit, 58220 idx 58221 ) { 58222 return _c("tr", [ 58223 _c("td", [ 58224 _vm._v( 58225 _vm._s( 58226 idx + 1 58227 ) 58228 ), 58229 ]), 58230 _vm._v(" "), 58231 _c("td", [ 58232 _vm._v( 58233 _vm._s( 58234 benefit.BenefitName 58235 ) 58236 ), 58237 ]), 58238 _vm._v(" "), 58239 _c( 58240 "td", 58241 [ 58242 benefit.LimitBenefit > 58243 0 58244 ? [ 58245 _vm._v( 58246 "\n " + 58247 _vm._s( 58248 _vm.numberFormat( 58249 benefit.LimitBenefit, 58250 0, 58251 ",", 58252 "." 58253 ) 58254 ) + 58255 "\n " 58256 ), 58257 ] 58258 : [ 58259 _vm._v( 58260 "\n " + 58261 _vm._s( 58262 benefit.LimitBenefitText 58263 ) + 58264 "\n " 58265 ), 58266 ], 58267 ], 58268 2 58269 ), 58270 ]) 58271 } 58272 ), 58273 0 58274 ), 58275 ] 58276 ), 58277 ] 58278 ), 58279 ] 58280 ), 58281 ] 58282 ) 58283 } 58284 ), 58285 0 58286 ), 58287 ]), 58288 ]) 58289 }) 58290 : _vm._e(), 58291 _vm._v(" "), 58292 _vm.isValidPolicy && _vm.step === 3 58293 ? [ 58294 _c("h3", { staticClass: "font-weight-bold" }, [ 58295 _vm._v("Pilih Rumah Sakit"), 58296 ]), 58297 _vm._v(" "), 58298 _c("div", { staticClass: "form-group" }, [ 58299 _c("label", [_vm._v("RS ID")]), 58300 _vm._v(" "), 58301 _c("div", { staticClass: "input-group" }, [ 58302 _c("input", { 58303 directives: [ 58304 { 58305 name: "model", 58306 rawName: "v-model", 58307 value: _vm.formData.id_rumah_sakit, 58308 expression: "formData.id_rumah_sakit", 58309 }, 58310 ], 58311 staticClass: "form-control", 58312 attrs: { type: "text", disabled: "" }, 58313 domProps: { 58314 value: _vm.formData.id_rumah_sakit, 58315 }, 58316 on: { 58317 input: function ($event) { 58318 if ($event.target.composing) { 58319 return 58320 } 58321 _vm.$set( 58322 _vm.formData, 58323 "id_rumah_sakit", 58324 $event.target.value 58325 ) 58326 }, 58327 }, 58328 }), 58329 _vm._v(" "), 58330 _vm._m(1), 58331 ]), 58332 ]), 58333 _vm._v(" "), 58334 _c("div", { staticClass: "form-group" }, [ 58335 _c("label", [_vm._v("Nama Rumah Sakit")]), 58336 _vm._v(" "), 58337 _c("div", { staticClass: "input-group" }, [ 58338 _c("input", { 58339 directives: [ 58340 { 58341 name: "model", 58342 rawName: "v-model", 58343 value: _vm.formData.nama_rumah_sakit, 58344 expression: "formData.nama_rumah_sakit", 58345 }, 58346 ], 58347 staticClass: "form-control", 58348 attrs: { type: "text", disabled: "" }, 58349 domProps: { 58350 value: _vm.formData.nama_rumah_sakit, 58351 }, 58352 on: { 58353 input: function ($event) { 58354 if ($event.target.composing) { 58355 return 58356 } 58357 _vm.$set( 58358 _vm.formData, 58359 "nama_rumah_sakit", 58360 $event.target.value 58361 ) 58362 }, 58363 }, 58364 }), 58365 ]), 58366 ]), 58367 _vm._v(" "), 58368 _c("div", { staticClass: "form-group" }, [ 58369 _c("label", [_vm._v("Alamat Rumah Sakit")]), 58370 _vm._v(" "), 58371 _c("div", { staticClass: "input-group" }, [ 58372 _c("input", { 58373 directives: [ 58374 { 58375 name: "model", 58376 rawName: "v-model", 58377 value: _vm.formData.alamat_rumah_sakit, 58378 expression: "formData.alamat_rumah_sakit", 58379 }, 58380 ], 58381 staticClass: "form-control", 58382 attrs: { type: "text", disabled: "" }, 58383 domProps: { 58384 value: _vm.formData.alamat_rumah_sakit, 58385 }, 58386 on: { 58387 input: function ($event) { 58388 if ($event.target.composing) { 58389 return 58390 } 58391 _vm.$set( 58392 _vm.formData, 58393 "alamat_rumah_sakit", 58394 $event.target.value 58395 ) 58396 }, 58397 }, 58398 }), 58399 ]), 58400 ]), 58401 _vm._v(" "), 58402 _c( 58403 "div", 58404 { staticClass: "form-group" }, 58405 [ 58406 _c("label", [_vm._v("Layanan")]), 58407 _vm._v(" "), 58408 _c("v-select", { 58409 attrs: { 58410 options: _vm.optionServices, 58411 reduce: function (text) { 58412 return text.value 58413 }, 58414 label: "text", 58415 }, 58416 model: { 58417 value: _vm.formData.layanan, 58418 callback: function ($$v) { 58419 _vm.$set(_vm.formData, "layanan", $$v) 58420 }, 58421 expression: "formData.layanan", 58422 }, 58423 }), 58424 _vm._v(" "), 58425 _vm.errors.layanan 58426 ? _c( 58427 "div", 58428 { 58429 staticClass: "invalid-feedback d-block", 58430 }, 58431 [ 58432 _vm._v( 58433 "\n " + 58434 _vm._s(_vm.errors.layanan[0]) + 58435 "\n " 58436 ), 58437 ] 58438 ) 58439 : _vm._e(), 58440 ], 58441 1 58442 ), 58443 _vm._v(" "), 58444 _c( 58445 "div", 58446 { staticClass: "form-group" }, 58447 [ 58448 _c("label", [_vm._v("Tanggal Kejadian")]), 58449 _vm._v(" "), 58450 _c("datetime", { 58451 staticClass: "flatpickr form-control", 58452 class: { 58453 "is-invalid": _vm.errors.tanggal_kejadian, 58454 }, 58455 attrs: { 58456 config: _vm.datePickerConfig, 58457 id: "tanggal_kejadian", 58458 name: "tanggal_kejadian", 58459 placeholder: "Tanggal Kejadian", 58460 }, 58461 model: { 58462 value: _vm.formData.tanggal_kejadian, 58463 callback: function ($$v) { 58464 _vm.$set( 58465 _vm.formData, 58466 "tanggal_kejadian", 58467 $$v 58468 ) 58469 }, 58470 expression: "formData.tanggal_kejadian", 58471 }, 58472 }), 58473 _vm._v(" "), 58474 _vm.errors.tanggal_kejadian 58475 ? _c( 58476 "small", 58477 { staticClass: "form-text text-danger" }, 58478 [ 58479 _vm._v( 58480 _vm._s(_vm.errors.tanggal_kejadian[0]) 58481 ), 58482 ] 58483 ) 58484 : _vm._e(), 58485 ], 58486 1 58487 ), 58488 _vm._v(" "), 58489 _c( 58490 "div", 58491 { staticClass: "form-group" }, 58492 [ 58493 _c("label", [_vm._v("Tanggal Keluar")]), 58494 _vm._v(" "), 58495 _c("datetime", { 58496 staticClass: "flatpickr form-control", 58497 class: { 58498 "is-invalid": _vm.errors.tanggal_keluar, 58499 }, 58500 attrs: { 58501 config: _vm.datePickerConfig, 58502 id: "tanggal_keluar", 58503 name: "tanggal_keluar", 58504 placeholder: "Tanggal Keluar", 58505 }, 58506 model: { 58507 value: _vm.formData.tanggal_keluar, 58508 callback: function ($$v) { 58509 _vm.$set( 58510 _vm.formData, 58511 "tanggal_keluar", 58512 $$v 58513 ) 58514 }, 58515 expression: "formData.tanggal_keluar", 58516 }, 58517 }), 58518 _vm._v(" "), 58519 _vm.errors.tanggal_keluar 58520 ? _c( 58521 "small", 58522 { staticClass: "form-text text-danger" }, 58523 [ 58524 _vm._v( 58525 _vm._s(_vm.errors.tanggal_keluar[0]) 58526 ), 58527 ] 58528 ) 58529 : _vm._e(), 58530 ], 58531 1 58532 ), 58533 _vm._v(" "), 58534 _c( 58535 "div", 58536 { 58537 staticClass: "form-group", 58538 class: { 58539 "d-none": 58540 _vm.formData.layanan === "OUTPATIENT", 58541 }, 58542 }, 58543 [ 58544 _c("label", [_vm._v("Total Klaim")]), 58545 _vm._v(" "), 58546 _c("div", { staticClass: "input-group" }, [ 58547 _c("input", { 58548 directives: [ 58549 { 58550 name: "model", 58551 rawName: "v-model.number", 58552 value: _vm.formData.total_klaim, 58553 expression: "formData.total_klaim", 58554 modifiers: { number: true }, 58555 }, 58556 ], 58557 staticClass: "form-control", 58558 attrs: { type: "number" }, 58559 domProps: { 58560 value: _vm.formData.total_klaim, 58561 }, 58562 on: { 58563 input: function ($event) { 58564 if ($event.target.composing) { 58565 return 58566 } 58567 _vm.$set( 58568 _vm.formData, 58569 "total_klaim", 58570 _vm._n($event.target.value) 58571 ) 58572 }, 58573 blur: function ($event) { 58574 return _vm.$forceUpdate() 58575 }, 58576 }, 58577 }), 58578 ]), 58579 ] 58580 ), 58581 ] 58582 : _vm._e(), 58583 _vm._v(" "), 58584 _vm.isValidPolicy && _vm.step === 4 && _vm.isHasBenefit 58585 ? [ 58586 _c("div", { staticClass: "form-group" }, [ 58587 _c("label", [_vm._v("Kode Diagnosis")]), 58588 _vm._v(" "), 58589 _c("div", { staticClass: "input-group" }, [ 58590 _c("input", { 58591 directives: [ 58592 { 58593 name: "model", 58594 rawName: "v-model", 58595 value: _vm.formData.kode_diagnosis, 58596 expression: "formData.kode_diagnosis", 58597 }, 58598 ], 58599 staticClass: "form-control", 58600 attrs: { type: "text" }, 58601 domProps: { 58602 value: _vm.formData.kode_diagnosis, 58603 }, 58604 on: { 58605 input: function ($event) { 58606 if ($event.target.composing) { 58607 return 58608 } 58609 _vm.$set( 58610 _vm.formData, 58611 "kode_diagnosis", 58612 $event.target.value 58613 ) 58614 }, 58615 }, 58616 }), 58617 ]), 58618 ]), 58619 _vm._v(" "), 58620 _c("div", { staticClass: "form-group" }, [ 58621 _c("label", [_vm._v("Diagnonis")]), 58622 _vm._v(" "), 58623 _c("div", { staticClass: "input-group" }, [ 58624 _c("input", { 58625 directives: [ 58626 { 58627 name: "model", 58628 rawName: "v-model", 58629 value: _vm.formData.diagnosis, 58630 expression: "formData.diagnosis", 58631 }, 58632 ], 58633 staticClass: "form-control", 58634 attrs: { type: "text" }, 58635 domProps: { value: _vm.formData.diagnosis }, 58636 on: { 58637 input: function ($event) { 58638 if ($event.target.composing) { 58639 return 58640 } 58641 _vm.$set( 58642 _vm.formData, 58643 "diagnosis", 58644 $event.target.value 58645 ) 58646 }, 58647 }, 58648 }), 58649 ]), 58650 ]), 58651 _vm._v(" "), 58652 _c("h3", { staticClass: "font-weight-bold" }, [ 58653 _vm._v("Isi Benefit sesuai klaim"), 58654 ]), 58655 _vm._v(" "), 58656 _c("div", { staticClass: "table-responsive" }, [ 58657 _c( 58658 "table", 58659 { 58660 staticClass: 58661 "table table-bordered table-striped table-hover", 58662 }, 58663 [ 58664 _vm._m(2), 58665 _vm._v(" "), 58666 _c( 58667 "tbody", 58668 [ 58669 _vm._l( 58670 _vm.dataBenefit.sv_benefit_list, 58671 function (ben, idx) { 58672 return _c("tr", [ 58673 _c("td", [_vm._v(_vm._s(idx + 1))]), 58674 _vm._v(" "), 58675 _c("td", [ 58676 _vm._v(_vm._s(ben.benefit_name)), 58677 ]), 58678 _vm._v(" "), 58679 _c("td", [ 58680 _c("input", { 58681 directives: [ 58682 { 58683 name: "model", 58684 rawName: "v-model.number", 58685 value: ben.proposed, 58686 expression: "ben.proposed", 58687 modifiers: { number: true }, 58688 }, 58689 ], 58690 staticClass: "form-control", 58691 attrs: { type: "number" }, 58692 domProps: { 58693 value: ben.proposed, 58694 }, 58695 on: { 58696 input: function ($event) { 58697 if ( 58698 $event.target.composing 58699 ) { 58700 return 58701 } 58702 _vm.$set( 58703 ben, 58704 "proposed", 58705 _vm._n( 58706 $event.target.value 58707 ) 58708 ) 58709 }, 58710 blur: function ($event) { 58711 return _vm.$forceUpdate() 58712 }, 58713 }, 58714 }), 58715 ]), 58716 ]) 58717 } 58718 ), 58719 _vm._v(" "), 58720 _c("tr", [ 58721 _c("td", { attrs: { colspan: "2" } }, [ 58722 _vm._v("TOTAL KLAIM"), 58723 ]), 58724 _vm._v(" "), 58725 _c("td", [ 58726 _vm._v(_vm._s(_vm.totalClaim)), 58727 ]), 58728 ]), 58729 ], 58730 2 58731 ), 58732 ] 58733 ), 58734 ]), 58735 ] 58736 : _vm._e(), 58737 _vm._v(" "), 58738 _vm.isValidPolicy && _vm.step === 5 && _vm.isHasBenefit 58739 ? [ 58740 _c( 58741 "table", 58742 { 58743 staticClass: 58744 "table table-sm table-striped table-bordered", 58745 }, 58746 [ 58747 _vm._m(3), 58748 _vm._v(" "), 58749 _c( 58750 "tbody", 58751 _vm._l( 58752 _vm.formData.documents, 58753 function (doc, idx) { 58754 return _c("tr", [ 58755 _c("td", [_vm._v(_vm._s(idx + 1))]), 58756 _vm._v(" "), 58757 _c( 58758 "td", 58759 [ 58760 _c( 58761 "vue-dropzone", 58762 { 58763 ref: "media" + idx, 58764 refInFor: true, 58765 attrs: { 58766 id: "media-" + idx, 58767 options: _vm.configMedia, 58768 useCustomSlot: true, 58769 }, 58770 on: { 58771 "vdropzone-sending": 58772 _vm.sendingMedia, 58773 "vdropzone-success": 58774 _vm.successMedia, 58775 "vdropzone-error": 58776 _vm.errorMedia, 58777 }, 58778 }, 58779 [ 58780 _c( 58781 "div", 58782 { 58783 staticClass: 58784 "dropzone-custom-content", 58785 }, 58786 [ 58787 _c( 58788 "h3", 58789 { 58790 staticClass: 58791 "dropzone-custom-title", 58792 }, 58793 [ 58794 _vm._v( 58795 "Drag and drop to upload\n images!" 58796 ), 58797 ] 58798 ), 58799 _vm._v(" "), 58800 _c( 58801 "div", 58802 { 58803 staticClass: "subtitle", 58804 }, 58805 [ 58806 _vm._v( 58807 "...or click to select a images from your\n computer\n " 58808 ), 58809 ] 58810 ), 58811 ] 58812 ), 58813 ] 58814 ), 58815 ], 58816 1 58817 ), 58818 _vm._v(" "), 58819 _c("td", [ 58820 _c("input", { 58821 directives: [ 58822 { 58823 name: "model", 58824 rawName: "v-model", 58825 value: doc.description, 58826 expression: "doc.description", 58827 }, 58828 ], 58829 staticClass: "form-control", 58830 attrs: { type: "text" }, 58831 domProps: { 58832 value: doc.description, 58833 }, 58834 on: { 58835 input: function ($event) { 58836 if ($event.target.composing) { 58837 return 58838 } 58839 _vm.$set( 58840 doc, 58841 "description", 58842 $event.target.value 58843 ) 58844 }, 58845 }, 58846 }), 58847 ]), 58848 ]) 58849 } 58850 ), 58851 0 58852 ), 58853 ] 58854 ), 58855 ] 58856 : _vm._e(), 58857 _vm._v(" "), 58858 _vm.isValidPolicy && _vm.step > 5 && _vm.isHasBenefit 58859 ? [ 58860 _c("h3", [_vm._v("Berhasil!")]), 58861 _vm._v(" "), 58862 _c("p", [ 58863 _vm._v( 58864 "Terima Kasih telah melakukan registrasi klaim, Klaim Anda akan Kami analisa lebih\n lanjut" 58865 ), 58866 ]), 58867 _vm._v(" "), 58868 _c("p", [ 58869 _vm._v( 58870 "Semoga Kami bisa melepas rasa cemas Anda karena kerugian tersebut." 58871 ), 58872 ]), 58873 ] 58874 : _vm._e(), 58875 _vm._v(" "), 58876 _c( 58877 "div", 58878 { 58879 staticClass: "modal fade", 58880 attrs: { 58881 id: "modalHospital", 58882 tabindex: "-1", 58883 "aria-labelledby": "modalHospitalLabel", 58884 "aria-hidden": "true", 58885 }, 58886 }, 58887 [ 58888 _c( 58889 "div", 58890 { 58891 staticClass: 58892 "modal-dialog modal-lg modal-dialog-centered", 58893 }, 58894 [ 58895 _c("div", { staticClass: "modal-content" }, [ 58896 _vm._m(4), 58897 _vm._v(" "), 58898 _c("div", { staticClass: "modal-body" }, [ 58899 _c( 58900 "div", 58901 { staticClass: "container-fluid" }, 58902 [ 58903 _c("div", { staticClass: "row" }, [ 58904 _c("div", { staticClass: "col-md-5" }, [ 58905 _c( 58906 "div", 58907 { staticClass: "form-group" }, 58908 [ 58909 _c("label", [_vm._v("Wilayah")]), 58910 _vm._v(" "), 58911 _c("v-select", { 58912 attrs: { 58913 options: _vm.optionProvinces, 58914 reduce: function (text) { 58915 return text.value 58916 }, 58917 label: "text", 58918 }, 58919 on: { 58920 "option:selected": 58921 _vm.getDataHospital, 58922 }, 58923 model: { 58924 value: _vm.filters.province, 58925 callback: function ($$v) { 58926 _vm.$set( 58927 _vm.filters, 58928 "province", 58929 $$v 58930 ) 58931 }, 58932 expression: 58933 "filters.province", 58934 }, 58935 }), 58936 ], 58937 1 58938 ), 58939 ]), 58940 _vm._v(" "), 58941 _c("div", { staticClass: "col-md-7" }, [ 58942 _c( 58943 "div", 58944 { staticClass: "form-group" }, 58945 [ 58946 _c("label", [ 58947 _vm._v("Nama Rumah Sakit"), 58948 ]), 58949 _vm._v(" "), 58950 _c( 58951 "div", 58952 { staticClass: "input-group" }, 58953 [ 58954 _c("input", { 58955 directives: [ 58956 { 58957 name: "model", 58958 rawName: "v-model", 58959 value: 58960 _vm.filters.hospital, 58961 expression: 58962 "filters.hospital", 58963 }, 58964 ], 58965 staticClass: "form-control", 58966 attrs: { 58967 type: "text", 58968 placeholder: 58969 "Search By Hospital Name", 58970 }, 58971 domProps: { 58972 value: 58973 _vm.filters.hospital, 58974 }, 58975 on: { 58976 keyup: function ($event) { 58977 if ( 58978 !$event.type.indexOf( 58979 "key" 58980 ) && 58981 _vm._k( 58982 $event.keyCode, 58983 "enter", 58984 13, 58985 $event.key, 58986 "Enter" 58987 ) 58988 ) { 58989 return null 58990 } 58991 return _vm.getDataHospital.apply( 58992 null, 58993 arguments 58994 ) 58995 }, 58996 input: function ($event) { 58997 if ( 58998 $event.target 58999 .composing 59000 ) { 59001 return 59002 } 59003 _vm.$set( 59004 _vm.filters, 59005 "hospital", 59006 $event.target.value 59007 ) 59008 }, 59009 }, 59010 }), 59011 _vm._v(" "), 59012 _c( 59013 "a", 59014 { 59015 staticClass: 59016 "btn btn-primary text-white", 59017 on: { 59018 click: 59019 _vm.getDataHospital, 59020 }, 59021 }, 59022 [ 59023 _c("i", { 59024 staticClass: 59025 "fa fa-search", 59026 }), 59027 ] 59028 ), 59029 ] 59030 ), 59031 ] 59032 ), 59033 ]), 59034 _vm._v(" "), 59035 _c("div", { staticClass: "col-md-7" }, [ 59036 _c( 59037 "div", 59038 { staticClass: "form-group" }, 59039 [ 59040 _c("label", [_vm._v("Layanan")]), 59041 _vm._v(" "), 59042 _c( 59043 "div", 59044 { staticClass: "input-group" }, 59045 [ 59046 _c("input", { 59047 directives: [ 59048 { 59049 name: "model", 59050 rawName: "v-model", 59051 value: 59052 _vm.filters.hospital, 59053 expression: 59054 "filters.hospital", 59055 }, 59056 ], 59057 staticClass: "form-control", 59058 attrs: { 59059 type: "text", 59060 placeholder: 59061 "Search By Hospital Name", 59062 }, 59063 domProps: { 59064 value: 59065 _vm.filters.hospital, 59066 }, 59067 on: { 59068 keyup: function ($event) { 59069 if ( 59070 !$event.type.indexOf( 59071 "key" 59072 ) && 59073 _vm._k( 59074 $event.keyCode, 59075 "enter", 59076 13, 59077 $event.key, 59078 "Enter" 59079 ) 59080 ) { 59081 return null 59082 } 59083 return _vm.getDataHospital.apply( 59084 null, 59085 arguments 59086 ) 59087 }, 59088 input: function ($event) { 59089 if ( 59090 $event.target 59091 .composing 59092 ) { 59093 return 59094 } 59095 _vm.$set( 59096 _vm.filters, 59097 "hospital", 59098 $event.target.value 59099 ) 59100 }, 59101 }, 59102 }), 59103 _vm._v(" "), 59104 _c( 59105 "a", 59106 { 59107 staticClass: 59108 "btn btn-primary text-white", 59109 on: { 59110 click: 59111 _vm.getDataHospital, 59112 }, 59113 }, 59114 [ 59115 _c("i", { 59116 staticClass: 59117 "fa fa-search", 59118 }), 59119 ] 59120 ), 59121 ] 59122 ), 59123 ] 59124 ), 59125 ]), 59126 ]), 59127 _vm._v(" "), 59128 _vm.loadingHospital 59129 ? _c( 59130 "content-placeholders", 59131 [ 59132 _c( 59133 "content-placeholders-heading" 59134 ), 59135 _vm._v(" "), 59136 _c("content-placeholders-text", { 59137 attrs: { lines: 2 }, 59138 }), 59139 ], 59140 1 59141 ) 59142 : _c("div", { staticClass: "row" }, [ 59143 _vm.listDataHospital.length > 0 59144 ? _c( 59145 "table", 59146 { 59147 staticClass: 59148 "table table-sm table-striped table-bordered", 59149 }, 59150 [ 59151 _c("thead", [ 59152 _c("tr", [ 59153 _c("th", [_vm._v("#")]), 59154 _vm._v(" "), 59155 _c("th", [ 59156 _vm._v("ID"), 59157 ]), 59158 _vm._v(" "), 59159 _c("th", [ 59160 _vm._v("Nama"), 59161 ]), 59162 _vm._v(" "), 59163 _c("th", [ 59164 _vm._v("Alamat"), 59165 ]), 59166 ]), 59167 ]), 59168 _vm._v(" "), 59169 _c( 59170 "tbody", 59171 _vm._l( 59172 _vm.listDataHospital, 59173 function (data, i) { 59174 return _c( 59175 "tr", 59176 { 59177 key: data.HospitalID, 59178 attrs: { 59179 id: 59180 "row-hospital-" + 59181 data.HospitalID, 59182 }, 59183 }, 59184 [ 59185 _c("td", [ 59186 _c( 59187 "button", 59188 { 59189 staticClass: 59190 "btn btn-sm btn-success", 59191 attrs: { 59192 "data-dismiss": 59193 "modal", 59194 }, 59195 on: { 59196 click: 59197 function ( 59198 $event 59199 ) { 59200 return _vm.selectHospital( 59201 data 59202 ) 59203 }, 59204 }, 59205 }, 59206 [ 59207 _vm._v( 59208 "Pilih\n " 59209 ), 59210 ] 59211 ), 59212 ]), 59213 _vm._v(" "), 59214 _c("td", [ 59215 _vm._v( 59216 _vm._s( 59217 data.HospitalID 59218 ) 59219 ), 59220 ]), 59221 _vm._v(" "), 59222 _c("td", [ 59223 _vm._v( 59224 _vm._s( 59225 data.HospitalName 59226 ) 59227 ), 59228 ]), 59229 _vm._v(" "), 59230 _c("td", [ 59231 _vm._v( 59232 _vm._s( 59233 data.HospitalAddress 59234 ) 59235 ), 59236 ]), 59237 ] 59238 ) 59239 } 59240 ), 59241 0 59242 ), 59243 ] 59244 ) 59245 : _vm._e(), 59246 ]), 59247 ], 59248 1 59249 ), 59250 ]), 59251 _vm._v(" "), 59252 _vm._m(5), 59253 ]), 59254 ] 59255 ), 59256 ] 59257 ), 59258 _vm._v(" "), 59259 !_vm.isValidPolicy && _vm.step === 1 59260 ? _c( 59261 "button", 59262 { 59263 staticClass: "btn btn-primary btn-block", 59264 attrs: { 59265 type: "submit", 59266 disabled: _vm.submitting, 59267 }, 59268 on: { click: _vm.checkPolicy }, 59269 }, 59270 [_vm._v("CEK POLIS\n ")] 59271 ) 59272 : _vm._e(), 59273 _vm._v(" "), 59274 _vm.step > 2 && _vm.step < 4 59275 ? _c( 59276 "button", 59277 { 59278 staticClass: "btn btn-primary btn-block", 59279 attrs: { 59280 type: "submit", 59281 disabled: _vm.submitting, 59282 }, 59283 on: { click: _vm.prepareForm }, 59284 }, 59285 [_vm._v("BERIKUTNYA\n ")] 59286 ) 59287 : _vm._e(), 59288 _vm._v(" "), 59289 _vm.step === 4 && _vm.isHasBenefit && _vm.isValidPolicy 59290 ? _c( 59291 "button", 59292 { 59293 staticClass: "btn btn-primary btn-block", 59294 attrs: { 59295 type: "submit", 59296 disabled: _vm.submitting, 59297 }, 59298 on: { click: _vm.claimInsurance }, 59299 }, 59300 [_vm._v("KLAIM ASURANSI\n ")] 59301 ) 59302 : _vm._e(), 59303 _vm._v(" "), 59304 _vm.step === 5 && _vm.isHasBenefit && _vm.isValidPolicy 59305 ? _c( 59306 "button", 59307 { 59308 staticClass: "btn btn-primary btn-block", 59309 attrs: { 59310 type: "submit", 59311 disabled: _vm.submitting, 59312 }, 59313 on: { click: _vm.uploadMedia }, 59314 }, 59315 [_vm._v("PROSES DOKUMEN\n ")] 59316 ) 59317 : _vm._e(), 59318 _vm._v(" "), 59319 _vm.step > 5 59320 ? _c("a", { attrs: { href: "/customer/list-claim" } }, [ 59321 _vm._v("PROGRESS CLAIM"), 59322 ]) 59323 : _vm._e(), 59324 ], 59325 2 59326 ), 59327 ]) 59328 : _c( 59329 "content-placeholders", 59330 [ 59331 _c("content-placeholders-heading"), 59332 _vm._v(" "), 59333 _c("content-placeholders-text", { attrs: { lines: 5 } }), 59334 ], 59335 1 59336 ), 59337 ], 59338 1 59339 ), 59340 ]), 59341 ]), 59342 ]) 59343} 59344var staticRenderFns = [ 59345 function () { 59346 var _vm = this 59347 var _h = _vm.$createElement 59348 var _c = _vm._self._c || _h 59349 return _c("thead", [ 59350 _c("tr", [ 59351 _c("th", [_vm._v("#")]), 59352 _vm._v(" "), 59353 _c("th", [_vm._v("Benefit")]), 59354 _vm._v(" "), 59355 _c("th", [_vm._v("Limit")]), 59356 ]), 59357 ]) 59358 }, 59359 function () { 59360 var _vm = this 59361 var _h = _vm.$createElement 59362 var _c = _vm._self._c || _h 59363 return _c( 59364 "button", 59365 { 59366 staticClass: "btn btn-primary", 59367 attrs: { 59368 type: "button", 59369 "data-toggle": "modal", 59370 "data-target": "#modalHospital", 59371 }, 59372 }, 59373 [ 59374 _c("i", { staticClass: "fa fa-search" }), 59375 _vm._v(" Cari\n "), 59376 ] 59377 ) 59378 }, 59379 function () { 59380 var _vm = this 59381 var _h = _vm.$createElement 59382 var _c = _vm._self._c || _h 59383 return _c("thead", [ 59384 _c("tr", [ 59385 _c("th", [_vm._v("#")]), 59386 _vm._v(" "), 59387 _c("th", [_vm._v("Benefit")]), 59388 _vm._v(" "), 59389 _c("th", [_vm._v("Klaim")]), 59390 ]), 59391 ]) 59392 }, 59393 function () { 59394 var _vm = this 59395 var _h = _vm.$createElement 59396 var _c = _vm._self._c || _h 59397 return _c("thead", [ 59398 _c("tr", [ 59399 _c("th", [_vm._v("#")]), 59400 _vm._v(" "), 59401 _c("th", [_vm._v("Upload Gambar")]), 59402 _vm._v(" "), 59403 _c("th", [_vm._v("Keterangan")]), 59404 ]), 59405 ]) 59406 }, 59407 function () { 59408 var _vm = this 59409 var _h = _vm.$createElement 59410 var _c = _vm._self._c || _h 59411 return _c("div", { staticClass: "modal-header" }, [ 59412 _c( 59413 "h5", 59414 { staticClass: "modal-title", attrs: { id: "modalHospitalLabel" } }, 59415 [_vm._v("New message")] 59416 ), 59417 _vm._v(" "), 59418 _c("button", { 59419 staticClass: "btn-close", 59420 attrs: { 59421 type: "button", 59422 "data-dismiss": "modal", 59423 "aria-label": "Close", 59424 }, 59425 }), 59426 ]) 59427 }, 59428 function () { 59429 var _vm = this 59430 var _h = _vm.$createElement 59431 var _c = _vm._self._c || _h 59432 return _c("div", { staticClass: "modal-footer" }, [ 59433 _c( 59434 "button", 59435 { 59436 staticClass: "btn btn-primary", 59437 attrs: { type: "button", "data-dismiss": "modal" }, 59438 }, 59439 [ 59440 _vm._v( 59441 "\n Close\n " 59442 ), 59443 ] 59444 ), 59445 ]) 59446 }, 59447] 59448render._withStripped = true 59449 59450 59451 59452/***/ }), 59453 59454/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6&": 59455/*!******************************************************************************************************************************************************************************************************************************!*\ 59456 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6& ***! 59457 \******************************************************************************************************************************************************************************************************************************/ 59458/*! exports provided: render, staticRenderFns */ 59459/***/ (function(module, __webpack_exports__, __webpack_require__) { 59460 59461"use strict"; 59462__webpack_require__.r(__webpack_exports__); 59463/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 59464/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 59465var render = function () { 59466 var _vm = this 59467 var _h = _vm.$createElement 59468 var _c = _vm._self._c || _h 59469 return _c("div", { staticClass: "row justify-content-center" }, [ 59470 _c("div", { staticClass: "col-lg-6" }, [ 59471 _c("div", { staticClass: "card card-product" }, [ 59472 _c( 59473 "div", 59474 { staticClass: "card-body" }, 59475 [ 59476 !_vm.submitting 59477 ? _c("div", { staticClass: "row" }, [ 59478 _c( 59479 "div", 59480 { staticClass: "col-lg-12" }, 59481 [ 59482 _vm.step === 1 59483 ? [ 59484 _c("div", { staticClass: "form-group" }, [ 59485 _c("label", [_vm._v("Nomor Polis")]), 59486 _vm._v(" "), 59487 _c("input", { 59488 directives: [ 59489 { 59490 name: "model", 59491 rawName: "v-model", 59492 value: _vm.formData.no_polis, 59493 expression: "formData.no_polis", 59494 }, 59495 ], 59496 staticClass: "form-control", 59497 attrs: { 59498 type: "text", 59499 placeholder: _vm.formData.no_polis, 59500 }, 59501 domProps: { value: _vm.formData.no_polis }, 59502 on: { 59503 input: function ($event) { 59504 if ($event.target.composing) { 59505 return 59506 } 59507 _vm.$set( 59508 _vm.formData, 59509 "no_polis", 59510 $event.target.value 59511 ) 59512 }, 59513 }, 59514 }), 59515 _vm._v(" "), 59516 _vm.errors.no_polis 59517 ? _c( 59518 "div", 59519 { staticClass: "invalid-feedback d-block" }, 59520 [ 59521 _vm._v( 59522 "\n " + 59523 _vm._s(_vm.errors.no_polis[0]) + 59524 "\n " 59525 ), 59526 ] 59527 ) 59528 : _vm._e(), 59529 ]), 59530 _vm._v(" "), 59531 _c("div", { staticClass: "form-group" }, [ 59532 _c("label", [_vm._v("Nomor Plat")]), 59533 _vm._v(" "), 59534 _c("input", { 59535 directives: [ 59536 { 59537 name: "model", 59538 rawName: "v-model", 59539 value: _vm.formData.no_plat, 59540 expression: "formData.no_plat", 59541 }, 59542 ], 59543 staticClass: "form-control", 59544 attrs: { 59545 type: "text", 59546 placeholder: _vm.formData.no_plat, 59547 }, 59548 domProps: { value: _vm.formData.no_plat }, 59549 on: { 59550 input: function ($event) { 59551 if ($event.target.composing) { 59552 return 59553 } 59554 _vm.$set( 59555 _vm.formData, 59556 "no_plat", 59557 $event.target.value 59558 ) 59559 }, 59560 }, 59561 }), 59562 _vm._v(" "), 59563 _vm.errors.no_plat 59564 ? _c( 59565 "div", 59566 { staticClass: "invalid-feedback d-block" }, 59567 [ 59568 _vm._v( 59569 "\n " + 59570 _vm._s(_vm.errors.no_plat[0]) + 59571 "\n " 59572 ), 59573 ] 59574 ) 59575 : _vm._e(), 59576 ]), 59577 _vm._v(" "), 59578 _c("div", { staticClass: "form-group" }, [ 59579 _c("label", [_vm._v("Nomor Rangka")]), 59580 _vm._v(" "), 59581 _c("input", { 59582 directives: [ 59583 { 59584 name: "model", 59585 rawName: "v-model", 59586 value: _vm.formData.no_rangka, 59587 expression: "formData.no_rangka", 59588 }, 59589 ], 59590 staticClass: "form-control", 59591 attrs: { 59592 type: "text", 59593 placeholder: _vm.formData.no_rangka, 59594 }, 59595 domProps: { value: _vm.formData.no_rangka }, 59596 on: { 59597 input: function ($event) { 59598 if ($event.target.composing) { 59599 return 59600 } 59601 _vm.$set( 59602 _vm.formData, 59603 "no_rangka", 59604 $event.target.value 59605 ) 59606 }, 59607 }, 59608 }), 59609 _vm._v(" "), 59610 _vm.errors.no_rangka 59611 ? _c( 59612 "div", 59613 { staticClass: "invalid-feedback d-block" }, 59614 [ 59615 _vm._v( 59616 "\n " + 59617 _vm._s(_vm.errors.no_rangka[0]) + 59618 "\n " 59619 ), 59620 ] 59621 ) 59622 : _vm._e(), 59623 ]), 59624 _vm._v(" "), 59625 _c("div", { staticClass: "form-group" }, [ 59626 _c("label", [_vm._v("Nomor Mesin")]), 59627 _vm._v(" "), 59628 _c("input", { 59629 directives: [ 59630 { 59631 name: "model", 59632 rawName: "v-model", 59633 value: _vm.formData.no_mesin, 59634 expression: "formData.no_mesin", 59635 }, 59636 ], 59637 staticClass: "form-control", 59638 attrs: { 59639 type: "text", 59640 placeholder: _vm.formData.no_mesin, 59641 }, 59642 domProps: { value: _vm.formData.no_mesin }, 59643 on: { 59644 input: function ($event) { 59645 if ($event.target.composing) { 59646 return 59647 } 59648 _vm.$set( 59649 _vm.formData, 59650 "no_mesin", 59651 $event.target.value 59652 ) 59653 }, 59654 }, 59655 }), 59656 _vm._v(" "), 59657 _vm.errors.no_mesin 59658 ? _c( 59659 "div", 59660 { staticClass: "invalid-feedback d-block" }, 59661 [ 59662 _vm._v( 59663 "\n " + 59664 _vm._s(_vm.errors.no_mesin[0]) + 59665 "\n " 59666 ), 59667 ] 59668 ) 59669 : _vm._e(), 59670 ]), 59671 _vm._v(" "), 59672 _c( 59673 "div", 59674 { staticClass: "form-group" }, 59675 [ 59676 _c("label", [_vm._v("Waktu Kejadian")]), 59677 _vm._v(" "), 59678 _c("datetime", { 59679 staticClass: "flatpickr form-control", 59680 class: { 59681 "is-invalid": _vm.errors.waktu_kejadian, 59682 }, 59683 attrs: { 59684 config: _vm.datetimePickerConfig, 59685 id: "waktu_kejadian", 59686 name: "waktu_kejadian", 59687 placeholder: "Waktu Kejadian", 59688 }, 59689 model: { 59690 value: _vm.formData.waktu_kejadian, 59691 callback: function ($$v) { 59692 _vm.$set( 59693 _vm.formData, 59694 "waktu_kejadian", 59695 $$v 59696 ) 59697 }, 59698 expression: "formData.waktu_kejadian", 59699 }, 59700 }), 59701 _vm._v(" "), 59702 _vm.errors.waktu_kejadian 59703 ? _c( 59704 "small", 59705 { staticClass: "form-text text-danger" }, 59706 [ 59707 _vm._v( 59708 _vm._s(_vm.errors.waktu_kejadian[0]) 59709 ), 59710 ] 59711 ) 59712 : _vm._e(), 59713 ], 59714 1 59715 ), 59716 ] 59717 : _vm._e(), 59718 _vm._v(" "), 59719 _vm.isValidPolicy && _vm.step === 2 59720 ? [ 59721 _c( 59722 "div", 59723 { staticClass: "form-group" }, 59724 [ 59725 _c("label", [_vm._v("Jenis Kejadian")]), 59726 _vm._v(" "), 59727 _c("v-select", { 59728 attrs: { 59729 options: _vm.optionIncident, 59730 reduce: function (option) { 59731 return option.value 59732 }, 59733 label: "text", 59734 }, 59735 model: { 59736 value: _vm.formData.jenis_kejadian, 59737 callback: function ($$v) { 59738 _vm.$set( 59739 _vm.formData, 59740 "jenis_kejadian", 59741 $$v 59742 ) 59743 }, 59744 expression: "formData.jenis_kejadian", 59745 }, 59746 }), 59747 _vm._v(" "), 59748 _vm.errors.jenis_kejadian 59749 ? _c( 59750 "div", 59751 { 59752 staticClass: "invalid-feedback d-block", 59753 }, 59754 [ 59755 _vm._v( 59756 "\n " + 59757 _vm._s( 59758 _vm.errors.jenis_kejadian[0] 59759 ) + 59760 "\n " 59761 ), 59762 ] 59763 ) 59764 : _vm._e(), 59765 ], 59766 1 59767 ), 59768 _vm._v(" "), 59769 _c( 59770 "div", 59771 { staticClass: "form-group" }, 59772 [ 59773 _c("label", [_vm._v("Jenis Klaim")]), 59774 _vm._v(" "), 59775 _c("v-select", { 59776 attrs: { 59777 options: _vm.optionClaimType, 59778 reduce: function (option) { 59779 return option.value 59780 }, 59781 label: "text", 59782 }, 59783 model: { 59784 value: _vm.formData.jenis_klaim, 59785 callback: function ($$v) { 59786 _vm.$set(_vm.formData, "jenis_klaim", $$v) 59787 }, 59788 expression: "formData.jenis_klaim", 59789 }, 59790 }), 59791 _vm._v(" "), 59792 _vm.errors.jenis_klaim 59793 ? _c( 59794 "div", 59795 { 59796 staticClass: "invalid-feedback d-block", 59797 }, 59798 [ 59799 _vm._v( 59800 "\n " + 59801 _vm._s(_vm.errors.jenis_klaim[0]) + 59802 "\n " 59803 ), 59804 ] 59805 ) 59806 : _vm._e(), 59807 ], 59808 1 59809 ), 59810 _vm._v(" "), 59811 _c("div", { staticClass: "form-group" }, [ 59812 _c("label", [_vm._v("Lokasi Kejadian")]), 59813 _vm._v(" "), 59814 _c("input", { 59815 directives: [ 59816 { 59817 name: "model", 59818 rawName: "v-model", 59819 value: _vm.formData.lokasi_kejadian, 59820 expression: "formData.lokasi_kejadian", 59821 }, 59822 ], 59823 staticClass: "form-control", 59824 attrs: { 59825 type: "text", 59826 placeholder: _vm.formData.lokasi_kejadian, 59827 }, 59828 domProps: { 59829 value: _vm.formData.lokasi_kejadian, 59830 }, 59831 on: { 59832 input: function ($event) { 59833 if ($event.target.composing) { 59834 return 59835 } 59836 _vm.$set( 59837 _vm.formData, 59838 "lokasi_kejadian", 59839 $event.target.value 59840 ) 59841 }, 59842 }, 59843 }), 59844 _vm._v(" "), 59845 _vm.errors.lokasi_kejadian 59846 ? _c( 59847 "div", 59848 { staticClass: "invalid-feedback d-block" }, 59849 [ 59850 _vm._v( 59851 "\n " + 59852 _vm._s( 59853 _vm.errors.lokasi_kejadian[0] 59854 ) + 59855 "\n " 59856 ), 59857 ] 59858 ) 59859 : _vm._e(), 59860 ]), 59861 _vm._v(" "), 59862 _c("div", { staticClass: "form-group" }, [ 59863 _c("label", [_vm._v("Kronologi")]), 59864 _vm._v(" "), 59865 _c("input", { 59866 directives: [ 59867 { 59868 name: "model", 59869 rawName: "v-model", 59870 value: _vm.formData.kronologi, 59871 expression: "formData.kronologi", 59872 }, 59873 ], 59874 staticClass: "form-control", 59875 attrs: { 59876 type: "text", 59877 placeholder: _vm.formData.kronologi, 59878 }, 59879 domProps: { value: _vm.formData.kronologi }, 59880 on: { 59881 input: function ($event) { 59882 if ($event.target.composing) { 59883 return 59884 } 59885 _vm.$set( 59886 _vm.formData, 59887 "kronologi", 59888 $event.target.value 59889 ) 59890 }, 59891 }, 59892 }), 59893 _vm._v(" "), 59894 _vm.errors.kronologi 59895 ? _c( 59896 "div", 59897 { staticClass: "invalid-feedback d-block" }, 59898 [ 59899 _vm._v( 59900 "\n " + 59901 _vm._s(_vm.errors.kronologi[0]) + 59902 "\n " 59903 ), 59904 ] 59905 ) 59906 : _vm._e(), 59907 ]), 59908 _vm._v(" "), 59909 _c("div", { staticClass: "form-group" }, [ 59910 _c("label", [_vm._v("Email")]), 59911 _vm._v(" "), 59912 _c("input", { 59913 directives: [ 59914 { 59915 name: "model", 59916 rawName: "v-model", 59917 value: _vm.formData.email, 59918 expression: "formData.email", 59919 }, 59920 ], 59921 staticClass: "form-control", 59922 attrs: { 59923 type: "email", 59924 placeholder: _vm.formData.email, 59925 }, 59926 domProps: { value: _vm.formData.email }, 59927 on: { 59928 input: function ($event) { 59929 if ($event.target.composing) { 59930 return 59931 } 59932 _vm.$set( 59933 _vm.formData, 59934 "email", 59935 $event.target.value 59936 ) 59937 }, 59938 }, 59939 }), 59940 _vm._v(" "), 59941 _vm.errors.email 59942 ? _c( 59943 "div", 59944 { staticClass: "invalid-feedback d-block" }, 59945 [ 59946 _vm._v( 59947 "\n " + 59948 _vm._s(_vm.errors.email[0]) + 59949 "\n " 59950 ), 59951 ] 59952 ) 59953 : _vm._e(), 59954 ]), 59955 _vm._v(" "), 59956 _c("div", { staticClass: "form-group" }, [ 59957 _c("label", [_vm._v("No KTP")]), 59958 _vm._v(" "), 59959 _c("input", { 59960 directives: [ 59961 { 59962 name: "model", 59963 rawName: "v-model", 59964 value: _vm.formData.no_ktp, 59965 expression: "formData.no_ktp", 59966 }, 59967 ], 59968 staticClass: "form-control", 59969 attrs: { 59970 type: "text", 59971 placeholder: _vm.formData.no_ktp, 59972 }, 59973 domProps: { value: _vm.formData.no_ktp }, 59974 on: { 59975 input: function ($event) { 59976 if ($event.target.composing) { 59977 return 59978 } 59979 _vm.$set( 59980 _vm.formData, 59981 "no_ktp", 59982 $event.target.value 59983 ) 59984 }, 59985 }, 59986 }), 59987 _vm._v(" "), 59988 _vm.errors.no_ktp 59989 ? _c( 59990 "div", 59991 { staticClass: "invalid-feedback d-block" }, 59992 [ 59993 _vm._v( 59994 "\n " + 59995 _vm._s(_vm.errors.no_ktp[0]) + 59996 "\n " 59997 ), 59998 ] 59999 ) 60000 : _vm._e(), 60001 ]), 60002 _vm._v(" "), 60003 _c("div", { staticClass: "form-group" }, [ 60004 _c("label", [_vm._v("Alamat")]), 60005 _vm._v(" "), 60006 _c("input", { 60007 directives: [ 60008 { 60009 name: "model", 60010 rawName: "v-model", 60011 value: _vm.formData.alamat, 60012 expression: "formData.alamat", 60013 }, 60014 ], 60015 staticClass: "form-control", 60016 attrs: { 60017 type: "text", 60018 placeholder: _vm.formData.alamat, 60019 }, 60020 domProps: { value: _vm.formData.alamat }, 60021 on: { 60022 input: function ($event) { 60023 if ($event.target.composing) { 60024 return 60025 } 60026 _vm.$set( 60027 _vm.formData, 60028 "alamat", 60029 $event.target.value 60030 ) 60031 }, 60032 }, 60033 }), 60034 _vm._v(" "), 60035 _vm.errors.alamat 60036 ? _c( 60037 "div", 60038 { staticClass: "invalid-feedback d-block" }, 60039 [ 60040 _vm._v( 60041 "\n " + 60042 _vm._s(_vm.errors.alamat[0]) + 60043 "\n " 60044 ), 60045 ] 60046 ) 60047 : _vm._e(), 60048 ]), 60049 _vm._v(" "), 60050 _c( 60051 "div", 60052 { staticClass: "form-group" }, 60053 [ 60054 _c("label", [_vm._v("Kerugian Pihak Ketiga")]), 60055 _vm._v(" "), 60056 _c("v-select", { 60057 attrs: { 60058 options: _vm.optionTjh, 60059 reduce: function (option) { 60060 return option.value 60061 }, 60062 label: "text", 60063 }, 60064 model: { 60065 value: _vm.formData.tjh, 60066 callback: function ($$v) { 60067 _vm.$set(_vm.formData, "tjh", $$v) 60068 }, 60069 expression: "formData.tjh", 60070 }, 60071 }), 60072 _vm._v(" "), 60073 _vm.errors.tjh 60074 ? _c( 60075 "div", 60076 { 60077 staticClass: "invalid-feedback d-block", 60078 }, 60079 [ 60080 _vm._v( 60081 "\n " + 60082 _vm._s(_vm.errors.tjh[0]) + 60083 "\n " 60084 ), 60085 ] 60086 ) 60087 : _vm._e(), 60088 ], 60089 1 60090 ), 60091 ] 60092 : _vm._e(), 60093 _vm._v(" "), 60094 _vm.isValidPolicy && _vm.step === 3 60095 ? [ 60096 _c( 60097 "vue-dropzone", 60098 { 60099 ref: "mediaKtp", 60100 attrs: { 60101 id: "media-ktp", 60102 options: _vm.configMedia, 60103 useCustomSlot: true, 60104 }, 60105 on: { 60106 "vdropzone-sending": _vm.sendingMediaKtp, 60107 "vdropzone-success": _vm.successMedia, 60108 "vdropzone-error": _vm.errorMedia, 60109 }, 60110 }, 60111 [ 60112 _c( 60113 "div", 60114 { staticClass: "dropzone-custom-content" }, 60115 [ 60116 _c( 60117 "h3", 60118 { staticClass: "dropzone-custom-title" }, 60119 [_vm._v("Drag and drop to upload KTP!")] 60120 ), 60121 _vm._v(" "), 60122 _c("div", { staticClass: "subtitle" }, [ 60123 _vm._v( 60124 "...or click to select a KTP from your computer" 60125 ), 60126 ]), 60127 ] 60128 ), 60129 ] 60130 ), 60131 _vm._v(" "), 60132 _c( 60133 "vue-dropzone", 60134 { 60135 ref: "mediaSim", 60136 attrs: { 60137 id: "media-sim", 60138 options: _vm.configMedia, 60139 useCustomSlot: true, 60140 }, 60141 on: { 60142 "vdropzone-sending": _vm.sendingMediaSim, 60143 "vdropzone-success": _vm.successMedia, 60144 "vdropzone-error": _vm.errorMedia, 60145 }, 60146 }, 60147 [ 60148 _c( 60149 "div", 60150 { staticClass: "dropzone-custom-content" }, 60151 [ 60152 _c( 60153 "h3", 60154 { staticClass: "dropzone-custom-title" }, 60155 [_vm._v("Drag and drop to upload SIM!")] 60156 ), 60157 _vm._v(" "), 60158 _c("div", { staticClass: "subtitle" }, [ 60159 _vm._v( 60160 "...or click to select a SIM from your computer" 60161 ), 60162 ]), 60163 ] 60164 ), 60165 ] 60166 ), 60167 _vm._v(" "), 60168 _c( 60169 "vue-dropzone", 60170 { 60171 ref: "mediaStnk", 60172 attrs: { 60173 id: "media-stnk", 60174 options: _vm.configMedia, 60175 useCustomSlot: true, 60176 }, 60177 on: { 60178 "vdropzone-sending": _vm.sendingMediaStnk, 60179 "vdropzone-success": _vm.successMedia, 60180 "vdropzone-error": _vm.errorMedia, 60181 }, 60182 }, 60183 [ 60184 _c( 60185 "div", 60186 { staticClass: "dropzone-custom-content" }, 60187 [ 60188 _c( 60189 "h3", 60190 { staticClass: "dropzone-custom-title" }, 60191 [_vm._v("Drag and drop to upload STNK!")] 60192 ), 60193 _vm._v(" "), 60194 _c("div", { staticClass: "subtitle" }, [ 60195 _vm._v( 60196 "...or click to select a STNK from your computer" 60197 ), 60198 ]), 60199 ] 60200 ), 60201 ] 60202 ), 60203 _vm._v(" "), 60204 _c( 60205 "vue-dropzone", 60206 { 60207 ref: "mediaDepan", 60208 attrs: { 60209 id: "media-depan", 60210 options: _vm.configMedia, 60211 useCustomSlot: true, 60212 }, 60213 on: { 60214 "vdropzone-sending": _vm.sendingMediaDepan, 60215 "vdropzone-success": _vm.successMedia, 60216 "vdropzone-error": _vm.errorMedia, 60217 }, 60218 }, 60219 [ 60220 _c( 60221 "div", 60222 { staticClass: "dropzone-custom-content" }, 60223 [ 60224 _c( 60225 "h3", 60226 { staticClass: "dropzone-custom-title" }, 60227 [ 60228 _vm._v( 60229 'Drag and drop to upload "Foto Depan"!' 60230 ), 60231 ] 60232 ), 60233 _vm._v(" "), 60234 _c("div", { staticClass: "subtitle" }, [ 60235 _vm._v( 60236 '...or click to select a "Foto Depan" from your computer\n ' 60237 ), 60238 ]), 60239 ] 60240 ), 60241 ] 60242 ), 60243 _vm._v(" "), 60244 _c( 60245 "vue-dropzone", 60246 { 60247 ref: "mediaDekat", 60248 attrs: { 60249 id: "media-dekat", 60250 options: _vm.configMedia, 60251 useCustomSlot: true, 60252 }, 60253 on: { 60254 "vdropzone-sending": _vm.sendingMediaDekat, 60255 "vdropzone-success": _vm.successMedia, 60256 "vdropzone-error": _vm.errorMedia, 60257 }, 60258 }, 60259 [ 60260 _c( 60261 "div", 60262 { staticClass: "dropzone-custom-content" }, 60263 [ 60264 _c( 60265 "h3", 60266 { staticClass: "dropzone-custom-title" }, 60267 [ 60268 _vm._v( 60269 'Drag and drop to upload "Foto Dekat"!' 60270 ), 60271 ] 60272 ), 60273 _vm._v(" "), 60274 _c("div", { staticClass: "subtitle" }, [ 60275 _vm._v( 60276 '...or click to select a "Foto Dekat" from your computer\n ' 60277 ), 60278 ]), 60279 ] 60280 ), 60281 ] 60282 ), 60283 _vm._v(" "), 60284 _c( 60285 "vue-dropzone", 60286 { 60287 ref: "mediaJauh", 60288 attrs: { 60289 id: "media-jauh", 60290 options: _vm.configMedia, 60291 useCustomSlot: true, 60292 }, 60293 on: { 60294 "vdropzone-sending": _vm.sendingMediaJauh, 60295 "vdropzone-success": _vm.successMedia, 60296 "vdropzone-error": _vm.errorMedia, 60297 }, 60298 }, 60299 [ 60300 _c( 60301 "div", 60302 { staticClass: "dropzone-custom-content" }, 60303 [ 60304 _c( 60305 "h3", 60306 { staticClass: "dropzone-custom-title" }, 60307 [ 60308 _vm._v( 60309 'Drag and drop to upload "Foto Jauh"!' 60310 ), 60311 ] 60312 ), 60313 _vm._v(" "), 60314 _c("div", { staticClass: "subtitle" }, [ 60315 _vm._v( 60316 '...or click to select a "Foto Jauh" from your computer\n ' 60317 ), 60318 ]), 60319 ] 60320 ), 60321 ] 60322 ), 60323 _vm._v(" "), 60324 _c( 60325 "vue-dropzone", 60326 { 60327 ref: "mediaSedang", 60328 attrs: { 60329 id: "media-sedang", 60330 options: _vm.configMedia, 60331 useCustomSlot: true, 60332 }, 60333 on: { 60334 "vdropzone-sending": _vm.sendingMediaSedang, 60335 "vdropzone-success": _vm.successMedia, 60336 "vdropzone-error": _vm.errorMedia, 60337 }, 60338 }, 60339 [ 60340 _c( 60341 "div", 60342 { staticClass: "dropzone-custom-content" }, 60343 [ 60344 _c( 60345 "h3", 60346 { staticClass: "dropzone-custom-title" }, 60347 [ 60348 _vm._v( 60349 'Drag and drop to upload "Foto Sedang"!' 60350 ), 60351 ] 60352 ), 60353 _vm._v(" "), 60354 _c("div", { staticClass: "subtitle" }, [ 60355 _vm._v( 60356 '...or click to select a "Foto Sedang" from your computer\n ' 60357 ), 60358 ]), 60359 ] 60360 ), 60361 ] 60362 ), 60363 ] 60364 : _vm._e(), 60365 _vm._v(" "), 60366 _vm.isValidPolicy && _vm.step === 4 60367 ? [ 60368 _c( 60369 "div", 60370 { staticClass: "form-group" }, 60371 [ 60372 _c("label", [_vm._v("Lokasi Bengkel")]), 60373 _vm._v(" "), 60374 _vm.loadingCity 60375 ? [ 60376 _c( 60377 "content-placeholders", 60378 [ 60379 _c("content-placeholders-text", { 60380 attrs: { lines: 2 }, 60381 }), 60382 ], 60383 1 60384 ), 60385 ] 60386 : [ 60387 _c("v-select", { 60388 attrs: { 60389 options: _vm.optionCity, 60390 reduce: function (option) { 60391 return option.value 60392 }, 60393 label: "text", 60394 }, 60395 on: { 60396 "option:selected": _vm.selectedCity, 60397 }, 60398 model: { 60399 value: _vm.formData.kota_bengkel_id, 60400 callback: function ($$v) { 60401 _vm.$set( 60402 _vm.formData, 60403 "kota_bengkel_id", 60404 $$v 60405 ) 60406 }, 60407 expression: 60408 "formData.kota_bengkel_id", 60409 }, 60410 }), 60411 ], 60412 _vm._v(" "), 60413 _vm.errors.kota_bengkel 60414 ? _c( 60415 "div", 60416 { 60417 staticClass: "invalid-feedback d-block", 60418 }, 60419 [ 60420 _vm._v( 60421 "\n " + 60422 _vm._s(_vm.errors.kota_bengkel[0]) + 60423 "\n " 60424 ), 60425 ] 60426 ) 60427 : _vm._e(), 60428 ], 60429 2 60430 ), 60431 _vm._v(" "), 60432 _vm.isHasATPM 60433 ? [ 60434 _c( 60435 "div", 60436 { staticClass: "form-group" }, 60437 [ 60438 _c("label", [_vm._v("Nama Bengkel")]), 60439 _vm._v(" "), 60440 _vm.loadingWorkshop 60441 ? [ 60442 _c( 60443 "content-placeholders", 60444 [ 60445 _c( 60446 "content-placeholders-text", 60447 { attrs: { lines: 2 } } 60448 ), 60449 ], 60450 1 60451 ), 60452 ] 60453 : [ 60454 _c("v-select", { 60455 attrs: { 60456 options: _vm.optionWorkshopName, 60457 reduce: function (option) { 60458 return option.value 60459 }, 60460 label: "text", 60461 }, 60462 model: { 60463 value: 60464 _vm.formData.nama_bengkel, 60465 callback: function ($$v) { 60466 _vm.$set( 60467 _vm.formData, 60468 "nama_bengkel", 60469 $$v 60470 ) 60471 }, 60472 expression: 60473 "formData.nama_bengkel", 60474 }, 60475 }), 60476 ], 60477 _vm._v(" "), 60478 _vm.errors.nama_bengkel 60479 ? _c( 60480 "div", 60481 { 60482 staticClass: 60483 "invalid-feedback d-block", 60484 }, 60485 [ 60486 _vm._v( 60487 "\n " + 60488 _vm._s( 60489 _vm.errors.nama_bengkel[0] 60490 ) + 60491 "\n " 60492 ), 60493 ] 60494 ) 60495 : _vm._e(), 60496 ], 60497 2 60498 ), 60499 ] 60500 : _vm._e(), 60501 ] 60502 : _vm._e(), 60503 _vm._v(" "), 60504 _vm.isValidPolicy && _vm.step > 4 60505 ? [ 60506 _c("h3", [_vm._v("Berhasil!")]), 60507 _vm._v(" "), 60508 _c("p", [ 60509 _vm._v( 60510 "Terima Kasih telah melakukan registrasi klaim, Klaim Anda akan Kami analisa lebih lanjut" 60511 ), 60512 ]), 60513 _vm._v(" "), 60514 _c("p", [ 60515 _vm._v( 60516 "Semoga Kami bisa melepas rasa cemas Anda karena kerugian tersebut." 60517 ), 60518 ]), 60519 ] 60520 : _vm._e(), 60521 _vm._v(" "), 60522 !_vm.isValidPolicy && _vm.step === 1 60523 ? _c( 60524 "button", 60525 { 60526 staticClass: "btn btn-primary btn-block", 60527 attrs: { 60528 type: "submit", 60529 disabled: _vm.submitting, 60530 }, 60531 on: { click: _vm.checkPolicy }, 60532 }, 60533 [_vm._v("CEK POLIS\n ")] 60534 ) 60535 : _vm._e(), 60536 _vm._v(" "), 60537 _vm.step > 1 && _vm.step < 4 60538 ? _c( 60539 "button", 60540 { 60541 staticClass: "btn btn-primary btn-block", 60542 attrs: { 60543 type: "submit", 60544 disabled: _vm.submitting, 60545 }, 60546 on: { click: _vm.prepareForm }, 60547 }, 60548 [_vm._v("BERIKUTNYA\n ")] 60549 ) 60550 : _vm._e(), 60551 _vm._v(" "), 60552 _vm.step === 4 60553 ? _c( 60554 "button", 60555 { 60556 staticClass: "btn btn-primary btn-block", 60557 attrs: { 60558 type: "submit", 60559 disabled: _vm.submitting, 60560 }, 60561 on: { click: _vm.claimInsurance }, 60562 }, 60563 [_vm._v("KLAIM ASURANSI\n ")] 60564 ) 60565 : _vm._e(), 60566 _vm._v(" "), 60567 _vm.step > 4 60568 ? _c("a", { attrs: { href: "/customer/list-claim" } }, [ 60569 _vm._v("PROGRESS CLAIM"), 60570 ]) 60571 : _vm._e(), 60572 ], 60573 2 60574 ), 60575 ]) 60576 : _c( 60577 "content-placeholders", 60578 [ 60579 _c("content-placeholders-heading"), 60580 _vm._v(" "), 60581 _c("content-placeholders-text", { attrs: { lines: 5 } }), 60582 ], 60583 1 60584 ), 60585 ], 60586 1 60587 ), 60588 ]), 60589 ]), 60590 ]) 60591} 60592var staticRenderFns = [] 60593render._withStripped = true 60594 60595 60596 60597/***/ }), 60598 60599/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true&": 60600/*!*************************************************************************************************************************************************************************************************************************************!*\ 60601 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true& ***! 60602 \*************************************************************************************************************************************************************************************************************************************/ 60603/*! exports provided: render, staticRenderFns */ 60604/***/ (function(module, __webpack_exports__, __webpack_require__) { 60605 60606"use strict"; 60607__webpack_require__.r(__webpack_exports__); 60608/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 60609/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 60610var render = function () { 60611 var _vm = this 60612 var _h = _vm.$createElement 60613 var _c = _vm._self._c || _h 60614 return _c("div", { staticClass: "card card-bicycle border-0" }, [ 60615 _c("div", { staticClass: "bg-grey nav-chil" }, [ 60616 _c("div", { staticClass: "container" }, [ 60617 _c("div", { staticClass: "row py-3" }, [ 60618 _vm._m(0), 60619 _vm._v(" "), 60620 _c("div", { staticClass: "nav-left" }, [ 60621 _c( 60622 "ul", 60623 { 60624 staticClass: "nav nav-pills", 60625 attrs: { id: "awardTab", role: "tablist" }, 60626 }, 60627 [ 60628 _c( 60629 "li", 60630 { staticClass: "nav-item", attrs: { role: "presentation" } }, 60631 [ 60632 _c( 60633 "a", 60634 { 60635 staticClass: "nav-link active", 60636 attrs: { 60637 "data-toggle": "tab", 60638 href: "#", 60639 role: "tab", 60640 "aria-selected": "true", 60641 }, 60642 on: { 60643 click: function ($event) { 60644 return _vm.setMainCountry(true) 60645 }, 60646 }, 60647 }, 60648 [_vm._v("Dalam\n Negeri")] 60649 ), 60650 ] 60651 ), 60652 _vm._v(" "), 60653 _c( 60654 "li", 60655 { staticClass: "nav-item", attrs: { role: "presentation" } }, 60656 [ 60657 _c( 60658 "a", 60659 { 60660 staticClass: "nav-link ", 60661 attrs: { 60662 "data-toggle": "tab", 60663 href: "#", 60664 role: "tab", 60665 "aria-selected": "false", 60666 }, 60667 on: { 60668 click: function ($event) { 60669 return _vm.setMainCountry(false) 60670 }, 60671 }, 60672 }, 60673 [_vm._v("Luar\n Negeri")] 60674 ), 60675 ] 60676 ), 60677 _vm._v(" "), 60678 _c( 60679 "li", 60680 { staticClass: "nav-item", attrs: { role: "presentation" } }, 60681 [ 60682 _c( 60683 "a", 60684 { 60685 staticClass: "nav-link ", 60686 attrs: { 60687 "data-toggle": "tab", 60688 href: "#", 60689 role: "tab", 60690 "aria-selected": "false", 60691 }, 60692 on: { 60693 click: function ($event) { 60694 return _vm.setMainCountry(true, "3") 60695 }, 60696 }, 60697 }, 60698 [_vm._v("SSE\n & SSG")] 60699 ), 60700 ] 60701 ), 60702 ] 60703 ), 60704 ]), 60705 ]), 60706 ]), 60707 ]), 60708 _vm._v(" "), 60709 _c( 60710 "div", 60711 { staticClass: "card-body" }, 60712 [ 60713 _c("div", { staticClass: "container" }, [ 60714 !_vm.loadingListData && !_vm.isDetail 60715 ? _c("div", { staticClass: "list-hospital" }, [ 60716 _c("div", { staticClass: "row justify-content-between" }, [ 60717 _vm.isMainCountry 60718 ? _c("div", { staticClass: "col-md-5" }, [ 60719 _c( 60720 "div", 60721 { staticClass: "form-group" }, 60722 [ 60723 _c("label", [_vm._v("Wilayah")]), 60724 _vm._v(" "), 60725 _c("v-select", { 60726 attrs: { 60727 options: _vm.optionProvinces, 60728 reduce: function (text) { 60729 return text.value 60730 }, 60731 label: "text", 60732 }, 60733 on: { "option:selected": _vm.getDataHospital }, 60734 model: { 60735 value: _vm.filters.province, 60736 callback: function ($$v) { 60737 _vm.$set(_vm.filters, "province", $$v) 60738 }, 60739 expression: "filters.province", 60740 }, 60741 }), 60742 ], 60743 1 60744 ), 60745 ]) 60746 : _c("div", { staticClass: "col-md-5" }, [ 60747 _c( 60748 "div", 60749 { staticClass: "form-group" }, 60750 [ 60751 _c("label", [_vm._v("Wilayah")]), 60752 _vm._v(" "), 60753 _c("v-select", { 60754 attrs: { 60755 options: _vm.optionCountries, 60756 reduce: function (text) { 60757 return text.value 60758 }, 60759 label: "text", 60760 }, 60761 on: { "option:selected": _vm.getDataHospital }, 60762 model: { 60763 value: _vm.filters.country, 60764 callback: function ($$v) { 60765 _vm.$set(_vm.filters, "country", $$v) 60766 }, 60767 expression: "filters.country", 60768 }, 60769 }), 60770 ], 60771 1 60772 ), 60773 ]), 60774 _vm._v(" "), 60775 _c("div", { staticClass: "col-md-5" }, [ 60776 _c("div", { staticClass: "form-group" }, [ 60777 _c("label", [_vm._v("Nama Rumah Sakit")]), 60778 _vm._v(" "), 60779 _c("input", { 60780 directives: [ 60781 { 60782 name: "model", 60783 rawName: "v-model", 60784 value: _vm.filters.hospital, 60785 expression: "filters.hospital", 60786 }, 60787 ], 60788 staticClass: "form-control", 60789 staticStyle: { "text-transform": "uppercase" }, 60790 attrs: { 60791 type: "text", 60792 placeholder: "Search By Hospital Name", 60793 }, 60794 domProps: { value: _vm.filters.hospital }, 60795 on: { 60796 keyup: function ($event) { 60797 if ( 60798 !$event.type.indexOf("key") && 60799 _vm._k( 60800 $event.keyCode, 60801 "enter", 60802 13, 60803 $event.key, 60804 "Enter" 60805 ) 60806 ) { 60807 return null 60808 } 60809 return _vm.getDataHospital.apply(null, arguments) 60810 }, 60811 input: function ($event) { 60812 if ($event.target.composing) { 60813 return 60814 } 60815 _vm.$set( 60816 _vm.filters, 60817 "hospital", 60818 $event.target.value 60819 ) 60820 }, 60821 }, 60822 }), 60823 ]), 60824 ]), 60825 _vm._v(" "), 60826 _c("div", { staticClass: "col-md-2" }, [ 60827 _c("div", { staticClass: "form-group" }, [ 60828 _c("label"), 60829 _vm._v(" "), 60830 _c( 60831 "a", 60832 { 60833 staticClass: 60834 "btn btn-primary btn-block text-white mt-2", 60835 on: { click: _vm.getDataHospital }, 60836 }, 60837 [ 60838 _vm._v("Cari "), 60839 _c("i", { staticClass: "fa fa-search" }), 60840 ] 60841 ), 60842 ]), 60843 ]), 60844 ]), 60845 _vm._v(" "), 60846 _c("div", { staticClass: "overflow-x" }, [ 60847 _c( 60848 "table", 60849 { staticClass: "table table-sm table-hover table-striped" }, 60850 [ 60851 _vm._m(1), 60852 _vm._v(" "), 60853 _c( 60854 "tbody", 60855 _vm._l(_vm.listData, function (data, i) { 60856 return _c( 60857 "tr", 60858 { 60859 key: data.HospitalID, 60860 attrs: { id: "row-hospital-" + data.HospitalID }, 60861 }, 60862 [ 60863 _c("td", [_vm._v(_vm._s(i + 1))]), 60864 _vm._v(" "), 60865 _c("td", [_vm._v(_vm._s(data.HospitalName))]), 60866 _vm._v(" "), 60867 _c("td", [_vm._v(_vm._s(data.HospitalTelepon))]), 60868 _vm._v(" "), 60869 _c("td", [_vm._v(_vm._s(data.HospitalAddress))]), 60870 _vm._v(" "), 60871 _c("td", [ 60872 _c( 60873 "button", 60874 { 60875 staticClass: "btn btn-success", 60876 on: { 60877 click: function ($event) { 60878 return _vm.showDetail(data.HospitalID) 60879 }, 60880 }, 60881 }, 60882 [_c("i", { staticClass: "fa fa-eye" })] 60883 ), 60884 ]), 60885 ] 60886 ) 60887 }), 60888 0 60889 ), 60890 ] 60891 ), 60892 ]), 60893 ]) 60894 : _vm._e(), 60895 ]), 60896 _vm._v(" "), 60897 _vm.loadingListData 60898 ? _c( 60899 "content-placeholders", 60900 [ 60901 _c("content-placeholders-heading"), 60902 _vm._v(" "), 60903 _c("content-placeholders-text", { attrs: { lines: 7 } }), 60904 ], 60905 1 60906 ) 60907 : _vm._e(), 60908 _vm._v(" "), 60909 _vm.isDetail 60910 ? _c("div", { staticClass: "detail-hospital" }, [ 60911 _c( 60912 "div", 60913 { staticClass: "row" }, 60914 [ 60915 _vm.loadingCoordinate 60916 ? _c( 60917 "div", 60918 { staticClass: "col-lg-12" }, 60919 [ 60920 _c( 60921 "content-placeholders", 60922 [ 60923 _c("content-placeholders-heading", { 60924 attrs: { img: true }, 60925 }), 60926 _vm._v(" "), 60927 _c("content-placeholders-text", { 60928 attrs: { lines: 1 }, 60929 }), 60930 ], 60931 1 60932 ), 60933 ], 60934 1 60935 ) 60936 : _vm._e(), 60937 _vm._v(" "), 60938 _vm.details.coordinate.longitude !== "0" && 60939 _vm.details.coordinate.longitude !== "0" 60940 ? _c("div", { staticClass: "col-lg-12" }, [ 60941 _vm._m(2), 60942 _vm._v(" "), 60943 _c("iframe", { 60944 staticStyle: { border: "0" }, 60945 attrs: { 60946 src: 60947 "https://maps.google.com/maps?q=" + 60948 _vm.details.coordinate.latitude + 60949 "," + 60950 _vm.details.coordinate.longitude + 60951 "&z=15&output=embed", 60952 width: "100%", 60953 height: "270", 60954 frameborder: "0", 60955 }, 60956 }), 60957 ]) 60958 : _vm._e(), 60959 _vm._v(" "), 60960 _vm.loadingRate 60961 ? _c( 60962 "content-placeholders", 60963 [ 60964 _c("content-placeholders-heading"), 60965 _vm._v(" "), 60966 _c("content-placeholders-text", { 60967 attrs: { lines: 3 }, 60968 }), 60969 ], 60970 1 60971 ) 60972 : _vm._e(), 60973 _vm._v(" "), 60974 !_vm.loadingRate 60975 ? _c("div", { staticClass: "col-lg-12" }, [ 60976 _vm._m(3), 60977 _vm._v(" "), 60978 _c( 60979 "table", 60980 { 60981 staticClass: 60982 "table table-sm table-hover table-striped table-bordered", 60983 }, 60984 [ 60985 _vm._m(4), 60986 _vm._v(" "), 60987 _c( 60988 "tbody", 60989 _vm._l(_vm.details.rates, function (data, i) { 60990 return _c( 60991 "tr", 60992 { 60993 key: data.HRBID, 60994 attrs: { id: "row-rate-" + data.HRBID }, 60995 }, 60996 [ 60997 _c("td", { staticClass: "text-center" }, [ 60998 _vm._v(_vm._s(i + 1)), 60999 ]), 61000 _vm._v(" "), 61001 _c("td", [_vm._v(_vm._s(data.HRBName))]), 61002 _vm._v(" "), 61003 _c("td", { staticClass: "text-right" }, [ 61004 _vm._v( 61005 _vm._s(_vm.formatPrice(data.HRBPRICE)) 61006 ), 61007 ]), 61008 ] 61009 ) 61010 }), 61011 0 61012 ), 61013 ] 61014 ), 61015 ]) 61016 : _vm._e(), 61017 _vm._v(" "), 61018 _vm.loadingSchedule 61019 ? _c( 61020 "content-placeholders", 61021 [ 61022 _c("content-placeholders-heading"), 61023 _vm._v(" "), 61024 _c("content-placeholders-text", { 61025 attrs: { lines: 5 }, 61026 }), 61027 ], 61028 1 61029 ) 61030 : _vm._e(), 61031 _vm._v(" "), 61032 !_vm.loadingSchedule 61033 ? _c("div", { staticClass: "col-lg-12" }, [ 61034 _vm._m(5), 61035 _vm._v(" "), 61036 _c( 61037 "table", 61038 { 61039 staticClass: 61040 "table table-sm table-hover table-striped table-bordered", 61041 }, 61042 [ 61043 _vm._m(6), 61044 _vm._v(" "), 61045 _c("tbody", [ 61046 _c( 61047 "tr", 61048 _vm._l(_vm.optionDays, function (day) { 61049 return _c("td", [ 61050 _c( 61051 "ol", 61052 _vm._l( 61053 _vm.details.schedules[day], 61054 function (sc) { 61055 return _c("li", [ 61056 _c("strong", [ 61057 _vm._v(_vm._s(sc.NamaDokter)), 61058 ]), 61059 _c("br"), 61060 _vm._v( 61061 "\n " + 61062 _vm._s(sc.JenisDokter) + 61063 "\n\n " 61064 ), 61065 _c("em", [ 61066 _vm._v( 61067 _vm._s(sc.JamInPraktek) + 61068 " - " + 61069 _vm._s(sc.JamOutPraktek) 61070 ), 61071 ]), 61072 ]) 61073 } 61074 ), 61075 0 61076 ), 61077 ]) 61078 }), 61079 0 61080 ), 61081 ]), 61082 ] 61083 ), 61084 _vm._v(" "), 61085 !_vm.loadingSchedule 61086 ? _c("div", { staticClass: "col-lg-12" }, [ 61087 _vm._m(7), 61088 _vm._v(" "), 61089 _c("p", [ 61090 _vm._v( 61091 "Disarankan sebelum penentuan harga kamar dan Jadwal Dokter agar konfirmasi ke rumah sakit dituju terlebih dahulu." 61092 ), 61093 ]), 61094 ]) 61095 : _vm._e(), 61096 ]) 61097 : _vm._e(), 61098 ], 61099 1 61100 ), 61101 ]) 61102 : _vm._e(), 61103 ], 61104 1 61105 ), 61106 _vm._v(" "), 61107 _c("div", { staticClass: "card-footer" }, [ 61108 _vm.isDetail 61109 ? _c( 61110 "button", 61111 { 61112 staticClass: "btn btn-success", 61113 attrs: { type: "button" }, 61114 on: { 61115 click: function ($event) { 61116 _vm.isDetail = !_vm.isDetail 61117 }, 61118 }, 61119 }, 61120 [_vm._v("Back")] 61121 ) 61122 : _vm._e(), 61123 ]), 61124 ]) 61125} 61126var staticRenderFns = [ 61127 function () { 61128 var _vm = this 61129 var _h = _vm.$createElement 61130 var _c = _vm._self._c || _h 61131 return _c("div", { staticClass: "col-md-4" }, [ 61132 _c("h5", { staticClass: "text-uppercase" }, [ 61133 _vm._v("Rumah Sakit Provider"), 61134 ]), 61135 ]) 61136 }, 61137 function () { 61138 var _vm = this 61139 var _h = _vm.$createElement 61140 var _c = _vm._self._c || _h 61141 return _c("thead", [ 61142 _c("tr", [ 61143 _c("th", { staticClass: "text-center" }, [_vm._v("No")]), 61144 _vm._v(" "), 61145 _c("th", { staticClass: "text-center" }, [_vm._v("Name")]), 61146 _vm._v(" "), 61147 _c("th", { staticClass: "text-center" }, [_vm._v("Phone")]), 61148 _vm._v(" "), 61149 _c("th", { staticClass: "text-center" }, [_vm._v("Address")]), 61150 _vm._v(" "), 61151 _c("th", { staticClass: "text-center" }, [_vm._v("Detail")]), 61152 ]), 61153 ]) 61154 }, 61155 function () { 61156 var _vm = this 61157 var _h = _vm.$createElement 61158 var _c = _vm._self._c || _h 61159 return _c("h3", [ 61160 _c("i", { staticClass: "fa fa-map-pin" }), 61161 _vm._v(" Location :"), 61162 ]) 61163 }, 61164 function () { 61165 var _vm = this 61166 var _h = _vm.$createElement 61167 var _c = _vm._self._c || _h 61168 return _c("h3", [ 61169 _c("i", { staticClass: "fa fa-dollar" }), 61170 _vm._v(" Room and Rates"), 61171 ]) 61172 }, 61173 function () { 61174 var _vm = this 61175 var _h = _vm.$createElement 61176 var _c = _vm._self._c || _h 61177 return _c("thead", [ 61178 _c("tr", [ 61179 _c("th", { staticClass: "text-center" }, [_vm._v("No")]), 61180 _vm._v(" "), 61181 _c("th", { staticClass: "text-left" }, [_vm._v("Name")]), 61182 _vm._v(" "), 61183 _c("th", { staticClass: "text-right" }, [_vm._v("Price")]), 61184 ]), 61185 ]) 61186 }, 61187 function () { 61188 var _vm = this 61189 var _h = _vm.$createElement 61190 var _c = _vm._self._c || _h 61191 return _c("h3", [ 61192 _c("i", { staticClass: "fa fa-clock" }), 61193 _vm._v(" Schedule"), 61194 ]) 61195 }, 61196 function () { 61197 var _vm = this 61198 var _h = _vm.$createElement 61199 var _c = _vm._self._c || _h 61200 return _c("thead", [ 61201 _c("tr", [ 61202 _c("th", { staticClass: "text-center", attrs: { colspan: "7" } }, [ 61203 _vm._v("Hari"), 61204 ]), 61205 ]), 61206 _vm._v(" "), 61207 _c("tr", [ 61208 _c("th", { staticClass: "text-center" }, [_vm._v("Senin")]), 61209 _vm._v(" "), 61210 _c("th", { staticClass: "text-center" }, [_vm._v("Selasa")]), 61211 _vm._v(" "), 61212 _c("th", { staticClass: "text-center" }, [_vm._v("Rabu")]), 61213 _vm._v(" "), 61214 _c("th", { staticClass: "text-center" }, [_vm._v("Kamis")]), 61215 _vm._v(" "), 61216 _c("th", { staticClass: "text-center" }, [_vm._v("Jumat")]), 61217 _vm._v(" "), 61218 _c("th", { staticClass: "text-center" }, [_vm._v("Sabtu")]), 61219 _vm._v(" "), 61220 _c("th", { staticClass: "text-center" }, [_vm._v("Minggu")]), 61221 ]), 61222 ]) 61223 }, 61224 function () { 61225 var _vm = this 61226 var _h = _vm.$createElement 61227 var _c = _vm._self._c || _h 61228 return _c("p", [ 61229 _vm._v( 61230 "Informasi harga kamar dan jadwal dokter rumah sakit yang terdapat di sinarmas.co.id bersifat sebagai sarana informasi dan bukan untuk tujuan komersial dan atau transaksi lainnya. " 61231 ), 61232 _c("b", [_vm._v("Asuransi Sinar Mas (ASM)")]), 61233 _vm._v( 61234 " selalu berupaya untuk menampilkan informasi seakurat mungkin, tetapi ASM tidak bertanggung jawab atas keterlambatan dalam memperbarui data atau informasi, atau atas segala kerugian yang timbul karena tindakan yang berkaitan dengan penggunaan informasi yang disajikan." 61235 ), 61236 ]) 61237 }, 61238] 61239render._withStripped = true 61240 61241 61242 61243/***/ }), 61244 61245/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=template&id=04184a1f&": 61246/*!******************************************************************************************************************************************************************************************************************************!*\ 61247 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=template&id=04184a1f& ***! 61248 \******************************************************************************************************************************************************************************************************************************/ 61249/*! exports provided: render, staticRenderFns */ 61250/***/ (function(module, __webpack_exports__, __webpack_require__) { 61251 61252"use strict"; 61253__webpack_require__.r(__webpack_exports__); 61254/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 61255/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 61256var render = function () { 61257 var _vm = this 61258 var _h = _vm.$createElement 61259 var _c = _vm._self._c || _h 61260 return _c( 61261 "div", 61262 { staticClass: "card card-bicycle card-product rounded-0" }, 61263 [ 61264 _c("div", { staticClass: "card-header d-none" }, [ 61265 _c("h3", [_vm._v(_vm._s(_vm.formData.business_name) + " Insurance")]), 61266 ]), 61267 _vm._v(" "), 61268 _c( 61269 "div", 61270 { staticClass: "card-body" }, 61271 [ 61272 !_vm.submitting 61273 ? [ 61274 _vm.currentPage === 1 61275 ? _c("div", { attrs: { id: "step-1" } }, [ 61276 _vm._m(0), 61277 _vm._v(" "), 61278 _c("div", { staticClass: "form-group" }, [ 61279 _vm._m(1), 61280 _vm._v(" "), 61281 _c("input", { 61282 directives: [ 61283 { 61284 name: "model", 61285 rawName: "v-model", 61286 value: _vm.formData.first_name, 61287 expression: "formData.first_name", 61288 }, 61289 ], 61290 staticClass: "form-control", 61291 attrs: { type: "text" }, 61292 domProps: { value: _vm.formData.first_name }, 61293 on: { 61294 input: function ($event) { 61295 if ($event.target.composing) { 61296 return 61297 } 61298 _vm.$set( 61299 _vm.formData, 61300 "first_name", 61301 $event.target.value 61302 ) 61303 }, 61304 }, 61305 }), 61306 _vm._v(" "), 61307 _vm.errors.first_name 61308 ? _c( 61309 "div", 61310 { staticClass: "invalid-feedback d-block" }, 61311 [_vm._v(_vm._s(_vm.errors.first_name[0]))] 61312 ) 61313 : _vm._e(), 61314 ]), 61315 _vm._v(" "), 61316 _c("div", { staticClass: "form-group" }, [ 61317 _c("label", [_vm._v("Nama Belakang")]), 61318 _vm._v(" "), 61319 _c("input", { 61320 directives: [ 61321 { 61322 name: "model", 61323 rawName: "v-model", 61324 value: _vm.formData.last_name, 61325 expression: "formData.last_name", 61326 }, 61327 ], 61328 staticClass: "form-control", 61329 attrs: { type: "text" }, 61330 domProps: { value: _vm.formData.last_name }, 61331 on: { 61332 input: function ($event) { 61333 if ($event.target.composing) { 61334 return 61335 } 61336 _vm.$set( 61337 _vm.formData, 61338 "last_name", 61339 $event.target.value 61340 ) 61341 }, 61342 }, 61343 }), 61344 _vm._v(" "), 61345 _vm.errors.last_name 61346 ? _c( 61347 "div", 61348 { staticClass: "invalid-feedback d-block" }, 61349 [_vm._v(_vm._s(_vm.errors.last_name[0]))] 61350 ) 61351 : _vm._e(), 61352 ]), 61353 _vm._v(" "), 61354 _c( 61355 "div", 61356 { staticClass: "form-check form-check-inline" }, 61357 [ 61358 _c("input", { 61359 directives: [ 61360 { 61361 name: "model", 61362 rawName: "v-model", 61363 value: _vm.formData.gender, 61364 expression: "formData.gender", 61365 }, 61366 ], 61367 staticClass: "form-check-input", 61368 attrs: { type: "radio", value: "1" }, 61369 domProps: { 61370 checked: _vm._q(_vm.formData.gender, "1"), 61371 }, 61372 on: { 61373 change: function ($event) { 61374 return _vm.$set(_vm.formData, "gender", "1") 61375 }, 61376 }, 61377 }), 61378 _vm._v(" "), 61379 _c("label", { staticClass: "form-check-label" }, [ 61380 _vm._v("Laki-Laki"), 61381 ]), 61382 ] 61383 ), 61384 _vm._v(" "), 61385 _c( 61386 "div", 61387 { staticClass: "form-check form-check-inline" }, 61388 [ 61389 _c("input", { 61390 directives: [ 61391 { 61392 name: "model", 61393 rawName: "v-model", 61394 value: _vm.formData.gender, 61395 expression: "formData.gender", 61396 }, 61397 ], 61398 staticClass: "form-check-input", 61399 attrs: { type: "radio", value: "2" }, 61400 domProps: { 61401 checked: _vm._q(_vm.formData.gender, "2"), 61402 }, 61403 on: { 61404 change: function ($event) { 61405 return _vm.$set(_vm.formData, "gender", "2") 61406 }, 61407 }, 61408 }), 61409 _vm._v(" "), 61410 _c("label", { staticClass: "form-check-label" }, [ 61411 _vm._v("Perempuan"), 61412 ]), 61413 ] 61414 ), 61415 _vm._v(" "), 61416 _c("div", { staticClass: "form-group" }, [ 61417 _vm._m(2), 61418 _vm._v(" "), 61419 _c("input", { 61420 directives: [ 61421 { 61422 name: "model", 61423 rawName: "v-model", 61424 value: _vm.formData.hand_phone, 61425 expression: "formData.hand_phone", 61426 }, 61427 ], 61428 staticClass: "form-control", 61429 attrs: { type: "text" }, 61430 domProps: { value: _vm.formData.hand_phone }, 61431 on: { 61432 input: function ($event) { 61433 if ($event.target.composing) { 61434 return 61435 } 61436 _vm.$set( 61437 _vm.formData, 61438 "hand_phone", 61439 $event.target.value 61440 ) 61441 }, 61442 }, 61443 }), 61444 _vm._v(" "), 61445 _vm.errors.hand_phone 61446 ? _c( 61447 "div", 61448 { staticClass: "invalid-feedback d-block" }, 61449 [ 61450 _vm._v( 61451 "\n " + 61452 _vm._s(_vm.errors.hand_phone[0]) + 61453 "\n " 61454 ), 61455 ] 61456 ) 61457 : _vm._e(), 61458 ]), 61459 _vm._v(" "), 61460 _c("div", { staticClass: "form-group" }, [ 61461 _vm._m(3), 61462 _vm._v(" "), 61463 _c("input", { 61464 directives: [ 61465 { 61466 name: "model", 61467 rawName: "v-model", 61468 value: _vm.formData.email, 61469 expression: "formData.email", 61470 }, 61471 ], 61472 staticClass: "form-control", 61473 attrs: { type: "email" }, 61474 domProps: { value: _vm.formData.email }, 61475 on: { 61476 input: function ($event) { 61477 if ($event.target.composing) { 61478 return 61479 } 61480 _vm.$set( 61481 _vm.formData, 61482 "email", 61483 $event.target.value 61484 ) 61485 }, 61486 }, 61487 }), 61488 _vm._v(" "), 61489 _vm.errors.email 61490 ? _c( 61491 "div", 61492 { staticClass: "invalid-feedback d-block" }, 61493 [ 61494 _vm._v( 61495 "\n " + 61496 _vm._s(_vm.errors.email[0]) + 61497 "\n " 61498 ), 61499 ] 61500 ) 61501 : _vm._e(), 61502 ]), 61503 ]) 61504 : _vm._e(), 61505 _vm._v(" "), 61506 _vm.currentPage === 2 61507 ? _c("div", { attrs: { id: "step-2" } }, [ 61508 _c("div", { staticClass: "row" }, [ 61509 _c("div", { staticClass: "col-md-6" }, [ 61510 _c("div", { staticClass: "form-group" }, [ 61511 _c("label", [_vm._v("Tanggal Mulai")]), 61512 _vm._v(" "), 61513 _c("input", { 61514 directives: [ 61515 { 61516 name: "model", 61517 rawName: "v-model", 61518 value: _vm.formData.start_date, 61519 expression: "formData.start_date", 61520 }, 61521 ], 61522 staticClass: "form-control", 61523 attrs: { type: "text", readonly: "" }, 61524 domProps: { value: _vm.formData.start_date }, 61525 on: { 61526 input: function ($event) { 61527 if ($event.target.composing) { 61528 return 61529 } 61530 _vm.$set( 61531 _vm.formData, 61532 "start_date", 61533 $event.target.value 61534 ) 61535 }, 61536 }, 61537 }), 61538 _vm._v(" "), 61539 _vm.errors.start_date 61540 ? _c( 61541 "small", 61542 { staticClass: "form-text text-danger" }, 61543 [_vm._v(_vm._s(_vm.errors.start_date[0]))] 61544 ) 61545 : _vm._e(), 61546 ]), 61547 ]), 61548 _vm._v(" "), 61549 _c("div", { staticClass: "col-md-6" }, [ 61550 _c("div", { staticClass: "form-group" }, [ 61551 _c("label", [_vm._v("Tanggal Berakhir")]), 61552 _vm._v(" "), 61553 _c("input", { 61554 directives: [ 61555 { 61556 name: "model", 61557 rawName: "v-model", 61558 value: _vm.formData.end_date, 61559 expression: "formData.end_date", 61560 }, 61561 ], 61562 staticClass: "form-control", 61563 attrs: { type: "text", readonly: "" }, 61564 domProps: { value: _vm.formData.end_date }, 61565 on: { 61566 input: function ($event) { 61567 if ($event.target.composing) { 61568 return 61569 } 61570 _vm.$set( 61571 _vm.formData, 61572 "end_date", 61573 $event.target.value 61574 ) 61575 }, 61576 }, 61577 }), 61578 _vm._v(" "), 61579 _vm.errors.end_date 61580 ? _c( 61581 "small", 61582 { staticClass: "form-text text-danger" }, 61583 [_vm._v(_vm._s(_vm.errors.end_date[0]))] 61584 ) 61585 : _vm._e(), 61586 ]), 61587 ]), 61588 ]), 61589 _vm._v(" "), 61590 _c( 61591 "div", 61592 { staticClass: "form-group" }, 61593 [ 61594 _c("label", [_vm._v("Paket")]), 61595 _vm._v(" "), 61596 _c("v-select", { 61597 attrs: { 61598 options: _vm.optionPackets, 61599 reduce: function (text) { 61600 return text.value 61601 }, 61602 label: "text", 61603 }, 61604 model: { 61605 value: _vm.formData.type_of_packet, 61606 callback: function ($$v) { 61607 _vm.$set(_vm.formData, "type_of_packet", $$v) 61608 }, 61609 expression: "formData.type_of_packet", 61610 }, 61611 }), 61612 _vm._v(" "), 61613 _vm.errors.type_of_packet 61614 ? _c( 61615 "div", 61616 { staticClass: "invalid-feedback d-block" }, 61617 [ 61618 _vm._v( 61619 "\n " + 61620 _vm._s(_vm.errors.type_of_packet[0]) + 61621 "\n " 61622 ), 61623 ] 61624 ) 61625 : _vm._e(), 61626 ], 61627 1 61628 ), 61629 _vm._v(" "), 61630 _c( 61631 "div", 61632 { staticClass: "form-group" }, 61633 [ 61634 _c("label", [_vm._v("Objek Pertanggungan")]), 61635 _vm._v(" "), 61636 _c("v-select", { 61637 attrs: { 61638 options: _vm.optionItemCodes, 61639 reduce: function (text) { 61640 return text.value 61641 }, 61642 label: "text", 61643 }, 61644 model: { 61645 value: _vm.formData.property_item_code, 61646 callback: function ($$v) { 61647 _vm.$set( 61648 _vm.formData, 61649 "property_item_code", 61650 $$v 61651 ) 61652 }, 61653 expression: "formData.property_item_code", 61654 }, 61655 }), 61656 _vm._v(" "), 61657 _vm.errors.property_item_code 61658 ? _c( 61659 "div", 61660 { staticClass: "invalid-feedback d-block" }, 61661 [ 61662 _vm._v( 61663 "\n " + 61664 _vm._s(_vm.errors.property_item_code[0]) + 61665 "\n " 61666 ), 61667 ] 61668 ) 61669 : _vm._e(), 61670 ], 61671 1 61672 ), 61673 _vm._v(" "), 61674 _c("div", { staticClass: "form-group" }, [ 61675 _c("label", [_vm._v("Harga Bangunan")]), 61676 _vm._v(" "), 61677 _c("input", { 61678 directives: [ 61679 { 61680 name: "model", 61681 rawName: "v-model", 61682 value: _vm.formData.tsi, 61683 expression: "formData.tsi", 61684 }, 61685 ], 61686 staticClass: "form-control", 61687 attrs: { type: "number", min: "1000000" }, 61688 domProps: { value: _vm.formData.tsi }, 61689 on: { 61690 input: function ($event) { 61691 if ($event.target.composing) { 61692 return 61693 } 61694 _vm.$set(_vm.formData, "tsi", $event.target.value) 61695 }, 61696 }, 61697 }), 61698 _vm._v(" "), 61699 _vm.errors.tsi 61700 ? _c( 61701 "div", 61702 { staticClass: "invalid-feedback d-block" }, 61703 [ 61704 _vm._v( 61705 "\n " + 61706 _vm._s(_vm.errors.tsi[0]) + 61707 "\n " 61708 ), 61709 ] 61710 ) 61711 : _vm._e(), 61712 ]), 61713 _vm._v(" "), 61714 _c("div", { staticClass: "form-group" }, [ 61715 _vm._m(4), 61716 _vm._v(" "), 61717 _c("textarea", { 61718 directives: [ 61719 { 61720 name: "model", 61721 rawName: "v-model", 61722 value: _vm.formData.property_address, 61723 expression: "formData.property_address", 61724 }, 61725 ], 61726 staticClass: "form-control", 61727 domProps: { value: _vm.formData.property_address }, 61728 on: { 61729 input: function ($event) { 61730 if ($event.target.composing) { 61731 return 61732 } 61733 _vm.$set( 61734 _vm.formData, 61735 "property_address", 61736 $event.target.value 61737 ) 61738 }, 61739 }, 61740 }), 61741 _vm._v(" "), 61742 _vm.errors.property_address 61743 ? _c( 61744 "div", 61745 { staticClass: "invalid-feedback d-block" }, 61746 [ 61747 _vm._v( 61748 "\n " + 61749 _vm._s(_vm.errors.property_address[0]) + 61750 "\n " 61751 ), 61752 ] 61753 ) 61754 : _vm._e(), 61755 ]), 61756 _vm._v(" "), 61757 _c("div", { staticClass: "form-group" }, [ 61758 _c("label", [_vm._v("Kodepos")]), 61759 _vm._v(" "), 61760 _c("input", { 61761 directives: [ 61762 { 61763 name: "model", 61764 rawName: "v-model", 61765 value: _vm.formData.property_zip_code, 61766 expression: "formData.property_zip_code", 61767 }, 61768 ], 61769 staticClass: "form-control", 61770 attrs: { type: "text", maxlength: "5" }, 61771 domProps: { value: _vm.formData.property_zip_code }, 61772 on: { 61773 input: function ($event) { 61774 if ($event.target.composing) { 61775 return 61776 } 61777 _vm.$set( 61778 _vm.formData, 61779 "property_zip_code", 61780 $event.target.value 61781 ) 61782 }, 61783 }, 61784 }), 61785 _vm._v(" "), 61786 _vm.errors.property_zip_code 61787 ? _c( 61788 "div", 61789 { staticClass: "invalid-feedback d-block" }, 61790 [ 61791 _vm._v( 61792 "\n " + 61793 _vm._s(_vm.errors.property_zip_code[0]) + 61794 "\n " 61795 ), 61796 ] 61797 ) 61798 : _vm._e(), 61799 ]), 61800 _vm._v(" "), 61801 _c( 61802 "div", 61803 { staticClass: "form-group" }, 61804 [ 61805 _c("label", [_vm._v("Tipe Jalan")]), 61806 _vm._v(" "), 61807 _c("v-select", { 61808 attrs: { options: _vm.optionRoadTypes }, 61809 model: { 61810 value: _vm.formData.property_road_type, 61811 callback: function ($$v) { 61812 _vm.$set( 61813 _vm.formData, 61814 "property_road_type", 61815 $$v 61816 ) 61817 }, 61818 expression: "formData.property_road_type", 61819 }, 61820 }), 61821 _vm._v(" "), 61822 _vm.errors.property_road_type 61823 ? _c( 61824 "div", 61825 { staticClass: "invalid-feedback d-block" }, 61826 [ 61827 _vm._v( 61828 "\n " + 61829 _vm._s(_vm.errors.property_road_type[0]) + 61830 "\n " 61831 ), 61832 ] 61833 ) 61834 : _vm._e(), 61835 ], 61836 1 61837 ), 61838 _vm._v(" "), 61839 _c("div", { staticClass: "form-group" }, [ 61840 _c("label", [_vm._v("Nama Jalan")]), 61841 _vm._v(" "), 61842 _c("input", { 61843 directives: [ 61844 { 61845 name: "model", 61846 rawName: "v-model", 61847 value: _vm.formData.property_road_name, 61848 expression: "formData.property_road_name", 61849 }, 61850 ], 61851 staticClass: "form-control", 61852 attrs: { type: "text" }, 61853 domProps: { value: _vm.formData.property_road_name }, 61854 on: { 61855 input: function ($event) { 61856 if ($event.target.composing) { 61857 return 61858 } 61859 _vm.$set( 61860 _vm.formData, 61861 "property_road_name", 61862 $event.target.value 61863 ) 61864 }, 61865 }, 61866 }), 61867 _vm._v(" "), 61868 _vm.errors.property_road_name 61869 ? _c( 61870 "div", 61871 { staticClass: "invalid-feedback d-block" }, 61872 [ 61873 _vm._v( 61874 "\n " + 61875 _vm._s(_vm.errors.property_road_name[0]) + 61876 "\n " 61877 ), 61878 ] 61879 ) 61880 : _vm._e(), 61881 ]), 61882 _vm._v(" "), 61883 _c("div", { staticClass: "form-group" }, [ 61884 _vm._m(5), 61885 _vm._v(" "), 61886 _c("input", { 61887 directives: [ 61888 { 61889 name: "model", 61890 rawName: "v-model", 61891 value: _vm.formData.property_building_no, 61892 expression: "formData.property_building_no", 61893 }, 61894 ], 61895 staticClass: "form-control", 61896 attrs: { type: "number" }, 61897 domProps: { 61898 value: _vm.formData.property_building_no, 61899 }, 61900 on: { 61901 input: function ($event) { 61902 if ($event.target.composing) { 61903 return 61904 } 61905 _vm.$set( 61906 _vm.formData, 61907 "property_building_no", 61908 $event.target.value 61909 ) 61910 }, 61911 }, 61912 }), 61913 _vm._v(" "), 61914 _vm.errors.property_building_no 61915 ? _c( 61916 "div", 61917 { staticClass: "invalid-feedback d-block" }, 61918 [ 61919 _vm._v( 61920 "\n " + 61921 _vm._s(_vm.errors.property_building_no[0]) + 61922 "\n " 61923 ), 61924 ] 61925 ) 61926 : _vm._e(), 61927 ]), 61928 _vm._v(" "), 61929 _c( 61930 "div", 61931 { staticClass: "form-group" }, 61932 [ 61933 _vm._m(6), 61934 _vm._v(" "), 61935 _c("v-select", { 61936 attrs: { 61937 options: _vm.optionFloorTypes, 61938 reduce: function (text) { 61939 return text.value 61940 }, 61941 label: "text", 61942 }, 61943 model: { 61944 value: _vm.formData.property_floor_type, 61945 callback: function ($$v) { 61946 _vm.$set( 61947 _vm.formData, 61948 "property_floor_type", 61949 $$v 61950 ) 61951 }, 61952 expression: "formData.property_floor_type", 61953 }, 61954 }), 61955 _vm._v(" "), 61956 _vm.errors.property_floor_type 61957 ? _c( 61958 "div", 61959 { staticClass: "invalid-feedback d-block" }, 61960 [ 61961 _vm._v( 61962 "\n " + 61963 _vm._s( 61964 _vm.errors.property_floor_type[0] 61965 ) + 61966 "\n " 61967 ), 61968 ] 61969 ) 61970 : _vm._e(), 61971 ], 61972 1 61973 ), 61974 _vm._v(" "), 61975 _c("div", { staticClass: "form-group" }, [ 61976 _vm._m(7), 61977 _vm._v(" "), 61978 _c("input", { 61979 directives: [ 61980 { 61981 name: "model", 61982 rawName: "v-model", 61983 value: _vm.formData.property_number_of_floor, 61984 expression: "formData.property_number_of_floor", 61985 }, 61986 ], 61987 staticClass: "form-control", 61988 attrs: { type: "text" }, 61989 domProps: { 61990 value: _vm.formData.property_number_of_floor, 61991 }, 61992 on: { 61993 input: function ($event) { 61994 if ($event.target.composing) { 61995 return 61996 } 61997 _vm.$set( 61998 _vm.formData, 61999 "property_number_of_floor", 62000 $event.target.value 62001 ) 62002 }, 62003 }, 62004 }), 62005 _vm._v(" "), 62006 _vm.errors.property_number_of_floor 62007 ? _c( 62008 "div", 62009 { staticClass: "invalid-feedback d-block" }, 62010 [ 62011 _vm._v( 62012 "\n " + 62013 _vm._s( 62014 _vm.errors.property_number_of_floor[0] 62015 ) + 62016 "\n " 62017 ), 62018 ] 62019 ) 62020 : _vm._e(), 62021 ]), 62022 _vm._v(" "), 62023 _c( 62024 "div", 62025 { staticClass: "form-group" }, 62026 [ 62027 _vm._m(8), 62028 _vm._v(" "), 62029 _c("v-select", { 62030 attrs: { 62031 options: _vm.optionRoofTypes, 62032 reduce: function (text) { 62033 return text.value 62034 }, 62035 label: "text", 62036 }, 62037 model: { 62038 value: _vm.formData.property_roof_type, 62039 callback: function ($$v) { 62040 _vm.$set( 62041 _vm.formData, 62042 "property_roof_type", 62043 $$v 62044 ) 62045 }, 62046 expression: "formData.property_roof_type", 62047 }, 62048 }), 62049 _vm._v(" "), 62050 _vm.errors.property_roof_type 62051 ? _c( 62052 "div", 62053 { staticClass: "invalid-feedback d-block" }, 62054 [ 62055 _vm._v( 62056 "\n " + 62057 _vm._s(_vm.errors.property_roof_type[0]) + 62058 "\n " 62059 ), 62060 ] 62061 ) 62062 : _vm._e(), 62063 ], 62064 1 62065 ), 62066 _vm._v(" "), 62067 _c( 62068 "div", 62069 { staticClass: "form-group" }, 62070 [ 62071 _vm._m(9), 62072 _vm._v(" "), 62073 _c("v-select", { 62074 attrs: { 62075 options: _vm.optionWallTypes, 62076 reduce: function (text) { 62077 return text.value 62078 }, 62079 label: "text", 62080 }, 62081 model: { 62082 value: _vm.formData.property_wall_type, 62083 callback: function ($$v) { 62084 _vm.$set( 62085 _vm.formData, 62086 "property_wall_type", 62087 $$v 62088 ) 62089 }, 62090 expression: "formData.property_wall_type", 62091 }, 62092 }), 62093 _vm._v(" "), 62094 _vm.errors.property_wall_type 62095 ? _c( 62096 "div", 62097 { staticClass: "invalid-feedback d-block" }, 62098 [ 62099 _vm._v( 62100 "\n " + 62101 _vm._s(_vm.errors.property_wall_type[0]) + 62102 "\n " 62103 ), 62104 ] 62105 ) 62106 : _vm._e(), 62107 ], 62108 1 62109 ), 62110 _vm._v(" "), 62111 _c( 62112 "div", 62113 { staticClass: "form-group" }, 62114 [ 62115 _vm._m(10), 62116 _vm._v(" "), 62117 _c("v-select", { 62118 attrs: { 62119 options: _vm.optionConstructions, 62120 reduce: function (text) { 62121 return text.value 62122 }, 62123 label: "text", 62124 }, 62125 model: { 62126 value: _vm.formData.property_construction, 62127 callback: function ($$v) { 62128 _vm.$set( 62129 _vm.formData, 62130 "property_construction", 62131 $$v 62132 ) 62133 }, 62134 expression: "formData.property_construction", 62135 }, 62136 }), 62137 _vm._v(" "), 62138 _c("label", [ 62139 _vm._v( 62140 "Simas Rumah Hemat ++ hanya menjamin bangunan dengan Konstruksi Kelas 1 / 90% material konstruksinya merupakan bahan yang tidak dapat terbakar" 62141 ), 62142 ]), 62143 _vm._v(" "), 62144 _vm.errors.property_construction 62145 ? _c( 62146 "div", 62147 { staticClass: "invalid-feedback d-block" }, 62148 [ 62149 _vm._v( 62150 "\n " + 62151 _vm._s( 62152 _vm.errors.property_construction[0] 62153 ) + 62154 "\n " 62155 ), 62156 ] 62157 ) 62158 : _vm._e(), 62159 ], 62160 1 62161 ), 62162 ]) 62163 : _vm._e(), 62164 _vm._v(" "), 62165 _vm.currentPage === 3 62166 ? _c("div", { staticClass: "step-3" }, [ 62167 _c("div", { staticClass: "form-group" }, [ 62168 _c("label", [_vm._v("Jumlah Pembayaran (Rupiah)")]), 62169 _vm._v(" "), 62170 _c("div", { staticClass: "input-group" }, [ 62171 _c("input", { 62172 directives: [ 62173 { 62174 name: "model", 62175 rawName: "v-model", 62176 value: _vm.formData.payment_total, 62177 expression: "formData.payment_total", 62178 }, 62179 ], 62180 staticClass: "form-control", 62181 attrs: { type: "text", readonly: "" }, 62182 domProps: { value: _vm.formData.payment_total }, 62183 on: { 62184 input: function ($event) { 62185 if ($event.target.composing) { 62186 return 62187 } 62188 _vm.$set( 62189 _vm.formData, 62190 "payment_total", 62191 $event.target.value 62192 ) 62193 }, 62194 }, 62195 }), 62196 _vm._v(" "), 62197 _c("div", { staticClass: "input-group-append" }, [ 62198 _c( 62199 "button", 62200 { 62201 staticClass: "btn btn-primary", 62202 attrs: { type: "button" }, 62203 on: { 62204 click: function ($event) { 62205 return _vm.copyData( 62206 _vm.formData.payment_total 62207 ) 62208 }, 62209 }, 62210 }, 62211 [ 62212 _c("i", { 62213 staticClass: "fa fa-copy text-white", 62214 }), 62215 ] 62216 ), 62217 ]), 62218 ]), 62219 ]), 62220 _vm._v(" "), 62221 _vm._m(11), 62222 _vm._v(" "), 62223 _vm._m(12), 62224 _vm._v(" "), 62225 _vm.formData.policy_number === "" 62226 ? _c("div", { staticClass: "form-check" }, [ 62227 _c("input", { 62228 directives: [ 62229 { 62230 name: "model", 62231 rawName: "v-model", 62232 value: _vm.isAgreement, 62233 expression: "isAgreement", 62234 }, 62235 ], 62236 staticClass: "form-check-input", 62237 attrs: { type: "checkbox", id: "agreement" }, 62238 domProps: { 62239 checked: Array.isArray(_vm.isAgreement) 62240 ? _vm._i(_vm.isAgreement, null) > -1 62241 : _vm.isAgreement, 62242 }, 62243 on: { 62244 change: function ($event) { 62245 var $$a = _vm.isAgreement, 62246 $$el = $event.target, 62247 $$c = $$el.checked ? true : false 62248 if (Array.isArray($$a)) { 62249 var $$v = null, 62250 $$i = _vm._i($$a, $$v) 62251 if ($$el.checked) { 62252 $$i < 0 && 62253 (_vm.isAgreement = $$a.concat([$$v])) 62254 } else { 62255 $$i > -1 && 62256 (_vm.isAgreement = $$a 62257 .slice(0, $$i) 62258 .concat($$a.slice($$i + 1))) 62259 } 62260 } else { 62261 _vm.isAgreement = $$c 62262 } 62263 }, 62264 }, 62265 }), 62266 _vm._v(" "), 62267 _vm._m(13), 62268 ]) 62269 : _vm._e(), 62270 ]) 62271 : _vm._e(), 62272 _vm._v(" "), 62273 _vm.currentPage === 4 62274 ? _c( 62275 "div", 62276 { staticClass: "step-4" }, 62277 [ 62278 _c("div", { staticClass: "form-group" }, [ 62279 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 62280 _vm._v(" "), 62281 _c("div", { staticClass: "input-group" }, [ 62282 _c("input", { 62283 directives: [ 62284 { 62285 name: "model", 62286 rawName: "v-model", 62287 value: _vm.formData.policy_number, 62288 expression: "formData.policy_number", 62289 }, 62290 ], 62291 staticClass: "form-control", 62292 attrs: { type: "text", readonly: "" }, 62293 domProps: { value: _vm.formData.policy_number }, 62294 on: { 62295 input: function ($event) { 62296 if ($event.target.composing) { 62297 return 62298 } 62299 _vm.$set( 62300 _vm.formData, 62301 "policy_number", 62302 $event.target.value 62303 ) 62304 }, 62305 }, 62306 }), 62307 _vm._v(" "), 62308 _c("div", { staticClass: "input-group-append" }, [ 62309 _c( 62310 "button", 62311 { 62312 staticClass: "btn btn-primary", 62313 attrs: { type: "button" }, 62314 on: { 62315 click: function ($event) { 62316 return _vm.copyData( 62317 _vm.formData.policy_number, 62318 "Policy Number" 62319 ) 62320 }, 62321 }, 62322 }, 62323 [ 62324 _c("i", { 62325 staticClass: "fa fa-copy text-white", 62326 }), 62327 ] 62328 ), 62329 ]), 62330 _vm._v(" "), 62331 _c( 62332 "div", 62333 { staticClass: "valid-feedback d-block" }, 62334 [ 62335 _vm._v( 62336 "The policy has been successfully issued, you can\n complete\n other data.\n " 62337 ), 62338 ] 62339 ), 62340 ]), 62341 ]), 62342 _vm._v(" "), 62343 _c("div", { staticClass: "form-group" }, [ 62344 _vm._m(14), 62345 _vm._v(" "), 62346 _c("input", { 62347 directives: [ 62348 { 62349 name: "model", 62350 rawName: "v-model", 62351 value: _vm.formData.id_card, 62352 expression: "formData.id_card", 62353 }, 62354 ], 62355 staticClass: "form-control", 62356 attrs: { type: "text" }, 62357 domProps: { value: _vm.formData.id_card }, 62358 on: { 62359 input: function ($event) { 62360 if ($event.target.composing) { 62361 return 62362 } 62363 _vm.$set( 62364 _vm.formData, 62365 "id_card", 62366 $event.target.value 62367 ) 62368 }, 62369 }, 62370 }), 62371 _vm._v(" "), 62372 _vm.errors.id_card 62373 ? _c( 62374 "div", 62375 { staticClass: "invalid-feedback d-block" }, 62376 [ 62377 _vm._v( 62378 "\n " + 62379 _vm._s(_vm.errors.id_card[0]) + 62380 "\n " 62381 ), 62382 ] 62383 ) 62384 : _vm._e(), 62385 ]), 62386 _vm._v(" "), 62387 _vm.formData.customer_type === "personal" 62388 ? [ 62389 _c("div", { staticClass: "form-group" }, [ 62390 _vm._m(15), 62391 _vm._v(" "), 62392 _c("textarea", { 62393 directives: [ 62394 { 62395 name: "model", 62396 rawName: "v-model", 62397 value: _vm.formData.address, 62398 expression: "formData.address", 62399 }, 62400 ], 62401 staticClass: "form-control", 62402 domProps: { value: _vm.formData.address }, 62403 on: { 62404 input: function ($event) { 62405 if ($event.target.composing) { 62406 return 62407 } 62408 _vm.$set( 62409 _vm.formData, 62410 "address", 62411 $event.target.value 62412 ) 62413 }, 62414 }, 62415 }), 62416 _vm._v(" "), 62417 _vm.errors.address 62418 ? _c( 62419 "div", 62420 { 62421 staticClass: "invalid-feedback d-block", 62422 }, 62423 [ 62424 _vm._v( 62425 "\n " + 62426 _vm._s(_vm.errors.address[0]) + 62427 "\n " 62428 ), 62429 ] 62430 ) 62431 : _vm._e(), 62432 ]), 62433 _vm._v(" "), 62434 _c("div", { staticClass: "form-group" }, [ 62435 _c("label", [_vm._v("Kodepos")]), 62436 _vm._v(" "), 62437 _c("input", { 62438 directives: [ 62439 { 62440 name: "model", 62441 rawName: "v-model", 62442 value: _vm.formData.zip_code, 62443 expression: "formData.zip_code", 62444 }, 62445 ], 62446 staticClass: "form-control", 62447 attrs: { type: "text", maxlength: "5" }, 62448 domProps: { value: _vm.formData.zip_code }, 62449 on: { 62450 input: function ($event) { 62451 if ($event.target.composing) { 62452 return 62453 } 62454 _vm.$set( 62455 _vm.formData, 62456 "zip_code", 62457 $event.target.value 62458 ) 62459 }, 62460 }, 62461 }), 62462 _vm._v(" "), 62463 _vm.errors.zip_code 62464 ? _c( 62465 "div", 62466 { 62467 staticClass: "invalid-feedback d-block", 62468 }, 62469 [ 62470 _vm._v( 62471 "\n " + 62472 _vm._s(_vm.errors.zip_code[0]) + 62473 "\n " 62474 ), 62475 ] 62476 ) 62477 : _vm._e(), 62478 ]), 62479 _vm._v(" "), 62480 _c("div", { staticClass: "form-group" }, [ 62481 _vm._m(16), 62482 _vm._v(" "), 62483 _c("input", { 62484 directives: [ 62485 { 62486 name: "model", 62487 rawName: "v-model", 62488 value: _vm.formData.telephone, 62489 expression: "formData.telephone", 62490 }, 62491 ], 62492 staticClass: "form-control", 62493 attrs: { type: "text" }, 62494 domProps: { value: _vm.formData.telephone }, 62495 on: { 62496 input: function ($event) { 62497 if ($event.target.composing) { 62498 return 62499 } 62500 _vm.$set( 62501 _vm.formData, 62502 "telephone", 62503 $event.target.value 62504 ) 62505 }, 62506 }, 62507 }), 62508 _vm._v(" "), 62509 _vm.errors.telephone 62510 ? _c( 62511 "div", 62512 { 62513 staticClass: "invalid-feedback d-block", 62514 }, 62515 [ 62516 _vm._v( 62517 "\n " + 62518 _vm._s(_vm.errors.telephone[0]) + 62519 "\n " 62520 ), 62521 ] 62522 ) 62523 : _vm._e(), 62524 ]), 62525 ] 62526 : [ 62527 _c("div", { staticClass: "form-group" }, [ 62528 _vm._m(17), 62529 _vm._v(" "), 62530 _c("input", { 62531 directives: [ 62532 { 62533 name: "model", 62534 rawName: "v-model", 62535 value: _vm.formData.company, 62536 expression: "formData.company", 62537 }, 62538 ], 62539 staticClass: "form-control", 62540 attrs: { type: "text" }, 62541 domProps: { value: _vm.formData.company }, 62542 on: { 62543 input: function ($event) { 62544 if ($event.target.composing) { 62545 return 62546 } 62547 _vm.$set( 62548 _vm.formData, 62549 "company", 62550 $event.target.value 62551 ) 62552 }, 62553 }, 62554 }), 62555 _vm._v(" "), 62556 _vm.errors.company 62557 ? _c( 62558 "div", 62559 { 62560 staticClass: "invalid-feedback d-block", 62561 }, 62562 [ 62563 _vm._v( 62564 "\n " + 62565 _vm._s(_vm.errors.company[0]) + 62566 "\n " 62567 ), 62568 ] 62569 ) 62570 : _vm._e(), 62571 ]), 62572 _vm._v(" "), 62573 _c("div", { staticClass: "form-group" }, [ 62574 _c("label", [_vm._v("NPWP")]), 62575 _vm._v(" "), 62576 _c("input", { 62577 directives: [ 62578 { 62579 name: "model", 62580 rawName: "v-model", 62581 value: _vm.formData.npwp, 62582 expression: "formData.npwp", 62583 }, 62584 ], 62585 staticClass: "form-control", 62586 attrs: { type: "text" }, 62587 domProps: { value: _vm.formData.npwp }, 62588 on: { 62589 input: function ($event) { 62590 if ($event.target.composing) { 62591 return 62592 } 62593 _vm.$set( 62594 _vm.formData, 62595 "npwp", 62596 $event.target.value 62597 ) 62598 }, 62599 }, 62600 }), 62601 _vm._v(" "), 62602 _vm.errors.npwp 62603 ? _c( 62604 "div", 62605 { 62606 staticClass: "invalid-feedback d-block", 62607 }, 62608 [ 62609 _vm._v( 62610 "\n " + 62611 _vm._s(_vm.errors.npwp[0]) + 62612 "\n " 62613 ), 62614 ] 62615 ) 62616 : _vm._e(), 62617 ]), 62618 _vm._v(" "), 62619 _c("div", { staticClass: "form-group" }, [ 62620 _vm._m(18), 62621 _vm._v(" "), 62622 _c("textarea", { 62623 directives: [ 62624 { 62625 name: "model", 62626 rawName: "v-model", 62627 value: _vm.formData.office_address, 62628 expression: "formData.office_address", 62629 }, 62630 ], 62631 staticClass: "form-control", 62632 domProps: { 62633 value: _vm.formData.office_address, 62634 }, 62635 on: { 62636 input: function ($event) { 62637 if ($event.target.composing) { 62638 return 62639 } 62640 _vm.$set( 62641 _vm.formData, 62642 "office_address", 62643 $event.target.value 62644 ) 62645 }, 62646 }, 62647 }), 62648 _vm._v(" "), 62649 _vm.errors.office_address 62650 ? _c( 62651 "div", 62652 { 62653 staticClass: "invalid-feedback d-block", 62654 }, 62655 [ 62656 _vm._v( 62657 "\n " + 62658 _vm._s( 62659 _vm.errors.office_address[0] 62660 ) + 62661 "\n " 62662 ), 62663 ] 62664 ) 62665 : _vm._e(), 62666 ]), 62667 _vm._v(" "), 62668 _c("div", { staticClass: "form-group" }, [ 62669 _c("label", [_vm._v("Kodepos")]), 62670 _vm._v(" "), 62671 _c("input", { 62672 directives: [ 62673 { 62674 name: "model", 62675 rawName: "v-model", 62676 value: _vm.formData.office_zip_code, 62677 expression: "formData.office_zip_code", 62678 }, 62679 ], 62680 staticClass: "form-control", 62681 attrs: { type: "text", maxlength: "5" }, 62682 domProps: { 62683 value: _vm.formData.office_zip_code, 62684 }, 62685 on: { 62686 input: function ($event) { 62687 if ($event.target.composing) { 62688 return 62689 } 62690 _vm.$set( 62691 _vm.formData, 62692 "office_zip_code", 62693 $event.target.value 62694 ) 62695 }, 62696 }, 62697 }), 62698 _vm._v(" "), 62699 _vm.errors.office_zip_code 62700 ? _c( 62701 "div", 62702 { 62703 staticClass: "invalid-feedback d-block", 62704 }, 62705 [ 62706 _vm._v( 62707 "\n " + 62708 _vm._s( 62709 _vm.errors.office_zip_code[0] 62710 ) + 62711 "\n " 62712 ), 62713 ] 62714 ) 62715 : _vm._e(), 62716 ]), 62717 _vm._v(" "), 62718 _c("div", { staticClass: "form-group" }, [ 62719 _c("label", [_vm._v("No Fax")]), 62720 _vm._v(" "), 62721 _c("input", { 62722 directives: [ 62723 { 62724 name: "model", 62725 rawName: "v-model", 62726 value: _vm.formData.office_fax, 62727 expression: "formData.office_fax", 62728 }, 62729 ], 62730 staticClass: "form-control", 62731 attrs: { type: "text" }, 62732 domProps: { value: _vm.formData.office_fax }, 62733 on: { 62734 input: function ($event) { 62735 if ($event.target.composing) { 62736 return 62737 } 62738 _vm.$set( 62739 _vm.formData, 62740 "office_fax", 62741 $event.target.value 62742 ) 62743 }, 62744 }, 62745 }), 62746 _vm._v(" "), 62747 _vm.errors.office_fax 62748 ? _c( 62749 "div", 62750 { 62751 staticClass: "invalid-feedback d-block", 62752 }, 62753 [ 62754 _vm._v( 62755 "\n " + 62756 _vm._s(_vm.errors.office_fax[0]) + 62757 "\n " 62758 ), 62759 ] 62760 ) 62761 : _vm._e(), 62762 ]), 62763 _vm._v(" "), 62764 _c("div", { staticClass: "form-group" }, [ 62765 _vm._m(19), 62766 _vm._v(" "), 62767 _c("input", { 62768 directives: [ 62769 { 62770 name: "model", 62771 rawName: "v-model", 62772 value: _vm.formData.office_email, 62773 expression: "formData.office_email", 62774 }, 62775 ], 62776 staticClass: "form-control", 62777 attrs: { type: "email" }, 62778 domProps: { 62779 value: _vm.formData.office_email, 62780 }, 62781 on: { 62782 input: function ($event) { 62783 if ($event.target.composing) { 62784 return 62785 } 62786 _vm.$set( 62787 _vm.formData, 62788 "office_email", 62789 $event.target.value 62790 ) 62791 }, 62792 }, 62793 }), 62794 _vm._v(" "), 62795 _vm.errors.office_email 62796 ? _c( 62797 "div", 62798 { 62799 staticClass: "invalid-feedback d-block", 62800 }, 62801 [ 62802 _vm._v( 62803 "\n " + 62804 _vm._s(_vm.errors.office_email[0]) + 62805 "\n " 62806 ), 62807 ] 62808 ) 62809 : _vm._e(), 62810 ]), 62811 ], 62812 ], 62813 2 62814 ) 62815 : _vm._e(), 62816 _vm._v(" "), 62817 _vm.currentPage > 4 62818 ? _c("div", { staticClass: "step-5" }, [ 62819 _c("div", { staticClass: "text-center" }, [ 62820 _c("h4", [ 62821 _vm._v( 62822 "Success Published Policy " + 62823 _vm._s(_vm.formData.business_name) 62824 ), 62825 ]), 62826 ]), 62827 _vm._v(" "), 62828 _c("div", { staticClass: "form-group" }, [ 62829 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 62830 _vm._v(" "), 62831 _c("div", { staticClass: "input-group" }, [ 62832 _c("input", { 62833 directives: [ 62834 { 62835 name: "model", 62836 rawName: "v-model", 62837 value: _vm.formData.policy_number, 62838 expression: "formData.policy_number", 62839 }, 62840 ], 62841 staticClass: "form-control", 62842 attrs: { type: "text", readonly: "" }, 62843 domProps: { value: _vm.formData.policy_number }, 62844 on: { 62845 input: function ($event) { 62846 if ($event.target.composing) { 62847 return 62848 } 62849 _vm.$set( 62850 _vm.formData, 62851 "policy_number", 62852 $event.target.value 62853 ) 62854 }, 62855 }, 62856 }), 62857 _vm._v(" "), 62858 _c("div", { staticClass: "input-group-append" }, [ 62859 _c( 62860 "button", 62861 { 62862 staticClass: "btn btn-primary", 62863 attrs: { type: "button" }, 62864 on: { 62865 click: function ($event) { 62866 return _vm.copyData( 62867 _vm.formData.policy_number, 62868 "Policy Number" 62869 ) 62870 }, 62871 }, 62872 }, 62873 [ 62874 _c("i", { 62875 staticClass: "fa fa-copy text-white", 62876 }), 62877 ] 62878 ), 62879 ]), 62880 ]), 62881 ]), 62882 _vm._v(" "), 62883 _c("div", { staticClass: "form-group" }, [ 62884 _c("label", [_vm._v("Harga Premi")]), 62885 _vm._v(" "), 62886 _c("div", { staticClass: "input-group" }, [ 62887 _c("input", { 62888 directives: [ 62889 { 62890 name: "model", 62891 rawName: "v-model", 62892 value: _vm.formData.premium, 62893 expression: "formData.premium", 62894 }, 62895 ], 62896 staticClass: "form-control", 62897 attrs: { type: "text", readonly: "" }, 62898 domProps: { value: _vm.formData.premium }, 62899 on: { 62900 input: function ($event) { 62901 if ($event.target.composing) { 62902 return 62903 } 62904 _vm.$set( 62905 _vm.formData, 62906 "premium", 62907 $event.target.value 62908 ) 62909 }, 62910 }, 62911 }), 62912 _vm._v(" "), 62913 _c("div", { staticClass: "input-group-append" }, [ 62914 _c( 62915 "button", 62916 { 62917 staticClass: "btn btn-primary", 62918 attrs: { type: "button" }, 62919 on: { 62920 click: function ($event) { 62921 return _vm.copyData( 62922 _vm.formData.premium, 62923 "Premium" 62924 ) 62925 }, 62926 }, 62927 }, 62928 [ 62929 _c("i", { 62930 staticClass: "fa fa-copy text-white", 62931 }), 62932 ] 62933 ), 62934 ]), 62935 ]), 62936 ]), 62937 _vm._v(" "), 62938 _c( 62939 "button", 62940 { 62941 staticClass: "btn btn-success btn-block", 62942 attrs: { type: "button", disabled: _vm.submitting }, 62943 on: { click: _vm.processPayment }, 62944 }, 62945 [_vm._v("BAYAR\n ")] 62946 ), 62947 ]) 62948 : _vm._e(), 62949 ] 62950 : _vm._e(), 62951 _vm._v(" "), 62952 _vm.submitting 62953 ? _c( 62954 "content-placeholders", 62955 [ 62956 _c("content-placeholders-heading", { attrs: { img: true } }), 62957 _vm._v(" "), 62958 _c("content-placeholders-text", { attrs: { lines: 3 } }), 62959 ], 62960 1 62961 ) 62962 : _vm._e(), 62963 ], 62964 2 62965 ), 62966 _vm._v(" "), 62967 _c("div", { staticClass: "card-footer" }, [ 62968 _vm._m(20), 62969 _vm._v(" "), 62970 _c("div", { staticClass: "row" }, [ 62971 _vm.formData.step < 5 62972 ? _c("div", { staticClass: "col-sm-6" }, [ 62973 _c( 62974 "button", 62975 { 62976 staticClass: "btn btn-primary", 62977 attrs: { type: "button", disabled: _vm.submitting }, 62978 on: { click: _vm.submitData }, 62979 }, 62980 [_vm._v("Submit\n ")] 62981 ), 62982 _vm._v(" "), 62983 _c( 62984 "button", 62985 { 62986 staticClass: "btn btn-warning", 62987 attrs: { type: "button" }, 62988 on: { click: _vm.resetData }, 62989 }, 62990 [_vm._v("Reset")] 62991 ), 62992 ]) 62993 : _vm._e(), 62994 _vm._v(" "), 62995 _c("div", { staticClass: "col ml-auto d-none" }, [ 62996 _c( 62997 "nav", 62998 { 62999 staticClass: "float-right", 63000 attrs: { "aria-label": "Page navigation example" }, 63001 }, 63002 [ 63003 _c( 63004 "ul", 63005 { staticClass: "pagination" }, 63006 [ 63007 _vm._l(4, function (p) { 63008 return [ 63009 _vm.currentPage === p 63010 ? _c( 63011 "li", 63012 { 63013 staticClass: "page-item active", 63014 attrs: { "aria-current": "page" }, 63015 }, 63016 [ 63017 _c( 63018 "a", 63019 { 63020 staticClass: "page-link", 63021 attrs: { href: "#" }, 63022 on: { 63023 click: function ($event) { 63024 return _vm.changePage(p) 63025 }, 63026 }, 63027 }, 63028 [_vm._v(_vm._s(p))] 63029 ), 63030 ] 63031 ) 63032 : _c( 63033 "li", 63034 { 63035 staticClass: "page-item", 63036 class: { disabled: p > _vm.formData.step }, 63037 }, 63038 [ 63039 _c( 63040 "a", 63041 { 63042 staticClass: "page-link", 63043 attrs: { href: "#" }, 63044 on: { 63045 click: function ($event) { 63046 return _vm.changePage(p) 63047 }, 63048 }, 63049 }, 63050 [_vm._v(_vm._s(p))] 63051 ), 63052 ] 63053 ), 63054 ] 63055 }), 63056 ], 63057 2 63058 ), 63059 ] 63060 ), 63061 ]), 63062 ]), 63063 ]), 63064 ] 63065 ) 63066} 63067var staticRenderFns = [ 63068 function () { 63069 var _vm = this 63070 var _h = _vm.$createElement 63071 var _c = _vm._self._c || _h 63072 return _c("div", { staticClass: "form-group" }, [ 63073 _c("h3", [_vm._v("Form Pembelian Simas Rumah Hemat ++ :")]), 63074 ]) 63075 }, 63076 function () { 63077 var _vm = this 63078 var _h = _vm.$createElement 63079 var _c = _vm._self._c || _h 63080 return _c("label", [ 63081 _vm._v("Nama Depan "), 63082 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63083 ]) 63084 }, 63085 function () { 63086 var _vm = this 63087 var _h = _vm.$createElement 63088 var _c = _vm._self._c || _h 63089 return _c("label", [ 63090 _vm._v("No Handphone"), 63091 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63092 ]) 63093 }, 63094 function () { 63095 var _vm = this 63096 var _h = _vm.$createElement 63097 var _c = _vm._self._c || _h 63098 return _c("label", [ 63099 _vm._v("Email"), 63100 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63101 ]) 63102 }, 63103 function () { 63104 var _vm = this 63105 var _h = _vm.$createElement 63106 var _c = _vm._self._c || _h 63107 return _c("label", [ 63108 _vm._v("Alamat Objek Pertanggungan "), 63109 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 63110 ]) 63111 }, 63112 function () { 63113 var _vm = this 63114 var _h = _vm.$createElement 63115 var _c = _vm._self._c || _h 63116 return _c("label", [ 63117 _vm._v("Nomor Gedung / Rumah"), 63118 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63119 ]) 63120 }, 63121 function () { 63122 var _vm = this 63123 var _h = _vm.$createElement 63124 var _c = _vm._self._c || _h 63125 return _c("label", [ 63126 _vm._v("Tipe Lantai"), 63127 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63128 ]) 63129 }, 63130 function () { 63131 var _vm = this 63132 var _h = _vm.$createElement 63133 var _c = _vm._self._c || _h 63134 return _c("label", [ 63135 _vm._v("Jumlah Lantai"), 63136 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63137 ]) 63138 }, 63139 function () { 63140 var _vm = this 63141 var _h = _vm.$createElement 63142 var _c = _vm._self._c || _h 63143 return _c("label", [ 63144 _vm._v("Tipe Atap"), 63145 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63146 ]) 63147 }, 63148 function () { 63149 var _vm = this 63150 var _h = _vm.$createElement 63151 var _c = _vm._self._c || _h 63152 return _c("label", [ 63153 _vm._v("Tipe Dinding"), 63154 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63155 ]) 63156 }, 63157 function () { 63158 var _vm = this 63159 var _h = _vm.$createElement 63160 var _c = _vm._self._c || _h 63161 return _c("label", [ 63162 _vm._v("Konstruksi "), 63163 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63164 ]) 63165 }, 63166 function () { 63167 var _vm = this 63168 var _h = _vm.$createElement 63169 var _c = _vm._self._c || _h 63170 return _c("div", { staticClass: "form-group" }, [ 63171 _c("h3", [_vm._v("Syarat & Ketentuan")]), 63172 ]) 63173 }, 63174 function () { 63175 var _vm = this 63176 var _h = _vm.$createElement 63177 var _c = _vm._self._c || _h 63178 return _c("div", { staticClass: "form-group" }, [ 63179 _c("label", [ 63180 _vm._v( 63181 "a. Bangunan yang akan diasuransikan tidak dalam keadaan kosong / tidak dihuni" 63182 ), 63183 ]), 63184 _vm._v(" "), 63185 _c("label", [_vm._v("b. Lokasi bagunan tidak berada di dalam gang")]), 63186 _vm._v(" "), 63187 _c("label", [ 63188 _vm._v( 63189 "c. Bangunan hanya untuk rumah tinggal saja, tidak ada proses produksi atau transaksi didalamnya" 63190 ), 63191 ]), 63192 _vm._v(" "), 63193 _c("label", [ 63194 _c("span", { staticClass: "text-danger" }, [ 63195 _vm._v( 63196 "* Jika kondisi bangunan yang dipertanggungkan berbeda dengan pernyataan ini, kami Asuransi Sinar Mas berhak menolak klaim Anda" 63197 ), 63198 ]), 63199 ]), 63200 ]) 63201 }, 63202 function () { 63203 var _vm = this 63204 var _h = _vm.$createElement 63205 var _c = _vm._self._c || _h 63206 return _c( 63207 "label", 63208 { staticClass: "form-check-label", attrs: { for: "agreement" } }, 63209 [ 63210 _vm._v( 63211 "\n Dengan ini Saya telah membaca dan menyetujui " 63212 ), 63213 _c( 63214 "a", 63215 { 63216 attrs: { 63217 href: "https://www.sinarmas.co.id/syarat-dan-ketentuan", 63218 target: "_blank", 63219 }, 63220 }, 63221 [_vm._v("Syarat & Ketentuan")] 63222 ), 63223 _vm._v( 63224 " PT Asuransi Sinar Mas dan setuju untuk menerbitkan Polis.\n " 63225 ), 63226 ] 63227 ) 63228 }, 63229 function () { 63230 var _vm = this 63231 var _h = _vm.$createElement 63232 var _c = _vm._self._c || _h 63233 return _c("label", [ 63234 _vm._v("Nomor KTP "), 63235 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63236 ]) 63237 }, 63238 function () { 63239 var _vm = this 63240 var _h = _vm.$createElement 63241 var _c = _vm._self._c || _h 63242 return _c("label", [ 63243 _vm._v("Alamat Rumah Pemegang Polis"), 63244 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 63245 ]) 63246 }, 63247 function () { 63248 var _vm = this 63249 var _h = _vm.$createElement 63250 var _c = _vm._self._c || _h 63251 return _c("label", [ 63252 _vm._v("No Telephone "), 63253 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 63254 ]) 63255 }, 63256 function () { 63257 var _vm = this 63258 var _h = _vm.$createElement 63259 var _c = _vm._self._c || _h 63260 return _c("label", [ 63261 _vm._v("Perusahaan "), 63262 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 63263 ]) 63264 }, 63265 function () { 63266 var _vm = this 63267 var _h = _vm.$createElement 63268 var _c = _vm._self._c || _h 63269 return _c("label", [ 63270 _vm._v("Alamat "), 63271 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 63272 ]) 63273 }, 63274 function () { 63275 var _vm = this 63276 var _h = _vm.$createElement 63277 var _c = _vm._self._c || _h 63278 return _c("label", [ 63279 _vm._v("Email Kantor "), 63280 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 63281 ]) 63282 }, 63283 function () { 63284 var _vm = this 63285 var _h = _vm.$createElement 63286 var _c = _vm._self._c || _h 63287 return _c("span", { staticClass: "text-danger" }, [ 63288 _c("em", [_vm._v("* Data wajib untuk diisi")]), 63289 ]) 63290 }, 63291] 63292render._withStripped = true 63293 63294 63295 63296/***/ }), 63297 63298/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb&": 63299/*!********************************************************************************************************************************************************************************************************************************!*\ 63300 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb& ***! 63301 \********************************************************************************************************************************************************************************************************************************/ 63302/*! exports provided: render, staticRenderFns */ 63303/***/ (function(module, __webpack_exports__, __webpack_require__) { 63304 63305"use strict"; 63306__webpack_require__.r(__webpack_exports__); 63307/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 63308/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 63309var render = function () { 63310 var _vm = this 63311 var _h = _vm.$createElement 63312 var _c = _vm._self._c || _h 63313 return _c("div", { staticClass: "card card-travel card-product rounded-0" }, [ 63314 _c("div", { staticClass: "card-header x d-none" }, [ 63315 _c("h3", [_vm._v(_vm._s(_vm.formData.business_name) + " Insurance")]), 63316 ]), 63317 _vm._v(" "), 63318 !_vm.submitting 63319 ? _c("div", { staticClass: "card-body" }, [ 63320 _vm.currentPage === 1 63321 ? _c("div", { attrs: { id: "step-1" } }, [ 63322 _vm._m(0), 63323 _vm._v(" "), 63324 _c("div", { staticClass: "form-group" }, [ 63325 _vm._m(1), 63326 _vm._v(" "), 63327 _c("input", { 63328 directives: [ 63329 { 63330 name: "model", 63331 rawName: "v-model", 63332 value: _vm.formData.first_name, 63333 expression: "formData.first_name", 63334 }, 63335 ], 63336 staticClass: "form-control", 63337 attrs: { type: "text" }, 63338 domProps: { value: _vm.formData.first_name }, 63339 on: { 63340 input: function ($event) { 63341 if ($event.target.composing) { 63342 return 63343 } 63344 _vm.$set( 63345 _vm.formData, 63346 "first_name", 63347 $event.target.value 63348 ) 63349 }, 63350 }, 63351 }), 63352 _vm._v(" "), 63353 _vm.errors.first_name 63354 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 63355 _vm._v(_vm._s(_vm.errors.first_name[0])), 63356 ]) 63357 : _vm._e(), 63358 ]), 63359 _vm._v(" "), 63360 _c("div", { staticClass: "form-group" }, [ 63361 _c("label", [_vm._v("Nama Belakang")]), 63362 _vm._v(" "), 63363 _c("input", { 63364 directives: [ 63365 { 63366 name: "model", 63367 rawName: "v-model", 63368 value: _vm.formData.last_name, 63369 expression: "formData.last_name", 63370 }, 63371 ], 63372 staticClass: "form-control", 63373 attrs: { type: "text" }, 63374 domProps: { value: _vm.formData.last_name }, 63375 on: { 63376 input: function ($event) { 63377 if ($event.target.composing) { 63378 return 63379 } 63380 _vm.$set(_vm.formData, "last_name", $event.target.value) 63381 }, 63382 }, 63383 }), 63384 _vm._v(" "), 63385 _vm.errors.last_name 63386 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 63387 _vm._v(_vm._s(_vm.errors.last_name[0])), 63388 ]) 63389 : _vm._e(), 63390 ]), 63391 _vm._v(" "), 63392 _c("div", { staticClass: "form-check form-check-inline" }, [ 63393 _c("input", { 63394 directives: [ 63395 { 63396 name: "model", 63397 rawName: "v-model", 63398 value: _vm.formData.gender, 63399 expression: "formData.gender", 63400 }, 63401 ], 63402 staticClass: "form-check-input", 63403 attrs: { type: "radio", value: "1" }, 63404 domProps: { checked: _vm._q(_vm.formData.gender, "1") }, 63405 on: { 63406 change: function ($event) { 63407 return _vm.$set(_vm.formData, "gender", "1") 63408 }, 63409 }, 63410 }), 63411 _vm._v(" "), 63412 _c("label", { staticClass: "form-check-label" }, [ 63413 _vm._v("Laki-Laki"), 63414 ]), 63415 ]), 63416 _vm._v(" "), 63417 _c("div", { staticClass: "form-check form-check-inline" }, [ 63418 _c("input", { 63419 directives: [ 63420 { 63421 name: "model", 63422 rawName: "v-model", 63423 value: _vm.formData.gender, 63424 expression: "formData.gender", 63425 }, 63426 ], 63427 staticClass: "form-check-input", 63428 attrs: { type: "radio", value: "2" }, 63429 domProps: { checked: _vm._q(_vm.formData.gender, "2") }, 63430 on: { 63431 change: function ($event) { 63432 return _vm.$set(_vm.formData, "gender", "2") 63433 }, 63434 }, 63435 }), 63436 _vm._v(" "), 63437 _c("label", { staticClass: "form-check-label" }, [ 63438 _vm._v("Perempuan"), 63439 ]), 63440 ]), 63441 _vm._v(" "), 63442 _c("div", { staticClass: "form-group" }, [ 63443 _vm._m(2), 63444 _vm._v(" "), 63445 _c("input", { 63446 directives: [ 63447 { 63448 name: "model", 63449 rawName: "v-model", 63450 value: _vm.formData.hand_phone, 63451 expression: "formData.hand_phone", 63452 }, 63453 ], 63454 staticClass: "form-control", 63455 attrs: { type: "text" }, 63456 domProps: { value: _vm.formData.hand_phone }, 63457 on: { 63458 input: function ($event) { 63459 if ($event.target.composing) { 63460 return 63461 } 63462 _vm.$set( 63463 _vm.formData, 63464 "hand_phone", 63465 $event.target.value 63466 ) 63467 }, 63468 }, 63469 }), 63470 _vm._v(" "), 63471 _vm.errors.hand_phone 63472 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 63473 _vm._v( 63474 "\n " + 63475 _vm._s(_vm.errors.hand_phone[0]) + 63476 "\n " 63477 ), 63478 ]) 63479 : _vm._e(), 63480 ]), 63481 _vm._v(" "), 63482 _c("div", { staticClass: "form-group" }, [ 63483 _vm._m(3), 63484 _vm._v(" "), 63485 _c("input", { 63486 directives: [ 63487 { 63488 name: "model", 63489 rawName: "v-model", 63490 value: _vm.formData.email, 63491 expression: "formData.email", 63492 }, 63493 ], 63494 staticClass: "form-control", 63495 attrs: { type: "email" }, 63496 domProps: { value: _vm.formData.email }, 63497 on: { 63498 input: function ($event) { 63499 if ($event.target.composing) { 63500 return 63501 } 63502 _vm.$set(_vm.formData, "email", $event.target.value) 63503 }, 63504 }, 63505 }), 63506 _vm._v(" "), 63507 _vm.errors.email 63508 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 63509 _vm._v( 63510 "\n " + 63511 _vm._s(_vm.errors.email[0]) + 63512 "\n " 63513 ), 63514 ]) 63515 : _vm._e(), 63516 ]), 63517 ]) 63518 : _vm._e(), 63519 _vm._v(" "), 63520 _vm.currentPage === 2 63521 ? _c( 63522 "div", 63523 { attrs: { id: "step-2" } }, 63524 [ 63525 _c("div", { staticClass: "row" }, [ 63526 _c("div", { staticClass: "col-md-6" }, [ 63527 _c( 63528 "div", 63529 { staticClass: "form-group" }, 63530 [ 63531 _c("label", [_vm._v("Tanggal Mulai")]), 63532 _vm._v(" "), 63533 _c("datetime", { 63534 staticClass: "flatpickr form-control", 63535 class: { "is-invalid": _vm.errors.start_date }, 63536 attrs: { 63537 config: _vm.datePickerConfig, 63538 id: "start_date", 63539 name: "start_date", 63540 placeholder: "Tanggal Mulai", 63541 }, 63542 model: { 63543 value: _vm.formData.start_date, 63544 callback: function ($$v) { 63545 _vm.$set(_vm.formData, "start_date", $$v) 63546 }, 63547 expression: "formData.start_date", 63548 }, 63549 }), 63550 _vm._v(" "), 63551 _vm.errors.start_date 63552 ? _c( 63553 "small", 63554 { staticClass: "form-text text-danger" }, 63555 [_vm._v(_vm._s(_vm.errors.start_date[0]))] 63556 ) 63557 : _vm._e(), 63558 ], 63559 1 63560 ), 63561 ]), 63562 _vm._v(" "), 63563 _c("div", { staticClass: "col-md-6" }, [ 63564 _c( 63565 "div", 63566 { staticClass: "form-group" }, 63567 [ 63568 _c("label", [_vm._v("Tanggal Berakhir")]), 63569 _vm._v(" "), 63570 _c("datetime", { 63571 staticClass: "flatpickr form-control", 63572 class: { "is-invalid": _vm.errors.end_date }, 63573 attrs: { 63574 config: _vm.datePickerConfig, 63575 id: "end_date", 63576 name: "end_date", 63577 placeholder: "Tanggal Berakhir", 63578 }, 63579 model: { 63580 value: _vm.formData.end_date, 63581 callback: function ($$v) { 63582 _vm.$set(_vm.formData, "end_date", $$v) 63583 }, 63584 expression: "formData.end_date", 63585 }, 63586 }), 63587 _vm._v(" "), 63588 _vm.errors.end_date 63589 ? _c( 63590 "small", 63591 { staticClass: "form-text text-danger" }, 63592 [_vm._v(_vm._s(_vm.errors.end_date[0]))] 63593 ) 63594 : _vm._e(), 63595 ], 63596 1 63597 ), 63598 ]), 63599 ]), 63600 _vm._v(" "), 63601 _c("div", { staticClass: "form-group" }, [ 63602 _vm._m(4), 63603 _vm._v(" "), 63604 _c("input", { 63605 directives: [ 63606 { 63607 name: "model", 63608 rawName: "v-model", 63609 value: _vm.formData.id_card, 63610 expression: "formData.id_card", 63611 }, 63612 ], 63613 staticClass: "form-control", 63614 attrs: { type: "text" }, 63615 domProps: { value: _vm.formData.id_card }, 63616 on: { 63617 input: function ($event) { 63618 if ($event.target.composing) { 63619 return 63620 } 63621 _vm.$set(_vm.formData, "id_card", $event.target.value) 63622 }, 63623 }, 63624 }), 63625 _vm._v(" "), 63626 _vm.errors.id_card 63627 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 63628 _vm._v( 63629 "\n " + 63630 _vm._s(_vm.errors.id_card[0]) + 63631 "\n " 63632 ), 63633 ]) 63634 : _vm._e(), 63635 ]), 63636 _vm._v(" "), 63637 _c("div", { staticClass: "form-group" }, [ 63638 _c("label", [_vm._v("No NPWP")]), 63639 _vm._v(" "), 63640 _c("input", { 63641 directives: [ 63642 { 63643 name: "model", 63644 rawName: "v-model", 63645 value: _vm.formData.npwp, 63646 expression: "formData.npwp", 63647 }, 63648 ], 63649 staticClass: "form-control", 63650 attrs: { type: "text" }, 63651 domProps: { value: _vm.formData.npwp }, 63652 on: { 63653 input: function ($event) { 63654 if ($event.target.composing) { 63655 return 63656 } 63657 _vm.$set(_vm.formData, "npwp", $event.target.value) 63658 }, 63659 }, 63660 }), 63661 _vm._v(" "), 63662 _vm.errors.npwp 63663 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 63664 _vm._v( 63665 "\n " + 63666 _vm._s(_vm.errors.npwp[0]) + 63667 "\n " 63668 ), 63669 ]) 63670 : _vm._e(), 63671 ]), 63672 _vm._v(" "), 63673 _vm.formData.customer_type === "personal" 63674 ? [ 63675 _c("div", { staticClass: "form-group" }, [ 63676 _vm._m(5), 63677 _vm._v(" "), 63678 _c("textarea", { 63679 directives: [ 63680 { 63681 name: "model", 63682 rawName: "v-model", 63683 value: _vm.formData.address, 63684 expression: "formData.address", 63685 }, 63686 ], 63687 staticClass: "form-control form-control-plaintext", 63688 domProps: { value: _vm.formData.address }, 63689 on: { 63690 input: function ($event) { 63691 if ($event.target.composing) { 63692 return 63693 } 63694 _vm.$set( 63695 _vm.formData, 63696 "address", 63697 $event.target.value 63698 ) 63699 }, 63700 }, 63701 }), 63702 _vm._v(" "), 63703 _vm.errors.address 63704 ? _c( 63705 "div", 63706 { staticClass: "invalid-feedback d-block" }, 63707 [ 63708 _vm._v( 63709 "\n " + 63710 _vm._s(_vm.errors.address[0]) + 63711 "\n " 63712 ), 63713 ] 63714 ) 63715 : _vm._e(), 63716 ]), 63717 _vm._v(" "), 63718 _c("div", { staticClass: "form-group" }, [ 63719 _c("label", [_vm._v("Kodepos")]), 63720 _vm._v(" "), 63721 _c("input", { 63722 directives: [ 63723 { 63724 name: "model", 63725 rawName: "v-model", 63726 value: _vm.formData.zip_code, 63727 expression: "formData.zip_code", 63728 }, 63729 ], 63730 staticClass: "form-control", 63731 attrs: { type: "text", maxlength: "5" }, 63732 domProps: { value: _vm.formData.zip_code }, 63733 on: { 63734 input: function ($event) { 63735 if ($event.target.composing) { 63736 return 63737 } 63738 _vm.$set( 63739 _vm.formData, 63740 "zip_code", 63741 $event.target.value 63742 ) 63743 }, 63744 }, 63745 }), 63746 _vm._v(" "), 63747 _vm.errors.zip_code 63748 ? _c( 63749 "div", 63750 { staticClass: "invalid-feedback d-block" }, 63751 [ 63752 _vm._v( 63753 "\n " + 63754 _vm._s(_vm.errors.zip_code[0]) + 63755 "\n " 63756 ), 63757 ] 63758 ) 63759 : _vm._e(), 63760 ]), 63761 _vm._v(" "), 63762 _c("div", { staticClass: "form-group" }, [ 63763 _c("label", [_vm._v("No Telephone")]), 63764 _vm._v(" "), 63765 _c("input", { 63766 directives: [ 63767 { 63768 name: "model", 63769 rawName: "v-model", 63770 value: _vm.formData.telephone, 63771 expression: "formData.telephone", 63772 }, 63773 ], 63774 staticClass: "form-control", 63775 attrs: { type: "text" }, 63776 domProps: { value: _vm.formData.telephone }, 63777 on: { 63778 input: function ($event) { 63779 if ($event.target.composing) { 63780 return 63781 } 63782 _vm.$set( 63783 _vm.formData, 63784 "telephone", 63785 $event.target.value 63786 ) 63787 }, 63788 }, 63789 }), 63790 _vm._v(" "), 63791 _vm.errors.telephone 63792 ? _c( 63793 "div", 63794 { staticClass: "invalid-feedback d-block" }, 63795 [ 63796 _vm._v( 63797 "\n " + 63798 _vm._s(_vm.errors.telephone[0]) + 63799 "\n " 63800 ), 63801 ] 63802 ) 63803 : _vm._e(), 63804 ]), 63805 _vm._v(" "), 63806 _c( 63807 "div", 63808 { staticClass: "form-group" }, 63809 [ 63810 _c("label", [_vm._v("Tanggal Lahir")]), 63811 _vm._v(" "), 63812 _c("datetime", { 63813 staticClass: "flatpickr form-control", 63814 class: { "is-invalid": _vm.errors.birth_date }, 63815 attrs: { 63816 config: _vm.datePickerConfig, 63817 id: "birth_date", 63818 name: "birth_date", 63819 placeholder: "Birth Date", 63820 }, 63821 model: { 63822 value: _vm.formData.birth_date, 63823 callback: function ($$v) { 63824 _vm.$set(_vm.formData, "birth_date", $$v) 63825 }, 63826 expression: "formData.birth_date", 63827 }, 63828 }), 63829 _vm._v(" "), 63830 _vm.errors.birth_date 63831 ? _c( 63832 "small", 63833 { staticClass: "form-text text-danger" }, 63834 [_vm._v(_vm._s(_vm.errors.birth_date[0]))] 63835 ) 63836 : _vm._e(), 63837 ], 63838 1 63839 ), 63840 ] 63841 : [ 63842 _c("div", { staticClass: "form-group" }, [ 63843 _vm._m(6), 63844 _vm._v(" "), 63845 _c("input", { 63846 directives: [ 63847 { 63848 name: "model", 63849 rawName: "v-model", 63850 value: _vm.formData.company, 63851 expression: "formData.company", 63852 }, 63853 ], 63854 staticClass: "form-control", 63855 attrs: { type: "text" }, 63856 domProps: { value: _vm.formData.company }, 63857 on: { 63858 input: function ($event) { 63859 if ($event.target.composing) { 63860 return 63861 } 63862 _vm.$set( 63863 _vm.formData, 63864 "company", 63865 $event.target.value 63866 ) 63867 }, 63868 }, 63869 }), 63870 _vm._v(" "), 63871 _vm.errors.company 63872 ? _c( 63873 "div", 63874 { staticClass: "invalid-feedback d-block" }, 63875 [ 63876 _vm._v( 63877 "\n " + 63878 _vm._s(_vm.errors.company[0]) + 63879 "\n " 63880 ), 63881 ] 63882 ) 63883 : _vm._e(), 63884 ]), 63885 _vm._v(" "), 63886 _c("div", { staticClass: "form-group" }, [ 63887 _vm._m(7), 63888 _vm._v(" "), 63889 _c("textarea", { 63890 directives: [ 63891 { 63892 name: "model", 63893 rawName: "v-model", 63894 value: _vm.formData.office_address, 63895 expression: "formData.office_address", 63896 }, 63897 ], 63898 staticClass: "form-control form-control-plaintext", 63899 domProps: { value: _vm.formData.office_address }, 63900 on: { 63901 input: function ($event) { 63902 if ($event.target.composing) { 63903 return 63904 } 63905 _vm.$set( 63906 _vm.formData, 63907 "office_address", 63908 $event.target.value 63909 ) 63910 }, 63911 }, 63912 }), 63913 _vm._v(" "), 63914 _vm.errors.office_address 63915 ? _c( 63916 "div", 63917 { staticClass: "invalid-feedback d-block" }, 63918 [ 63919 _vm._v( 63920 "\n " + 63921 _vm._s(_vm.errors.office_address[0]) + 63922 "\n " 63923 ), 63924 ] 63925 ) 63926 : _vm._e(), 63927 ]), 63928 _vm._v(" "), 63929 _c("div", { staticClass: "form-group" }, [ 63930 _c("label", [_vm._v("Kodepos")]), 63931 _vm._v(" "), 63932 _c("input", { 63933 directives: [ 63934 { 63935 name: "model", 63936 rawName: "v-model", 63937 value: _vm.formData.office_zip_code, 63938 expression: "formData.office_zip_code", 63939 }, 63940 ], 63941 staticClass: "form-control", 63942 attrs: { type: "text", maxlength: "5" }, 63943 domProps: { value: _vm.formData.office_zip_code }, 63944 on: { 63945 input: function ($event) { 63946 if ($event.target.composing) { 63947 return 63948 } 63949 _vm.$set( 63950 _vm.formData, 63951 "office_zip_code", 63952 $event.target.value 63953 ) 63954 }, 63955 }, 63956 }), 63957 _vm._v(" "), 63958 _vm.errors.office_zip_code 63959 ? _c( 63960 "div", 63961 { staticClass: "invalid-feedback d-block" }, 63962 [ 63963 _vm._v( 63964 "\n " + 63965 _vm._s(_vm.errors.office_zip_code[0]) + 63966 "\n " 63967 ), 63968 ] 63969 ) 63970 : _vm._e(), 63971 ]), 63972 _vm._v(" "), 63973 _c("div", { staticClass: "form-group" }, [ 63974 _c("label", [_vm._v("No Telephone")]), 63975 _vm._v(" "), 63976 _c("input", { 63977 directives: [ 63978 { 63979 name: "model", 63980 rawName: "v-model", 63981 value: _vm.formData.telephone, 63982 expression: "formData.telephone", 63983 }, 63984 ], 63985 staticClass: "form-control", 63986 attrs: { type: "text" }, 63987 domProps: { value: _vm.formData.telephone }, 63988 on: { 63989 input: function ($event) { 63990 if ($event.target.composing) { 63991 return 63992 } 63993 _vm.$set( 63994 _vm.formData, 63995 "telephone", 63996 $event.target.value 63997 ) 63998 }, 63999 }, 64000 }), 64001 _vm._v(" "), 64002 _vm.errors.telephone 64003 ? _c( 64004 "div", 64005 { staticClass: "invalid-feedback d-block" }, 64006 [ 64007 _vm._v( 64008 "\n " + 64009 _vm._s(_vm.errors.telephone[0]) + 64010 "\n " 64011 ), 64012 ] 64013 ) 64014 : _vm._e(), 64015 ]), 64016 _vm._v(" "), 64017 _c("div", { staticClass: "form-group" }, [ 64018 _c("label", [_vm._v("No Fax")]), 64019 _vm._v(" "), 64020 _c("input", { 64021 directives: [ 64022 { 64023 name: "model", 64024 rawName: "v-model", 64025 value: _vm.formData.office_fax, 64026 expression: "formData.office_fax", 64027 }, 64028 ], 64029 staticClass: "form-control", 64030 attrs: { type: "text" }, 64031 domProps: { value: _vm.formData.office_fax }, 64032 on: { 64033 input: function ($event) { 64034 if ($event.target.composing) { 64035 return 64036 } 64037 _vm.$set( 64038 _vm.formData, 64039 "office_fax", 64040 $event.target.value 64041 ) 64042 }, 64043 }, 64044 }), 64045 _vm._v(" "), 64046 _vm.errors.office_fax 64047 ? _c( 64048 "div", 64049 { staticClass: "invalid-feedback d-block" }, 64050 [ 64051 _vm._v( 64052 "\n " + 64053 _vm._s(_vm.errors.office_fax[0]) + 64054 "\n " 64055 ), 64056 ] 64057 ) 64058 : _vm._e(), 64059 ]), 64060 _vm._v(" "), 64061 _c("div", { staticClass: "form-group" }, [ 64062 _vm._m(8), 64063 _vm._v(" "), 64064 _c("input", { 64065 directives: [ 64066 { 64067 name: "model", 64068 rawName: "v-model", 64069 value: _vm.formData.office_email, 64070 expression: "formData.office_email", 64071 }, 64072 ], 64073 staticClass: "form-control", 64074 attrs: { type: "email" }, 64075 domProps: { value: _vm.formData.office_email }, 64076 on: { 64077 input: function ($event) { 64078 if ($event.target.composing) { 64079 return 64080 } 64081 _vm.$set( 64082 _vm.formData, 64083 "office_email", 64084 $event.target.value 64085 ) 64086 }, 64087 }, 64088 }), 64089 _vm._v(" "), 64090 _vm.errors.office_email 64091 ? _c( 64092 "div", 64093 { staticClass: "invalid-feedback d-block" }, 64094 [ 64095 _vm._v( 64096 "\n " + 64097 _vm._s(_vm.errors.office_email[0]) + 64098 "\n " 64099 ), 64100 ] 64101 ) 64102 : _vm._e(), 64103 ]), 64104 ], 64105 _vm._v(" "), 64106 _c( 64107 "div", 64108 { staticClass: "form-group" }, 64109 [ 64110 _c("label", [_vm._v("Tipe Perjalanan")]), 64111 _vm._v(" "), 64112 _c("v-select", { 64113 attrs: { 64114 options: _vm.optionTripTypes, 64115 reduce: function (text) { 64116 return text.value 64117 }, 64118 label: "text", 64119 }, 64120 model: { 64121 value: _vm.formData.trip_type, 64122 callback: function ($$v) { 64123 _vm.$set(_vm.formData, "trip_type", $$v) 64124 }, 64125 expression: "formData.trip_type", 64126 }, 64127 }), 64128 _vm._v(" "), 64129 _vm.errors.trip_type 64130 ? _c( 64131 "div", 64132 { staticClass: "invalid-feedback d-block" }, 64133 [ 64134 _vm._v( 64135 "\n " + 64136 _vm._s(_vm.errors.trip_type[0]) + 64137 "\n " 64138 ), 64139 ] 64140 ) 64141 : _vm._e(), 64142 ], 64143 1 64144 ), 64145 _vm._v(" "), 64146 _c( 64147 "div", 64148 { staticClass: "form-group" }, 64149 [ 64150 _c("label", [_vm._v("Rencana Perjalanan")]), 64151 _vm._v(" "), 64152 _c("v-select", { 64153 attrs: { 64154 options: _vm.optionPlanTypes, 64155 reduce: function (text) { 64156 return text.value 64157 }, 64158 label: "text", 64159 }, 64160 model: { 64161 value: _vm.formData.plan_type, 64162 callback: function ($$v) { 64163 _vm.$set(_vm.formData, "plan_type", $$v) 64164 }, 64165 expression: "formData.plan_type", 64166 }, 64167 }), 64168 _vm._v(" "), 64169 _vm.errors.plan_type 64170 ? _c( 64171 "div", 64172 { staticClass: "invalid-feedback d-block" }, 64173 [ 64174 _vm._v( 64175 "\n " + 64176 _vm._s(_vm.errors.plan_type[0]) + 64177 "\n " 64178 ), 64179 ] 64180 ) 64181 : _vm._e(), 64182 ], 64183 1 64184 ), 64185 _vm._v(" "), 64186 _c("div", { staticClass: "form-group" }, [ 64187 _c("label", [_vm._v("Kota Tujuan")]), 64188 _vm._v(" "), 64189 _c("input", { 64190 directives: [ 64191 { 64192 name: "model", 64193 rawName: "v-model", 64194 value: _vm.formData.travel_destination, 64195 expression: "formData.travel_destination", 64196 }, 64197 ], 64198 staticClass: "form-control", 64199 attrs: { type: "text" }, 64200 domProps: { value: _vm.formData.travel_destination }, 64201 on: { 64202 input: function ($event) { 64203 if ($event.target.composing) { 64204 return 64205 } 64206 _vm.$set( 64207 _vm.formData, 64208 "travel_destination", 64209 $event.target.value 64210 ) 64211 }, 64212 }, 64213 }), 64214 _vm._v(" "), 64215 _vm.errors.travel_destination 64216 ? _c("div", { staticClass: "invalid-feedback d-block" }, [ 64217 _vm._v( 64218 "\n " + 64219 _vm._s(_vm.errors.travel_destination[0]) + 64220 "\n " 64221 ), 64222 ]) 64223 : _vm._e(), 64224 ]), 64225 _vm._v(" "), 64226 _c( 64227 "div", 64228 { staticClass: "form-group" }, 64229 [ 64230 _c("label", [_vm._v("Negara")]), 64231 _vm._v(" "), 64232 _c("v-select", { 64233 attrs: { 64234 options: _vm.optionNegara, 64235 reduce: function (text) { 64236 return text.value 64237 }, 64238 label: "text", 64239 }, 64240 model: { 64241 value: _vm.formData.travel_country, 64242 callback: function ($$v) { 64243 _vm.$set(_vm.formData, "travel_country", $$v) 64244 }, 64245 expression: "formData.travel_country", 64246 }, 64247 }), 64248 _vm._v(" "), 64249 _vm.errors.travel_country 64250 ? _c( 64251 "div", 64252 { staticClass: "invalid-feedback d-block" }, 64253 [ 64254 _vm._v( 64255 "\n " + 64256 _vm._s(_vm.errors.travel_country[0]) + 64257 "\n " 64258 ), 64259 ] 64260 ) 64261 : _vm._e(), 64262 ], 64263 1 64264 ), 64265 _vm._v(" "), 64266 _c( 64267 "div", 64268 { staticClass: "form-group" }, 64269 [ 64270 _c("label", [_vm._v("Maksud Perjalanan")]), 64271 _vm._v(" "), 64272 _c("v-select", { 64273 attrs: { 64274 options: _vm.optionTravelPurposes, 64275 reduce: function (text) { 64276 return text.value 64277 }, 64278 label: "text", 64279 }, 64280 model: { 64281 value: _vm.formData.travel_purpose, 64282 callback: function ($$v) { 64283 _vm.$set(_vm.formData, "travel_purpose", $$v) 64284 }, 64285 expression: "formData.travel_purpose", 64286 }, 64287 }), 64288 _vm._v(" "), 64289 _vm.errors.travel_purpose 64290 ? _c( 64291 "div", 64292 { staticClass: "invalid-feedback d-block" }, 64293 [ 64294 _vm._v( 64295 "\n " + 64296 _vm._s(_vm.errors.travel_purpose[0]) + 64297 "\n " 64298 ), 64299 ] 64300 ) 64301 : _vm._e(), 64302 ], 64303 1 64304 ), 64305 _vm._v(" "), 64306 _c( 64307 "div", 64308 { staticClass: "form-group" }, 64309 [ 64310 _c("label", [ 64311 _vm._v("Coverage "), 64312 _c("span", { staticClass: "d-none" }, [ 64313 _vm._v(_vm._s(_vm.formData.coverage)), 64314 ]), 64315 ]), 64316 _vm._v(" "), 64317 _c("br"), 64318 _vm._v(" "), 64319 _vm._m(9), 64320 _vm._v(" "), 64321 _c("v-select", { 64322 attrs: { 64323 options: _vm.optionCoverages, 64324 reduce: function (text) { 64325 return text.value 64326 }, 64327 label: "text", 64328 }, 64329 model: { 64330 value: _vm.formData.coverage, 64331 callback: function ($$v) { 64332 _vm.$set(_vm.formData, "coverage", $$v) 64333 }, 64334 expression: "formData.coverage", 64335 }, 64336 }), 64337 _vm._v(" "), 64338 _vm.errors.coverage 64339 ? _c( 64340 "div", 64341 { staticClass: "invalid-feedback d-block" }, 64342 [ 64343 _vm._v( 64344 "\n " + 64345 _vm._s(_vm.errors.coverage[0]) + 64346 "\n " 64347 ), 64348 ] 64349 ) 64350 : _vm._e(), 64351 ], 64352 1 64353 ), 64354 _vm._v(" "), 64355 _c("div", { staticClass: "form-check" }, [ 64356 _c("input", { 64357 directives: [ 64358 { 64359 name: "model", 64360 rawName: "v-model", 64361 value: _vm.formData.is_covid_policy, 64362 expression: "formData.is_covid_policy", 64363 }, 64364 ], 64365 staticClass: "form-check-input", 64366 attrs: { type: "checkbox", id: "covid-policy" }, 64367 domProps: { 64368 checked: Array.isArray(_vm.formData.is_covid_policy) 64369 ? _vm._i(_vm.formData.is_covid_policy, null) > -1 64370 : _vm.formData.is_covid_policy, 64371 }, 64372 on: { 64373 change: function ($event) { 64374 var $$a = _vm.formData.is_covid_policy, 64375 $$el = $event.target, 64376 $$c = $$el.checked ? true : false 64377 if (Array.isArray($$a)) { 64378 var $$v = null, 64379 $$i = _vm._i($$a, $$v) 64380 if ($$el.checked) { 64381 $$i < 0 && 64382 _vm.$set( 64383 _vm.formData, 64384 "is_covid_policy", 64385 $$a.concat([$$v]) 64386 ) 64387 } else { 64388 $$i > -1 && 64389 _vm.$set( 64390 _vm.formData, 64391 "is_covid_policy", 64392 $$a.slice(0, $$i).concat($$a.slice($$i + 1)) 64393 ) 64394 } 64395 } else { 64396 _vm.$set(_vm.formData, "is_covid_policy", $$c) 64397 } 64398 }, 64399 }, 64400 }), 64401 _vm._v(" "), 64402 _c( 64403 "label", 64404 { 64405 staticClass: "form-check-label", 64406 attrs: { for: "covid-policy" }, 64407 }, 64408 [ 64409 _vm._v( 64410 "\n Include Covid Insurance.\n " 64411 ), 64412 ] 64413 ), 64414 ]), 64415 _vm._v(" "), 64416 _vm.formData.is_covid_policy 64417 ? _c( 64418 "div", 64419 { staticClass: "form-group" }, 64420 [ 64421 _c("v-select", { 64422 attrs: { 64423 options: _vm.optionCovidInsurance, 64424 reduce: function (text) { 64425 return text.value 64426 }, 64427 label: "text", 64428 }, 64429 on: { input: _vm.changeCovidInsurance }, 64430 model: { 64431 value: _vm.formData.option_covid_policy, 64432 callback: function ($$v) { 64433 _vm.$set( 64434 _vm.formData, 64435 "option_covid_policy", 64436 $$v 64437 ) 64438 }, 64439 expression: "formData.option_covid_policy", 64440 }, 64441 }), 64442 _vm._v(" "), 64443 _vm.errors.option_covid_policy 64444 ? _c( 64445 "div", 64446 { staticClass: "invalid-feedback d-block" }, 64447 [ 64448 _vm._v( 64449 "\n " + 64450 _vm._s( 64451 _vm.errors.option_covid_policy[0] 64452 ) + 64453 "\n " 64454 ), 64455 ] 64456 ) 64457 : _vm._e(), 64458 ], 64459 1 64460 ) 64461 : _vm._e(), 64462 ], 64463 2 64464 ) 64465 : _vm._e(), 64466 _vm._v(" "), 64467 _vm.currentPage === 3 64468 ? _c("div", { staticClass: "step-3" }, [ 64469 _c("div", { staticClass: "form-group" }, [ 64470 _c("label", [_vm._v("Jumlah Pembayaran (Rupiah)")]), 64471 _vm._v(" "), 64472 _c("div", { staticClass: "input-group" }, [ 64473 _c("input", { 64474 directives: [ 64475 { 64476 name: "model", 64477 rawName: "v-model", 64478 value: _vm.formData.premium, 64479 expression: "formData.premium", 64480 }, 64481 ], 64482 staticClass: "form-control", 64483 attrs: { type: "text", readonly: "" }, 64484 domProps: { value: _vm.formData.premium }, 64485 on: { 64486 input: function ($event) { 64487 if ($event.target.composing) { 64488 return 64489 } 64490 _vm.$set(_vm.formData, "premium", $event.target.value) 64491 }, 64492 }, 64493 }), 64494 _vm._v(" "), 64495 _c("div", { staticClass: "input-group-append" }, [ 64496 _c( 64497 "button", 64498 { 64499 staticClass: "btn btn-primary", 64500 attrs: { type: "button" }, 64501 on: { 64502 click: function ($event) { 64503 return _vm.copyData(_vm.formData.payment_total) 64504 }, 64505 }, 64506 }, 64507 [_c("i", { staticClass: "fa fa-copy text-white" })] 64508 ), 64509 ]), 64510 ]), 64511 ]), 64512 _vm._v(" "), 64513 _vm._m(10), 64514 _vm._v(" "), 64515 _vm._m(11), 64516 _vm._v(" "), 64517 _vm.formData.policy_number === "" 64518 ? _c("div", { staticClass: "form-check" }, [ 64519 _c("input", { 64520 directives: [ 64521 { 64522 name: "model", 64523 rawName: "v-model", 64524 value: _vm.isAgreement, 64525 expression: "isAgreement", 64526 }, 64527 ], 64528 staticClass: "form-check-input", 64529 attrs: { type: "checkbox", id: "agreement" }, 64530 domProps: { 64531 checked: Array.isArray(_vm.isAgreement) 64532 ? _vm._i(_vm.isAgreement, null) > -1 64533 : _vm.isAgreement, 64534 }, 64535 on: { 64536 change: function ($event) { 64537 var $$a = _vm.isAgreement, 64538 $$el = $event.target, 64539 $$c = $$el.checked ? true : false 64540 if (Array.isArray($$a)) { 64541 var $$v = null, 64542 $$i = _vm._i($$a, $$v) 64543 if ($$el.checked) { 64544 $$i < 0 && (_vm.isAgreement = $$a.concat([$$v])) 64545 } else { 64546 $$i > -1 && 64547 (_vm.isAgreement = $$a 64548 .slice(0, $$i) 64549 .concat($$a.slice($$i + 1))) 64550 } 64551 } else { 64552 _vm.isAgreement = $$c 64553 } 64554 }, 64555 }, 64556 }), 64557 _vm._v(" "), 64558 _vm._m(12), 64559 ]) 64560 : _vm._e(), 64561 ]) 64562 : _vm._e(), 64563 _vm._v(" "), 64564 _vm.currentPage === 4 64565 ? _c("div", { staticClass: "step-4" }, [ 64566 _c("div", { staticClass: "form-group" }, [ 64567 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 64568 _vm._v(" "), 64569 _c("div", { staticClass: "input-group" }, [ 64570 _c("input", { 64571 directives: [ 64572 { 64573 name: "model", 64574 rawName: "v-model", 64575 value: _vm.formData.policy_number, 64576 expression: "formData.policy_number", 64577 }, 64578 ], 64579 staticClass: "form-control", 64580 attrs: { type: "text", readonly: "" }, 64581 domProps: { value: _vm.formData.policy_number }, 64582 on: { 64583 input: function ($event) { 64584 if ($event.target.composing) { 64585 return 64586 } 64587 _vm.$set( 64588 _vm.formData, 64589 "policy_number", 64590 $event.target.value 64591 ) 64592 }, 64593 }, 64594 }), 64595 _vm._v(" "), 64596 _c("div", { staticClass: "input-group-append" }, [ 64597 _c( 64598 "button", 64599 { 64600 staticClass: "btn btn-primary", 64601 attrs: { type: "button" }, 64602 on: { 64603 click: function ($event) { 64604 return _vm.copyData( 64605 _vm.formData.policy_number, 64606 "Policy Number" 64607 ) 64608 }, 64609 }, 64610 }, 64611 [_c("i", { staticClass: "fa fa-copy text-white" })] 64612 ), 64613 ]), 64614 _vm._v(" "), 64615 _c("div", { staticClass: "valid-feedback d-block" }, [ 64616 _vm._v( 64617 "The policy has been successfully issued, you can complete\n other data.\n " 64618 ), 64619 ]), 64620 ]), 64621 ]), 64622 _vm._v(" "), 64623 _c( 64624 "div", 64625 { staticClass: "row" }, 64626 _vm._l(_vm.formData.heirs, function (heir, idx) { 64627 return _c( 64628 "div", 64629 { 64630 staticClass: "col-lg-12", 64631 class: { "bg-gray-400": idx % 2 === 1 }, 64632 }, 64633 [ 64634 _vm.formData.heirs.length > 1 64635 ? _c( 64636 "button", 64637 { 64638 staticClass: 64639 "btn btn-sm btn-danger float-right", 64640 on: { 64641 click: function ($event) { 64642 return _vm.deleteHeir(idx) 64643 }, 64644 }, 64645 }, 64646 [_c("i", { staticClass: "fa fa-close" })] 64647 ) 64648 : _vm._e(), 64649 _vm._v(" "), 64650 _c("div", { staticClass: "form-group" }, [ 64651 _vm._m(13, true), 64652 _vm._v(" "), 64653 _c("input", { 64654 directives: [ 64655 { 64656 name: "model", 64657 rawName: "v-model", 64658 value: heir.heir_name, 64659 expression: "heir.heir_name", 64660 }, 64661 ], 64662 staticClass: "form-control", 64663 attrs: { type: "text" }, 64664 domProps: { value: heir.heir_name }, 64665 on: { 64666 input: function ($event) { 64667 if ($event.target.composing) { 64668 return 64669 } 64670 _vm.$set(heir, "heir_name", $event.target.value) 64671 }, 64672 }, 64673 }), 64674 _vm._v(" "), 64675 _vm.errors.heir_name 64676 ? _c( 64677 "div", 64678 { staticClass: "invalid-feedback d-block" }, 64679 [ 64680 _vm._v( 64681 "\n " + 64682 _vm._s(_vm.errors.heir_name[0]) + 64683 "\n " 64684 ), 64685 ] 64686 ) 64687 : _vm._e(), 64688 ]), 64689 _vm._v(" "), 64690 _c( 64691 "div", 64692 { staticClass: "form-group" }, 64693 [ 64694 _c("label", [_vm._v("Hubungan Pewaris")]), 64695 _vm._v(" "), 64696 _c("v-select", { 64697 attrs: { options: _vm.optionRelations }, 64698 model: { 64699 value: heir.heir_relation, 64700 callback: function ($$v) { 64701 _vm.$set(heir, "heir_relation", $$v) 64702 }, 64703 expression: "heir.heir_relation", 64704 }, 64705 }), 64706 _vm._v(" "), 64707 _vm.errors.heir_relation 64708 ? _c( 64709 "div", 64710 { staticClass: "invalid-feedback d-block" }, 64711 [ 64712 _vm._v( 64713 "\n " + 64714 _vm._s(_vm.errors.heir_relation[0]) + 64715 "\n " 64716 ), 64717 ] 64718 ) 64719 : _vm._e(), 64720 ], 64721 1 64722 ), 64723 _vm._v(" "), 64724 _c( 64725 "div", 64726 { staticClass: "form-check form-check-inline" }, 64727 [ 64728 _c("input", { 64729 directives: [ 64730 { 64731 name: "model", 64732 rawName: "v-model", 64733 value: heir.heir_gender, 64734 expression: "heir.heir_gender", 64735 }, 64736 ], 64737 staticClass: "form-check-input", 64738 attrs: { type: "radio", value: "Laki-Laki" }, 64739 domProps: { 64740 checked: _vm._q(heir.heir_gender, "Laki-Laki"), 64741 }, 64742 on: { 64743 change: function ($event) { 64744 return _vm.$set( 64745 heir, 64746 "heir_gender", 64747 "Laki-Laki" 64748 ) 64749 }, 64750 }, 64751 }), 64752 _vm._v(" "), 64753 _c("label", { staticClass: "form-check-label" }, [ 64754 _vm._v("Laki-Laki"), 64755 ]), 64756 ] 64757 ), 64758 _vm._v(" "), 64759 _c( 64760 "div", 64761 { staticClass: "form-check form-check-inline" }, 64762 [ 64763 _c("input", { 64764 directives: [ 64765 { 64766 name: "model", 64767 rawName: "v-model", 64768 value: heir.heir_gender, 64769 expression: "heir.heir_gender", 64770 }, 64771 ], 64772 staticClass: "form-check-input", 64773 attrs: { type: "radio", value: "Perempuan" }, 64774 domProps: { 64775 checked: _vm._q(heir.heir_gender, "Perempuan"), 64776 }, 64777 on: { 64778 change: function ($event) { 64779 return _vm.$set( 64780 heir, 64781 "heir_gender", 64782 "Perempuan" 64783 ) 64784 }, 64785 }, 64786 }), 64787 _vm._v(" "), 64788 _c("label", { staticClass: "form-check-label" }, [ 64789 _vm._v("Perempuan"), 64790 ]), 64791 ] 64792 ), 64793 _vm._v(" "), 64794 _c( 64795 "div", 64796 { staticClass: "form-group" }, 64797 [ 64798 _c("label", [_vm._v("Tanggal Lahir Pewaris")]), 64799 _vm._v(" "), 64800 _c("datetime", { 64801 staticClass: "flatpickr form-control", 64802 class: { 64803 "is-invalid": _vm.errors.heir_birth_date, 64804 }, 64805 attrs: { 64806 config: _vm.datePickerConfig, 64807 id: "heir_birth_date", 64808 name: "heir_birth_date", 64809 placeholder: "Tanggal Lahir Pewaris", 64810 }, 64811 model: { 64812 value: heir.heir_birth_date, 64813 callback: function ($$v) { 64814 _vm.$set(heir, "heir_birth_date", $$v) 64815 }, 64816 expression: "heir.heir_birth_date", 64817 }, 64818 }), 64819 _vm._v(" "), 64820 _vm.errors.heir_birth_date 64821 ? _c( 64822 "small", 64823 { staticClass: "form-text text-danger" }, 64824 [ 64825 _vm._v( 64826 _vm._s(_vm.errors.heir_birth_date[0]) 64827 ), 64828 ] 64829 ) 64830 : _vm._e(), 64831 ], 64832 1 64833 ), 64834 _vm._v(" "), 64835 _c("div", { staticClass: "form-group col-md-3" }, [ 64836 _c("label", [_vm._v("Persentase Pewaris")]), 64837 _vm._v(" "), 64838 _c("input", { 64839 directives: [ 64840 { 64841 name: "model", 64842 rawName: "v-model", 64843 value: heir.heir_percentage, 64844 expression: "heir.heir_percentage", 64845 }, 64846 ], 64847 staticClass: "form-control", 64848 attrs: { type: "number", min: "1", max: "100" }, 64849 domProps: { value: heir.heir_percentage }, 64850 on: { 64851 input: function ($event) { 64852 if ($event.target.composing) { 64853 return 64854 } 64855 _vm.$set( 64856 heir, 64857 "heir_percentage", 64858 $event.target.value 64859 ) 64860 }, 64861 }, 64862 }), 64863 _vm._v(" "), 64864 _vm.errors.heir_percentage 64865 ? _c( 64866 "div", 64867 { staticClass: "invalid-feedback d-block" }, 64868 [ 64869 _vm._v( 64870 "\n " + 64871 _vm._s(_vm.errors.heir_percentage[0]) + 64872 "\n " 64873 ), 64874 ] 64875 ) 64876 : _vm._e(), 64877 ]), 64878 _vm._v(" "), 64879 _vm.formData.heirs.length < 4 64880 ? _c( 64881 "button", 64882 { 64883 staticClass: "btn btn-block btn-primary", 64884 on: { click: _vm.addHeir }, 64885 }, 64886 [ 64887 _c("i", { staticClass: "fa fa-users" }), 64888 _vm._v(" Add Heir\n "), 64889 ] 64890 ) 64891 : _vm._e(), 64892 ] 64893 ) 64894 }), 64895 0 64896 ), 64897 ]) 64898 : _vm._e(), 64899 _vm._v(" "), 64900 _vm.currentPage > 4 64901 ? _c("div", { staticClass: "step-5" }, [ 64902 _c("div", { staticClass: "text-center" }, [ 64903 _c("h4", [ 64904 _vm._v( 64905 "Success Published Policy " + 64906 _vm._s(_vm.formData.business_name) 64907 ), 64908 ]), 64909 ]), 64910 _vm._v(" "), 64911 _c("div", { staticClass: "form-group" }, [ 64912 _c("label", [_vm._v("Policy Number (Nomor Polis)")]), 64913 _vm._v(" "), 64914 _c("div", { staticClass: "input-group" }, [ 64915 _c("input", { 64916 directives: [ 64917 { 64918 name: "model", 64919 rawName: "v-model", 64920 value: _vm.formData.policy_number, 64921 expression: "formData.policy_number", 64922 }, 64923 ], 64924 staticClass: "form-control", 64925 attrs: { type: "text", readonly: "" }, 64926 domProps: { value: _vm.formData.policy_number }, 64927 on: { 64928 input: function ($event) { 64929 if ($event.target.composing) { 64930 return 64931 } 64932 _vm.$set( 64933 _vm.formData, 64934 "policy_number", 64935 $event.target.value 64936 ) 64937 }, 64938 }, 64939 }), 64940 _vm._v(" "), 64941 _c("div", { staticClass: "input-group-append" }, [ 64942 _c( 64943 "button", 64944 { 64945 staticClass: "btn btn-primary", 64946 attrs: { type: "button" }, 64947 on: { 64948 click: function ($event) { 64949 return _vm.copyData( 64950 _vm.formData.policy_number, 64951 "Policy Number" 64952 ) 64953 }, 64954 }, 64955 }, 64956 [_c("i", { staticClass: "fa fa-copy text-white" })] 64957 ), 64958 ]), 64959 ]), 64960 ]), 64961 _vm._v(" "), 64962 _c("div", { staticClass: "form-group" }, [ 64963 _c("label", [_vm._v("Premi")]), 64964 _vm._v(" "), 64965 _c("div", { staticClass: "input-group" }, [ 64966 _c("input", { 64967 directives: [ 64968 { 64969 name: "model", 64970 rawName: "v-model", 64971 value: _vm.formData.premium, 64972 expression: "formData.premium", 64973 }, 64974 ], 64975 staticClass: "form-control", 64976 attrs: { type: "text", readonly: "" }, 64977 domProps: { value: _vm.formData.premium }, 64978 on: { 64979 input: function ($event) { 64980 if ($event.target.composing) { 64981 return 64982 } 64983 _vm.$set(_vm.formData, "premium", $event.target.value) 64984 }, 64985 }, 64986 }), 64987 _vm._v(" "), 64988 _c("div", { staticClass: "input-group-append" }, [ 64989 _c( 64990 "button", 64991 { 64992 staticClass: "btn btn-primary", 64993 attrs: { type: "button" }, 64994 on: { 64995 click: function ($event) { 64996 return _vm.copyData( 64997 _vm.formData.premium, 64998 "Premium" 64999 ) 65000 }, 65001 }, 65002 }, 65003 [_c("i", { staticClass: "fa fa-copy text-white" })] 65004 ), 65005 ]), 65006 ]), 65007 ]), 65008 _vm._v(" "), 65009 _c( 65010 "button", 65011 { 65012 staticClass: "btn btn-success btn-block", 65013 attrs: { type: "button", disabled: _vm.submitting }, 65014 on: { click: _vm.processPayment }, 65015 }, 65016 [_vm._v("BAYAR\n ")] 65017 ), 65018 ]) 65019 : _vm._e(), 65020 ]) 65021 : _c( 65022 "div", 65023 { staticClass: "card-body" }, 65024 [ 65025 _c( 65026 "content-placeholders", 65027 [ 65028 _c("content-placeholders-heading", { attrs: { img: true } }), 65029 _vm._v(" "), 65030 _c("content-placeholders-text", { attrs: { lines: 3 } }), 65031 ], 65032 1 65033 ), 65034 ], 65035 1 65036 ), 65037 _vm._v(" "), 65038 _c("div", { staticClass: "card-footer" }, [ 65039 _vm._m(14), 65040 _vm._v(" "), 65041 _c("div", { staticClass: "row" }, [ 65042 _vm.formData.step < 5 65043 ? _c("div", { staticClass: "col-sm-6" }, [ 65044 _c( 65045 "button", 65046 { 65047 staticClass: "btn btn-primary", 65048 attrs: { type: "button", disabled: _vm.submitting }, 65049 on: { click: _vm.submitData }, 65050 }, 65051 [_vm._v("Submit\n ")] 65052 ), 65053 _vm._v(" "), 65054 _c( 65055 "button", 65056 { 65057 staticClass: "btn btn-warning", 65058 attrs: { type: "button" }, 65059 on: { click: _vm.resetData }, 65060 }, 65061 [_vm._v("Reset")] 65062 ), 65063 ]) 65064 : _vm._e(), 65065 _vm._v(" "), 65066 _c("div", { staticClass: "col ml-auto d-none" }, [ 65067 _c( 65068 "nav", 65069 { 65070 staticClass: "float-right", 65071 attrs: { "aria-label": "Page navigation example" }, 65072 }, 65073 [ 65074 _c( 65075 "ul", 65076 { staticClass: "pagination" }, 65077 [ 65078 _vm._l(4, function (p) { 65079 return [ 65080 _vm.currentPage === p 65081 ? _c( 65082 "li", 65083 { 65084 staticClass: "page-item active", 65085 attrs: { "aria-current": "page" }, 65086 }, 65087 [ 65088 _c( 65089 "a", 65090 { 65091 staticClass: "page-link", 65092 attrs: { href: "#" }, 65093 on: { 65094 click: function ($event) { 65095 return _vm.changePage(p) 65096 }, 65097 }, 65098 }, 65099 [_vm._v(_vm._s(p))] 65100 ), 65101 ] 65102 ) 65103 : _c( 65104 "li", 65105 { 65106 staticClass: "page-item", 65107 class: { disabled: p > _vm.formData.step }, 65108 }, 65109 [ 65110 _c( 65111 "a", 65112 { 65113 staticClass: "page-link", 65114 attrs: { href: "#" }, 65115 on: { 65116 click: function ($event) { 65117 return _vm.changePage(p) 65118 }, 65119 }, 65120 }, 65121 [_vm._v(_vm._s(p))] 65122 ), 65123 ] 65124 ), 65125 ] 65126 }), 65127 ], 65128 2 65129 ), 65130 ] 65131 ), 65132 ]), 65133 ]), 65134 ]), 65135 ]) 65136} 65137var staticRenderFns = [ 65138 function () { 65139 var _vm = this 65140 var _h = _vm.$createElement 65141 var _c = _vm._self._c || _h 65142 return _c("div", { staticClass: "form-group" }, [ 65143 _c("h3", [_vm._v("Form Pembelian Simas Travel Domestic :")]), 65144 ]) 65145 }, 65146 function () { 65147 var _vm = this 65148 var _h = _vm.$createElement 65149 var _c = _vm._self._c || _h 65150 return _c("label", [ 65151 _vm._v("Nama Depan "), 65152 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 65153 ]) 65154 }, 65155 function () { 65156 var _vm = this 65157 var _h = _vm.$createElement 65158 var _c = _vm._self._c || _h 65159 return _c("label", [ 65160 _vm._v("No Handphone"), 65161 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 65162 ]) 65163 }, 65164 function () { 65165 var _vm = this 65166 var _h = _vm.$createElement 65167 var _c = _vm._self._c || _h 65168 return _c("label", [ 65169 _vm._v("Email"), 65170 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 65171 ]) 65172 }, 65173 function () { 65174 var _vm = this 65175 var _h = _vm.$createElement 65176 var _c = _vm._self._c || _h 65177 return _c("label", [ 65178 _vm._v("No KTP "), 65179 _c("span", { staticClass: "text-danger" }, [_vm._v("*")]), 65180 ]) 65181 }, 65182 function () { 65183 var _vm = this 65184 var _h = _vm.$createElement 65185 var _c = _vm._self._c || _h 65186 return _c("label", [ 65187 _vm._v("Alamat "), 65188 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 65189 ]) 65190 }, 65191 function () { 65192 var _vm = this 65193 var _h = _vm.$createElement 65194 var _c = _vm._self._c || _h 65195 return _c("label", [ 65196 _vm._v("Perusahaan "), 65197 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 65198 ]) 65199 }, 65200 function () { 65201 var _vm = this 65202 var _h = _vm.$createElement 65203 var _c = _vm._self._c || _h 65204 return _c("label", [ 65205 _vm._v("Alamat "), 65206 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 65207 ]) 65208 }, 65209 function () { 65210 var _vm = this 65211 var _h = _vm.$createElement 65212 var _c = _vm._self._c || _h 65213 return _c("label", [ 65214 _vm._v("Email Kantor "), 65215 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 65216 ]) 65217 }, 65218 function () { 65219 var _vm = this 65220 var _h = _vm.$createElement 65221 var _c = _vm._self._c || _h 65222 return _c("label", [ 65223 _c( 65224 "a", 65225 { 65226 attrs: { 65227 href: "https://www.sinarmas.co.id/property/1946073/Tabel-Jaminan-Simas-Travel-Domestic.pdf", 65228 target: "_blank", 65229 }, 65230 }, 65231 [_vm._v("Lihat tabel jaminan simas travel domestic disini")] 65232 ), 65233 ]) 65234 }, 65235 function () { 65236 var _vm = this 65237 var _h = _vm.$createElement 65238 var _c = _vm._self._c || _h 65239 return _c("div", { staticClass: "form-group" }, [ 65240 _c("h3", [_vm._v("Syarat & Ketentuan")]), 65241 ]) 65242 }, 65243 function () { 65244 var _vm = this 65245 var _h = _vm.$createElement 65246 var _c = _vm._self._c || _h 65247 return _c("div", { staticClass: "form-group" }, [ 65248 _c("label", [ 65249 _vm._v( 65250 "a. Menyatakan bahwa tujuan perjalanan Saya bukan untuk tujuan medis ataupun untuk mendapatkan perawatan medis" 65251 ), 65252 ]), 65253 ]) 65254 }, 65255 function () { 65256 var _vm = this 65257 var _h = _vm.$createElement 65258 var _c = _vm._self._c || _h 65259 return _c( 65260 "label", 65261 { staticClass: "form-check-label", attrs: { for: "agreement" } }, 65262 [ 65263 _vm._v( 65264 "\n Dengan ini Saya telah membaca dan menyetujui " 65265 ), 65266 _c( 65267 "a", 65268 { 65269 attrs: { 65270 href: "https://www.sinarmas.co.id/syarat-dan-ketentuan", 65271 target: "_blank", 65272 }, 65273 }, 65274 [_vm._v("Syarat & Ketentuan")] 65275 ), 65276 _vm._v( 65277 " PT Asuransi Sinar Mas dan setuju untuk menerbitkan Polis.\n " 65278 ), 65279 ] 65280 ) 65281 }, 65282 function () { 65283 var _vm = this 65284 var _h = _vm.$createElement 65285 var _c = _vm._self._c || _h 65286 return _c("label", [ 65287 _vm._v("Nama Pewaris"), 65288 _c("em", { staticClass: "text-danger" }, [_vm._v("*")]), 65289 ]) 65290 }, 65291 function () { 65292 var _vm = this 65293 var _h = _vm.$createElement 65294 var _c = _vm._self._c || _h 65295 return _c("span", { staticClass: "text-danger" }, [ 65296 _c("em", [_vm._v("* Data wajib untuk diisi")]), 65297 ]) 65298 }, 65299] 65300render._withStripped = true 65301 65302 65303 65304/***/ }), 65305 65306/***/ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ValidatePolicy.vue?vue&type=template&id=da4ad4fe&": 65307/*!***************************************************************************************************************************************************************************************************************************!*\ 65308 !*** ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./resources/js/components/frontends/ValidatePolicy.vue?vue&type=template&id=da4ad4fe& ***! 65309 \***************************************************************************************************************************************************************************************************************************/ 65310/*! exports provided: render, staticRenderFns */ 65311/***/ (function(module, __webpack_exports__, __webpack_require__) { 65312 65313"use strict"; 65314__webpack_require__.r(__webpack_exports__); 65315/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "render", function() { return render; }); 65316/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return staticRenderFns; }); 65317var render = function () { 65318 var _vm = this 65319 var _h = _vm.$createElement 65320 var _c = _vm._self._c || _h 65321 return _c("div", { staticClass: "col-lg-12" }, [ 65322 _c("div", { staticClass: "row" }, [ 65323 _c("div", { staticClass: "col-lg-12" }, [ 65324 _c("div", { staticClass: "card border-0" }, [ 65325 _c( 65326 "div", 65327 { staticClass: "card-body" }, 65328 [ 65329 !_vm.submitting 65330 ? _c("div", { staticClass: "row" }, [ 65331 _c("div", { staticClass: "col-lg-12" }, [ 65332 _c("div", { staticClass: "form-group" }, [ 65333 _c("label", [_vm._v("Nomor Polis")]), 65334 _vm._v(" "), 65335 _c("input", { 65336 directives: [ 65337 { 65338 name: "model", 65339 rawName: "v-model", 65340 value: _vm.formData.no_polis, 65341 expression: "formData.no_polis", 65342 }, 65343 ], 65344 staticClass: "form-control", 65345 attrs: { 65346 type: "email", 65347 placeholder: _vm.formData.no_polis, 65348 }, 65349 domProps: { value: _vm.formData.no_polis }, 65350 on: { 65351 input: function ($event) { 65352 if ($event.target.composing) { 65353 return 65354 } 65355 _vm.$set( 65356 _vm.formData, 65357 "no_polis", 65358 $event.target.value 65359 ) 65360 }, 65361 }, 65362 }), 65363 _vm._v(" "), 65364 _vm.errors.no_polis 65365 ? _c( 65366 "div", 65367 { staticClass: "invalid-feedback d-block" }, 65368 [ 65369 _vm._v( 65370 "\n " + 65371 _vm._s(_vm.errors.no_polis[0]) + 65372 "\n " 65373 ), 65374 ] 65375 ) 65376 : _vm._e(), 65377 ]), 65378 _vm._v(" "), 65379 _c("div", { staticClass: "form-group" }, [ 65380 _vm._m(0), 65381 _vm._v(" "), 65382 _c("input", { 65383 directives: [ 65384 { 65385 name: "model", 65386 rawName: "v-model", 65387 value: _vm.formData.digit_sum, 65388 expression: "formData.digit_sum", 65389 }, 65390 ], 65391 staticClass: "form-control", 65392 attrs: { 65393 type: "email", 65394 placeholder: _vm.formData.digit_sum, 65395 }, 65396 domProps: { value: _vm.formData.digit_sum }, 65397 on: { 65398 input: function ($event) { 65399 if ($event.target.composing) { 65400 return 65401 } 65402 _vm.$set( 65403 _vm.formData, 65404 "digit_sum", 65405 $event.target.value 65406 ) 65407 }, 65408 }, 65409 }), 65410 _vm._v(" "), 65411 _vm.errors.digit_sum 65412 ? _c( 65413 "div", 65414 { staticClass: "invalid-feedback d-block" }, 65415 [ 65416 _vm._v( 65417 "\n " + 65418 _vm._s(_vm.errors.digit_sum[0]) + 65419 "\n " 65420 ), 65421 ] 65422 ) 65423 : _vm._e(), 65424 ]), 65425 _vm._v(" "), 65426 _c( 65427 "button", 65428 { 65429 staticClass: "btn btn-primary btn-block", 65430 attrs: { type: "submit", disabled: _vm.submitting }, 65431 on: { click: _vm.validatePolicy }, 65432 }, 65433 [_vm._v("Validasi Polis\n ")] 65434 ), 65435 ]), 65436 ]) 65437 : _c( 65438 "content-placeholders", 65439 [ 65440 _c("content-placeholders-heading"), 65441 _vm._v(" "), 65442 _c("content-placeholders-text", { attrs: { lines: 5 } }), 65443 ], 65444 1 65445 ), 65446 ], 65447 1 65448 ), 65449 ]), 65450 ]), 65451 _vm._v(" "), 65452 _vm.listData.length > 0 65453 ? _c("div", { staticClass: "col-lg-6" }, [ 65454 _c("div", { staticClass: "card bg-grey" }, [ 65455 _c("div", { staticClass: "card-body" }, [ 65456 _vm.listData[0].error 65457 ? _c("h3", { staticClass: "text-center text-danger" }, [ 65458 _vm._v(_vm._s(_vm.listData[0].message)), 65459 ]) 65460 : _c("h3", { staticClass: "text-center text-success" }, [ 65461 _vm._v(_vm._s(_vm.listData[0].message)), 65462 ]), 65463 ]), 65464 ]), 65465 ]) 65466 : _vm._e(), 65467 ]), 65468 ]) 65469} 65470var staticRenderFns = [ 65471 function () { 65472 var _vm = this 65473 var _h = _vm.$createElement 65474 var _c = _vm._self._c || _h 65475 return _c("label", [ 65476 _vm._v("Digit Sum "), 65477 _c("small", [ 65478 _c("em", { staticClass: "text-danger" }, [ 65479 _vm._v( 65480 "(diisi nilai digitsum yang terdaftar\n pada polis)" 65481 ), 65482 ]), 65483 ]), 65484 ]) 65485 }, 65486] 65487render._withStripped = true 65488 65489 65490 65491/***/ }), 65492
vendor: 3,349 bytes, lines 65493-65604
65493/***/ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js": 65494/*!********************************************************************!*\ 65495 !*** ./node_modules/vue-loader/lib/runtime/componentNormalizer.js ***! 65496 \********************************************************************/ 65497/*! exports provided: default */ 65498/***/ (function(module, __webpack_exports__, __webpack_require__) { 65499 65500"use strict"; 65501__webpack_require__.r(__webpack_exports__); 65502/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return normalizeComponent; }); 65503/* globals __VUE_SSR_CONTEXT__ */ 65504 65505// IMPORTANT: Do NOT use ES2015 features in this file (except for modules). 65506// This module is a runtime utility for cleaner component module output and will 65507// be included in the final webpack user bundle. 65508 65509function normalizeComponent ( 65510 scriptExports, 65511 render, 65512 staticRenderFns, 65513 functionalTemplate, 65514 injectStyles, 65515 scopeId, 65516 moduleIdentifier, /* server only */ 65517 shadowMode /* vue-cli only */ 65518) { 65519 // Vue.extend constructor export interop 65520 var options = typeof scriptExports === 'function' 65521 ? scriptExports.options 65522 : scriptExports 65523 65524 // render functions 65525 if (render) { 65526 options.render = render 65527 options.staticRenderFns = staticRenderFns 65528 options._compiled = true 65529 } 65530 65531 // functional template 65532 if (functionalTemplate) { 65533 options.functional = true 65534 } 65535 65536 // scopedId 65537 if (scopeId) { 65538 options._scopeId = 'data-v-' + scopeId 65539 } 65540 65541 var hook 65542 if (moduleIdentifier) { // server build 65543 hook = function (context) { 65544 // 2.3 injection 65545 context = 65546 context || // cached call 65547 (this.$vnode && this.$vnode.ssrContext) || // stateful 65548 (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional 65549 // 2.2 with runInNewContext: true 65550 if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') { 65551 context = __VUE_SSR_CONTEXT__ 65552 } 65553 // inject component styles 65554 if (injectStyles) { 65555 injectStyles.call(this, context) 65556 } 65557 // register component module identifier for async chunk inferrence 65558 if (context && context._registeredComponents) { 65559 context._registeredComponents.add(moduleIdentifier) 65560 } 65561 } 65562 // used by ssr in case component is cached and beforeCreate 65563 // never gets called 65564 options._ssrRegister = hook 65565 } else if (injectStyles) { 65566 hook = shadowMode 65567 ? function () { 65568 injectStyles.call( 65569 this, 65570 (options.functional ? this.parent : this).$root.$options.shadowRoot 65571 ) 65572 } 65573 : injectStyles 65574 } 65575 65576 if (hook) { 65577 if (options.functional) { 65578 // for template-only hot-reload because in that case the render fn doesn't 65579 // go through the normalizer 65580 options._injectStyles = hook 65581 // register for functional component in vue file 65582 var originalRender = options.render 65583 options.render = function renderWithStyleInjection (h, context) { 65584 hook.call(context) 65585 return originalRender(h, context) 65586 } 65587 } else { 65588 // inject component registration as beforeCreate hook 65589 var existing = options.beforeCreate 65590 options.beforeCreate = existing 65591 ? [].concat(existing, hook) 65592 : [hook] 65593 } 65594 } 65595 65596 return { 65597 exports: scriptExports, 65598 options: options 65599 } 65600} 65601 65602 65603/***/ }), 65604
vendor: 21,150 bytes, lines 65605-65616
65605/***/ "./node_modules/vue-select/dist/vue-select.js": 65606/*!****************************************************!*\ 65607 !*** ./node_modules/vue-select/dist/vue-select.js ***! 65608 \****************************************************/ 65609/*! no static exports found */ 65610/***/ (function(module, exports, __webpack_require__) { 65611 65612!function(t,e){ true?module.exports=e():undefined}("undefined"!=typeof self?self:this,(function(){return(()=>{var t={646:t=>{t.exports=function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e<t.length;e++)n[e]=t[e];return n}}},713:t=>{t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}},860:t=>{t.exports=function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}},206:t=>{t.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}},319:(t,e,n)=>{var o=n(646),i=n(860),s=n(206);t.exports=function(t){return o(t)||i(t)||s()}},8:t=>{function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}},e={};function n(o){var i=e[o];if(void 0!==i)return i.exports;var s=e[o]={exports:{}};return t[o](s,s.exports,n),s.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";n.r(o),n.d(o,{VueSelect:()=>m,default:()=>O,mixins:()=>_});var t=n(319),e=n.n(t),i=n(8),s=n.n(i),r=n(713),a=n.n(r);const l={props:{autoscroll:{type:Boolean,default:!0}},watch:{typeAheadPointer:function(){this.autoscroll&&this.maybeAdjustScroll()},open:function(t){var e=this;this.autoscroll&&t&&this.$nextTick((function(){return e.maybeAdjustScroll()}))}},methods:{maybeAdjustScroll:function(){var t,e=(null===(t=this.$refs.dropdownMenu)||void 0===t?void 0:t.children[this.typeAheadPointer])||!1;if(e){var n=this.getDropdownViewport(),o=e.getBoundingClientRect(),i=o.top,s=o.bottom,r=o.height;if(i<n.top)return this.$refs.dropdownMenu.scrollTop=e.offsetTop;if(s>n.bottom)return this.$refs.dropdownMenu.scrollTop=e.offsetTop-(n.height-r)}},getDropdownViewport:function(){return this.$refs.dropdownMenu?this.$refs.dropdownMenu.getBoundingClientRect():{height:0,top:0,bottom:0}}}},c={data:function(){return{typeAheadPointer:-1}},watch:{filteredOptions:function(){for(var t=0;t<this.filteredOptions.length;t++)if(this.selectable(this.filteredOptions[t])){this.typeAheadPointer=t;break}},open:function(t){t&&this.typeAheadToLastSelected()},selectedValue:function(){this.open&&this.typeAheadToLastSelected()}},methods:{typeAheadUp:function(){for(var t=this.typeAheadPointer-1;t>=0;t--)if(this.selectable(this.filteredOptions[t])){this.typeAheadPointer=t;break}},typeAheadDown:function(){for(var t=this.typeAheadPointer+1;t<this.filteredOptions.length;t++)if(this.selectable(this.filteredOptions[t])){this.typeAheadPointer=t;break}},typeAheadSelect:function(){var t=this.filteredOptions[this.typeAheadPointer];t&&this.selectable(t)&&this.select(t)},typeAheadToLastSelected:function(){this.typeAheadPointer=0!==this.selectedValue.length?this.filteredOptions.indexOf(this.selectedValue[this.selectedValue.length-1]):-1}}},u={props:{loading:{type:Boolean,default:!1}},data:function(){return{mutableLoading:!1}},watch:{search:function(){this.$emit("search",this.search,this.toggleLoading)},loading:function(t){this.mutableLoading=t}},methods:{toggleLoading:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return this.mutableLoading=null==t?!this.mutableLoading:t}}};function p(t,e,n,o,i,s,r,a){var l,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),o&&(c.functional=!0),s&&(c._scopeId="data-v-"+s),r?(l=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),i&&i.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(r)},c._ssrRegister=l):i&&(l=a?function(){i.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:i),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(t,e){return l.call(e),u(t,e)}}else{var p=c.beforeCreate;c.beforeCreate=p?[].concat(p,l):[l]}return{exports:t,options:c}}const h={Deselect:p({},(function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10"}},[e("path",{attrs:{d:"M6.895455 5l2.842897-2.842898c.348864-.348863.348864-.914488 0-1.263636L9.106534.261648c-.348864-.348864-.914489-.348864-1.263636 0L5 3.104545 2.157102.261648c-.348863-.348864-.914488-.348864-1.263636 0L.261648.893466c-.348864.348864-.348864.914489 0 1.263636L3.104545 5 .261648 7.842898c-.348864.348863-.348864.914488 0 1.263636l.631818.631818c.348864.348864.914773.348864 1.263636 0L5 6.895455l2.842898 2.842897c.348863.348864.914772.348864 1.263636 0l.631818-.631818c.348864-.348864.348864-.914489 0-1.263636L6.895455 5z"}})])}),[],!1,null,null,null).exports,OpenIndicator:p({},(function(){var t=this.$createElement,e=this._self._c||t;return e("svg",{attrs:{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"10"}},[e("path",{attrs:{d:"M9.211364 7.59931l4.48338-4.867229c.407008-.441854.407008-1.158247 0-1.60046l-.73712-.80023c-.407008-.441854-1.066904-.441854-1.474243 0L7 5.198617 2.51662.33139c-.407008-.441853-1.066904-.441853-1.474243 0l-.737121.80023c-.407008.441854-.407008 1.158248 0 1.600461l4.48338 4.867228L7 10l2.211364-2.40069z"}})])}),[],!1,null,null,null).exports},d={inserted:function(t,e,n){var o=n.context;if(o.appendToBody){var i=o.$refs.toggle.getBoundingClientRect(),s=i.height,r=i.top,a=i.left,l=i.width,c=window.scrollX||window.pageXOffset,u=window.scrollY||window.pageYOffset;t.unbindPosition=o.calculatePosition(t,o,{width:l+"px",left:c+a+"px",top:u+r+s+"px"}),document.body.appendChild(t)}},unbind:function(t,e,n){n.context.appendToBody&&(t.unbindPosition&&"function"==typeof t.unbindPosition&&t.unbindPosition(),t.parentNode&&t.parentNode.removeChild(t))}};const f=function(t){var e={};return Object.keys(t).sort().forEach((function(n){e[n]=t[n]})),JSON.stringify(e)};var y=0;const b=function(){return++y};function g(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function v(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?g(Object(n),!0).forEach((function(e){a()(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):g(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}const m=p({components:v({},h),directives:{appendToBody:d},mixins:[l,c,u],props:{value:{},components:{type:Object,default:function(){return{}}},options:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},deselectFromDropdown:{type:Boolean,default:!1},searchable:{type:Boolean,default:!0},multiple:{type:Boolean,default:!1},placeholder:{type:String,default:""},transition:{type:String,default:"vs__fade"},clearSearchOnSelect:{type:Boolean,default:!0},closeOnSelect:{type:Boolean,default:!0},label:{type:String,default:"label"},autocomplete:{type:String,default:"off"},reduce:{type:Function,default:function(t){return t}},selectable:{type:Function,default:function(t){return!0}},getOptionLabel:{type:Function,default:function(t){return"object"===s()(t)?t.hasOwnProperty(this.label)?t[this.label]:console.warn('[vue-select warn]: Label key "option.'.concat(this.label,'" does not')+" exist in options object ".concat(JSON.stringify(t),".\n")+"https://vue-select.org/api/props.html#getoptionlabel"):t}},getOptionKey:{type:Function,default:function(t){if("object"!==s()(t))return t;try{return t.hasOwnProperty("id")?t.id:f(t)}catch(e){return console.warn("[vue-select warn]: Could not stringify this option to generate unique key. Please provide'getOptionKey' prop to return a unique key for each option.\nhttps://vue-select.org/api/props.html#getoptionkey",t,e)}}},onTab:{type:Function,default:function(){this.selectOnTab&&!this.isComposing&&this.typeAheadSelect()}},taggable:{type:Boolean,default:!1},tabindex:{type:Number,default:null},pushTags:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},filterBy:{type:Function,default:function(t,e,n){return(e||"").toLocaleLowerCase().indexOf(n.toLocaleLowerCase())>-1}},filter:{type:Function,default:function(t,e){var n=this;return t.filter((function(t){var o=n.getOptionLabel(t);return"number"==typeof o&&(o=o.toString()),n.filterBy(t,o,e)}))}},createOption:{type:Function,default:function(t){return"object"===s()(this.optionList[0])?a()({},this.label,t):t}},resetOnOptionsChange:{default:!1,validator:function(t){return["function","boolean"].includes(s()(t))}},clearSearchOnBlur:{type:Function,default:function(t){var e=t.clearSearchOnSelect,n=t.multiple;return e&&!n}},noDrop:{type:Boolean,default:!1},inputId:{type:String},dir:{type:String,default:"auto"},selectOnTab:{type:Boolean,default:!1},selectOnKeyCodes:{type:Array,default:function(){return[13]}},searchInputQuerySelector:{type:String,default:"[type=search]"},mapKeydown:{type:Function,default:function(t,e){return t}},appendToBody:{type:Boolean,default:!1},calculatePosition:{type:Function,default:function(t,e,n){var o=n.width,i=n.top,s=n.left;t.style.top=i,t.style.left=s,t.style.width=o}},dropdownShouldOpen:{type:Function,default:function(t){var e=t.noDrop,n=t.open,o=t.mutableLoading;return!e&&(n&&!o)}},uid:{type:[String,Number],default:function(){return b()}}},data:function(){return{search:"",open:!1,isComposing:!1,pushedTags:[],_value:[]}},computed:{isTrackingValues:function(){return void 0===this.value||this.$options.propsData.hasOwnProperty("reduce")},selectedValue:function(){var t=this.value;return this.isTrackingValues&&(t=this.$data._value),null!=t&&""!==t?[].concat(t):[]},optionList:function(){return this.options.concat(this.pushTags?this.pushedTags:[])},searchEl:function(){return this.$scopedSlots.search?this.$refs.selectedOptions.querySelector(this.searchInputQuerySelector):this.$refs.search},scope:function(){var t=this,e={search:this.search,loading:this.loading,searching:this.searching,filteredOptions:this.filteredOptions};return{search:{attributes:v({disabled:this.disabled,placeholder:this.searchPlaceholder,tabindex:this.tabindex,readonly:!this.searchable,id:this.inputId,"aria-autocomplete":"list","aria-labelledby":"vs".concat(this.uid,"__combobox"),"aria-controls":"vs".concat(this.uid,"__listbox"),ref:"search",type:"search",autocomplete:this.autocomplete,value:this.search},this.dropdownOpen&&this.filteredOptions[this.typeAheadPointer]?{"aria-activedescendant":"vs".concat(this.uid,"__option-").concat(this.typeAheadPointer)}:{}),events:{compositionstart:function(){return t.isComposing=!0},compositionend:function(){return t.isComposing=!1},keydown:this.onSearchKeyDown,blur:this.onSearchBlur,focus:this.onSearchFocus,input:function(e){return t.search=e.target.value}}},spinner:{loading:this.mutableLoading},noOptions:{search:this.search,loading:this.mutableLoading,searching:this.searching},openIndicator:{attributes:{ref:"openIndicator",role:"presentation",class:"vs__open-indicator"}},listHeader:e,listFooter:e,header:v({},e,{deselect:this.deselect}),footer:v({},e,{deselect:this.deselect})}},childComponents:function(){return v({},h,{},this.components)},stateClasses:function(){return{"vs--open":this.dropdownOpen,"vs--single":!this.multiple,"vs--multiple":this.multiple,"vs--searching":this.searching&&!this.noDrop,"vs--searchable":this.searchable&&!this.noDrop,"vs--unsearchable":!this.searchable,"vs--loading":this.mutableLoading,"vs--disabled":this.disabled}},searching:function(){return!!this.search},dropdownOpen:function(){return this.dropdownShouldOpen(this)},searchPlaceholder:function(){return this.isValueEmpty&&this.placeholder?this.placeholder:void 0},filteredOptions:function(){var t=[].concat(this.optionList);if(!this.filterable&&!this.taggable)return t;var e=this.search.length?this.filter(t,this.search,this):t;if(this.taggable&&this.search.length){var n=this.createOption(this.search);this.optionExists(n)||e.unshift(n)}return e},isValueEmpty:function(){return 0===this.selectedValue.length},showClearButton:function(){return!this.multiple&&this.clearable&&!this.open&&!this.isValueEmpty}},watch:{options:function(t,e){var n=this;!this.taggable&&("function"==typeof n.resetOnOptionsChange?n.resetOnOptionsChange(t,e,n.selectedValue):n.resetOnOptionsChange)&&this.clearSelection(),this.value&&this.isTrackingValues&&this.setInternalValueFromOptions(this.value)},value:{immediate:!0,handler:function(t){this.isTrackingValues&&this.setInternalValueFromOptions(t)}},multiple:function(){this.clearSelection()},open:function(t){this.$emit(t?"open":"close")}},created:function(){this.mutableLoading=this.loading,this.$on("option:created",this.pushTag)},methods:{setInternalValueFromOptions:function(t){var e=this;Array.isArray(t)?this.$data._value=t.map((function(t){return e.findOptionFromReducedValue(t)})):this.$data._value=this.findOptionFromReducedValue(t)},select:function(t){this.$emit("option:selecting",t),this.isOptionSelected(t)?this.deselectFromDropdown&&(this.clearable||this.multiple&&this.selectedValue.length>1)&&this.deselect(t):(this.taggable&&!this.optionExists(t)&&this.$emit("option:created",t),this.multiple&&(t=this.selectedValue.concat(t)),this.updateValue(t),this.$emit("option:selected",t)),this.onAfterSelect(t)},deselect:function(t){var e=this;this.$emit("option:deselecting",t),this.updateValue(this.selectedValue.filter((function(n){return!e.optionComparator(n,t)}))),this.$emit("option:deselected",t)},clearSelection:function(){this.updateValue(this.multiple?[]:null)},onAfterSelect:function(t){this.closeOnSelect&&(this.open=!this.open,this.searchEl.blur()),this.clearSearchOnSelect&&(this.search="")},updateValue:function(t){var e=this;void 0===this.value&&(this.$data._value=t),null!==t&&(t=Array.isArray(t)?t.map((function(t){return e.reduce(t)})):this.reduce(t)),this.$emit("input",t)},toggleDropdown:function(t){var n=t.target!==this.searchEl;n&&t.preventDefault();var o=[].concat(e()(this.$refs.deselectButtons||[]),e()([this.$refs.clearButton]||false));void 0===this.searchEl||o.filter(Boolean).some((function(e){return e.contains(t.target)||e===t.target}))?t.preventDefault():this.open&&n?this.searchEl.blur():this.disabled||(this.open=!0,this.searchEl.focus())},isOptionSelected:function(t){var e=this;return this.selectedValue.some((function(n){return e.optionComparator(n,t)}))},isOptionDeselectable:function(t){return this.isOptionSelected(t)&&this.deselectFromDropdown},optionComparator:function(t,e){return this.getOptionKey(t)===this.getOptionKey(e)},findOptionFromReducedValue:function(t){var n=this,o=[].concat(e()(this.options),e()(this.pushedTags)).filter((function(e){return JSON.stringify(n.reduce(e))===JSON.stringify(t)}));return 1===o.length?o[0]:o.find((function(t){return n.optionComparator(t,n.$data._value)}))||t},closeSearchOptions:function(){this.open=!1,this.$emit("search:blur")},maybeDeleteValue:function(){if(!this.searchEl.value.length&&this.selectedValue&&this.selectedValue.length&&this.clearable){var t=null;this.multiple&&(t=e()(this.selectedValue.slice(0,this.selectedValue.length-1))),this.updateValue(t)}},optionExists:function(t){var e=this;return this.optionList.some((function(n){return e.optionComparator(n,t)}))},normalizeOptionForSlot:function(t){return"object"===s()(t)?t:a()({},this.label,t)},pushTag:function(t){this.pushedTags.push(t)},onEscape:function(){this.search.length?this.search="":this.searchEl.blur()},onSearchBlur:function(){if(!this.mousedown||this.searching){var t=this.clearSearchOnSelect,e=this.multiple;return this.clearSearchOnBlur({clearSearchOnSelect:t,multiple:e})&&(this.search=""),void this.closeSearchOptions()}this.mousedown=!1,0!==this.search.length||0!==this.options.length||this.closeSearchOptions()},onSearchFocus:function(){this.open=!0,this.$emit("search:focus")},onMousedown:function(){this.mousedown=!0},onMouseUp:function(){this.mousedown=!1},onSearchKeyDown:function(t){var e=this,n=function(t){return t.preventDefault(),!e.isComposing&&e.typeAheadSelect()},o={8:function(t){return e.maybeDeleteValue()},9:function(t){return e.onTab()},27:function(t){return e.onEscape()},38:function(t){return t.preventDefault(),e.typeAheadUp()},40:function(t){return t.preventDefault(),e.typeAheadDown()}};this.selectOnKeyCodes.forEach((function(t){return o[t]=n}));var i=this.mapKeydown(o,this);if("function"==typeof i[t.keyCode])return i[t.keyCode](t)}}},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"v-select",class:t.stateClasses,attrs:{dir:t.dir}},[t._t("header",null,null,t.scope.header),t._v(" "),n("div",{ref:"toggle",staticClass:"vs__dropdown-toggle",attrs:{id:"vs"+t.uid+"__combobox",role:"combobox","aria-expanded":t.dropdownOpen.toString(),"aria-owns":"vs"+t.uid+"__listbox","aria-label":"Search for option"},on:{mousedown:function(e){return t.toggleDropdown(e)}}},[n("div",{ref:"selectedOptions",staticClass:"vs__selected-options"},[t._l(t.selectedValue,(function(e){return t._t("selected-option-container",[n("span",{key:t.getOptionKey(e),staticClass:"vs__selected"},[t._t("selected-option",[t._v("\n "+t._s(t.getOptionLabel(e))+"\n ")],null,t.normalizeOptionForSlot(e)),t._v(" "),t.multiple?n("button",{ref:"deselectButtons",refInFor:!0,staticClass:"vs__deselect",attrs:{disabled:t.disabled,type:"button",title:"Deselect "+t.getOptionLabel(e),"aria-label":"Deselect "+t.getOptionLabel(e)},on:{click:function(n){return t.deselect(e)}}},[n(t.childComponents.Deselect,{tag:"component"})],1):t._e()],2)],{option:t.normalizeOptionForSlot(e),deselect:t.deselect,multiple:t.multiple,disabled:t.disabled})})),t._v(" "),t._t("search",[n("input",t._g(t._b({staticClass:"vs__search"},"input",t.scope.search.attributes,!1),t.scope.search.events))],null,t.scope.search)],2),t._v(" "),n("div",{ref:"actions",staticClass:"vs__actions"},[n("button",{directives:[{name:"show",rawName:"v-show",value:t.showClearButton,expression:"showClearButton"}],ref:"clearButton",staticClass:"vs__clear",attrs:{disabled:t.disabled,type:"button",title:"Clear Selected","aria-label":"Clear Selected"},on:{click:t.clearSelection}},[n(t.childComponents.Deselect,{tag:"component"})],1),t._v(" "),t._t("open-indicator",[t.noDrop?t._e():n(t.childComponents.OpenIndicator,t._b({tag:"component"},"component",t.scope.openIndicator.attributes,!1))],null,t.scope.openIndicator),t._v(" "),t._t("spinner",[n("div",{directives:[{name:"show",rawName:"v-show",value:t.mutableLoading,expression:"mutableLoading"}],staticClass:"vs__spinner"},[t._v("Loading...")])],null,t.scope.spinner)],2)]),t._v(" "),n("transition",{attrs:{name:t.transition}},[t.dropdownOpen?n("ul",{directives:[{name:"append-to-body",rawName:"v-append-to-body"}],key:"vs"+t.uid+"__listbox",ref:"dropdownMenu",staticClass:"vs__dropdown-menu",attrs:{id:"vs"+t.uid+"__listbox",role:"listbox",tabindex:"-1"},on:{mousedown:function(e){return e.preventDefault(),t.onMousedown(e)},mouseup:t.onMouseUp}},[t._t("list-header",null,null,t.scope.listHeader),t._v(" "),t._l(t.filteredOptions,(function(e,o){return n("li",{key:t.getOptionKey(e),staticClass:"vs__dropdown-option",class:{"vs__dropdown-option--deselect":t.isOptionDeselectable(e)&&o===t.typeAheadPointer,"vs__dropdown-option--selected":t.isOptionSelected(e),"vs__dropdown-option--highlight":o===t.typeAheadPointer,"vs__dropdown-option--disabled":!t.selectable(e)},attrs:{id:"vs"+t.uid+"__option-"+o,role:"option","aria-selected":o===t.typeAheadPointer||null},on:{mouseover:function(n){t.selectable(e)&&(t.typeAheadPointer=o)},click:function(n){n.preventDefault(),n.stopPropagation(),t.selectable(e)&&t.select(e)}}},[t._t("option",[t._v("\n "+t._s(t.getOptionLabel(e))+"\n ")],null,t.normalizeOptionForSlot(e))],2)})),t._v(" "),0===t.filteredOptions.length?n("li",{staticClass:"vs__no-options"},[t._t("no-options",[t._v("\n Sorry, no matching options.\n ")],null,t.scope.noOptions)],2):t._e(),t._v(" "),t._t("list-footer",null,null,t.scope.listFooter)],2):n("ul",{staticStyle:{display:"none",visibility:"hidden"},attrs:{id:"vs"+t.uid+"__listbox",role:"listbox"}})]),t._v(" "),t._t("footer",null,null,t.scope.footer)],2)}),[],!1,null,null,null).exports,_={ajax:u,pointer:c,pointerScroll:l},O=m})(),o})()})); 65613//# sourceMappingURL=vue-select.js.map 65614 65615/***/ }), 65616
vendor: 57,540 bytes, lines 65617-65627
65617/***/ "./node_modules/vue-toasted/dist/vue-toasted.min.js": 65618/*!**********************************************************!*\ 65619 !*** ./node_modules/vue-toasted/dist/vue-toasted.min.js ***! 65620 \**********************************************************/ 65621/*! no static exports found */ 65622/***/ (function(module, exports, __webpack_require__) { 65623 65624!function(t,e){if(true)module.exports=e();else { var r, n; }}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=6)}([function(t,e,n){"use strict";function r(){d=!1}function i(t){if(!t)return void(f!==m&&(f=m,r()));if(t!==f){if(t.length!==m.length)throw new Error("Custom alphabet for shortid must be "+m.length+" unique characters. You submitted "+t.length+" characters: "+t);var e=t.split("").filter(function(t,e,n){return e!==n.lastIndexOf(t)});if(e.length)throw new Error("Custom alphabet for shortid must be "+m.length+" unique characters. These characters were not unique: "+e.join(", "));f=t,r()}}function o(t){return i(t),f}function a(t){h.seed(t),p!==t&&(r(),p=t)}function s(){f||i(m);for(var t,e=f.split(""),n=[],r=h.nextValue();e.length>0;)r=h.nextValue(),t=Math.floor(r*e.length),n.push(e.splice(t,1)[0]);return n.join("")}function c(){return d||(d=s())}function u(t){return c()[t]}function l(){return f||m}var f,p,d,h=n(19),m="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_-";t.exports={get:l,characters:o,seed:a,lookup:u,shuffled:c}},function(t,e,n){"use strict";var r=n(5),i=n.n(r);e.a={animateIn:function(t){i()({targets:t,translateY:"-35px",opacity:1,duration:300,easing:"easeOutCubic"})},animateOut:function(t,e){i()({targets:t,opacity:0,marginTop:"-40px",duration:300,easing:"easeOutExpo",complete:e})},animateOutBottom:function(t,e){i()({targets:t,opacity:0,marginBottom:"-40px",duration:300,easing:"easeOutExpo",complete:e})},animateReset:function(t){i()({targets:t,left:0,opacity:1,duration:300,easing:"easeOutExpo"})},animatePanning:function(t,e,n){i()({targets:t,duration:10,easing:"easeOutQuad",left:e,opacity:n})},animatePanEnd:function(t,e){i()({targets:t,opacity:0,duration:300,easing:"easeOutExpo",complete:e})},clearAnimation:function(t){var e=i.a.timeline();t.forEach(function(t){e.add({targets:t.el,opacity:0,right:"-40px",duration:300,offset:"-=150",easing:"easeOutExpo",complete:function(){t.remove()}})})}}},function(t,e,n){"use strict";t.exports=n(16)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(8),i=n(1),o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=n(2);n(11).polyfill();var s=function t(e){var n=this;return this.id=a.generate(),this.options=e,this.cached_options={},this.global={},this.groups=[],this.toasts=[],this.container=null,l(this),u(this),this.group=function(e){e||(e={}),e.globalToasts||(e.globalToasts={}),Object.assign(e.globalToasts,n.global);var r=new t(e);return n.groups.push(r),r},this.register=function(t,e,r){return r=r||{},f(n,t,e,r)},this.show=function(t,e){return c(n,t,e)},this.success=function(t,e){return e=e||{},e.type="success",c(n,t,e)},this.info=function(t,e){return e=e||{},e.type="info",c(n,t,e)},this.error=function(t,e){return e=e||{},e.type="error",c(n,t,e)},this.remove=function(t){n.toasts=n.toasts.filter(function(e){return e.el.hash!==t.hash}),t.parentNode&&t.parentNode.removeChild(t)},this.clear=function(t){return i.a.clearAnimation(n.toasts,function(){t&&t()}),n.toasts=[],!0},this},c=function(t,e,i){i=i||{};var a=null;if("object"!==(void 0===i?"undefined":o(i)))return console.error("Options should be a type of object. given : "+i),null;t.options.singleton&&t.toasts.length>0&&(t.cached_options=i,t.toasts[t.toasts.length-1].goAway(0));var s=Object.assign({},t.options);return Object.assign(s,i),a=n.i(r.a)(t,e,s),t.toasts.push(a),a},u=function(t){var e=t.options.globalToasts,n=function(e,n){return"string"==typeof n&&t[n]?t[n].apply(t,[e,{}]):c(t,e,n)};e&&(t.global={},Object.keys(e).forEach(function(r){t.global[r]=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e[r].apply(null,[t,n])}}))},l=function(t){var e=document.createElement("div");e.id=t.id,e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),e.setAttribute("aria-atomic","false"),document.body.appendChild(e),t.container=e},f=function(t,e,n,r){t.options.globalToasts||(t.options.globalToasts={}),t.options.globalToasts[e]=function(t,e){var i=null;return"string"==typeof n&&(i=n),"function"==typeof n&&(i=n(t)),e(i,r)},u(t)}},function(t,e,n){n(22);var r=n(21)(null,null,null,null);t.exports=r.exports},function(t,e,n){(function(n){var r,i,o,a={scope:{}};a.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(t,e,n){if(n.get||n.set)throw new TypeError("ES3 does not support getters and setters.");t!=Array.prototype&&t!=Object.prototype&&(t[e]=n.value)},a.getGlobal=function(t){return"undefined"!=typeof window&&window===t?t:void 0!==n&&null!=n?n:t},a.global=a.getGlobal(this),a.SYMBOL_PREFIX="jscomp_symbol_",a.initSymbol=function(){a.initSymbol=function(){},a.global.Symbol||(a.global.Symbol=a.Symbol)},a.symbolCounter_=0,a.Symbol=function(t){return a.SYMBOL_PREFIX+(t||"")+a.symbolCounter_++},a.initSymbolIterator=function(){a.initSymbol();var t=a.global.Symbol.iterator;t||(t=a.global.Symbol.iterator=a.global.Symbol("iterator")),"function"!=typeof Array.prototype[t]&&a.defineProperty(Array.prototype,t,{configurable:!0,writable:!0,value:function(){return a.arrayIterator(this)}}),a.initSymbolIterator=function(){}},a.arrayIterator=function(t){var e=0;return a.iteratorPrototype(function(){return e<t.length?{done:!1,value:t[e++]}:{done:!0}})},a.iteratorPrototype=function(t){return a.initSymbolIterator(),t={next:t},t[a.global.Symbol.iterator]=function(){return this},t},a.array=a.array||{},a.iteratorFromArray=function(t,e){a.initSymbolIterator(),t instanceof String&&(t+="");var n=0,r={next:function(){if(n<t.length){var i=n++;return{value:e(i,t[i]),done:!1}}return r.next=function(){return{done:!0,value:void 0}},r.next()}};return r[Symbol.iterator]=function(){return r},r},a.polyfill=function(t,e,n,r){if(e){for(n=a.global,t=t.split("."),r=0;r<t.length-1;r++){var i=t[r];i in n||(n[i]={}),n=n[i]}t=t[t.length-1],r=n[t],e=e(r),e!=r&&null!=e&&a.defineProperty(n,t,{configurable:!0,writable:!0,value:e})}},a.polyfill("Array.prototype.keys",function(t){return t||function(){return a.iteratorFromArray(this,function(t){return t})}},"es6-impl","es3");var s=this;!function(n,a){i=[],r=a,void 0!==(o="function"==typeof r?r.apply(e,i):r)&&(t.exports=o)}(0,function(){function t(t){if(!R.col(t))try{return document.querySelectorAll(t)}catch(t){}}function e(t,e){for(var n=t.length,r=2<=arguments.length?arguments[1]:void 0,i=[],o=0;o<n;o++)if(o in t){var a=t[o];e.call(r,a,o,t)&&i.push(a)}return i}function n(t){return t.reduce(function(t,e){return t.concat(R.arr(e)?n(e):e)},[])}function r(e){return R.arr(e)?e:(R.str(e)&&(e=t(e)||e),e instanceof NodeList||e instanceof HTMLCollection?[].slice.call(e):[e])}function i(t,e){return t.some(function(t){return t===e})}function o(t){var e,n={};for(e in t)n[e]=t[e];return n}function a(t,e){var n,r=o(t);for(n in t)r[n]=e.hasOwnProperty(n)?e[n]:t[n];return r}function c(t,e){var n,r=o(t);for(n in e)r[n]=R.und(t[n])?e[n]:t[n];return r}function u(t){t=t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(t,e,n,r){return e+e+n+n+r+r});var e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(t);t=parseInt(e[1],16);var n=parseInt(e[2],16),e=parseInt(e[3],16);return"rgba("+t+","+n+","+e+",1)"}function l(t){function e(t,e,n){return 0>n&&(n+=1),1<n&&--n,n<1/6?t+6*(e-t)*n:.5>n?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var n=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(t);t=parseInt(n[1])/360;var r=parseInt(n[2])/100,i=parseInt(n[3])/100,n=n[4]||1;if(0==r)i=r=t=i;else{var o=.5>i?i*(1+r):i+r-i*r,a=2*i-o,i=e(a,o,t+1/3),r=e(a,o,t);t=e(a,o,t-1/3)}return"rgba("+255*i+","+255*r+","+255*t+","+n+")"}function f(t){if(t=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(t))return t[2]}function p(t){return-1<t.indexOf("translate")||"perspective"===t?"px":-1<t.indexOf("rotate")||-1<t.indexOf("skew")?"deg":void 0}function d(t,e){return R.fnc(t)?t(e.target,e.id,e.total):t}function h(t,e){if(e in t.style)return getComputedStyle(t).getPropertyValue(e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase())||"0"}function m(t,e){return R.dom(t)&&i(D,e)?"transform":R.dom(t)&&(t.getAttribute(e)||R.svg(t)&&t[e])?"attribute":R.dom(t)&&"transform"!==e&&h(t,e)?"css":null!=t[e]?"object":void 0}function v(t,n){var r=p(n),r=-1<n.indexOf("scale")?1:0+r;if(!(t=t.style.transform))return r;for(var i=[],o=[],a=[],s=/(\w+)\((.+?)\)/g;i=s.exec(t);)o.push(i[1]),a.push(i[2]);return t=e(a,function(t,e){return o[e]===n}),t.length?t[0]:r}function g(t,e){switch(m(t,e)){case"transform":return v(t,e);case"css":return h(t,e);case"attribute":return t.getAttribute(e)}return t[e]||0}function y(t,e){var n=/^(\*=|\+=|-=)/.exec(t);if(!n)return t;var r=f(t)||0;switch(e=parseFloat(e),t=parseFloat(t.replace(n[0],"")),n[0][0]){case"+":return e+t+r;case"-":return e-t+r;case"*":return e*t+r}}function b(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function x(t){t=t.points;for(var e,n=0,r=0;r<t.numberOfItems;r++){var i=t.getItem(r);0<r&&(n+=b(e,i)),e=i}return n}function T(t){if(t.getTotalLength)return t.getTotalLength();switch(t.tagName.toLowerCase()){case"circle":return 2*Math.PI*t.getAttribute("r");case"rect":return 2*t.getAttribute("width")+2*t.getAttribute("height");case"line":return b({x:t.getAttribute("x1"),y:t.getAttribute("y1")},{x:t.getAttribute("x2"),y:t.getAttribute("y2")});case"polyline":return x(t);case"polygon":var e=t.points;return x(t)+b(e.getItem(e.numberOfItems-1),e.getItem(0))}}function w(t,e){function n(n){return n=void 0===n?0:n,t.el.getPointAtLength(1<=e+n?e+n:0)}var r=n(),i=n(-1),o=n(1);switch(t.property){case"x":return r.x;case"y":return r.y;case"angle":return 180*Math.atan2(o.y-i.y,o.x-i.x)/Math.PI}}function E(t,e){var n,r=/-?\d*\.?\d+/g;if(n=R.pth(t)?t.totalLength:t,R.col(n))if(R.rgb(n)){var i=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(n);n=i?"rgba("+i[1]+",1)":n}else n=R.hex(n)?u(n):R.hsl(n)?l(n):void 0;else i=(i=f(n))?n.substr(0,n.length-i.length):n,n=e&&!/\s/g.test(n)?i+e:i;return n+="",{original:n,numbers:n.match(r)?n.match(r).map(Number):[0],strings:R.str(t)||e?n.split(r):[]}}function C(t){return t=t?n(R.arr(t)?t.map(r):r(t)):[],e(t,function(t,e,n){return n.indexOf(t)===e})}function S(t){var e=C(t);return e.map(function(t,n){return{target:t,id:n,total:e.length}})}function O(t,e){var n=o(e);if(R.arr(t)){var i=t.length;2!==i||R.obj(t[0])?R.fnc(e.duration)||(n.duration=e.duration/i):t={value:t}}return r(t).map(function(t,n){return n=n?0:e.delay,t=R.obj(t)&&!R.pth(t)?t:{value:t},R.und(t.delay)&&(t.delay=n),t}).map(function(t){return c(t,n)})}function A(t,e){var n,r={};for(n in t){var i=d(t[n],e);R.arr(i)&&(i=i.map(function(t){return d(t,e)}),1===i.length&&(i=i[0])),r[n]=i}return r.duration=parseFloat(r.duration),r.delay=parseFloat(r.delay),r}function I(t){return R.arr(t)?F.apply(this,t):z[t]}function M(t,e){var n;return t.tweens.map(function(r){r=A(r,e);var i=r.value,o=g(e.target,t.name),a=n?n.to.original:o,a=R.arr(i)?i[0]:a,s=y(R.arr(i)?i[1]:i,a),o=f(s)||f(a)||f(o);return r.from=E(a,o),r.to=E(s,o),r.start=n?n.end:t.offset,r.end=r.start+r.delay+r.duration,r.easing=I(r.easing),r.elasticity=(1e3-Math.min(Math.max(r.elasticity,1),999))/1e3,r.isPath=R.pth(i),r.isColor=R.col(r.from.original),r.isColor&&(r.round=1),n=r})}function k(t,r){return e(n(t.map(function(t){return r.map(function(e){var n=m(t.target,e.name);if(n){var r=M(e,t);e={type:n,property:e.name,animatable:t,tweens:r,duration:r[r.length-1].end,delay:r[0].delay}}else e=void 0;return e})})),function(t){return!R.und(t)})}function P(t,e,n,r){var i="delay"===t;return e.length?(i?Math.min:Math.max).apply(Math,e.map(function(e){return e[t]})):i?r.delay:n.offset+r.delay+r.duration}function L(t){var e,n=a(_,t),r=a(X,t),i=S(t.targets),o=[],s=c(n,r);for(e in t)s.hasOwnProperty(e)||"targets"===e||o.push({name:e,offset:s.offset,tweens:O(t[e],r)});return t=k(i,o),c(n,{children:[],animatables:i,animations:t,duration:P("duration",t,n,r),delay:P("delay",t,n,r)})}function j(t){function n(){return window.Promise&&new Promise(function(t){return f=t})}function r(t){return d.reversed?d.duration-t:t}function i(t){for(var n=0,r={},i=d.animations,o=i.length;n<o;){var a=i[n],s=a.animatable,c=a.tweens,u=c.length-1,l=c[u];u&&(l=e(c,function(e){return t<e.end})[0]||l);for(var c=Math.min(Math.max(t-l.start-l.delay,0),l.duration)/l.duration,f=isNaN(c)?1:l.easing(c,l.elasticity),c=l.to.strings,p=l.round,u=[],m=void 0,m=l.to.numbers.length,v=0;v<m;v++){var g=void 0,g=l.to.numbers[v],y=l.from.numbers[v],g=l.isPath?w(l.value,f*g):y+f*(g-y);p&&(l.isColor&&2<v||(g=Math.round(g*p)/p)),u.push(g)}if(l=c.length)for(m=c[0],f=0;f<l;f++)p=c[f+1],v=u[f],isNaN(v)||(m=p?m+(v+p):m+(v+" "));else m=u[0];Y[a.type](s.target,a.property,m,r,s.id),a.currentValue=m,n++}if(n=Object.keys(r).length)for(i=0;i<n;i++)N||(N=h(document.body,"transform")?"transform":"-webkit-transform"),d.animatables[i].target.style[N]=r[i].join(" ");d.currentTime=t,d.progress=t/d.duration*100}function o(t){d[t]&&d[t](d)}function a(){d.remaining&&!0!==d.remaining&&d.remaining--}function s(t){var e=d.duration,s=d.offset,h=s+d.delay,m=d.currentTime,v=d.reversed,g=r(t);if(d.children.length){var y=d.children,b=y.length;if(g>=d.currentTime)for(var x=0;x<b;x++)y[x].seek(g);else for(;b--;)y[b].seek(g)}(g>=h||!e)&&(d.began||(d.began=!0,o("begin")),o("run")),g>s&&g<e?i(g):(g<=s&&0!==m&&(i(0),v&&a()),(g>=e&&m!==e||!e)&&(i(e),v||a())),o("update"),t>=e&&(d.remaining?(u=c,"alternate"===d.direction&&(d.reversed=!d.reversed)):(d.pause(),d.completed||(d.completed=!0,o("complete"),"Promise"in window&&(f(),p=n()))),l=0)}t=void 0===t?{}:t;var c,u,l=0,f=null,p=n(),d=L(t);return d.reset=function(){var t=d.direction,e=d.loop;for(d.currentTime=0,d.progress=0,d.paused=!0,d.began=!1,d.completed=!1,d.reversed="reverse"===t,d.remaining="alternate"===t&&1===e?2:e,i(0),t=d.children.length;t--;)d.children[t].reset()},d.tick=function(t){c=t,u||(u=c),s((l+c-u)*j.speed)},d.seek=function(t){s(r(t))},d.pause=function(){var t=H.indexOf(d);-1<t&&H.splice(t,1),d.paused=!0},d.play=function(){d.paused&&(d.paused=!1,u=0,l=r(d.currentTime),H.push(d),q||V())},d.reverse=function(){d.reversed=!d.reversed,u=0,l=r(d.currentTime)},d.restart=function(){d.pause(),d.reset(),d.play()},d.finished=p,d.reset(),d.autoplay&&d.play(),d}var N,_={update:void 0,begin:void 0,run:void 0,complete:void 0,loop:1,direction:"normal",autoplay:!0,offset:0},X={duration:1e3,delay:0,easing:"easeOutElastic",elasticity:500,round:0},D="translateX translateY translateZ rotate rotateX rotateY rotateZ scale scaleX scaleY scaleZ skewX skewY perspective".split(" "),R={arr:function(t){return Array.isArray(t)},obj:function(t){return-1<Object.prototype.toString.call(t).indexOf("Object")},pth:function(t){return R.obj(t)&&t.hasOwnProperty("totalLength")},svg:function(t){return t instanceof SVGElement},dom:function(t){return t.nodeType||R.svg(t)},str:function(t){return"string"==typeof t},fnc:function(t){return"function"==typeof t},und:function(t){return void 0===t},hex:function(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)},rgb:function(t){return/^rgb/.test(t)},hsl:function(t){return/^hsl/.test(t)},col:function(t){return R.hex(t)||R.rgb(t)||R.hsl(t)}},F=function(){function t(t,e,n){return(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t}return function(e,n,r,i){if(0<=e&&1>=e&&0<=r&&1>=r){var o=new Float32Array(11);if(e!==n||r!==i)for(var a=0;11>a;++a)o[a]=t(.1*a,e,r);return function(a){if(e===n&&r===i)return a;if(0===a)return 0;if(1===a)return 1;for(var s=0,c=1;10!==c&&o[c]<=a;++c)s+=.1;--c;var c=s+(a-o[c])/(o[c+1]-o[c])*.1,u=3*(1-3*r+3*e)*c*c+2*(3*r-6*e)*c+3*e;if(.001<=u){for(s=0;4>s&&0!==(u=3*(1-3*r+3*e)*c*c+2*(3*r-6*e)*c+3*e);++s)var l=t(c,e,r)-a,c=c-l/u;a=c}else if(0===u)a=c;else{var c=s,s=s+.1,f=0;do{l=c+(s-c)/2,u=t(l,e,r)-a,0<u?s=l:c=l}while(1e-7<Math.abs(u)&&10>++f);a=l}return t(a,n,i)}}}}(),z=function(){function t(t,e){return 0===t||1===t?t:-Math.pow(2,10*(t-1))*Math.sin(2*(t-1-e/(2*Math.PI)*Math.asin(1))*Math.PI/e)}var e,n="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),r={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],t],Out:[[.25,.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(e,n){return 1-t(1-e,n)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(e,n){return.5>e?t(2*e,n)/2:1-t(-2*e+2,n)/2}]},i={linear:F(.25,.25,.75,.75)},o={};for(e in r)o.type=e,r[o.type].forEach(function(t){return function(e,r){i["ease"+t.type+n[r]]=R.fnc(e)?e:F.apply(s,e)}}(o)),o={type:o.type};return i}(),Y={css:function(t,e,n){return t.style[e]=n},attribute:function(t,e,n){return t.setAttribute(e,n)},object:function(t,e,n){return t[e]=n},transform:function(t,e,n,r,i){r[i]||(r[i]=[]),r[i].push(e+"("+n+")")}},H=[],q=0,V=function(){function t(){q=requestAnimationFrame(e)}function e(e){var n=H.length;if(n){for(var r=0;r<n;)H[r]&&H[r].tick(e),r++;t()}else cancelAnimationFrame(q),q=0}return t}();return j.version="2.2.0",j.speed=1,j.running=H,j.remove=function(t){t=C(t);for(var e=H.length;e--;)for(var n=H[e],r=n.animations,o=r.length;o--;)i(t,r[o].animatable.target)&&(r.splice(o,1),r.length||n.pause())},j.getValue=g,j.path=function(e,n){var r=R.str(e)?t(e)[0]:e,i=n||100;return function(t){return{el:r,property:t,totalLength:T(r)*(i/100)}}},j.setDashoffset=function(t){var e=T(t);return t.setAttribute("stroke-dasharray",e),e},j.bezier=F,j.easings=z,j.timeline=function(t){var e=j(t);return e.pause(),e.duration=0,e.add=function(n){return e.children.forEach(function(t){t.began=!0,t.completed=!0}),r(n).forEach(function(n){var r=c(n,a(X,t||{}));r.targets=r.targets||t.targets,n=e.duration;var i=r.offset;r.autoplay=!1,r.direction=e.direction,r.offset=R.und(i)?n:y(i,n),e.began=!0,e.completed=!0,e.seek(r.offset),r=j(r),r.began=!0,r.completed=!0,r.duration>n&&(e.duration=r.duration),e.children.push(r)}),e.seek(0),e.reset(),e.autoplay&&e.restart(),e},e},j.random=function(t,e){return Math.floor(Math.random()*(e-t+1))+t},j})}).call(e,n(25))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(4),o=n.n(i),a={install:function(t,e){e||(e={});var n=new r.a(e);t.component("toasted",o.a),t.toasted=t.prototype.$toasted=n}};"undefined"!=typeof window&&window.Vue&&(window.Toasted=a),e.default=a},function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n(1),i=this,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e,n){return setTimeout(function(){if(n.cached_options.position&&n.cached_options.position.includes("bottom"))return void r.a.animateOutBottom(t,function(){n.remove(t)});r.a.animateOut(t,function(){n.remove(t)})},e),!0},s=function(t,e){return("object"===("undefined"==typeof HTMLElement?"undefined":o(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":o(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)?t.appendChild(e):t.innerHTML=e,i},c=function(t,e){var n=!1;return{el:t,text:function(e){return s(t,e),this},goAway:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:800;return n=!0,a(t,r,e)},remove:function(){e.remove(t)},disposed:function(){return n}}}},function(t,e,n){"use strict";var r=n(12),i=n.n(r),o=n(1),a=n(7),s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},c=n(2);String.prototype.includes||Object.defineProperty(String.prototype,"includes",{value:function(t,e){return"number"!=typeof e&&(e=0),!(e+t.length>this.length)&&-1!==this.indexOf(t,e)}});var u={},l=null,f=function(t){return t.className=t.className||null,t.onComplete=t.onComplete||null,t.position=t.position||"top-right",t.duration=t.duration||null,t.keepOnHover=t.keepOnHover||!1,t.theme=t.theme||"toasted-primary",t.type=t.type||"default",t.containerClass=t.containerClass||null,t.fullWidth=t.fullWidth||!1,t.icon=t.icon||null,t.action=t.action||null,t.fitToScreen=t.fitToScreen||null,t.closeOnSwipe=void 0===t.closeOnSwipe||t.closeOnSwipe,t.iconPack=t.iconPack||"material",t.className&&"string"==typeof t.className&&(t.className=t.className.split(" ")),t.className||(t.className=[]),t.theme&&t.className.push(t.theme.trim()),t.type&&t.className.push(t.type),t.containerClass&&"string"==typeof t.containerClass&&(t.containerClass=t.containerClass.split(" ")),t.containerClass||(t.containerClass=[]),t.position&&t.containerClass.push(t.position.trim()),t.fullWidth&&t.containerClass.push("full-width"),t.fitToScreen&&t.containerClass.push("fit-to-screen"),u=t,t},p=function(t,e){var r=document.createElement("div");if(r.classList.add("toasted"),r.hash=c.generate(),e.className&&e.className.forEach(function(t){r.classList.add(t)}),("object"===("undefined"==typeof HTMLElement?"undefined":s(HTMLElement))?t instanceof HTMLElement:t&&"object"===(void 0===t?"undefined":s(t))&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName)?r.appendChild(t):r.innerHTML=t,d(e,r),e.closeOnSwipe){var u=new i.a(r,{prevent_default:!1});u.on("pan",function(t){var e=t.deltaX;r.classList.contains("panning")||r.classList.add("panning");var n=1-Math.abs(e/80);n<0&&(n=0),o.a.animatePanning(r,e,n)}),u.on("panend",function(t){var n=t.deltaX;Math.abs(n)>80?o.a.animatePanEnd(r,function(){"function"==typeof e.onComplete&&e.onComplete(),r.parentNode&&l.remove(r)}):(r.classList.remove("panning"),o.a.animateReset(r))})}if(Array.isArray(e.action))e.action.forEach(function(t){var e=m(t,n.i(a.a)(r,l));e&&r.appendChild(e)});else if("object"===s(e.action)){var f=m(e.action,n.i(a.a)(r,l));f&&r.appendChild(f)}return r},d=function(t,e){if(t.icon){var n=document.createElement("i");switch(n.setAttribute("aria-hidden","true"),t.iconPack){case"fontawesome":n.classList.add("fa");var r=t.icon.name?t.icon.name:t.icon;r.includes("fa-")?n.classList.add(r.trim()):n.classList.add("fa-"+r.trim());break;case"mdi":n.classList.add("mdi");var i=t.icon.name?t.icon.name:t.icon;i.includes("mdi-")?n.classList.add(i.trim()):n.classList.add("mdi-"+i.trim());break;case"custom-class":var o=t.icon.name?t.icon.name:t.icon;"string"==typeof o?o.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(o)&&o.forEach(function(t){n.classList.add(t.trim())});break;case"callback":var a=t.icon&&t.icon instanceof Function?t.icon:null;a&&(n=a(n));break;default:n.classList.add("material-icons"),n.textContent=t.icon.name?t.icon.name:t.icon}t.icon.after&&n.classList.add("after"),h(t,n,e)}},h=function(t,e,n){t.icon&&(t.icon.after&&t.icon.name?n.appendChild(e):(t.icon.name,n.insertBefore(e,n.firstChild)))},m=function(t,e){if(!t)return null;var n=document.createElement("a");if(n.classList.add("action"),n.classList.add("ripple"),t.text&&(n.text=t.text),t.href&&(n.href=t.href),t.target&&(n.target=t.target),t.icon){n.classList.add("icon");var r=document.createElement("i");switch(u.iconPack){case"fontawesome":r.classList.add("fa"),t.icon.includes("fa-")?r.classList.add(t.icon.trim()):r.classList.add("fa-"+t.icon.trim());break;case"mdi":r.classList.add("mdi"),t.icon.includes("mdi-")?r.classList.add(t.icon.trim()):r.classList.add("mdi-"+t.icon.trim());break;case"custom-class":"string"==typeof t.icon?t.icon.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(t.icon)&&t.icon.forEach(function(t){n.classList.add(t.trim())});break;default:r.classList.add("material-icons"),r.textContent=t.icon}n.appendChild(r)}return t.class&&("string"==typeof t.class?t.class.split(" ").forEach(function(t){n.classList.add(t)}):Array.isArray(t.class)&&t.class.forEach(function(t){n.classList.add(t.trim())})),t.push&&n.addEventListener("click",function(n){if(n.preventDefault(),!u.router)return void console.warn("[vue-toasted] : Vue Router instance is not attached. please check the docs");u.router.push(t.push),t.push.dontClose||e.goAway(0)}),t.onClick&&"function"==typeof t.onClick&&n.addEventListener("click",function(n){t.onClick&&(n.preventDefault(),t.onClick(n,e))}),n};e.a=function(t,e,r){l=t,r=f(r);var i=l.container;r.containerClass.unshift("toasted-container"),i.className!==r.containerClass.join(" ")&&(i.className="",r.containerClass.forEach(function(t){i.classList.add(t)}));var s=p(e,r);e&&i.appendChild(s),s.style.opacity=0,o.a.animateIn(s);var c=r.duration,u=void 0;if(null!==c){var d=function(){return setInterval(function(){null===s.parentNode&&window.clearInterval(u),s.classList.contains("panning")||(c-=20),c<=0&&(o.a.animateOut(s,function(){"function"==typeof r.onComplete&&r.onComplete(),s.parentNode&&l.remove(s)}),window.clearInterval(u))},20)};u=d(),r.keepOnHover&&(s.addEventListener("mouseover",function(){window.clearInterval(u)}),s.addEventListener("mouseout",function(){u=d()}))}return n.i(a.a)(s,l)}},function(t,e,n){e=t.exports=n(10)(),e.push([t.i,".toasted{padding:0 20px}.toasted.rounded{border-radius:24px}.toasted .primary,.toasted.toasted-primary{border-radius:2px;min-height:38px;line-height:1.1em;background-color:#353535;padding:6px 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted .primary.success,.toasted.toasted-primary.success{background:#4caf50}.toasted .primary.error,.toasted.toasted-primary.error{background:#f44336}.toasted .primary.info,.toasted.toasted-primary.info{background:#3f51b5}.toasted .primary .action,.toasted.toasted-primary .action{color:#a1c2fa}.toasted.bubble{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#ff7043;padding:0 20px;font-size:15px;font-weight:300;color:#fff;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24)}.toasted.bubble.success{background:#4caf50}.toasted.bubble.error{background:#f44336}.toasted.bubble.info{background:#3f51b5}.toasted.bubble .action{color:#8e2b0c}.toasted.outline{border-radius:30px;min-height:38px;line-height:1.1em;background-color:#fff;border:1px solid #676767;padding:0 20px;font-size:15px;color:#676767;box-shadow:0 1px 3px rgba(0,0,0,.12),0 1px 2px rgba(0,0,0,.24);font-weight:700}.toasted.outline.success{color:#4caf50;border-color:#4caf50}.toasted.outline.error{color:#f44336;border-color:#f44336}.toasted.outline.info{color:#3f51b5;border-color:#3f51b5}.toasted.outline .action{color:#607d8b}.toasted-container{position:fixed;z-index:10000}.toasted-container,.toasted-container.full-width{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.toasted-container.full-width{max-width:86%;width:100%}.toasted-container.full-width.fit-to-screen{min-width:100%}.toasted-container.full-width.fit-to-screen .toasted:first-child{margin-top:0}.toasted-container.full-width.fit-to-screen.top-right{top:0;right:0}.toasted-container.full-width.fit-to-screen.top-left{top:0;left:0}.toasted-container.full-width.fit-to-screen.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.full-width.fit-to-screen.bottom-right{right:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-left{left:0;bottom:0}.toasted-container.full-width.fit-to-screen.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.top-right{top:10%;right:7%}.toasted-container.top-left{top:10%;left:7%}.toasted-container.top-center{top:10%;left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%)}.toasted-container.bottom-right{right:5%;bottom:7%}.toasted-container.bottom-left{left:5%;bottom:7%}.toasted-container.bottom-center{left:50%;-webkit-transform:translateX(-50%);transform:translateX(-50%);bottom:7%}.toasted-container.bottom-left .toasted,.toasted-container.top-left .toasted{float:left}.toasted-container.bottom-right .toasted,.toasted-container.top-right .toasted{float:right}.toasted-container .toasted{top:35px;width:auto;clear:both;margin-top:10px;position:relative;max-width:100%;height:auto;word-break:normal;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;box-sizing:inherit}.toasted-container .toasted .fa,.toasted-container .toasted .fab,.toasted-container .toasted .far,.toasted-container .toasted .fas,.toasted-container .toasted .material-icons,.toasted-container .toasted .mdi{margin-right:.5rem;margin-left:-.4rem}.toasted-container .toasted .fa.after,.toasted-container .toasted .fab.after,.toasted-container .toasted .far.after,.toasted-container .toasted .fas.after,.toasted-container .toasted .material-icons.after,.toasted-container .toasted .mdi.after{margin-left:.5rem;margin-right:-.4rem}.toasted-container .toasted .action{text-decoration:none;font-size:.8rem;padding:8px;margin:5px -7px 5px 7px;border-radius:3px;text-transform:uppercase;letter-spacing:.03em;font-weight:600;cursor:pointer}.toasted-container .toasted .action.icon{padding:4px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.toasted-container .toasted .action.icon .fa,.toasted-container .toasted .action.icon .material-icons,.toasted-container .toasted .action.icon .mdi{margin-right:0;margin-left:4px}.toasted-container .toasted .action.icon:hover{text-decoration:none}.toasted-container .toasted .action:hover{text-decoration:underline}@media only screen and (max-width:600px){.toasted-container{min-width:100%}.toasted-container .toasted:first-child{margin-top:0}.toasted-container.top-right{top:0;right:0}.toasted-container.top-left{top:0;left:0}.toasted-container.top-center{top:0;left:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.bottom-right{right:0;bottom:0}.toasted-container.bottom-left{left:0;bottom:0}.toasted-container.bottom-center{left:0;bottom:0;-webkit-transform:translateX(0);transform:translateX(0)}.toasted-container.bottom-center,.toasted-container.top-center{-ms-flex-align:stretch!important;align-items:stretch!important}.toasted-container.bottom-left .toasted,.toasted-container.bottom-right .toasted,.toasted-container.top-left .toasted,.toasted-container.top-right .toasted{float:none}.toasted-container .toasted{border-radius:0}}",""])},function(t,e){t.exports=function(){var t=[];return t.toString=function(){for(var t=[],e=0;e<this.length;e++){var n=this[e];n[2]?t.push("@media "+n[2]+"{"+n[1]+"}"):t.push(n[1])}return t.join("")},t.i=function(e,n){"string"==typeof e&&(e=[[null,e,""]]);for(var r={},i=0;i<this.length;i++){var o=this[i][0];"number"==typeof o&&(r[o]=!0)}for(i=0;i<e.length;i++){var a=e[i];"number"==typeof a[0]&&r[a[0]]||(n&&!a[2]?a[2]=n:n&&(a[2]="("+a[2]+") and ("+n+")"),t.push(a))}},t}},function(t,e,n){"use strict";function r(t,e){if(void 0===t||null===t)throw new TypeError("Cannot convert first argument to object");for(var n=Object(t),r=1;r<arguments.length;r++){var i=arguments[r];if(void 0!==i&&null!==i)for(var o=Object.keys(Object(i)),a=0,s=o.length;a<s;a++){var c=o[a],u=Object.getOwnPropertyDescriptor(i,c);void 0!==u&&u.enumerable&&(n[c]=i[c])}}return n}function i(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:r})}t.exports={assign:r,polyfill:i}},function(t,e,n){var r;!function(i,o,a,s){"use strict";function c(t,e,n){return setTimeout(d(t,n),e)}function u(t,e,n){return!!Array.isArray(t)&&(l(t,n[e],n),!0)}function l(t,e,n){var r;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==s)for(r=0;r<t.length;)e.call(n,t[r],r,t),r++;else for(r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r,t)}function f(t,e,n){var r="DEPRECATED METHOD: "+e+"\n"+n+" AT \n";return function(){var e=new Error("get-stack-trace"),n=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=i.console&&(i.console.warn||i.console.log);return o&&o.call(i.console,r,n),t.apply(this,arguments)}}function p(t,e,n){var r,i=e.prototype;r=t.prototype=Object.create(i),r.constructor=t,r._super=i,n&&ht(r,n)}function d(t,e){return function(){return t.apply(e,arguments)}}function h(t,e){return typeof t==gt?t.apply(e?e[0]||s:s,e):t}function m(t,e){return t===s?e:t}function v(t,e,n){l(x(e),function(e){t.addEventListener(e,n,!1)})}function g(t,e,n){l(x(e),function(e){t.removeEventListener(e,n,!1)})}function y(t,e){for(;t;){if(t==e)return!0;t=t.parentNode}return!1}function b(t,e){return t.indexOf(e)>-1}function x(t){return t.trim().split(/\s+/g)}function T(t,e,n){if(t.indexOf&&!n)return t.indexOf(e);for(var r=0;r<t.length;){if(n&&t[r][n]==e||!n&&t[r]===e)return r;r++}return-1}function w(t){return Array.prototype.slice.call(t,0)}function E(t,e,n){for(var r=[],i=[],o=0;o<t.length;){var a=e?t[o][e]:t[o];T(i,a)<0&&r.push(t[o]),i[o]=a,o++}return n&&(r=e?r.sort(function(t,n){return t[e]>n[e]}):r.sort()),r}function C(t,e){for(var n,r,i=e[0].toUpperCase()+e.slice(1),o=0;o<mt.length;){if(n=mt[o],(r=n?n+i:e)in t)return r;o++}return s}function S(){return Et++}function O(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||i}function A(t,e){var n=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){h(t.options.enable,[t])&&n.handler(e)},this.init()}function I(t){var e=t.options.inputClass;return new(e||(Ot?H:At?W:St?B:Y))(t,M)}function M(t,e,n){var r=n.pointers.length,i=n.changedPointers.length,o=e&Mt&&r-i==0,a=e&(Pt|Lt)&&r-i==0;n.isFirst=!!o,n.isFinal=!!a,o&&(t.session={}),n.eventType=e,k(t,n),t.emit("hammer.input",n),t.recognize(n),t.session.prevInput=n}function k(t,e){var n=t.session,r=e.pointers,i=r.length;n.firstInput||(n.firstInput=j(e)),i>1&&!n.firstMultiple?n.firstMultiple=j(e):1===i&&(n.firstMultiple=!1);var o=n.firstInput,a=n.firstMultiple,s=a?a.center:o.center,c=e.center=N(r);e.timeStamp=xt(),e.deltaTime=e.timeStamp-o.timeStamp,e.angle=R(s,c),e.distance=D(s,c),P(n,e),e.offsetDirection=X(e.deltaX,e.deltaY);var u=_(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=bt(u.x)>bt(u.y)?u.x:u.y,e.scale=a?z(a.pointers,r):1,e.rotation=a?F(a.pointers,r):0,e.maxPointers=n.prevInput?e.pointers.length>n.prevInput.maxPointers?e.pointers.length:n.prevInput.maxPointers:e.pointers.length,L(n,e);var l=t.element;y(e.srcEvent.target,l)&&(l=e.srcEvent.target),e.target=l}function P(t,e){var n=e.center,r=t.offsetDelta||{},i=t.prevDelta||{},o=t.prevInput||{};e.eventType!==Mt&&o.eventType!==Pt||(i=t.prevDelta={x:o.deltaX||0,y:o.deltaY||0},r=t.offsetDelta={x:n.x,y:n.y}),e.deltaX=i.x+(n.x-r.x),e.deltaY=i.y+(n.y-r.y)}function L(t,e){var n,r,i,o,a=t.lastInterval||e,c=e.timeStamp-a.timeStamp;if(e.eventType!=Lt&&(c>It||a.velocity===s)){var u=e.deltaX-a.deltaX,l=e.deltaY-a.deltaY,f=_(c,u,l);r=f.x,i=f.y,n=bt(f.x)>bt(f.y)?f.x:f.y,o=X(u,l),t.lastInterval=e}else n=a.velocity,r=a.velocityX,i=a.velocityY,o=a.direction;e.velocity=n,e.velocityX=r,e.velocityY=i,e.direction=o}function j(t){for(var e=[],n=0;n<t.pointers.length;)e[n]={clientX:yt(t.pointers[n].clientX),clientY:yt(t.pointers[n].clientY)},n++;return{timeStamp:xt(),pointers:e,center:N(e),deltaX:t.deltaX,deltaY:t.deltaY}}function N(t){var e=t.length;if(1===e)return{x:yt(t[0].clientX),y:yt(t[0].clientY)};for(var n=0,r=0,i=0;i<e;)n+=t[i].clientX,r+=t[i].clientY,i++;return{x:yt(n/e),y:yt(r/e)}}function _(t,e,n){return{x:e/t||0,y:n/t||0}}function X(t,e){return t===e?jt:bt(t)>=bt(e)?t<0?Nt:_t:e<0?Xt:Dt}function D(t,e,n){n||(n=Yt);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return Math.sqrt(r*r+i*i)}function R(t,e,n){n||(n=Yt);var r=e[n[0]]-t[n[0]],i=e[n[1]]-t[n[1]];return 180*Math.atan2(i,r)/Math.PI}function F(t,e){return R(e[1],e[0],Ht)+R(t[1],t[0],Ht)}function z(t,e){return D(e[0],e[1],Ht)/D(t[0],t[1],Ht)}function Y(){this.evEl=Vt,this.evWin=Wt,this.pressed=!1,A.apply(this,arguments)}function H(){this.evEl=$t,this.evWin=Gt,A.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}function q(){this.evTarget=Qt,this.evWin=Jt,this.started=!1,A.apply(this,arguments)}function V(t,e){var n=w(t.touches),r=w(t.changedTouches);return e&(Pt|Lt)&&(n=E(n.concat(r),"identifier",!0)),[n,r]}function W(){this.evTarget=te,this.targetIds={},A.apply(this,arguments)}function U(t,e){var n=w(t.touches),r=this.targetIds;if(e&(Mt|kt)&&1===n.length)return r[n[0].identifier]=!0,[n,n];var i,o,a=w(t.changedTouches),s=[],c=this.target;if(o=n.filter(function(t){return y(t.target,c)}),e===Mt)for(i=0;i<o.length;)r[o[i].identifier]=!0,i++;for(i=0;i<a.length;)r[a[i].identifier]&&s.push(a[i]),e&(Pt|Lt)&&delete r[a[i].identifier],i++;return s.length?[E(o.concat(s),"identifier",!0),s]:void 0}function B(){A.apply(this,arguments);var t=d(this.handler,this);this.touch=new W(this.manager,t),this.mouse=new Y(this.manager,t),this.primaryTouch=null,this.lastTouches=[]}function $(t,e){t&Mt?(this.primaryTouch=e.changedPointers[0].identifier,G.call(this,e)):t&(Pt|Lt)&&G.call(this,e)}function G(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var n={x:e.clientX,y:e.clientY};this.lastTouches.push(n);var r=this.lastTouches,i=function(){var t=r.indexOf(n);t>-1&&r.splice(t,1)};setTimeout(i,ee)}}function Z(t){for(var e=t.srcEvent.clientX,n=t.srcEvent.clientY,r=0;r<this.lastTouches.length;r++){var i=this.lastTouches[r],o=Math.abs(e-i.x),a=Math.abs(n-i.y);if(o<=ne&&a<=ne)return!0}return!1}function Q(t,e){this.manager=t,this.set(e)}function J(t){if(b(t,se))return se;var e=b(t,ce),n=b(t,ue);return e&&n?se:e||n?e?ce:ue:b(t,ae)?ae:oe}function K(t){this.options=ht({},this.defaults,t||{}),this.id=S(),this.manager=null,this.options.enable=m(this.options.enable,!0),this.state=fe,this.simultaneous={},this.requireFail=[]}function tt(t){return t&ve?"cancel":t&he?"end":t&de?"move":t&pe?"start":""}function et(t){return t==Dt?"down":t==Xt?"up":t==Nt?"left":t==_t?"right":""}function nt(t,e){var n=e.manager;return n?n.get(t):t}function rt(){K.apply(this,arguments)}function it(){rt.apply(this,arguments),this.pX=null,this.pY=null}function ot(){rt.apply(this,arguments)}function at(){K.apply(this,arguments),this._timer=null,this._input=null}function st(){rt.apply(this,arguments)}function ct(){rt.apply(this,arguments)}function ut(){K.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}function lt(t,e){return e=e||{},e.recognizers=m(e.recognizers,lt.defaults.preset),new ft(t,e)}function ft(t,e){this.options=ht({},lt.defaults,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=I(this),this.touchAction=new Q(this,this.options.touchAction),pt(this,!0),l(this.options.recognizers,function(t){var e=this.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])},this)}function pt(t,e){var n=t.element;if(n.style){var r;l(t.options.cssProps,function(i,o){r=C(n.style,o),e?(t.oldCssProps[r]=n.style[r],n.style[r]=i):n.style[r]=t.oldCssProps[r]||""}),e||(t.oldCssProps={})}}function dt(t,e){var n=o.createEvent("Event");n.initEvent(t,!0,!0),n.gesture=e,e.target.dispatchEvent(n)}var ht,mt=["","webkit","Moz","MS","ms","o"],vt=o.createElement("div"),gt="function",yt=Math.round,bt=Math.abs,xt=Date.now;ht="function"!=typeof Object.assign?function(t){if(t===s||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var r=arguments[n];if(r!==s&&null!==r)for(var i in r)r.hasOwnProperty(i)&&(e[i]=r[i])}return e}:Object.assign;var Tt=f(function(t,e,n){for(var r=Object.keys(e),i=0;i<r.length;)(!n||n&&t[r[i]]===s)&&(t[r[i]]=e[r[i]]),i++;return t},"extend","Use `assign`."),wt=f(function(t,e){return Tt(t,e,!0)},"merge","Use `assign`."),Et=1,Ct=/mobile|tablet|ip(ad|hone|od)|android/i,St="ontouchstart"in i,Ot=C(i,"PointerEvent")!==s,At=St&&Ct.test(navigator.userAgent),It=25,Mt=1,kt=2,Pt=4,Lt=8,jt=1,Nt=2,_t=4,Xt=8,Dt=16,Rt=Nt|_t,Ft=Xt|Dt,zt=Rt|Ft,Yt=["x","y"],Ht=["clientX","clientY"];A.prototype={handler:function(){},init:function(){this.evEl&&v(this.element,this.evEl,this.domHandler),this.evTarget&&v(this.target,this.evTarget,this.domHandler),this.evWin&&v(O(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&g(this.element,this.evEl,this.domHandler),this.evTarget&&g(this.target,this.evTarget,this.domHandler),this.evWin&&g(O(this.element),this.evWin,this.domHandler)}};var qt={mousedown:Mt,mousemove:kt,mouseup:Pt},Vt="mousedown",Wt="mousemove mouseup";p(Y,A,{handler:function(t){var e=qt[t.type];e&Mt&&0===t.button&&(this.pressed=!0),e&kt&&1!==t.which&&(e=Pt),this.pressed&&(e&Pt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:"mouse",srcEvent:t}))}});var Ut={pointerdown:Mt,pointermove:kt,pointerup:Pt,pointercancel:Lt,pointerout:Lt},Bt={2:"touch",3:"pen",4:"mouse",5:"kinect"},$t="pointerdown",Gt="pointermove pointerup pointercancel";i.MSPointerEvent&&!i.PointerEvent&&($t="MSPointerDown",Gt="MSPointerMove MSPointerUp MSPointerCancel"),p(H,A,{handler:function(t){var e=this.store,n=!1,r=t.type.toLowerCase().replace("ms",""),i=Ut[r],o=Bt[t.pointerType]||t.pointerType,a="touch"==o,s=T(e,t.pointerId,"pointerId");i&Mt&&(0===t.button||a)?s<0&&(e.push(t),s=e.length-1):i&(Pt|Lt)&&(n=!0),s<0||(e[s]=t,this.callback(this.manager,i,{pointers:e,changedPointers:[t],pointerType:o,srcEvent:t}),n&&e.splice(s,1))}});var Zt={touchstart:Mt,touchmove:kt,touchend:Pt,touchcancel:Lt},Qt="touchstart",Jt="touchstart touchmove touchend touchcancel";p(q,A,{handler:function(t){var e=Zt[t.type];if(e===Mt&&(this.started=!0),this.started){var n=V.call(this,t,e);e&(Pt|Lt)&&n[0].length-n[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}}});var Kt={touchstart:Mt,touchmove:kt,touchend:Pt,touchcancel:Lt},te="touchstart touchmove touchend touchcancel";p(W,A,{handler:function(t){var e=Kt[t.type],n=U.call(this,t,e);n&&this.callback(this.manager,e,{pointers:n[0],changedPointers:n[1],pointerType:"touch",srcEvent:t})}});var ee=2500,ne=25;p(B,A,{handler:function(t,e,n){var r="touch"==n.pointerType,i="mouse"==n.pointerType;if(!(i&&n.sourceCapabilities&&n.sourceCapabilities.firesTouchEvents)){if(r)$.call(this,e,n);else if(i&&Z.call(this,n))return;this.callback(t,e,n)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});var re=C(vt.style,"touchAction"),ie=re!==s,oe="auto",ae="manipulation",se="none",ce="pan-x",ue="pan-y",le=function(){if(!ie)return!1;var t={},e=i.CSS&&i.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(n){t[n]=!e||i.CSS.supports("touch-action",n)}),t}();Q.prototype={set:function(t){"compute"==t&&(t=this.compute()),ie&&this.manager.element.style&&le[t]&&(this.manager.element.style[re]=t),this.actions=t.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var t=[];return l(this.manager.recognizers,function(e){h(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))}),J(t.join(" "))},preventDefaults:function(t){var e=t.srcEvent,n=t.offsetDirection;if(this.manager.session.prevented)return void e.preventDefault();var r=this.actions,i=b(r,se)&&!le[se],o=b(r,ue)&&!le[ue],a=b(r,ce)&&!le[ce];if(i){var s=1===t.pointers.length,c=t.distance<2,u=t.deltaTime<250;if(s&&c&&u)return}return a&&o?void 0:i||o&&n&Rt||a&&n&Ft?this.preventSrc(e):void 0},preventSrc:function(t){this.manager.session.prevented=!0,t.preventDefault()}};var fe=1,pe=2,de=4,he=8,me=he,ve=16;K.prototype={defaults:{},set:function(t){return ht(this.options,t),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(t){if(u(t,"recognizeWith",this))return this;var e=this.simultaneous;return t=nt(t,this),e[t.id]||(e[t.id]=t,t.recognizeWith(this)),this},dropRecognizeWith:function(t){return u(t,"dropRecognizeWith",this)?this:(t=nt(t,this),delete this.simultaneous[t.id],this)},requireFailure:function(t){if(u(t,"requireFailure",this))return this;var e=this.requireFail;return t=nt(t,this),-1===T(e,t)&&(e.push(t),t.requireFailure(this)),this},dropRequireFailure:function(t){if(u(t,"dropRequireFailure",this))return this;t=nt(t,this);var e=T(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(t){return!!this.simultaneous[t.id]},emit:function(t){function e(e){n.manager.emit(e,t)}var n=this,r=this.state;r<he&&e(n.options.event+tt(r)),e(n.options.event),t.additionalEvent&&e(t.additionalEvent),r>=he&&e(n.options.event+tt(r))},tryEmit:function(t){if(this.canEmit())return this.emit(t);this.state=32},canEmit:function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(32|fe)))return!1;t++}return!0},recognize:function(t){var e=ht({},t);if(!h(this.options.enable,[this,e]))return this.reset(),void(this.state=32);this.state&(me|ve|32)&&(this.state=fe),this.state=this.process(e),this.state&(pe|de|he|ve)&&this.tryEmit(e)},process:function(t){},getTouchAction:function(){},reset:function(){}},p(rt,K,{defaults:{pointers:1},attrTest:function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},process:function(t){var e=this.state,n=t.eventType,r=e&(pe|de),i=this.attrTest(t);return r&&(n&Lt||!i)?e|ve:r||i?n&Pt?e|he:e&pe?e|de:pe:32}}),p(it,rt,{defaults:{event:"pan",threshold:10,pointers:1,direction:zt},getTouchAction:function(){var t=this.options.direction,e=[];return t&Rt&&e.push(ue),t&Ft&&e.push(ce),e},directionTest:function(t){var e=this.options,n=!0,r=t.distance,i=t.direction,o=t.deltaX,a=t.deltaY;return i&e.direction||(e.direction&Rt?(i=0===o?jt:o<0?Nt:_t,n=o!=this.pX,r=Math.abs(t.deltaX)):(i=0===a?jt:a<0?Xt:Dt,n=a!=this.pY,r=Math.abs(t.deltaY))),t.direction=i,n&&r>e.threshold&&i&e.direction},attrTest:function(t){return rt.prototype.attrTest.call(this,t)&&(this.state&pe||!(this.state&pe)&&this.directionTest(t))},emit:function(t){this.pX=t.deltaX,this.pY=t.deltaY;var e=et(t.direction);e&&(t.additionalEvent=this.options.event+e),this._super.emit.call(this,t)}}),p(ot,rt,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.scale-1)>this.options.threshold||this.state&pe)},emit:function(t){if(1!==t.scale){var e=t.scale<1?"in":"out";t.additionalEvent=this.options.event+e}this._super.emit.call(this,t)}}),p(at,K,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[oe]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime>e.time;if(this._input=t,!r||!n||t.eventType&(Pt|Lt)&&!i)this.reset();else if(t.eventType&Mt)this.reset(),this._timer=c(function(){this.state=me,this.tryEmit()},e.time,this);else if(t.eventType&Pt)return me;return 32},reset:function(){clearTimeout(this._timer)},emit:function(t){this.state===me&&(t&&t.eventType&Pt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=xt(),this.manager.emit(this.options.event,this._input)))}}),p(st,rt,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[se]},attrTest:function(t){return this._super.attrTest.call(this,t)&&(Math.abs(t.rotation)>this.options.threshold||this.state&pe)}}),p(ct,rt,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:Rt|Ft,pointers:1},getTouchAction:function(){return it.prototype.getTouchAction.call(this)},attrTest:function(t){var e,n=this.options.direction;return n&(Rt|Ft)?e=t.overallVelocity:n&Rt?e=t.overallVelocityX:n&Ft&&(e=t.overallVelocityY),this._super.attrTest.call(this,t)&&n&t.offsetDirection&&t.distance>this.options.threshold&&t.maxPointers==this.options.pointers&&bt(e)>this.options.velocity&&t.eventType&Pt},emit:function(t){var e=et(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)}}),p(ut,K,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ae]},process:function(t){var e=this.options,n=t.pointers.length===e.pointers,r=t.distance<e.threshold,i=t.deltaTime<e.time;if(this.reset(),t.eventType&Mt&&0===this.count)return this.failTimeout();if(r&&i&&n){if(t.eventType!=Pt)return this.failTimeout();var o=!this.pTime||t.timeStamp-this.pTime<e.interval,a=!this.pCenter||D(this.pCenter,t.center)<e.posThreshold;this.pTime=t.timeStamp,this.pCenter=t.center,a&&o?this.count+=1:this.count=1,this._input=t;if(0===this.count%e.taps)return this.hasRequireFailures()?(this._timer=c(function(){this.state=me,this.tryEmit()},e.interval,this),pe):me}return 32},failTimeout:function(){return this._timer=c(function(){this.state=32},this.options.interval,this),32},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==me&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}}),lt.VERSION="2.0.7",lt.defaults={domEvents:!1,touchAction:"compute",enable:!0,inputTarget:null,inputClass:null,preset:[[st,{enable:!1}],[ot,{enable:!1},["rotate"]],[ct,{direction:Rt}],[it,{direction:Rt},["swipe"]],[ut],[ut,{event:"doubletap",taps:2},["tap"]],[at]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};ft.prototype={set:function(t){return ht(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},stop:function(t){this.session.stopped=t?2:1},recognize:function(t){var e=this.session;if(!e.stopped){this.touchAction.preventDefaults(t);var n,r=this.recognizers,i=e.curRecognizer;(!i||i&&i.state&me)&&(i=e.curRecognizer=null);for(var o=0;o<r.length;)n=r[o],2===e.stopped||i&&n!=i&&!n.canRecognizeWith(i)?n.reset():n.recognize(t),!i&&n.state&(pe|de|he)&&(i=e.curRecognizer=n),o++}},get:function(t){if(t instanceof K)return t;for(var e=this.recognizers,n=0;n<e.length;n++)if(e[n].options.event==t)return e[n];return null},add:function(t){if(u(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},remove:function(t){if(u(t,"remove",this))return this;if(t=this.get(t)){var e=this.recognizers,n=T(e,t);-1!==n&&(e.splice(n,1),this.touchAction.update())}return this},on:function(t,e){if(t!==s&&e!==s){var n=this.handlers;return l(x(t),function(t){n[t]=n[t]||[],n[t].push(e)}),this}},off:function(t,e){if(t!==s){var n=this.handlers;return l(x(t),function(t){e?n[t]&&n[t].splice(T(n[t],e),1):delete n[t]}),this}},emit:function(t,e){this.options.domEvents&&dt(t,e);var n=this.handlers[t]&&this.handlers[t].slice();if(n&&n.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var r=0;r<n.length;)n[r](e),r++}},destroy:function(){this.element&&pt(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}},ht(lt,{INPUT_START:Mt,INPUT_MOVE:kt,INPUT_END:Pt,INPUT_CANCEL:Lt,STATE_POSSIBLE:fe,STATE_BEGAN:pe,STATE_CHANGED:de,STATE_ENDED:he,STATE_RECOGNIZED:me,STATE_CANCELLED:ve,STATE_FAILED:32,DIRECTION_NONE:jt,DIRECTION_LEFT:Nt,DIRECTION_RIGHT:_t,DIRECTION_UP:Xt,DIRECTION_DOWN:Dt,DIRECTION_HORIZONTAL:Rt,DIRECTION_VERTICAL:Ft,DIRECTION_ALL:zt,Manager:ft,Input:A,TouchAction:Q,TouchInput:W,MouseInput:Y,PointerEventInput:H,TouchMouseInput:B,SingleTouchInput:q,Recognizer:K,AttrRecognizer:rt,Tap:ut,Pan:it,Swipe:ct,Pinch:ot,Rotate:st,Press:at,on:v,off:g,each:l,merge:wt,extend:Tt,assign:ht,inherit:p,bindFn:d,prefixed:C}),(void 0!==i?i:"undefined"!=typeof self?self:{}).Hammer=lt,(r=function(){return lt}.call(e,n,e,t))!==s&&(t.exports=r)}(window,document)},function(t,e){t.exports=function(t,e,n){for(var r=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*r*n/e.length),o="";;)for(var a=t(i),s=i;s--;)if(o+=e[a[s]&r]||"",o.length===+n)return o}},function(t,e,n){"use strict";function r(t){var e="",n=Math.floor(.001*(Date.now()-s));return n===o?i++:(i=0,o=n),e+=a(c),e+=a(t),i>0&&(e+=a(i)),e+=a(n)}var i,o,a=n(15),s=(n(0),1567752802062),c=7;t.exports=r},function(t,e,n){"use strict";function r(t){for(var e,n=0,r="";!e;)r+=a(o,i.get(),1),e=t<Math.pow(16,n+1),n++;return r}var i=n(0),o=n(18),a=n(13);t.exports=r},function(t,e,n){"use strict";function r(e){return s.seed(e),t.exports}function i(e){return l=e,t.exports}function o(t){return void 0!==t&&s.characters(t),s.shuffled()}function a(){return c(l)}var s=n(0),c=n(14),u=n(17),l=n(20)||0;t.exports=a,t.exports.generate=a,t.exports.seed=r,t.exports.worker=i,t.exports.characters=o,t.exports.isValid=u},function(t,e,n){"use strict";function r(t){return!(!t||"string"!=typeof t||t.length<6)&&!new RegExp("[^"+i.get().replace(/[|\\{}()[\]^$+*?.-]/g,"\\$&")+"]").test(t)}var i=n(0);t.exports=r},function(t,e,n){"use strict";var r,i="object"==typeof window&&(window.crypto||window.msCrypto);r=i&&i.getRandomValues?function(t){return i.getRandomValues(new Uint8Array(t))}:function(t){for(var e=[],n=0;n<t;n++)e.push(Math.floor(256*Math.random()));return e},t.exports=r},function(t,e,n){"use strict";function r(){return(o=(9301*o+49297)%233280)/233280}function i(t){o=t}var o=1;t.exports={nextValue:r,seed:i}},function(t,e,n){"use strict";t.exports=0},function(t,e){t.exports=function(t,e,n,r){var i,o=t=t||{},a=typeof t.default;"object"!==a&&"function"!==a||(i=t,o=t.default);var s="function"==typeof o?o.options:o;if(e&&(s.render=e.render,s.staticRenderFns=e.staticRenderFns),n&&(s._scopeId=n),r){var c=Object.create(s.computed||null);Object.keys(r).forEach(function(t){var e=r[t];c[t]=function(){return e}}),s.computed=c}return{esModule:i,exports:o,options:s}}},function(t,e,n){var r=n(9);"string"==typeof r&&(r=[[t.i,r,""]]),r.locals&&(t.exports=r.locals);n(23)("df0682cc",r,!0,{})},function(t,e,n){function r(t){for(var e=0;e<t.length;e++){var n=t[e],r=l[n.id];if(r){r.refs++;for(var i=0;i<r.parts.length;i++)r.parts[i](n.parts[i]);for(;i<n.parts.length;i++)r.parts.push(o(n.parts[i]));r.parts.length>n.parts.length&&(r.parts.length=n.parts.length)}else{for(var a=[],i=0;i<n.parts.length;i++)a.push(o(n.parts[i]));l[n.id]={id:n.id,refs:1,parts:a}}}}function i(){var t=document.createElement("style");return t.type="text/css",f.appendChild(t),t}function o(t){var e,n,r=document.querySelector("style["+g+'~="'+t.id+'"]');if(r){if(h)return m;r.parentNode.removeChild(r)}if(y){var o=d++;r=p||(p=i()),e=a.bind(null,r,o,!1),n=a.bind(null,r,o,!0)}else r=i(),e=s.bind(null,r),n=function(){r.parentNode.removeChild(r)};return e(t),function(r){if(r){if(r.css===t.css&&r.media===t.media&&r.sourceMap===t.sourceMap)return;e(t=r)}else n()}}function a(t,e,n,r){var i=n?"":r.css;if(t.styleSheet)t.styleSheet.cssText=b(e,i);else{var o=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(o,a[e]):t.appendChild(o)}}function s(t,e){var n=e.css,r=e.media,i=e.sourceMap;if(r&&t.setAttribute("media",r),v.ssrId&&t.setAttribute(g,e.id),i&&(n+="\n/*# sourceURL="+i.sources[0]+" */",n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(i))))+" */"),t.styleSheet)t.styleSheet.cssText=n;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(n))}}var c="undefined"!=typeof document;if("undefined"!=typeof DEBUG&&DEBUG&&!c)throw new Error("vue-style-loader cannot be used in a non-browser environment. Use { target: 'node' } in your Webpack config to indicate a server-rendering environment.");var u=n(24),l={},f=c&&(document.head||document.getElementsByTagName("head")[0]),p=null,d=0,h=!1,m=function(){},v=null,g="data-vue-ssr-id",y="undefined"!=typeof navigator&&/msie [6-9]\b/.test(navigator.userAgent.toLowerCase());t.exports=function(t,e,n,i){h=n,v=i||{};var o=u(t,e);return r(o),function(e){for(var n=[],i=0;i<o.length;i++){var a=o[i],s=l[a.id];s.refs--,n.push(s)}e?(o=u(t,e),r(o)):o=[];for(var i=0;i<n.length;i++){var s=n[i];if(0===s.refs){for(var c=0;c<s.parts.length;c++)s.parts[c]();delete l[s.id]}}}};var b=function(){var t=[];return function(e,n){return t[e]=n,t.filter(Boolean).join("\n")}}()},function(t,e){t.exports=function(t,e){for(var n=[],r={},i=0;i<e.length;i++){var o=e[i],a=o[0],s=o[1],c=o[2],u=o[3],l={id:t+":"+i,css:s,media:c,sourceMap:u};r[a]?r[a].parts.push(l):n.push(r[a]={id:a,parts:[l]})}return n}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n}])}); 65625 65626/***/ }), 65627
vendor: 3,453 bytes, lines 65628-65638
65628/***/ "./node_modules/vue-trumbowyg/dist/vue-trumbowyg.min.js": 65629/*!**************************************************************!*\ 65630 !*** ./node_modules/vue-trumbowyg/dist/vue-trumbowyg.min.js ***! 65631 \**************************************************************/ 65632/*! no static exports found */ 65633/***/ (function(module, exports, __webpack_require__) { 65634 65635!function(t,e){ true?module.exports=e(__webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"),__webpack_require__(/*! trumbowyg/dist/ui/icons.svg */ "./node_modules/trumbowyg/dist/ui/icons.svg"),__webpack_require__(/*! trumbowyg */ "./node_modules/trumbowyg/dist/trumbowyg.js")):undefined}("undefined"!=typeof self?self:this,(function(t,e,n){return function(t){var e={};function n(o){if(e[o])return e[o].exports;var r=e[o]={i:o,l:!1,exports:{}};return t[o].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(o,r,function(e){return t[e]}.bind(null,r));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=3)}([function(e,n){e.exports=t},function(t,n){t.exports=e},function(t,e){t.exports=n},function(t,e,n){"use strict";n.r(e),n.d(e,"trumbowygPlugin",(function(){return s})),n.d(e,"component",(function(){return l}));var o=n(0),r=n.n(o),u=(n(2),n(1)),i=["init","focus","blur","change","resize","paste","openfullscreen","closefullscreen","close","modalopen","modalclose"],l={name:"trumbowyg",render:function(t){return t("textarea")},props:{value:{default:null,required:!0,validator:function(t){return null===t||"string"==typeof t||t instanceof String}},config:{type:Object,default:function(){return{}}},svgPath:{type:[String,Boolean],default:n.n(u).a},disabled:{type:Boolean,default:!1}},data:function(){return{el:null}},mounted:function(){this.el||(this.el=r()(this.$el),this.el.trumbowyg(r.a.extend(!0,{},{svgPath:this.svgPath},this.config)),this.el.trumbowyg("html",this.value),this.el.on("".concat("tbw","change"),this.onChange),this.el.on("".concat("tbw","blur"),this.onBlur),this.toggleDisabled(this.disabled),this.registerEvents())},watch:{value:function(t){this.el&&t!==this.el.trumbowyg("html")&&this.el.trumbowyg("html",t)},disabled:function(t){this.toggleDisabled(t)}},methods:{onChange:function(t){this.$emit("input",t.target.value)},onBlur:function(t){this.$emit("blur",t.target.value)},registerEvents:function(){var t=this;i.forEach((function(e){t.el.on("".concat("tbw").concat(e),(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];t.$emit.apply(t,["".concat("tbw","-").concat(e)].concat(o))}))}))},toggleDisabled:function(t){var e=t?"disable":"enable";this.el.trumbowyg(e)}},beforeDestroy:function(){this.el&&(this.el.trumbowyg("destroy"),this.el=null)}},s=function(t,e){var n="trumbowyg";"string"==typeof e&&(n=e),t.component(n,l)};l.install=s;e.default=l}])})); 65636 65637/***/ }), 65638
vendor: 322,690 bytes, lines 65639-77659
65639/***/ "./node_modules/vue/dist/vue.common.dev.js": 65640/*!*************************************************!*\ 65641 !*** ./node_modules/vue/dist/vue.common.dev.js ***! 65642 \*************************************************/ 65643/*! no static exports found */ 65644/***/ (function(module, exports, __webpack_require__) { 65645 65646"use strict"; 65647/* WEBPACK VAR INJECTION */(function(global, setImmediate) {/*! 65648 * Vue.js v2.6.14 65649 * (c) 2014-2021 Evan You 65650 * Released under the MIT License. 65651 */ 65652 65653 65654/* */ 65655 65656var emptyObject = Object.freeze({}); 65657 65658// These helpers produce better VM code in JS engines due to their 65659// explicitness and function inlining. 65660function isUndef (v) { 65661 return v === undefined || v === null 65662} 65663 65664function isDef (v) { 65665 return v !== undefined && v !== null 65666} 65667 65668function isTrue (v) { 65669 return v === true 65670} 65671 65672function isFalse (v) { 65673 return v === false 65674} 65675 65676/** 65677 * Check if value is primitive. 65678 */ 65679function isPrimitive (value) { 65680 return ( 65681 typeof value === 'string' || 65682 typeof value === 'number' || 65683 // $flow-disable-line 65684 typeof value === 'symbol' || 65685 typeof value === 'boolean' 65686 ) 65687} 65688 65689/** 65690 * Quick object check - this is primarily used to tell 65691 * Objects from primitive values when we know the value 65692 * is a JSON-compliant type. 65693 */ 65694function isObject (obj) { 65695 return obj !== null && typeof obj === 'object' 65696} 65697 65698/** 65699 * Get the raw type string of a value, e.g., [object Object]. 65700 */ 65701var _toString = Object.prototype.toString; 65702 65703function toRawType (value) { 65704 return _toString.call(value).slice(8, -1) 65705} 65706 65707/** 65708 * Strict object type check. Only returns true 65709 * for plain JavaScript objects. 65710 */ 65711function isPlainObject (obj) { 65712 return _toString.call(obj) === '[object Object]' 65713} 65714 65715function isRegExp (v) { 65716 return _toString.call(v) === '[object RegExp]' 65717} 65718 65719/** 65720 * Check if val is a valid array index. 65721 */ 65722function isValidArrayIndex (val) { 65723 var n = parseFloat(String(val)); 65724 return n >= 0 && Math.floor(n) === n && isFinite(val) 65725} 65726 65727function isPromise (val) { 65728 return ( 65729 isDef(val) && 65730 typeof val.then === 'function' && 65731 typeof val.catch === 'function' 65732 ) 65733} 65734 65735/** 65736 * Convert a value to a string that is actually rendered. 65737 */ 65738function toString (val) { 65739 return val == null 65740 ? '' 65741 : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString) 65742 ? JSON.stringify(val, null, 2) 65743 : String(val) 65744} 65745 65746/** 65747 * Convert an input value to a number for persistence. 65748 * If the conversion fails, return original string. 65749 */ 65750function toNumber (val) { 65751 var n = parseFloat(val); 65752 return isNaN(n) ? val : n 65753} 65754 65755/** 65756 * Make a map and return a function for checking if a key 65757 * is in that map. 65758 */ 65759function makeMap ( 65760 str, 65761 expectsLowerCase 65762) { 65763 var map = Object.create(null); 65764 var list = str.split(','); 65765 for (var i = 0; i < list.length; i++) { 65766 map[list[i]] = true; 65767 } 65768 return expectsLowerCase 65769 ? function (val) { return map[val.toLowerCase()]; } 65770 : function (val) { return map[val]; } 65771} 65772 65773/** 65774 * Check if a tag is a built-in tag. 65775 */ 65776var isBuiltInTag = makeMap('slot,component', true); 65777 65778/** 65779 * Check if an attribute is a reserved attribute. 65780 */ 65781var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is'); 65782 65783/** 65784 * Remove an item from an array. 65785 */ 65786function remove (arr, item) { 65787 if (arr.length) { 65788 var index = arr.indexOf(item); 65789 if (index > -1) { 65790 return arr.splice(index, 1) 65791 } 65792 } 65793} 65794 65795/** 65796 * Check whether an object has the property. 65797 */ 65798var hasOwnProperty = Object.prototype.hasOwnProperty; 65799function hasOwn (obj, key) { 65800 return hasOwnProperty.call(obj, key) 65801} 65802 65803/** 65804 * Create a cached version of a pure function. 65805 */ 65806function cached (fn) { 65807 var cache = Object.create(null); 65808 return (function cachedFn (str) { 65809 var hit = cache[str]; 65810 return hit || (cache[str] = fn(str)) 65811 }) 65812} 65813 65814/** 65815 * Camelize a hyphen-delimited string. 65816 */ 65817var camelizeRE = /-(\w)/g; 65818var camelize = cached(function (str) { 65819 return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; }) 65820}); 65821 65822/** 65823 * Capitalize a string. 65824 */ 65825var capitalize = cached(function (str) { 65826 return str.charAt(0).toUpperCase() + str.slice(1) 65827}); 65828 65829/** 65830 * Hyphenate a camelCase string. 65831 */ 65832var hyphenateRE = /\B([A-Z])/g; 65833var hyphenate = cached(function (str) { 65834 return str.replace(hyphenateRE, '-$1').toLowerCase() 65835}); 65836 65837/** 65838 * Simple bind polyfill for environments that do not support it, 65839 * e.g., PhantomJS 1.x. Technically, we don't need this anymore 65840 * since native bind is now performant enough in most browsers. 65841 * But removing it would mean breaking code that was able to run in 65842 * PhantomJS 1.x, so this must be kept for backward compatibility. 65843 */ 65844 65845/* istanbul ignore next */ 65846function polyfillBind (fn, ctx) { 65847 function boundFn (a) { 65848 var l = arguments.length; 65849 return l 65850 ? l > 1 65851 ? fn.apply(ctx, arguments) 65852 : fn.call(ctx, a) 65853 : fn.call(ctx) 65854 } 65855 65856 boundFn._length = fn.length; 65857 return boundFn 65858} 65859 65860function nativeBind (fn, ctx) { 65861 return fn.bind(ctx) 65862} 65863 65864var bind = Function.prototype.bind 65865 ? nativeBind 65866 : polyfillBind; 65867 65868/** 65869 * Convert an Array-like object to a real Array. 65870 */ 65871function toArray (list, start) { 65872 start = start || 0; 65873 var i = list.length - start; 65874 var ret = new Array(i); 65875 while (i--) { 65876 ret[i] = list[i + start]; 65877 } 65878 return ret 65879} 65880 65881/** 65882 * Mix properties into target object. 65883 */ 65884function extend (to, _from) { 65885 for (var key in _from) { 65886 to[key] = _from[key]; 65887 } 65888 return to 65889} 65890 65891/** 65892 * Merge an Array of Objects into a single Object. 65893 */ 65894function toObject (arr) { 65895 var res = {}; 65896 for (var i = 0; i < arr.length; i++) { 65897 if (arr[i]) { 65898 extend(res, arr[i]); 65899 } 65900 } 65901 return res 65902} 65903 65904/* eslint-disable no-unused-vars */ 65905 65906/** 65907 * Perform no operation. 65908 * Stubbing args to make Flow happy without leaving useless transpiled code 65909 * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/). 65910 */ 65911function noop (a, b, c) {} 65912 65913/** 65914 * Always return false. 65915 */ 65916var no = function (a, b, c) { return false; }; 65917 65918/* eslint-enable no-unused-vars */ 65919 65920/** 65921 * Return the same value. 65922 */ 65923var identity = function (_) { return _; }; 65924 65925/** 65926 * Generate a string containing static keys from compiler modules. 65927 */ 65928function genStaticKeys (modules) { 65929 return modules.reduce(function (keys, m) { 65930 return keys.concat(m.staticKeys || []) 65931 }, []).join(',') 65932} 65933 65934/** 65935 * Check if two values are loosely equal - that is, 65936 * if they are plain objects, do they have the same shape? 65937 */ 65938function looseEqual (a, b) { 65939 if (a === b) { return true } 65940 var isObjectA = isObject(a); 65941 var isObjectB = isObject(b); 65942 if (isObjectA && isObjectB) { 65943 try { 65944 var isArrayA = Array.isArray(a); 65945 var isArrayB = Array.isArray(b); 65946 if (isArrayA && isArrayB) { 65947 return a.length === b.length && a.every(function (e, i) { 65948 return looseEqual(e, b[i]) 65949 }) 65950 } else if (a instanceof Date && b instanceof Date) { 65951 return a.getTime() === b.getTime() 65952 } else if (!isArrayA && !isArrayB) { 65953 var keysA = Object.keys(a); 65954 var keysB = Object.keys(b); 65955 return keysA.length === keysB.length && keysA.every(function (key) { 65956 return looseEqual(a[key], b[key]) 65957 }) 65958 } else { 65959 /* istanbul ignore next */ 65960 return false 65961 } 65962 } catch (e) { 65963 /* istanbul ignore next */ 65964 return false 65965 } 65966 } else if (!isObjectA && !isObjectB) { 65967 return String(a) === String(b) 65968 } else { 65969 return false 65970 } 65971} 65972 65973/** 65974 * Return the first index at which a loosely equal value can be 65975 * found in the array (if value is a plain object, the array must 65976 * contain an object of the same shape), or -1 if it is not present. 65977 */ 65978function looseIndexOf (arr, val) { 65979 for (var i = 0; i < arr.length; i++) { 65980 if (looseEqual(arr[i], val)) { return i } 65981 } 65982 return -1 65983} 65984 65985/** 65986 * Ensure a function is called only once. 65987 */ 65988function once (fn) { 65989 var called = false; 65990 return function () { 65991 if (!called) { 65992 called = true; 65993 fn.apply(this, arguments); 65994 } 65995 } 65996} 65997 65998var SSR_ATTR = 'data-server-rendered'; 65999 66000var ASSET_TYPES = [ 66001 'component', 66002 'directive', 66003 'filter' 66004]; 66005 66006var LIFECYCLE_HOOKS = [ 66007 'beforeCreate', 66008 'created', 66009 'beforeMount', 66010 'mounted', 66011 'beforeUpdate', 66012 'updated', 66013 'beforeDestroy', 66014 'destroyed', 66015 'activated', 66016 'deactivated', 66017 'errorCaptured', 66018 'serverPrefetch' 66019]; 66020 66021/* */ 66022 66023 66024 66025var config = ({ 66026 /** 66027 * Option merge strategies (used in core/util/options) 66028 */ 66029 // $flow-disable-line 66030 optionMergeStrategies: Object.create(null), 66031 66032 /** 66033 * Whether to suppress warnings. 66034 */ 66035 silent: false, 66036 66037 /** 66038 * Show production mode tip message on boot? 66039 */ 66040 productionTip: "development" !== 'production', 66041 66042 /** 66043 * Whether to enable devtools 66044 */ 66045 devtools: "development" !== 'production', 66046 66047 /** 66048 * Whether to record perf 66049 */ 66050 performance: false, 66051 66052 /** 66053 * Error handler for watcher errors 66054 */ 66055 errorHandler: null, 66056 66057 /** 66058 * Warn handler for watcher warns 66059 */ 66060 warnHandler: null, 66061 66062 /** 66063 * Ignore certain custom elements 66064 */ 66065 ignoredElements: [], 66066 66067 /** 66068 * Custom user key aliases for v-on 66069 */ 66070 // $flow-disable-line 66071 keyCodes: Object.create(null), 66072 66073 /** 66074 * Check if a tag is reserved so that it cannot be registered as a 66075 * component. This is platform-dependent and may be overwritten. 66076 */ 66077 isReservedTag: no, 66078 66079 /** 66080 * Check if an attribute is reserved so that it cannot be used as a component 66081 * prop. This is platform-dependent and may be overwritten. 66082 */ 66083 isReservedAttr: no, 66084 66085 /** 66086 * Check if a tag is an unknown element. 66087 * Platform-dependent. 66088 */ 66089 isUnknownElement: no, 66090 66091 /** 66092 * Get the namespace of an element 66093 */ 66094 getTagNamespace: noop, 66095 66096 /** 66097 * Parse the real tag name for the specific platform. 66098 */ 66099 parsePlatformTagName: identity, 66100 66101 /** 66102 * Check if an attribute must be bound using property, e.g. value 66103 * Platform-dependent. 66104 */ 66105 mustUseProp: no, 66106 66107 /** 66108 * Perform updates asynchronously. Intended to be used by Vue Test Utils 66109 * This will significantly reduce performance if set to false. 66110 */ 66111 async: true, 66112 66113 /** 66114 * Exposed for legacy reasons 66115 */ 66116 _lifecycleHooks: LIFECYCLE_HOOKS 66117}); 66118 66119/* */ 66120 66121/** 66122 * unicode letters used for parsing html tags, component names and property paths. 66123 * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname 66124 * skipping \u10000-\uEFFFF due to it freezing up PhantomJS 66125 */ 66126var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/; 66127 66128/** 66129 * Check if a string starts with $ or _ 66130 */ 66131function isReserved (str) { 66132 var c = (str + '').charCodeAt(0); 66133 return c === 0x24 || c === 0x5F 66134} 66135 66136/** 66137 * Define a property. 66138 */ 66139function def (obj, key, val, enumerable) { 66140 Object.defineProperty(obj, key, { 66141 value: val, 66142 enumerable: !!enumerable, 66143 writable: true, 66144 configurable: true 66145 }); 66146} 66147 66148/** 66149 * Parse simple path. 66150 */ 66151var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]")); 66152function parsePath (path) { 66153 if (bailRE.test(path)) { 66154 return 66155 } 66156 var segments = path.split('.'); 66157 return function (obj) { 66158 for (var i = 0; i < segments.length; i++) { 66159 if (!obj) { return } 66160 obj = obj[segments[i]]; 66161 } 66162 return obj 66163 } 66164} 66165 66166/* */ 66167 66168// can we use __proto__? 66169var hasProto = '__proto__' in {}; 66170 66171// Browser environment sniffing 66172var inBrowser = typeof window !== 'undefined'; 66173var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform; 66174var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase(); 66175var UA = inBrowser && window.navigator.userAgent.toLowerCase(); 66176var isIE = UA && /msie|trident/.test(UA); 66177var isIE9 = UA && UA.indexOf('msie 9.0') > 0; 66178var isEdge = UA && UA.indexOf('edge/') > 0; 66179var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android'); 66180var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios'); 66181var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge; 66182var isPhantomJS = UA && /phantomjs/.test(UA); 66183var isFF = UA && UA.match(/firefox\/(\d+)/); 66184 66185// Firefox has a "watch" function on Object.prototype... 66186var nativeWatch = ({}).watch; 66187 66188var supportsPassive = false; 66189if (inBrowser) { 66190 try { 66191 var opts = {}; 66192 Object.defineProperty(opts, 'passive', ({ 66193 get: function get () { 66194 /* istanbul ignore next */ 66195 supportsPassive = true; 66196 } 66197 })); // https://github.com/facebook/flow/issues/285 66198 window.addEventListener('test-passive', null, opts); 66199 } catch (e) {} 66200} 66201 66202// this needs to be lazy-evaled because vue may be required before 66203// vue-server-renderer can set VUE_ENV 66204var _isServer; 66205var isServerRendering = function () { 66206 if (_isServer === undefined) { 66207 /* istanbul ignore if */ 66208 if (!inBrowser && !inWeex && typeof global !== 'undefined') { 66209 // detect presence of vue-server-renderer and avoid 66210 // Webpack shimming the process 66211 _isServer = global['process'] && global['process'].env.VUE_ENV === 'server'; 66212 } else { 66213 _isServer = false; 66214 } 66215 } 66216 return _isServer 66217}; 66218 66219// detect devtools 66220var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__; 66221 66222/* istanbul ignore next */ 66223function isNative (Ctor) { 66224 return typeof Ctor === 'function' && /native code/.test(Ctor.toString()) 66225} 66226 66227var hasSymbol = 66228 typeof Symbol !== 'undefined' && isNative(Symbol) && 66229 typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys); 66230 66231var _Set; 66232/* istanbul ignore if */ // $flow-disable-line 66233if (typeof Set !== 'undefined' && isNative(Set)) { 66234 // use native Set when available. 66235 _Set = Set; 66236} else { 66237 // a non-standard Set polyfill that only works with primitive keys. 66238 _Set = /*@__PURE__*/(function () { 66239 function Set () { 66240 this.set = Object.create(null); 66241 } 66242 Set.prototype.has = function has (key) { 66243 return this.set[key] === true 66244 }; 66245 Set.prototype.add = function add (key) { 66246 this.set[key] = true; 66247 }; 66248 Set.prototype.clear = function clear () { 66249 this.set = Object.create(null); 66250 }; 66251 66252 return Set; 66253 }()); 66254} 66255 66256/* */ 66257 66258var warn = noop; 66259var tip = noop; 66260var generateComponentTrace = (noop); // work around flow check 66261var formatComponentName = (noop); 66262 66263{ 66264 var hasConsole = typeof console !== 'undefined'; 66265 var classifyRE = /(?:^|[-_])(\w)/g; 66266 var classify = function (str) { return str 66267 .replace(classifyRE, function (c) { return c.toUpperCase(); }) 66268 .replace(/[-_]/g, ''); }; 66269 66270 warn = function (msg, vm) { 66271 var trace = vm ? generateComponentTrace(vm) : ''; 66272 66273 if (config.warnHandler) { 66274 config.warnHandler.call(null, msg, vm, trace); 66275 } else if (hasConsole && (!config.silent)) { 66276 console.error(("[Vue warn]: " + msg + trace)); 66277 } 66278 }; 66279 66280 tip = function (msg, vm) { 66281 if (hasConsole && (!config.silent)) { 66282 console.warn("[Vue tip]: " + msg + ( 66283 vm ? generateComponentTrace(vm) : '' 66284 )); 66285 } 66286 }; 66287 66288 formatComponentName = function (vm, includeFile) { 66289 if (vm.$root === vm) { 66290 return '<Root>' 66291 } 66292 var options = typeof vm === 'function' && vm.cid != null 66293 ? vm.options 66294 : vm._isVue 66295 ? vm.$options || vm.constructor.options 66296 : vm; 66297 var name = options.name || options._componentTag; 66298 var file = options.__file; 66299 if (!name && file) { 66300 var match = file.match(/([^/\\]+)\.vue$/); 66301 name = match && match[1]; 66302 } 66303 66304 return ( 66305 (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") + 66306 (file && includeFile !== false ? (" at " + file) : '') 66307 ) 66308 }; 66309 66310 var repeat = function (str, n) { 66311 var res = ''; 66312 while (n) { 66313 if (n % 2 === 1) { res += str; } 66314 if (n > 1) { str += str; } 66315 n >>= 1; 66316 } 66317 return res 66318 }; 66319 66320 generateComponentTrace = function (vm) { 66321 if (vm._isVue && vm.$parent) { 66322 var tree = []; 66323 var currentRecursiveSequence = 0; 66324 while (vm) { 66325 if (tree.length > 0) { 66326 var last = tree[tree.length - 1]; 66327 if (last.constructor === vm.constructor) { 66328 currentRecursiveSequence++; 66329 vm = vm.$parent; 66330 continue 66331 } else if (currentRecursiveSequence > 0) { 66332 tree[tree.length - 1] = [last, currentRecursiveSequence]; 66333 currentRecursiveSequence = 0; 66334 } 66335 } 66336 tree.push(vm); 66337 vm = vm.$parent; 66338 } 66339 return '\n\nfound in\n\n' + tree 66340 .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm) 66341 ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)") 66342 : formatComponentName(vm))); }) 66343 .join('\n') 66344 } else { 66345 return ("\n\n(found in " + (formatComponentName(vm)) + ")") 66346 } 66347 }; 66348} 66349 66350/* */ 66351 66352var uid = 0; 66353 66354/** 66355 * A dep is an observable that can have multiple 66356 * directives subscribing to it. 66357 */ 66358var Dep = function Dep () { 66359 this.id = uid++; 66360 this.subs = []; 66361}; 66362 66363Dep.prototype.addSub = function addSub (sub) { 66364 this.subs.push(sub); 66365}; 66366 66367Dep.prototype.removeSub = function removeSub (sub) { 66368 remove(this.subs, sub); 66369}; 66370 66371Dep.prototype.depend = function depend () { 66372 if (Dep.target) { 66373 Dep.target.addDep(this); 66374 } 66375}; 66376 66377Dep.prototype.notify = function notify () { 66378 // stabilize the subscriber list first 66379 var subs = this.subs.slice(); 66380 if (!config.async) { 66381 // subs aren't sorted in scheduler if not running async 66382 // we need to sort them now to make sure they fire in correct 66383 // order 66384 subs.sort(function (a, b) { return a.id - b.id; }); 66385 } 66386 for (var i = 0, l = subs.length; i < l; i++) { 66387 subs[i].update(); 66388 } 66389}; 66390 66391// The current target watcher being evaluated. 66392// This is globally unique because only one watcher 66393// can be evaluated at a time. 66394Dep.target = null; 66395var targetStack = []; 66396 66397function pushTarget (target) { 66398 targetStack.push(target); 66399 Dep.target = target; 66400} 66401 66402function popTarget () { 66403 targetStack.pop(); 66404 Dep.target = targetStack[targetStack.length - 1]; 66405} 66406 66407/* */ 66408 66409var VNode = function VNode ( 66410 tag, 66411 data, 66412 children, 66413 text, 66414 elm, 66415 context, 66416 componentOptions, 66417 asyncFactory 66418) { 66419 this.tag = tag; 66420 this.data = data; 66421 this.children = children; 66422 this.text = text; 66423 this.elm = elm; 66424 this.ns = undefined; 66425 this.context = context; 66426 this.fnContext = undefined; 66427 this.fnOptions = undefined; 66428 this.fnScopeId = undefined; 66429 this.key = data && data.key; 66430 this.componentOptions = componentOptions; 66431 this.componentInstance = undefined; 66432 this.parent = undefined; 66433 this.raw = false; 66434 this.isStatic = false; 66435 this.isRootInsert = true; 66436 this.isComment = false; 66437 this.isCloned = false; 66438 this.isOnce = false; 66439 this.asyncFactory = asyncFactory; 66440 this.asyncMeta = undefined; 66441 this.isAsyncPlaceholder = false; 66442}; 66443 66444var prototypeAccessors = { child: { configurable: true } }; 66445 66446// DEPRECATED: alias for componentInstance for backwards compat. 66447/* istanbul ignore next */ 66448prototypeAccessors.child.get = function () { 66449 return this.componentInstance 66450}; 66451 66452Object.defineProperties( VNode.prototype, prototypeAccessors ); 66453 66454var createEmptyVNode = function (text) { 66455 if ( text === void 0 ) text = ''; 66456 66457 var node = new VNode(); 66458 node.text = text; 66459 node.isComment = true; 66460 return node 66461}; 66462 66463function createTextVNode (val) { 66464 return new VNode(undefined, undefined, undefined, String(val)) 66465} 66466 66467// optimized shallow clone 66468// used for static nodes and slot nodes because they may be reused across 66469// multiple renders, cloning them avoids errors when DOM manipulations rely 66470// on their elm reference. 66471function cloneVNode (vnode) { 66472 var cloned = new VNode( 66473 vnode.tag, 66474 vnode.data, 66475 // #7975 66476 // clone children array to avoid mutating original in case of cloning 66477 // a child. 66478 vnode.children && vnode.children.slice(), 66479 vnode.text, 66480 vnode.elm, 66481 vnode.context, 66482 vnode.componentOptions, 66483 vnode.asyncFactory 66484 ); 66485 cloned.ns = vnode.ns; 66486 cloned.isStatic = vnode.isStatic; 66487 cloned.key = vnode.key; 66488 cloned.isComment = vnode.isComment; 66489 cloned.fnContext = vnode.fnContext; 66490 cloned.fnOptions = vnode.fnOptions; 66491 cloned.fnScopeId = vnode.fnScopeId; 66492 cloned.asyncMeta = vnode.asyncMeta; 66493 cloned.isCloned = true; 66494 return cloned 66495} 66496 66497/* 66498 * not type checking this file because flow doesn't play well with 66499 * dynamically accessing methods on Array prototype 66500 */ 66501 66502var arrayProto = Array.prototype; 66503var arrayMethods = Object.create(arrayProto); 66504 66505var methodsToPatch = [ 66506 'push', 66507 'pop', 66508 'shift', 66509 'unshift', 66510 'splice', 66511 'sort', 66512 'reverse' 66513]; 66514 66515/** 66516 * Intercept mutating methods and emit events 66517 */ 66518methodsToPatch.forEach(function (method) { 66519 // cache original method 66520 var original = arrayProto[method]; 66521 def(arrayMethods, method, function mutator () { 66522 var args = [], len = arguments.length; 66523 while ( len-- ) args[ len ] = arguments[ len ]; 66524 66525 var result = original.apply(this, args); 66526 var ob = this.__ob__; 66527 var inserted; 66528 switch (method) { 66529 case 'push': 66530 case 'unshift': 66531 inserted = args; 66532 break 66533 case 'splice': 66534 inserted = args.slice(2); 66535 break 66536 } 66537 if (inserted) { ob.observeArray(inserted); } 66538 // notify change 66539 ob.dep.notify(); 66540 return result 66541 }); 66542}); 66543 66544/* */ 66545 66546var arrayKeys = Object.getOwnPropertyNames(arrayMethods); 66547 66548/** 66549 * In some cases we may want to disable observation inside a component's 66550 * update computation. 66551 */ 66552var shouldObserve = true; 66553 66554function toggleObserving (value) { 66555 shouldObserve = value; 66556} 66557 66558/** 66559 * Observer class that is attached to each observed 66560 * object. Once attached, the observer converts the target 66561 * object's property keys into getter/setters that 66562 * collect dependencies and dispatch updates. 66563 */ 66564var Observer = function Observer (value) { 66565 this.value = value; 66566 this.dep = new Dep(); 66567 this.vmCount = 0; 66568 def(value, '__ob__', this); 66569 if (Array.isArray(value)) { 66570 if (hasProto) { 66571 protoAugment(value, arrayMethods); 66572 } else { 66573 copyAugment(value, arrayMethods, arrayKeys); 66574 } 66575 this.observeArray(value); 66576 } else { 66577 this.walk(value); 66578 } 66579}; 66580 66581/** 66582 * Walk through all properties and convert them into 66583 * getter/setters. This method should only be called when 66584 * value type is Object. 66585 */ 66586Observer.prototype.walk = function walk (obj) { 66587 var keys = Object.keys(obj); 66588 for (var i = 0; i < keys.length; i++) { 66589 defineReactive$$1(obj, keys[i]); 66590 } 66591}; 66592 66593/** 66594 * Observe a list of Array items. 66595 */ 66596Observer.prototype.observeArray = function observeArray (items) { 66597 for (var i = 0, l = items.length; i < l; i++) { 66598 observe(items[i]); 66599 } 66600}; 66601 66602// helpers 66603 66604/** 66605 * Augment a target Object or Array by intercepting 66606 * the prototype chain using __proto__ 66607 */ 66608function protoAugment (target, src) { 66609 /* eslint-disable no-proto */ 66610 target.__proto__ = src; 66611 /* eslint-enable no-proto */ 66612} 66613 66614/** 66615 * Augment a target Object or Array by defining 66616 * hidden properties. 66617 */ 66618/* istanbul ignore next */ 66619function copyAugment (target, src, keys) { 66620 for (var i = 0, l = keys.length; i < l; i++) { 66621 var key = keys[i]; 66622 def(target, key, src[key]); 66623 } 66624} 66625 66626/** 66627 * Attempt to create an observer instance for a value, 66628 * returns the new observer if successfully observed, 66629 * or the existing observer if the value already has one. 66630 */ 66631function observe (value, asRootData) { 66632 if (!isObject(value) || value instanceof VNode) { 66633 return 66634 } 66635 var ob; 66636 if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) { 66637 ob = value.__ob__; 66638 } else if ( 66639 shouldObserve && 66640 !isServerRendering() && 66641 (Array.isArray(value) || isPlainObject(value)) && 66642 Object.isExtensible(value) && 66643 !value._isVue 66644 ) { 66645 ob = new Observer(value); 66646 } 66647 if (asRootData && ob) { 66648 ob.vmCount++; 66649 } 66650 return ob 66651} 66652 66653/** 66654 * Define a reactive property on an Object. 66655 */ 66656function defineReactive$$1 ( 66657 obj, 66658 key, 66659 val, 66660 customSetter, 66661 shallow 66662) { 66663 var dep = new Dep(); 66664 66665 var property = Object.getOwnPropertyDescriptor(obj, key); 66666 if (property && property.configurable === false) { 66667 return 66668 } 66669 66670 // cater for pre-defined getter/setters 66671 var getter = property && property.get; 66672 var setter = property && property.set; 66673 if ((!getter || setter) && arguments.length === 2) { 66674 val = obj[key]; 66675 } 66676 66677 var childOb = !shallow && observe(val); 66678 Object.defineProperty(obj, key, { 66679 enumerable: true, 66680 configurable: true, 66681 get: function reactiveGetter () { 66682 var value = getter ? getter.call(obj) : val; 66683 if (Dep.target) { 66684 dep.depend(); 66685 if (childOb) { 66686 childOb.dep.depend(); 66687 if (Array.isArray(value)) { 66688 dependArray(value); 66689 } 66690 } 66691 } 66692 return value 66693 }, 66694 set: function reactiveSetter (newVal) { 66695 var value = getter ? getter.call(obj) : val; 66696 /* eslint-disable no-self-compare */ 66697 if (newVal === value || (newVal !== newVal && value !== value)) { 66698 return 66699 } 66700 /* eslint-enable no-self-compare */ 66701 if (customSetter) { 66702 customSetter(); 66703 } 66704 // #7981: for accessor properties without setter 66705 if (getter && !setter) { return } 66706 if (setter) { 66707 setter.call(obj, newVal); 66708 } else { 66709 val = newVal; 66710 } 66711 childOb = !shallow && observe(newVal); 66712 dep.notify(); 66713 } 66714 }); 66715} 66716 66717/** 66718 * Set a property on an object. Adds the new property and 66719 * triggers change notification if the property doesn't 66720 * already exist. 66721 */ 66722function set (target, key, val) { 66723 if (isUndef(target) || isPrimitive(target) 66724 ) { 66725 warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target)))); 66726 } 66727 if (Array.isArray(target) && isValidArrayIndex(key)) { 66728 target.length = Math.max(target.length, key); 66729 target.splice(key, 1, val); 66730 return val 66731 } 66732 if (key in target && !(key in Object.prototype)) { 66733 target[key] = val; 66734 return val 66735 } 66736 var ob = (target).__ob__; 66737 if (target._isVue || (ob && ob.vmCount)) { 66738 warn( 66739 'Avoid adding reactive properties to a Vue instance or its root $data ' + 66740 'at runtime - declare it upfront in the data option.' 66741 ); 66742 return val 66743 } 66744 if (!ob) { 66745 target[key] = val; 66746 return val 66747 } 66748 defineReactive$$1(ob.value, key, val); 66749 ob.dep.notify(); 66750 return val 66751} 66752 66753/** 66754 * Delete a property and trigger change if necessary. 66755 */ 66756function del (target, key) { 66757 if (isUndef(target) || isPrimitive(target) 66758 ) { 66759 warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target)))); 66760 } 66761 if (Array.isArray(target) && isValidArrayIndex(key)) { 66762 target.splice(key, 1); 66763 return 66764 } 66765 var ob = (target).__ob__; 66766 if (target._isVue || (ob && ob.vmCount)) { 66767 warn( 66768 'Avoid deleting properties on a Vue instance or its root $data ' + 66769 '- just set it to null.' 66770 ); 66771 return 66772 } 66773 if (!hasOwn(target, key)) { 66774 return 66775 } 66776 delete target[key]; 66777 if (!ob) { 66778 return 66779 } 66780 ob.dep.notify(); 66781} 66782 66783/** 66784 * Collect dependencies on array elements when the array is touched, since 66785 * we cannot intercept array element access like property getters. 66786 */ 66787function dependArray (value) { 66788 for (var e = (void 0), i = 0, l = value.length; i < l; i++) { 66789 e = value[i]; 66790 e && e.__ob__ && e.__ob__.dep.depend(); 66791 if (Array.isArray(e)) { 66792 dependArray(e); 66793 } 66794 } 66795} 66796 66797/* */ 66798 66799/** 66800 * Option overwriting strategies are functions that handle 66801 * how to merge a parent option value and a child option 66802 * value into the final value. 66803 */ 66804var strats = config.optionMergeStrategies; 66805 66806/** 66807 * Options with restrictions 66808 */ 66809{ 66810 strats.el = strats.propsData = function (parent, child, vm, key) { 66811 if (!vm) { 66812 warn( 66813 "option \"" + key + "\" can only be used during instance " + 66814 'creation with the `new` keyword.' 66815 ); 66816 } 66817 return defaultStrat(parent, child) 66818 }; 66819} 66820 66821/** 66822 * Helper that recursively merges two data objects together. 66823 */ 66824function mergeData (to, from) { 66825 if (!from) { return to } 66826 var key, toVal, fromVal; 66827 66828 var keys = hasSymbol 66829 ? Reflect.ownKeys(from) 66830 : Object.keys(from); 66831 66832 for (var i = 0; i < keys.length; i++) { 66833 key = keys[i]; 66834 // in case the object is already observed... 66835 if (key === '__ob__') { continue } 66836 toVal = to[key]; 66837 fromVal = from[key]; 66838 if (!hasOwn(to, key)) { 66839 set(to, key, fromVal); 66840 } else if ( 66841 toVal !== fromVal && 66842 isPlainObject(toVal) && 66843 isPlainObject(fromVal) 66844 ) { 66845 mergeData(toVal, fromVal); 66846 } 66847 } 66848 return to 66849} 66850 66851/** 66852 * Data 66853 */ 66854function mergeDataOrFn ( 66855 parentVal, 66856 childVal, 66857 vm 66858) { 66859 if (!vm) { 66860 // in a Vue.extend merge, both should be functions 66861 if (!childVal) { 66862 return parentVal 66863 } 66864 if (!parentVal) { 66865 return childVal 66866 } 66867 // when parentVal & childVal are both present, 66868 // we need to return a function that returns the 66869 // merged result of both functions... no need to 66870 // check if parentVal is a function here because 66871 // it has to be a function to pass previous merges. 66872 return function mergedDataFn () { 66873 return mergeData( 66874 typeof childVal === 'function' ? childVal.call(this, this) : childVal, 66875 typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal 66876 ) 66877 } 66878 } else { 66879 return function mergedInstanceDataFn () { 66880 // instance merge 66881 var instanceData = typeof childVal === 'function' 66882 ? childVal.call(vm, vm) 66883 : childVal; 66884 var defaultData = typeof parentVal === 'function' 66885 ? parentVal.call(vm, vm) 66886 : parentVal; 66887 if (instanceData) { 66888 return mergeData(instanceData, defaultData) 66889 } else { 66890 return defaultData 66891 } 66892 } 66893 } 66894} 66895 66896strats.data = function ( 66897 parentVal, 66898 childVal, 66899 vm 66900) { 66901 if (!vm) { 66902 if (childVal && typeof childVal !== 'function') { 66903 warn( 66904 'The "data" option should be a function ' + 66905 'that returns a per-instance value in component ' + 66906 'definitions.', 66907 vm 66908 ); 66909 66910 return parentVal 66911 } 66912 return mergeDataOrFn(parentVal, childVal) 66913 } 66914 66915 return mergeDataOrFn(parentVal, childVal, vm) 66916}; 66917 66918/** 66919 * Hooks and props are merged as arrays. 66920 */ 66921function mergeHook ( 66922 parentVal, 66923 childVal 66924) { 66925 var res = childVal 66926 ? parentVal 66927 ? parentVal.concat(childVal) 66928 : Array.isArray(childVal) 66929 ? childVal 66930 : [childVal] 66931 : parentVal; 66932 return res 66933 ? dedupeHooks(res) 66934 : res 66935} 66936 66937function dedupeHooks (hooks) { 66938 var res = []; 66939 for (var i = 0; i < hooks.length; i++) { 66940 if (res.indexOf(hooks[i]) === -1) { 66941 res.push(hooks[i]); 66942 } 66943 } 66944 return res 66945} 66946 66947LIFECYCLE_HOOKS.forEach(function (hook) { 66948 strats[hook] = mergeHook; 66949}); 66950 66951/** 66952 * Assets 66953 * 66954 * When a vm is present (instance creation), we need to do 66955 * a three-way merge between constructor options, instance 66956 * options and parent options. 66957 */ 66958function mergeAssets ( 66959 parentVal, 66960 childVal, 66961 vm, 66962 key 66963) { 66964 var res = Object.create(parentVal || null); 66965 if (childVal) { 66966 assertObjectType(key, childVal, vm); 66967 return extend(res, childVal) 66968 } else { 66969 return res 66970 } 66971} 66972 66973ASSET_TYPES.forEach(function (type) { 66974 strats[type + 's'] = mergeAssets; 66975}); 66976 66977/** 66978 * Watchers. 66979 * 66980 * Watchers hashes should not overwrite one 66981 * another, so we merge them as arrays. 66982 */ 66983strats.watch = function ( 66984 parentVal, 66985 childVal, 66986 vm, 66987 key 66988) { 66989 // work around Firefox's Object.prototype.watch... 66990 if (parentVal === nativeWatch) { parentVal = undefined; } 66991 if (childVal === nativeWatch) { childVal = undefined; } 66992 /* istanbul ignore if */ 66993 if (!childVal) { return Object.create(parentVal || null) } 66994 { 66995 assertObjectType(key, childVal, vm); 66996 } 66997 if (!parentVal) { return childVal } 66998 var ret = {}; 66999 extend(ret, parentVal); 67000 for (var key$1 in childVal) { 67001 var parent = ret[key$1]; 67002 var child = childVal[key$1]; 67003 if (parent && !Array.isArray(parent)) { 67004 parent = [parent]; 67005 } 67006 ret[key$1] = parent 67007 ? parent.concat(child) 67008 : Array.isArray(child) ? child : [child]; 67009 } 67010 return ret 67011}; 67012 67013/** 67014 * Other object hashes. 67015 */ 67016strats.props = 67017strats.methods = 67018strats.inject = 67019strats.computed = function ( 67020 parentVal, 67021 childVal, 67022 vm, 67023 key 67024) { 67025 if (childVal && "development" !== 'production') { 67026 assertObjectType(key, childVal, vm); 67027 } 67028 if (!parentVal) { return childVal } 67029 var ret = Object.create(null); 67030 extend(ret, parentVal); 67031 if (childVal) { extend(ret, childVal); } 67032 return ret 67033}; 67034strats.provide = mergeDataOrFn; 67035 67036/** 67037 * Default strategy. 67038 */ 67039var defaultStrat = function (parentVal, childVal) { 67040 return childVal === undefined 67041 ? parentVal 67042 : childVal 67043}; 67044 67045/** 67046 * Validate component names 67047 */ 67048function checkComponents (options) { 67049 for (var key in options.components) { 67050 validateComponentName(key); 67051 } 67052} 67053 67054function validateComponentName (name) { 67055 if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) { 67056 warn( 67057 'Invalid component name: "' + name + '". Component names ' + 67058 'should conform to valid custom element name in html5 specification.' 67059 ); 67060 } 67061 if (isBuiltInTag(name) || config.isReservedTag(name)) { 67062 warn( 67063 'Do not use built-in or reserved HTML elements as component ' + 67064 'id: ' + name 67065 ); 67066 } 67067} 67068 67069/** 67070 * Ensure all props option syntax are normalized into the 67071 * Object-based format. 67072 */ 67073function normalizeProps (options, vm) { 67074 var props = options.props; 67075 if (!props) { return } 67076 var res = {}; 67077 var i, val, name; 67078 if (Array.isArray(props)) { 67079 i = props.length; 67080 while (i--) { 67081 val = props[i]; 67082 if (typeof val === 'string') { 67083 name = camelize(val); 67084 res[name] = { type: null }; 67085 } else { 67086 warn('props must be strings when using array syntax.'); 67087 } 67088 } 67089 } else if (isPlainObject(props)) { 67090 for (var key in props) { 67091 val = props[key]; 67092 name = camelize(key); 67093 res[name] = isPlainObject(val) 67094 ? val 67095 : { type: val }; 67096 } 67097 } else { 67098 warn( 67099 "Invalid value for option \"props\": expected an Array or an Object, " + 67100 "but got " + (toRawType(props)) + ".", 67101 vm 67102 ); 67103 } 67104 options.props = res; 67105} 67106 67107/** 67108 * Normalize all injections into Object-based format 67109 */ 67110function normalizeInject (options, vm) { 67111 var inject = options.inject; 67112 if (!inject) { return } 67113 var normalized = options.inject = {}; 67114 if (Array.isArray(inject)) { 67115 for (var i = 0; i < inject.length; i++) { 67116 normalized[inject[i]] = { from: inject[i] }; 67117 } 67118 } else if (isPlainObject(inject)) { 67119 for (var key in inject) { 67120 var val = inject[key]; 67121 normalized[key] = isPlainObject(val) 67122 ? extend({ from: key }, val) 67123 : { from: val }; 67124 } 67125 } else { 67126 warn( 67127 "Invalid value for option \"inject\": expected an Array or an Object, " + 67128 "but got " + (toRawType(inject)) + ".", 67129 vm 67130 ); 67131 } 67132} 67133 67134/** 67135 * Normalize raw function directives into object format. 67136 */ 67137function normalizeDirectives (options) { 67138 var dirs = options.directives; 67139 if (dirs) { 67140 for (var key in dirs) { 67141 var def$$1 = dirs[key]; 67142 if (typeof def$$1 === 'function') { 67143 dirs[key] = { bind: def$$1, update: def$$1 }; 67144 } 67145 } 67146 } 67147} 67148 67149function assertObjectType (name, value, vm) { 67150 if (!isPlainObject(value)) { 67151 warn( 67152 "Invalid value for option \"" + name + "\": expected an Object, " + 67153 "but got " + (toRawType(value)) + ".", 67154 vm 67155 ); 67156 } 67157} 67158 67159/** 67160 * Merge two option objects into a new one. 67161 * Core utility used in both instantiation and inheritance. 67162 */ 67163function mergeOptions ( 67164 parent, 67165 child, 67166 vm 67167) { 67168 { 67169 checkComponents(child); 67170 } 67171 67172 if (typeof child === 'function') { 67173 child = child.options; 67174 } 67175 67176 normalizeProps(child, vm); 67177 normalizeInject(child, vm); 67178 normalizeDirectives(child); 67179 67180 // Apply extends and mixins on the child options, 67181 // but only if it is a raw options object that isn't 67182 // the result of another mergeOptions call. 67183 // Only merged options has the _base property. 67184 if (!child._base) { 67185 if (child.extends) { 67186 parent = mergeOptions(parent, child.extends, vm); 67187 } 67188 if (child.mixins) { 67189 for (var i = 0, l = child.mixins.length; i < l; i++) { 67190 parent = mergeOptions(parent, child.mixins[i], vm); 67191 } 67192 } 67193 } 67194 67195 var options = {}; 67196 var key; 67197 for (key in parent) { 67198 mergeField(key); 67199 } 67200 for (key in child) { 67201 if (!hasOwn(parent, key)) { 67202 mergeField(key); 67203 } 67204 } 67205 function mergeField (key) { 67206 var strat = strats[key] || defaultStrat; 67207 options[key] = strat(parent[key], child[key], vm, key); 67208 } 67209 return options 67210} 67211 67212/** 67213 * Resolve an asset. 67214 * This function is used because child instances need access 67215 * to assets defined in its ancestor chain. 67216 */ 67217function resolveAsset ( 67218 options, 67219 type, 67220 id, 67221 warnMissing 67222) { 67223 /* istanbul ignore if */ 67224 if (typeof id !== 'string') { 67225 return 67226 } 67227 var assets = options[type]; 67228 // check local registration variations first 67229 if (hasOwn(assets, id)) { return assets[id] } 67230 var camelizedId = camelize(id); 67231 if (hasOwn(assets, camelizedId)) { return assets[camelizedId] } 67232 var PascalCaseId = capitalize(camelizedId); 67233 if (hasOwn(assets, PascalCaseId)) { return assets[PascalCaseId] } 67234 // fallback to prototype chain 67235 var res = assets[id] || assets[camelizedId] || assets[PascalCaseId]; 67236 if (warnMissing && !res) { 67237 warn( 67238 'Failed to resolve ' + type.slice(0, -1) + ': ' + id, 67239 options 67240 ); 67241 } 67242 return res 67243} 67244 67245/* */ 67246 67247 67248 67249function validateProp ( 67250 key, 67251 propOptions, 67252 propsData, 67253 vm 67254) { 67255 var prop = propOptions[key]; 67256 var absent = !hasOwn(propsData, key); 67257 var value = propsData[key]; 67258 // boolean casting 67259 var booleanIndex = getTypeIndex(Boolean, prop.type); 67260 if (booleanIndex > -1) { 67261 if (absent && !hasOwn(prop, 'default')) { 67262 value = false; 67263 } else if (value === '' || value === hyphenate(key)) { 67264 // only cast empty string / same name to boolean if 67265 // boolean has higher priority 67266 var stringIndex = getTypeIndex(String, prop.type); 67267 if (stringIndex < 0 || booleanIndex < stringIndex) { 67268 value = true; 67269 } 67270 } 67271 } 67272 // check default value 67273 if (value === undefined) { 67274 value = getPropDefaultValue(vm, prop, key); 67275 // since the default value is a fresh copy, 67276 // make sure to observe it. 67277 var prevShouldObserve = shouldObserve; 67278 toggleObserving(true); 67279 observe(value); 67280 toggleObserving(prevShouldObserve); 67281 } 67282 { 67283 assertProp(prop, key, value, vm, absent); 67284 } 67285 return value 67286} 67287 67288/** 67289 * Get the default value of a prop. 67290 */ 67291function getPropDefaultValue (vm, prop, key) { 67292 // no default, return undefined 67293 if (!hasOwn(prop, 'default')) { 67294 return undefined 67295 } 67296 var def = prop.default; 67297 // warn against non-factory defaults for Object & Array 67298 if (isObject(def)) { 67299 warn( 67300 'Invalid default value for prop "' + key + '": ' + 67301 'Props with type Object/Array must use a factory function ' + 67302 'to return the default value.', 67303 vm 67304 ); 67305 } 67306 // the raw prop value was also undefined from previous render, 67307 // return previous default value to avoid unnecessary watcher trigger 67308 if (vm && vm.$options.propsData && 67309 vm.$options.propsData[key] === undefined && 67310 vm._props[key] !== undefined 67311 ) { 67312 return vm._props[key] 67313 } 67314 // call factory function for non-Function types 67315 // a value is Function if its prototype is function even across different execution context 67316 return typeof def === 'function' && getType(prop.type) !== 'Function' 67317 ? def.call(vm) 67318 : def 67319} 67320 67321/** 67322 * Assert whether a prop is valid. 67323 */ 67324function assertProp ( 67325 prop, 67326 name, 67327 value, 67328 vm, 67329 absent 67330) { 67331 if (prop.required && absent) { 67332 warn( 67333 'Missing required prop: "' + name + '"', 67334 vm 67335 ); 67336 return 67337 } 67338 if (value == null && !prop.required) { 67339 return 67340 } 67341 var type = prop.type; 67342 var valid = !type || type === true; 67343 var expectedTypes = []; 67344 if (type) { 67345 if (!Array.isArray(type)) { 67346 type = [type]; 67347 } 67348 for (var i = 0; i < type.length && !valid; i++) { 67349 var assertedType = assertType(value, type[i], vm); 67350 expectedTypes.push(assertedType.expectedType || ''); 67351 valid = assertedType.valid; 67352 } 67353 } 67354 67355 var haveExpectedTypes = expectedTypes.some(function (t) { return t; }); 67356 if (!valid && haveExpectedTypes) { 67357 warn( 67358 getInvalidTypeMessage(name, value, expectedTypes), 67359 vm 67360 ); 67361 return 67362 } 67363 var validator = prop.validator; 67364 if (validator) { 67365 if (!validator(value)) { 67366 warn( 67367 'Invalid prop: custom validator check failed for prop "' + name + '".', 67368 vm 67369 ); 67370 } 67371 } 67372} 67373 67374var simpleCheckRE = /^(String|Number|Boolean|Function|Symbol|BigInt)$/; 67375 67376function assertType (value, type, vm) { 67377 var valid; 67378 var expectedType = getType(type); 67379 if (simpleCheckRE.test(expectedType)) { 67380 var t = typeof value; 67381 valid = t === expectedType.toLowerCase(); 67382 // for primitive wrapper objects 67383 if (!valid && t === 'object') { 67384 valid = value instanceof type; 67385 } 67386 } else if (expectedType === 'Object') { 67387 valid = isPlainObject(value); 67388 } else if (expectedType === 'Array') { 67389 valid = Array.isArray(value); 67390 } else { 67391 try { 67392 valid = value instanceof type; 67393 } catch (e) { 67394 warn('Invalid prop type: "' + String(type) + '" is not a constructor', vm); 67395 valid = false; 67396 } 67397 } 67398 return { 67399 valid: valid, 67400 expectedType: expectedType 67401 } 67402} 67403 67404var functionTypeCheckRE = /^\s*function (\w+)/; 67405 67406/** 67407 * Use function string name to check built-in types, 67408 * because a simple equality check will fail when running 67409 * across different vms / iframes. 67410 */ 67411function getType (fn) { 67412 var match = fn && fn.toString().match(functionTypeCheckRE); 67413 return match ? match[1] : '' 67414} 67415 67416function isSameType (a, b) { 67417 return getType(a) === getType(b) 67418} 67419 67420function getTypeIndex (type, expectedTypes) { 67421 if (!Array.isArray(expectedTypes)) { 67422 return isSameType(expectedTypes, type) ? 0 : -1 67423 } 67424 for (var i = 0, len = expectedTypes.length; i < len; i++) { 67425 if (isSameType(expectedTypes[i], type)) { 67426 return i 67427 } 67428 } 67429 return -1 67430} 67431 67432function getInvalidTypeMessage (name, value, expectedTypes) { 67433 var message = "Invalid prop: type check failed for prop \"" + name + "\"." + 67434 " Expected " + (expectedTypes.map(capitalize).join(', ')); 67435 var expectedType = expectedTypes[0]; 67436 var receivedType = toRawType(value); 67437 // check if we need to specify expected value 67438 if ( 67439 expectedTypes.length === 1 && 67440 isExplicable(expectedType) && 67441 isExplicable(typeof value) && 67442 !isBoolean(expectedType, receivedType) 67443 ) { 67444 message += " with value " + (styleValue(value, expectedType)); 67445 } 67446 message += ", got " + receivedType + " "; 67447 // check if we need to specify received value 67448 if (isExplicable(receivedType)) { 67449 message += "with value " + (styleValue(value, receivedType)) + "."; 67450 } 67451 return message 67452} 67453 67454function styleValue (value, type) { 67455 if (type === 'String') { 67456 return ("\"" + value + "\"") 67457 } else if (type === 'Number') { 67458 return ("" + (Number(value))) 67459 } else { 67460 return ("" + value) 67461 } 67462} 67463 67464var EXPLICABLE_TYPES = ['string', 'number', 'boolean']; 67465function isExplicable (value) { 67466 return EXPLICABLE_TYPES.some(function (elem) { return value.toLowerCase() === elem; }) 67467} 67468 67469function isBoolean () { 67470 var args = [], len = arguments.length; 67471 while ( len-- ) args[ len ] = arguments[ len ]; 67472 67473 return args.some(function (elem) { return elem.toLowerCase() === 'boolean'; }) 67474} 67475 67476/* */ 67477 67478function handleError (err, vm, info) { 67479 // Deactivate deps tracking while processing error handler to avoid possible infinite rendering. 67480 // See: https://github.com/vuejs/vuex/issues/1505 67481 pushTarget(); 67482 try { 67483 if (vm) { 67484 var cur = vm; 67485 while ((cur = cur.$parent)) { 67486 var hooks = cur.$options.errorCaptured; 67487 if (hooks) { 67488 for (var i = 0; i < hooks.length; i++) { 67489 try { 67490 var capture = hooks[i].call(cur, err, vm, info) === false; 67491 if (capture) { return } 67492 } catch (e) { 67493 globalHandleError(e, cur, 'errorCaptured hook'); 67494 } 67495 } 67496 } 67497 } 67498 } 67499 globalHandleError(err, vm, info); 67500 } finally { 67501 popTarget(); 67502 } 67503} 67504 67505function invokeWithErrorHandling ( 67506 handler, 67507 context, 67508 args, 67509 vm, 67510 info 67511) { 67512 var res; 67513 try { 67514 res = args ? handler.apply(context, args) : handler.call(context); 67515 if (res && !res._isVue && isPromise(res) && !res._handled) { 67516 res.catch(function (e) { return handleError(e, vm, info + " (Promise/async)"); }); 67517 // issue #9511 67518 // avoid catch triggering multiple times when nested calls 67519 res._handled = true; 67520 } 67521 } catch (e) { 67522 handleError(e, vm, info); 67523 } 67524 return res 67525} 67526 67527function globalHandleError (err, vm, info) { 67528 if (config.errorHandler) { 67529 try { 67530 return config.errorHandler.call(null, err, vm, info) 67531 } catch (e) { 67532 // if the user intentionally throws the original error in the handler, 67533 // do not log it twice 67534 if (e !== err) { 67535 logError(e, null, 'config.errorHandler'); 67536 } 67537 } 67538 } 67539 logError(err, vm, info); 67540} 67541 67542function logError (err, vm, info) { 67543 { 67544 warn(("Error in " + info + ": \"" + (err.toString()) + "\""), vm); 67545 } 67546 /* istanbul ignore else */ 67547 if ((inBrowser || inWeex) && typeof console !== 'undefined') { 67548 console.error(err); 67549 } else { 67550 throw err 67551 } 67552} 67553 67554/* */ 67555 67556var isUsingMicroTask = false; 67557 67558var callbacks = []; 67559var pending = false; 67560 67561function flushCallbacks () { 67562 pending = false; 67563 var copies = callbacks.slice(0); 67564 callbacks.length = 0; 67565 for (var i = 0; i < copies.length; i++) { 67566 copies[i](); 67567 } 67568} 67569 67570// Here we have async deferring wrappers using microtasks. 67571// In 2.5 we used (macro) tasks (in combination with microtasks). 67572// However, it has subtle problems when state is changed right before repaint 67573// (e.g. #6813, out-in transitions). 67574// Also, using (macro) tasks in event handler would cause some weird behaviors 67575// that cannot be circumvented (e.g. #7109, #7153, #7546, #7834, #8109). 67576// So we now use microtasks everywhere, again. 67577// A major drawback of this tradeoff is that there are some scenarios 67578// where microtasks have too high a priority and fire in between supposedly 67579// sequential events (e.g. #4521, #6690, which have workarounds) 67580// or even between bubbling of the same event (#6566). 67581var timerFunc; 67582 67583// The nextTick behavior leverages the microtask queue, which can be accessed 67584// via either native Promise.then or MutationObserver. 67585// MutationObserver has wider support, however it is seriously bugged in 67586// UIWebView in iOS >= 9.3.3 when triggered in touch event handlers. It 67587// completely stops working after triggering a few times... so, if native 67588// Promise is available, we will use it: 67589/* istanbul ignore next, $flow-disable-line */ 67590if (typeof Promise !== 'undefined' && isNative(Promise)) { 67591 var p = Promise.resolve(); 67592 timerFunc = function () { 67593 p.then(flushCallbacks); 67594 // In problematic UIWebViews, Promise.then doesn't completely break, but 67595 // it can get stuck in a weird state where callbacks are pushed into the 67596 // microtask queue but the queue isn't being flushed, until the browser 67597 // needs to do some other work, e.g. handle a timer. Therefore we can 67598 // "force" the microtask queue to be flushed by adding an empty timer. 67599 if (isIOS) { setTimeout(noop); } 67600 }; 67601 isUsingMicroTask = true; 67602} else if (!isIE && typeof MutationObserver !== 'undefined' && ( 67603 isNative(MutationObserver) || 67604 // PhantomJS and iOS 7.x 67605 MutationObserver.toString() === '[object MutationObserverConstructor]' 67606)) { 67607 // Use MutationObserver where native Promise is not available, 67608 // e.g. PhantomJS, iOS7, Android 4.4 67609 // (#6466 MutationObserver is unreliable in IE11) 67610 var counter = 1; 67611 var observer = new MutationObserver(flushCallbacks); 67612 var textNode = document.createTextNode(String(counter)); 67613 observer.observe(textNode, { 67614 characterData: true 67615 }); 67616 timerFunc = function () { 67617 counter = (counter + 1) % 2; 67618 textNode.data = String(counter); 67619 }; 67620 isUsingMicroTask = true; 67621} else if (typeof setImmediate !== 'undefined' && isNative(setImmediate)) { 67622 // Fallback to setImmediate. 67623 // Technically it leverages the (macro) task queue, 67624 // but it is still a better choice than setTimeout. 67625 timerFunc = function () { 67626 setImmediate(flushCallbacks); 67627 }; 67628} else { 67629 // Fallback to setTimeout. 67630 timerFunc = function () { 67631 setTimeout(flushCallbacks, 0); 67632 }; 67633} 67634 67635function nextTick (cb, ctx) { 67636 var _resolve; 67637 callbacks.push(function () { 67638 if (cb) { 67639 try { 67640 cb.call(ctx); 67641 } catch (e) { 67642 handleError(e, ctx, 'nextTick'); 67643 } 67644 } else if (_resolve) { 67645 _resolve(ctx); 67646 } 67647 }); 67648 if (!pending) { 67649 pending = true; 67650 timerFunc(); 67651 } 67652 // $flow-disable-line 67653 if (!cb && typeof Promise !== 'undefined') { 67654 return new Promise(function (resolve) { 67655 _resolve = resolve; 67656 }) 67657 } 67658} 67659 67660/* */ 67661 67662var mark; 67663var measure; 67664 67665{ 67666 var perf = inBrowser && window.performance; 67667 /* istanbul ignore if */ 67668 if ( 67669 perf && 67670 perf.mark && 67671 perf.measure && 67672 perf.clearMarks && 67673 perf.clearMeasures 67674 ) { 67675 mark = function (tag) { return perf.mark(tag); }; 67676 measure = function (name, startTag, endTag) { 67677 perf.measure(name, startTag, endTag); 67678 perf.clearMarks(startTag); 67679 perf.clearMarks(endTag); 67680 // perf.clearMeasures(name) 67681 }; 67682 } 67683} 67684 67685/* not type checking this file because flow doesn't play well with Proxy */ 67686 67687var initProxy; 67688 67689{ 67690 var allowedGlobals = makeMap( 67691 'Infinity,undefined,NaN,isFinite,isNaN,' + 67692 'parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,' + 67693 'Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,' + 67694 'require' // for Webpack/Browserify 67695 ); 67696 67697 var warnNonPresent = function (target, key) { 67698 warn( 67699 "Property or method \"" + key + "\" is not defined on the instance but " + 67700 'referenced during render. Make sure that this property is reactive, ' + 67701 'either in the data option, or for class-based components, by ' + 67702 'initializing the property. ' + 67703 'See: https://vuejs.org/v2/guide/reactivity.html#Declaring-Reactive-Properties.', 67704 target 67705 ); 67706 }; 67707 67708 var warnReservedPrefix = function (target, key) { 67709 warn( 67710 "Property \"" + key + "\" must be accessed with \"$data." + key + "\" because " + 67711 'properties starting with "$" or "_" are not proxied in the Vue instance to ' + 67712 'prevent conflicts with Vue internals. ' + 67713 'See: https://vuejs.org/v2/api/#data', 67714 target 67715 ); 67716 }; 67717 67718 var hasProxy = 67719 typeof Proxy !== 'undefined' && isNative(Proxy); 67720 67721 if (hasProxy) { 67722 var isBuiltInModifier = makeMap('stop,prevent,self,ctrl,shift,alt,meta,exact'); 67723 config.keyCodes = new Proxy(config.keyCodes, { 67724 set: function set (target, key, value) { 67725 if (isBuiltInModifier(key)) { 67726 warn(("Avoid overwriting built-in modifier in config.keyCodes: ." + key)); 67727 return false 67728 } else { 67729 target[key] = value; 67730 return true 67731 } 67732 } 67733 }); 67734 } 67735 67736 var hasHandler = { 67737 has: function has (target, key) { 67738 var has = key in target; 67739 var isAllowed = allowedGlobals(key) || 67740 (typeof key === 'string' && key.charAt(0) === '_' && !(key in target.$data)); 67741 if (!has && !isAllowed) { 67742 if (key in target.$data) { warnReservedPrefix(target, key); } 67743 else { warnNonPresent(target, key); } 67744 } 67745 return has || !isAllowed 67746 } 67747 }; 67748 67749 var getHandler = { 67750 get: function get (target, key) { 67751 if (typeof key === 'string' && !(key in target)) { 67752 if (key in target.$data) { warnReservedPrefix(target, key); } 67753 else { warnNonPresent(target, key); } 67754 } 67755 return target[key] 67756 } 67757 }; 67758 67759 initProxy = function initProxy (vm) { 67760 if (hasProxy) { 67761 // determine which proxy handler to use 67762 var options = vm.$options; 67763 var handlers = options.render && options.render._withStripped 67764 ? getHandler 67765 : hasHandler; 67766 vm._renderProxy = new Proxy(vm, handlers); 67767 } else { 67768 vm._renderProxy = vm; 67769 } 67770 }; 67771} 67772 67773/* */ 67774 67775var seenObjects = new _Set(); 67776 67777/** 67778 * Recursively traverse an object to evoke all converted 67779 * getters, so that every nested property inside the object 67780 * is collected as a "deep" dependency. 67781 */ 67782function traverse (val) { 67783 _traverse(val, seenObjects); 67784 seenObjects.clear(); 67785} 67786 67787function _traverse (val, seen) { 67788 var i, keys; 67789 var isA = Array.isArray(val); 67790 if ((!isA && !isObject(val)) || Object.isFrozen(val) || val instanceof VNode) { 67791 return 67792 } 67793 if (val.__ob__) { 67794 var depId = val.__ob__.dep.id; 67795 if (seen.has(depId)) { 67796 return 67797 } 67798 seen.add(depId); 67799 } 67800 if (isA) { 67801 i = val.length; 67802 while (i--) { _traverse(val[i], seen); } 67803 } else { 67804 keys = Object.keys(val); 67805 i = keys.length; 67806 while (i--) { _traverse(val[keys[i]], seen); } 67807 } 67808} 67809 67810/* */ 67811 67812var normalizeEvent = cached(function (name) { 67813 var passive = name.charAt(0) === '&'; 67814 name = passive ? name.slice(1) : name; 67815 var once$$1 = name.charAt(0) === '~'; // Prefixed last, checked first 67816 name = once$$1 ? name.slice(1) : name; 67817 var capture = name.charAt(0) === '!'; 67818 name = capture ? name.slice(1) : name; 67819 return { 67820 name: name, 67821 once: once$$1, 67822 capture: capture, 67823 passive: passive 67824 } 67825}); 67826 67827function createFnInvoker (fns, vm) { 67828 function invoker () { 67829 var arguments$1 = arguments; 67830 67831 var fns = invoker.fns; 67832 if (Array.isArray(fns)) { 67833 var cloned = fns.slice(); 67834 for (var i = 0; i < cloned.length; i++) { 67835 invokeWithErrorHandling(cloned[i], null, arguments$1, vm, "v-on handler"); 67836 } 67837 } else { 67838 // return handler return value for single handlers 67839 return invokeWithErrorHandling(fns, null, arguments, vm, "v-on handler") 67840 } 67841 } 67842 invoker.fns = fns; 67843 return invoker 67844} 67845 67846function updateListeners ( 67847 on, 67848 oldOn, 67849 add, 67850 remove$$1, 67851 createOnceHandler, 67852 vm 67853) { 67854 var name, def$$1, cur, old, event; 67855 for (name in on) { 67856 def$$1 = cur = on[name]; 67857 old = oldOn[name]; 67858 event = normalizeEvent(name); 67859 if (isUndef(cur)) { 67860 warn( 67861 "Invalid handler for event \"" + (event.name) + "\": got " + String(cur), 67862 vm 67863 ); 67864 } else if (isUndef(old)) { 67865 if (isUndef(cur.fns)) { 67866 cur = on[name] = createFnInvoker(cur, vm); 67867 } 67868 if (isTrue(event.once)) { 67869 cur = on[name] = createOnceHandler(event.name, cur, event.capture); 67870 } 67871 add(event.name, cur, event.capture, event.passive, event.params); 67872 } else if (cur !== old) { 67873 old.fns = cur; 67874 on[name] = old; 67875 } 67876 } 67877 for (name in oldOn) { 67878 if (isUndef(on[name])) { 67879 event = normalizeEvent(name); 67880 remove$$1(event.name, oldOn[name], event.capture); 67881 } 67882 } 67883} 67884 67885/* */ 67886 67887function mergeVNodeHook (def, hookKey, hook) { 67888 if (def instanceof VNode) { 67889 def = def.data.hook || (def.data.hook = {}); 67890 } 67891 var invoker; 67892 var oldHook = def[hookKey]; 67893 67894 function wrappedHook () { 67895 hook.apply(this, arguments); 67896 // important: remove merged hook to ensure it's called only once 67897 // and prevent memory leak 67898 remove(invoker.fns, wrappedHook); 67899 } 67900 67901 if (isUndef(oldHook)) { 67902 // no existing hook 67903 invoker = createFnInvoker([wrappedHook]); 67904 } else { 67905 /* istanbul ignore if */ 67906 if (isDef(oldHook.fns) && isTrue(oldHook.merged)) { 67907 // already a merged invoker 67908 invoker = oldHook; 67909 invoker.fns.push(wrappedHook); 67910 } else { 67911 // existing plain hook 67912 invoker = createFnInvoker([oldHook, wrappedHook]); 67913 } 67914 } 67915 67916 invoker.merged = true; 67917 def[hookKey] = invoker; 67918} 67919 67920/* */ 67921 67922function extractPropsFromVNodeData ( 67923 data, 67924 Ctor, 67925 tag 67926) { 67927 // we are only extracting raw values here. 67928 // validation and default values are handled in the child 67929 // component itself. 67930 var propOptions = Ctor.options.props; 67931 if (isUndef(propOptions)) { 67932 return 67933 } 67934 var res = {}; 67935 var attrs = data.attrs; 67936 var props = data.props; 67937 if (isDef(attrs) || isDef(props)) { 67938 for (var key in propOptions) { 67939 var altKey = hyphenate(key); 67940 { 67941 var keyInLowerCase = key.toLowerCase(); 67942 if ( 67943 key !== keyInLowerCase && 67944 attrs && hasOwn(attrs, keyInLowerCase) 67945 ) { 67946 tip( 67947 "Prop \"" + keyInLowerCase + "\" is passed to component " + 67948 (formatComponentName(tag || Ctor)) + ", but the declared prop name is" + 67949 " \"" + key + "\". " + 67950 "Note that HTML attributes are case-insensitive and camelCased " + 67951 "props need to use their kebab-case equivalents when using in-DOM " + 67952 "templates. You should probably use \"" + altKey + "\" instead of \"" + key + "\"." 67953 ); 67954 } 67955 } 67956 checkProp(res, props, key, altKey, true) || 67957 checkProp(res, attrs, key, altKey, false); 67958 } 67959 } 67960 return res 67961} 67962 67963function checkProp ( 67964 res, 67965 hash, 67966 key, 67967 altKey, 67968 preserve 67969) { 67970 if (isDef(hash)) { 67971 if (hasOwn(hash, key)) { 67972 res[key] = hash[key]; 67973 if (!preserve) { 67974 delete hash[key]; 67975 } 67976 return true 67977 } else if (hasOwn(hash, altKey)) { 67978 res[key] = hash[altKey]; 67979 if (!preserve) { 67980 delete hash[altKey]; 67981 } 67982 return true 67983 } 67984 } 67985 return false 67986} 67987 67988/* */ 67989 67990// The template compiler attempts to minimize the need for normalization by 67991// statically analyzing the template at compile time. 67992// 67993// For plain HTML markup, normalization can be completely skipped because the 67994// generated render function is guaranteed to return Array<VNode>. There are 67995// two cases where extra normalization is needed: 67996 67997// 1. When the children contains components - because a functional component 67998// may return an Array instead of a single root. In this case, just a simple 67999// normalization is needed - if any child is an Array, we flatten the whole 68000// thing with Array.prototype.concat. It is guaranteed to be only 1-level deep 68001// because functional components already normalize their own children. 68002function simpleNormalizeChildren (children) { 68003 for (var i = 0; i < children.length; i++) { 68004 if (Array.isArray(children[i])) { 68005 return Array.prototype.concat.apply([], children) 68006 } 68007 } 68008 return children 68009} 68010 68011// 2. When the children contains constructs that always generated nested Arrays, 68012// e.g. <template>, <slot>, v-for, or when the children is provided by user 68013// with hand-written render functions / JSX. In such cases a full normalization 68014// is needed to cater to all possible types of children values. 68015function normalizeChildren (children) { 68016 return isPrimitive(children) 68017 ? [createTextVNode(children)] 68018 : Array.isArray(children) 68019 ? normalizeArrayChildren(children) 68020 : undefined 68021} 68022 68023function isTextNode (node) { 68024 return isDef(node) && isDef(node.text) && isFalse(node.isComment) 68025} 68026 68027function normalizeArrayChildren (children, nestedIndex) { 68028 var res = []; 68029 var i, c, lastIndex, last; 68030 for (i = 0; i < children.length; i++) { 68031 c = children[i]; 68032 if (isUndef(c) || typeof c === 'boolean') { continue } 68033 lastIndex = res.length - 1; 68034 last = res[lastIndex]; 68035 // nested 68036 if (Array.isArray(c)) { 68037 if (c.length > 0) { 68038 c = normalizeArrayChildren(c, ((nestedIndex || '') + "_" + i)); 68039 // merge adjacent text nodes 68040 if (isTextNode(c[0]) && isTextNode(last)) { 68041 res[lastIndex] = createTextVNode(last.text + (c[0]).text); 68042 c.shift(); 68043 } 68044 res.push.apply(res, c); 68045 } 68046 } else if (isPrimitive(c)) { 68047 if (isTextNode(last)) { 68048 // merge adjacent text nodes 68049 // this is necessary for SSR hydration because text nodes are 68050 // essentially merged when rendered to HTML strings 68051 res[lastIndex] = createTextVNode(last.text + c); 68052 } else if (c !== '') { 68053 // convert primitive to vnode 68054 res.push(createTextVNode(c)); 68055 } 68056 } else { 68057 if (isTextNode(c) && isTextNode(last)) { 68058 // merge adjacent text nodes 68059 res[lastIndex] = createTextVNode(last.text + c.text); 68060 } else { 68061 // default key for nested array children (likely generated by v-for) 68062 if (isTrue(children._isVList) && 68063 isDef(c.tag) && 68064 isUndef(c.key) && 68065 isDef(nestedIndex)) { 68066 c.key = "__vlist" + nestedIndex + "_" + i + "__"; 68067 } 68068 res.push(c); 68069 } 68070 } 68071 } 68072 return res 68073} 68074 68075/* */ 68076 68077function initProvide (vm) { 68078 var provide = vm.$options.provide; 68079 if (provide) { 68080 vm._provided = typeof provide === 'function' 68081 ? provide.call(vm) 68082 : provide; 68083 } 68084} 68085 68086function initInjections (vm) { 68087 var result = resolveInject(vm.$options.inject, vm); 68088 if (result) { 68089 toggleObserving(false); 68090 Object.keys(result).forEach(function (key) { 68091 /* istanbul ignore else */ 68092 { 68093 defineReactive$$1(vm, key, result[key], function () { 68094 warn( 68095 "Avoid mutating an injected value directly since the changes will be " + 68096 "overwritten whenever the provided component re-renders. " + 68097 "injection being mutated: \"" + key + "\"", 68098 vm 68099 ); 68100 }); 68101 } 68102 }); 68103 toggleObserving(true); 68104 } 68105} 68106 68107function resolveInject (inject, vm) { 68108 if (inject) { 68109 // inject is :any because flow is not smart enough to figure out cached 68110 var result = Object.create(null); 68111 var keys = hasSymbol 68112 ? Reflect.ownKeys(inject) 68113 : Object.keys(inject); 68114 68115 for (var i = 0; i < keys.length; i++) { 68116 var key = keys[i]; 68117 // #6574 in case the inject object is observed... 68118 if (key === '__ob__') { continue } 68119 var provideKey = inject[key].from; 68120 var source = vm; 68121 while (source) { 68122 if (source._provided && hasOwn(source._provided, provideKey)) { 68123 result[key] = source._provided[provideKey]; 68124 break 68125 } 68126 source = source.$parent; 68127 } 68128 if (!source) { 68129 if ('default' in inject[key]) { 68130 var provideDefault = inject[key].default; 68131 result[key] = typeof provideDefault === 'function' 68132 ? provideDefault.call(vm) 68133 : provideDefault; 68134 } else { 68135 warn(("Injection \"" + key + "\" not found"), vm); 68136 } 68137 } 68138 } 68139 return result 68140 } 68141} 68142 68143/* */ 68144 68145 68146 68147/** 68148 * Runtime helper for resolving raw children VNodes into a slot object. 68149 */ 68150function resolveSlots ( 68151 children, 68152 context 68153) { 68154 if (!children || !children.length) { 68155 return {} 68156 } 68157 var slots = {}; 68158 for (var i = 0, l = children.length; i < l; i++) { 68159 var child = children[i]; 68160 var data = child.data; 68161 // remove slot attribute if the node is resolved as a Vue slot node 68162 if (data && data.attrs && data.attrs.slot) { 68163 delete data.attrs.slot; 68164 } 68165 // named slots should only be respected if the vnode was rendered in the 68166 // same context. 68167 if ((child.context === context || child.fnContext === context) && 68168 data && data.slot != null 68169 ) { 68170 var name = data.slot; 68171 var slot = (slots[name] || (slots[name] = [])); 68172 if (child.tag === 'template') { 68173 slot.push.apply(slot, child.children || []); 68174 } else { 68175 slot.push(child); 68176 } 68177 } else { 68178 (slots.default || (slots.default = [])).push(child); 68179 } 68180 } 68181 // ignore slots that contains only whitespace 68182 for (var name$1 in slots) { 68183 if (slots[name$1].every(isWhitespace)) { 68184 delete slots[name$1]; 68185 } 68186 } 68187 return slots 68188} 68189 68190function isWhitespace (node) { 68191 return (node.isComment && !node.asyncFactory) || node.text === ' ' 68192} 68193 68194/* */ 68195 68196function isAsyncPlaceholder (node) { 68197 return node.isComment && node.asyncFactory 68198} 68199 68200/* */ 68201 68202function normalizeScopedSlots ( 68203 slots, 68204 normalSlots, 68205 prevSlots 68206) { 68207 var res; 68208 var hasNormalSlots = Object.keys(normalSlots).length > 0; 68209 var isStable = slots ? !!slots.$stable : !hasNormalSlots; 68210 var key = slots && slots.$key; 68211 if (!slots) { 68212 res = {}; 68213 } else if (slots._normalized) { 68214 // fast path 1: child component re-render only, parent did not change 68215 return slots._normalized 68216 } else if ( 68217 isStable && 68218 prevSlots && 68219 prevSlots !== emptyObject && 68220 key === prevSlots.$key && 68221 !hasNormalSlots && 68222 !prevSlots.$hasNormal 68223 ) { 68224 // fast path 2: stable scoped slots w/ no normal slots to proxy, 68225 // only need to normalize once 68226 return prevSlots 68227 } else { 68228 res = {}; 68229 for (var key$1 in slots) { 68230 if (slots[key$1] && key$1[0] !== '$') { 68231 res[key$1] = normalizeScopedSlot(normalSlots, key$1, slots[key$1]); 68232 } 68233 } 68234 } 68235 // expose normal slots on scopedSlots 68236 for (var key$2 in normalSlots) { 68237 if (!(key$2 in res)) { 68238 res[key$2] = proxyNormalSlot(normalSlots, key$2); 68239 } 68240 } 68241 // avoriaz seems to mock a non-extensible $scopedSlots object 68242 // and when that is passed down this would cause an error 68243 if (slots && Object.isExtensible(slots)) { 68244 (slots)._normalized = res; 68245 } 68246 def(res, '$stable', isStable); 68247 def(res, '$key', key); 68248 def(res, '$hasNormal', hasNormalSlots); 68249 return res 68250} 68251 68252function normalizeScopedSlot(normalSlots, key, fn) { 68253 var normalized = function () { 68254 var res = arguments.length ? fn.apply(null, arguments) : fn({}); 68255 res = res && typeof res === 'object' && !Array.isArray(res) 68256 ? [res] // single vnode 68257 : normalizeChildren(res); 68258 var vnode = res && res[0]; 68259 return res && ( 68260 !vnode || 68261 (res.length === 1 && vnode.isComment && !isAsyncPlaceholder(vnode)) // #9658, #10391 68262 ) ? undefined 68263 : res 68264 }; 68265 // this is a slot using the new v-slot syntax without scope. although it is 68266 // compiled as a scoped slot, render fn users would expect it to be present 68267 // on this.$slots because the usage is semantically a normal slot. 68268 if (fn.proxy) { 68269 Object.defineProperty(normalSlots, key, { 68270 get: normalized, 68271 enumerable: true, 68272 configurable: true 68273 }); 68274 } 68275 return normalized 68276} 68277 68278function proxyNormalSlot(slots, key) { 68279 return function () { return slots[key]; } 68280} 68281 68282/* */ 68283 68284/** 68285 * Runtime helper for rendering v-for lists. 68286 */ 68287function renderList ( 68288 val, 68289 render 68290) { 68291 var ret, i, l, keys, key; 68292 if (Array.isArray(val) || typeof val === 'string') { 68293 ret = new Array(val.length); 68294 for (i = 0, l = val.length; i < l; i++) { 68295 ret[i] = render(val[i], i); 68296 } 68297 } else if (typeof val === 'number') { 68298 ret = new Array(val); 68299 for (i = 0; i < val; i++) { 68300 ret[i] = render(i + 1, i); 68301 } 68302 } else if (isObject(val)) { 68303 if (hasSymbol && val[Symbol.iterator]) { 68304 ret = []; 68305 var iterator = val[Symbol.iterator](); 68306 var result = iterator.next(); 68307 while (!result.done) { 68308 ret.push(render(result.value, ret.length)); 68309 result = iterator.next(); 68310 } 68311 } else { 68312 keys = Object.keys(val); 68313 ret = new Array(keys.length); 68314 for (i = 0, l = keys.length; i < l; i++) { 68315 key = keys[i]; 68316 ret[i] = render(val[key], key, i); 68317 } 68318 } 68319 } 68320 if (!isDef(ret)) { 68321 ret = []; 68322 } 68323 (ret)._isVList = true; 68324 return ret 68325} 68326 68327/* */ 68328 68329/** 68330 * Runtime helper for rendering <slot> 68331 */ 68332function renderSlot ( 68333 name, 68334 fallbackRender, 68335 props, 68336 bindObject 68337) { 68338 var scopedSlotFn = this.$scopedSlots[name]; 68339 var nodes; 68340 if (scopedSlotFn) { 68341 // scoped slot 68342 props = props || {}; 68343 if (bindObject) { 68344 if (!isObject(bindObject)) { 68345 warn('slot v-bind without argument expects an Object', this); 68346 } 68347 props = extend(extend({}, bindObject), props); 68348 } 68349 nodes = 68350 scopedSlotFn(props) || 68351 (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender); 68352 } else { 68353 nodes = 68354 this.$slots[name] || 68355 (typeof fallbackRender === 'function' ? fallbackRender() : fallbackRender); 68356 } 68357 68358 var target = props && props.slot; 68359 if (target) { 68360 return this.$createElement('template', { slot: target }, nodes) 68361 } else { 68362 return nodes 68363 } 68364} 68365 68366/* */ 68367 68368/** 68369 * Runtime helper for resolving filters 68370 */ 68371function resolveFilter (id) { 68372 return resolveAsset(this.$options, 'filters', id, true) || identity 68373} 68374 68375/* */ 68376 68377function isKeyNotMatch (expect, actual) { 68378 if (Array.isArray(expect)) { 68379 return expect.indexOf(actual) === -1 68380 } else { 68381 return expect !== actual 68382 } 68383} 68384 68385/** 68386 * Runtime helper for checking keyCodes from config. 68387 * exposed as Vue.prototype._k 68388 * passing in eventKeyName as last argument separately for backwards compat 68389 */ 68390function checkKeyCodes ( 68391 eventKeyCode, 68392 key, 68393 builtInKeyCode, 68394 eventKeyName, 68395 builtInKeyName 68396) { 68397 var mappedKeyCode = config.keyCodes[key] || builtInKeyCode; 68398 if (builtInKeyName && eventKeyName && !config.keyCodes[key]) { 68399 return isKeyNotMatch(builtInKeyName, eventKeyName) 68400 } else if (mappedKeyCode) { 68401 return isKeyNotMatch(mappedKeyCode, eventKeyCode) 68402 } else if (eventKeyName) { 68403 return hyphenate(eventKeyName) !== key 68404 } 68405 return eventKeyCode === undefined 68406} 68407 68408/* */ 68409 68410/** 68411 * Runtime helper for merging v-bind="object" into a VNode's data. 68412 */ 68413function bindObjectProps ( 68414 data, 68415 tag, 68416 value, 68417 asProp, 68418 isSync 68419) { 68420 if (value) { 68421 if (!isObject(value)) { 68422 warn( 68423 'v-bind without argument expects an Object or Array value', 68424 this 68425 ); 68426 } else { 68427 if (Array.isArray(value)) { 68428 value = toObject(value); 68429 } 68430 var hash; 68431 var loop = function ( key ) { 68432 if ( 68433 key === 'class' || 68434 key === 'style' || 68435 isReservedAttribute(key) 68436 ) { 68437 hash = data; 68438 } else { 68439 var type = data.attrs && data.attrs.type; 68440 hash = asProp || config.mustUseProp(tag, type, key) 68441 ? data.domProps || (data.domProps = {}) 68442 : data.attrs || (data.attrs = {}); 68443 } 68444 var camelizedKey = camelize(key); 68445 var hyphenatedKey = hyphenate(key); 68446 if (!(camelizedKey in hash) && !(hyphenatedKey in hash)) { 68447 hash[key] = value[key]; 68448 68449 if (isSync) { 68450 var on = data.on || (data.on = {}); 68451 on[("update:" + key)] = function ($event) { 68452 value[key] = $event; 68453 }; 68454 } 68455 } 68456 }; 68457 68458 for (var key in value) loop( key ); 68459 } 68460 } 68461 return data 68462} 68463 68464/* */ 68465 68466/** 68467 * Runtime helper for rendering static trees. 68468 */ 68469function renderStatic ( 68470 index, 68471 isInFor 68472) { 68473 var cached = this._staticTrees || (this._staticTrees = []); 68474 var tree = cached[index]; 68475 // if has already-rendered static tree and not inside v-for, 68476 // we can reuse the same tree. 68477 if (tree && !isInFor) { 68478 return tree 68479 } 68480 // otherwise, render a fresh tree. 68481 tree = cached[index] = this.$options.staticRenderFns[index].call( 68482 this._renderProxy, 68483 null, 68484 this // for render fns generated for functional component templates 68485 ); 68486 markStatic(tree, ("__static__" + index), false); 68487 return tree 68488} 68489 68490/** 68491 * Runtime helper for v-once. 68492 * Effectively it means marking the node as static with a unique key. 68493 */ 68494function markOnce ( 68495 tree, 68496 index, 68497 key 68498) { 68499 markStatic(tree, ("__once__" + index + (key ? ("_" + key) : "")), true); 68500 return tree 68501} 68502 68503function markStatic ( 68504 tree, 68505 key, 68506 isOnce 68507) { 68508 if (Array.isArray(tree)) { 68509 for (var i = 0; i < tree.length; i++) { 68510 if (tree[i] && typeof tree[i] !== 'string') { 68511 markStaticNode(tree[i], (key + "_" + i), isOnce); 68512 } 68513 } 68514 } else { 68515 markStaticNode(tree, key, isOnce); 68516 } 68517} 68518 68519function markStaticNode (node, key, isOnce) { 68520 node.isStatic = true; 68521 node.key = key; 68522 node.isOnce = isOnce; 68523} 68524 68525/* */ 68526 68527function bindObjectListeners (data, value) { 68528 if (value) { 68529 if (!isPlainObject(value)) { 68530 warn( 68531 'v-on without argument expects an Object value', 68532 this 68533 ); 68534 } else { 68535 var on = data.on = data.on ? extend({}, data.on) : {}; 68536 for (var key in value) { 68537 var existing = on[key]; 68538 var ours = value[key]; 68539 on[key] = existing ? [].concat(existing, ours) : ours; 68540 } 68541 } 68542 } 68543 return data 68544} 68545 68546/* */ 68547 68548function resolveScopedSlots ( 68549 fns, // see flow/vnode 68550 res, 68551 // the following are added in 2.6 68552 hasDynamicKeys, 68553 contentHashKey 68554) { 68555 res = res || { $stable: !hasDynamicKeys }; 68556 for (var i = 0; i < fns.length; i++) { 68557 var slot = fns[i]; 68558 if (Array.isArray(slot)) { 68559 resolveScopedSlots(slot, res, hasDynamicKeys); 68560 } else if (slot) { 68561 // marker for reverse proxying v-slot without scope on this.$slots 68562 if (slot.proxy) { 68563 slot.fn.proxy = true; 68564 } 68565 res[slot.key] = slot.fn; 68566 } 68567 } 68568 if (contentHashKey) { 68569 (res).$key = contentHashKey; 68570 } 68571 return res 68572} 68573 68574/* */ 68575 68576function bindDynamicKeys (baseObj, values) { 68577 for (var i = 0; i < values.length; i += 2) { 68578 var key = values[i]; 68579 if (typeof key === 'string' && key) { 68580 baseObj[values[i]] = values[i + 1]; 68581 } else if (key !== '' && key !== null) { 68582 // null is a special value for explicitly removing a binding 68583 warn( 68584 ("Invalid value for dynamic directive argument (expected string or null): " + key), 68585 this 68586 ); 68587 } 68588 } 68589 return baseObj 68590} 68591 68592// helper to dynamically append modifier runtime markers to event names. 68593// ensure only append when value is already string, otherwise it will be cast 68594// to string and cause the type check to miss. 68595function prependModifier (value, symbol) { 68596 return typeof value === 'string' ? symbol + value : value 68597} 68598 68599/* */ 68600 68601function installRenderHelpers (target) { 68602 target._o = markOnce; 68603 target._n = toNumber; 68604 target._s = toString; 68605 target._l = renderList; 68606 target._t = renderSlot; 68607 target._q = looseEqual; 68608 target._i = looseIndexOf; 68609 target._m = renderStatic; 68610 target._f = resolveFilter; 68611 target._k = checkKeyCodes; 68612 target._b = bindObjectProps; 68613 target._v = createTextVNode; 68614 target._e = createEmptyVNode; 68615 target._u = resolveScopedSlots; 68616 target._g = bindObjectListeners; 68617 target._d = bindDynamicKeys; 68618 target._p = prependModifier; 68619} 68620 68621/* */ 68622 68623function FunctionalRenderContext ( 68624 data, 68625 props, 68626 children, 68627 parent, 68628 Ctor 68629) { 68630 var this$1 = this; 68631 68632 var options = Ctor.options; 68633 // ensure the createElement function in functional components 68634 // gets a unique context - this is necessary for correct named slot check 68635 var contextVm; 68636 if (hasOwn(parent, '_uid')) { 68637 contextVm = Object.create(parent); 68638 // $flow-disable-line 68639 contextVm._original = parent; 68640 } else { 68641 // the context vm passed in is a functional context as well. 68642 // in this case we want to make sure we are able to get a hold to the 68643 // real context instance. 68644 contextVm = parent; 68645 // $flow-disable-line 68646 parent = parent._original; 68647 } 68648 var isCompiled = isTrue(options._compiled); 68649 var needNormalization = !isCompiled; 68650 68651 this.data = data; 68652 this.props = props; 68653 this.children = children; 68654 this.parent = parent; 68655 this.listeners = data.on || emptyObject; 68656 this.injections = resolveInject(options.inject, parent); 68657 this.slots = function () { 68658 if (!this$1.$slots) { 68659 normalizeScopedSlots( 68660 data.scopedSlots, 68661 this$1.$slots = resolveSlots(children, parent) 68662 ); 68663 } 68664 return this$1.$slots 68665 }; 68666 68667 Object.defineProperty(this, 'scopedSlots', ({ 68668 enumerable: true, 68669 get: function get () { 68670 return normalizeScopedSlots(data.scopedSlots, this.slots()) 68671 } 68672 })); 68673 68674 // support for compiled functional template 68675 if (isCompiled) { 68676 // exposing $options for renderStatic() 68677 this.$options = options; 68678 // pre-resolve slots for renderSlot() 68679 this.$slots = this.slots(); 68680 this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots); 68681 } 68682 68683 if (options._scopeId) { 68684 this._c = function (a, b, c, d) { 68685 var vnode = createElement(contextVm, a, b, c, d, needNormalization); 68686 if (vnode && !Array.isArray(vnode)) { 68687 vnode.fnScopeId = options._scopeId; 68688 vnode.fnContext = parent; 68689 } 68690 return vnode 68691 }; 68692 } else { 68693 this._c = function (a, b, c, d) { return createElement(contextVm, a, b, c, d, needNormalization); }; 68694 } 68695} 68696 68697installRenderHelpers(FunctionalRenderContext.prototype); 68698 68699function createFunctionalComponent ( 68700 Ctor, 68701 propsData, 68702 data, 68703 contextVm, 68704 children 68705) { 68706 var options = Ctor.options; 68707 var props = {}; 68708 var propOptions = options.props; 68709 if (isDef(propOptions)) { 68710 for (var key in propOptions) { 68711 props[key] = validateProp(key, propOptions, propsData || emptyObject); 68712 } 68713 } else { 68714 if (isDef(data.attrs)) { mergeProps(props, data.attrs); } 68715 if (isDef(data.props)) { mergeProps(props, data.props); } 68716 } 68717 68718 var renderContext = new FunctionalRenderContext( 68719 data, 68720 props, 68721 children, 68722 contextVm, 68723 Ctor 68724 ); 68725 68726 var vnode = options.render.call(null, renderContext._c, renderContext); 68727 68728 if (vnode instanceof VNode) { 68729 return cloneAndMarkFunctionalResult(vnode, data, renderContext.parent, options, renderContext) 68730 } else if (Array.isArray(vnode)) { 68731 var vnodes = normalizeChildren(vnode) || []; 68732 var res = new Array(vnodes.length); 68733 for (var i = 0; i < vnodes.length; i++) { 68734 res[i] = cloneAndMarkFunctionalResult(vnodes[i], data, renderContext.parent, options, renderContext); 68735 } 68736 return res 68737 } 68738} 68739 68740function cloneAndMarkFunctionalResult (vnode, data, contextVm, options, renderContext) { 68741 // #7817 clone node before setting fnContext, otherwise if the node is reused 68742 // (e.g. it was from a cached normal slot) the fnContext causes named slots 68743 // that should not be matched to match. 68744 var clone = cloneVNode(vnode); 68745 clone.fnContext = contextVm; 68746 clone.fnOptions = options; 68747 { 68748 (clone.devtoolsMeta = clone.devtoolsMeta || {}).renderContext = renderContext; 68749 } 68750 if (data.slot) { 68751 (clone.data || (clone.data = {})).slot = data.slot; 68752 } 68753 return clone 68754} 68755 68756function mergeProps (to, from) { 68757 for (var key in from) { 68758 to[camelize(key)] = from[key]; 68759 } 68760} 68761 68762/* */ 68763 68764/* */ 68765 68766/* */ 68767 68768/* */ 68769 68770// inline hooks to be invoked on component VNodes during patch 68771var componentVNodeHooks = { 68772 init: function init (vnode, hydrating) { 68773 if ( 68774 vnode.componentInstance && 68775 !vnode.componentInstance._isDestroyed && 68776 vnode.data.keepAlive 68777 ) { 68778 // kept-alive components, treat as a patch 68779 var mountedNode = vnode; // work around flow 68780 componentVNodeHooks.prepatch(mountedNode, mountedNode); 68781 } else { 68782 var child = vnode.componentInstance = createComponentInstanceForVnode( 68783 vnode, 68784 activeInstance 68785 ); 68786 child.$mount(hydrating ? vnode.elm : undefined, hydrating); 68787 } 68788 }, 68789 68790 prepatch: function prepatch (oldVnode, vnode) { 68791 var options = vnode.componentOptions; 68792 var child = vnode.componentInstance = oldVnode.componentInstance; 68793 updateChildComponent( 68794 child, 68795 options.propsData, // updated props 68796 options.listeners, // updated listeners 68797 vnode, // new parent vnode 68798 options.children // new children 68799 ); 68800 }, 68801 68802 insert: function insert (vnode) { 68803 var context = vnode.context; 68804 var componentInstance = vnode.componentInstance; 68805 if (!componentInstance._isMounted) { 68806 componentInstance._isMounted = true; 68807 callHook(componentInstance, 'mounted'); 68808 } 68809 if (vnode.data.keepAlive) { 68810 if (context._isMounted) { 68811 // vue-router#1212 68812 // During updates, a kept-alive component's child components may 68813 // change, so directly walking the tree here may call activated hooks 68814 // on incorrect children. Instead we push them into a queue which will 68815 // be processed after the whole patch process ended. 68816 queueActivatedComponent(componentInstance); 68817 } else { 68818 activateChildComponent(componentInstance, true /* direct */); 68819 } 68820 } 68821 }, 68822 68823 destroy: function destroy (vnode) { 68824 var componentInstance = vnode.componentInstance; 68825 if (!componentInstance._isDestroyed) { 68826 if (!vnode.data.keepAlive) { 68827 componentInstance.$destroy(); 68828 } else { 68829 deactivateChildComponent(componentInstance, true /* direct */); 68830 } 68831 } 68832 } 68833}; 68834 68835var hooksToMerge = Object.keys(componentVNodeHooks); 68836 68837function createComponent ( 68838 Ctor, 68839 data, 68840 context, 68841 children, 68842 tag 68843) { 68844 if (isUndef(Ctor)) { 68845 return 68846 } 68847 68848 var baseCtor = context.$options._base; 68849 68850 // plain options object: turn it into a constructor 68851 if (isObject(Ctor)) { 68852 Ctor = baseCtor.extend(Ctor); 68853 } 68854 68855 // if at this stage it's not a constructor or an async component factory, 68856 // reject. 68857 if (typeof Ctor !== 'function') { 68858 { 68859 warn(("Invalid Component definition: " + (String(Ctor))), context); 68860 } 68861 return 68862 } 68863 68864 // async component 68865 var asyncFactory; 68866 if (isUndef(Ctor.cid)) { 68867 asyncFactory = Ctor; 68868 Ctor = resolveAsyncComponent(asyncFactory, baseCtor); 68869 if (Ctor === undefined) { 68870 // return a placeholder node for async component, which is rendered 68871 // as a comment node but preserves all the raw information for the node. 68872 // the information will be used for async server-rendering and hydration. 68873 return createAsyncPlaceholder( 68874 asyncFactory, 68875 data, 68876 context, 68877 children, 68878 tag 68879 ) 68880 } 68881 } 68882 68883 data = data || {}; 68884 68885 // resolve constructor options in case global mixins are applied after 68886 // component constructor creation 68887 resolveConstructorOptions(Ctor); 68888 68889 // transform component v-model data into props & events 68890 if (isDef(data.model)) { 68891 transformModel(Ctor.options, data); 68892 } 68893 68894 // extract props 68895 var propsData = extractPropsFromVNodeData(data, Ctor, tag); 68896 68897 // functional component 68898 if (isTrue(Ctor.options.functional)) { 68899 return createFunctionalComponent(Ctor, propsData, data, context, children) 68900 } 68901 68902 // extract listeners, since these needs to be treated as 68903 // child component listeners instead of DOM listeners 68904 var listeners = data.on; 68905 // replace with listeners with .native modifier 68906 // so it gets processed during parent component patch. 68907 data.on = data.nativeOn; 68908 68909 if (isTrue(Ctor.options.abstract)) { 68910 // abstract components do not keep anything 68911 // other than props & listeners & slot 68912 68913 // work around flow 68914 var slot = data.slot; 68915 data = {}; 68916 if (slot) { 68917 data.slot = slot; 68918 } 68919 } 68920 68921 // install component management hooks onto the placeholder node 68922 installComponentHooks(data); 68923 68924 // return a placeholder vnode 68925 var name = Ctor.options.name || tag; 68926 var vnode = new VNode( 68927 ("vue-component-" + (Ctor.cid) + (name ? ("-" + name) : '')), 68928 data, undefined, undefined, undefined, context, 68929 { Ctor: Ctor, propsData: propsData, listeners: listeners, tag: tag, children: children }, 68930 asyncFactory 68931 ); 68932 68933 return vnode 68934} 68935 68936function createComponentInstanceForVnode ( 68937 // we know it's MountedComponentVNode but flow doesn't 68938 vnode, 68939 // activeInstance in lifecycle state 68940 parent 68941) { 68942 var options = { 68943 _isComponent: true, 68944 _parentVnode: vnode, 68945 parent: parent 68946 }; 68947 // check inline-template render functions 68948 var inlineTemplate = vnode.data.inlineTemplate; 68949 if (isDef(inlineTemplate)) { 68950 options.render = inlineTemplate.render; 68951 options.staticRenderFns = inlineTemplate.staticRenderFns; 68952 } 68953 return new vnode.componentOptions.Ctor(options) 68954} 68955 68956function installComponentHooks (data) { 68957 var hooks = data.hook || (data.hook = {}); 68958 for (var i = 0; i < hooksToMerge.length; i++) { 68959 var key = hooksToMerge[i]; 68960 var existing = hooks[key]; 68961 var toMerge = componentVNodeHooks[key]; 68962 if (existing !== toMerge && !(existing && existing._merged)) { 68963 hooks[key] = existing ? mergeHook$1(toMerge, existing) : toMerge; 68964 } 68965 } 68966} 68967 68968function mergeHook$1 (f1, f2) { 68969 var merged = function (a, b) { 68970 // flow complains about extra args which is why we use any 68971 f1(a, b); 68972 f2(a, b); 68973 }; 68974 merged._merged = true; 68975 return merged 68976} 68977 68978// transform component v-model info (value and callback) into 68979// prop and event handler respectively. 68980function transformModel (options, data) { 68981 var prop = (options.model && options.model.prop) || 'value'; 68982 var event = (options.model && options.model.event) || 'input' 68983 ;(data.attrs || (data.attrs = {}))[prop] = data.model.value; 68984 var on = data.on || (data.on = {}); 68985 var existing = on[event]; 68986 var callback = data.model.callback; 68987 if (isDef(existing)) { 68988 if ( 68989 Array.isArray(existing) 68990 ? existing.indexOf(callback) === -1 68991 : existing !== callback 68992 ) { 68993 on[event] = [callback].concat(existing); 68994 } 68995 } else { 68996 on[event] = callback; 68997 } 68998} 68999 69000/* */ 69001 69002var SIMPLE_NORMALIZE = 1; 69003var ALWAYS_NORMALIZE = 2; 69004 69005// wrapper function for providing a more flexible interface 69006// without getting yelled at by flow 69007function createElement ( 69008 context, 69009 tag, 69010 data, 69011 children, 69012 normalizationType, 69013 alwaysNormalize 69014) { 69015 if (Array.isArray(data) || isPrimitive(data)) { 69016 normalizationType = children; 69017 children = data; 69018 data = undefined; 69019 } 69020 if (isTrue(alwaysNormalize)) { 69021 normalizationType = ALWAYS_NORMALIZE; 69022 } 69023 return _createElement(context, tag, data, children, normalizationType) 69024} 69025 69026function _createElement ( 69027 context, 69028 tag, 69029 data, 69030 children, 69031 normalizationType 69032) { 69033 if (isDef(data) && isDef((data).__ob__)) { 69034 warn( 69035 "Avoid using observed data object as vnode data: " + (JSON.stringify(data)) + "\n" + 69036 'Always create fresh vnode data objects in each render!', 69037 context 69038 ); 69039 return createEmptyVNode() 69040 } 69041 // object syntax in v-bind 69042 if (isDef(data) && isDef(data.is)) { 69043 tag = data.is; 69044 } 69045 if (!tag) { 69046 // in case of component :is set to falsy value 69047 return createEmptyVNode() 69048 } 69049 // warn against non-primitive key 69050 if (isDef(data) && isDef(data.key) && !isPrimitive(data.key) 69051 ) { 69052 { 69053 warn( 69054 'Avoid using non-primitive value as key, ' + 69055 'use string/number value instead.', 69056 context 69057 ); 69058 } 69059 } 69060 // support single function children as default scoped slot 69061 if (Array.isArray(children) && 69062 typeof children[0] === 'function' 69063 ) { 69064 data = data || {}; 69065 data.scopedSlots = { default: children[0] }; 69066 children.length = 0; 69067 } 69068 if (normalizationType === ALWAYS_NORMALIZE) { 69069 children = normalizeChildren(children); 69070 } else if (normalizationType === SIMPLE_NORMALIZE) { 69071 children = simpleNormalizeChildren(children); 69072 } 69073 var vnode, ns; 69074 if (typeof tag === 'string') { 69075 var Ctor; 69076 ns = (context.$vnode && context.$vnode.ns) || config.getTagNamespace(tag); 69077 if (config.isReservedTag(tag)) { 69078 // platform built-in elements 69079 if (isDef(data) && isDef(data.nativeOn) && data.tag !== 'component') { 69080 warn( 69081 ("The .native modifier for v-on is only valid on components but it was used on <" + tag + ">."), 69082 context 69083 ); 69084 } 69085 vnode = new VNode( 69086 config.parsePlatformTagName(tag), data, children, 69087 undefined, undefined, context 69088 ); 69089 } else if ((!data || !data.pre) && isDef(Ctor = resolveAsset(context.$options, 'components', tag))) { 69090 // component 69091 vnode = createComponent(Ctor, data, context, children, tag); 69092 } else { 69093 // unknown or unlisted namespaced elements 69094 // check at runtime because it may get assigned a namespace when its 69095 // parent normalizes children 69096 vnode = new VNode( 69097 tag, data, children, 69098 undefined, undefined, context 69099 ); 69100 } 69101 } else { 69102 // direct component options / constructor 69103 vnode = createComponent(tag, data, context, children); 69104 } 69105 if (Array.isArray(vnode)) { 69106 return vnode 69107 } else if (isDef(vnode)) { 69108 if (isDef(ns)) { applyNS(vnode, ns); } 69109 if (isDef(data)) { registerDeepBindings(data); } 69110 return vnode 69111 } else { 69112 return createEmptyVNode() 69113 } 69114} 69115 69116function applyNS (vnode, ns, force) { 69117 vnode.ns = ns; 69118 if (vnode.tag === 'foreignObject') { 69119 // use default namespace inside foreignObject 69120 ns = undefined; 69121 force = true; 69122 } 69123 if (isDef(vnode.children)) { 69124 for (var i = 0, l = vnode.children.length; i < l; i++) { 69125 var child = vnode.children[i]; 69126 if (isDef(child.tag) && ( 69127 isUndef(child.ns) || (isTrue(force) && child.tag !== 'svg'))) { 69128 applyNS(child, ns, force); 69129 } 69130 } 69131 } 69132} 69133 69134// ref #5318 69135// necessary to ensure parent re-render when deep bindings like :style and 69136// :class are used on slot nodes 69137function registerDeepBindings (data) { 69138 if (isObject(data.style)) { 69139 traverse(data.style); 69140 } 69141 if (isObject(data.class)) { 69142 traverse(data.class); 69143 } 69144} 69145 69146/* */ 69147 69148function initRender (vm) { 69149 vm._vnode = null; // the root of the child tree 69150 vm._staticTrees = null; // v-once cached trees 69151 var options = vm.$options; 69152 var parentVnode = vm.$vnode = options._parentVnode; // the placeholder node in parent tree 69153 var renderContext = parentVnode && parentVnode.context; 69154 vm.$slots = resolveSlots(options._renderChildren, renderContext); 69155 vm.$scopedSlots = emptyObject; 69156 // bind the createElement fn to this instance 69157 // so that we get proper render context inside it. 69158 // args order: tag, data, children, normalizationType, alwaysNormalize 69159 // internal version is used by render functions compiled from templates 69160 vm._c = function (a, b, c, d) { return createElement(vm, a, b, c, d, false); }; 69161 // normalization is always applied for the public version, used in 69162 // user-written render functions. 69163 vm.$createElement = function (a, b, c, d) { return createElement(vm, a, b, c, d, true); }; 69164 69165 // $attrs & $listeners are exposed for easier HOC creation. 69166 // they need to be reactive so that HOCs using them are always updated 69167 var parentData = parentVnode && parentVnode.data; 69168 69169 /* istanbul ignore else */ 69170 { 69171 defineReactive$$1(vm, '$attrs', parentData && parentData.attrs || emptyObject, function () { 69172 !isUpdatingChildComponent && warn("$attrs is readonly.", vm); 69173 }, true); 69174 defineReactive$$1(vm, '$listeners', options._parentListeners || emptyObject, function () { 69175 !isUpdatingChildComponent && warn("$listeners is readonly.", vm); 69176 }, true); 69177 } 69178} 69179 69180var currentRenderingInstance = null; 69181 69182function renderMixin (Vue) { 69183 // install runtime convenience helpers 69184 installRenderHelpers(Vue.prototype); 69185 69186 Vue.prototype.$nextTick = function (fn) { 69187 return nextTick(fn, this) 69188 }; 69189 69190 Vue.prototype._render = function () { 69191 var vm = this; 69192 var ref = vm.$options; 69193 var render = ref.render; 69194 var _parentVnode = ref._parentVnode; 69195 69196 if (_parentVnode) { 69197 vm.$scopedSlots = normalizeScopedSlots( 69198 _parentVnode.data.scopedSlots, 69199 vm.$slots, 69200 vm.$scopedSlots 69201 ); 69202 } 69203 69204 // set parent vnode. this allows render functions to have access 69205 // to the data on the placeholder node. 69206 vm.$vnode = _parentVnode; 69207 // render self 69208 var vnode; 69209 try { 69210 // There's no need to maintain a stack because all render fns are called 69211 // separately from one another. Nested component's render fns are called 69212 // when parent component is patched. 69213 currentRenderingInstance = vm; 69214 vnode = render.call(vm._renderProxy, vm.$createElement); 69215 } catch (e) { 69216 handleError(e, vm, "render"); 69217 // return error render result, 69218 // or previous vnode to prevent render error causing blank component 69219 /* istanbul ignore else */ 69220 if (vm.$options.renderError) { 69221 try { 69222 vnode = vm.$options.renderError.call(vm._renderProxy, vm.$createElement, e); 69223 } catch (e) { 69224 handleError(e, vm, "renderError"); 69225 vnode = vm._vnode; 69226 } 69227 } else { 69228 vnode = vm._vnode; 69229 } 69230 } finally { 69231 currentRenderingInstance = null; 69232 } 69233 // if the returned array contains only a single node, allow it 69234 if (Array.isArray(vnode) && vnode.length === 1) { 69235 vnode = vnode[0]; 69236 } 69237 // return empty vnode in case the render function errored out 69238 if (!(vnode instanceof VNode)) { 69239 if (Array.isArray(vnode)) { 69240 warn( 69241 'Multiple root nodes returned from render function. Render function ' + 69242 'should return a single root node.', 69243 vm 69244 ); 69245 } 69246 vnode = createEmptyVNode(); 69247 } 69248 // set parent 69249 vnode.parent = _parentVnode; 69250 return vnode 69251 }; 69252} 69253 69254/* */ 69255 69256function ensureCtor (comp, base) { 69257 if ( 69258 comp.__esModule || 69259 (hasSymbol && comp[Symbol.toStringTag] === 'Module') 69260 ) { 69261 comp = comp.default; 69262 } 69263 return isObject(comp) 69264 ? base.extend(comp) 69265 : comp 69266} 69267 69268function createAsyncPlaceholder ( 69269 factory, 69270 data, 69271 context, 69272 children, 69273 tag 69274) { 69275 var node = createEmptyVNode(); 69276 node.asyncFactory = factory; 69277 node.asyncMeta = { data: data, context: context, children: children, tag: tag }; 69278 return node 69279} 69280 69281function resolveAsyncComponent ( 69282 factory, 69283 baseCtor 69284) { 69285 if (isTrue(factory.error) && isDef(factory.errorComp)) { 69286 return factory.errorComp 69287 } 69288 69289 if (isDef(factory.resolved)) { 69290 return factory.resolved 69291 } 69292 69293 var owner = currentRenderingInstance; 69294 if (owner && isDef(factory.owners) && factory.owners.indexOf(owner) === -1) { 69295 // already pending 69296 factory.owners.push(owner); 69297 } 69298 69299 if (isTrue(factory.loading) && isDef(factory.loadingComp)) { 69300 return factory.loadingComp 69301 } 69302 69303 if (owner && !isDef(factory.owners)) { 69304 var owners = factory.owners = [owner]; 69305 var sync = true; 69306 var timerLoading = null; 69307 var timerTimeout = null 69308 69309 ;(owner).$on('hook:destroyed', function () { return remove(owners, owner); }); 69310 69311 var forceRender = function (renderCompleted) { 69312 for (var i = 0, l = owners.length; i < l; i++) { 69313 (owners[i]).$forceUpdate(); 69314 } 69315 69316 if (renderCompleted) { 69317 owners.length = 0; 69318 if (timerLoading !== null) { 69319 clearTimeout(timerLoading); 69320 timerLoading = null; 69321 } 69322 if (timerTimeout !== null) { 69323 clearTimeout(timerTimeout); 69324 timerTimeout = null; 69325 } 69326 } 69327 }; 69328 69329 var resolve = once(function (res) { 69330 // cache resolved 69331 factory.resolved = ensureCtor(res, baseCtor); 69332 // invoke callbacks only if this is not a synchronous resolve 69333 // (async resolves are shimmed as synchronous during SSR) 69334 if (!sync) { 69335 forceRender(true); 69336 } else { 69337 owners.length = 0; 69338 } 69339 }); 69340 69341 var reject = once(function (reason) { 69342 warn( 69343 "Failed to resolve async component: " + (String(factory)) + 69344 (reason ? ("\nReason: " + reason) : '') 69345 ); 69346 if (isDef(factory.errorComp)) { 69347 factory.error = true; 69348 forceRender(true); 69349 } 69350 }); 69351 69352 var res = factory(resolve, reject); 69353 69354 if (isObject(res)) { 69355 if (isPromise(res)) { 69356 // () => Promise 69357 if (isUndef(factory.resolved)) { 69358 res.then(resolve, reject); 69359 } 69360 } else if (isPromise(res.component)) { 69361 res.component.then(resolve, reject); 69362 69363 if (isDef(res.error)) { 69364 factory.errorComp = ensureCtor(res.error, baseCtor); 69365 } 69366 69367 if (isDef(res.loading)) { 69368 factory.loadingComp = ensureCtor(res.loading, baseCtor); 69369 if (res.delay === 0) { 69370 factory.loading = true; 69371 } else { 69372 timerLoading = setTimeout(function () { 69373 timerLoading = null; 69374 if (isUndef(factory.resolved) && isUndef(factory.error)) { 69375 factory.loading = true; 69376 forceRender(false); 69377 } 69378 }, res.delay || 200); 69379 } 69380 } 69381 69382 if (isDef(res.timeout)) { 69383 timerTimeout = setTimeout(function () { 69384 timerTimeout = null; 69385 if (isUndef(factory.resolved)) { 69386 reject( 69387 "timeout (" + (res.timeout) + "ms)" 69388 ); 69389 } 69390 }, res.timeout); 69391 } 69392 } 69393 } 69394 69395 sync = false; 69396 // return in case resolved synchronously 69397 return factory.loading 69398 ? factory.loadingComp 69399 : factory.resolved 69400 } 69401} 69402 69403/* */ 69404 69405function getFirstComponentChild (children) { 69406 if (Array.isArray(children)) { 69407 for (var i = 0; i < children.length; i++) { 69408 var c = children[i]; 69409 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) { 69410 return c 69411 } 69412 } 69413 } 69414} 69415 69416/* */ 69417 69418/* */ 69419 69420function initEvents (vm) { 69421 vm._events = Object.create(null); 69422 vm._hasHookEvent = false; 69423 // init parent attached events 69424 var listeners = vm.$options._parentListeners; 69425 if (listeners) { 69426 updateComponentListeners(vm, listeners); 69427 } 69428} 69429 69430var target; 69431 69432function add (event, fn) { 69433 target.$on(event, fn); 69434} 69435 69436function remove$1 (event, fn) { 69437 target.$off(event, fn); 69438} 69439 69440function createOnceHandler (event, fn) { 69441 var _target = target; 69442 return function onceHandler () { 69443 var res = fn.apply(null, arguments); 69444 if (res !== null) { 69445 _target.$off(event, onceHandler); 69446 } 69447 } 69448} 69449 69450function updateComponentListeners ( 69451 vm, 69452 listeners, 69453 oldListeners 69454) { 69455 target = vm; 69456 updateListeners(listeners, oldListeners || {}, add, remove$1, createOnceHandler, vm); 69457 target = undefined; 69458} 69459 69460function eventsMixin (Vue) { 69461 var hookRE = /^hook:/; 69462 Vue.prototype.$on = function (event, fn) { 69463 var vm = this; 69464 if (Array.isArray(event)) { 69465 for (var i = 0, l = event.length; i < l; i++) { 69466 vm.$on(event[i], fn); 69467 } 69468 } else { 69469 (vm._events[event] || (vm._events[event] = [])).push(fn); 69470 // optimize hook:event cost by using a boolean flag marked at registration 69471 // instead of a hash lookup 69472 if (hookRE.test(event)) { 69473 vm._hasHookEvent = true; 69474 } 69475 } 69476 return vm 69477 }; 69478 69479 Vue.prototype.$once = function (event, fn) { 69480 var vm = this; 69481 function on () { 69482 vm.$off(event, on); 69483 fn.apply(vm, arguments); 69484 } 69485 on.fn = fn; 69486 vm.$on(event, on); 69487 return vm 69488 }; 69489 69490 Vue.prototype.$off = function (event, fn) { 69491 var vm = this; 69492 // all 69493 if (!arguments.length) { 69494 vm._events = Object.create(null); 69495 return vm 69496 } 69497 // array of events 69498 if (Array.isArray(event)) { 69499 for (var i$1 = 0, l = event.length; i$1 < l; i$1++) { 69500 vm.$off(event[i$1], fn); 69501 } 69502 return vm 69503 } 69504 // specific event 69505 var cbs = vm._events[event]; 69506 if (!cbs) { 69507 return vm 69508 } 69509 if (!fn) { 69510 vm._events[event] = null; 69511 return vm 69512 } 69513 // specific handler 69514 var cb; 69515 var i = cbs.length; 69516 while (i--) { 69517 cb = cbs[i]; 69518 if (cb === fn || cb.fn === fn) { 69519 cbs.splice(i, 1); 69520 break 69521 } 69522 } 69523 return vm 69524 }; 69525 69526 Vue.prototype.$emit = function (event) { 69527 var vm = this; 69528 { 69529 var lowerCaseEvent = event.toLowerCase(); 69530 if (lowerCaseEvent !== event && vm._events[lowerCaseEvent]) { 69531 tip( 69532 "Event \"" + lowerCaseEvent + "\" is emitted in component " + 69533 (formatComponentName(vm)) + " but the handler is registered for \"" + event + "\". " + 69534 "Note that HTML attributes are case-insensitive and you cannot use " + 69535 "v-on to listen to camelCase events when using in-DOM templates. " + 69536 "You should probably use \"" + (hyphenate(event)) + "\" instead of \"" + event + "\"." 69537 ); 69538 } 69539 } 69540 var cbs = vm._events[event]; 69541 if (cbs) { 69542 cbs = cbs.length > 1 ? toArray(cbs) : cbs; 69543 var args = toArray(arguments, 1); 69544 var info = "event handler for \"" + event + "\""; 69545 for (var i = 0, l = cbs.length; i < l; i++) { 69546 invokeWithErrorHandling(cbs[i], vm, args, vm, info); 69547 } 69548 } 69549 return vm 69550 }; 69551} 69552 69553/* */ 69554 69555var activeInstance = null; 69556var isUpdatingChildComponent = false; 69557 69558function setActiveInstance(vm) { 69559 var prevActiveInstance = activeInstance; 69560 activeInstance = vm; 69561 return function () { 69562 activeInstance = prevActiveInstance; 69563 } 69564} 69565 69566function initLifecycle (vm) { 69567 var options = vm.$options; 69568 69569 // locate first non-abstract parent 69570 var parent = options.parent; 69571 if (parent && !options.abstract) { 69572 while (parent.$options.abstract && parent.$parent) { 69573 parent = parent.$parent; 69574 } 69575 parent.$children.push(vm); 69576 } 69577 69578 vm.$parent = parent; 69579 vm.$root = parent ? parent.$root : vm; 69580 69581 vm.$children = []; 69582 vm.$refs = {}; 69583 69584 vm._watcher = null; 69585 vm._inactive = null; 69586 vm._directInactive = false; 69587 vm._isMounted = false; 69588 vm._isDestroyed = false; 69589 vm._isBeingDestroyed = false; 69590} 69591 69592function lifecycleMixin (Vue) { 69593 Vue.prototype._update = function (vnode, hydrating) { 69594 var vm = this; 69595 var prevEl = vm.$el; 69596 var prevVnode = vm._vnode; 69597 var restoreActiveInstance = setActiveInstance(vm); 69598 vm._vnode = vnode; 69599 // Vue.prototype.__patch__ is injected in entry points 69600 // based on the rendering backend used. 69601 if (!prevVnode) { 69602 // initial render 69603 vm.$el = vm.__patch__(vm.$el, vnode, hydrating, false /* removeOnly */); 69604 } else { 69605 // updates 69606 vm.$el = vm.__patch__(prevVnode, vnode); 69607 } 69608 restoreActiveInstance(); 69609 // update __vue__ reference 69610 if (prevEl) { 69611 prevEl.__vue__ = null; 69612 } 69613 if (vm.$el) { 69614 vm.$el.__vue__ = vm; 69615 } 69616 // if parent is an HOC, update its $el as well 69617 if (vm.$vnode && vm.$parent && vm.$vnode === vm.$parent._vnode) { 69618 vm.$parent.$el = vm.$el; 69619 } 69620 // updated hook is called by the scheduler to ensure that children are 69621 // updated in a parent's updated hook. 69622 }; 69623 69624 Vue.prototype.$forceUpdate = function () { 69625 var vm = this; 69626 if (vm._watcher) { 69627 vm._watcher.update(); 69628 } 69629 }; 69630 69631 Vue.prototype.$destroy = function () { 69632 var vm = this; 69633 if (vm._isBeingDestroyed) { 69634 return 69635 } 69636 callHook(vm, 'beforeDestroy'); 69637 vm._isBeingDestroyed = true; 69638 // remove self from parent 69639 var parent = vm.$parent; 69640 if (parent && !parent._isBeingDestroyed && !vm.$options.abstract) { 69641 remove(parent.$children, vm); 69642 } 69643 // teardown watchers 69644 if (vm._watcher) { 69645 vm._watcher.teardown(); 69646 } 69647 var i = vm._watchers.length; 69648 while (i--) { 69649 vm._watchers[i].teardown(); 69650 } 69651 // remove reference from data ob 69652 // frozen object may not have observer. 69653 if (vm._data.__ob__) { 69654 vm._data.__ob__.vmCount--; 69655 } 69656 // call the last hook... 69657 vm._isDestroyed = true; 69658 // invoke destroy hooks on current rendered tree 69659 vm.__patch__(vm._vnode, null); 69660 // fire destroyed hook 69661 callHook(vm, 'destroyed'); 69662 // turn off all instance listeners. 69663 vm.$off(); 69664 // remove __vue__ reference 69665 if (vm.$el) { 69666 vm.$el.__vue__ = null; 69667 } 69668 // release circular reference (#6759) 69669 if (vm.$vnode) { 69670 vm.$vnode.parent = null; 69671 } 69672 }; 69673} 69674 69675function mountComponent ( 69676 vm, 69677 el, 69678 hydrating 69679) { 69680 vm.$el = el; 69681 if (!vm.$options.render) { 69682 vm.$options.render = createEmptyVNode; 69683 { 69684 /* istanbul ignore if */ 69685 if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') || 69686 vm.$options.el || el) { 69687 warn( 69688 'You are using the runtime-only build of Vue where the template ' + 69689 'compiler is not available. Either pre-compile the templates into ' + 69690 'render functions, or use the compiler-included build.', 69691 vm 69692 ); 69693 } else { 69694 warn( 69695 'Failed to mount component: template or render function not defined.', 69696 vm 69697 ); 69698 } 69699 } 69700 } 69701 callHook(vm, 'beforeMount'); 69702 69703 var updateComponent; 69704 /* istanbul ignore if */ 69705 if (config.performance && mark) { 69706 updateComponent = function () { 69707 var name = vm._name; 69708 var id = vm._uid; 69709 var startTag = "vue-perf-start:" + id; 69710 var endTag = "vue-perf-end:" + id; 69711 69712 mark(startTag); 69713 var vnode = vm._render(); 69714 mark(endTag); 69715 measure(("vue " + name + " render"), startTag, endTag); 69716 69717 mark(startTag); 69718 vm._update(vnode, hydrating); 69719 mark(endTag); 69720 measure(("vue " + name + " patch"), startTag, endTag); 69721 }; 69722 } else { 69723 updateComponent = function () { 69724 vm._update(vm._render(), hydrating); 69725 }; 69726 } 69727 69728 // we set this to vm._watcher inside the watcher's constructor 69729 // since the watcher's initial patch may call $forceUpdate (e.g. inside child 69730 // component's mounted hook), which relies on vm._watcher being already defined 69731 new Watcher(vm, updateComponent, noop, { 69732 before: function before () { 69733 if (vm._isMounted && !vm._isDestroyed) { 69734 callHook(vm, 'beforeUpdate'); 69735 } 69736 } 69737 }, true /* isRenderWatcher */); 69738 hydrating = false; 69739 69740 // manually mounted instance, call mounted on self 69741 // mounted is called for render-created child components in its inserted hook 69742 if (vm.$vnode == null) { 69743 vm._isMounted = true; 69744 callHook(vm, 'mounted'); 69745 } 69746 return vm 69747} 69748 69749function updateChildComponent ( 69750 vm, 69751 propsData, 69752 listeners, 69753 parentVnode, 69754 renderChildren 69755) { 69756 { 69757 isUpdatingChildComponent = true; 69758 } 69759 69760 // determine whether component has slot children 69761 // we need to do this before overwriting $options._renderChildren. 69762 69763 // check if there are dynamic scopedSlots (hand-written or compiled but with 69764 // dynamic slot names). Static scoped slots compiled from template has the 69765 // "$stable" marker. 69766 var newScopedSlots = parentVnode.data.scopedSlots; 69767 var oldScopedSlots = vm.$scopedSlots; 69768 var hasDynamicScopedSlot = !!( 69769 (newScopedSlots && !newScopedSlots.$stable) || 69770 (oldScopedSlots !== emptyObject && !oldScopedSlots.$stable) || 69771 (newScopedSlots && vm.$scopedSlots.$key !== newScopedSlots.$key) || 69772 (!newScopedSlots && vm.$scopedSlots.$key) 69773 ); 69774 69775 // Any static slot children from the parent may have changed during parent's 69776 // update. Dynamic scoped slots may also have changed. In such cases, a forced 69777 // update is necessary to ensure correctness. 69778 var needsForceUpdate = !!( 69779 renderChildren || // has new static slots 69780 vm.$options._renderChildren || // has old static slots 69781 hasDynamicScopedSlot 69782 ); 69783 69784 vm.$options._parentVnode = parentVnode; 69785 vm.$vnode = parentVnode; // update vm's placeholder node without re-render 69786 69787 if (vm._vnode) { // update child tree's parent 69788 vm._vnode.parent = parentVnode; 69789 } 69790 vm.$options._renderChildren = renderChildren; 69791 69792 // update $attrs and $listeners hash 69793 // these are also reactive so they may trigger child update if the child 69794 // used them during render 69795 vm.$attrs = parentVnode.data.attrs || emptyObject; 69796 vm.$listeners = listeners || emptyObject; 69797 69798 // update props 69799 if (propsData && vm.$options.props) { 69800 toggleObserving(false); 69801 var props = vm._props; 69802 var propKeys = vm.$options._propKeys || []; 69803 for (var i = 0; i < propKeys.length; i++) { 69804 var key = propKeys[i]; 69805 var propOptions = vm.$options.props; // wtf flow? 69806 props[key] = validateProp(key, propOptions, propsData, vm); 69807 } 69808 toggleObserving(true); 69809 // keep a copy of raw propsData 69810 vm.$options.propsData = propsData; 69811 } 69812 69813 // update listeners 69814 listeners = listeners || emptyObject; 69815 var oldListeners = vm.$options._parentListeners; 69816 vm.$options._parentListeners = listeners; 69817 updateComponentListeners(vm, listeners, oldListeners); 69818 69819 // resolve slots + force update if has children 69820 if (needsForceUpdate) { 69821 vm.$slots = resolveSlots(renderChildren, parentVnode.context); 69822 vm.$forceUpdate(); 69823 } 69824 69825 { 69826 isUpdatingChildComponent = false; 69827 } 69828} 69829 69830function isInInactiveTree (vm) { 69831 while (vm && (vm = vm.$parent)) { 69832 if (vm._inactive) { return true } 69833 } 69834 return false 69835} 69836 69837function activateChildComponent (vm, direct) { 69838 if (direct) { 69839 vm._directInactive = false; 69840 if (isInInactiveTree(vm)) { 69841 return 69842 } 69843 } else if (vm._directInactive) { 69844 return 69845 } 69846 if (vm._inactive || vm._inactive === null) { 69847 vm._inactive = false; 69848 for (var i = 0; i < vm.$children.length; i++) { 69849 activateChildComponent(vm.$children[i]); 69850 } 69851 callHook(vm, 'activated'); 69852 } 69853} 69854 69855function deactivateChildComponent (vm, direct) { 69856 if (direct) { 69857 vm._directInactive = true; 69858 if (isInInactiveTree(vm)) { 69859 return 69860 } 69861 } 69862 if (!vm._inactive) { 69863 vm._inactive = true; 69864 for (var i = 0; i < vm.$children.length; i++) { 69865 deactivateChildComponent(vm.$children[i]); 69866 } 69867 callHook(vm, 'deactivated'); 69868 } 69869} 69870 69871function callHook (vm, hook) { 69872 // #7573 disable dep collection when invoking lifecycle hooks 69873 pushTarget(); 69874 var handlers = vm.$options[hook]; 69875 var info = hook + " hook"; 69876 if (handlers) { 69877 for (var i = 0, j = handlers.length; i < j; i++) { 69878 invokeWithErrorHandling(handlers[i], vm, null, vm, info); 69879 } 69880 } 69881 if (vm._hasHookEvent) { 69882 vm.$emit('hook:' + hook); 69883 } 69884 popTarget(); 69885} 69886 69887/* */ 69888 69889var MAX_UPDATE_COUNT = 100; 69890 69891var queue = []; 69892var activatedChildren = []; 69893var has = {}; 69894var circular = {}; 69895var waiting = false; 69896var flushing = false; 69897var index = 0; 69898 69899/** 69900 * Reset the scheduler's state. 69901 */ 69902function resetSchedulerState () { 69903 index = queue.length = activatedChildren.length = 0; 69904 has = {}; 69905 { 69906 circular = {}; 69907 } 69908 waiting = flushing = false; 69909} 69910 69911// Async edge case #6566 requires saving the timestamp when event listeners are 69912// attached. However, calling performance.now() has a perf overhead especially 69913// if the page has thousands of event listeners. Instead, we take a timestamp 69914// every time the scheduler flushes and use that for all event listeners 69915// attached during that flush. 69916var currentFlushTimestamp = 0; 69917 69918// Async edge case fix requires storing an event listener's attach timestamp. 69919var getNow = Date.now; 69920 69921// Determine what event timestamp the browser is using. Annoyingly, the 69922// timestamp can either be hi-res (relative to page load) or low-res 69923// (relative to UNIX epoch), so in order to compare time we have to use the 69924// same timestamp type when saving the flush timestamp. 69925// All IE versions use low-res event timestamps, and have problematic clock 69926// implementations (#9632) 69927if (inBrowser && !isIE) { 69928 var performance = window.performance; 69929 if ( 69930 performance && 69931 typeof performance.now === 'function' && 69932 getNow() > document.createEvent('Event').timeStamp 69933 ) { 69934 // if the event timestamp, although evaluated AFTER the Date.now(), is 69935 // smaller than it, it means the event is using a hi-res timestamp, 69936 // and we need to use the hi-res version for event listener timestamps as 69937 // well. 69938 getNow = function () { return performance.now(); }; 69939 } 69940} 69941 69942/** 69943 * Flush both queues and run the watchers. 69944 */ 69945function flushSchedulerQueue () { 69946 currentFlushTimestamp = getNow(); 69947 flushing = true; 69948 var watcher, id; 69949 69950 // Sort queue before flush. 69951 // This ensures that: 69952 // 1. Components are updated from parent to child. (because parent is always 69953 // created before the child) 69954 // 2. A component's user watchers are run before its render watcher (because 69955 // user watchers are created before the render watcher) 69956 // 3. If a component is destroyed during a parent component's watcher run, 69957 // its watchers can be skipped. 69958 queue.sort(function (a, b) { return a.id - b.id; }); 69959 69960 // do not cache length because more watchers might be pushed 69961 // as we run existing watchers 69962 for (index = 0; index < queue.length; index++) { 69963 watcher = queue[index]; 69964 if (watcher.before) { 69965 watcher.before(); 69966 } 69967 id = watcher.id; 69968 has[id] = null; 69969 watcher.run(); 69970 // in dev build, check and stop circular updates. 69971 if (has[id] != null) { 69972 circular[id] = (circular[id] || 0) + 1; 69973 if (circular[id] > MAX_UPDATE_COUNT) { 69974 warn( 69975 'You may have an infinite update loop ' + ( 69976 watcher.user 69977 ? ("in watcher with expression \"" + (watcher.expression) + "\"") 69978 : "in a component render function." 69979 ), 69980 watcher.vm 69981 ); 69982 break 69983 } 69984 } 69985 } 69986 69987 // keep copies of post queues before resetting state 69988 var activatedQueue = activatedChildren.slice(); 69989 var updatedQueue = queue.slice(); 69990 69991 resetSchedulerState(); 69992 69993 // call component updated and activated hooks 69994 callActivatedHooks(activatedQueue); 69995 callUpdatedHooks(updatedQueue); 69996 69997 // devtool hook 69998 /* istanbul ignore if */ 69999 if (devtools && config.devtools) { 70000 devtools.emit('flush'); 70001 } 70002} 70003 70004function callUpdatedHooks (queue) { 70005 var i = queue.length; 70006 while (i--) { 70007 var watcher = queue[i]; 70008 var vm = watcher.vm; 70009 if (vm._watcher === watcher && vm._isMounted && !vm._isDestroyed) { 70010 callHook(vm, 'updated'); 70011 } 70012 } 70013} 70014 70015/** 70016 * Queue a kept-alive component that was activated during patch. 70017 * The queue will be processed after the entire tree has been patched. 70018 */ 70019function queueActivatedComponent (vm) { 70020 // setting _inactive to false here so that a render function can 70021 // rely on checking whether it's in an inactive tree (e.g. router-view) 70022 vm._inactive = false; 70023 activatedChildren.push(vm); 70024} 70025 70026function callActivatedHooks (queue) { 70027 for (var i = 0; i < queue.length; i++) { 70028 queue[i]._inactive = true; 70029 activateChildComponent(queue[i], true /* true */); 70030 } 70031} 70032 70033/** 70034 * Push a watcher into the watcher queue. 70035 * Jobs with duplicate IDs will be skipped unless it's 70036 * pushed when the queue is being flushed. 70037 */ 70038function queueWatcher (watcher) { 70039 var id = watcher.id; 70040 if (has[id] == null) { 70041 has[id] = true; 70042 if (!flushing) { 70043 queue.push(watcher); 70044 } else { 70045 // if already flushing, splice the watcher based on its id 70046 // if already past its id, it will be run next immediately. 70047 var i = queue.length - 1; 70048 while (i > index && queue[i].id > watcher.id) { 70049 i--; 70050 } 70051 queue.splice(i + 1, 0, watcher); 70052 } 70053 // queue the flush 70054 if (!waiting) { 70055 waiting = true; 70056 70057 if (!config.async) { 70058 flushSchedulerQueue(); 70059 return 70060 } 70061 nextTick(flushSchedulerQueue); 70062 } 70063 } 70064} 70065 70066/* */ 70067 70068 70069 70070var uid$2 = 0; 70071 70072/** 70073 * A watcher parses an expression, collects dependencies, 70074 * and fires callback when the expression value changes. 70075 * This is used for both the $watch() api and directives. 70076 */ 70077var Watcher = function Watcher ( 70078 vm, 70079 expOrFn, 70080 cb, 70081 options, 70082 isRenderWatcher 70083) { 70084 this.vm = vm; 70085 if (isRenderWatcher) { 70086 vm._watcher = this; 70087 } 70088 vm._watchers.push(this); 70089 // options 70090 if (options) { 70091 this.deep = !!options.deep; 70092 this.user = !!options.user; 70093 this.lazy = !!options.lazy; 70094 this.sync = !!options.sync; 70095 this.before = options.before; 70096 } else { 70097 this.deep = this.user = this.lazy = this.sync = false; 70098 } 70099 this.cb = cb; 70100 this.id = ++uid$2; // uid for batching 70101 this.active = true; 70102 this.dirty = this.lazy; // for lazy watchers 70103 this.deps = []; 70104 this.newDeps = []; 70105 this.depIds = new _Set(); 70106 this.newDepIds = new _Set(); 70107 this.expression = expOrFn.toString(); 70108 // parse expression for getter 70109 if (typeof expOrFn === 'function') { 70110 this.getter = expOrFn; 70111 } else { 70112 this.getter = parsePath(expOrFn); 70113 if (!this.getter) { 70114 this.getter = noop; 70115 warn( 70116 "Failed watching path: \"" + expOrFn + "\" " + 70117 'Watcher only accepts simple dot-delimited paths. ' + 70118 'For full control, use a function instead.', 70119 vm 70120 ); 70121 } 70122 } 70123 this.value = this.lazy 70124 ? undefined 70125 : this.get(); 70126}; 70127 70128/** 70129 * Evaluate the getter, and re-collect dependencies. 70130 */ 70131Watcher.prototype.get = function get () { 70132 pushTarget(this); 70133 var value; 70134 var vm = this.vm; 70135 try { 70136 value = this.getter.call(vm, vm); 70137 } catch (e) { 70138 if (this.user) { 70139 handleError(e, vm, ("getter for watcher \"" + (this.expression) + "\"")); 70140 } else { 70141 throw e 70142 } 70143 } finally { 70144 // "touch" every property so they are all tracked as 70145 // dependencies for deep watching 70146 if (this.deep) { 70147 traverse(value); 70148 } 70149 popTarget(); 70150 this.cleanupDeps(); 70151 } 70152 return value 70153}; 70154 70155/** 70156 * Add a dependency to this directive. 70157 */ 70158Watcher.prototype.addDep = function addDep (dep) { 70159 var id = dep.id; 70160 if (!this.newDepIds.has(id)) { 70161 this.newDepIds.add(id); 70162 this.newDeps.push(dep); 70163 if (!this.depIds.has(id)) { 70164 dep.addSub(this); 70165 } 70166 } 70167}; 70168 70169/** 70170 * Clean up for dependency collection. 70171 */ 70172Watcher.prototype.cleanupDeps = function cleanupDeps () { 70173 var i = this.deps.length; 70174 while (i--) { 70175 var dep = this.deps[i]; 70176 if (!this.newDepIds.has(dep.id)) { 70177 dep.removeSub(this); 70178 } 70179 } 70180 var tmp = this.depIds; 70181 this.depIds = this.newDepIds; 70182 this.newDepIds = tmp; 70183 this.newDepIds.clear(); 70184 tmp = this.deps; 70185 this.deps = this.newDeps; 70186 this.newDeps = tmp; 70187 this.newDeps.length = 0; 70188}; 70189 70190/** 70191 * Subscriber interface. 70192 * Will be called when a dependency changes. 70193 */ 70194Watcher.prototype.update = function update () { 70195 /* istanbul ignore else */ 70196 if (this.lazy) { 70197 this.dirty = true; 70198 } else if (this.sync) { 70199 this.run(); 70200 } else { 70201 queueWatcher(this); 70202 } 70203}; 70204 70205/** 70206 * Scheduler job interface. 70207 * Will be called by the scheduler. 70208 */ 70209Watcher.prototype.run = function run () { 70210 if (this.active) { 70211 var value = this.get(); 70212 if ( 70213 value !== this.value || 70214 // Deep watchers and watchers on Object/Arrays should fire even 70215 // when the value is the same, because the value may 70216 // have mutated. 70217 isObject(value) || 70218 this.deep 70219 ) { 70220 // set new value 70221 var oldValue = this.value; 70222 this.value = value; 70223 if (this.user) { 70224 var info = "callback for watcher \"" + (this.expression) + "\""; 70225 invokeWithErrorHandling(this.cb, this.vm, [value, oldValue], this.vm, info); 70226 } else { 70227 this.cb.call(this.vm, value, oldValue); 70228 } 70229 } 70230 } 70231}; 70232 70233/** 70234 * Evaluate the value of the watcher. 70235 * This only gets called for lazy watchers. 70236 */ 70237Watcher.prototype.evaluate = function evaluate () { 70238 this.value = this.get(); 70239 this.dirty = false; 70240}; 70241 70242/** 70243 * Depend on all deps collected by this watcher. 70244 */ 70245Watcher.prototype.depend = function depend () { 70246 var i = this.deps.length; 70247 while (i--) { 70248 this.deps[i].depend(); 70249 } 70250}; 70251 70252/** 70253 * Remove self from all dependencies' subscriber list. 70254 */ 70255Watcher.prototype.teardown = function teardown () { 70256 if (this.active) { 70257 // remove self from vm's watcher list 70258 // this is a somewhat expensive operation so we skip it 70259 // if the vm is being destroyed. 70260 if (!this.vm._isBeingDestroyed) { 70261 remove(this.vm._watchers, this); 70262 } 70263 var i = this.deps.length; 70264 while (i--) { 70265 this.deps[i].removeSub(this); 70266 } 70267 this.active = false; 70268 } 70269}; 70270 70271/* */ 70272 70273var sharedPropertyDefinition = { 70274 enumerable: true, 70275 configurable: true, 70276 get: noop, 70277 set: noop 70278}; 70279 70280function proxy (target, sourceKey, key) { 70281 sharedPropertyDefinition.get = function proxyGetter () { 70282 return this[sourceKey][key] 70283 }; 70284 sharedPropertyDefinition.set = function proxySetter (val) { 70285 this[sourceKey][key] = val; 70286 }; 70287 Object.defineProperty(target, key, sharedPropertyDefinition); 70288} 70289 70290function initState (vm) { 70291 vm._watchers = []; 70292 var opts = vm.$options; 70293 if (opts.props) { initProps(vm, opts.props); } 70294 if (opts.methods) { initMethods(vm, opts.methods); } 70295 if (opts.data) { 70296 initData(vm); 70297 } else { 70298 observe(vm._data = {}, true /* asRootData */); 70299 } 70300 if (opts.computed) { initComputed(vm, opts.computed); } 70301 if (opts.watch && opts.watch !== nativeWatch) { 70302 initWatch(vm, opts.watch); 70303 } 70304} 70305 70306function initProps (vm, propsOptions) { 70307 var propsData = vm.$options.propsData || {}; 70308 var props = vm._props = {}; 70309 // cache prop keys so that future props updates can iterate using Array 70310 // instead of dynamic object key enumeration. 70311 var keys = vm.$options._propKeys = []; 70312 var isRoot = !vm.$parent; 70313 // root instance props should be converted 70314 if (!isRoot) { 70315 toggleObserving(false); 70316 } 70317 var loop = function ( key ) { 70318 keys.push(key); 70319 var value = validateProp(key, propsOptions, propsData, vm); 70320 /* istanbul ignore else */ 70321 { 70322 var hyphenatedKey = hyphenate(key); 70323 if (isReservedAttribute(hyphenatedKey) || 70324 config.isReservedAttr(hyphenatedKey)) { 70325 warn( 70326 ("\"" + hyphenatedKey + "\" is a reserved attribute and cannot be used as component prop."), 70327 vm 70328 ); 70329 } 70330 defineReactive$$1(props, key, value, function () { 70331 if (!isRoot && !isUpdatingChildComponent) { 70332 warn( 70333 "Avoid mutating a prop directly since the value will be " + 70334 "overwritten whenever the parent component re-renders. " + 70335 "Instead, use a data or computed property based on the prop's " + 70336 "value. Prop being mutated: \"" + key + "\"", 70337 vm 70338 ); 70339 } 70340 }); 70341 } 70342 // static props are already proxied on the component's prototype 70343 // during Vue.extend(). We only need to proxy props defined at 70344 // instantiation here. 70345 if (!(key in vm)) { 70346 proxy(vm, "_props", key); 70347 } 70348 }; 70349 70350 for (var key in propsOptions) loop( key ); 70351 toggleObserving(true); 70352} 70353 70354function initData (vm) { 70355 var data = vm.$options.data; 70356 data = vm._data = typeof data === 'function' 70357 ? getData(data, vm) 70358 : data || {}; 70359 if (!isPlainObject(data)) { 70360 data = {}; 70361 warn( 70362 'data functions should return an object:\n' + 70363 'https://vuejs.org/v2/guide/components.html#data-Must-Be-a-Function', 70364 vm 70365 ); 70366 } 70367 // proxy data on instance 70368 var keys = Object.keys(data); 70369 var props = vm.$options.props; 70370 var methods = vm.$options.methods; 70371 var i = keys.length; 70372 while (i--) { 70373 var key = keys[i]; 70374 { 70375 if (methods && hasOwn(methods, key)) { 70376 warn( 70377 ("Method \"" + key + "\" has already been defined as a data property."), 70378 vm 70379 ); 70380 } 70381 } 70382 if (props && hasOwn(props, key)) { 70383 warn( 70384 "The data property \"" + key + "\" is already declared as a prop. " + 70385 "Use prop default value instead.", 70386 vm 70387 ); 70388 } else if (!isReserved(key)) { 70389 proxy(vm, "_data", key); 70390 } 70391 } 70392 // observe data 70393 observe(data, true /* asRootData */); 70394} 70395 70396function getData (data, vm) { 70397 // #7573 disable dep collection when invoking data getters 70398 pushTarget(); 70399 try { 70400 return data.call(vm, vm) 70401 } catch (e) { 70402 handleError(e, vm, "data()"); 70403 return {} 70404 } finally { 70405 popTarget(); 70406 } 70407} 70408 70409var computedWatcherOptions = { lazy: true }; 70410 70411function initComputed (vm, computed) { 70412 // $flow-disable-line 70413 var watchers = vm._computedWatchers = Object.create(null); 70414 // computed properties are just getters during SSR 70415 var isSSR = isServerRendering(); 70416 70417 for (var key in computed) { 70418 var userDef = computed[key]; 70419 var getter = typeof userDef === 'function' ? userDef : userDef.get; 70420 if (getter == null) { 70421 warn( 70422 ("Getter is missing for computed property \"" + key + "\"."), 70423 vm 70424 ); 70425 } 70426 70427 if (!isSSR) { 70428 // create internal watcher for the computed property. 70429 watchers[key] = new Watcher( 70430 vm, 70431 getter || noop, 70432 noop, 70433 computedWatcherOptions 70434 ); 70435 } 70436 70437 // component-defined computed properties are already defined on the 70438 // component prototype. We only need to define computed properties defined 70439 // at instantiation here. 70440 if (!(key in vm)) { 70441 defineComputed(vm, key, userDef); 70442 } else { 70443 if (key in vm.$data) { 70444 warn(("The computed property \"" + key + "\" is already defined in data."), vm); 70445 } else if (vm.$options.props && key in vm.$options.props) { 70446 warn(("The computed property \"" + key + "\" is already defined as a prop."), vm); 70447 } else if (vm.$options.methods && key in vm.$options.methods) { 70448 warn(("The computed property \"" + key + "\" is already defined as a method."), vm); 70449 } 70450 } 70451 } 70452} 70453 70454function defineComputed ( 70455 target, 70456 key, 70457 userDef 70458) { 70459 var shouldCache = !isServerRendering(); 70460 if (typeof userDef === 'function') { 70461 sharedPropertyDefinition.get = shouldCache 70462 ? createComputedGetter(key) 70463 : createGetterInvoker(userDef); 70464 sharedPropertyDefinition.set = noop; 70465 } else { 70466 sharedPropertyDefinition.get = userDef.get 70467 ? shouldCache && userDef.cache !== false 70468 ? createComputedGetter(key) 70469 : createGetterInvoker(userDef.get) 70470 : noop; 70471 sharedPropertyDefinition.set = userDef.set || noop; 70472 } 70473 if (sharedPropertyDefinition.set === noop) { 70474 sharedPropertyDefinition.set = function () { 70475 warn( 70476 ("Computed property \"" + key + "\" was assigned to but it has no setter."), 70477 this 70478 ); 70479 }; 70480 } 70481 Object.defineProperty(target, key, sharedPropertyDefinition); 70482} 70483 70484function createComputedGetter (key) { 70485 return function computedGetter () { 70486 var watcher = this._computedWatchers && this._computedWatchers[key]; 70487 if (watcher) { 70488 if (watcher.dirty) { 70489 watcher.evaluate(); 70490 } 70491 if (Dep.target) { 70492 watcher.depend(); 70493 } 70494 return watcher.value 70495 } 70496 } 70497} 70498 70499function createGetterInvoker(fn) { 70500 return function computedGetter () { 70501 return fn.call(this, this) 70502 } 70503} 70504 70505function initMethods (vm, methods) { 70506 var props = vm.$options.props; 70507 for (var key in methods) { 70508 { 70509 if (typeof methods[key] !== 'function') { 70510 warn( 70511 "Method \"" + key + "\" has type \"" + (typeof methods[key]) + "\" in the component definition. " + 70512 "Did you reference the function correctly?", 70513 vm 70514 ); 70515 } 70516 if (props && hasOwn(props, key)) { 70517 warn( 70518 ("Method \"" + key + "\" has already been defined as a prop."), 70519 vm 70520 ); 70521 } 70522 if ((key in vm) && isReserved(key)) { 70523 warn( 70524 "Method \"" + key + "\" conflicts with an existing Vue instance method. " + 70525 "Avoid defining component methods that start with _ or $." 70526 ); 70527 } 70528 } 70529 vm[key] = typeof methods[key] !== 'function' ? noop : bind(methods[key], vm); 70530 } 70531} 70532 70533function initWatch (vm, watch) { 70534 for (var key in watch) { 70535 var handler = watch[key]; 70536 if (Array.isArray(handler)) { 70537 for (var i = 0; i < handler.length; i++) { 70538 createWatcher(vm, key, handler[i]); 70539 } 70540 } else { 70541 createWatcher(vm, key, handler); 70542 } 70543 } 70544} 70545 70546function createWatcher ( 70547 vm, 70548 expOrFn, 70549 handler, 70550 options 70551) { 70552 if (isPlainObject(handler)) { 70553 options = handler; 70554 handler = handler.handler; 70555 } 70556 if (typeof handler === 'string') { 70557 handler = vm[handler]; 70558 } 70559 return vm.$watch(expOrFn, handler, options) 70560} 70561 70562function stateMixin (Vue) { 70563 // flow somehow has problems with directly declared definition object 70564 // when using Object.defineProperty, so we have to procedurally build up 70565 // the object here. 70566 var dataDef = {}; 70567 dataDef.get = function () { return this._data }; 70568 var propsDef = {}; 70569 propsDef.get = function () { return this._props }; 70570 { 70571 dataDef.set = function () { 70572 warn( 70573 'Avoid replacing instance root $data. ' + 70574 'Use nested data properties instead.', 70575 this 70576 ); 70577 }; 70578 propsDef.set = function () { 70579 warn("$props is readonly.", this); 70580 }; 70581 } 70582 Object.defineProperty(Vue.prototype, '$data', dataDef); 70583 Object.defineProperty(Vue.prototype, '$props', propsDef); 70584 70585 Vue.prototype.$set = set; 70586 Vue.prototype.$delete = del; 70587 70588 Vue.prototype.$watch = function ( 70589 expOrFn, 70590 cb, 70591 options 70592 ) { 70593 var vm = this; 70594 if (isPlainObject(cb)) { 70595 return createWatcher(vm, expOrFn, cb, options) 70596 } 70597 options = options || {}; 70598 options.user = true; 70599 var watcher = new Watcher(vm, expOrFn, cb, options); 70600 if (options.immediate) { 70601 var info = "callback for immediate watcher \"" + (watcher.expression) + "\""; 70602 pushTarget(); 70603 invokeWithErrorHandling(cb, vm, [watcher.value], vm, info); 70604 popTarget(); 70605 } 70606 return function unwatchFn () { 70607 watcher.teardown(); 70608 } 70609 }; 70610} 70611 70612/* */ 70613 70614var uid$3 = 0; 70615 70616function initMixin (Vue) { 70617 Vue.prototype._init = function (options) { 70618 var vm = this; 70619 // a uid 70620 vm._uid = uid$3++; 70621 70622 var startTag, endTag; 70623 /* istanbul ignore if */ 70624 if (config.performance && mark) { 70625 startTag = "vue-perf-start:" + (vm._uid); 70626 endTag = "vue-perf-end:" + (vm._uid); 70627 mark(startTag); 70628 } 70629 70630 // a flag to avoid this being observed 70631 vm._isVue = true; 70632 // merge options 70633 if (options && options._isComponent) { 70634 // optimize internal component instantiation 70635 // since dynamic options merging is pretty slow, and none of the 70636 // internal component options needs special treatment. 70637 initInternalComponent(vm, options); 70638 } else { 70639 vm.$options = mergeOptions( 70640 resolveConstructorOptions(vm.constructor), 70641 options || {}, 70642 vm 70643 ); 70644 } 70645 /* istanbul ignore else */ 70646 { 70647 initProxy(vm); 70648 } 70649 // expose real self 70650 vm._self = vm; 70651 initLifecycle(vm); 70652 initEvents(vm); 70653 initRender(vm); 70654 callHook(vm, 'beforeCreate'); 70655 initInjections(vm); // resolve injections before data/props 70656 initState(vm); 70657 initProvide(vm); // resolve provide after data/props 70658 callHook(vm, 'created'); 70659 70660 /* istanbul ignore if */ 70661 if (config.performance && mark) { 70662 vm._name = formatComponentName(vm, false); 70663 mark(endTag); 70664 measure(("vue " + (vm._name) + " init"), startTag, endTag); 70665 } 70666 70667 if (vm.$options.el) { 70668 vm.$mount(vm.$options.el); 70669 } 70670 }; 70671} 70672 70673function initInternalComponent (vm, options) { 70674 var opts = vm.$options = Object.create(vm.constructor.options); 70675 // doing this because it's faster than dynamic enumeration. 70676 var parentVnode = options._parentVnode; 70677 opts.parent = options.parent; 70678 opts._parentVnode = parentVnode; 70679 70680 var vnodeComponentOptions = parentVnode.componentOptions; 70681 opts.propsData = vnodeComponentOptions.propsData; 70682 opts._parentListeners = vnodeComponentOptions.listeners; 70683 opts._renderChildren = vnodeComponentOptions.children; 70684 opts._componentTag = vnodeComponentOptions.tag; 70685 70686 if (options.render) { 70687 opts.render = options.render; 70688 opts.staticRenderFns = options.staticRenderFns; 70689 } 70690} 70691 70692function resolveConstructorOptions (Ctor) { 70693 var options = Ctor.options; 70694 if (Ctor.super) { 70695 var superOptions = resolveConstructorOptions(Ctor.super); 70696 var cachedSuperOptions = Ctor.superOptions; 70697 if (superOptions !== cachedSuperOptions) { 70698 // super option changed, 70699 // need to resolve new options. 70700 Ctor.superOptions = superOptions; 70701 // check if there are any late-modified/attached options (#4976) 70702 var modifiedOptions = resolveModifiedOptions(Ctor); 70703 // update base extend options 70704 if (modifiedOptions) { 70705 extend(Ctor.extendOptions, modifiedOptions); 70706 } 70707 options = Ctor.options = mergeOptions(superOptions, Ctor.extendOptions); 70708 if (options.name) { 70709 options.components[options.name] = Ctor; 70710 } 70711 } 70712 } 70713 return options 70714} 70715 70716function resolveModifiedOptions (Ctor) { 70717 var modified; 70718 var latest = Ctor.options; 70719 var sealed = Ctor.sealedOptions; 70720 for (var key in latest) { 70721 if (latest[key] !== sealed[key]) { 70722 if (!modified) { modified = {}; } 70723 modified[key] = latest[key]; 70724 } 70725 } 70726 return modified 70727} 70728 70729function Vue (options) { 70730 if (!(this instanceof Vue) 70731 ) { 70732 warn('Vue is a constructor and should be called with the `new` keyword'); 70733 } 70734 this._init(options); 70735} 70736 70737initMixin(Vue); 70738stateMixin(Vue); 70739eventsMixin(Vue); 70740lifecycleMixin(Vue); 70741renderMixin(Vue); 70742 70743/* */ 70744 70745function initUse (Vue) { 70746 Vue.use = function (plugin) { 70747 var installedPlugins = (this._installedPlugins || (this._installedPlugins = [])); 70748 if (installedPlugins.indexOf(plugin) > -1) { 70749 return this 70750 } 70751 70752 // additional parameters 70753 var args = toArray(arguments, 1); 70754 args.unshift(this); 70755 if (typeof plugin.install === 'function') { 70756 plugin.install.apply(plugin, args); 70757 } else if (typeof plugin === 'function') { 70758 plugin.apply(null, args); 70759 } 70760 installedPlugins.push(plugin); 70761 return this 70762 }; 70763} 70764 70765/* */ 70766 70767function initMixin$1 (Vue) { 70768 Vue.mixin = function (mixin) { 70769 this.options = mergeOptions(this.options, mixin); 70770 return this 70771 }; 70772} 70773 70774/* */ 70775 70776function initExtend (Vue) { 70777 /** 70778 * Each instance constructor, including Vue, has a unique 70779 * cid. This enables us to create wrapped "child 70780 * constructors" for prototypal inheritance and cache them. 70781 */ 70782 Vue.cid = 0; 70783 var cid = 1; 70784 70785 /** 70786 * Class inheritance 70787 */ 70788 Vue.extend = function (extendOptions) { 70789 extendOptions = extendOptions || {}; 70790 var Super = this; 70791 var SuperId = Super.cid; 70792 var cachedCtors = extendOptions._Ctor || (extendOptions._Ctor = {}); 70793 if (cachedCtors[SuperId]) { 70794 return cachedCtors[SuperId] 70795 } 70796 70797 var name = extendOptions.name || Super.options.name; 70798 if (name) { 70799 validateComponentName(name); 70800 } 70801 70802 var Sub = function VueComponent (options) { 70803 this._init(options); 70804 }; 70805 Sub.prototype = Object.create(Super.prototype); 70806 Sub.prototype.constructor = Sub; 70807 Sub.cid = cid++; 70808 Sub.options = mergeOptions( 70809 Super.options, 70810 extendOptions 70811 ); 70812 Sub['super'] = Super; 70813 70814 // For props and computed properties, we define the proxy getters on 70815 // the Vue instances at extension time, on the extended prototype. This 70816 // avoids Object.defineProperty calls for each instance created. 70817 if (Sub.options.props) { 70818 initProps$1(Sub); 70819 } 70820 if (Sub.options.computed) { 70821 initComputed$1(Sub); 70822 } 70823 70824 // allow further extension/mixin/plugin usage 70825 Sub.extend = Super.extend; 70826 Sub.mixin = Super.mixin; 70827 Sub.use = Super.use; 70828 70829 // create asset registers, so extended classes 70830 // can have their private assets too. 70831 ASSET_TYPES.forEach(function (type) { 70832 Sub[type] = Super[type]; 70833 }); 70834 // enable recursive self-lookup 70835 if (name) { 70836 Sub.options.components[name] = Sub; 70837 } 70838 70839 // keep a reference to the super options at extension time. 70840 // later at instantiation we can check if Super's options have 70841 // been updated. 70842 Sub.superOptions = Super.options; 70843 Sub.extendOptions = extendOptions; 70844 Sub.sealedOptions = extend({}, Sub.options); 70845 70846 // cache constructor 70847 cachedCtors[SuperId] = Sub; 70848 return Sub 70849 }; 70850} 70851 70852function initProps$1 (Comp) { 70853 var props = Comp.options.props; 70854 for (var key in props) { 70855 proxy(Comp.prototype, "_props", key); 70856 } 70857} 70858 70859function initComputed$1 (Comp) { 70860 var computed = Comp.options.computed; 70861 for (var key in computed) { 70862 defineComputed(Comp.prototype, key, computed[key]); 70863 } 70864} 70865 70866/* */ 70867 70868function initAssetRegisters (Vue) { 70869 /** 70870 * Create asset registration methods. 70871 */ 70872 ASSET_TYPES.forEach(function (type) { 70873 Vue[type] = function ( 70874 id, 70875 definition 70876 ) { 70877 if (!definition) { 70878 return this.options[type + 's'][id] 70879 } else { 70880 /* istanbul ignore if */ 70881 if (type === 'component') { 70882 validateComponentName(id); 70883 } 70884 if (type === 'component' && isPlainObject(definition)) { 70885 definition.name = definition.name || id; 70886 definition = this.options._base.extend(definition); 70887 } 70888 if (type === 'directive' && typeof definition === 'function') { 70889 definition = { bind: definition, update: definition }; 70890 } 70891 this.options[type + 's'][id] = definition; 70892 return definition 70893 } 70894 }; 70895 }); 70896} 70897 70898/* */ 70899 70900 70901 70902 70903 70904function getComponentName (opts) { 70905 return opts && (opts.Ctor.options.name || opts.tag) 70906} 70907 70908function matches (pattern, name) { 70909 if (Array.isArray(pattern)) { 70910 return pattern.indexOf(name) > -1 70911 } else if (typeof pattern === 'string') { 70912 return pattern.split(',').indexOf(name) > -1 70913 } else if (isRegExp(pattern)) { 70914 return pattern.test(name) 70915 } 70916 /* istanbul ignore next */ 70917 return false 70918} 70919 70920function pruneCache (keepAliveInstance, filter) { 70921 var cache = keepAliveInstance.cache; 70922 var keys = keepAliveInstance.keys; 70923 var _vnode = keepAliveInstance._vnode; 70924 for (var key in cache) { 70925 var entry = cache[key]; 70926 if (entry) { 70927 var name = entry.name; 70928 if (name && !filter(name)) { 70929 pruneCacheEntry(cache, key, keys, _vnode); 70930 } 70931 } 70932 } 70933} 70934 70935function pruneCacheEntry ( 70936 cache, 70937 key, 70938 keys, 70939 current 70940) { 70941 var entry = cache[key]; 70942 if (entry && (!current || entry.tag !== current.tag)) { 70943 entry.componentInstance.$destroy(); 70944 } 70945 cache[key] = null; 70946 remove(keys, key); 70947} 70948 70949var patternTypes = [String, RegExp, Array]; 70950 70951var KeepAlive = { 70952 name: 'keep-alive', 70953 abstract: true, 70954 70955 props: { 70956 include: patternTypes, 70957 exclude: patternTypes, 70958 max: [String, Number] 70959 }, 70960 70961 methods: { 70962 cacheVNode: function cacheVNode() { 70963 var ref = this; 70964 var cache = ref.cache; 70965 var keys = ref.keys; 70966 var vnodeToCache = ref.vnodeToCache; 70967 var keyToCache = ref.keyToCache; 70968 if (vnodeToCache) { 70969 var tag = vnodeToCache.tag; 70970 var componentInstance = vnodeToCache.componentInstance; 70971 var componentOptions = vnodeToCache.componentOptions; 70972 cache[keyToCache] = { 70973 name: getComponentName(componentOptions), 70974 tag: tag, 70975 componentInstance: componentInstance, 70976 }; 70977 keys.push(keyToCache); 70978 // prune oldest entry 70979 if (this.max && keys.length > parseInt(this.max)) { 70980 pruneCacheEntry(cache, keys[0], keys, this._vnode); 70981 } 70982 this.vnodeToCache = null; 70983 } 70984 } 70985 }, 70986 70987 created: function created () { 70988 this.cache = Object.create(null); 70989 this.keys = []; 70990 }, 70991 70992 destroyed: function destroyed () { 70993 for (var key in this.cache) { 70994 pruneCacheEntry(this.cache, key, this.keys); 70995 } 70996 }, 70997 70998 mounted: function mounted () { 70999 var this$1 = this; 71000 71001 this.cacheVNode(); 71002 this.$watch('include', function (val) { 71003 pruneCache(this$1, function (name) { return matches(val, name); }); 71004 }); 71005 this.$watch('exclude', function (val) { 71006 pruneCache(this$1, function (name) { return !matches(val, name); }); 71007 }); 71008 }, 71009 71010 updated: function updated () { 71011 this.cacheVNode(); 71012 }, 71013 71014 render: function render () { 71015 var slot = this.$slots.default; 71016 var vnode = getFirstComponentChild(slot); 71017 var componentOptions = vnode && vnode.componentOptions; 71018 if (componentOptions) { 71019 // check pattern 71020 var name = getComponentName(componentOptions); 71021 var ref = this; 71022 var include = ref.include; 71023 var exclude = ref.exclude; 71024 if ( 71025 // not included 71026 (include && (!name || !matches(include, name))) || 71027 // excluded 71028 (exclude && name && matches(exclude, name)) 71029 ) { 71030 return vnode 71031 } 71032 71033 var ref$1 = this; 71034 var cache = ref$1.cache; 71035 var keys = ref$1.keys; 71036 var key = vnode.key == null 71037 // same constructor may get registered as different local components 71038 // so cid alone is not enough (#3269) 71039 ? componentOptions.Ctor.cid + (componentOptions.tag ? ("::" + (componentOptions.tag)) : '') 71040 : vnode.key; 71041 if (cache[key]) { 71042 vnode.componentInstance = cache[key].componentInstance; 71043 // make current key freshest 71044 remove(keys, key); 71045 keys.push(key); 71046 } else { 71047 // delay setting the cache until update 71048 this.vnodeToCache = vnode; 71049 this.keyToCache = key; 71050 } 71051 71052 vnode.data.keepAlive = true; 71053 } 71054 return vnode || (slot && slot[0]) 71055 } 71056}; 71057 71058var builtInComponents = { 71059 KeepAlive: KeepAlive 71060}; 71061 71062/* */ 71063 71064function initGlobalAPI (Vue) { 71065 // config 71066 var configDef = {}; 71067 configDef.get = function () { return config; }; 71068 { 71069 configDef.set = function () { 71070 warn( 71071 'Do not replace the Vue.config object, set individual fields instead.' 71072 ); 71073 }; 71074 } 71075 Object.defineProperty(Vue, 'config', configDef); 71076 71077 // exposed util methods. 71078 // NOTE: these are not considered part of the public API - avoid relying on 71079 // them unless you are aware of the risk. 71080 Vue.util = { 71081 warn: warn, 71082 extend: extend, 71083 mergeOptions: mergeOptions, 71084 defineReactive: defineReactive$$1 71085 }; 71086 71087 Vue.set = set; 71088 Vue.delete = del; 71089 Vue.nextTick = nextTick; 71090 71091 // 2.6 explicit observable API 71092 Vue.observable = function (obj) { 71093 observe(obj); 71094 return obj 71095 }; 71096 71097 Vue.options = Object.create(null); 71098 ASSET_TYPES.forEach(function (type) { 71099 Vue.options[type + 's'] = Object.create(null); 71100 }); 71101 71102 // this is used to identify the "base" constructor to extend all plain-object 71103 // components with in Weex's multi-instance scenarios. 71104 Vue.options._base = Vue; 71105 71106 extend(Vue.options.components, builtInComponents); 71107 71108 initUse(Vue); 71109 initMixin$1(Vue); 71110 initExtend(Vue); 71111 initAssetRegisters(Vue); 71112} 71113 71114initGlobalAPI(Vue); 71115 71116Object.defineProperty(Vue.prototype, '$isServer', { 71117 get: isServerRendering 71118}); 71119 71120Object.defineProperty(Vue.prototype, '$ssrContext', { 71121 get: function get () { 71122 /* istanbul ignore next */ 71123 return this.$vnode && this.$vnode.ssrContext 71124 } 71125}); 71126 71127// expose FunctionalRenderContext for ssr runtime helper installation 71128Object.defineProperty(Vue, 'FunctionalRenderContext', { 71129 value: FunctionalRenderContext 71130}); 71131 71132Vue.version = '2.6.14'; 71133 71134/* */ 71135 71136// these are reserved for web because they are directly compiled away 71137// during template compilation 71138var isReservedAttr = makeMap('style,class'); 71139 71140// attributes that should be using props for binding 71141var acceptValue = makeMap('input,textarea,option,select,progress'); 71142var mustUseProp = function (tag, type, attr) { 71143 return ( 71144 (attr === 'value' && acceptValue(tag)) && type !== 'button' || 71145 (attr === 'selected' && tag === 'option') || 71146 (attr === 'checked' && tag === 'input') || 71147 (attr === 'muted' && tag === 'video') 71148 ) 71149}; 71150 71151var isEnumeratedAttr = makeMap('contenteditable,draggable,spellcheck'); 71152 71153var isValidContentEditableValue = makeMap('events,caret,typing,plaintext-only'); 71154 71155var convertEnumeratedValue = function (key, value) { 71156 return isFalsyAttrValue(value) || value === 'false' 71157 ? 'false' 71158 // allow arbitrary string value for contenteditable 71159 : key === 'contenteditable' && isValidContentEditableValue(value) 71160 ? value 71161 : 'true' 71162}; 71163 71164var isBooleanAttr = makeMap( 71165 'allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,' + 71166 'default,defaultchecked,defaultmuted,defaultselected,defer,disabled,' + 71167 'enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,' + 71168 'muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,' + 71169 'required,reversed,scoped,seamless,selected,sortable,' + 71170 'truespeed,typemustmatch,visible' 71171); 71172 71173var xlinkNS = 'http://www.w3.org/1999/xlink'; 71174 71175var isXlink = function (name) { 71176 return name.charAt(5) === ':' && name.slice(0, 5) === 'xlink' 71177}; 71178 71179var getXlinkProp = function (name) { 71180 return isXlink(name) ? name.slice(6, name.length) : '' 71181}; 71182 71183var isFalsyAttrValue = function (val) { 71184 return val == null || val === false 71185}; 71186 71187/* */ 71188 71189function genClassForVnode (vnode) { 71190 var data = vnode.data; 71191 var parentNode = vnode; 71192 var childNode = vnode; 71193 while (isDef(childNode.componentInstance)) { 71194 childNode = childNode.componentInstance._vnode; 71195 if (childNode && childNode.data) { 71196 data = mergeClassData(childNode.data, data); 71197 } 71198 } 71199 while (isDef(parentNode = parentNode.parent)) { 71200 if (parentNode && parentNode.data) { 71201 data = mergeClassData(data, parentNode.data); 71202 } 71203 } 71204 return renderClass(data.staticClass, data.class) 71205} 71206 71207function mergeClassData (child, parent) { 71208 return { 71209 staticClass: concat(child.staticClass, parent.staticClass), 71210 class: isDef(child.class) 71211 ? [child.class, parent.class] 71212 : parent.class 71213 } 71214} 71215 71216function renderClass ( 71217 staticClass, 71218 dynamicClass 71219) { 71220 if (isDef(staticClass) || isDef(dynamicClass)) { 71221 return concat(staticClass, stringifyClass(dynamicClass)) 71222 } 71223 /* istanbul ignore next */ 71224 return '' 71225} 71226 71227function concat (a, b) { 71228 return a ? b ? (a + ' ' + b) : a : (b || '') 71229} 71230 71231function stringifyClass (value) { 71232 if (Array.isArray(value)) { 71233 return stringifyArray(value) 71234 } 71235 if (isObject(value)) { 71236 return stringifyObject(value) 71237 } 71238 if (typeof value === 'string') { 71239 return value 71240 } 71241 /* istanbul ignore next */ 71242 return '' 71243} 71244 71245function stringifyArray (value) { 71246 var res = ''; 71247 var stringified; 71248 for (var i = 0, l = value.length; i < l; i++) { 71249 if (isDef(stringified = stringifyClass(value[i])) && stringified !== '') { 71250 if (res) { res += ' '; } 71251 res += stringified; 71252 } 71253 } 71254 return res 71255} 71256 71257function stringifyObject (value) { 71258 var res = ''; 71259 for (var key in value) { 71260 if (value[key]) { 71261 if (res) { res += ' '; } 71262 res += key; 71263 } 71264 } 71265 return res 71266} 71267 71268/* */ 71269 71270var namespaceMap = { 71271 svg: 'http://www.w3.org/2000/svg', 71272 math: 'http://www.w3.org/1998/Math/MathML' 71273}; 71274 71275var isHTMLTag = makeMap( 71276 'html,body,base,head,link,meta,style,title,' + 71277 'address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,' + 71278 'div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,' + 71279 'a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,' + 71280 's,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,' + 71281 'embed,object,param,source,canvas,script,noscript,del,ins,' + 71282 'caption,col,colgroup,table,thead,tbody,td,th,tr,' + 71283 'button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,' + 71284 'output,progress,select,textarea,' + 71285 'details,dialog,menu,menuitem,summary,' + 71286 'content,element,shadow,template,blockquote,iframe,tfoot' 71287); 71288 71289// this map is intentionally selective, only covering SVG elements that may 71290// contain child elements. 71291var isSVG = makeMap( 71292 'svg,animate,circle,clippath,cursor,defs,desc,ellipse,filter,font-face,' + 71293 'foreignobject,g,glyph,image,line,marker,mask,missing-glyph,path,pattern,' + 71294 'polygon,polyline,rect,switch,symbol,text,textpath,tspan,use,view', 71295 true 71296); 71297 71298var isPreTag = function (tag) { return tag === 'pre'; }; 71299 71300var isReservedTag = function (tag) { 71301 return isHTMLTag(tag) || isSVG(tag) 71302}; 71303 71304function getTagNamespace (tag) { 71305 if (isSVG(tag)) { 71306 return 'svg' 71307 } 71308 // basic support for MathML 71309 // note it doesn't support other MathML elements being component roots 71310 if (tag === 'math') { 71311 return 'math' 71312 } 71313} 71314 71315var unknownElementCache = Object.create(null); 71316function isUnknownElement (tag) { 71317 /* istanbul ignore if */ 71318 if (!inBrowser) { 71319 return true 71320 } 71321 if (isReservedTag(tag)) { 71322 return false 71323 } 71324 tag = tag.toLowerCase(); 71325 /* istanbul ignore if */ 71326 if (unknownElementCache[tag] != null) { 71327 return unknownElementCache[tag] 71328 } 71329 var el = document.createElement(tag); 71330 if (tag.indexOf('-') > -1) { 71331 // http://stackoverflow.com/a/28210364/1070244 71332 return (unknownElementCache[tag] = ( 71333 el.constructor === window.HTMLUnknownElement || 71334 el.constructor === window.HTMLElement 71335 )) 71336 } else { 71337 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString())) 71338 } 71339} 71340 71341var isTextInputType = makeMap('text,number,password,search,email,tel,url'); 71342 71343/* */ 71344 71345/** 71346 * Query an element selector if it's not an element already. 71347 */ 71348function query (el) { 71349 if (typeof el === 'string') { 71350 var selected = document.querySelector(el); 71351 if (!selected) { 71352 warn( 71353 'Cannot find element: ' + el 71354 ); 71355 return document.createElement('div') 71356 } 71357 return selected 71358 } else { 71359 return el 71360 } 71361} 71362 71363/* */ 71364 71365function createElement$1 (tagName, vnode) { 71366 var elm = document.createElement(tagName); 71367 if (tagName !== 'select') { 71368 return elm 71369 } 71370 // false or null will remove the attribute but undefined will not 71371 if (vnode.data && vnode.data.attrs && vnode.data.attrs.multiple !== undefined) { 71372 elm.setAttribute('multiple', 'multiple'); 71373 } 71374 return elm 71375} 71376 71377function createElementNS (namespace, tagName) { 71378 return document.createElementNS(namespaceMap[namespace], tagName) 71379} 71380 71381function createTextNode (text) { 71382 return document.createTextNode(text) 71383} 71384 71385function createComment (text) { 71386 return document.createComment(text) 71387} 71388 71389function insertBefore (parentNode, newNode, referenceNode) { 71390 parentNode.insertBefore(newNode, referenceNode); 71391} 71392 71393function removeChild (node, child) { 71394 node.removeChild(child); 71395} 71396 71397function appendChild (node, child) { 71398 node.appendChild(child); 71399} 71400 71401function parentNode (node) { 71402 return node.parentNode 71403} 71404 71405function nextSibling (node) { 71406 return node.nextSibling 71407} 71408 71409function tagName (node) { 71410 return node.tagName 71411} 71412 71413function setTextContent (node, text) { 71414 node.textContent = text; 71415} 71416 71417function setStyleScope (node, scopeId) { 71418 node.setAttribute(scopeId, ''); 71419} 71420 71421var nodeOps = /*#__PURE__*/Object.freeze({ 71422 createElement: createElement$1, 71423 createElementNS: createElementNS, 71424 createTextNode: createTextNode, 71425 createComment: createComment, 71426 insertBefore: insertBefore, 71427 removeChild: removeChild, 71428 appendChild: appendChild, 71429 parentNode: parentNode, 71430 nextSibling: nextSibling, 71431 tagName: tagName, 71432 setTextContent: setTextContent, 71433 setStyleScope: setStyleScope 71434}); 71435 71436/* */ 71437 71438var ref = { 71439 create: function create (_, vnode) { 71440 registerRef(vnode); 71441 }, 71442 update: function update (oldVnode, vnode) { 71443 if (oldVnode.data.ref !== vnode.data.ref) { 71444 registerRef(oldVnode, true); 71445 registerRef(vnode); 71446 } 71447 }, 71448 destroy: function destroy (vnode) { 71449 registerRef(vnode, true); 71450 } 71451}; 71452 71453function registerRef (vnode, isRemoval) { 71454 var key = vnode.data.ref; 71455 if (!isDef(key)) { return } 71456 71457 var vm = vnode.context; 71458 var ref = vnode.componentInstance || vnode.elm; 71459 var refs = vm.$refs; 71460 if (isRemoval) { 71461 if (Array.isArray(refs[key])) { 71462 remove(refs[key], ref); 71463 } else if (refs[key] === ref) { 71464 refs[key] = undefined; 71465 } 71466 } else { 71467 if (vnode.data.refInFor) { 71468 if (!Array.isArray(refs[key])) { 71469 refs[key] = [ref]; 71470 } else if (refs[key].indexOf(ref) < 0) { 71471 // $flow-disable-line 71472 refs[key].push(ref); 71473 } 71474 } else { 71475 refs[key] = ref; 71476 } 71477 } 71478} 71479 71480/** 71481 * Virtual DOM patching algorithm based on Snabbdom by 71482 * Simon Friis Vindum (@paldepind) 71483 * Licensed under the MIT License 71484 * https://github.com/paldepind/snabbdom/blob/master/LICENSE 71485 * 71486 * modified by Evan You (@yyx990803) 71487 * 71488 * Not type-checking this because this file is perf-critical and the cost 71489 * of making flow understand it is not worth it. 71490 */ 71491 71492var emptyNode = new VNode('', {}, []); 71493 71494var hooks = ['create', 'activate', 'update', 'remove', 'destroy']; 71495 71496function sameVnode (a, b) { 71497 return ( 71498 a.key === b.key && 71499 a.asyncFactory === b.asyncFactory && ( 71500 ( 71501 a.tag === b.tag && 71502 a.isComment === b.isComment && 71503 isDef(a.data) === isDef(b.data) && 71504 sameInputType(a, b) 71505 ) || ( 71506 isTrue(a.isAsyncPlaceholder) && 71507 isUndef(b.asyncFactory.error) 71508 ) 71509 ) 71510 ) 71511} 71512 71513function sameInputType (a, b) { 71514 if (a.tag !== 'input') { return true } 71515 var i; 71516 var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; 71517 var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type; 71518 return typeA === typeB || isTextInputType(typeA) && isTextInputType(typeB) 71519} 71520 71521function createKeyToOldIdx (children, beginIdx, endIdx) { 71522 var i, key; 71523 var map = {}; 71524 for (i = beginIdx; i <= endIdx; ++i) { 71525 key = children[i].key; 71526 if (isDef(key)) { map[key] = i; } 71527 } 71528 return map 71529} 71530 71531function createPatchFunction (backend) { 71532 var i, j; 71533 var cbs = {}; 71534 71535 var modules = backend.modules; 71536 var nodeOps = backend.nodeOps; 71537 71538 for (i = 0; i < hooks.length; ++i) { 71539 cbs[hooks[i]] = []; 71540 for (j = 0; j < modules.length; ++j) { 71541 if (isDef(modules[j][hooks[i]])) { 71542 cbs[hooks[i]].push(modules[j][hooks[i]]); 71543 } 71544 } 71545 } 71546 71547 function emptyNodeAt (elm) { 71548 return new VNode(nodeOps.tagName(elm).toLowerCase(), {}, [], undefined, elm) 71549 } 71550 71551 function createRmCb (childElm, listeners) { 71552 function remove$$1 () { 71553 if (--remove$$1.listeners === 0) { 71554 removeNode(childElm); 71555 } 71556 } 71557 remove$$1.listeners = listeners; 71558 return remove$$1 71559 } 71560 71561 function removeNode (el) { 71562 var parent = nodeOps.parentNode(el); 71563 // element may have already been removed due to v-html / v-text 71564 if (isDef(parent)) { 71565 nodeOps.removeChild(parent, el); 71566 } 71567 } 71568 71569 function isUnknownElement$$1 (vnode, inVPre) { 71570 return ( 71571 !inVPre && 71572 !vnode.ns && 71573 !( 71574 config.ignoredElements.length && 71575 config.ignoredElements.some(function (ignore) { 71576 return isRegExp(ignore) 71577 ? ignore.test(vnode.tag) 71578 : ignore === vnode.tag 71579 }) 71580 ) && 71581 config.isUnknownElement(vnode.tag) 71582 ) 71583 } 71584 71585 var creatingElmInVPre = 0; 71586 71587 function createElm ( 71588 vnode, 71589 insertedVnodeQueue, 71590 parentElm, 71591 refElm, 71592 nested, 71593 ownerArray, 71594 index 71595 ) { 71596 if (isDef(vnode.elm) && isDef(ownerArray)) { 71597 // This vnode was used in a previous render! 71598 // now it's used as a new node, overwriting its elm would cause 71599 // potential patch errors down the road when it's used as an insertion 71600 // reference node. Instead, we clone the node on-demand before creating 71601 // associated DOM element for it. 71602 vnode = ownerArray[index] = cloneVNode(vnode); 71603 } 71604 71605 vnode.isRootInsert = !nested; // for transition enter check 71606 if (createComponent(vnode, insertedVnodeQueue, parentElm, refElm)) { 71607 return 71608 } 71609 71610 var data = vnode.data; 71611 var children = vnode.children; 71612 var tag = vnode.tag; 71613 if (isDef(tag)) { 71614 { 71615 if (data && data.pre) { 71616 creatingElmInVPre++; 71617 } 71618 if (isUnknownElement$$1(vnode, creatingElmInVPre)) { 71619 warn( 71620 'Unknown custom element: <' + tag + '> - did you ' + 71621 'register the component correctly? For recursive components, ' + 71622 'make sure to provide the "name" option.', 71623 vnode.context 71624 ); 71625 } 71626 } 71627 71628 vnode.elm = vnode.ns 71629 ? nodeOps.createElementNS(vnode.ns, tag) 71630 : nodeOps.createElement(tag, vnode); 71631 setScope(vnode); 71632 71633 /* istanbul ignore if */ 71634 { 71635 createChildren(vnode, children, insertedVnodeQueue); 71636 if (isDef(data)) { 71637 invokeCreateHooks(vnode, insertedVnodeQueue); 71638 } 71639 insert(parentElm, vnode.elm, refElm); 71640 } 71641 71642 if (data && data.pre) { 71643 creatingElmInVPre--; 71644 } 71645 } else if (isTrue(vnode.isComment)) { 71646 vnode.elm = nodeOps.createComment(vnode.text); 71647 insert(parentElm, vnode.elm, refElm); 71648 } else { 71649 vnode.elm = nodeOps.createTextNode(vnode.text); 71650 insert(parentElm, vnode.elm, refElm); 71651 } 71652 } 71653 71654 function createComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 71655 var i = vnode.data; 71656 if (isDef(i)) { 71657 var isReactivated = isDef(vnode.componentInstance) && i.keepAlive; 71658 if (isDef(i = i.hook) && isDef(i = i.init)) { 71659 i(vnode, false /* hydrating */); 71660 } 71661 // after calling the init hook, if the vnode is a child component 71662 // it should've created a child instance and mounted it. the child 71663 // component also has set the placeholder vnode's elm. 71664 // in that case we can just return the element and be done. 71665 if (isDef(vnode.componentInstance)) { 71666 initComponent(vnode, insertedVnodeQueue); 71667 insert(parentElm, vnode.elm, refElm); 71668 if (isTrue(isReactivated)) { 71669 reactivateComponent(vnode, insertedVnodeQueue, parentElm, refElm); 71670 } 71671 return true 71672 } 71673 } 71674 } 71675 71676 function initComponent (vnode, insertedVnodeQueue) { 71677 if (isDef(vnode.data.pendingInsert)) { 71678 insertedVnodeQueue.push.apply(insertedVnodeQueue, vnode.data.pendingInsert); 71679 vnode.data.pendingInsert = null; 71680 } 71681 vnode.elm = vnode.componentInstance.$el; 71682 if (isPatchable(vnode)) { 71683 invokeCreateHooks(vnode, insertedVnodeQueue); 71684 setScope(vnode); 71685 } else { 71686 // empty component root. 71687 // skip all element-related modules except for ref (#3455) 71688 registerRef(vnode); 71689 // make sure to invoke the insert hook 71690 insertedVnodeQueue.push(vnode); 71691 } 71692 } 71693 71694 function reactivateComponent (vnode, insertedVnodeQueue, parentElm, refElm) { 71695 var i; 71696 // hack for #4339: a reactivated component with inner transition 71697 // does not trigger because the inner node's created hooks are not called 71698 // again. It's not ideal to involve module-specific logic in here but 71699 // there doesn't seem to be a better way to do it. 71700 var innerNode = vnode; 71701 while (innerNode.componentInstance) { 71702 innerNode = innerNode.componentInstance._vnode; 71703 if (isDef(i = innerNode.data) && isDef(i = i.transition)) { 71704 for (i = 0; i < cbs.activate.length; ++i) { 71705 cbs.activate[i](emptyNode, innerNode); 71706 } 71707 insertedVnodeQueue.push(innerNode); 71708 break 71709 } 71710 } 71711 // unlike a newly created component, 71712 // a reactivated keep-alive component doesn't insert itself 71713 insert(parentElm, vnode.elm, refElm); 71714 } 71715 71716 function insert (parent, elm, ref$$1) { 71717 if (isDef(parent)) { 71718 if (isDef(ref$$1)) { 71719 if (nodeOps.parentNode(ref$$1) === parent) { 71720 nodeOps.insertBefore(parent, elm, ref$$1); 71721 } 71722 } else { 71723 nodeOps.appendChild(parent, elm); 71724 } 71725 } 71726 } 71727 71728 function createChildren (vnode, children, insertedVnodeQueue) { 71729 if (Array.isArray(children)) { 71730 { 71731 checkDuplicateKeys(children); 71732 } 71733 for (var i = 0; i < children.length; ++i) { 71734 createElm(children[i], insertedVnodeQueue, vnode.elm, null, true, children, i); 71735 } 71736 } else if (isPrimitive(vnode.text)) { 71737 nodeOps.appendChild(vnode.elm, nodeOps.createTextNode(String(vnode.text))); 71738 } 71739 } 71740 71741 function isPatchable (vnode) { 71742 while (vnode.componentInstance) { 71743 vnode = vnode.componentInstance._vnode; 71744 } 71745 return isDef(vnode.tag) 71746 } 71747 71748 function invokeCreateHooks (vnode, insertedVnodeQueue) { 71749 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 71750 cbs.create[i$1](emptyNode, vnode); 71751 } 71752 i = vnode.data.hook; // Reuse variable 71753 if (isDef(i)) { 71754 if (isDef(i.create)) { i.create(emptyNode, vnode); } 71755 if (isDef(i.insert)) { insertedVnodeQueue.push(vnode); } 71756 } 71757 } 71758 71759 // set scope id attribute for scoped CSS. 71760 // this is implemented as a special case to avoid the overhead 71761 // of going through the normal attribute patching process. 71762 function setScope (vnode) { 71763 var i; 71764 if (isDef(i = vnode.fnScopeId)) { 71765 nodeOps.setStyleScope(vnode.elm, i); 71766 } else { 71767 var ancestor = vnode; 71768 while (ancestor) { 71769 if (isDef(i = ancestor.context) && isDef(i = i.$options._scopeId)) { 71770 nodeOps.setStyleScope(vnode.elm, i); 71771 } 71772 ancestor = ancestor.parent; 71773 } 71774 } 71775 // for slot content they should also get the scopeId from the host instance. 71776 if (isDef(i = activeInstance) && 71777 i !== vnode.context && 71778 i !== vnode.fnContext && 71779 isDef(i = i.$options._scopeId) 71780 ) { 71781 nodeOps.setStyleScope(vnode.elm, i); 71782 } 71783 } 71784 71785 function addVnodes (parentElm, refElm, vnodes, startIdx, endIdx, insertedVnodeQueue) { 71786 for (; startIdx <= endIdx; ++startIdx) { 71787 createElm(vnodes[startIdx], insertedVnodeQueue, parentElm, refElm, false, vnodes, startIdx); 71788 } 71789 } 71790 71791 function invokeDestroyHook (vnode) { 71792 var i, j; 71793 var data = vnode.data; 71794 if (isDef(data)) { 71795 if (isDef(i = data.hook) && isDef(i = i.destroy)) { i(vnode); } 71796 for (i = 0; i < cbs.destroy.length; ++i) { cbs.destroy[i](vnode); } 71797 } 71798 if (isDef(i = vnode.children)) { 71799 for (j = 0; j < vnode.children.length; ++j) { 71800 invokeDestroyHook(vnode.children[j]); 71801 } 71802 } 71803 } 71804 71805 function removeVnodes (vnodes, startIdx, endIdx) { 71806 for (; startIdx <= endIdx; ++startIdx) { 71807 var ch = vnodes[startIdx]; 71808 if (isDef(ch)) { 71809 if (isDef(ch.tag)) { 71810 removeAndInvokeRemoveHook(ch); 71811 invokeDestroyHook(ch); 71812 } else { // Text node 71813 removeNode(ch.elm); 71814 } 71815 } 71816 } 71817 } 71818 71819 function removeAndInvokeRemoveHook (vnode, rm) { 71820 if (isDef(rm) || isDef(vnode.data)) { 71821 var i; 71822 var listeners = cbs.remove.length + 1; 71823 if (isDef(rm)) { 71824 // we have a recursively passed down rm callback 71825 // increase the listeners count 71826 rm.listeners += listeners; 71827 } else { 71828 // directly removing 71829 rm = createRmCb(vnode.elm, listeners); 71830 } 71831 // recursively invoke hooks on child component root node 71832 if (isDef(i = vnode.componentInstance) && isDef(i = i._vnode) && isDef(i.data)) { 71833 removeAndInvokeRemoveHook(i, rm); 71834 } 71835 for (i = 0; i < cbs.remove.length; ++i) { 71836 cbs.remove[i](vnode, rm); 71837 } 71838 if (isDef(i = vnode.data.hook) && isDef(i = i.remove)) { 71839 i(vnode, rm); 71840 } else { 71841 rm(); 71842 } 71843 } else { 71844 removeNode(vnode.elm); 71845 } 71846 } 71847 71848 function updateChildren (parentElm, oldCh, newCh, insertedVnodeQueue, removeOnly) { 71849 var oldStartIdx = 0; 71850 var newStartIdx = 0; 71851 var oldEndIdx = oldCh.length - 1; 71852 var oldStartVnode = oldCh[0]; 71853 var oldEndVnode = oldCh[oldEndIdx]; 71854 var newEndIdx = newCh.length - 1; 71855 var newStartVnode = newCh[0]; 71856 var newEndVnode = newCh[newEndIdx]; 71857 var oldKeyToIdx, idxInOld, vnodeToMove, refElm; 71858 71859 // removeOnly is a special flag used only by <transition-group> 71860 // to ensure removed elements stay in correct relative positions 71861 // during leaving transitions 71862 var canMove = !removeOnly; 71863 71864 { 71865 checkDuplicateKeys(newCh); 71866 } 71867 71868 while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) { 71869 if (isUndef(oldStartVnode)) { 71870 oldStartVnode = oldCh[++oldStartIdx]; // Vnode has been moved left 71871 } else if (isUndef(oldEndVnode)) { 71872 oldEndVnode = oldCh[--oldEndIdx]; 71873 } else if (sameVnode(oldStartVnode, newStartVnode)) { 71874 patchVnode(oldStartVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 71875 oldStartVnode = oldCh[++oldStartIdx]; 71876 newStartVnode = newCh[++newStartIdx]; 71877 } else if (sameVnode(oldEndVnode, newEndVnode)) { 71878 patchVnode(oldEndVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); 71879 oldEndVnode = oldCh[--oldEndIdx]; 71880 newEndVnode = newCh[--newEndIdx]; 71881 } else if (sameVnode(oldStartVnode, newEndVnode)) { // Vnode moved right 71882 patchVnode(oldStartVnode, newEndVnode, insertedVnodeQueue, newCh, newEndIdx); 71883 canMove && nodeOps.insertBefore(parentElm, oldStartVnode.elm, nodeOps.nextSibling(oldEndVnode.elm)); 71884 oldStartVnode = oldCh[++oldStartIdx]; 71885 newEndVnode = newCh[--newEndIdx]; 71886 } else if (sameVnode(oldEndVnode, newStartVnode)) { // Vnode moved left 71887 patchVnode(oldEndVnode, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 71888 canMove && nodeOps.insertBefore(parentElm, oldEndVnode.elm, oldStartVnode.elm); 71889 oldEndVnode = oldCh[--oldEndIdx]; 71890 newStartVnode = newCh[++newStartIdx]; 71891 } else { 71892 if (isUndef(oldKeyToIdx)) { oldKeyToIdx = createKeyToOldIdx(oldCh, oldStartIdx, oldEndIdx); } 71893 idxInOld = isDef(newStartVnode.key) 71894 ? oldKeyToIdx[newStartVnode.key] 71895 : findIdxInOld(newStartVnode, oldCh, oldStartIdx, oldEndIdx); 71896 if (isUndef(idxInOld)) { // New element 71897 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 71898 } else { 71899 vnodeToMove = oldCh[idxInOld]; 71900 if (sameVnode(vnodeToMove, newStartVnode)) { 71901 patchVnode(vnodeToMove, newStartVnode, insertedVnodeQueue, newCh, newStartIdx); 71902 oldCh[idxInOld] = undefined; 71903 canMove && nodeOps.insertBefore(parentElm, vnodeToMove.elm, oldStartVnode.elm); 71904 } else { 71905 // same key but different element. treat as new element 71906 createElm(newStartVnode, insertedVnodeQueue, parentElm, oldStartVnode.elm, false, newCh, newStartIdx); 71907 } 71908 } 71909 newStartVnode = newCh[++newStartIdx]; 71910 } 71911 } 71912 if (oldStartIdx > oldEndIdx) { 71913 refElm = isUndef(newCh[newEndIdx + 1]) ? null : newCh[newEndIdx + 1].elm; 71914 addVnodes(parentElm, refElm, newCh, newStartIdx, newEndIdx, insertedVnodeQueue); 71915 } else if (newStartIdx > newEndIdx) { 71916 removeVnodes(oldCh, oldStartIdx, oldEndIdx); 71917 } 71918 } 71919 71920 function checkDuplicateKeys (children) { 71921 var seenKeys = {}; 71922 for (var i = 0; i < children.length; i++) { 71923 var vnode = children[i]; 71924 var key = vnode.key; 71925 if (isDef(key)) { 71926 if (seenKeys[key]) { 71927 warn( 71928 ("Duplicate keys detected: '" + key + "'. This may cause an update error."), 71929 vnode.context 71930 ); 71931 } else { 71932 seenKeys[key] = true; 71933 } 71934 } 71935 } 71936 } 71937 71938 function findIdxInOld (node, oldCh, start, end) { 71939 for (var i = start; i < end; i++) { 71940 var c = oldCh[i]; 71941 if (isDef(c) && sameVnode(node, c)) { return i } 71942 } 71943 } 71944 71945 function patchVnode ( 71946 oldVnode, 71947 vnode, 71948 insertedVnodeQueue, 71949 ownerArray, 71950 index, 71951 removeOnly 71952 ) { 71953 if (oldVnode === vnode) { 71954 return 71955 } 71956 71957 if (isDef(vnode.elm) && isDef(ownerArray)) { 71958 // clone reused vnode 71959 vnode = ownerArray[index] = cloneVNode(vnode); 71960 } 71961 71962 var elm = vnode.elm = oldVnode.elm; 71963 71964 if (isTrue(oldVnode.isAsyncPlaceholder)) { 71965 if (isDef(vnode.asyncFactory.resolved)) { 71966 hydrate(oldVnode.elm, vnode, insertedVnodeQueue); 71967 } else { 71968 vnode.isAsyncPlaceholder = true; 71969 } 71970 return 71971 } 71972 71973 // reuse element for static trees. 71974 // note we only do this if the vnode is cloned - 71975 // if the new node is not cloned it means the render functions have been 71976 // reset by the hot-reload-api and we need to do a proper re-render. 71977 if (isTrue(vnode.isStatic) && 71978 isTrue(oldVnode.isStatic) && 71979 vnode.key === oldVnode.key && 71980 (isTrue(vnode.isCloned) || isTrue(vnode.isOnce)) 71981 ) { 71982 vnode.componentInstance = oldVnode.componentInstance; 71983 return 71984 } 71985 71986 var i; 71987 var data = vnode.data; 71988 if (isDef(data) && isDef(i = data.hook) && isDef(i = i.prepatch)) { 71989 i(oldVnode, vnode); 71990 } 71991 71992 var oldCh = oldVnode.children; 71993 var ch = vnode.children; 71994 if (isDef(data) && isPatchable(vnode)) { 71995 for (i = 0; i < cbs.update.length; ++i) { cbs.update[i](oldVnode, vnode); } 71996 if (isDef(i = data.hook) && isDef(i = i.update)) { i(oldVnode, vnode); } 71997 } 71998 if (isUndef(vnode.text)) { 71999 if (isDef(oldCh) && isDef(ch)) { 72000 if (oldCh !== ch) { updateChildren(elm, oldCh, ch, insertedVnodeQueue, removeOnly); } 72001 } else if (isDef(ch)) { 72002 { 72003 checkDuplicateKeys(ch); 72004 } 72005 if (isDef(oldVnode.text)) { nodeOps.setTextContent(elm, ''); } 72006 addVnodes(elm, null, ch, 0, ch.length - 1, insertedVnodeQueue); 72007 } else if (isDef(oldCh)) { 72008 removeVnodes(oldCh, 0, oldCh.length - 1); 72009 } else if (isDef(oldVnode.text)) { 72010 nodeOps.setTextContent(elm, ''); 72011 } 72012 } else if (oldVnode.text !== vnode.text) { 72013 nodeOps.setTextContent(elm, vnode.text); 72014 } 72015 if (isDef(data)) { 72016 if (isDef(i = data.hook) && isDef(i = i.postpatch)) { i(oldVnode, vnode); } 72017 } 72018 } 72019 72020 function invokeInsertHook (vnode, queue, initial) { 72021 // delay insert hooks for component root nodes, invoke them after the 72022 // element is really inserted 72023 if (isTrue(initial) && isDef(vnode.parent)) { 72024 vnode.parent.data.pendingInsert = queue; 72025 } else { 72026 for (var i = 0; i < queue.length; ++i) { 72027 queue[i].data.hook.insert(queue[i]); 72028 } 72029 } 72030 } 72031 72032 var hydrationBailed = false; 72033 // list of modules that can skip create hook during hydration because they 72034 // are already rendered on the client or has no need for initialization 72035 // Note: style is excluded because it relies on initial clone for future 72036 // deep updates (#7063). 72037 var isRenderedModule = makeMap('attrs,class,staticClass,staticStyle,key'); 72038 72039 // Note: this is a browser-only function so we can assume elms are DOM nodes. 72040 function hydrate (elm, vnode, insertedVnodeQueue, inVPre) { 72041 var i; 72042 var tag = vnode.tag; 72043 var data = vnode.data; 72044 var children = vnode.children; 72045 inVPre = inVPre || (data && data.pre); 72046 vnode.elm = elm; 72047 72048 if (isTrue(vnode.isComment) && isDef(vnode.asyncFactory)) { 72049 vnode.isAsyncPlaceholder = true; 72050 return true 72051 } 72052 // assert node match 72053 { 72054 if (!assertNodeMatch(elm, vnode, inVPre)) { 72055 return false 72056 } 72057 } 72058 if (isDef(data)) { 72059 if (isDef(i = data.hook) && isDef(i = i.init)) { i(vnode, true /* hydrating */); } 72060 if (isDef(i = vnode.componentInstance)) { 72061 // child component. it should have hydrated its own tree. 72062 initComponent(vnode, insertedVnodeQueue); 72063 return true 72064 } 72065 } 72066 if (isDef(tag)) { 72067 if (isDef(children)) { 72068 // empty element, allow client to pick up and populate children 72069 if (!elm.hasChildNodes()) { 72070 createChildren(vnode, children, insertedVnodeQueue); 72071 } else { 72072 // v-html and domProps: innerHTML 72073 if (isDef(i = data) && isDef(i = i.domProps) && isDef(i = i.innerHTML)) { 72074 if (i !== elm.innerHTML) { 72075 /* istanbul ignore if */ 72076 if (typeof console !== 'undefined' && 72077 !hydrationBailed 72078 ) { 72079 hydrationBailed = true; 72080 console.warn('Parent: ', elm); 72081 console.warn('server innerHTML: ', i); 72082 console.warn('client innerHTML: ', elm.innerHTML); 72083 } 72084 return false 72085 } 72086 } else { 72087 // iterate and compare children lists 72088 var childrenMatch = true; 72089 var childNode = elm.firstChild; 72090 for (var i$1 = 0; i$1 < children.length; i$1++) { 72091 if (!childNode || !hydrate(childNode, children[i$1], insertedVnodeQueue, inVPre)) { 72092 childrenMatch = false; 72093 break 72094 } 72095 childNode = childNode.nextSibling; 72096 } 72097 // if childNode is not null, it means the actual childNodes list is 72098 // longer than the virtual children list. 72099 if (!childrenMatch || childNode) { 72100 /* istanbul ignore if */ 72101 if (typeof console !== 'undefined' && 72102 !hydrationBailed 72103 ) { 72104 hydrationBailed = true; 72105 console.warn('Parent: ', elm); 72106 console.warn('Mismatching childNodes vs. VNodes: ', elm.childNodes, children); 72107 } 72108 return false 72109 } 72110 } 72111 } 72112 } 72113 if (isDef(data)) { 72114 var fullInvoke = false; 72115 for (var key in data) { 72116 if (!isRenderedModule(key)) { 72117 fullInvoke = true; 72118 invokeCreateHooks(vnode, insertedVnodeQueue); 72119 break 72120 } 72121 } 72122 if (!fullInvoke && data['class']) { 72123 // ensure collecting deps for deep class bindings for future updates 72124 traverse(data['class']); 72125 } 72126 } 72127 } else if (elm.data !== vnode.text) { 72128 elm.data = vnode.text; 72129 } 72130 return true 72131 } 72132 72133 function assertNodeMatch (node, vnode, inVPre) { 72134 if (isDef(vnode.tag)) { 72135 return vnode.tag.indexOf('vue-component') === 0 || ( 72136 !isUnknownElement$$1(vnode, inVPre) && 72137 vnode.tag.toLowerCase() === (node.tagName && node.tagName.toLowerCase()) 72138 ) 72139 } else { 72140 return node.nodeType === (vnode.isComment ? 8 : 3) 72141 } 72142 } 72143 72144 return function patch (oldVnode, vnode, hydrating, removeOnly) { 72145 if (isUndef(vnode)) { 72146 if (isDef(oldVnode)) { invokeDestroyHook(oldVnode); } 72147 return 72148 } 72149 72150 var isInitialPatch = false; 72151 var insertedVnodeQueue = []; 72152 72153 if (isUndef(oldVnode)) { 72154 // empty mount (likely as component), create new root element 72155 isInitialPatch = true; 72156 createElm(vnode, insertedVnodeQueue); 72157 } else { 72158 var isRealElement = isDef(oldVnode.nodeType); 72159 if (!isRealElement && sameVnode(oldVnode, vnode)) { 72160 // patch existing root node 72161 patchVnode(oldVnode, vnode, insertedVnodeQueue, null, null, removeOnly); 72162 } else { 72163 if (isRealElement) { 72164 // mounting to a real element 72165 // check if this is server-rendered content and if we can perform 72166 // a successful hydration. 72167 if (oldVnode.nodeType === 1 && oldVnode.hasAttribute(SSR_ATTR)) { 72168 oldVnode.removeAttribute(SSR_ATTR); 72169 hydrating = true; 72170 } 72171 if (isTrue(hydrating)) { 72172 if (hydrate(oldVnode, vnode, insertedVnodeQueue)) { 72173 invokeInsertHook(vnode, insertedVnodeQueue, true); 72174 return oldVnode 72175 } else { 72176 warn( 72177 'The client-side rendered virtual DOM tree is not matching ' + 72178 'server-rendered content. This is likely caused by incorrect ' + 72179 'HTML markup, for example nesting block-level elements inside ' + 72180 '<p>, or missing <tbody>. Bailing hydration and performing ' + 72181 'full client-side render.' 72182 ); 72183 } 72184 } 72185 // either not server-rendered, or hydration failed. 72186 // create an empty node and replace it 72187 oldVnode = emptyNodeAt(oldVnode); 72188 } 72189 72190 // replacing existing element 72191 var oldElm = oldVnode.elm; 72192 var parentElm = nodeOps.parentNode(oldElm); 72193 72194 // create new node 72195 createElm( 72196 vnode, 72197 insertedVnodeQueue, 72198 // extremely rare edge case: do not insert if old element is in a 72199 // leaving transition. Only happens when combining transition + 72200 // keep-alive + HOCs. (#4590) 72201 oldElm._leaveCb ? null : parentElm, 72202 nodeOps.nextSibling(oldElm) 72203 ); 72204 72205 // update parent placeholder node element, recursively 72206 if (isDef(vnode.parent)) { 72207 var ancestor = vnode.parent; 72208 var patchable = isPatchable(vnode); 72209 while (ancestor) { 72210 for (var i = 0; i < cbs.destroy.length; ++i) { 72211 cbs.destroy[i](ancestor); 72212 } 72213 ancestor.elm = vnode.elm; 72214 if (patchable) { 72215 for (var i$1 = 0; i$1 < cbs.create.length; ++i$1) { 72216 cbs.create[i$1](emptyNode, ancestor); 72217 } 72218 // #6513 72219 // invoke insert hooks that may have been merged by create hooks. 72220 // e.g. for directives that uses the "inserted" hook. 72221 var insert = ancestor.data.hook.insert; 72222 if (insert.merged) { 72223 // start at index 1 to avoid re-invoking component mounted hook 72224 for (var i$2 = 1; i$2 < insert.fns.length; i$2++) { 72225 insert.fns[i$2](); 72226 } 72227 } 72228 } else { 72229 registerRef(ancestor); 72230 } 72231 ancestor = ancestor.parent; 72232 } 72233 } 72234 72235 // destroy old node 72236 if (isDef(parentElm)) { 72237 removeVnodes([oldVnode], 0, 0); 72238 } else if (isDef(oldVnode.tag)) { 72239 invokeDestroyHook(oldVnode); 72240 } 72241 } 72242 } 72243 72244 invokeInsertHook(vnode, insertedVnodeQueue, isInitialPatch); 72245 return vnode.elm 72246 } 72247} 72248 72249/* */ 72250 72251var directives = { 72252 create: updateDirectives, 72253 update: updateDirectives, 72254 destroy: function unbindDirectives (vnode) { 72255 updateDirectives(vnode, emptyNode); 72256 } 72257}; 72258 72259function updateDirectives (oldVnode, vnode) { 72260 if (oldVnode.data.directives || vnode.data.directives) { 72261 _update(oldVnode, vnode); 72262 } 72263} 72264 72265function _update (oldVnode, vnode) { 72266 var isCreate = oldVnode === emptyNode; 72267 var isDestroy = vnode === emptyNode; 72268 var oldDirs = normalizeDirectives$1(oldVnode.data.directives, oldVnode.context); 72269 var newDirs = normalizeDirectives$1(vnode.data.directives, vnode.context); 72270 72271 var dirsWithInsert = []; 72272 var dirsWithPostpatch = []; 72273 72274 var key, oldDir, dir; 72275 for (key in newDirs) { 72276 oldDir = oldDirs[key]; 72277 dir = newDirs[key]; 72278 if (!oldDir) { 72279 // new directive, bind 72280 callHook$1(dir, 'bind', vnode, oldVnode); 72281 if (dir.def && dir.def.inserted) { 72282 dirsWithInsert.push(dir); 72283 } 72284 } else { 72285 // existing directive, update 72286 dir.oldValue = oldDir.value; 72287 dir.oldArg = oldDir.arg; 72288 callHook$1(dir, 'update', vnode, oldVnode); 72289 if (dir.def && dir.def.componentUpdated) { 72290 dirsWithPostpatch.push(dir); 72291 } 72292 } 72293 } 72294 72295 if (dirsWithInsert.length) { 72296 var callInsert = function () { 72297 for (var i = 0; i < dirsWithInsert.length; i++) { 72298 callHook$1(dirsWithInsert[i], 'inserted', vnode, oldVnode); 72299 } 72300 }; 72301 if (isCreate) { 72302 mergeVNodeHook(vnode, 'insert', callInsert); 72303 } else { 72304 callInsert(); 72305 } 72306 } 72307 72308 if (dirsWithPostpatch.length) { 72309 mergeVNodeHook(vnode, 'postpatch', function () { 72310 for (var i = 0; i < dirsWithPostpatch.length; i++) { 72311 callHook$1(dirsWithPostpatch[i], 'componentUpdated', vnode, oldVnode); 72312 } 72313 }); 72314 } 72315 72316 if (!isCreate) { 72317 for (key in oldDirs) { 72318 if (!newDirs[key]) { 72319 // no longer present, unbind 72320 callHook$1(oldDirs[key], 'unbind', oldVnode, oldVnode, isDestroy); 72321 } 72322 } 72323 } 72324} 72325 72326var emptyModifiers = Object.create(null); 72327 72328function normalizeDirectives$1 ( 72329 dirs, 72330 vm 72331) { 72332 var res = Object.create(null); 72333 if (!dirs) { 72334 // $flow-disable-line 72335 return res 72336 } 72337 var i, dir; 72338 for (i = 0; i < dirs.length; i++) { 72339 dir = dirs[i]; 72340 if (!dir.modifiers) { 72341 // $flow-disable-line 72342 dir.modifiers = emptyModifiers; 72343 } 72344 res[getRawDirName(dir)] = dir; 72345 dir.def = resolveAsset(vm.$options, 'directives', dir.name, true); 72346 } 72347 // $flow-disable-line 72348 return res 72349} 72350 72351function getRawDirName (dir) { 72352 return dir.rawName || ((dir.name) + "." + (Object.keys(dir.modifiers || {}).join('.'))) 72353} 72354 72355function callHook$1 (dir, hook, vnode, oldVnode, isDestroy) { 72356 var fn = dir.def && dir.def[hook]; 72357 if (fn) { 72358 try { 72359 fn(vnode.elm, dir, vnode, oldVnode, isDestroy); 72360 } catch (e) { 72361 handleError(e, vnode.context, ("directive " + (dir.name) + " " + hook + " hook")); 72362 } 72363 } 72364} 72365 72366var baseModules = [ 72367 ref, 72368 directives 72369]; 72370 72371/* */ 72372 72373function updateAttrs (oldVnode, vnode) { 72374 var opts = vnode.componentOptions; 72375 if (isDef(opts) && opts.Ctor.options.inheritAttrs === false) { 72376 return 72377 } 72378 if (isUndef(oldVnode.data.attrs) && isUndef(vnode.data.attrs)) { 72379 return 72380 } 72381 var key, cur, old; 72382 var elm = vnode.elm; 72383 var oldAttrs = oldVnode.data.attrs || {}; 72384 var attrs = vnode.data.attrs || {}; 72385 // clone observed objects, as the user probably wants to mutate it 72386 if (isDef(attrs.__ob__)) { 72387 attrs = vnode.data.attrs = extend({}, attrs); 72388 } 72389 72390 for (key in attrs) { 72391 cur = attrs[key]; 72392 old = oldAttrs[key]; 72393 if (old !== cur) { 72394 setAttr(elm, key, cur, vnode.data.pre); 72395 } 72396 } 72397 // #4391: in IE9, setting type can reset value for input[type=radio] 72398 // #6666: IE/Edge forces progress value down to 1 before setting a max 72399 /* istanbul ignore if */ 72400 if ((isIE || isEdge) && attrs.value !== oldAttrs.value) { 72401 setAttr(elm, 'value', attrs.value); 72402 } 72403 for (key in oldAttrs) { 72404 if (isUndef(attrs[key])) { 72405 if (isXlink(key)) { 72406 elm.removeAttributeNS(xlinkNS, getXlinkProp(key)); 72407 } else if (!isEnumeratedAttr(key)) { 72408 elm.removeAttribute(key); 72409 } 72410 } 72411 } 72412} 72413 72414function setAttr (el, key, value, isInPre) { 72415 if (isInPre || el.tagName.indexOf('-') > -1) { 72416 baseSetAttr(el, key, value); 72417 } else if (isBooleanAttr(key)) { 72418 // set attribute for blank value 72419 // e.g. <option disabled>Select one</option> 72420 if (isFalsyAttrValue(value)) { 72421 el.removeAttribute(key); 72422 } else { 72423 // technically allowfullscreen is a boolean attribute for <iframe>, 72424 // but Flash expects a value of "true" when used on <embed> tag 72425 value = key === 'allowfullscreen' && el.tagName === 'EMBED' 72426 ? 'true' 72427 : key; 72428 el.setAttribute(key, value); 72429 } 72430 } else if (isEnumeratedAttr(key)) { 72431 el.setAttribute(key, convertEnumeratedValue(key, value)); 72432 } else if (isXlink(key)) { 72433 if (isFalsyAttrValue(value)) { 72434 el.removeAttributeNS(xlinkNS, getXlinkProp(key)); 72435 } else { 72436 el.setAttributeNS(xlinkNS, key, value); 72437 } 72438 } else { 72439 baseSetAttr(el, key, value); 72440 } 72441} 72442 72443function baseSetAttr (el, key, value) { 72444 if (isFalsyAttrValue(value)) { 72445 el.removeAttribute(key); 72446 } else { 72447 // #7138: IE10 & 11 fires input event when setting placeholder on 72448 // <textarea>... block the first input event and remove the blocker 72449 // immediately. 72450 /* istanbul ignore if */ 72451 if ( 72452 isIE && !isIE9 && 72453 el.tagName === 'TEXTAREA' && 72454 key === 'placeholder' && value !== '' && !el.__ieph 72455 ) { 72456 var blocker = function (e) { 72457 e.stopImmediatePropagation(); 72458 el.removeEventListener('input', blocker); 72459 }; 72460 el.addEventListener('input', blocker); 72461 // $flow-disable-line 72462 el.__ieph = true; /* IE placeholder patched */ 72463 } 72464 el.setAttribute(key, value); 72465 } 72466} 72467 72468var attrs = { 72469 create: updateAttrs, 72470 update: updateAttrs 72471}; 72472 72473/* */ 72474 72475function updateClass (oldVnode, vnode) { 72476 var el = vnode.elm; 72477 var data = vnode.data; 72478 var oldData = oldVnode.data; 72479 if ( 72480 isUndef(data.staticClass) && 72481 isUndef(data.class) && ( 72482 isUndef(oldData) || ( 72483 isUndef(oldData.staticClass) && 72484 isUndef(oldData.class) 72485 ) 72486 ) 72487 ) { 72488 return 72489 } 72490 72491 var cls = genClassForVnode(vnode); 72492 72493 // handle transition classes 72494 var transitionClass = el._transitionClasses; 72495 if (isDef(transitionClass)) { 72496 cls = concat(cls, stringifyClass(transitionClass)); 72497 } 72498 72499 // set the class 72500 if (cls !== el._prevClass) { 72501 el.setAttribute('class', cls); 72502 el._prevClass = cls; 72503 } 72504} 72505 72506var klass = { 72507 create: updateClass, 72508 update: updateClass 72509}; 72510 72511/* */ 72512 72513var validDivisionCharRE = /[\w).+\-_$\]]/; 72514 72515function parseFilters (exp) { 72516 var inSingle = false; 72517 var inDouble = false; 72518 var inTemplateString = false; 72519 var inRegex = false; 72520 var curly = 0; 72521 var square = 0; 72522 var paren = 0; 72523 var lastFilterIndex = 0; 72524 var c, prev, i, expression, filters; 72525 72526 for (i = 0; i < exp.length; i++) { 72527 prev = c; 72528 c = exp.charCodeAt(i); 72529 if (inSingle) { 72530 if (c === 0x27 && prev !== 0x5C) { inSingle = false; } 72531 } else if (inDouble) { 72532 if (c === 0x22 && prev !== 0x5C) { inDouble = false; } 72533 } else if (inTemplateString) { 72534 if (c === 0x60 && prev !== 0x5C) { inTemplateString = false; } 72535 } else if (inRegex) { 72536 if (c === 0x2f && prev !== 0x5C) { inRegex = false; } 72537 } else if ( 72538 c === 0x7C && // pipe 72539 exp.charCodeAt(i + 1) !== 0x7C && 72540 exp.charCodeAt(i - 1) !== 0x7C && 72541 !curly && !square && !paren 72542 ) { 72543 if (expression === undefined) { 72544 // first filter, end of expression 72545 lastFilterIndex = i + 1; 72546 expression = exp.slice(0, i).trim(); 72547 } else { 72548 pushFilter(); 72549 } 72550 } else { 72551 switch (c) { 72552 case 0x22: inDouble = true; break // " 72553 case 0x27: inSingle = true; break // ' 72554 case 0x60: inTemplateString = true; break // ` 72555 case 0x28: paren++; break // ( 72556 case 0x29: paren--; break // ) 72557 case 0x5B: square++; break // [ 72558 case 0x5D: square--; break // ] 72559 case 0x7B: curly++; break // { 72560 case 0x7D: curly--; break // } 72561 } 72562 if (c === 0x2f) { // / 72563 var j = i - 1; 72564 var p = (void 0); 72565 // find first non-whitespace prev char 72566 for (; j >= 0; j--) { 72567 p = exp.charAt(j); 72568 if (p !== ' ') { break } 72569 } 72570 if (!p || !validDivisionCharRE.test(p)) { 72571 inRegex = true; 72572 } 72573 } 72574 } 72575 } 72576 72577 if (expression === undefined) { 72578 expression = exp.slice(0, i).trim(); 72579 } else if (lastFilterIndex !== 0) { 72580 pushFilter(); 72581 } 72582 72583 function pushFilter () { 72584 (filters || (filters = [])).push(exp.slice(lastFilterIndex, i).trim()); 72585 lastFilterIndex = i + 1; 72586 } 72587 72588 if (filters) { 72589 for (i = 0; i < filters.length; i++) { 72590 expression = wrapFilter(expression, filters[i]); 72591 } 72592 } 72593 72594 return expression 72595} 72596 72597function wrapFilter (exp, filter) { 72598 var i = filter.indexOf('('); 72599 if (i < 0) { 72600 // _f: resolveFilter 72601 return ("_f(\"" + filter + "\")(" + exp + ")") 72602 } else { 72603 var name = filter.slice(0, i); 72604 var args = filter.slice(i + 1); 72605 return ("_f(\"" + name + "\")(" + exp + (args !== ')' ? ',' + args : args)) 72606 } 72607} 72608 72609/* */ 72610 72611 72612 72613/* eslint-disable no-unused-vars */ 72614function baseWarn (msg, range) { 72615 console.error(("[Vue compiler]: " + msg)); 72616} 72617/* eslint-enable no-unused-vars */ 72618 72619function pluckModuleFunction ( 72620 modules, 72621 key 72622) { 72623 return modules 72624 ? modules.map(function (m) { return m[key]; }).filter(function (_) { return _; }) 72625 : [] 72626} 72627 72628function addProp (el, name, value, range, dynamic) { 72629 (el.props || (el.props = [])).push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); 72630 el.plain = false; 72631} 72632 72633function addAttr (el, name, value, range, dynamic) { 72634 var attrs = dynamic 72635 ? (el.dynamicAttrs || (el.dynamicAttrs = [])) 72636 : (el.attrs || (el.attrs = [])); 72637 attrs.push(rangeSetItem({ name: name, value: value, dynamic: dynamic }, range)); 72638 el.plain = false; 72639} 72640 72641// add a raw attr (use this in preTransforms) 72642function addRawAttr (el, name, value, range) { 72643 el.attrsMap[name] = value; 72644 el.attrsList.push(rangeSetItem({ name: name, value: value }, range)); 72645} 72646 72647function addDirective ( 72648 el, 72649 name, 72650 rawName, 72651 value, 72652 arg, 72653 isDynamicArg, 72654 modifiers, 72655 range 72656) { 72657 (el.directives || (el.directives = [])).push(rangeSetItem({ 72658 name: name, 72659 rawName: rawName, 72660 value: value, 72661 arg: arg, 72662 isDynamicArg: isDynamicArg, 72663 modifiers: modifiers 72664 }, range)); 72665 el.plain = false; 72666} 72667 72668function prependModifierMarker (symbol, name, dynamic) { 72669 return dynamic 72670 ? ("_p(" + name + ",\"" + symbol + "\")") 72671 : symbol + name // mark the event as captured 72672} 72673 72674function addHandler ( 72675 el, 72676 name, 72677 value, 72678 modifiers, 72679 important, 72680 warn, 72681 range, 72682 dynamic 72683) { 72684 modifiers = modifiers || emptyObject; 72685 // warn prevent and passive modifier 72686 /* istanbul ignore if */ 72687 if ( 72688 warn && 72689 modifiers.prevent && modifiers.passive 72690 ) { 72691 warn( 72692 'passive and prevent can\'t be used together. ' + 72693 'Passive handler can\'t prevent default event.', 72694 range 72695 ); 72696 } 72697 72698 // normalize click.right and click.middle since they don't actually fire 72699 // this is technically browser-specific, but at least for now browsers are 72700 // the only target envs that have right/middle clicks. 72701 if (modifiers.right) { 72702 if (dynamic) { 72703 name = "(" + name + ")==='click'?'contextmenu':(" + name + ")"; 72704 } else if (name === 'click') { 72705 name = 'contextmenu'; 72706 delete modifiers.right; 72707 } 72708 } else if (modifiers.middle) { 72709 if (dynamic) { 72710 name = "(" + name + ")==='click'?'mouseup':(" + name + ")"; 72711 } else if (name === 'click') { 72712 name = 'mouseup'; 72713 } 72714 } 72715 72716 // check capture modifier 72717 if (modifiers.capture) { 72718 delete modifiers.capture; 72719 name = prependModifierMarker('!', name, dynamic); 72720 } 72721 if (modifiers.once) { 72722 delete modifiers.once; 72723 name = prependModifierMarker('~', name, dynamic); 72724 } 72725 /* istanbul ignore if */ 72726 if (modifiers.passive) { 72727 delete modifiers.passive; 72728 name = prependModifierMarker('&', name, dynamic); 72729 } 72730 72731 var events; 72732 if (modifiers.native) { 72733 delete modifiers.native; 72734 events = el.nativeEvents || (el.nativeEvents = {}); 72735 } else { 72736 events = el.events || (el.events = {}); 72737 } 72738 72739 var newHandler = rangeSetItem({ value: value.trim(), dynamic: dynamic }, range); 72740 if (modifiers !== emptyObject) { 72741 newHandler.modifiers = modifiers; 72742 } 72743 72744 var handlers = events[name]; 72745 /* istanbul ignore if */ 72746 if (Array.isArray(handlers)) { 72747 important ? handlers.unshift(newHandler) : handlers.push(newHandler); 72748 } else if (handlers) { 72749 events[name] = important ? [newHandler, handlers] : [handlers, newHandler]; 72750 } else { 72751 events[name] = newHandler; 72752 } 72753 72754 el.plain = false; 72755} 72756 72757function getRawBindingAttr ( 72758 el, 72759 name 72760) { 72761 return el.rawAttrsMap[':' + name] || 72762 el.rawAttrsMap['v-bind:' + name] || 72763 el.rawAttrsMap[name] 72764} 72765 72766function getBindingAttr ( 72767 el, 72768 name, 72769 getStatic 72770) { 72771 var dynamicValue = 72772 getAndRemoveAttr(el, ':' + name) || 72773 getAndRemoveAttr(el, 'v-bind:' + name); 72774 if (dynamicValue != null) { 72775 return parseFilters(dynamicValue) 72776 } else if (getStatic !== false) { 72777 var staticValue = getAndRemoveAttr(el, name); 72778 if (staticValue != null) { 72779 return JSON.stringify(staticValue) 72780 } 72781 } 72782} 72783 72784// note: this only removes the attr from the Array (attrsList) so that it 72785// doesn't get processed by processAttrs. 72786// By default it does NOT remove it from the map (attrsMap) because the map is 72787// needed during codegen. 72788function getAndRemoveAttr ( 72789 el, 72790 name, 72791 removeFromMap 72792) { 72793 var val; 72794 if ((val = el.attrsMap[name]) != null) { 72795 var list = el.attrsList; 72796 for (var i = 0, l = list.length; i < l; i++) { 72797 if (list[i].name === name) { 72798 list.splice(i, 1); 72799 break 72800 } 72801 } 72802 } 72803 if (removeFromMap) { 72804 delete el.attrsMap[name]; 72805 } 72806 return val 72807} 72808 72809function getAndRemoveAttrByRegex ( 72810 el, 72811 name 72812) { 72813 var list = el.attrsList; 72814 for (var i = 0, l = list.length; i < l; i++) { 72815 var attr = list[i]; 72816 if (name.test(attr.name)) { 72817 list.splice(i, 1); 72818 return attr 72819 } 72820 } 72821} 72822 72823function rangeSetItem ( 72824 item, 72825 range 72826) { 72827 if (range) { 72828 if (range.start != null) { 72829 item.start = range.start; 72830 } 72831 if (range.end != null) { 72832 item.end = range.end; 72833 } 72834 } 72835 return item 72836} 72837 72838/* */ 72839 72840/** 72841 * Cross-platform code generation for component v-model 72842 */ 72843function genComponentModel ( 72844 el, 72845 value, 72846 modifiers 72847) { 72848 var ref = modifiers || {}; 72849 var number = ref.number; 72850 var trim = ref.trim; 72851 72852 var baseValueExpression = '$$v'; 72853 var valueExpression = baseValueExpression; 72854 if (trim) { 72855 valueExpression = 72856 "(typeof " + baseValueExpression + " === 'string'" + 72857 "? " + baseValueExpression + ".trim()" + 72858 ": " + baseValueExpression + ")"; 72859 } 72860 if (number) { 72861 valueExpression = "_n(" + valueExpression + ")"; 72862 } 72863 var assignment = genAssignmentCode(value, valueExpression); 72864 72865 el.model = { 72866 value: ("(" + value + ")"), 72867 expression: JSON.stringify(value), 72868 callback: ("function (" + baseValueExpression + ") {" + assignment + "}") 72869 }; 72870} 72871 72872/** 72873 * Cross-platform codegen helper for generating v-model value assignment code. 72874 */ 72875function genAssignmentCode ( 72876 value, 72877 assignment 72878) { 72879 var res = parseModel(value); 72880 if (res.key === null) { 72881 return (value + "=" + assignment) 72882 } else { 72883 return ("$set(" + (res.exp) + ", " + (res.key) + ", " + assignment + ")") 72884 } 72885} 72886 72887/** 72888 * Parse a v-model expression into a base path and a final key segment. 72889 * Handles both dot-path and possible square brackets. 72890 * 72891 * Possible cases: 72892 * 72893 * - test 72894 * - test[key] 72895 * - test[test1[key]] 72896 * - test["a"][key] 72897 * - xxx.test[a[a].test1[key]] 72898 * - test.xxx.a["asa"][test1[key]] 72899 * 72900 */ 72901 72902var len, str, chr, index$1, expressionPos, expressionEndPos; 72903 72904 72905 72906function parseModel (val) { 72907 // Fix https://github.com/vuejs/vue/pull/7730 72908 // allow v-model="obj.val " (trailing whitespace) 72909 val = val.trim(); 72910 len = val.length; 72911 72912 if (val.indexOf('[') < 0 || val.lastIndexOf(']') < len - 1) { 72913 index$1 = val.lastIndexOf('.'); 72914 if (index$1 > -1) { 72915 return { 72916 exp: val.slice(0, index$1), 72917 key: '"' + val.slice(index$1 + 1) + '"' 72918 } 72919 } else { 72920 return { 72921 exp: val, 72922 key: null 72923 } 72924 } 72925 } 72926 72927 str = val; 72928 index$1 = expressionPos = expressionEndPos = 0; 72929 72930 while (!eof()) { 72931 chr = next(); 72932 /* istanbul ignore if */ 72933 if (isStringStart(chr)) { 72934 parseString(chr); 72935 } else if (chr === 0x5B) { 72936 parseBracket(chr); 72937 } 72938 } 72939 72940 return { 72941 exp: val.slice(0, expressionPos), 72942 key: val.slice(expressionPos + 1, expressionEndPos) 72943 } 72944} 72945 72946function next () { 72947 return str.charCodeAt(++index$1) 72948} 72949 72950function eof () { 72951 return index$1 >= len 72952} 72953 72954function isStringStart (chr) { 72955 return chr === 0x22 || chr === 0x27 72956} 72957 72958function parseBracket (chr) { 72959 var inBracket = 1; 72960 expressionPos = index$1; 72961 while (!eof()) { 72962 chr = next(); 72963 if (isStringStart(chr)) { 72964 parseString(chr); 72965 continue 72966 } 72967 if (chr === 0x5B) { inBracket++; } 72968 if (chr === 0x5D) { inBracket--; } 72969 if (inBracket === 0) { 72970 expressionEndPos = index$1; 72971 break 72972 } 72973 } 72974} 72975 72976function parseString (chr) { 72977 var stringQuote = chr; 72978 while (!eof()) { 72979 chr = next(); 72980 if (chr === stringQuote) { 72981 break 72982 } 72983 } 72984} 72985 72986/* */ 72987 72988var warn$1; 72989 72990// in some cases, the event used has to be determined at runtime 72991// so we used some reserved tokens during compile. 72992var RANGE_TOKEN = '__r'; 72993var CHECKBOX_RADIO_TOKEN = '__c'; 72994 72995function model ( 72996 el, 72997 dir, 72998 _warn 72999) { 73000 warn$1 = _warn; 73001 var value = dir.value; 73002 var modifiers = dir.modifiers; 73003 var tag = el.tag; 73004 var type = el.attrsMap.type; 73005 73006 { 73007 // inputs with type="file" are read only and setting the input's 73008 // value will throw an error. 73009 if (tag === 'input' && type === 'file') { 73010 warn$1( 73011 "<" + (el.tag) + " v-model=\"" + value + "\" type=\"file\">:\n" + 73012 "File inputs are read only. Use a v-on:change listener instead.", 73013 el.rawAttrsMap['v-model'] 73014 ); 73015 } 73016 } 73017 73018 if (el.component) { 73019 genComponentModel(el, value, modifiers); 73020 // component v-model doesn't need extra runtime 73021 return false 73022 } else if (tag === 'select') { 73023 genSelect(el, value, modifiers); 73024 } else if (tag === 'input' && type === 'checkbox') { 73025 genCheckboxModel(el, value, modifiers); 73026 } else if (tag === 'input' && type === 'radio') { 73027 genRadioModel(el, value, modifiers); 73028 } else if (tag === 'input' || tag === 'textarea') { 73029 genDefaultModel(el, value, modifiers); 73030 } else if (!config.isReservedTag(tag)) { 73031 genComponentModel(el, value, modifiers); 73032 // component v-model doesn't need extra runtime 73033 return false 73034 } else { 73035 warn$1( 73036 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 73037 "v-model is not supported on this element type. " + 73038 'If you are working with contenteditable, it\'s recommended to ' + 73039 'wrap a library dedicated for that purpose inside a custom component.', 73040 el.rawAttrsMap['v-model'] 73041 ); 73042 } 73043 73044 // ensure runtime directive metadata 73045 return true 73046} 73047 73048function genCheckboxModel ( 73049 el, 73050 value, 73051 modifiers 73052) { 73053 var number = modifiers && modifiers.number; 73054 var valueBinding = getBindingAttr(el, 'value') || 'null'; 73055 var trueValueBinding = getBindingAttr(el, 'true-value') || 'true'; 73056 var falseValueBinding = getBindingAttr(el, 'false-value') || 'false'; 73057 addProp(el, 'checked', 73058 "Array.isArray(" + value + ")" + 73059 "?_i(" + value + "," + valueBinding + ")>-1" + ( 73060 trueValueBinding === 'true' 73061 ? (":(" + value + ")") 73062 : (":_q(" + value + "," + trueValueBinding + ")") 73063 ) 73064 ); 73065 addHandler(el, 'change', 73066 "var $$a=" + value + "," + 73067 '$$el=$event.target,' + 73068 "$$c=$$el.checked?(" + trueValueBinding + "):(" + falseValueBinding + ");" + 73069 'if(Array.isArray($$a)){' + 73070 "var $$v=" + (number ? '_n(' + valueBinding + ')' : valueBinding) + "," + 73071 '$$i=_i($$a,$$v);' + 73072 "if($$el.checked){$$i<0&&(" + (genAssignmentCode(value, '$$a.concat([$$v])')) + ")}" + 73073 "else{$$i>-1&&(" + (genAssignmentCode(value, '$$a.slice(0,$$i).concat($$a.slice($$i+1))')) + ")}" + 73074 "}else{" + (genAssignmentCode(value, '$$c')) + "}", 73075 null, true 73076 ); 73077} 73078 73079function genRadioModel ( 73080 el, 73081 value, 73082 modifiers 73083) { 73084 var number = modifiers && modifiers.number; 73085 var valueBinding = getBindingAttr(el, 'value') || 'null'; 73086 valueBinding = number ? ("_n(" + valueBinding + ")") : valueBinding; 73087 addProp(el, 'checked', ("_q(" + value + "," + valueBinding + ")")); 73088 addHandler(el, 'change', genAssignmentCode(value, valueBinding), null, true); 73089} 73090 73091function genSelect ( 73092 el, 73093 value, 73094 modifiers 73095) { 73096 var number = modifiers && modifiers.number; 73097 var selectedVal = "Array.prototype.filter" + 73098 ".call($event.target.options,function(o){return o.selected})" + 73099 ".map(function(o){var val = \"_value\" in o ? o._value : o.value;" + 73100 "return " + (number ? '_n(val)' : 'val') + "})"; 73101 73102 var assignment = '$event.target.multiple ? $$selectedVal : $$selectedVal[0]'; 73103 var code = "var $$selectedVal = " + selectedVal + ";"; 73104 code = code + " " + (genAssignmentCode(value, assignment)); 73105 addHandler(el, 'change', code, null, true); 73106} 73107 73108function genDefaultModel ( 73109 el, 73110 value, 73111 modifiers 73112) { 73113 var type = el.attrsMap.type; 73114 73115 // warn if v-bind:value conflicts with v-model 73116 // except for inputs with v-bind:type 73117 { 73118 var value$1 = el.attrsMap['v-bind:value'] || el.attrsMap[':value']; 73119 var typeBinding = el.attrsMap['v-bind:type'] || el.attrsMap[':type']; 73120 if (value$1 && !typeBinding) { 73121 var binding = el.attrsMap['v-bind:value'] ? 'v-bind:value' : ':value'; 73122 warn$1( 73123 binding + "=\"" + value$1 + "\" conflicts with v-model on the same element " + 73124 'because the latter already expands to a value binding internally', 73125 el.rawAttrsMap[binding] 73126 ); 73127 } 73128 } 73129 73130 var ref = modifiers || {}; 73131 var lazy = ref.lazy; 73132 var number = ref.number; 73133 var trim = ref.trim; 73134 var needCompositionGuard = !lazy && type !== 'range'; 73135 var event = lazy 73136 ? 'change' 73137 : type === 'range' 73138 ? RANGE_TOKEN 73139 : 'input'; 73140 73141 var valueExpression = '$event.target.value'; 73142 if (trim) { 73143 valueExpression = "$event.target.value.trim()"; 73144 } 73145 if (number) { 73146 valueExpression = "_n(" + valueExpression + ")"; 73147 } 73148 73149 var code = genAssignmentCode(value, valueExpression); 73150 if (needCompositionGuard) { 73151 code = "if($event.target.composing)return;" + code; 73152 } 73153 73154 addProp(el, 'value', ("(" + value + ")")); 73155 addHandler(el, event, code, null, true); 73156 if (trim || number) { 73157 addHandler(el, 'blur', '$forceUpdate()'); 73158 } 73159} 73160 73161/* */ 73162 73163// normalize v-model event tokens that can only be determined at runtime. 73164// it's important to place the event as the first in the array because 73165// the whole point is ensuring the v-model callback gets called before 73166// user-attached handlers. 73167function normalizeEvents (on) { 73168 /* istanbul ignore if */ 73169 if (isDef(on[RANGE_TOKEN])) { 73170 // IE input[type=range] only supports `change` event 73171 var event = isIE ? 'change' : 'input'; 73172 on[event] = [].concat(on[RANGE_TOKEN], on[event] || []); 73173 delete on[RANGE_TOKEN]; 73174 } 73175 // This was originally intended to fix #4521 but no longer necessary 73176 // after 2.5. Keeping it for backwards compat with generated code from < 2.4 73177 /* istanbul ignore if */ 73178 if (isDef(on[CHECKBOX_RADIO_TOKEN])) { 73179 on.change = [].concat(on[CHECKBOX_RADIO_TOKEN], on.change || []); 73180 delete on[CHECKBOX_RADIO_TOKEN]; 73181 } 73182} 73183 73184var target$1; 73185 73186function createOnceHandler$1 (event, handler, capture) { 73187 var _target = target$1; // save current target element in closure 73188 return function onceHandler () { 73189 var res = handler.apply(null, arguments); 73190 if (res !== null) { 73191 remove$2(event, onceHandler, capture, _target); 73192 } 73193 } 73194} 73195 73196// #9446: Firefox <= 53 (in particular, ESR 52) has incorrect Event.timeStamp 73197// implementation and does not fire microtasks in between event propagation, so 73198// safe to exclude. 73199var useMicrotaskFix = isUsingMicroTask && !(isFF && Number(isFF[1]) <= 53); 73200 73201function add$1 ( 73202 name, 73203 handler, 73204 capture, 73205 passive 73206) { 73207 // async edge case #6566: inner click event triggers patch, event handler 73208 // attached to outer element during patch, and triggered again. This 73209 // happens because browsers fire microtask ticks between event propagation. 73210 // the solution is simple: we save the timestamp when a handler is attached, 73211 // and the handler would only fire if the event passed to it was fired 73212 // AFTER it was attached. 73213 if (useMicrotaskFix) { 73214 var attachedTimestamp = currentFlushTimestamp; 73215 var original = handler; 73216 handler = original._wrapper = function (e) { 73217 if ( 73218 // no bubbling, should always fire. 73219 // this is just a safety net in case event.timeStamp is unreliable in 73220 // certain weird environments... 73221 e.target === e.currentTarget || 73222 // event is fired after handler attachment 73223 e.timeStamp >= attachedTimestamp || 73224 // bail for environments that have buggy event.timeStamp implementations 73225 // #9462 iOS 9 bug: event.timeStamp is 0 after history.pushState 73226 // #9681 QtWebEngine event.timeStamp is negative value 73227 e.timeStamp <= 0 || 73228 // #9448 bail if event is fired in another document in a multi-page 73229 // electron/nw.js app, since event.timeStamp will be using a different 73230 // starting reference 73231 e.target.ownerDocument !== document 73232 ) { 73233 return original.apply(this, arguments) 73234 } 73235 }; 73236 } 73237 target$1.addEventListener( 73238 name, 73239 handler, 73240 supportsPassive 73241 ? { capture: capture, passive: passive } 73242 : capture 73243 ); 73244} 73245 73246function remove$2 ( 73247 name, 73248 handler, 73249 capture, 73250 _target 73251) { 73252 (_target || target$1).removeEventListener( 73253 name, 73254 handler._wrapper || handler, 73255 capture 73256 ); 73257} 73258 73259function updateDOMListeners (oldVnode, vnode) { 73260 if (isUndef(oldVnode.data.on) && isUndef(vnode.data.on)) { 73261 return 73262 } 73263 var on = vnode.data.on || {}; 73264 var oldOn = oldVnode.data.on || {}; 73265 target$1 = vnode.elm; 73266 normalizeEvents(on); 73267 updateListeners(on, oldOn, add$1, remove$2, createOnceHandler$1, vnode.context); 73268 target$1 = undefined; 73269} 73270 73271var events = { 73272 create: updateDOMListeners, 73273 update: updateDOMListeners 73274}; 73275 73276/* */ 73277 73278var svgContainer; 73279 73280function updateDOMProps (oldVnode, vnode) { 73281 if (isUndef(oldVnode.data.domProps) && isUndef(vnode.data.domProps)) { 73282 return 73283 } 73284 var key, cur; 73285 var elm = vnode.elm; 73286 var oldProps = oldVnode.data.domProps || {}; 73287 var props = vnode.data.domProps || {}; 73288 // clone observed objects, as the user probably wants to mutate it 73289 if (isDef(props.__ob__)) { 73290 props = vnode.data.domProps = extend({}, props); 73291 } 73292 73293 for (key in oldProps) { 73294 if (!(key in props)) { 73295 elm[key] = ''; 73296 } 73297 } 73298 73299 for (key in props) { 73300 cur = props[key]; 73301 // ignore children if the node has textContent or innerHTML, 73302 // as these will throw away existing DOM nodes and cause removal errors 73303 // on subsequent patches (#3360) 73304 if (key === 'textContent' || key === 'innerHTML') { 73305 if (vnode.children) { vnode.children.length = 0; } 73306 if (cur === oldProps[key]) { continue } 73307 // #6601 work around Chrome version <= 55 bug where single textNode 73308 // replaced by innerHTML/textContent retains its parentNode property 73309 if (elm.childNodes.length === 1) { 73310 elm.removeChild(elm.childNodes[0]); 73311 } 73312 } 73313 73314 if (key === 'value' && elm.tagName !== 'PROGRESS') { 73315 // store value as _value as well since 73316 // non-string values will be stringified 73317 elm._value = cur; 73318 // avoid resetting cursor position when value is the same 73319 var strCur = isUndef(cur) ? '' : String(cur); 73320 if (shouldUpdateValue(elm, strCur)) { 73321 elm.value = strCur; 73322 } 73323 } else if (key === 'innerHTML' && isSVG(elm.tagName) && isUndef(elm.innerHTML)) { 73324 // IE doesn't support innerHTML for SVG elements 73325 svgContainer = svgContainer || document.createElement('div'); 73326 svgContainer.innerHTML = "<svg>" + cur + "</svg>"; 73327 var svg = svgContainer.firstChild; 73328 while (elm.firstChild) { 73329 elm.removeChild(elm.firstChild); 73330 } 73331 while (svg.firstChild) { 73332 elm.appendChild(svg.firstChild); 73333 } 73334 } else if ( 73335 // skip the update if old and new VDOM state is the same. 73336 // `value` is handled separately because the DOM value may be temporarily 73337 // out of sync with VDOM state due to focus, composition and modifiers. 73338 // This #4521 by skipping the unnecessary `checked` update. 73339 cur !== oldProps[key] 73340 ) { 73341 // some property updates can throw 73342 // e.g. `value` on <progress> w/ non-finite value 73343 try { 73344 elm[key] = cur; 73345 } catch (e) {} 73346 } 73347 } 73348} 73349 73350// check platforms/web/util/attrs.js acceptValue 73351 73352 73353function shouldUpdateValue (elm, checkVal) { 73354 return (!elm.composing && ( 73355 elm.tagName === 'OPTION' || 73356 isNotInFocusAndDirty(elm, checkVal) || 73357 isDirtyWithModifiers(elm, checkVal) 73358 )) 73359} 73360 73361function isNotInFocusAndDirty (elm, checkVal) { 73362 // return true when textbox (.number and .trim) loses focus and its value is 73363 // not equal to the updated value 73364 var notInFocus = true; 73365 // #6157 73366 // work around IE bug when accessing document.activeElement in an iframe 73367 try { notInFocus = document.activeElement !== elm; } catch (e) {} 73368 return notInFocus && elm.value !== checkVal 73369} 73370 73371function isDirtyWithModifiers (elm, newVal) { 73372 var value = elm.value; 73373 var modifiers = elm._vModifiers; // injected by v-model runtime 73374 if (isDef(modifiers)) { 73375 if (modifiers.number) { 73376 return toNumber(value) !== toNumber(newVal) 73377 } 73378 if (modifiers.trim) { 73379 return value.trim() !== newVal.trim() 73380 } 73381 } 73382 return value !== newVal 73383} 73384 73385var domProps = { 73386 create: updateDOMProps, 73387 update: updateDOMProps 73388}; 73389 73390/* */ 73391 73392var parseStyleText = cached(function (cssText) { 73393 var res = {}; 73394 var listDelimiter = /;(?![^(]*\))/g; 73395 var propertyDelimiter = /:(.+)/; 73396 cssText.split(listDelimiter).forEach(function (item) { 73397 if (item) { 73398 var tmp = item.split(propertyDelimiter); 73399 tmp.length > 1 && (res[tmp[0].trim()] = tmp[1].trim()); 73400 } 73401 }); 73402 return res 73403}); 73404 73405// merge static and dynamic style data on the same vnode 73406function normalizeStyleData (data) { 73407 var style = normalizeStyleBinding(data.style); 73408 // static style is pre-processed into an object during compilation 73409 // and is always a fresh object, so it's safe to merge into it 73410 return data.staticStyle 73411 ? extend(data.staticStyle, style) 73412 : style 73413} 73414 73415// normalize possible array / string values into Object 73416function normalizeStyleBinding (bindingStyle) { 73417 if (Array.isArray(bindingStyle)) { 73418 return toObject(bindingStyle) 73419 } 73420 if (typeof bindingStyle === 'string') { 73421 return parseStyleText(bindingStyle) 73422 } 73423 return bindingStyle 73424} 73425 73426/** 73427 * parent component style should be after child's 73428 * so that parent component's style could override it 73429 */ 73430function getStyle (vnode, checkChild) { 73431 var res = {}; 73432 var styleData; 73433 73434 if (checkChild) { 73435 var childNode = vnode; 73436 while (childNode.componentInstance) { 73437 childNode = childNode.componentInstance._vnode; 73438 if ( 73439 childNode && childNode.data && 73440 (styleData = normalizeStyleData(childNode.data)) 73441 ) { 73442 extend(res, styleData); 73443 } 73444 } 73445 } 73446 73447 if ((styleData = normalizeStyleData(vnode.data))) { 73448 extend(res, styleData); 73449 } 73450 73451 var parentNode = vnode; 73452 while ((parentNode = parentNode.parent)) { 73453 if (parentNode.data && (styleData = normalizeStyleData(parentNode.data))) { 73454 extend(res, styleData); 73455 } 73456 } 73457 return res 73458} 73459 73460/* */ 73461 73462var cssVarRE = /^--/; 73463var importantRE = /\s*!important$/; 73464var setProp = function (el, name, val) { 73465 /* istanbul ignore if */ 73466 if (cssVarRE.test(name)) { 73467 el.style.setProperty(name, val); 73468 } else if (importantRE.test(val)) { 73469 el.style.setProperty(hyphenate(name), val.replace(importantRE, ''), 'important'); 73470 } else { 73471 var normalizedName = normalize(name); 73472 if (Array.isArray(val)) { 73473 // Support values array created by autoprefixer, e.g. 73474 // {display: ["-webkit-box", "-ms-flexbox", "flex"]} 73475 // Set them one by one, and the browser will only set those it can recognize 73476 for (var i = 0, len = val.length; i < len; i++) { 73477 el.style[normalizedName] = val[i]; 73478 } 73479 } else { 73480 el.style[normalizedName] = val; 73481 } 73482 } 73483}; 73484 73485var vendorNames = ['Webkit', 'Moz', 'ms']; 73486 73487var emptyStyle; 73488var normalize = cached(function (prop) { 73489 emptyStyle = emptyStyle || document.createElement('div').style; 73490 prop = camelize(prop); 73491 if (prop !== 'filter' && (prop in emptyStyle)) { 73492 return prop 73493 } 73494 var capName = prop.charAt(0).toUpperCase() + prop.slice(1); 73495 for (var i = 0; i < vendorNames.length; i++) { 73496 var name = vendorNames[i] + capName; 73497 if (name in emptyStyle) { 73498 return name 73499 } 73500 } 73501}); 73502 73503function updateStyle (oldVnode, vnode) { 73504 var data = vnode.data; 73505 var oldData = oldVnode.data; 73506 73507 if (isUndef(data.staticStyle) && isUndef(data.style) && 73508 isUndef(oldData.staticStyle) && isUndef(oldData.style) 73509 ) { 73510 return 73511 } 73512 73513 var cur, name; 73514 var el = vnode.elm; 73515 var oldStaticStyle = oldData.staticStyle; 73516 var oldStyleBinding = oldData.normalizedStyle || oldData.style || {}; 73517 73518 // if static style exists, stylebinding already merged into it when doing normalizeStyleData 73519 var oldStyle = oldStaticStyle || oldStyleBinding; 73520 73521 var style = normalizeStyleBinding(vnode.data.style) || {}; 73522 73523 // store normalized style under a different key for next diff 73524 // make sure to clone it if it's reactive, since the user likely wants 73525 // to mutate it. 73526 vnode.data.normalizedStyle = isDef(style.__ob__) 73527 ? extend({}, style) 73528 : style; 73529 73530 var newStyle = getStyle(vnode, true); 73531 73532 for (name in oldStyle) { 73533 if (isUndef(newStyle[name])) { 73534 setProp(el, name, ''); 73535 } 73536 } 73537 for (name in newStyle) { 73538 cur = newStyle[name]; 73539 if (cur !== oldStyle[name]) { 73540 // ie9 setting to null has no effect, must use empty string 73541 setProp(el, name, cur == null ? '' : cur); 73542 } 73543 } 73544} 73545 73546var style = { 73547 create: updateStyle, 73548 update: updateStyle 73549}; 73550 73551/* */ 73552 73553var whitespaceRE = /\s+/; 73554 73555/** 73556 * Add class with compatibility for SVG since classList is not supported on 73557 * SVG elements in IE 73558 */ 73559function addClass (el, cls) { 73560 /* istanbul ignore if */ 73561 if (!cls || !(cls = cls.trim())) { 73562 return 73563 } 73564 73565 /* istanbul ignore else */ 73566 if (el.classList) { 73567 if (cls.indexOf(' ') > -1) { 73568 cls.split(whitespaceRE).forEach(function (c) { return el.classList.add(c); }); 73569 } else { 73570 el.classList.add(cls); 73571 } 73572 } else { 73573 var cur = " " + (el.getAttribute('class') || '') + " "; 73574 if (cur.indexOf(' ' + cls + ' ') < 0) { 73575 el.setAttribute('class', (cur + cls).trim()); 73576 } 73577 } 73578} 73579 73580/** 73581 * Remove class with compatibility for SVG since classList is not supported on 73582 * SVG elements in IE 73583 */ 73584function removeClass (el, cls) { 73585 /* istanbul ignore if */ 73586 if (!cls || !(cls = cls.trim())) { 73587 return 73588 } 73589 73590 /* istanbul ignore else */ 73591 if (el.classList) { 73592 if (cls.indexOf(' ') > -1) { 73593 cls.split(whitespaceRE).forEach(function (c) { return el.classList.remove(c); }); 73594 } else { 73595 el.classList.remove(cls); 73596 } 73597 if (!el.classList.length) { 73598 el.removeAttribute('class'); 73599 } 73600 } else { 73601 var cur = " " + (el.getAttribute('class') || '') + " "; 73602 var tar = ' ' + cls + ' '; 73603 while (cur.indexOf(tar) >= 0) { 73604 cur = cur.replace(tar, ' '); 73605 } 73606 cur = cur.trim(); 73607 if (cur) { 73608 el.setAttribute('class', cur); 73609 } else { 73610 el.removeAttribute('class'); 73611 } 73612 } 73613} 73614 73615/* */ 73616 73617function resolveTransition (def$$1) { 73618 if (!def$$1) { 73619 return 73620 } 73621 /* istanbul ignore else */ 73622 if (typeof def$$1 === 'object') { 73623 var res = {}; 73624 if (def$$1.css !== false) { 73625 extend(res, autoCssTransition(def$$1.name || 'v')); 73626 } 73627 extend(res, def$$1); 73628 return res 73629 } else if (typeof def$$1 === 'string') { 73630 return autoCssTransition(def$$1) 73631 } 73632} 73633 73634var autoCssTransition = cached(function (name) { 73635 return { 73636 enterClass: (name + "-enter"), 73637 enterToClass: (name + "-enter-to"), 73638 enterActiveClass: (name + "-enter-active"), 73639 leaveClass: (name + "-leave"), 73640 leaveToClass: (name + "-leave-to"), 73641 leaveActiveClass: (name + "-leave-active") 73642 } 73643}); 73644 73645var hasTransition = inBrowser && !isIE9; 73646var TRANSITION = 'transition'; 73647var ANIMATION = 'animation'; 73648 73649// Transition property/event sniffing 73650var transitionProp = 'transition'; 73651var transitionEndEvent = 'transitionend'; 73652var animationProp = 'animation'; 73653var animationEndEvent = 'animationend'; 73654if (hasTransition) { 73655 /* istanbul ignore if */ 73656 if (window.ontransitionend === undefined && 73657 window.onwebkittransitionend !== undefined 73658 ) { 73659 transitionProp = 'WebkitTransition'; 73660 transitionEndEvent = 'webkitTransitionEnd'; 73661 } 73662 if (window.onanimationend === undefined && 73663 window.onwebkitanimationend !== undefined 73664 ) { 73665 animationProp = 'WebkitAnimation'; 73666 animationEndEvent = 'webkitAnimationEnd'; 73667 } 73668} 73669 73670// binding to window is necessary to make hot reload work in IE in strict mode 73671var raf = inBrowser 73672 ? window.requestAnimationFrame 73673 ? window.requestAnimationFrame.bind(window) 73674 : setTimeout 73675 : /* istanbul ignore next */ function (fn) { return fn(); }; 73676 73677function nextFrame (fn) { 73678 raf(function () { 73679 raf(fn); 73680 }); 73681} 73682 73683function addTransitionClass (el, cls) { 73684 var transitionClasses = el._transitionClasses || (el._transitionClasses = []); 73685 if (transitionClasses.indexOf(cls) < 0) { 73686 transitionClasses.push(cls); 73687 addClass(el, cls); 73688 } 73689} 73690 73691function removeTransitionClass (el, cls) { 73692 if (el._transitionClasses) { 73693 remove(el._transitionClasses, cls); 73694 } 73695 removeClass(el, cls); 73696} 73697 73698function whenTransitionEnds ( 73699 el, 73700 expectedType, 73701 cb 73702) { 73703 var ref = getTransitionInfo(el, expectedType); 73704 var type = ref.type; 73705 var timeout = ref.timeout; 73706 var propCount = ref.propCount; 73707 if (!type) { return cb() } 73708 var event = type === TRANSITION ? transitionEndEvent : animationEndEvent; 73709 var ended = 0; 73710 var end = function () { 73711 el.removeEventListener(event, onEnd); 73712 cb(); 73713 }; 73714 var onEnd = function (e) { 73715 if (e.target === el) { 73716 if (++ended >= propCount) { 73717 end(); 73718 } 73719 } 73720 }; 73721 setTimeout(function () { 73722 if (ended < propCount) { 73723 end(); 73724 } 73725 }, timeout + 1); 73726 el.addEventListener(event, onEnd); 73727} 73728 73729var transformRE = /\b(transform|all)(,|$)/; 73730 73731function getTransitionInfo (el, expectedType) { 73732 var styles = window.getComputedStyle(el); 73733 // JSDOM may return undefined for transition properties 73734 var transitionDelays = (styles[transitionProp + 'Delay'] || '').split(', '); 73735 var transitionDurations = (styles[transitionProp + 'Duration'] || '').split(', '); 73736 var transitionTimeout = getTimeout(transitionDelays, transitionDurations); 73737 var animationDelays = (styles[animationProp + 'Delay'] || '').split(', '); 73738 var animationDurations = (styles[animationProp + 'Duration'] || '').split(', '); 73739 var animationTimeout = getTimeout(animationDelays, animationDurations); 73740 73741 var type; 73742 var timeout = 0; 73743 var propCount = 0; 73744 /* istanbul ignore if */ 73745 if (expectedType === TRANSITION) { 73746 if (transitionTimeout > 0) { 73747 type = TRANSITION; 73748 timeout = transitionTimeout; 73749 propCount = transitionDurations.length; 73750 } 73751 } else if (expectedType === ANIMATION) { 73752 if (animationTimeout > 0) { 73753 type = ANIMATION; 73754 timeout = animationTimeout; 73755 propCount = animationDurations.length; 73756 } 73757 } else { 73758 timeout = Math.max(transitionTimeout, animationTimeout); 73759 type = timeout > 0 73760 ? transitionTimeout > animationTimeout 73761 ? TRANSITION 73762 : ANIMATION 73763 : null; 73764 propCount = type 73765 ? type === TRANSITION 73766 ? transitionDurations.length 73767 : animationDurations.length 73768 : 0; 73769 } 73770 var hasTransform = 73771 type === TRANSITION && 73772 transformRE.test(styles[transitionProp + 'Property']); 73773 return { 73774 type: type, 73775 timeout: timeout, 73776 propCount: propCount, 73777 hasTransform: hasTransform 73778 } 73779} 73780 73781function getTimeout (delays, durations) { 73782 /* istanbul ignore next */ 73783 while (delays.length < durations.length) { 73784 delays = delays.concat(delays); 73785 } 73786 73787 return Math.max.apply(null, durations.map(function (d, i) { 73788 return toMs(d) + toMs(delays[i]) 73789 })) 73790} 73791 73792// Old versions of Chromium (below 61.0.3163.100) formats floating pointer numbers 73793// in a locale-dependent way, using a comma instead of a dot. 73794// If comma is not replaced with a dot, the input will be rounded down (i.e. acting 73795// as a floor function) causing unexpected behaviors 73796function toMs (s) { 73797 return Number(s.slice(0, -1).replace(',', '.')) * 1000 73798} 73799 73800/* */ 73801 73802function enter (vnode, toggleDisplay) { 73803 var el = vnode.elm; 73804 73805 // call leave callback now 73806 if (isDef(el._leaveCb)) { 73807 el._leaveCb.cancelled = true; 73808 el._leaveCb(); 73809 } 73810 73811 var data = resolveTransition(vnode.data.transition); 73812 if (isUndef(data)) { 73813 return 73814 } 73815 73816 /* istanbul ignore if */ 73817 if (isDef(el._enterCb) || el.nodeType !== 1) { 73818 return 73819 } 73820 73821 var css = data.css; 73822 var type = data.type; 73823 var enterClass = data.enterClass; 73824 var enterToClass = data.enterToClass; 73825 var enterActiveClass = data.enterActiveClass; 73826 var appearClass = data.appearClass; 73827 var appearToClass = data.appearToClass; 73828 var appearActiveClass = data.appearActiveClass; 73829 var beforeEnter = data.beforeEnter; 73830 var enter = data.enter; 73831 var afterEnter = data.afterEnter; 73832 var enterCancelled = data.enterCancelled; 73833 var beforeAppear = data.beforeAppear; 73834 var appear = data.appear; 73835 var afterAppear = data.afterAppear; 73836 var appearCancelled = data.appearCancelled; 73837 var duration = data.duration; 73838 73839 // activeInstance will always be the <transition> component managing this 73840 // transition. One edge case to check is when the <transition> is placed 73841 // as the root node of a child component. In that case we need to check 73842 // <transition>'s parent for appear check. 73843 var context = activeInstance; 73844 var transitionNode = activeInstance.$vnode; 73845 while (transitionNode && transitionNode.parent) { 73846 context = transitionNode.context; 73847 transitionNode = transitionNode.parent; 73848 } 73849 73850 var isAppear = !context._isMounted || !vnode.isRootInsert; 73851 73852 if (isAppear && !appear && appear !== '') { 73853 return 73854 } 73855 73856 var startClass = isAppear && appearClass 73857 ? appearClass 73858 : enterClass; 73859 var activeClass = isAppear && appearActiveClass 73860 ? appearActiveClass 73861 : enterActiveClass; 73862 var toClass = isAppear && appearToClass 73863 ? appearToClass 73864 : enterToClass; 73865 73866 var beforeEnterHook = isAppear 73867 ? (beforeAppear || beforeEnter) 73868 : beforeEnter; 73869 var enterHook = isAppear 73870 ? (typeof appear === 'function' ? appear : enter) 73871 : enter; 73872 var afterEnterHook = isAppear 73873 ? (afterAppear || afterEnter) 73874 : afterEnter; 73875 var enterCancelledHook = isAppear 73876 ? (appearCancelled || enterCancelled) 73877 : enterCancelled; 73878 73879 var explicitEnterDuration = toNumber( 73880 isObject(duration) 73881 ? duration.enter 73882 : duration 73883 ); 73884 73885 if (explicitEnterDuration != null) { 73886 checkDuration(explicitEnterDuration, 'enter', vnode); 73887 } 73888 73889 var expectsCSS = css !== false && !isIE9; 73890 var userWantsControl = getHookArgumentsLength(enterHook); 73891 73892 var cb = el._enterCb = once(function () { 73893 if (expectsCSS) { 73894 removeTransitionClass(el, toClass); 73895 removeTransitionClass(el, activeClass); 73896 } 73897 if (cb.cancelled) { 73898 if (expectsCSS) { 73899 removeTransitionClass(el, startClass); 73900 } 73901 enterCancelledHook && enterCancelledHook(el); 73902 } else { 73903 afterEnterHook && afterEnterHook(el); 73904 } 73905 el._enterCb = null; 73906 }); 73907 73908 if (!vnode.data.show) { 73909 // remove pending leave element on enter by injecting an insert hook 73910 mergeVNodeHook(vnode, 'insert', function () { 73911 var parent = el.parentNode; 73912 var pendingNode = parent && parent._pending && parent._pending[vnode.key]; 73913 if (pendingNode && 73914 pendingNode.tag === vnode.tag && 73915 pendingNode.elm._leaveCb 73916 ) { 73917 pendingNode.elm._leaveCb(); 73918 } 73919 enterHook && enterHook(el, cb); 73920 }); 73921 } 73922 73923 // start enter transition 73924 beforeEnterHook && beforeEnterHook(el); 73925 if (expectsCSS) { 73926 addTransitionClass(el, startClass); 73927 addTransitionClass(el, activeClass); 73928 nextFrame(function () { 73929 removeTransitionClass(el, startClass); 73930 if (!cb.cancelled) { 73931 addTransitionClass(el, toClass); 73932 if (!userWantsControl) { 73933 if (isValidDuration(explicitEnterDuration)) { 73934 setTimeout(cb, explicitEnterDuration); 73935 } else { 73936 whenTransitionEnds(el, type, cb); 73937 } 73938 } 73939 } 73940 }); 73941 } 73942 73943 if (vnode.data.show) { 73944 toggleDisplay && toggleDisplay(); 73945 enterHook && enterHook(el, cb); 73946 } 73947 73948 if (!expectsCSS && !userWantsControl) { 73949 cb(); 73950 } 73951} 73952 73953function leave (vnode, rm) { 73954 var el = vnode.elm; 73955 73956 // call enter callback now 73957 if (isDef(el._enterCb)) { 73958 el._enterCb.cancelled = true; 73959 el._enterCb(); 73960 } 73961 73962 var data = resolveTransition(vnode.data.transition); 73963 if (isUndef(data) || el.nodeType !== 1) { 73964 return rm() 73965 } 73966 73967 /* istanbul ignore if */ 73968 if (isDef(el._leaveCb)) { 73969 return 73970 } 73971 73972 var css = data.css; 73973 var type = data.type; 73974 var leaveClass = data.leaveClass; 73975 var leaveToClass = data.leaveToClass; 73976 var leaveActiveClass = data.leaveActiveClass; 73977 var beforeLeave = data.beforeLeave; 73978 var leave = data.leave; 73979 var afterLeave = data.afterLeave; 73980 var leaveCancelled = data.leaveCancelled; 73981 var delayLeave = data.delayLeave; 73982 var duration = data.duration; 73983 73984 var expectsCSS = css !== false && !isIE9; 73985 var userWantsControl = getHookArgumentsLength(leave); 73986 73987 var explicitLeaveDuration = toNumber( 73988 isObject(duration) 73989 ? duration.leave 73990 : duration 73991 ); 73992 73993 if (isDef(explicitLeaveDuration)) { 73994 checkDuration(explicitLeaveDuration, 'leave', vnode); 73995 } 73996 73997 var cb = el._leaveCb = once(function () { 73998 if (el.parentNode && el.parentNode._pending) { 73999 el.parentNode._pending[vnode.key] = null; 74000 } 74001 if (expectsCSS) { 74002 removeTransitionClass(el, leaveToClass); 74003 removeTransitionClass(el, leaveActiveClass); 74004 } 74005 if (cb.cancelled) { 74006 if (expectsCSS) { 74007 removeTransitionClass(el, leaveClass); 74008 } 74009 leaveCancelled && leaveCancelled(el); 74010 } else { 74011 rm(); 74012 afterLeave && afterLeave(el); 74013 } 74014 el._leaveCb = null; 74015 }); 74016 74017 if (delayLeave) { 74018 delayLeave(performLeave); 74019 } else { 74020 performLeave(); 74021 } 74022 74023 function performLeave () { 74024 // the delayed leave may have already been cancelled 74025 if (cb.cancelled) { 74026 return 74027 } 74028 // record leaving element 74029 if (!vnode.data.show && el.parentNode) { 74030 (el.parentNode._pending || (el.parentNode._pending = {}))[(vnode.key)] = vnode; 74031 } 74032 beforeLeave && beforeLeave(el); 74033 if (expectsCSS) { 74034 addTransitionClass(el, leaveClass); 74035 addTransitionClass(el, leaveActiveClass); 74036 nextFrame(function () { 74037 removeTransitionClass(el, leaveClass); 74038 if (!cb.cancelled) { 74039 addTransitionClass(el, leaveToClass); 74040 if (!userWantsControl) { 74041 if (isValidDuration(explicitLeaveDuration)) { 74042 setTimeout(cb, explicitLeaveDuration); 74043 } else { 74044 whenTransitionEnds(el, type, cb); 74045 } 74046 } 74047 } 74048 }); 74049 } 74050 leave && leave(el, cb); 74051 if (!expectsCSS && !userWantsControl) { 74052 cb(); 74053 } 74054 } 74055} 74056 74057// only used in dev mode 74058function checkDuration (val, name, vnode) { 74059 if (typeof val !== 'number') { 74060 warn( 74061 "<transition> explicit " + name + " duration is not a valid number - " + 74062 "got " + (JSON.stringify(val)) + ".", 74063 vnode.context 74064 ); 74065 } else if (isNaN(val)) { 74066 warn( 74067 "<transition> explicit " + name + " duration is NaN - " + 74068 'the duration expression might be incorrect.', 74069 vnode.context 74070 ); 74071 } 74072} 74073 74074function isValidDuration (val) { 74075 return typeof val === 'number' && !isNaN(val) 74076} 74077 74078/** 74079 * Normalize a transition hook's argument length. The hook may be: 74080 * - a merged hook (invoker) with the original in .fns 74081 * - a wrapped component method (check ._length) 74082 * - a plain function (.length) 74083 */ 74084function getHookArgumentsLength (fn) { 74085 if (isUndef(fn)) { 74086 return false 74087 } 74088 var invokerFns = fn.fns; 74089 if (isDef(invokerFns)) { 74090 // invoker 74091 return getHookArgumentsLength( 74092 Array.isArray(invokerFns) 74093 ? invokerFns[0] 74094 : invokerFns 74095 ) 74096 } else { 74097 return (fn._length || fn.length) > 1 74098 } 74099} 74100 74101function _enter (_, vnode) { 74102 if (vnode.data.show !== true) { 74103 enter(vnode); 74104 } 74105} 74106 74107var transition = inBrowser ? { 74108 create: _enter, 74109 activate: _enter, 74110 remove: function remove$$1 (vnode, rm) { 74111 /* istanbul ignore else */ 74112 if (vnode.data.show !== true) { 74113 leave(vnode, rm); 74114 } else { 74115 rm(); 74116 } 74117 } 74118} : {}; 74119 74120var platformModules = [ 74121 attrs, 74122 klass, 74123 events, 74124 domProps, 74125 style, 74126 transition 74127]; 74128 74129/* */ 74130 74131// the directive module should be applied last, after all 74132// built-in modules have been applied. 74133var modules = platformModules.concat(baseModules); 74134 74135var patch = createPatchFunction({ nodeOps: nodeOps, modules: modules }); 74136 74137/** 74138 * Not type checking this file because flow doesn't like attaching 74139 * properties to Elements. 74140 */ 74141 74142/* istanbul ignore if */ 74143if (isIE9) { 74144 // http://www.matts411.com/post/internet-explorer-9-oninput/ 74145 document.addEventListener('selectionchange', function () { 74146 var el = document.activeElement; 74147 if (el && el.vmodel) { 74148 trigger(el, 'input'); 74149 } 74150 }); 74151} 74152 74153var directive = { 74154 inserted: function inserted (el, binding, vnode, oldVnode) { 74155 if (vnode.tag === 'select') { 74156 // #6903 74157 if (oldVnode.elm && !oldVnode.elm._vOptions) { 74158 mergeVNodeHook(vnode, 'postpatch', function () { 74159 directive.componentUpdated(el, binding, vnode); 74160 }); 74161 } else { 74162 setSelected(el, binding, vnode.context); 74163 } 74164 el._vOptions = [].map.call(el.options, getValue); 74165 } else if (vnode.tag === 'textarea' || isTextInputType(el.type)) { 74166 el._vModifiers = binding.modifiers; 74167 if (!binding.modifiers.lazy) { 74168 el.addEventListener('compositionstart', onCompositionStart); 74169 el.addEventListener('compositionend', onCompositionEnd); 74170 // Safari < 10.2 & UIWebView doesn't fire compositionend when 74171 // switching focus before confirming composition choice 74172 // this also fixes the issue where some browsers e.g. iOS Chrome 74173 // fires "change" instead of "input" on autocomplete. 74174 el.addEventListener('change', onCompositionEnd); 74175 /* istanbul ignore if */ 74176 if (isIE9) { 74177 el.vmodel = true; 74178 } 74179 } 74180 } 74181 }, 74182 74183 componentUpdated: function componentUpdated (el, binding, vnode) { 74184 if (vnode.tag === 'select') { 74185 setSelected(el, binding, vnode.context); 74186 // in case the options rendered by v-for have changed, 74187 // it's possible that the value is out-of-sync with the rendered options. 74188 // detect such cases and filter out values that no longer has a matching 74189 // option in the DOM. 74190 var prevOptions = el._vOptions; 74191 var curOptions = el._vOptions = [].map.call(el.options, getValue); 74192 if (curOptions.some(function (o, i) { return !looseEqual(o, prevOptions[i]); })) { 74193 // trigger change event if 74194 // no matching option found for at least one value 74195 var needReset = el.multiple 74196 ? binding.value.some(function (v) { return hasNoMatchingOption(v, curOptions); }) 74197 : binding.value !== binding.oldValue && hasNoMatchingOption(binding.value, curOptions); 74198 if (needReset) { 74199 trigger(el, 'change'); 74200 } 74201 } 74202 } 74203 } 74204}; 74205 74206function setSelected (el, binding, vm) { 74207 actuallySetSelected(el, binding, vm); 74208 /* istanbul ignore if */ 74209 if (isIE || isEdge) { 74210 setTimeout(function () { 74211 actuallySetSelected(el, binding, vm); 74212 }, 0); 74213 } 74214} 74215 74216function actuallySetSelected (el, binding, vm) { 74217 var value = binding.value; 74218 var isMultiple = el.multiple; 74219 if (isMultiple && !Array.isArray(value)) { 74220 warn( 74221 "<select multiple v-model=\"" + (binding.expression) + "\"> " + 74222 "expects an Array value for its binding, but got " + (Object.prototype.toString.call(value).slice(8, -1)), 74223 vm 74224 ); 74225 return 74226 } 74227 var selected, option; 74228 for (var i = 0, l = el.options.length; i < l; i++) { 74229 option = el.options[i]; 74230 if (isMultiple) { 74231 selected = looseIndexOf(value, getValue(option)) > -1; 74232 if (option.selected !== selected) { 74233 option.selected = selected; 74234 } 74235 } else { 74236 if (looseEqual(getValue(option), value)) { 74237 if (el.selectedIndex !== i) { 74238 el.selectedIndex = i; 74239 } 74240 return 74241 } 74242 } 74243 } 74244 if (!isMultiple) { 74245 el.selectedIndex = -1; 74246 } 74247} 74248 74249function hasNoMatchingOption (value, options) { 74250 return options.every(function (o) { return !looseEqual(o, value); }) 74251} 74252 74253function getValue (option) { 74254 return '_value' in option 74255 ? option._value 74256 : option.value 74257} 74258 74259function onCompositionStart (e) { 74260 e.target.composing = true; 74261} 74262 74263function onCompositionEnd (e) { 74264 // prevent triggering an input event for no reason 74265 if (!e.target.composing) { return } 74266 e.target.composing = false; 74267 trigger(e.target, 'input'); 74268} 74269 74270function trigger (el, type) { 74271 var e = document.createEvent('HTMLEvents'); 74272 e.initEvent(type, true, true); 74273 el.dispatchEvent(e); 74274} 74275 74276/* */ 74277 74278// recursively search for possible transition defined inside the component root 74279function locateNode (vnode) { 74280 return vnode.componentInstance && (!vnode.data || !vnode.data.transition) 74281 ? locateNode(vnode.componentInstance._vnode) 74282 : vnode 74283} 74284 74285var show = { 74286 bind: function bind (el, ref, vnode) { 74287 var value = ref.value; 74288 74289 vnode = locateNode(vnode); 74290 var transition$$1 = vnode.data && vnode.data.transition; 74291 var originalDisplay = el.__vOriginalDisplay = 74292 el.style.display === 'none' ? '' : el.style.display; 74293 if (value && transition$$1) { 74294 vnode.data.show = true; 74295 enter(vnode, function () { 74296 el.style.display = originalDisplay; 74297 }); 74298 } else { 74299 el.style.display = value ? originalDisplay : 'none'; 74300 } 74301 }, 74302 74303 update: function update (el, ref, vnode) { 74304 var value = ref.value; 74305 var oldValue = ref.oldValue; 74306 74307 /* istanbul ignore if */ 74308 if (!value === !oldValue) { return } 74309 vnode = locateNode(vnode); 74310 var transition$$1 = vnode.data && vnode.data.transition; 74311 if (transition$$1) { 74312 vnode.data.show = true; 74313 if (value) { 74314 enter(vnode, function () { 74315 el.style.display = el.__vOriginalDisplay; 74316 }); 74317 } else { 74318 leave(vnode, function () { 74319 el.style.display = 'none'; 74320 }); 74321 } 74322 } else { 74323 el.style.display = value ? el.__vOriginalDisplay : 'none'; 74324 } 74325 }, 74326 74327 unbind: function unbind ( 74328 el, 74329 binding, 74330 vnode, 74331 oldVnode, 74332 isDestroy 74333 ) { 74334 if (!isDestroy) { 74335 el.style.display = el.__vOriginalDisplay; 74336 } 74337 } 74338}; 74339 74340var platformDirectives = { 74341 model: directive, 74342 show: show 74343}; 74344 74345/* */ 74346 74347var transitionProps = { 74348 name: String, 74349 appear: Boolean, 74350 css: Boolean, 74351 mode: String, 74352 type: String, 74353 enterClass: String, 74354 leaveClass: String, 74355 enterToClass: String, 74356 leaveToClass: String, 74357 enterActiveClass: String, 74358 leaveActiveClass: String, 74359 appearClass: String, 74360 appearActiveClass: String, 74361 appearToClass: String, 74362 duration: [Number, String, Object] 74363}; 74364 74365// in case the child is also an abstract component, e.g. <keep-alive> 74366// we want to recursively retrieve the real component to be rendered 74367function getRealChild (vnode) { 74368 var compOptions = vnode && vnode.componentOptions; 74369 if (compOptions && compOptions.Ctor.options.abstract) { 74370 return getRealChild(getFirstComponentChild(compOptions.children)) 74371 } else { 74372 return vnode 74373 } 74374} 74375 74376function extractTransitionData (comp) { 74377 var data = {}; 74378 var options = comp.$options; 74379 // props 74380 for (var key in options.propsData) { 74381 data[key] = comp[key]; 74382 } 74383 // events. 74384 // extract listeners and pass them directly to the transition methods 74385 var listeners = options._parentListeners; 74386 for (var key$1 in listeners) { 74387 data[camelize(key$1)] = listeners[key$1]; 74388 } 74389 return data 74390} 74391 74392function placeholder (h, rawChild) { 74393 if (/\d-keep-alive$/.test(rawChild.tag)) { 74394 return h('keep-alive', { 74395 props: rawChild.componentOptions.propsData 74396 }) 74397 } 74398} 74399 74400function hasParentTransition (vnode) { 74401 while ((vnode = vnode.parent)) { 74402 if (vnode.data.transition) { 74403 return true 74404 } 74405 } 74406} 74407 74408function isSameChild (child, oldChild) { 74409 return oldChild.key === child.key && oldChild.tag === child.tag 74410} 74411 74412var isNotTextNode = function (c) { return c.tag || isAsyncPlaceholder(c); }; 74413 74414var isVShowDirective = function (d) { return d.name === 'show'; }; 74415 74416var Transition = { 74417 name: 'transition', 74418 props: transitionProps, 74419 abstract: true, 74420 74421 render: function render (h) { 74422 var this$1 = this; 74423 74424 var children = this.$slots.default; 74425 if (!children) { 74426 return 74427 } 74428 74429 // filter out text nodes (possible whitespaces) 74430 children = children.filter(isNotTextNode); 74431 /* istanbul ignore if */ 74432 if (!children.length) { 74433 return 74434 } 74435 74436 // warn multiple elements 74437 if (children.length > 1) { 74438 warn( 74439 '<transition> can only be used on a single element. Use ' + 74440 '<transition-group> for lists.', 74441 this.$parent 74442 ); 74443 } 74444 74445 var mode = this.mode; 74446 74447 // warn invalid mode 74448 if (mode && mode !== 'in-out' && mode !== 'out-in' 74449 ) { 74450 warn( 74451 'invalid <transition> mode: ' + mode, 74452 this.$parent 74453 ); 74454 } 74455 74456 var rawChild = children[0]; 74457 74458 // if this is a component root node and the component's 74459 // parent container node also has transition, skip. 74460 if (hasParentTransition(this.$vnode)) { 74461 return rawChild 74462 } 74463 74464 // apply transition data to child 74465 // use getRealChild() to ignore abstract components e.g. keep-alive 74466 var child = getRealChild(rawChild); 74467 /* istanbul ignore if */ 74468 if (!child) { 74469 return rawChild 74470 } 74471 74472 if (this._leaving) { 74473 return placeholder(h, rawChild) 74474 } 74475 74476 // ensure a key that is unique to the vnode type and to this transition 74477 // component instance. This key will be used to remove pending leaving nodes 74478 // during entering. 74479 var id = "__transition-" + (this._uid) + "-"; 74480 child.key = child.key == null 74481 ? child.isComment 74482 ? id + 'comment' 74483 : id + child.tag 74484 : isPrimitive(child.key) 74485 ? (String(child.key).indexOf(id) === 0 ? child.key : id + child.key) 74486 : child.key; 74487 74488 var data = (child.data || (child.data = {})).transition = extractTransitionData(this); 74489 var oldRawChild = this._vnode; 74490 var oldChild = getRealChild(oldRawChild); 74491 74492 // mark v-show 74493 // so that the transition module can hand over the control to the directive 74494 if (child.data.directives && child.data.directives.some(isVShowDirective)) { 74495 child.data.show = true; 74496 } 74497 74498 if ( 74499 oldChild && 74500 oldChild.data && 74501 !isSameChild(child, oldChild) && 74502 !isAsyncPlaceholder(oldChild) && 74503 // #6687 component root is a comment node 74504 !(oldChild.componentInstance && oldChild.componentInstance._vnode.isComment) 74505 ) { 74506 // replace old child transition data with fresh one 74507 // important for dynamic transitions! 74508 var oldData = oldChild.data.transition = extend({}, data); 74509 // handle transition mode 74510 if (mode === 'out-in') { 74511 // return placeholder node and queue update when leave finishes 74512 this._leaving = true; 74513 mergeVNodeHook(oldData, 'afterLeave', function () { 74514 this$1._leaving = false; 74515 this$1.$forceUpdate(); 74516 }); 74517 return placeholder(h, rawChild) 74518 } else if (mode === 'in-out') { 74519 if (isAsyncPlaceholder(child)) { 74520 return oldRawChild 74521 } 74522 var delayedLeave; 74523 var performLeave = function () { delayedLeave(); }; 74524 mergeVNodeHook(data, 'afterEnter', performLeave); 74525 mergeVNodeHook(data, 'enterCancelled', performLeave); 74526 mergeVNodeHook(oldData, 'delayLeave', function (leave) { delayedLeave = leave; }); 74527 } 74528 } 74529 74530 return rawChild 74531 } 74532}; 74533 74534/* */ 74535 74536var props = extend({ 74537 tag: String, 74538 moveClass: String 74539}, transitionProps); 74540 74541delete props.mode; 74542 74543var TransitionGroup = { 74544 props: props, 74545 74546 beforeMount: function beforeMount () { 74547 var this$1 = this; 74548 74549 var update = this._update; 74550 this._update = function (vnode, hydrating) { 74551 var restoreActiveInstance = setActiveInstance(this$1); 74552 // force removing pass 74553 this$1.__patch__( 74554 this$1._vnode, 74555 this$1.kept, 74556 false, // hydrating 74557 true // removeOnly (!important, avoids unnecessary moves) 74558 ); 74559 this$1._vnode = this$1.kept; 74560 restoreActiveInstance(); 74561 update.call(this$1, vnode, hydrating); 74562 }; 74563 }, 74564 74565 render: function render (h) { 74566 var tag = this.tag || this.$vnode.data.tag || 'span'; 74567 var map = Object.create(null); 74568 var prevChildren = this.prevChildren = this.children; 74569 var rawChildren = this.$slots.default || []; 74570 var children = this.children = []; 74571 var transitionData = extractTransitionData(this); 74572 74573 for (var i = 0; i < rawChildren.length; i++) { 74574 var c = rawChildren[i]; 74575 if (c.tag) { 74576 if (c.key != null && String(c.key).indexOf('__vlist') !== 0) { 74577 children.push(c); 74578 map[c.key] = c 74579 ;(c.data || (c.data = {})).transition = transitionData; 74580 } else { 74581 var opts = c.componentOptions; 74582 var name = opts ? (opts.Ctor.options.name || opts.tag || '') : c.tag; 74583 warn(("<transition-group> children must be keyed: <" + name + ">")); 74584 } 74585 } 74586 } 74587 74588 if (prevChildren) { 74589 var kept = []; 74590 var removed = []; 74591 for (var i$1 = 0; i$1 < prevChildren.length; i$1++) { 74592 var c$1 = prevChildren[i$1]; 74593 c$1.data.transition = transitionData; 74594 c$1.data.pos = c$1.elm.getBoundingClientRect(); 74595 if (map[c$1.key]) { 74596 kept.push(c$1); 74597 } else { 74598 removed.push(c$1); 74599 } 74600 } 74601 this.kept = h(tag, null, kept); 74602 this.removed = removed; 74603 } 74604 74605 return h(tag, null, children) 74606 }, 74607 74608 updated: function updated () { 74609 var children = this.prevChildren; 74610 var moveClass = this.moveClass || ((this.name || 'v') + '-move'); 74611 if (!children.length || !this.hasMove(children[0].elm, moveClass)) { 74612 return 74613 } 74614 74615 // we divide the work into three loops to avoid mixing DOM reads and writes 74616 // in each iteration - which helps prevent layout thrashing. 74617 children.forEach(callPendingCbs); 74618 children.forEach(recordPosition); 74619 children.forEach(applyTranslation); 74620 74621 // force reflow to put everything in position 74622 // assign to this to avoid being removed in tree-shaking 74623 // $flow-disable-line 74624 this._reflow = document.body.offsetHeight; 74625 74626 children.forEach(function (c) { 74627 if (c.data.moved) { 74628 var el = c.elm; 74629 var s = el.style; 74630 addTransitionClass(el, moveClass); 74631 s.transform = s.WebkitTransform = s.transitionDuration = ''; 74632 el.addEventListener(transitionEndEvent, el._moveCb = function cb (e) { 74633 if (e && e.target !== el) { 74634 return 74635 } 74636 if (!e || /transform$/.test(e.propertyName)) { 74637 el.removeEventListener(transitionEndEvent, cb); 74638 el._moveCb = null; 74639 removeTransitionClass(el, moveClass); 74640 } 74641 }); 74642 } 74643 }); 74644 }, 74645 74646 methods: { 74647 hasMove: function hasMove (el, moveClass) { 74648 /* istanbul ignore if */ 74649 if (!hasTransition) { 74650 return false 74651 } 74652 /* istanbul ignore if */ 74653 if (this._hasMove) { 74654 return this._hasMove 74655 } 74656 // Detect whether an element with the move class applied has 74657 // CSS transitions. Since the element may be inside an entering 74658 // transition at this very moment, we make a clone of it and remove 74659 // all other transition classes applied to ensure only the move class 74660 // is applied. 74661 var clone = el.cloneNode(); 74662 if (el._transitionClasses) { 74663 el._transitionClasses.forEach(function (cls) { removeClass(clone, cls); }); 74664 } 74665 addClass(clone, moveClass); 74666 clone.style.display = 'none'; 74667 this.$el.appendChild(clone); 74668 var info = getTransitionInfo(clone); 74669 this.$el.removeChild(clone); 74670 return (this._hasMove = info.hasTransform) 74671 } 74672 } 74673}; 74674 74675function callPendingCbs (c) { 74676 /* istanbul ignore if */ 74677 if (c.elm._moveCb) { 74678 c.elm._moveCb(); 74679 } 74680 /* istanbul ignore if */ 74681 if (c.elm._enterCb) { 74682 c.elm._enterCb(); 74683 } 74684} 74685 74686function recordPosition (c) { 74687 c.data.newPos = c.elm.getBoundingClientRect(); 74688} 74689 74690function applyTranslation (c) { 74691 var oldPos = c.data.pos; 74692 var newPos = c.data.newPos; 74693 var dx = oldPos.left - newPos.left; 74694 var dy = oldPos.top - newPos.top; 74695 if (dx || dy) { 74696 c.data.moved = true; 74697 var s = c.elm.style; 74698 s.transform = s.WebkitTransform = "translate(" + dx + "px," + dy + "px)"; 74699 s.transitionDuration = '0s'; 74700 } 74701} 74702 74703var platformComponents = { 74704 Transition: Transition, 74705 TransitionGroup: TransitionGroup 74706}; 74707 74708/* */ 74709 74710// install platform specific utils 74711Vue.config.mustUseProp = mustUseProp; 74712Vue.config.isReservedTag = isReservedTag; 74713Vue.config.isReservedAttr = isReservedAttr; 74714Vue.config.getTagNamespace = getTagNamespace; 74715Vue.config.isUnknownElement = isUnknownElement; 74716 74717// install platform runtime directives & components 74718extend(Vue.options.directives, platformDirectives); 74719extend(Vue.options.components, platformComponents); 74720 74721// install platform patch function 74722Vue.prototype.__patch__ = inBrowser ? patch : noop; 74723 74724// public mount method 74725Vue.prototype.$mount = function ( 74726 el, 74727 hydrating 74728) { 74729 el = el && inBrowser ? query(el) : undefined; 74730 return mountComponent(this, el, hydrating) 74731}; 74732 74733// devtools global hook 74734/* istanbul ignore next */ 74735if (inBrowser) { 74736 setTimeout(function () { 74737 if (config.devtools) { 74738 if (devtools) { 74739 devtools.emit('init', Vue); 74740 } else { 74741 console[console.info ? 'info' : 'log']( 74742 'Download the Vue Devtools extension for a better development experience:\n' + 74743 'https://github.com/vuejs/vue-devtools' 74744 ); 74745 } 74746 } 74747 if (config.productionTip !== false && 74748 typeof console !== 'undefined' 74749 ) { 74750 console[console.info ? 'info' : 'log']( 74751 "You are running Vue in development mode.\n" + 74752 "Make sure to turn on production mode when deploying for production.\n" + 74753 "See more tips at https://vuejs.org/guide/deployment.html" 74754 ); 74755 } 74756 }, 0); 74757} 74758 74759/* */ 74760 74761var defaultTagRE = /\{\{((?:.|\r?\n)+?)\}\}/g; 74762var regexEscapeRE = /[-.*+?^${}()|[\]\/\\]/g; 74763 74764var buildRegex = cached(function (delimiters) { 74765 var open = delimiters[0].replace(regexEscapeRE, '\\$&'); 74766 var close = delimiters[1].replace(regexEscapeRE, '\\$&'); 74767 return new RegExp(open + '((?:.|\\n)+?)' + close, 'g') 74768}); 74769 74770 74771 74772function parseText ( 74773 text, 74774 delimiters 74775) { 74776 var tagRE = delimiters ? buildRegex(delimiters) : defaultTagRE; 74777 if (!tagRE.test(text)) { 74778 return 74779 } 74780 var tokens = []; 74781 var rawTokens = []; 74782 var lastIndex = tagRE.lastIndex = 0; 74783 var match, index, tokenValue; 74784 while ((match = tagRE.exec(text))) { 74785 index = match.index; 74786 // push text token 74787 if (index > lastIndex) { 74788 rawTokens.push(tokenValue = text.slice(lastIndex, index)); 74789 tokens.push(JSON.stringify(tokenValue)); 74790 } 74791 // tag token 74792 var exp = parseFilters(match[1].trim()); 74793 tokens.push(("_s(" + exp + ")")); 74794 rawTokens.push({ '@binding': exp }); 74795 lastIndex = index + match[0].length; 74796 } 74797 if (lastIndex < text.length) { 74798 rawTokens.push(tokenValue = text.slice(lastIndex)); 74799 tokens.push(JSON.stringify(tokenValue)); 74800 } 74801 return { 74802 expression: tokens.join('+'), 74803 tokens: rawTokens 74804 } 74805} 74806 74807/* */ 74808 74809function transformNode (el, options) { 74810 var warn = options.warn || baseWarn; 74811 var staticClass = getAndRemoveAttr(el, 'class'); 74812 if (staticClass) { 74813 var res = parseText(staticClass, options.delimiters); 74814 if (res) { 74815 warn( 74816 "class=\"" + staticClass + "\": " + 74817 'Interpolation inside attributes has been removed. ' + 74818 'Use v-bind or the colon shorthand instead. For example, ' + 74819 'instead of <div class="{{ val }}">, use <div :class="val">.', 74820 el.rawAttrsMap['class'] 74821 ); 74822 } 74823 } 74824 if (staticClass) { 74825 el.staticClass = JSON.stringify(staticClass); 74826 } 74827 var classBinding = getBindingAttr(el, 'class', false /* getStatic */); 74828 if (classBinding) { 74829 el.classBinding = classBinding; 74830 } 74831} 74832 74833function genData (el) { 74834 var data = ''; 74835 if (el.staticClass) { 74836 data += "staticClass:" + (el.staticClass) + ","; 74837 } 74838 if (el.classBinding) { 74839 data += "class:" + (el.classBinding) + ","; 74840 } 74841 return data 74842} 74843 74844var klass$1 = { 74845 staticKeys: ['staticClass'], 74846 transformNode: transformNode, 74847 genData: genData 74848}; 74849 74850/* */ 74851 74852function transformNode$1 (el, options) { 74853 var warn = options.warn || baseWarn; 74854 var staticStyle = getAndRemoveAttr(el, 'style'); 74855 if (staticStyle) { 74856 /* istanbul ignore if */ 74857 { 74858 var res = parseText(staticStyle, options.delimiters); 74859 if (res) { 74860 warn( 74861 "style=\"" + staticStyle + "\": " + 74862 'Interpolation inside attributes has been removed. ' + 74863 'Use v-bind or the colon shorthand instead. For example, ' + 74864 'instead of <div style="{{ val }}">, use <div :style="val">.', 74865 el.rawAttrsMap['style'] 74866 ); 74867 } 74868 } 74869 el.staticStyle = JSON.stringify(parseStyleText(staticStyle)); 74870 } 74871 74872 var styleBinding = getBindingAttr(el, 'style', false /* getStatic */); 74873 if (styleBinding) { 74874 el.styleBinding = styleBinding; 74875 } 74876} 74877 74878function genData$1 (el) { 74879 var data = ''; 74880 if (el.staticStyle) { 74881 data += "staticStyle:" + (el.staticStyle) + ","; 74882 } 74883 if (el.styleBinding) { 74884 data += "style:(" + (el.styleBinding) + "),"; 74885 } 74886 return data 74887} 74888 74889var style$1 = { 74890 staticKeys: ['staticStyle'], 74891 transformNode: transformNode$1, 74892 genData: genData$1 74893}; 74894 74895/* */ 74896 74897var decoder; 74898 74899var he = { 74900 decode: function decode (html) { 74901 decoder = decoder || document.createElement('div'); 74902 decoder.innerHTML = html; 74903 return decoder.textContent 74904 } 74905}; 74906 74907/* */ 74908 74909var isUnaryTag = makeMap( 74910 'area,base,br,col,embed,frame,hr,img,input,isindex,keygen,' + 74911 'link,meta,param,source,track,wbr' 74912); 74913 74914// Elements that you can, intentionally, leave open 74915// (and which close themselves) 74916var canBeLeftOpenTag = makeMap( 74917 'colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source' 74918); 74919 74920// HTML5 tags https://html.spec.whatwg.org/multipage/indices.html#elements-3 74921// Phrasing Content https://html.spec.whatwg.org/multipage/dom.html#phrasing-content 74922var isNonPhrasingTag = makeMap( 74923 'address,article,aside,base,blockquote,body,caption,col,colgroup,dd,' + 74924 'details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,' + 74925 'h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,' + 74926 'optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,' + 74927 'title,tr,track' 74928); 74929 74930/** 74931 * Not type-checking this file because it's mostly vendor code. 74932 */ 74933 74934// Regular Expressions for parsing tags and attributes 74935var attribute = /^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 74936var dynamicArgAttribute = /^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+?\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/; 74937var ncname = "[a-zA-Z_][\\-\\.0-9_a-zA-Z" + (unicodeRegExp.source) + "]*"; 74938var qnameCapture = "((?:" + ncname + "\\:)?" + ncname + ")"; 74939var startTagOpen = new RegExp(("^<" + qnameCapture)); 74940var startTagClose = /^\s*(\/?)>/; 74941var endTag = new RegExp(("^<\\/" + qnameCapture + "[^>]*>")); 74942var doctype = /^<!DOCTYPE [^>]+>/i; 74943// #7298: escape - to avoid being passed as HTML comment when inlined in page 74944var comment = /^<!\--/; 74945var conditionalComment = /^<!\[/; 74946 74947// Special Elements (can contain anything) 74948var isPlainTextElement = makeMap('script,style,textarea', true); 74949var reCache = {}; 74950 74951var decodingMap = { 74952 '<': '<', 74953 '>': '>', 74954 '"': '"', 74955 '&': '&', 74956 ' ': '\n', 74957 '	': '\t', 74958 ''': "'" 74959}; 74960var encodedAttr = /&(?:lt|gt|quot|amp|#39);/g; 74961var encodedAttrWithNewLines = /&(?:lt|gt|quot|amp|#39|#10|#9);/g; 74962 74963// #5992 74964var isIgnoreNewlineTag = makeMap('pre,textarea', true); 74965var shouldIgnoreFirstNewline = function (tag, html) { return tag && isIgnoreNewlineTag(tag) && html[0] === '\n'; }; 74966 74967function decodeAttr (value, shouldDecodeNewlines) { 74968 var re = shouldDecodeNewlines ? encodedAttrWithNewLines : encodedAttr; 74969 return value.replace(re, function (match) { return decodingMap[match]; }) 74970} 74971 74972function parseHTML (html, options) { 74973 var stack = []; 74974 var expectHTML = options.expectHTML; 74975 var isUnaryTag$$1 = options.isUnaryTag || no; 74976 var canBeLeftOpenTag$$1 = options.canBeLeftOpenTag || no; 74977 var index = 0; 74978 var last, lastTag; 74979 while (html) { 74980 last = html; 74981 // Make sure we're not in a plaintext content element like script/style 74982 if (!lastTag || !isPlainTextElement(lastTag)) { 74983 var textEnd = html.indexOf('<'); 74984 if (textEnd === 0) { 74985 // Comment: 74986 if (comment.test(html)) { 74987 var commentEnd = html.indexOf('-->'); 74988 74989 if (commentEnd >= 0) { 74990 if (options.shouldKeepComment) { 74991 options.comment(html.substring(4, commentEnd), index, index + commentEnd + 3); 74992 } 74993 advance(commentEnd + 3); 74994 continue 74995 } 74996 } 74997 74998 // http://en.wikipedia.org/wiki/Conditional_comment#Downlevel-revealed_conditional_comment 74999 if (conditionalComment.test(html)) { 75000 var conditionalEnd = html.indexOf(']>'); 75001 75002 if (conditionalEnd >= 0) { 75003 advance(conditionalEnd + 2); 75004 continue 75005 } 75006 } 75007 75008 // Doctype: 75009 var doctypeMatch = html.match(doctype); 75010 if (doctypeMatch) { 75011 advance(doctypeMatch[0].length); 75012 continue 75013 } 75014 75015 // End tag: 75016 var endTagMatch = html.match(endTag); 75017 if (endTagMatch) { 75018 var curIndex = index; 75019 advance(endTagMatch[0].length); 75020 parseEndTag(endTagMatch[1], curIndex, index); 75021 continue 75022 } 75023 75024 // Start tag: 75025 var startTagMatch = parseStartTag(); 75026 if (startTagMatch) { 75027 handleStartTag(startTagMatch); 75028 if (shouldIgnoreFirstNewline(startTagMatch.tagName, html)) { 75029 advance(1); 75030 } 75031 continue 75032 } 75033 } 75034 75035 var text = (void 0), rest = (void 0), next = (void 0); 75036 if (textEnd >= 0) { 75037 rest = html.slice(textEnd); 75038 while ( 75039 !endTag.test(rest) && 75040 !startTagOpen.test(rest) && 75041 !comment.test(rest) && 75042 !conditionalComment.test(rest) 75043 ) { 75044 // < in plain text, be forgiving and treat it as text 75045 next = rest.indexOf('<', 1); 75046 if (next < 0) { break } 75047 textEnd += next; 75048 rest = html.slice(textEnd); 75049 } 75050 text = html.substring(0, textEnd); 75051 } 75052 75053 if (textEnd < 0) { 75054 text = html; 75055 } 75056 75057 if (text) { 75058 advance(text.length); 75059 } 75060 75061 if (options.chars && text) { 75062 options.chars(text, index - text.length, index); 75063 } 75064 } else { 75065 var endTagLength = 0; 75066 var stackedTag = lastTag.toLowerCase(); 75067 var reStackedTag = reCache[stackedTag] || (reCache[stackedTag] = new RegExp('([\\s\\S]*?)(</' + stackedTag + '[^>]*>)', 'i')); 75068 var rest$1 = html.replace(reStackedTag, function (all, text, endTag) { 75069 endTagLength = endTag.length; 75070 if (!isPlainTextElement(stackedTag) && stackedTag !== 'noscript') { 75071 text = text 75072 .replace(/<!\--([\s\S]*?)-->/g, '$1') // #7298 75073 .replace(/<!\[CDATA\[([\s\S]*?)]]>/g, '$1'); 75074 } 75075 if (shouldIgnoreFirstNewline(stackedTag, text)) { 75076 text = text.slice(1); 75077 } 75078 if (options.chars) { 75079 options.chars(text); 75080 } 75081 return '' 75082 }); 75083 index += html.length - rest$1.length; 75084 html = rest$1; 75085 parseEndTag(stackedTag, index - endTagLength, index); 75086 } 75087 75088 if (html === last) { 75089 options.chars && options.chars(html); 75090 if (!stack.length && options.warn) { 75091 options.warn(("Mal-formatted tag at end of template: \"" + html + "\""), { start: index + html.length }); 75092 } 75093 break 75094 } 75095 } 75096 75097 // Clean up any remaining tags 75098 parseEndTag(); 75099 75100 function advance (n) { 75101 index += n; 75102 html = html.substring(n); 75103 } 75104 75105 function parseStartTag () { 75106 var start = html.match(startTagOpen); 75107 if (start) { 75108 var match = { 75109 tagName: start[1], 75110 attrs: [], 75111 start: index 75112 }; 75113 advance(start[0].length); 75114 var end, attr; 75115 while (!(end = html.match(startTagClose)) && (attr = html.match(dynamicArgAttribute) || html.match(attribute))) { 75116 attr.start = index; 75117 advance(attr[0].length); 75118 attr.end = index; 75119 match.attrs.push(attr); 75120 } 75121 if (end) { 75122 match.unarySlash = end[1]; 75123 advance(end[0].length); 75124 match.end = index; 75125 return match 75126 } 75127 } 75128 } 75129 75130 function handleStartTag (match) { 75131 var tagName = match.tagName; 75132 var unarySlash = match.unarySlash; 75133 75134 if (expectHTML) { 75135 if (lastTag === 'p' && isNonPhrasingTag(tagName)) { 75136 parseEndTag(lastTag); 75137 } 75138 if (canBeLeftOpenTag$$1(tagName) && lastTag === tagName) { 75139 parseEndTag(tagName); 75140 } 75141 } 75142 75143 var unary = isUnaryTag$$1(tagName) || !!unarySlash; 75144 75145 var l = match.attrs.length; 75146 var attrs = new Array(l); 75147 for (var i = 0; i < l; i++) { 75148 var args = match.attrs[i]; 75149 var value = args[3] || args[4] || args[5] || ''; 75150 var shouldDecodeNewlines = tagName === 'a' && args[1] === 'href' 75151 ? options.shouldDecodeNewlinesForHref 75152 : options.shouldDecodeNewlines; 75153 attrs[i] = { 75154 name: args[1], 75155 value: decodeAttr(value, shouldDecodeNewlines) 75156 }; 75157 if (options.outputSourceRange) { 75158 attrs[i].start = args.start + args[0].match(/^\s*/).length; 75159 attrs[i].end = args.end; 75160 } 75161 } 75162 75163 if (!unary) { 75164 stack.push({ tag: tagName, lowerCasedTag: tagName.toLowerCase(), attrs: attrs, start: match.start, end: match.end }); 75165 lastTag = tagName; 75166 } 75167 75168 if (options.start) { 75169 options.start(tagName, attrs, unary, match.start, match.end); 75170 } 75171 } 75172 75173 function parseEndTag (tagName, start, end) { 75174 var pos, lowerCasedTagName; 75175 if (start == null) { start = index; } 75176 if (end == null) { end = index; } 75177 75178 // Find the closest opened tag of the same type 75179 if (tagName) { 75180 lowerCasedTagName = tagName.toLowerCase(); 75181 for (pos = stack.length - 1; pos >= 0; pos--) { 75182 if (stack[pos].lowerCasedTag === lowerCasedTagName) { 75183 break 75184 } 75185 } 75186 } else { 75187 // If no tag name is provided, clean shop 75188 pos = 0; 75189 } 75190 75191 if (pos >= 0) { 75192 // Close all the open elements, up the stack 75193 for (var i = stack.length - 1; i >= pos; i--) { 75194 if (i > pos || !tagName && 75195 options.warn 75196 ) { 75197 options.warn( 75198 ("tag <" + (stack[i].tag) + "> has no matching end tag."), 75199 { start: stack[i].start, end: stack[i].end } 75200 ); 75201 } 75202 if (options.end) { 75203 options.end(stack[i].tag, start, end); 75204 } 75205 } 75206 75207 // Remove the open elements from the stack 75208 stack.length = pos; 75209 lastTag = pos && stack[pos - 1].tag; 75210 } else if (lowerCasedTagName === 'br') { 75211 if (options.start) { 75212 options.start(tagName, [], true, start, end); 75213 } 75214 } else if (lowerCasedTagName === 'p') { 75215 if (options.start) { 75216 options.start(tagName, [], false, start, end); 75217 } 75218 if (options.end) { 75219 options.end(tagName, start, end); 75220 } 75221 } 75222 } 75223} 75224 75225/* */ 75226 75227var onRE = /^@|^v-on:/; 75228var dirRE = /^v-|^@|^:|^#/; 75229var forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; 75230var forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; 75231var stripParensRE = /^\(|\)$/g; 75232var dynamicArgRE = /^\[.*\]$/; 75233 75234var argRE = /:(.*)$/; 75235var bindRE = /^:|^\.|^v-bind:/; 75236var modifierRE = /\.[^.\]]+(?=[^\]]*$)/g; 75237 75238var slotRE = /^v-slot(:|$)|^#/; 75239 75240var lineBreakRE = /[\r\n]/; 75241var whitespaceRE$1 = /[ \f\t\r\n]+/g; 75242 75243var invalidAttributeRE = /[\s"'<>\/=]/; 75244 75245var decodeHTMLCached = cached(he.decode); 75246 75247var emptySlotScopeToken = "_empty_"; 75248 75249// configurable state 75250var warn$2; 75251var delimiters; 75252var transforms; 75253var preTransforms; 75254var postTransforms; 75255var platformIsPreTag; 75256var platformMustUseProp; 75257var platformGetTagNamespace; 75258var maybeComponent; 75259 75260function createASTElement ( 75261 tag, 75262 attrs, 75263 parent 75264) { 75265 return { 75266 type: 1, 75267 tag: tag, 75268 attrsList: attrs, 75269 attrsMap: makeAttrsMap(attrs), 75270 rawAttrsMap: {}, 75271 parent: parent, 75272 children: [] 75273 } 75274} 75275 75276/** 75277 * Convert HTML string to AST. 75278 */ 75279function parse ( 75280 template, 75281 options 75282) { 75283 warn$2 = options.warn || baseWarn; 75284 75285 platformIsPreTag = options.isPreTag || no; 75286 platformMustUseProp = options.mustUseProp || no; 75287 platformGetTagNamespace = options.getTagNamespace || no; 75288 var isReservedTag = options.isReservedTag || no; 75289 maybeComponent = function (el) { return !!( 75290 el.component || 75291 el.attrsMap[':is'] || 75292 el.attrsMap['v-bind:is'] || 75293 !(el.attrsMap.is ? isReservedTag(el.attrsMap.is) : isReservedTag(el.tag)) 75294 ); }; 75295 transforms = pluckModuleFunction(options.modules, 'transformNode'); 75296 preTransforms = pluckModuleFunction(options.modules, 'preTransformNode'); 75297 postTransforms = pluckModuleFunction(options.modules, 'postTransformNode'); 75298 75299 delimiters = options.delimiters; 75300 75301 var stack = []; 75302 var preserveWhitespace = options.preserveWhitespace !== false; 75303 var whitespaceOption = options.whitespace; 75304 var root; 75305 var currentParent; 75306 var inVPre = false; 75307 var inPre = false; 75308 var warned = false; 75309 75310 function warnOnce (msg, range) { 75311 if (!warned) { 75312 warned = true; 75313 warn$2(msg, range); 75314 } 75315 } 75316 75317 function closeElement (element) { 75318 trimEndingWhitespace(element); 75319 if (!inVPre && !element.processed) { 75320 element = processElement(element, options); 75321 } 75322 // tree management 75323 if (!stack.length && element !== root) { 75324 // allow root elements with v-if, v-else-if and v-else 75325 if (root.if && (element.elseif || element.else)) { 75326 { 75327 checkRootConstraints(element); 75328 } 75329 addIfCondition(root, { 75330 exp: element.elseif, 75331 block: element 75332 }); 75333 } else { 75334 warnOnce( 75335 "Component template should contain exactly one root element. " + 75336 "If you are using v-if on multiple elements, " + 75337 "use v-else-if to chain them instead.", 75338 { start: element.start } 75339 ); 75340 } 75341 } 75342 if (currentParent && !element.forbidden) { 75343 if (element.elseif || element.else) { 75344 processIfConditions(element, currentParent); 75345 } else { 75346 if (element.slotScope) { 75347 // scoped slot 75348 // keep it in the children list so that v-else(-if) conditions can 75349 // find it as the prev node. 75350 var name = element.slotTarget || '"default"' 75351 ;(currentParent.scopedSlots || (currentParent.scopedSlots = {}))[name] = element; 75352 } 75353 currentParent.children.push(element); 75354 element.parent = currentParent; 75355 } 75356 } 75357 75358 // final children cleanup 75359 // filter out scoped slots 75360 element.children = element.children.filter(function (c) { return !(c).slotScope; }); 75361 // remove trailing whitespace node again 75362 trimEndingWhitespace(element); 75363 75364 // check pre state 75365 if (element.pre) { 75366 inVPre = false; 75367 } 75368 if (platformIsPreTag(element.tag)) { 75369 inPre = false; 75370 } 75371 // apply post-transforms 75372 for (var i = 0; i < postTransforms.length; i++) { 75373 postTransforms[i](element, options); 75374 } 75375 } 75376 75377 function trimEndingWhitespace (el) { 75378 // remove trailing whitespace node 75379 if (!inPre) { 75380 var lastNode; 75381 while ( 75382 (lastNode = el.children[el.children.length - 1]) && 75383 lastNode.type === 3 && 75384 lastNode.text === ' ' 75385 ) { 75386 el.children.pop(); 75387 } 75388 } 75389 } 75390 75391 function checkRootConstraints (el) { 75392 if (el.tag === 'slot' || el.tag === 'template') { 75393 warnOnce( 75394 "Cannot use <" + (el.tag) + "> as component root element because it may " + 75395 'contain multiple nodes.', 75396 { start: el.start } 75397 ); 75398 } 75399 if (el.attrsMap.hasOwnProperty('v-for')) { 75400 warnOnce( 75401 'Cannot use v-for on stateful component root element because ' + 75402 'it renders multiple elements.', 75403 el.rawAttrsMap['v-for'] 75404 ); 75405 } 75406 } 75407 75408 parseHTML(template, { 75409 warn: warn$2, 75410 expectHTML: options.expectHTML, 75411 isUnaryTag: options.isUnaryTag, 75412 canBeLeftOpenTag: options.canBeLeftOpenTag, 75413 shouldDecodeNewlines: options.shouldDecodeNewlines, 75414 shouldDecodeNewlinesForHref: options.shouldDecodeNewlinesForHref, 75415 shouldKeepComment: options.comments, 75416 outputSourceRange: options.outputSourceRange, 75417 start: function start (tag, attrs, unary, start$1, end) { 75418 // check namespace. 75419 // inherit parent ns if there is one 75420 var ns = (currentParent && currentParent.ns) || platformGetTagNamespace(tag); 75421 75422 // handle IE svg bug 75423 /* istanbul ignore if */ 75424 if (isIE && ns === 'svg') { 75425 attrs = guardIESVGBug(attrs); 75426 } 75427 75428 var element = createASTElement(tag, attrs, currentParent); 75429 if (ns) { 75430 element.ns = ns; 75431 } 75432 75433 { 75434 if (options.outputSourceRange) { 75435 element.start = start$1; 75436 element.end = end; 75437 element.rawAttrsMap = element.attrsList.reduce(function (cumulated, attr) { 75438 cumulated[attr.name] = attr; 75439 return cumulated 75440 }, {}); 75441 } 75442 attrs.forEach(function (attr) { 75443 if (invalidAttributeRE.test(attr.name)) { 75444 warn$2( 75445 "Invalid dynamic argument expression: attribute names cannot contain " + 75446 "spaces, quotes, <, >, / or =.", 75447 { 75448 start: attr.start + attr.name.indexOf("["), 75449 end: attr.start + attr.name.length 75450 } 75451 ); 75452 } 75453 }); 75454 } 75455 75456 if (isForbiddenTag(element) && !isServerRendering()) { 75457 element.forbidden = true; 75458 warn$2( 75459 'Templates should only be responsible for mapping the state to the ' + 75460 'UI. Avoid placing tags with side-effects in your templates, such as ' + 75461 "<" + tag + ">" + ', as they will not be parsed.', 75462 { start: element.start } 75463 ); 75464 } 75465 75466 // apply pre-transforms 75467 for (var i = 0; i < preTransforms.length; i++) { 75468 element = preTransforms[i](element, options) || element; 75469 } 75470 75471 if (!inVPre) { 75472 processPre(element); 75473 if (element.pre) { 75474 inVPre = true; 75475 } 75476 } 75477 if (platformIsPreTag(element.tag)) { 75478 inPre = true; 75479 } 75480 if (inVPre) { 75481 processRawAttrs(element); 75482 } else if (!element.processed) { 75483 // structural directives 75484 processFor(element); 75485 processIf(element); 75486 processOnce(element); 75487 } 75488 75489 if (!root) { 75490 root = element; 75491 { 75492 checkRootConstraints(root); 75493 } 75494 } 75495 75496 if (!unary) { 75497 currentParent = element; 75498 stack.push(element); 75499 } else { 75500 closeElement(element); 75501 } 75502 }, 75503 75504 end: function end (tag, start, end$1) { 75505 var element = stack[stack.length - 1]; 75506 // pop stack 75507 stack.length -= 1; 75508 currentParent = stack[stack.length - 1]; 75509 if (options.outputSourceRange) { 75510 element.end = end$1; 75511 } 75512 closeElement(element); 75513 }, 75514 75515 chars: function chars (text, start, end) { 75516 if (!currentParent) { 75517 { 75518 if (text === template) { 75519 warnOnce( 75520 'Component template requires a root element, rather than just text.', 75521 { start: start } 75522 ); 75523 } else if ((text = text.trim())) { 75524 warnOnce( 75525 ("text \"" + text + "\" outside root element will be ignored."), 75526 { start: start } 75527 ); 75528 } 75529 } 75530 return 75531 } 75532 // IE textarea placeholder bug 75533 /* istanbul ignore if */ 75534 if (isIE && 75535 currentParent.tag === 'textarea' && 75536 currentParent.attrsMap.placeholder === text 75537 ) { 75538 return 75539 } 75540 var children = currentParent.children; 75541 if (inPre || text.trim()) { 75542 text = isTextTag(currentParent) ? text : decodeHTMLCached(text); 75543 } else if (!children.length) { 75544 // remove the whitespace-only node right after an opening tag 75545 text = ''; 75546 } else if (whitespaceOption) { 75547 if (whitespaceOption === 'condense') { 75548 // in condense mode, remove the whitespace node if it contains 75549 // line break, otherwise condense to a single space 75550 text = lineBreakRE.test(text) ? '' : ' '; 75551 } else { 75552 text = ' '; 75553 } 75554 } else { 75555 text = preserveWhitespace ? ' ' : ''; 75556 } 75557 if (text) { 75558 if (!inPre && whitespaceOption === 'condense') { 75559 // condense consecutive whitespaces into single space 75560 text = text.replace(whitespaceRE$1, ' '); 75561 } 75562 var res; 75563 var child; 75564 if (!inVPre && text !== ' ' && (res = parseText(text, delimiters))) { 75565 child = { 75566 type: 2, 75567 expression: res.expression, 75568 tokens: res.tokens, 75569 text: text 75570 }; 75571 } else if (text !== ' ' || !children.length || children[children.length - 1].text !== ' ') { 75572 child = { 75573 type: 3, 75574 text: text 75575 }; 75576 } 75577 if (child) { 75578 if (options.outputSourceRange) { 75579 child.start = start; 75580 child.end = end; 75581 } 75582 children.push(child); 75583 } 75584 } 75585 }, 75586 comment: function comment (text, start, end) { 75587 // adding anything as a sibling to the root node is forbidden 75588 // comments should still be allowed, but ignored 75589 if (currentParent) { 75590 var child = { 75591 type: 3, 75592 text: text, 75593 isComment: true 75594 }; 75595 if (options.outputSourceRange) { 75596 child.start = start; 75597 child.end = end; 75598 } 75599 currentParent.children.push(child); 75600 } 75601 } 75602 }); 75603 return root 75604} 75605 75606function processPre (el) { 75607 if (getAndRemoveAttr(el, 'v-pre') != null) { 75608 el.pre = true; 75609 } 75610} 75611 75612function processRawAttrs (el) { 75613 var list = el.attrsList; 75614 var len = list.length; 75615 if (len) { 75616 var attrs = el.attrs = new Array(len); 75617 for (var i = 0; i < len; i++) { 75618 attrs[i] = { 75619 name: list[i].name, 75620 value: JSON.stringify(list[i].value) 75621 }; 75622 if (list[i].start != null) { 75623 attrs[i].start = list[i].start; 75624 attrs[i].end = list[i].end; 75625 } 75626 } 75627 } else if (!el.pre) { 75628 // non root node in pre blocks with no attributes 75629 el.plain = true; 75630 } 75631} 75632 75633function processElement ( 75634 element, 75635 options 75636) { 75637 processKey(element); 75638 75639 // determine whether this is a plain element after 75640 // removing structural attributes 75641 element.plain = ( 75642 !element.key && 75643 !element.scopedSlots && 75644 !element.attrsList.length 75645 ); 75646 75647 processRef(element); 75648 processSlotContent(element); 75649 processSlotOutlet(element); 75650 processComponent(element); 75651 for (var i = 0; i < transforms.length; i++) { 75652 element = transforms[i](element, options) || element; 75653 } 75654 processAttrs(element); 75655 return element 75656} 75657 75658function processKey (el) { 75659 var exp = getBindingAttr(el, 'key'); 75660 if (exp) { 75661 { 75662 if (el.tag === 'template') { 75663 warn$2( 75664 "<template> cannot be keyed. Place the key on real elements instead.", 75665 getRawBindingAttr(el, 'key') 75666 ); 75667 } 75668 if (el.for) { 75669 var iterator = el.iterator2 || el.iterator1; 75670 var parent = el.parent; 75671 if (iterator && iterator === exp && parent && parent.tag === 'transition-group') { 75672 warn$2( 75673 "Do not use v-for index as key on <transition-group> children, " + 75674 "this is the same as not using keys.", 75675 getRawBindingAttr(el, 'key'), 75676 true /* tip */ 75677 ); 75678 } 75679 } 75680 } 75681 el.key = exp; 75682 } 75683} 75684 75685function processRef (el) { 75686 var ref = getBindingAttr(el, 'ref'); 75687 if (ref) { 75688 el.ref = ref; 75689 el.refInFor = checkInFor(el); 75690 } 75691} 75692 75693function processFor (el) { 75694 var exp; 75695 if ((exp = getAndRemoveAttr(el, 'v-for'))) { 75696 var res = parseFor(exp); 75697 if (res) { 75698 extend(el, res); 75699 } else { 75700 warn$2( 75701 ("Invalid v-for expression: " + exp), 75702 el.rawAttrsMap['v-for'] 75703 ); 75704 } 75705 } 75706} 75707 75708 75709 75710function parseFor (exp) { 75711 var inMatch = exp.match(forAliasRE); 75712 if (!inMatch) { return } 75713 var res = {}; 75714 res.for = inMatch[2].trim(); 75715 var alias = inMatch[1].trim().replace(stripParensRE, ''); 75716 var iteratorMatch = alias.match(forIteratorRE); 75717 if (iteratorMatch) { 75718 res.alias = alias.replace(forIteratorRE, '').trim(); 75719 res.iterator1 = iteratorMatch[1].trim(); 75720 if (iteratorMatch[2]) { 75721 res.iterator2 = iteratorMatch[2].trim(); 75722 } 75723 } else { 75724 res.alias = alias; 75725 } 75726 return res 75727} 75728 75729function processIf (el) { 75730 var exp = getAndRemoveAttr(el, 'v-if'); 75731 if (exp) { 75732 el.if = exp; 75733 addIfCondition(el, { 75734 exp: exp, 75735 block: el 75736 }); 75737 } else { 75738 if (getAndRemoveAttr(el, 'v-else') != null) { 75739 el.else = true; 75740 } 75741 var elseif = getAndRemoveAttr(el, 'v-else-if'); 75742 if (elseif) { 75743 el.elseif = elseif; 75744 } 75745 } 75746} 75747 75748function processIfConditions (el, parent) { 75749 var prev = findPrevElement(parent.children); 75750 if (prev && prev.if) { 75751 addIfCondition(prev, { 75752 exp: el.elseif, 75753 block: el 75754 }); 75755 } else { 75756 warn$2( 75757 "v-" + (el.elseif ? ('else-if="' + el.elseif + '"') : 'else') + " " + 75758 "used on element <" + (el.tag) + "> without corresponding v-if.", 75759 el.rawAttrsMap[el.elseif ? 'v-else-if' : 'v-else'] 75760 ); 75761 } 75762} 75763 75764function findPrevElement (children) { 75765 var i = children.length; 75766 while (i--) { 75767 if (children[i].type === 1) { 75768 return children[i] 75769 } else { 75770 if (children[i].text !== ' ') { 75771 warn$2( 75772 "text \"" + (children[i].text.trim()) + "\" between v-if and v-else(-if) " + 75773 "will be ignored.", 75774 children[i] 75775 ); 75776 } 75777 children.pop(); 75778 } 75779 } 75780} 75781 75782function addIfCondition (el, condition) { 75783 if (!el.ifConditions) { 75784 el.ifConditions = []; 75785 } 75786 el.ifConditions.push(condition); 75787} 75788 75789function processOnce (el) { 75790 var once$$1 = getAndRemoveAttr(el, 'v-once'); 75791 if (once$$1 != null) { 75792 el.once = true; 75793 } 75794} 75795 75796// handle content being passed to a component as slot, 75797// e.g. <template slot="xxx">, <div slot-scope="xxx"> 75798function processSlotContent (el) { 75799 var slotScope; 75800 if (el.tag === 'template') { 75801 slotScope = getAndRemoveAttr(el, 'scope'); 75802 /* istanbul ignore if */ 75803 if (slotScope) { 75804 warn$2( 75805 "the \"scope\" attribute for scoped slots have been deprecated and " + 75806 "replaced by \"slot-scope\" since 2.5. The new \"slot-scope\" attribute " + 75807 "can also be used on plain elements in addition to <template> to " + 75808 "denote scoped slots.", 75809 el.rawAttrsMap['scope'], 75810 true 75811 ); 75812 } 75813 el.slotScope = slotScope || getAndRemoveAttr(el, 'slot-scope'); 75814 } else if ((slotScope = getAndRemoveAttr(el, 'slot-scope'))) { 75815 /* istanbul ignore if */ 75816 if (el.attrsMap['v-for']) { 75817 warn$2( 75818 "Ambiguous combined usage of slot-scope and v-for on <" + (el.tag) + "> " + 75819 "(v-for takes higher priority). Use a wrapper <template> for the " + 75820 "scoped slot to make it clearer.", 75821 el.rawAttrsMap['slot-scope'], 75822 true 75823 ); 75824 } 75825 el.slotScope = slotScope; 75826 } 75827 75828 // slot="xxx" 75829 var slotTarget = getBindingAttr(el, 'slot'); 75830 if (slotTarget) { 75831 el.slotTarget = slotTarget === '""' ? '"default"' : slotTarget; 75832 el.slotTargetDynamic = !!(el.attrsMap[':slot'] || el.attrsMap['v-bind:slot']); 75833 // preserve slot as an attribute for native shadow DOM compat 75834 // only for non-scoped slots. 75835 if (el.tag !== 'template' && !el.slotScope) { 75836 addAttr(el, 'slot', slotTarget, getRawBindingAttr(el, 'slot')); 75837 } 75838 } 75839 75840 // 2.6 v-slot syntax 75841 { 75842 if (el.tag === 'template') { 75843 // v-slot on <template> 75844 var slotBinding = getAndRemoveAttrByRegex(el, slotRE); 75845 if (slotBinding) { 75846 { 75847 if (el.slotTarget || el.slotScope) { 75848 warn$2( 75849 "Unexpected mixed usage of different slot syntaxes.", 75850 el 75851 ); 75852 } 75853 if (el.parent && !maybeComponent(el.parent)) { 75854 warn$2( 75855 "<template v-slot> can only appear at the root level inside " + 75856 "the receiving component", 75857 el 75858 ); 75859 } 75860 } 75861 var ref = getSlotName(slotBinding); 75862 var name = ref.name; 75863 var dynamic = ref.dynamic; 75864 el.slotTarget = name; 75865 el.slotTargetDynamic = dynamic; 75866 el.slotScope = slotBinding.value || emptySlotScopeToken; // force it into a scoped slot for perf 75867 } 75868 } else { 75869 // v-slot on component, denotes default slot 75870 var slotBinding$1 = getAndRemoveAttrByRegex(el, slotRE); 75871 if (slotBinding$1) { 75872 { 75873 if (!maybeComponent(el)) { 75874 warn$2( 75875 "v-slot can only be used on components or <template>.", 75876 slotBinding$1 75877 ); 75878 } 75879 if (el.slotScope || el.slotTarget) { 75880 warn$2( 75881 "Unexpected mixed usage of different slot syntaxes.", 75882 el 75883 ); 75884 } 75885 if (el.scopedSlots) { 75886 warn$2( 75887 "To avoid scope ambiguity, the default slot should also use " + 75888 "<template> syntax when there are other named slots.", 75889 slotBinding$1 75890 ); 75891 } 75892 } 75893 // add the component's children to its default slot 75894 var slots = el.scopedSlots || (el.scopedSlots = {}); 75895 var ref$1 = getSlotName(slotBinding$1); 75896 var name$1 = ref$1.name; 75897 var dynamic$1 = ref$1.dynamic; 75898 var slotContainer = slots[name$1] = createASTElement('template', [], el); 75899 slotContainer.slotTarget = name$1; 75900 slotContainer.slotTargetDynamic = dynamic$1; 75901 slotContainer.children = el.children.filter(function (c) { 75902 if (!c.slotScope) { 75903 c.parent = slotContainer; 75904 return true 75905 } 75906 }); 75907 slotContainer.slotScope = slotBinding$1.value || emptySlotScopeToken; 75908 // remove children as they are returned from scopedSlots now 75909 el.children = []; 75910 // mark el non-plain so data gets generated 75911 el.plain = false; 75912 } 75913 } 75914 } 75915} 75916 75917function getSlotName (binding) { 75918 var name = binding.name.replace(slotRE, ''); 75919 if (!name) { 75920 if (binding.name[0] !== '#') { 75921 name = 'default'; 75922 } else { 75923 warn$2( 75924 "v-slot shorthand syntax requires a slot name.", 75925 binding 75926 ); 75927 } 75928 } 75929 return dynamicArgRE.test(name) 75930 // dynamic [name] 75931 ? { name: name.slice(1, -1), dynamic: true } 75932 // static name 75933 : { name: ("\"" + name + "\""), dynamic: false } 75934} 75935 75936// handle <slot/> outlets 75937function processSlotOutlet (el) { 75938 if (el.tag === 'slot') { 75939 el.slotName = getBindingAttr(el, 'name'); 75940 if (el.key) { 75941 warn$2( 75942 "`key` does not work on <slot> because slots are abstract outlets " + 75943 "and can possibly expand into multiple elements. " + 75944 "Use the key on a wrapping element instead.", 75945 getRawBindingAttr(el, 'key') 75946 ); 75947 } 75948 } 75949} 75950 75951function processComponent (el) { 75952 var binding; 75953 if ((binding = getBindingAttr(el, 'is'))) { 75954 el.component = binding; 75955 } 75956 if (getAndRemoveAttr(el, 'inline-template') != null) { 75957 el.inlineTemplate = true; 75958 } 75959} 75960 75961function processAttrs (el) { 75962 var list = el.attrsList; 75963 var i, l, name, rawName, value, modifiers, syncGen, isDynamic; 75964 for (i = 0, l = list.length; i < l; i++) { 75965 name = rawName = list[i].name; 75966 value = list[i].value; 75967 if (dirRE.test(name)) { 75968 // mark element as dynamic 75969 el.hasBindings = true; 75970 // modifiers 75971 modifiers = parseModifiers(name.replace(dirRE, '')); 75972 // support .foo shorthand syntax for the .prop modifier 75973 if (modifiers) { 75974 name = name.replace(modifierRE, ''); 75975 } 75976 if (bindRE.test(name)) { // v-bind 75977 name = name.replace(bindRE, ''); 75978 value = parseFilters(value); 75979 isDynamic = dynamicArgRE.test(name); 75980 if (isDynamic) { 75981 name = name.slice(1, -1); 75982 } 75983 if ( 75984 value.trim().length === 0 75985 ) { 75986 warn$2( 75987 ("The value for a v-bind expression cannot be empty. Found in \"v-bind:" + name + "\"") 75988 ); 75989 } 75990 if (modifiers) { 75991 if (modifiers.prop && !isDynamic) { 75992 name = camelize(name); 75993 if (name === 'innerHtml') { name = 'innerHTML'; } 75994 } 75995 if (modifiers.camel && !isDynamic) { 75996 name = camelize(name); 75997 } 75998 if (modifiers.sync) { 75999 syncGen = genAssignmentCode(value, "$event"); 76000 if (!isDynamic) { 76001 addHandler( 76002 el, 76003 ("update:" + (camelize(name))), 76004 syncGen, 76005 null, 76006 false, 76007 warn$2, 76008 list[i] 76009 ); 76010 if (hyphenate(name) !== camelize(name)) { 76011 addHandler( 76012 el, 76013 ("update:" + (hyphenate(name))), 76014 syncGen, 76015 null, 76016 false, 76017 warn$2, 76018 list[i] 76019 ); 76020 } 76021 } else { 76022 // handler w/ dynamic event name 76023 addHandler( 76024 el, 76025 ("\"update:\"+(" + name + ")"), 76026 syncGen, 76027 null, 76028 false, 76029 warn$2, 76030 list[i], 76031 true // dynamic 76032 ); 76033 } 76034 } 76035 } 76036 if ((modifiers && modifiers.prop) || ( 76037 !el.component && platformMustUseProp(el.tag, el.attrsMap.type, name) 76038 )) { 76039 addProp(el, name, value, list[i], isDynamic); 76040 } else { 76041 addAttr(el, name, value, list[i], isDynamic); 76042 } 76043 } else if (onRE.test(name)) { // v-on 76044 name = name.replace(onRE, ''); 76045 isDynamic = dynamicArgRE.test(name); 76046 if (isDynamic) { 76047 name = name.slice(1, -1); 76048 } 76049 addHandler(el, name, value, modifiers, false, warn$2, list[i], isDynamic); 76050 } else { // normal directives 76051 name = name.replace(dirRE, ''); 76052 // parse arg 76053 var argMatch = name.match(argRE); 76054 var arg = argMatch && argMatch[1]; 76055 isDynamic = false; 76056 if (arg) { 76057 name = name.slice(0, -(arg.length + 1)); 76058 if (dynamicArgRE.test(arg)) { 76059 arg = arg.slice(1, -1); 76060 isDynamic = true; 76061 } 76062 } 76063 addDirective(el, name, rawName, value, arg, isDynamic, modifiers, list[i]); 76064 if (name === 'model') { 76065 checkForAliasModel(el, value); 76066 } 76067 } 76068 } else { 76069 // literal attribute 76070 { 76071 var res = parseText(value, delimiters); 76072 if (res) { 76073 warn$2( 76074 name + "=\"" + value + "\": " + 76075 'Interpolation inside attributes has been removed. ' + 76076 'Use v-bind or the colon shorthand instead. For example, ' + 76077 'instead of <div id="{{ val }}">, use <div :id="val">.', 76078 list[i] 76079 ); 76080 } 76081 } 76082 addAttr(el, name, JSON.stringify(value), list[i]); 76083 // #6887 firefox doesn't update muted state if set via attribute 76084 // even immediately after element creation 76085 if (!el.component && 76086 name === 'muted' && 76087 platformMustUseProp(el.tag, el.attrsMap.type, name)) { 76088 addProp(el, name, 'true', list[i]); 76089 } 76090 } 76091 } 76092} 76093 76094function checkInFor (el) { 76095 var parent = el; 76096 while (parent) { 76097 if (parent.for !== undefined) { 76098 return true 76099 } 76100 parent = parent.parent; 76101 } 76102 return false 76103} 76104 76105function parseModifiers (name) { 76106 var match = name.match(modifierRE); 76107 if (match) { 76108 var ret = {}; 76109 match.forEach(function (m) { ret[m.slice(1)] = true; }); 76110 return ret 76111 } 76112} 76113 76114function makeAttrsMap (attrs) { 76115 var map = {}; 76116 for (var i = 0, l = attrs.length; i < l; i++) { 76117 if ( 76118 map[attrs[i].name] && !isIE && !isEdge 76119 ) { 76120 warn$2('duplicate attribute: ' + attrs[i].name, attrs[i]); 76121 } 76122 map[attrs[i].name] = attrs[i].value; 76123 } 76124 return map 76125} 76126 76127// for script (e.g. type="x/template") or style, do not decode content 76128function isTextTag (el) { 76129 return el.tag === 'script' || el.tag === 'style' 76130} 76131 76132function isForbiddenTag (el) { 76133 return ( 76134 el.tag === 'style' || 76135 (el.tag === 'script' && ( 76136 !el.attrsMap.type || 76137 el.attrsMap.type === 'text/javascript' 76138 )) 76139 ) 76140} 76141 76142var ieNSBug = /^xmlns:NS\d+/; 76143var ieNSPrefix = /^NS\d+:/; 76144 76145/* istanbul ignore next */ 76146function guardIESVGBug (attrs) { 76147 var res = []; 76148 for (var i = 0; i < attrs.length; i++) { 76149 var attr = attrs[i]; 76150 if (!ieNSBug.test(attr.name)) { 76151 attr.name = attr.name.replace(ieNSPrefix, ''); 76152 res.push(attr); 76153 } 76154 } 76155 return res 76156} 76157 76158function checkForAliasModel (el, value) { 76159 var _el = el; 76160 while (_el) { 76161 if (_el.for && _el.alias === value) { 76162 warn$2( 76163 "<" + (el.tag) + " v-model=\"" + value + "\">: " + 76164 "You are binding v-model directly to a v-for iteration alias. " + 76165 "This will not be able to modify the v-for source array because " + 76166 "writing to the alias is like modifying a function local variable. " + 76167 "Consider using an array of objects and use v-model on an object property instead.", 76168 el.rawAttrsMap['v-model'] 76169 ); 76170 } 76171 _el = _el.parent; 76172 } 76173} 76174 76175/* */ 76176 76177function preTransformNode (el, options) { 76178 if (el.tag === 'input') { 76179 var map = el.attrsMap; 76180 if (!map['v-model']) { 76181 return 76182 } 76183 76184 var typeBinding; 76185 if (map[':type'] || map['v-bind:type']) { 76186 typeBinding = getBindingAttr(el, 'type'); 76187 } 76188 if (!map.type && !typeBinding && map['v-bind']) { 76189 typeBinding = "(" + (map['v-bind']) + ").type"; 76190 } 76191 76192 if (typeBinding) { 76193 var ifCondition = getAndRemoveAttr(el, 'v-if', true); 76194 var ifConditionExtra = ifCondition ? ("&&(" + ifCondition + ")") : ""; 76195 var hasElse = getAndRemoveAttr(el, 'v-else', true) != null; 76196 var elseIfCondition = getAndRemoveAttr(el, 'v-else-if', true); 76197 // 1. checkbox 76198 var branch0 = cloneASTElement(el); 76199 // process for on the main node 76200 processFor(branch0); 76201 addRawAttr(branch0, 'type', 'checkbox'); 76202 processElement(branch0, options); 76203 branch0.processed = true; // prevent it from double-processed 76204 branch0.if = "(" + typeBinding + ")==='checkbox'" + ifConditionExtra; 76205 addIfCondition(branch0, { 76206 exp: branch0.if, 76207 block: branch0 76208 }); 76209 // 2. add radio else-if condition 76210 var branch1 = cloneASTElement(el); 76211 getAndRemoveAttr(branch1, 'v-for', true); 76212 addRawAttr(branch1, 'type', 'radio'); 76213 processElement(branch1, options); 76214 addIfCondition(branch0, { 76215 exp: "(" + typeBinding + ")==='radio'" + ifConditionExtra, 76216 block: branch1 76217 }); 76218 // 3. other 76219 var branch2 = cloneASTElement(el); 76220 getAndRemoveAttr(branch2, 'v-for', true); 76221 addRawAttr(branch2, ':type', typeBinding); 76222 processElement(branch2, options); 76223 addIfCondition(branch0, { 76224 exp: ifCondition, 76225 block: branch2 76226 }); 76227 76228 if (hasElse) { 76229 branch0.else = true; 76230 } else if (elseIfCondition) { 76231 branch0.elseif = elseIfCondition; 76232 } 76233 76234 return branch0 76235 } 76236 } 76237} 76238 76239function cloneASTElement (el) { 76240 return createASTElement(el.tag, el.attrsList.slice(), el.parent) 76241} 76242 76243var model$1 = { 76244 preTransformNode: preTransformNode 76245}; 76246 76247var modules$1 = [ 76248 klass$1, 76249 style$1, 76250 model$1 76251]; 76252 76253/* */ 76254 76255function text (el, dir) { 76256 if (dir.value) { 76257 addProp(el, 'textContent', ("_s(" + (dir.value) + ")"), dir); 76258 } 76259} 76260 76261/* */ 76262 76263function html (el, dir) { 76264 if (dir.value) { 76265 addProp(el, 'innerHTML', ("_s(" + (dir.value) + ")"), dir); 76266 } 76267} 76268 76269var directives$1 = { 76270 model: model, 76271 text: text, 76272 html: html 76273}; 76274 76275/* */ 76276 76277var baseOptions = { 76278 expectHTML: true, 76279 modules: modules$1, 76280 directives: directives$1, 76281 isPreTag: isPreTag, 76282 isUnaryTag: isUnaryTag, 76283 mustUseProp: mustUseProp, 76284 canBeLeftOpenTag: canBeLeftOpenTag, 76285 isReservedTag: isReservedTag, 76286 getTagNamespace: getTagNamespace, 76287 staticKeys: genStaticKeys(modules$1) 76288}; 76289 76290/* */ 76291 76292var isStaticKey; 76293var isPlatformReservedTag; 76294 76295var genStaticKeysCached = cached(genStaticKeys$1); 76296 76297/** 76298 * Goal of the optimizer: walk the generated template AST tree 76299 * and detect sub-trees that are purely static, i.e. parts of 76300 * the DOM that never needs to change. 76301 * 76302 * Once we detect these sub-trees, we can: 76303 * 76304 * 1. Hoist them into constants, so that we no longer need to 76305 * create fresh nodes for them on each re-render; 76306 * 2. Completely skip them in the patching process. 76307 */ 76308function optimize (root, options) { 76309 if (!root) { return } 76310 isStaticKey = genStaticKeysCached(options.staticKeys || ''); 76311 isPlatformReservedTag = options.isReservedTag || no; 76312 // first pass: mark all non-static nodes. 76313 markStatic$1(root); 76314 // second pass: mark static roots. 76315 markStaticRoots(root, false); 76316} 76317 76318function genStaticKeys$1 (keys) { 76319 return makeMap( 76320 'type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap' + 76321 (keys ? ',' + keys : '') 76322 ) 76323} 76324 76325function markStatic$1 (node) { 76326 node.static = isStatic(node); 76327 if (node.type === 1) { 76328 // do not make component slot content static. this avoids 76329 // 1. components not able to mutate slot nodes 76330 // 2. static slot content fails for hot-reloading 76331 if ( 76332 !isPlatformReservedTag(node.tag) && 76333 node.tag !== 'slot' && 76334 node.attrsMap['inline-template'] == null 76335 ) { 76336 return 76337 } 76338 for (var i = 0, l = node.children.length; i < l; i++) { 76339 var child = node.children[i]; 76340 markStatic$1(child); 76341 if (!child.static) { 76342 node.static = false; 76343 } 76344 } 76345 if (node.ifConditions) { 76346 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 76347 var block = node.ifConditions[i$1].block; 76348 markStatic$1(block); 76349 if (!block.static) { 76350 node.static = false; 76351 } 76352 } 76353 } 76354 } 76355} 76356 76357function markStaticRoots (node, isInFor) { 76358 if (node.type === 1) { 76359 if (node.static || node.once) { 76360 node.staticInFor = isInFor; 76361 } 76362 // For a node to qualify as a static root, it should have children that 76363 // are not just static text. Otherwise the cost of hoisting out will 76364 // outweigh the benefits and it's better off to just always render it fresh. 76365 if (node.static && node.children.length && !( 76366 node.children.length === 1 && 76367 node.children[0].type === 3 76368 )) { 76369 node.staticRoot = true; 76370 return 76371 } else { 76372 node.staticRoot = false; 76373 } 76374 if (node.children) { 76375 for (var i = 0, l = node.children.length; i < l; i++) { 76376 markStaticRoots(node.children[i], isInFor || !!node.for); 76377 } 76378 } 76379 if (node.ifConditions) { 76380 for (var i$1 = 1, l$1 = node.ifConditions.length; i$1 < l$1; i$1++) { 76381 markStaticRoots(node.ifConditions[i$1].block, isInFor); 76382 } 76383 } 76384 } 76385} 76386 76387function isStatic (node) { 76388 if (node.type === 2) { // expression 76389 return false 76390 } 76391 if (node.type === 3) { // text 76392 return true 76393 } 76394 return !!(node.pre || ( 76395 !node.hasBindings && // no dynamic bindings 76396 !node.if && !node.for && // not v-if or v-for or v-else 76397 !isBuiltInTag(node.tag) && // not a built-in 76398 isPlatformReservedTag(node.tag) && // not a component 76399 !isDirectChildOfTemplateFor(node) && 76400 Object.keys(node).every(isStaticKey) 76401 )) 76402} 76403 76404function isDirectChildOfTemplateFor (node) { 76405 while (node.parent) { 76406 node = node.parent; 76407 if (node.tag !== 'template') { 76408 return false 76409 } 76410 if (node.for) { 76411 return true 76412 } 76413 } 76414 return false 76415} 76416 76417/* */ 76418 76419var fnExpRE = /^([\w$_]+|\([^)]*?\))\s*=>|^function(?:\s+[\w$]+)?\s*\(/; 76420var fnInvokeRE = /\([^)]*?\);*$/; 76421var simplePathRE = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/; 76422 76423// KeyboardEvent.keyCode aliases 76424var keyCodes = { 76425 esc: 27, 76426 tab: 9, 76427 enter: 13, 76428 space: 32, 76429 up: 38, 76430 left: 37, 76431 right: 39, 76432 down: 40, 76433 'delete': [8, 46] 76434}; 76435 76436// KeyboardEvent.key aliases 76437var keyNames = { 76438 // #7880: IE11 and Edge use `Esc` for Escape key name. 76439 esc: ['Esc', 'Escape'], 76440 tab: 'Tab', 76441 enter: 'Enter', 76442 // #9112: IE11 uses `Spacebar` for Space key name. 76443 space: [' ', 'Spacebar'], 76444 // #7806: IE11 uses key names without `Arrow` prefix for arrow keys. 76445 up: ['Up', 'ArrowUp'], 76446 left: ['Left', 'ArrowLeft'], 76447 right: ['Right', 'ArrowRight'], 76448 down: ['Down', 'ArrowDown'], 76449 // #9112: IE11 uses `Del` for Delete key name. 76450 'delete': ['Backspace', 'Delete', 'Del'] 76451}; 76452 76453// #4868: modifiers that prevent the execution of the listener 76454// need to explicitly return null so that we can determine whether to remove 76455// the listener for .once 76456var genGuard = function (condition) { return ("if(" + condition + ")return null;"); }; 76457 76458var modifierCode = { 76459 stop: '$event.stopPropagation();', 76460 prevent: '$event.preventDefault();', 76461 self: genGuard("$event.target !== $event.currentTarget"), 76462 ctrl: genGuard("!$event.ctrlKey"), 76463 shift: genGuard("!$event.shiftKey"), 76464 alt: genGuard("!$event.altKey"), 76465 meta: genGuard("!$event.metaKey"), 76466 left: genGuard("'button' in $event && $event.button !== 0"), 76467 middle: genGuard("'button' in $event && $event.button !== 1"), 76468 right: genGuard("'button' in $event && $event.button !== 2") 76469}; 76470 76471function genHandlers ( 76472 events, 76473 isNative 76474) { 76475 var prefix = isNative ? 'nativeOn:' : 'on:'; 76476 var staticHandlers = ""; 76477 var dynamicHandlers = ""; 76478 for (var name in events) { 76479 var handlerCode = genHandler(events[name]); 76480 if (events[name] && events[name].dynamic) { 76481 dynamicHandlers += name + "," + handlerCode + ","; 76482 } else { 76483 staticHandlers += "\"" + name + "\":" + handlerCode + ","; 76484 } 76485 } 76486 staticHandlers = "{" + (staticHandlers.slice(0, -1)) + "}"; 76487 if (dynamicHandlers) { 76488 return prefix + "_d(" + staticHandlers + ",[" + (dynamicHandlers.slice(0, -1)) + "])" 76489 } else { 76490 return prefix + staticHandlers 76491 } 76492} 76493 76494function genHandler (handler) { 76495 if (!handler) { 76496 return 'function(){}' 76497 } 76498 76499 if (Array.isArray(handler)) { 76500 return ("[" + (handler.map(function (handler) { return genHandler(handler); }).join(',')) + "]") 76501 } 76502 76503 var isMethodPath = simplePathRE.test(handler.value); 76504 var isFunctionExpression = fnExpRE.test(handler.value); 76505 var isFunctionInvocation = simplePathRE.test(handler.value.replace(fnInvokeRE, '')); 76506 76507 if (!handler.modifiers) { 76508 if (isMethodPath || isFunctionExpression) { 76509 return handler.value 76510 } 76511 return ("function($event){" + (isFunctionInvocation ? ("return " + (handler.value)) : handler.value) + "}") // inline statement 76512 } else { 76513 var code = ''; 76514 var genModifierCode = ''; 76515 var keys = []; 76516 for (var key in handler.modifiers) { 76517 if (modifierCode[key]) { 76518 genModifierCode += modifierCode[key]; 76519 // left/right 76520 if (keyCodes[key]) { 76521 keys.push(key); 76522 } 76523 } else if (key === 'exact') { 76524 var modifiers = (handler.modifiers); 76525 genModifierCode += genGuard( 76526 ['ctrl', 'shift', 'alt', 'meta'] 76527 .filter(function (keyModifier) { return !modifiers[keyModifier]; }) 76528 .map(function (keyModifier) { return ("$event." + keyModifier + "Key"); }) 76529 .join('||') 76530 ); 76531 } else { 76532 keys.push(key); 76533 } 76534 } 76535 if (keys.length) { 76536 code += genKeyFilter(keys); 76537 } 76538 // Make sure modifiers like prevent and stop get executed after key filtering 76539 if (genModifierCode) { 76540 code += genModifierCode; 76541 } 76542 var handlerCode = isMethodPath 76543 ? ("return " + (handler.value) + ".apply(null, arguments)") 76544 : isFunctionExpression 76545 ? ("return (" + (handler.value) + ").apply(null, arguments)") 76546 : isFunctionInvocation 76547 ? ("return " + (handler.value)) 76548 : handler.value; 76549 return ("function($event){" + code + handlerCode + "}") 76550 } 76551} 76552 76553function genKeyFilter (keys) { 76554 return ( 76555 // make sure the key filters only apply to KeyboardEvents 76556 // #9441: can't use 'keyCode' in $event because Chrome autofill fires fake 76557 // key events that do not have keyCode property... 76558 "if(!$event.type.indexOf('key')&&" + 76559 (keys.map(genFilterCode).join('&&')) + ")return null;" 76560 ) 76561} 76562 76563function genFilterCode (key) { 76564 var keyVal = parseInt(key, 10); 76565 if (keyVal) { 76566 return ("$event.keyCode!==" + keyVal) 76567 } 76568 var keyCode = keyCodes[key]; 76569 var keyName = keyNames[key]; 76570 return ( 76571 "_k($event.keyCode," + 76572 (JSON.stringify(key)) + "," + 76573 (JSON.stringify(keyCode)) + "," + 76574 "$event.key," + 76575 "" + (JSON.stringify(keyName)) + 76576 ")" 76577 ) 76578} 76579 76580/* */ 76581 76582function on (el, dir) { 76583 if (dir.modifiers) { 76584 warn("v-on without argument does not support modifiers."); 76585 } 76586 el.wrapListeners = function (code) { return ("_g(" + code + "," + (dir.value) + ")"); }; 76587} 76588 76589/* */ 76590 76591function bind$1 (el, dir) { 76592 el.wrapData = function (code) { 76593 return ("_b(" + code + ",'" + (el.tag) + "'," + (dir.value) + "," + (dir.modifiers && dir.modifiers.prop ? 'true' : 'false') + (dir.modifiers && dir.modifiers.sync ? ',true' : '') + ")") 76594 }; 76595} 76596 76597/* */ 76598 76599var baseDirectives = { 76600 on: on, 76601 bind: bind$1, 76602 cloak: noop 76603}; 76604 76605/* */ 76606 76607 76608 76609 76610 76611var CodegenState = function CodegenState (options) { 76612 this.options = options; 76613 this.warn = options.warn || baseWarn; 76614 this.transforms = pluckModuleFunction(options.modules, 'transformCode'); 76615 this.dataGenFns = pluckModuleFunction(options.modules, 'genData'); 76616 this.directives = extend(extend({}, baseDirectives), options.directives); 76617 var isReservedTag = options.isReservedTag || no; 76618 this.maybeComponent = function (el) { return !!el.component || !isReservedTag(el.tag); }; 76619 this.onceId = 0; 76620 this.staticRenderFns = []; 76621 this.pre = false; 76622}; 76623 76624 76625 76626function generate ( 76627 ast, 76628 options 76629) { 76630 var state = new CodegenState(options); 76631 // fix #11483, Root level <script> tags should not be rendered. 76632 var code = ast ? (ast.tag === 'script' ? 'null' : genElement(ast, state)) : '_c("div")'; 76633 return { 76634 render: ("with(this){return " + code + "}"), 76635 staticRenderFns: state.staticRenderFns 76636 } 76637} 76638 76639function genElement (el, state) { 76640 if (el.parent) { 76641 el.pre = el.pre || el.parent.pre; 76642 } 76643 76644 if (el.staticRoot && !el.staticProcessed) { 76645 return genStatic(el, state) 76646 } else if (el.once && !el.onceProcessed) { 76647 return genOnce(el, state) 76648 } else if (el.for && !el.forProcessed) { 76649 return genFor(el, state) 76650 } else if (el.if && !el.ifProcessed) { 76651 return genIf(el, state) 76652 } else if (el.tag === 'template' && !el.slotTarget && !state.pre) { 76653 return genChildren(el, state) || 'void 0' 76654 } else if (el.tag === 'slot') { 76655 return genSlot(el, state) 76656 } else { 76657 // component or element 76658 var code; 76659 if (el.component) { 76660 code = genComponent(el.component, el, state); 76661 } else { 76662 var data; 76663 if (!el.plain || (el.pre && state.maybeComponent(el))) { 76664 data = genData$2(el, state); 76665 } 76666 76667 var children = el.inlineTemplate ? null : genChildren(el, state, true); 76668 code = "_c('" + (el.tag) + "'" + (data ? ("," + data) : '') + (children ? ("," + children) : '') + ")"; 76669 } 76670 // module transforms 76671 for (var i = 0; i < state.transforms.length; i++) { 76672 code = state.transforms[i](el, code); 76673 } 76674 return code 76675 } 76676} 76677 76678// hoist static sub-trees out 76679function genStatic (el, state) { 76680 el.staticProcessed = true; 76681 // Some elements (templates) need to behave differently inside of a v-pre 76682 // node. All pre nodes are static roots, so we can use this as a location to 76683 // wrap a state change and reset it upon exiting the pre node. 76684 var originalPreState = state.pre; 76685 if (el.pre) { 76686 state.pre = el.pre; 76687 } 76688 state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}")); 76689 state.pre = originalPreState; 76690 return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")") 76691} 76692 76693// v-once 76694function genOnce (el, state) { 76695 el.onceProcessed = true; 76696 if (el.if && !el.ifProcessed) { 76697 return genIf(el, state) 76698 } else if (el.staticInFor) { 76699 var key = ''; 76700 var parent = el.parent; 76701 while (parent) { 76702 if (parent.for) { 76703 key = parent.key; 76704 break 76705 } 76706 parent = parent.parent; 76707 } 76708 if (!key) { 76709 state.warn( 76710 "v-once can only be used inside v-for that is keyed. ", 76711 el.rawAttrsMap['v-once'] 76712 ); 76713 return genElement(el, state) 76714 } 76715 return ("_o(" + (genElement(el, state)) + "," + (state.onceId++) + "," + key + ")") 76716 } else { 76717 return genStatic(el, state) 76718 } 76719} 76720 76721function genIf ( 76722 el, 76723 state, 76724 altGen, 76725 altEmpty 76726) { 76727 el.ifProcessed = true; // avoid recursion 76728 return genIfConditions(el.ifConditions.slice(), state, altGen, altEmpty) 76729} 76730 76731function genIfConditions ( 76732 conditions, 76733 state, 76734 altGen, 76735 altEmpty 76736) { 76737 if (!conditions.length) { 76738 return altEmpty || '_e()' 76739 } 76740 76741 var condition = conditions.shift(); 76742 if (condition.exp) { 76743 return ("(" + (condition.exp) + ")?" + (genTernaryExp(condition.block)) + ":" + (genIfConditions(conditions, state, altGen, altEmpty))) 76744 } else { 76745 return ("" + (genTernaryExp(condition.block))) 76746 } 76747 76748 // v-if with v-once should generate code like (a)?_m(0):_m(1) 76749 function genTernaryExp (el) { 76750 return altGen 76751 ? altGen(el, state) 76752 : el.once 76753 ? genOnce(el, state) 76754 : genElement(el, state) 76755 } 76756} 76757 76758function genFor ( 76759 el, 76760 state, 76761 altGen, 76762 altHelper 76763) { 76764 var exp = el.for; 76765 var alias = el.alias; 76766 var iterator1 = el.iterator1 ? ("," + (el.iterator1)) : ''; 76767 var iterator2 = el.iterator2 ? ("," + (el.iterator2)) : ''; 76768 76769 if (state.maybeComponent(el) && 76770 el.tag !== 'slot' && 76771 el.tag !== 'template' && 76772 !el.key 76773 ) { 76774 state.warn( 76775 "<" + (el.tag) + " v-for=\"" + alias + " in " + exp + "\">: component lists rendered with " + 76776 "v-for should have explicit keys. " + 76777 "See https://vuejs.org/guide/list.html#key for more info.", 76778 el.rawAttrsMap['v-for'], 76779 true /* tip */ 76780 ); 76781 } 76782 76783 el.forProcessed = true; // avoid recursion 76784 return (altHelper || '_l') + "((" + exp + ")," + 76785 "function(" + alias + iterator1 + iterator2 + "){" + 76786 "return " + ((altGen || genElement)(el, state)) + 76787 '})' 76788} 76789 76790function genData$2 (el, state) { 76791 var data = '{'; 76792 76793 // directives first. 76794 // directives may mutate the el's other properties before they are generated. 76795 var dirs = genDirectives(el, state); 76796 if (dirs) { data += dirs + ','; } 76797 76798 // key 76799 if (el.key) { 76800 data += "key:" + (el.key) + ","; 76801 } 76802 // ref 76803 if (el.ref) { 76804 data += "ref:" + (el.ref) + ","; 76805 } 76806 if (el.refInFor) { 76807 data += "refInFor:true,"; 76808 } 76809 // pre 76810 if (el.pre) { 76811 data += "pre:true,"; 76812 } 76813 // record original tag name for components using "is" attribute 76814 if (el.component) { 76815 data += "tag:\"" + (el.tag) + "\","; 76816 } 76817 // module data generation functions 76818 for (var i = 0; i < state.dataGenFns.length; i++) { 76819 data += state.dataGenFns[i](el); 76820 } 76821 // attributes 76822 if (el.attrs) { 76823 data += "attrs:" + (genProps(el.attrs)) + ","; 76824 } 76825 // DOM props 76826 if (el.props) { 76827 data += "domProps:" + (genProps(el.props)) + ","; 76828 } 76829 // event handlers 76830 if (el.events) { 76831 data += (genHandlers(el.events, false)) + ","; 76832 } 76833 if (el.nativeEvents) { 76834 data += (genHandlers(el.nativeEvents, true)) + ","; 76835 } 76836 // slot target 76837 // only for non-scoped slots 76838 if (el.slotTarget && !el.slotScope) { 76839 data += "slot:" + (el.slotTarget) + ","; 76840 } 76841 // scoped slots 76842 if (el.scopedSlots) { 76843 data += (genScopedSlots(el, el.scopedSlots, state)) + ","; 76844 } 76845 // component v-model 76846 if (el.model) { 76847 data += "model:{value:" + (el.model.value) + ",callback:" + (el.model.callback) + ",expression:" + (el.model.expression) + "},"; 76848 } 76849 // inline-template 76850 if (el.inlineTemplate) { 76851 var inlineTemplate = genInlineTemplate(el, state); 76852 if (inlineTemplate) { 76853 data += inlineTemplate + ","; 76854 } 76855 } 76856 data = data.replace(/,$/, '') + '}'; 76857 // v-bind dynamic argument wrap 76858 // v-bind with dynamic arguments must be applied using the same v-bind object 76859 // merge helper so that class/style/mustUseProp attrs are handled correctly. 76860 if (el.dynamicAttrs) { 76861 data = "_b(" + data + ",\"" + (el.tag) + "\"," + (genProps(el.dynamicAttrs)) + ")"; 76862 } 76863 // v-bind data wrap 76864 if (el.wrapData) { 76865 data = el.wrapData(data); 76866 } 76867 // v-on data wrap 76868 if (el.wrapListeners) { 76869 data = el.wrapListeners(data); 76870 } 76871 return data 76872} 76873 76874function genDirectives (el, state) { 76875 var dirs = el.directives; 76876 if (!dirs) { return } 76877 var res = 'directives:['; 76878 var hasRuntime = false; 76879 var i, l, dir, needRuntime; 76880 for (i = 0, l = dirs.length; i < l; i++) { 76881 dir = dirs[i]; 76882 needRuntime = true; 76883 var gen = state.directives[dir.name]; 76884 if (gen) { 76885 // compile-time directive that manipulates AST. 76886 // returns true if it also needs a runtime counterpart. 76887 needRuntime = !!gen(el, dir, state.warn); 76888 } 76889 if (needRuntime) { 76890 hasRuntime = true; 76891 res += "{name:\"" + (dir.name) + "\",rawName:\"" + (dir.rawName) + "\"" + (dir.value ? (",value:(" + (dir.value) + "),expression:" + (JSON.stringify(dir.value))) : '') + (dir.arg ? (",arg:" + (dir.isDynamicArg ? dir.arg : ("\"" + (dir.arg) + "\""))) : '') + (dir.modifiers ? (",modifiers:" + (JSON.stringify(dir.modifiers))) : '') + "},"; 76892 } 76893 } 76894 if (hasRuntime) { 76895 return res.slice(0, -1) + ']' 76896 } 76897} 76898 76899function genInlineTemplate (el, state) { 76900 var ast = el.children[0]; 76901 if (el.children.length !== 1 || ast.type !== 1) { 76902 state.warn( 76903 'Inline-template components must have exactly one child element.', 76904 { start: el.start } 76905 ); 76906 } 76907 if (ast && ast.type === 1) { 76908 var inlineRenderFns = generate(ast, state.options); 76909 return ("inlineTemplate:{render:function(){" + (inlineRenderFns.render) + "},staticRenderFns:[" + (inlineRenderFns.staticRenderFns.map(function (code) { return ("function(){" + code + "}"); }).join(',')) + "]}") 76910 } 76911} 76912 76913function genScopedSlots ( 76914 el, 76915 slots, 76916 state 76917) { 76918 // by default scoped slots are considered "stable", this allows child 76919 // components with only scoped slots to skip forced updates from parent. 76920 // but in some cases we have to bail-out of this optimization 76921 // for example if the slot contains dynamic names, has v-if or v-for on them... 76922 var needsForceUpdate = el.for || Object.keys(slots).some(function (key) { 76923 var slot = slots[key]; 76924 return ( 76925 slot.slotTargetDynamic || 76926 slot.if || 76927 slot.for || 76928 containsSlotChild(slot) // is passing down slot from parent which may be dynamic 76929 ) 76930 }); 76931 76932 // #9534: if a component with scoped slots is inside a conditional branch, 76933 // it's possible for the same component to be reused but with different 76934 // compiled slot content. To avoid that, we generate a unique key based on 76935 // the generated code of all the slot contents. 76936 var needsKey = !!el.if; 76937 76938 // OR when it is inside another scoped slot or v-for (the reactivity may be 76939 // disconnected due to the intermediate scope variable) 76940 // #9438, #9506 76941 // TODO: this can be further optimized by properly analyzing in-scope bindings 76942 // and skip force updating ones that do not actually use scope variables. 76943 if (!needsForceUpdate) { 76944 var parent = el.parent; 76945 while (parent) { 76946 if ( 76947 (parent.slotScope && parent.slotScope !== emptySlotScopeToken) || 76948 parent.for 76949 ) { 76950 needsForceUpdate = true; 76951 break 76952 } 76953 if (parent.if) { 76954 needsKey = true; 76955 } 76956 parent = parent.parent; 76957 } 76958 } 76959 76960 var generatedSlots = Object.keys(slots) 76961 .map(function (key) { return genScopedSlot(slots[key], state); }) 76962 .join(','); 76963 76964 return ("scopedSlots:_u([" + generatedSlots + "]" + (needsForceUpdate ? ",null,true" : "") + (!needsForceUpdate && needsKey ? (",null,false," + (hash(generatedSlots))) : "") + ")") 76965} 76966 76967function hash(str) { 76968 var hash = 5381; 76969 var i = str.length; 76970 while(i) { 76971 hash = (hash * 33) ^ str.charCodeAt(--i); 76972 } 76973 return hash >>> 0 76974} 76975 76976function containsSlotChild (el) { 76977 if (el.type === 1) { 76978 if (el.tag === 'slot') { 76979 return true 76980 } 76981 return el.children.some(containsSlotChild) 76982 } 76983 return false 76984} 76985 76986function genScopedSlot ( 76987 el, 76988 state 76989) { 76990 var isLegacySyntax = el.attrsMap['slot-scope']; 76991 if (el.if && !el.ifProcessed && !isLegacySyntax) { 76992 return genIf(el, state, genScopedSlot, "null") 76993 } 76994 if (el.for && !el.forProcessed) { 76995 return genFor(el, state, genScopedSlot) 76996 } 76997 var slotScope = el.slotScope === emptySlotScopeToken 76998 ? "" 76999 : String(el.slotScope); 77000 var fn = "function(" + slotScope + "){" + 77001 "return " + (el.tag === 'template' 77002 ? el.if && isLegacySyntax 77003 ? ("(" + (el.if) + ")?" + (genChildren(el, state) || 'undefined') + ":undefined") 77004 : genChildren(el, state) || 'undefined' 77005 : genElement(el, state)) + "}"; 77006 // reverse proxy v-slot without scope on this.$slots 77007 var reverseProxy = slotScope ? "" : ",proxy:true"; 77008 return ("{key:" + (el.slotTarget || "\"default\"") + ",fn:" + fn + reverseProxy + "}") 77009} 77010 77011function genChildren ( 77012 el, 77013 state, 77014 checkSkip, 77015 altGenElement, 77016 altGenNode 77017) { 77018 var children = el.children; 77019 if (children.length) { 77020 var el$1 = children[0]; 77021 // optimize single v-for 77022 if (children.length === 1 && 77023 el$1.for && 77024 el$1.tag !== 'template' && 77025 el$1.tag !== 'slot' 77026 ) { 77027 var normalizationType = checkSkip 77028 ? state.maybeComponent(el$1) ? ",1" : ",0" 77029 : ""; 77030 return ("" + ((altGenElement || genElement)(el$1, state)) + normalizationType) 77031 } 77032 var normalizationType$1 = checkSkip 77033 ? getNormalizationType(children, state.maybeComponent) 77034 : 0; 77035 var gen = altGenNode || genNode; 77036 return ("[" + (children.map(function (c) { return gen(c, state); }).join(',')) + "]" + (normalizationType$1 ? ("," + normalizationType$1) : '')) 77037 } 77038} 77039 77040// determine the normalization needed for the children array. 77041// 0: no normalization needed 77042// 1: simple normalization needed (possible 1-level deep nested array) 77043// 2: full normalization needed 77044function getNormalizationType ( 77045 children, 77046 maybeComponent 77047) { 77048 var res = 0; 77049 for (var i = 0; i < children.length; i++) { 77050 var el = children[i]; 77051 if (el.type !== 1) { 77052 continue 77053 } 77054 if (needsNormalization(el) || 77055 (el.ifConditions && el.ifConditions.some(function (c) { return needsNormalization(c.block); }))) { 77056 res = 2; 77057 break 77058 } 77059 if (maybeComponent(el) || 77060 (el.ifConditions && el.ifConditions.some(function (c) { return maybeComponent(c.block); }))) { 77061 res = 1; 77062 } 77063 } 77064 return res 77065} 77066 77067function needsNormalization (el) { 77068 return el.for !== undefined || el.tag === 'template' || el.tag === 'slot' 77069} 77070 77071function genNode (node, state) { 77072 if (node.type === 1) { 77073 return genElement(node, state) 77074 } else if (node.type === 3 && node.isComment) { 77075 return genComment(node) 77076 } else { 77077 return genText(node) 77078 } 77079} 77080 77081function genText (text) { 77082 return ("_v(" + (text.type === 2 77083 ? text.expression // no need for () because already wrapped in _s() 77084 : transformSpecialNewlines(JSON.stringify(text.text))) + ")") 77085} 77086 77087function genComment (comment) { 77088 return ("_e(" + (JSON.stringify(comment.text)) + ")") 77089} 77090 77091function genSlot (el, state) { 77092 var slotName = el.slotName || '"default"'; 77093 var children = genChildren(el, state); 77094 var res = "_t(" + slotName + (children ? (",function(){return " + children + "}") : ''); 77095 var attrs = el.attrs || el.dynamicAttrs 77096 ? genProps((el.attrs || []).concat(el.dynamicAttrs || []).map(function (attr) { return ({ 77097 // slot props are camelized 77098 name: camelize(attr.name), 77099 value: attr.value, 77100 dynamic: attr.dynamic 77101 }); })) 77102 : null; 77103 var bind$$1 = el.attrsMap['v-bind']; 77104 if ((attrs || bind$$1) && !children) { 77105 res += ",null"; 77106 } 77107 if (attrs) { 77108 res += "," + attrs; 77109 } 77110 if (bind$$1) { 77111 res += (attrs ? '' : ',null') + "," + bind$$1; 77112 } 77113 return res + ')' 77114} 77115 77116// componentName is el.component, take it as argument to shun flow's pessimistic refinement 77117function genComponent ( 77118 componentName, 77119 el, 77120 state 77121) { 77122 var children = el.inlineTemplate ? null : genChildren(el, state, true); 77123 return ("_c(" + componentName + "," + (genData$2(el, state)) + (children ? ("," + children) : '') + ")") 77124} 77125 77126function genProps (props) { 77127 var staticProps = ""; 77128 var dynamicProps = ""; 77129 for (var i = 0; i < props.length; i++) { 77130 var prop = props[i]; 77131 var value = transformSpecialNewlines(prop.value); 77132 if (prop.dynamic) { 77133 dynamicProps += (prop.name) + "," + value + ","; 77134 } else { 77135 staticProps += "\"" + (prop.name) + "\":" + value + ","; 77136 } 77137 } 77138 staticProps = "{" + (staticProps.slice(0, -1)) + "}"; 77139 if (dynamicProps) { 77140 return ("_d(" + staticProps + ",[" + (dynamicProps.slice(0, -1)) + "])") 77141 } else { 77142 return staticProps 77143 } 77144} 77145 77146// #3895, #4268 77147function transformSpecialNewlines (text) { 77148 return text 77149 .replace(/\u2028/g, '\\u2028') 77150 .replace(/\u2029/g, '\\u2029') 77151} 77152 77153/* */ 77154 77155 77156 77157// these keywords should not appear inside expressions, but operators like 77158// typeof, instanceof and in are allowed 77159var prohibitedKeywordRE = new RegExp('\\b' + ( 77160 'do,if,for,let,new,try,var,case,else,with,await,break,catch,class,const,' + 77161 'super,throw,while,yield,delete,export,import,return,switch,default,' + 77162 'extends,finally,continue,debugger,function,arguments' 77163).split(',').join('\\b|\\b') + '\\b'); 77164 77165// these unary operators should not be used as property/method names 77166var unaryOperatorsRE = new RegExp('\\b' + ( 77167 'delete,typeof,void' 77168).split(',').join('\\s*\\([^\\)]*\\)|\\b') + '\\s*\\([^\\)]*\\)'); 77169 77170// strip strings in expressions 77171var stripStringRE = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g; 77172 77173// detect problematic expressions in a template 77174function detectErrors (ast, warn) { 77175 if (ast) { 77176 checkNode(ast, warn); 77177 } 77178} 77179 77180function checkNode (node, warn) { 77181 if (node.type === 1) { 77182 for (var name in node.attrsMap) { 77183 if (dirRE.test(name)) { 77184 var value = node.attrsMap[name]; 77185 if (value) { 77186 var range = node.rawAttrsMap[name]; 77187 if (name === 'v-for') { 77188 checkFor(node, ("v-for=\"" + value + "\""), warn, range); 77189 } else if (name === 'v-slot' || name[0] === '#') { 77190 checkFunctionParameterExpression(value, (name + "=\"" + value + "\""), warn, range); 77191 } else if (onRE.test(name)) { 77192 checkEvent(value, (name + "=\"" + value + "\""), warn, range); 77193 } else { 77194 checkExpression(value, (name + "=\"" + value + "\""), warn, range); 77195 } 77196 } 77197 } 77198 } 77199 if (node.children) { 77200 for (var i = 0; i < node.children.length; i++) { 77201 checkNode(node.children[i], warn); 77202 } 77203 } 77204 } else if (node.type === 2) { 77205 checkExpression(node.expression, node.text, warn, node); 77206 } 77207} 77208 77209function checkEvent (exp, text, warn, range) { 77210 var stripped = exp.replace(stripStringRE, ''); 77211 var keywordMatch = stripped.match(unaryOperatorsRE); 77212 if (keywordMatch && stripped.charAt(keywordMatch.index - 1) !== '$') { 77213 warn( 77214 "avoid using JavaScript unary operator as property name: " + 77215 "\"" + (keywordMatch[0]) + "\" in expression " + (text.trim()), 77216 range 77217 ); 77218 } 77219 checkExpression(exp, text, warn, range); 77220} 77221 77222function checkFor (node, text, warn, range) { 77223 checkExpression(node.for || '', text, warn, range); 77224 checkIdentifier(node.alias, 'v-for alias', text, warn, range); 77225 checkIdentifier(node.iterator1, 'v-for iterator', text, warn, range); 77226 checkIdentifier(node.iterator2, 'v-for iterator', text, warn, range); 77227} 77228 77229function checkIdentifier ( 77230 ident, 77231 type, 77232 text, 77233 warn, 77234 range 77235) { 77236 if (typeof ident === 'string') { 77237 try { 77238 new Function(("var " + ident + "=_")); 77239 } catch (e) { 77240 warn(("invalid " + type + " \"" + ident + "\" in expression: " + (text.trim())), range); 77241 } 77242 } 77243} 77244 77245function checkExpression (exp, text, warn, range) { 77246 try { 77247 new Function(("return " + exp)); 77248 } catch (e) { 77249 var keywordMatch = exp.replace(stripStringRE, '').match(prohibitedKeywordRE); 77250 if (keywordMatch) { 77251 warn( 77252 "avoid using JavaScript keyword as property name: " + 77253 "\"" + (keywordMatch[0]) + "\"\n Raw expression: " + (text.trim()), 77254 range 77255 ); 77256 } else { 77257 warn( 77258 "invalid expression: " + (e.message) + " in\n\n" + 77259 " " + exp + "\n\n" + 77260 " Raw expression: " + (text.trim()) + "\n", 77261 range 77262 ); 77263 } 77264 } 77265} 77266 77267function checkFunctionParameterExpression (exp, text, warn, range) { 77268 try { 77269 new Function(exp, ''); 77270 } catch (e) { 77271 warn( 77272 "invalid function parameter expression: " + (e.message) + " in\n\n" + 77273 " " + exp + "\n\n" + 77274 " Raw expression: " + (text.trim()) + "\n", 77275 range 77276 ); 77277 } 77278} 77279 77280/* */ 77281 77282var range = 2; 77283 77284function generateCodeFrame ( 77285 source, 77286 start, 77287 end 77288) { 77289 if ( start === void 0 ) start = 0; 77290 if ( end === void 0 ) end = source.length; 77291 77292 var lines = source.split(/\r?\n/); 77293 var count = 0; 77294 var res = []; 77295 for (var i = 0; i < lines.length; i++) { 77296 count += lines[i].length + 1; 77297 if (count >= start) { 77298 for (var j = i - range; j <= i + range || end > count; j++) { 77299 if (j < 0 || j >= lines.length) { continue } 77300 res.push(("" + (j + 1) + (repeat$1(" ", 3 - String(j + 1).length)) + "| " + (lines[j]))); 77301 var lineLength = lines[j].length; 77302 if (j === i) { 77303 // push underline 77304 var pad = start - (count - lineLength) + 1; 77305 var length = end > count ? lineLength - pad : end - start; 77306 res.push(" | " + repeat$1(" ", pad) + repeat$1("^", length)); 77307 } else if (j > i) { 77308 if (end > count) { 77309 var length$1 = Math.min(end - count, lineLength); 77310 res.push(" | " + repeat$1("^", length$1)); 77311 } 77312 count += lineLength + 1; 77313 } 77314 } 77315 break 77316 } 77317 } 77318 return res.join('\n') 77319} 77320 77321function repeat$1 (str, n) { 77322 var result = ''; 77323 if (n > 0) { 77324 while (true) { // eslint-disable-line 77325 if (n & 1) { result += str; } 77326 n >>>= 1; 77327 if (n <= 0) { break } 77328 str += str; 77329 } 77330 } 77331 return result 77332} 77333 77334/* */ 77335 77336 77337 77338function createFunction (code, errors) { 77339 try { 77340 return new Function(code) 77341 } catch (err) { 77342 errors.push({ err: err, code: code }); 77343 return noop 77344 } 77345} 77346 77347function createCompileToFunctionFn (compile) { 77348 var cache = Object.create(null); 77349 77350 return function compileToFunctions ( 77351 template, 77352 options, 77353 vm 77354 ) { 77355 options = extend({}, options); 77356 var warn$$1 = options.warn || warn; 77357 delete options.warn; 77358 77359 /* istanbul ignore if */ 77360 { 77361 // detect possible CSP restriction 77362 try { 77363 new Function('return 1'); 77364 } catch (e) { 77365 if (e.toString().match(/unsafe-eval|CSP/)) { 77366 warn$$1( 77367 'It seems you are using the standalone build of Vue.js in an ' + 77368 'environment with Content Security Policy that prohibits unsafe-eval. ' + 77369 'The template compiler cannot work in this environment. Consider ' + 77370 'relaxing the policy to allow unsafe-eval or pre-compiling your ' + 77371 'templates into render functions.' 77372 ); 77373 } 77374 } 77375 } 77376 77377 // check cache 77378 var key = options.delimiters 77379 ? String(options.delimiters) + template 77380 : template; 77381 if (cache[key]) { 77382 return cache[key] 77383 } 77384 77385 // compile 77386 var compiled = compile(template, options); 77387 77388 // check compilation errors/tips 77389 { 77390 if (compiled.errors && compiled.errors.length) { 77391 if (options.outputSourceRange) { 77392 compiled.errors.forEach(function (e) { 77393 warn$$1( 77394 "Error compiling template:\n\n" + (e.msg) + "\n\n" + 77395 generateCodeFrame(template, e.start, e.end), 77396 vm 77397 ); 77398 }); 77399 } else { 77400 warn$$1( 77401 "Error compiling template:\n\n" + template + "\n\n" + 77402 compiled.errors.map(function (e) { return ("- " + e); }).join('\n') + '\n', 77403 vm 77404 ); 77405 } 77406 } 77407 if (compiled.tips && compiled.tips.length) { 77408 if (options.outputSourceRange) { 77409 compiled.tips.forEach(function (e) { return tip(e.msg, vm); }); 77410 } else { 77411 compiled.tips.forEach(function (msg) { return tip(msg, vm); }); 77412 } 77413 } 77414 } 77415 77416 // turn code into functions 77417 var res = {}; 77418 var fnGenErrors = []; 77419 res.render = createFunction(compiled.render, fnGenErrors); 77420 res.staticRenderFns = compiled.staticRenderFns.map(function (code) { 77421 return createFunction(code, fnGenErrors) 77422 }); 77423 77424 // check function generation errors. 77425 // this should only happen if there is a bug in the compiler itself. 77426 // mostly for codegen development use 77427 /* istanbul ignore if */ 77428 { 77429 if ((!compiled.errors || !compiled.errors.length) && fnGenErrors.length) { 77430 warn$$1( 77431 "Failed to generate render function:\n\n" + 77432 fnGenErrors.map(function (ref) { 77433 var err = ref.err; 77434 var code = ref.code; 77435 77436 return ((err.toString()) + " in\n\n" + code + "\n"); 77437 }).join('\n'), 77438 vm 77439 ); 77440 } 77441 } 77442 77443 return (cache[key] = res) 77444 } 77445} 77446 77447/* */ 77448 77449function createCompilerCreator (baseCompile) { 77450 return function createCompiler (baseOptions) { 77451 function compile ( 77452 template, 77453 options 77454 ) { 77455 var finalOptions = Object.create(baseOptions); 77456 var errors = []; 77457 var tips = []; 77458 77459 var warn = function (msg, range, tip) { 77460 (tip ? tips : errors).push(msg); 77461 }; 77462 77463 if (options) { 77464 if (options.outputSourceRange) { 77465 // $flow-disable-line 77466 var leadingSpaceLength = template.match(/^\s*/)[0].length; 77467 77468 warn = function (msg, range, tip) { 77469 var data = { msg: msg }; 77470 if (range) { 77471 if (range.start != null) { 77472 data.start = range.start + leadingSpaceLength; 77473 } 77474 if (range.end != null) { 77475 data.end = range.end + leadingSpaceLength; 77476 } 77477 } 77478 (tip ? tips : errors).push(data); 77479 }; 77480 } 77481 // merge custom modules 77482 if (options.modules) { 77483 finalOptions.modules = 77484 (baseOptions.modules || []).concat(options.modules); 77485 } 77486 // merge custom directives 77487 if (options.directives) { 77488 finalOptions.directives = extend( 77489 Object.create(baseOptions.directives || null), 77490 options.directives 77491 ); 77492 } 77493 // copy other options 77494 for (var key in options) { 77495 if (key !== 'modules' && key !== 'directives') { 77496 finalOptions[key] = options[key]; 77497 } 77498 } 77499 } 77500 77501 finalOptions.warn = warn; 77502 77503 var compiled = baseCompile(template.trim(), finalOptions); 77504 { 77505 detectErrors(compiled.ast, warn); 77506 } 77507 compiled.errors = errors; 77508 compiled.tips = tips; 77509 return compiled 77510 } 77511 77512 return { 77513 compile: compile, 77514 compileToFunctions: createCompileToFunctionFn(compile) 77515 } 77516 } 77517} 77518 77519/* */ 77520 77521// `createCompilerCreator` allows creating compilers that use alternative 77522// parser/optimizer/codegen, e.g the SSR optimizing compiler. 77523// Here we just export a default compiler using the default parts. 77524var createCompiler = createCompilerCreator(function baseCompile ( 77525 template, 77526 options 77527) { 77528 var ast = parse(template.trim(), options); 77529 if (options.optimize !== false) { 77530 optimize(ast, options); 77531 } 77532 var code = generate(ast, options); 77533 return { 77534 ast: ast, 77535 render: code.render, 77536 staticRenderFns: code.staticRenderFns 77537 } 77538}); 77539 77540/* */ 77541 77542var ref$1 = createCompiler(baseOptions); 77543var compile = ref$1.compile; 77544var compileToFunctions = ref$1.compileToFunctions; 77545 77546/* */ 77547 77548// check whether current browser encodes a char inside attribute values 77549var div; 77550function getShouldDecode (href) { 77551 div = div || document.createElement('div'); 77552 div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>"; 77553 return div.innerHTML.indexOf(' ') > 0 77554} 77555 77556// #3663: IE encodes newlines inside attribute values while other browsers don't 77557var shouldDecodeNewlines = inBrowser ? getShouldDecode(false) : false; 77558// #6828: chrome encodes content in a[href] 77559var shouldDecodeNewlinesForHref = inBrowser ? getShouldDecode(true) : false; 77560 77561/* */ 77562 77563var idToTemplate = cached(function (id) { 77564 var el = query(id); 77565 return el && el.innerHTML 77566}); 77567 77568var mount = Vue.prototype.$mount; 77569Vue.prototype.$mount = function ( 77570 el, 77571 hydrating 77572) { 77573 el = el && query(el); 77574 77575 /* istanbul ignore if */ 77576 if (el === document.body || el === document.documentElement) { 77577 warn( 77578 "Do not mount Vue to <html> or <body> - mount to normal elements instead." 77579 ); 77580 return this 77581 } 77582 77583 var options = this.$options; 77584 // resolve template/el and convert to render function 77585 if (!options.render) { 77586 var template = options.template; 77587 if (template) { 77588 if (typeof template === 'string') { 77589 if (template.charAt(0) === '#') { 77590 template = idToTemplate(template); 77591 /* istanbul ignore if */ 77592 if (!template) { 77593 warn( 77594 ("Template element not found or is empty: " + (options.template)), 77595 this 77596 ); 77597 } 77598 } 77599 } else if (template.nodeType) { 77600 template = template.innerHTML; 77601 } else { 77602 { 77603 warn('invalid template option:' + template, this); 77604 } 77605 return this 77606 } 77607 } else if (el) { 77608 template = getOuterHTML(el); 77609 } 77610 if (template) { 77611 /* istanbul ignore if */ 77612 if (config.performance && mark) { 77613 mark('compile'); 77614 } 77615 77616 var ref = compileToFunctions(template, { 77617 outputSourceRange: "development" !== 'production', 77618 shouldDecodeNewlines: shouldDecodeNewlines, 77619 shouldDecodeNewlinesForHref: shouldDecodeNewlinesForHref, 77620 delimiters: options.delimiters, 77621 comments: options.comments 77622 }, this); 77623 var render = ref.render; 77624 var staticRenderFns = ref.staticRenderFns; 77625 options.render = render; 77626 options.staticRenderFns = staticRenderFns; 77627 77628 /* istanbul ignore if */ 77629 if (config.performance && mark) { 77630 mark('compile end'); 77631 measure(("vue " + (this._name) + " compile"), 'compile', 'compile end'); 77632 } 77633 } 77634 } 77635 return mount.call(this, el, hydrating) 77636}; 77637 77638/** 77639 * Get outerHTML of elements, taking care 77640 * of SVG elements in IE as well. 77641 */ 77642function getOuterHTML (el) { 77643 if (el.outerHTML) { 77644 return el.outerHTML 77645 } else { 77646 var container = document.createElement('div'); 77647 container.appendChild(el.cloneNode(true)); 77648 return container.innerHTML 77649 } 77650} 77651 77652Vue.compile = compileToFunctions; 77653 77654module.exports = Vue; 77655 77656/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ "./node_modules/webpack/buildin/global.js"), __webpack_require__(/*! ./../../timers-browserify/main.js */ "./node_modules/timers-browserify/main.js").setImmediate)) 77657 77658/***/ }), 77659
vendor: 434 bytes, lines 77660-77673
77660/***/ "./node_modules/vue/dist/vue.common.js": 77661/*!*********************************************!*\ 77662 !*** ./node_modules/vue/dist/vue.common.js ***! 77663 \*********************************************/ 77664/*! no static exports found */ 77665/***/ (function(module, exports, __webpack_require__) { 77666 77667if (false) {} else { 77668 module.exports = __webpack_require__(/*! ./vue.common.dev.js */ "./node_modules/vue/dist/vue.common.dev.js") 77669} 77670 77671 77672/***/ }), 77673
vendor: 52,356 bytes, lines 77674-77686
77674/***/ "./node_modules/vue2-dropzone/dist/vue2Dropzone.js": 77675/*!*********************************************************!*\ 77676 !*** ./node_modules/vue2-dropzone/dist/vue2Dropzone.js ***! 77677 \*********************************************************/ 77678/*! no static exports found */ 77679/***/ (function(module, exports, __webpack_require__) { 77680 77681!function(e,t){ true?module.exports=t():undefined}(this,function(){"use strict";var e,t=(function(e){var t=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}();function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(){n(this,e)}return t(e,[{key:"on",value:function(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}},{key:"emit",value:function(e){this._callbacks=this._callbacks||{};var t=this._callbacks[e];if(t){for(var i=arguments.length,n=Array(i>1?i-1:0),r=1;r<i;r++)n[r-1]=arguments[r];for(var o=0,s=s=t;;){if(o>=s.length)break;s[o++].apply(this,n)}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var n=0;n<i.length;n++){if(i[n]===t){i.splice(n,1);break}}return this}}]),e}(),o=function(e){function o(e,t){n(this,o);var r,s=i(this,(o.__proto__||Object.getPrototypeOf(o)).call(this)),a=void 0;if(s.element=e,s.version=o.version,s.defaultOptions.previewTemplate=s.defaultOptions.previewTemplate.replace(/\n*/g,""),s.clickableElements=[],s.listeners=[],s.files=[],"string"==typeof s.element&&(s.element=document.querySelector(s.element)),!s.element||null==s.element.nodeType)throw new Error("Invalid dropzone element.");if(s.element.dropzone)throw new Error("Dropzone already attached.");o.instances.push(s),s.element.dropzone=s;var l,u=null!=(r=o.optionsForElement(s.element))?r:{};if(s.options=o.extend({},s.defaultOptions,u,null!=t?t:{}),s.options.forceFallback||!o.isBrowserSupported())return l=s.options.fallback.call(s),i(s,l);if(null==s.options.url&&(s.options.url=s.element.getAttribute("action")),!s.options.url)throw new Error("No URL provided.");if(s.options.acceptedFiles&&s.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(s.options.uploadMultiple&&s.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");return s.options.acceptedMimeTypes&&(s.options.acceptedFiles=s.options.acceptedMimeTypes,delete s.options.acceptedMimeTypes),null!=s.options.renameFilename&&(s.options.renameFile=function(e){return s.options.renameFilename.call(s,e.name,e)}),s.options.method=s.options.method.toUpperCase(),(a=s.getExistingFallback())&&a.parentNode&&a.parentNode.removeChild(a),!1!==s.options.previewsContainer&&(s.options.previewsContainer?s.previewsContainer=o.getElement(s.options.previewsContainer,"previewsContainer"):s.previewsContainer=s.element),s.options.clickable&&(!0===s.options.clickable?s.clickableElements=[s.element]:s.clickableElements=o.getElements(s.options.clickable,"clickable")),s.init(),s}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(o,r),t(o,null,[{key:"initClass",value:function(){this.prototype.Emitter=r,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init:function(){},params:function(e,t,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept:function(e,t){return t()},chunksUploaded:function(e,t){t()},fallback:function(){var e=void 0;this.element.className=this.element.className+" dz-browser-not-supported";for(var t=0,i=i=this.element.getElementsByTagName("div");;){if(t>=i.length)break;var n=i[t++];if(/(^| )dz-message($| )/.test(n.className)){e=n,n.className="dz-message";break}}e||(e=o.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));var r=e.getElementsByTagName("span")[0];return r&&(null!=r.textContent?r.textContent=this.options.dictFallbackMessage:null!=r.innerText&&(r.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,i,n){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==i?(t=r.srcWidth,i=r.srcHeight):null==t?t=i*o:null==i&&(i=t/o);var s=(t=Math.min(t,r.srcWidth))/(i=Math.min(i,r.srcHeight));if(r.srcWidth>t||r.srcHeight>i)if("crop"===n)o>s?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*s):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/s);else{if("contain"!==n)throw new Error("Unknown resizeMethod '"+n+"'");o>s?i=t/o:t=i*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=i,r},transformFile:function(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n <div class="dz-image"><img data-dz-thumbnail /></div>\n <div class="dz-details">\n <div class="dz-size"><span data-dz-size></span></div>\n <div class="dz-filename"><span data-dz-name></span></div>\n </div>\n <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n <div class="dz-error-message"><span data-dz-errormessage></span></div>\n <div class="dz-success-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Check</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF" sketch:type="MSShapeGroup"></path>\n </g>\n </svg>\n </div>\n <div class="dz-error-mark">\n <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">\n <title>Error</title>\n <defs></defs>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">\n <g id="Check-+-Oval-2" sketch:type="MSLayerGroup" stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" id="Oval-2" sketch:type="MSShapeGroup"></path>\n </g>\n </g>\n </svg>\n </div>\n</div>',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var t=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){e.previewElement=o.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);for(var i=0,n=n=e.previewElement.querySelectorAll("[data-dz-name]");;){if(i>=n.length)break;var r=n[i++];r.textContent=e.name}for(var s=0,a=a=e.previewElement.querySelectorAll("[data-dz-size]");!(s>=a.length);)(r=a[s++]).innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=o.createElement('<a class="dz-remove" href="javascript:undefined;" data-dz-remove>'+this.options.dictRemoveFile+"</a>"),e.previewElement.appendChild(e._removeLink));for(var l=function(i){return i.preventDefault(),i.stopPropagation(),e.status===o.UPLOADING?o.confirm(t.options.dictCancelUploadConfirmation,function(){return t.removeFile(e)}):t.options.dictRemoveFileConfirmation?o.confirm(t.options.dictRemoveFileConfirmation,function(){return t.removeFile(e)}):t.removeFile(e)},u=0,d=d=e.previewElement.querySelectorAll("[data-dz-remove]");;){if(u>=d.length)break;d[u++].addEventListener("click",l)}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(var i=0,n=n=e.previewElement.querySelectorAll("[data-dz-thumbnail]");;){if(i>=n.length)break;var r=n[i++];r.alt=e.name,r.src=t}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);for(var i=0,n=n=e.previewElement.querySelectorAll("[data-dz-errormessage]");;){if(i>=n.length)break;n[i++].textContent=t}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,i){if(e.previewElement)for(var n=0,r=r=e.previewElement.querySelectorAll("[data-dz-uploadprogress]");;){if(n>=r.length)break;var o=r[n++];"PROGRESS"===o.nodeName?o.value=t:o.style.width=t+"%"}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];for(var r=0,o=o=i;;){if(r>=o.length)break;var s=o[r++];for(var a in s){var l=s[a];e[a]=l}}return e}}]),t(o,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(e){return this.files.filter(function(t){return t.status===e}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(o.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(o.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(o.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===o.UPLOADING||e.status===o.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var e=this;if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(o.createElement('<div class="dz-default dz-message"><span>'+this.options.dictDefaultMessage+"</span></div>")),this.clickableElements.length){!function t(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",o.getElement(e.options.hiddenInputContainer,"hiddenInputContainer").appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var i=e.hiddenFileInput.files;if(i.length)for(var n=0,r=r=i;!(n>=r.length);){var o=r[n++];e.addFile(o)}return e.emit("addedfiles",i),t()})}()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(var t=0,i=i=this.events;;){if(t>=i.length)break;var n=i[t++];this.on(n,this.options[n])}this.on("uploadprogress",function(){return e.updateTotalUploadProgress()}),this.on("removedfile",function(){return e.updateTotalUploadProgress()}),this.on("canceled",function(t){return e.emit("complete",t)}),this.on("complete",function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)});var r=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return r(t),e.emit("dragenter",t)},dragover:function(t){var i=void 0;try{i=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",r(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return r(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach(function(t){return e.listeners.push({element:t,events:{click:function(i){return(t!==e.element||i.target===e.element||o.elementInside(i.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,o.instances.splice(o.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e=void 0,t=0,i=0;if(this.getActiveFiles().length){for(var n=0,r=r=this.getActiveFiles();;){if(n>=r.length)break;var o=r[n++];t+=o.upload.bytesSent,i+=o.upload.total}e=100*t/i}else e=100;return this.emit("totaluploadprogress",e,i,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e,t=void 0;if(e=this.getExistingFallback())return e;var i='<div class="dz-fallback">';this.options.dictFallbackText&&(i+="<p>"+this.options.dictFallbackText+"</p>"),i+='<input type="file" name="'+this._getParamName(0)+'" '+(this.options.uploadMultiple?'multiple="multiple"':void 0)+' /><input type="submit" value="Upload!"></div>';var n=o.createElement(i);return"FORM"!==this.element.tagName?(t=o.createElement('<form action="'+this.options.url+'" enctype="multipart/form-data" method="'+this.options.method+'"></form>')).appendChild(n):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:n}},{key:"getExistingFallback",value:function(){for(var e=function(e){for(var t=0,i=i=e;;){if(t>=i.length)break;var n=i[t++];if(/(^| )fallback($| )/.test(n.className))return n}},t=["div","form"],i=0;i<t.length;i++){var n,r=t[i];if(n=e(this.element.getElementsByTagName(r)))return n}}},{key:"setupEventListeners",value:function(){return this.listeners.map(function(e){return function(){var t=[];for(var i in e.events){var n=e.events[i];t.push(e.element.addEventListener(i,n,!1))}return t}()})}},{key:"removeEventListeners",value:function(){return this.listeners.map(function(e){return function(){var t=[];for(var i in e.events){var n=e.events[i];t.push(e.element.removeEventListener(i,n,!1))}return t}()})}},{key:"disable",value:function(){var e=this;return this.clickableElements.forEach(function(e){return e.classList.remove("dz-clickable")}),this.removeEventListeners(),this.disabled=!0,this.files.map(function(t){return e.cancelUpload(t)})}},{key:"enable",value:function(){return delete this.disabled,this.clickableElements.forEach(function(e){return e.classList.add("dz-clickable")}),this.setupEventListeners()}},{key:"filesize",value:function(e){var t=0,i="b";if(e>0){for(var n=["tb","gb","mb","kb","b"],r=0;r<n.length;r++){var o=n[r];if(e>=Math.pow(this.options.filesizeBase,4-r)/10){t=e/Math.pow(this.options.filesizeBase,4-r),i=o;break}}t=Math.round(10*t)/10}return"<strong>"+t+"</strong> "+this.options.dictFileSizeUnits[i]}},{key:"_updateMaxFilesReachedClass",value:function(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);for(var t=[],i=0;i<e.dataTransfer.files.length;i++)t[i]=e.dataTransfer.files[i];if(this.emit("addedfiles",t),t.length){var n=e.dataTransfer.items;n&&n.length&&null!=n[0].webkitGetAsEntry?this._addFilesFromItems(n):this.handleFiles(t)}}}},{key:"paste",value:function(e){if(null!=(t=null!=e?e.clipboardData:void 0,i=function(e){return e.items},null!=t?i(t):void 0)){var t,i;this.emit("paste",e);var n=e.clipboardData.items;return n.length?this._addFilesFromItems(n):void 0}}},{key:"handleFiles",value:function(e){for(var t=0,i=i=e;;){if(t>=i.length)break;var n=i[t++];this.addFile(n)}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){for(var i=[],n=0,r=r=e;;){if(n>=r.length)break;var o,s=r[n++];null!=s.webkitGetAsEntry&&(o=s.webkitGetAsEntry())?o.isFile?i.push(t.addFile(s.getAsFile())):o.isDirectory?i.push(t._addFilesFromDirectory(o,o.name)):i.push(void 0):null!=s.getAsFile&&(null==s.kind||"file"===s.kind)?i.push(t.addFile(s.getAsFile())):i.push(void 0)}return i}()}},{key:"_addFilesFromDirectory",value:function(e,t){var i=this,n=e.createReader(),r=function(e){return t=console,i="log",n=function(t){return t.log(e)},null!=t&&"function"==typeof t[i]?n(t,i):void 0;var t,i,n};return function e(){return n.readEntries(function(n){if(n.length>0){for(var r=0,o=o=n;!(r>=o.length);){var s=o[r++];s.isFile?s.file(function(e){if(!i.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,i.addFile(e)}):s.isDirectory&&i._addFilesFromDirectory(s,t+"/"+s.name)}e()}return null},r)}()}},{key:"accept",value:function(e,t){return this.options.maxFilesize&&e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):o.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}},{key:"addFile",value:function(e){var t=this;return e.upload={uuid:o.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e),chunked:this.options.chunking&&(this.options.forceChunking||e.size>this.options.chunkSize),totalChunkCount:Math.ceil(e.size/this.options.chunkSize)},this.files.push(e),e.status=o.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(i){return i?(e.accepted=!1,t._errorProcessing([e],i)):(e.accepted=!0,t.options.autoQueue&&t.enqueueFile(e)),t._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){for(var t=0,i=i=e;;){if(t>=i.length)break;var n=i[t++];this.enqueueFile(n)}return null}},{key:"enqueueFile",value:function(e){var t=this;if(e.status!==o.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=o.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return t.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return e.emit("thumbnail",t,i),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===o.UPLOADING&&this.cancelUpload(e),this.files=s(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);for(var t=0,i=i=this.files.slice();;){if(t>=i.length)break;var n=i[t++];(n.status!==o.UPLOADING||e)&&this.removeFile(n)}return null}},{key:"resizeImage",value:function(e,t,i,n,r){var s=this;return this.createThumbnail(e,t,i,n,!0,function(t,i){if(null==i)return r(e);var n=s.options.resizeMimeType;null==n&&(n=e.type);var a=i.toDataURL(n,s.options.resizeQuality);return"image/jpeg"!==n&&"image/jpg"!==n||(a=u.restore(e.dataURL,a)),r(o.dataURItoBlob(a))})}},{key:"createThumbnail",value:function(e,t,i,n,r,o){var s=this,a=new FileReader;return a.onload=function(){if(e.dataURL=a.result,"image/svg+xml"!==e.type)return s.createThumbnailFromUrl(e,t,i,n,r,o);null!=o&&o(a.result)},a.readAsDataURL(e)}},{key:"createThumbnailFromUrl",value:function(e,t,i,n,r,o,s){var a=this,u=document.createElement("img");return s&&(u.crossOrigin=s),u.onload=function(){var s=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(s=function(e){return EXIF.getData(u,function(){return e(EXIF.getTag(this,"Orientation"))})}),s(function(r){e.width=u.width,e.height=u.height;var s=a.options.resize.call(a,e,t,i,n),d=document.createElement("canvas"),c=d.getContext("2d");switch(d.width=s.trgWidth,d.height=s.trgHeight,r>4&&(d.width=s.trgHeight,d.height=s.trgWidth),r){case 2:c.translate(d.width,0),c.scale(-1,1);break;case 3:c.translate(d.width,d.height),c.rotate(Math.PI);break;case 4:c.translate(0,d.height),c.scale(1,-1);break;case 5:c.rotate(.5*Math.PI),c.scale(1,-1);break;case 6:c.rotate(.5*Math.PI),c.translate(0,-d.width);break;case 7:c.rotate(.5*Math.PI),c.translate(d.height,-d.width),c.scale(-1,1);break;case 8:c.rotate(-.5*Math.PI),c.translate(-d.height,0)}l(c,u,null!=s.srcX?s.srcX:0,null!=s.srcY?s.srcY:0,s.srcWidth,s.srcHeight,null!=s.trgX?s.trgX:0,null!=s.trgY?s.trgY:0,s.trgWidth,s.trgHeight);var p=d.toDataURL("image/png");if(null!=o)return o(p,d)})},null!=o&&(u.onerror=o),u.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,i=t;if(!(t>=e)){var n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-t));for(;i<e;){if(!n.length)return;this.processFile(n.shift()),i++}}}}},{key:"processFile",value:function(e){return this.processFiles([e])}},{key:"processFiles",value:function(e){for(var t=0,i=i=e;;){if(t>=i.length)break;var n=i[t++];n.processing=!0,n.status=o.UPLOADING,this.emit("processing",n)}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){return this.files.filter(function(t){return t.xhr===e}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===o.UPLOADING){for(var t=this._getFilesWithXhr(e.xhr),i=0,n=n=t;;){if(i>=n.length)break;n[i++].status=o.CANCELED}void 0!==e.xhr&&e.xhr.abort();for(var r=0,s=s=t;;){if(r>=s.length)break;var a=s[r++];this.emit("canceled",a)}this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==o.ADDED&&e.status!==o.QUEUED||(e.status=o.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];return e.apply(this,i)}return e}},{key:"uploadFile",value:function(e){return this.uploadFiles([e])}},{key:"uploadFiles",value:function(e){var t=this;this._transformFiles(e,function(i){if(e[0].upload.chunked){var n=e[0],r=i[0];n.upload.chunks=[];var s=function(){for(var i=0;void 0!==n.upload.chunks[i];)i++;if(!(i>=n.upload.totalChunkCount)){var s=i*t.options.chunkSize,a=Math.min(s+t.options.chunkSize,n.size),l={name:t._getParamName(0),data:r.webkitSlice?r.webkitSlice(s,a):r.slice(s,a),filename:n.upload.filename,chunkIndex:i};n.upload.chunks[i]={file:n,index:i,dataBlock:l,status:o.UPLOADING,progress:0,retries:0},t._uploadData(e,[l])}};if(n.upload.finishedChunkUpload=function(i){var r=!0;i.status=o.SUCCESS,i.dataBlock=null,i.xhr=null;for(var a=0;a<n.upload.totalChunkCount;a++){if(void 0===n.upload.chunks[a])return s();n.upload.chunks[a].status!==o.SUCCESS&&(r=!1)}r&&t.options.chunksUploaded(n,function(){t._finished(e,"",null)})},t.options.parallelChunkUploads)for(var a=0;a<n.upload.totalChunkCount;a++)s();else s()}else{for(var l=[],u=0;u<e.length;u++)l[u]={name:t._getParamName(u),data:i[u],filename:e[u].upload.filename};t._uploadData(e,l)}})}},{key:"_getChunk",value:function(e,t){for(var i=0;i<e.upload.totalChunkCount;i++)if(void 0!==e.upload.chunks[i]&&e.upload.chunks[i].xhr===t)return e.upload.chunks[i]}},{key:"_uploadData",value:function(e,t){for(var i=this,n=new XMLHttpRequest,r=0,s=s=e;;){if(r>=s.length)break;s[r++].xhr=n}e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=n);var a=this.resolveOption(this.options.method,e),l=this.resolveOption(this.options.url,e);n.open(a,l,!0),n.timeout=this.resolveOption(this.options.timeout,e),n.withCredentials=!!this.options.withCredentials,n.onload=function(t){i._finishedUploading(e,n,t)},n.onerror=function(){i._handleUploadError(e,n)},(null!=n.upload?n.upload:n).onprogress=function(t){return i._updateFilesUploadProgress(e,n,t)};var u={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};for(var d in this.options.headers&&o.extend(u,this.options.headers),u){var c=u[d];c&&n.setRequestHeader(d,c)}var p=new FormData;if(this.options.params){var h=this.options.params;for(var f in"function"==typeof h&&(h=h.call(this,e,n,e[0].upload.chunked?this._getChunk(e[0],n):null)),h){var m=h[f];p.append(f,m)}}for(var v=0,g=g=e;;){if(v>=g.length)break;var k=g[v++];this.emit("sending",k,n,p)}this.options.uploadMultiple&&this.emit("sendingmultiple",e,n,p),this._addFormElementData(p);for(var y=0;y<t.length;y++){var b=t[y];p.append(b.name,b.data,b.filename)}this.submitRequest(n,p,e)}},{key:"_transformFiles",value:function(e,t){for(var i=this,n=[],r=0,o=function(o){i.options.transformFile.call(i,e[o],function(i){n[o]=i,++r===e.length&&t(n)})},s=0;s<e.length;s++)o(s)}},{key:"_addFormElementData",value:function(e){if("FORM"===this.element.tagName)for(var t=0,i=i=this.element.querySelectorAll("input, textarea, select, button");;){if(t>=i.length)break;var n=i[t++],r=n.getAttribute("name"),o=n.getAttribute("type");if(o&&(o=o.toLowerCase()),null!=r)if("SELECT"===n.tagName&&n.hasAttribute("multiple"))for(var s=0,a=a=n.options;;){if(s>=a.length)break;var l=a[s++];l.selected&&e.append(r,l.value)}else(!o||"checkbox"!==o&&"radio"!==o||n.checked)&&e.append(r,n.value)}}},{key:"_updateFilesUploadProgress",value:function(e,t,i){var n=void 0;if(void 0!==i){if(n=100*i.loaded/i.total,e[0].upload.chunked){var r=e[0],o=this._getChunk(r,t);o.progress=n,o.total=i.total,o.bytesSent=i.loaded,r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(var s=0;s<r.upload.totalChunkCount;s++)void 0!==r.upload.chunks[s]&&void 0!==r.upload.chunks[s].progress&&(r.upload.progress+=r.upload.chunks[s].progress,r.upload.total+=r.upload.chunks[s].total,r.upload.bytesSent+=r.upload.chunks[s].bytesSent);r.upload.progress=r.upload.progress/r.upload.totalChunkCount}else for(var a=0,l=l=e;;){if(a>=l.length)break;var u=l[a++];u.upload.progress=n,u.upload.total=i.total,u.upload.bytesSent=i.loaded}for(var d=0,c=c=e;;){if(d>=c.length)break;var p=c[d++];this.emit("uploadprogress",p,p.upload.progress,p.upload.bytesSent)}}else{var h=!0;n=100;for(var f=0,m=m=e;;){if(f>=m.length)break;var v=m[f++];100===v.upload.progress&&v.upload.bytesSent===v.upload.total||(h=!1),v.upload.progress=n,v.upload.bytesSent=v.upload.total}if(h)return;for(var g=0,k=k=e;;){if(g>=k.length)break;var y=k[g++];this.emit("uploadprogress",y,n,y.upload.bytesSent)}}}},{key:"_finishedUploading",value:function(e,t,i){var n=void 0;if(e[0].status!==o.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(n=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{n=JSON.parse(n)}catch(e){i=e,n="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t)):this._finished(e,n,i):this._handleUploadError(e,t,n)}}},{key:"_handleUploadError",value:function(e,t,i){if(e[0].status!==o.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var n=this._getChunk(e[0],t);if(n.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[n.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}for(var r=0,s=s=e;;){if(r>=s.length)break;s[r++],this._errorProcessing(e,i||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}}},{key:"submitRequest",value:function(e,t,i){e.send(t)}},{key:"_finished",value:function(e,t,i){for(var n=0,r=r=e;;){if(n>=r.length)break;var s=r[n++];s.status=o.SUCCESS,this.emit("success",s,t,i),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,i),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,t,i){for(var n=0,r=r=e;;){if(n>=r.length)break;var s=r[n++];s.status=o.ERROR,this.emit("error",s,t,i),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,i),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}]),o}();o.initClass(),o.version="5.5.1",o.options={},o.optionsForElement=function(e){return e.getAttribute("id")?o.options[a(e.getAttribute("id"))]:void 0},o.instances=[],o.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},o.autoDiscover=!0,o.discover=function(){var e=void 0;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){for(var i=[],n=0,r=r=t;;){if(n>=r.length)break;var o=r[n++];/(^| )dropzone($| )/.test(o.className)?i.push(e.push(o)):i.push(void 0)}return i}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){for(var t=[],i=0,n=n=e;;){if(i>=n.length)break;var r=n[i++];!1!==o.optionsForElement(r)?t.push(new o(r)):t.push(void 0)}return t}()},o.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],o.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(var t=0,i=i=o.blacklistedBrowsers;;){if(t>=i.length)break;i[t++].test(navigator.userAgent)&&(e=!1)}else e=!1;else e=!1;return e},o.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),r=new Uint8Array(n),o=0,s=t.length,a=0<=s;a?o<=s:o>=s;a?o++:o--)r[o]=t.charCodeAt(o);return new Blob([n],{type:i})};var s=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},a=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};o.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},o.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},o.getElement=function(e,t){var i=void 0;if("string"==typeof e?i=document.querySelector(e):null!=e.nodeType&&(i=e),null==i)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector or a plain HTML element.");return i},o.getElements=function(e,t){var i=void 0,n=void 0;if(e instanceof Array){n=[];try{for(var r=0,o=o=e;!(r>=o.length);)i=o[r++],n.push(this.getElement(i,t))}catch(e){n=null}}else if("string"==typeof e){n=[];for(var s=0,a=a=document.querySelectorAll(e);!(s>=a.length);)i=a[s++],n.push(i)}else null!=e.nodeType&&(n=[e]);if(null==n||!n.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return n},o.confirm=function(e,t,i){return window.confirm(e)?t():null!=i?i():void 0},o.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");for(var i=e.type,n=i.replace(/\/.*$/,""),r=0,o=o=t;;){if(r>=o.length)break;var s=o[r++];if("."===(s=s.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(s.toLowerCase(),e.name.length-s.length))return!0}else if(/\/\*$/.test(s)){if(n===s.replace(/\/.*$/,""))return!0}else if(i===s)return!0}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new o(this,e)})}),null!==e?e.exports=o:window.Dropzone=o,o.ADDED="added",o.QUEUED="queued",o.ACCEPTED=o.QUEUED,o.UPLOADING="uploading",o.PROCESSING=o.UPLOADING,o.CANCELED="canceled",o.ERROR="error",o.SUCCESS="success";var l=function(e,t,i,n,r,o,s,a,l,u){var d=function(e){e.naturalWidth;var t=e.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=t;var n=i.getContext("2d");n.drawImage(e,0,0);for(var r=n.getImageData(1,0,1,t).data,o=0,s=t,a=t;a>o;)0===r[4*(a-1)+3]?s=a:o=a,a=s+o>>1;var l=a/t;return 0===l?1:l}(t);return e.drawImage(t,i,n,r,o,s,a,l,u/d)},u=function(){function e(){n(this,e)}return t(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",i=void 0,n=void 0,r="",o=void 0,s=void 0,a=void 0,l="",u=0;o=(i=e[u++])>>2,s=(3&i)<<4|(n=e[u++])>>4,a=(15&n)<<2|(r=e[u++])>>6,l=63&r,isNaN(n)?a=l=64:isNaN(r)&&(l=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(s)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l),i=n=r="",o=s=a=l="",u<e.length;);return t}},{key:"restore",value:function(e,t){if(!e.match("data:image/jpeg;base64,"))return t;var i=this.decode64(e.replace("data:image/jpeg;base64,","")),n=this.slice2Segments(i),r=this.exifManipulation(t,n);return"data:image/jpeg;base64,"+this.encode64(r)}},{key:"exifManipulation",value:function(e,t){var i=this.getExifArray(t),n=this.insertExif(e,i);return new Uint8Array(n)}},{key:"getExifArray",value:function(e){for(var t=void 0,i=0;i<e.length;){if(255===(t=e[i])[0]&225===t[1])return t;i++}return[]}},{key:"insertExif",value:function(e,t){var i=e.replace("data:image/jpeg;base64,",""),n=this.decode64(i),r=n.indexOf(255,3),o=n.slice(0,r),s=n.slice(r),a=o;return a=(a=a.concat(t)).concat(s)}},{key:"slice2Segments",value:function(e){for(var t=0,i=[];;){if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{var n=t+(256*e[t+2]+e[t+3])+2,r=e.slice(t,n);i.push(r),t=n}if(t>e.length)break}return i}},{key:"decode64",value:function(e){var t=void 0,i=void 0,n="",r=void 0,o=void 0,s="",a=0,l=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=this.KEY_STR.indexOf(e.charAt(a++))<<2|(r=this.KEY_STR.indexOf(e.charAt(a++)))>>4,i=(15&r)<<4|(o=this.KEY_STR.indexOf(e.charAt(a++)))>>2,n=(3&o)<<6|(s=this.KEY_STR.indexOf(e.charAt(a++))),l.push(t),64!==o&&l.push(i),64!==s&&l.push(n),t=i=n="",r=o=s="",a<e.length;);return l}}]),e}();u.initClass(),o._autoDiscoverFunction=function(){if(o.autoDiscover)return o.discover()},function(e,t){var i=!1,n=!0,r=e.document,o=r.documentElement,s=r.addEventListener?"addEventListener":"attachEvent",a=r.addEventListener?"removeEventListener":"detachEvent",l=r.addEventListener?"":"on",u=function n(o){if("readystatechange"!==o.type||"complete"===r.readyState)return("load"===o.type?e:r)[a](l+o.type,n,!1),!i&&(i=!0)?t.call(e,o.type||o):void 0};if("complete"!==r.readyState){if(r.createEventObject&&o.doScroll){try{n=!e.frameElement}catch(e){}n&&function e(){try{o.doScroll("left")}catch(t){return void setTimeout(e,50)}return u("poll")}()}r[s](l+"DOMContentLoaded",u,!1),r[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}}(window,o._autoDiscoverFunction)}(e={exports:{}},e.exports),e.exports),i={getSignedURL(e,t){let i={filePath:e.name,contentType:e.type};return new Promise((n,r)=>{var o=new FormData;let s=new XMLHttpRequest,a="function"==typeof t.signingURL?t.signingURL(e):t.signingURL;s.open("POST",a),s.onload=function(){200==s.status?n(JSON.parse(s.response)):r(s.statusText)},s.onerror=function(e){console.error("Network Error : Could not send request to AWS (Maybe CORS errors)"),r(e)},!0===t.withCredentials&&(s.withCredentials=!0),Object.entries(t.headers||{}).forEach(([e,t])=>{s.setRequestHeader(e,t)}),i=Object.assign(i,t.params||{}),Object.entries(i).forEach(([e,t])=>{o.append(e,t)}),s.send(o)})},sendFile(e,t,i){var n=i?this.setResponseHandler:this.sendS3Handler;return this.getSignedURL(e,t).then(t=>n(t,e)).catch(e=>e)},setResponseHandler(e,t){t.s3Signature=e.signature,t.s3Url=e.postEndpoint},sendS3Handler(e,t){let i=new FormData,n=e.signature;return Object.keys(n).forEach(function(e){i.append(e,n[e])}),i.append("file",t),new Promise((t,n)=>{let r=new XMLHttpRequest;r.open("POST",e.postEndpoint),r.onload=function(){if(201==r.status){var e=(new window.DOMParser).parseFromString(r.response,"text/xml").firstChild.children[0].innerHTML;t({success:!0,message:e})}else{var i=(new window.DOMParser).parseFromString(r.response,"text/xml").firstChild.children[0].innerHTML;n({success:!1,message:i+". Request is marked as resolved when returns as status 201"})}},r.onerror=function(e){var t=(new window.DOMParser).parseFromString(r.response,"text/xml").firstChild.children[1].innerHTML;n({success:!1,message:t})},r.send(i)})}};t.autoDiscover=!1;return function(e,t,i,n,r,o,s,a,l,u){"boolean"!=typeof s&&(l=a,a=s,s=!1);var d,c="function"==typeof i?i.options:i;if(e&&e.render&&(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),n&&(c._scopeId=n),o?(d=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,l(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},c._ssrRegister=d):t&&(d=s?function(){t.call(this,u(this.$root.$options.shadowRoot))}:function(e){t.call(this,a(e))}),d)if(c.functional){var p=c.render;c.render=function(e,t){return d.call(t),p(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,d):[d]}return i}({render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{ref:"dropzoneElement",class:{"vue-dropzone dropzone":this.includeStyling},attrs:{id:this.id}},[this.useCustomSlot?t("div",{staticClass:"dz-message"},[this._t("default",[this._v("Drop files here to upload")])],2):this._e()])},staticRenderFns:[]},void 0,{props:{id:{type:String,required:!0,default:"dropzone"},options:{type:Object,required:!0},includeStyling:{type:Boolean,default:!0,required:!1},awss3:{type:Object,required:!1,default:null},destroyDropzone:{type:Boolean,default:!0,required:!1},duplicateCheck:{type:Boolean,default:!1,required:!1},useCustomSlot:{type:Boolean,default:!1,required:!1}},data:()=>({isS3:!1,isS3OverridesServerPropagation:!1,wasQueueAutoProcess:!0}),computed:{dropzoneSettings(){let e={thumbnailWidth:200,thumbnailHeight:200};return Object.keys(this.options).forEach(function(t){e[t]=this.options[t]},this),null!==this.awss3&&(e.autoProcessQueue=!1,this.isS3=!0,this.isS3OverridesServerPropagation=!1===this.awss3.sendFileToServer,void 0!==this.options.autoProcessQueue&&(this.wasQueueAutoProcess=this.options.autoProcessQueue),this.isS3OverridesServerPropagation&&(e.url=(e=>e[0].s3Url))),e}},mounted(){if(this.$isServer&&this.hasBeenMounted)return;this.hasBeenMounted=!0,this.dropzone=new t(this.$refs.dropzoneElement,this.dropzoneSettings);let e=this;this.dropzone.on("thumbnail",function(t,i){e.$emit("vdropzone-thumbnail",t,i)}),this.dropzone.on("addedfile",function(t){var i,n;if(e.duplicateCheck&&this.files.length)for(i=0,n=this.files.length;i<n-1;i++)this.files[i].name===t.name&&this.files[i].size===t.size&&this.files[i].lastModifiedDate.toString()===t.lastModifiedDate.toString()&&(this.removeFile(t),e.$emit("vdropzone-duplicate-file",t));e.$emit("vdropzone-file-added",t),e.isS3&&e.wasQueueAutoProcess&&!t.manuallyAdded&&e.getSignedAndUploadToS3(t)}),this.dropzone.on("addedfiles",function(t){e.$emit("vdropzone-files-added",t)}),this.dropzone.on("removedfile",function(t){e.$emit("vdropzone-removed-file",t),t.manuallyAdded&&null!==e.dropzone.options.maxFiles&&e.dropzone.options.maxFiles++}),this.dropzone.on("success",function(t,i){if(e.$emit("vdropzone-success",t,i),e.isS3){if(e.isS3OverridesServerPropagation){var n=(new window.DOMParser).parseFromString(i,"text/xml").firstChild.children[0].innerHTML;e.$emit("vdropzone-s3-upload-success",n)}e.wasQueueAutoProcess&&e.setOption("autoProcessQueue",!1)}}),this.dropzone.on("successmultiple",function(t,i){e.$emit("vdropzone-success-multiple",t,i)}),this.dropzone.on("error",function(t,i,n){e.$emit("vdropzone-error",t,i,n),this.isS3&&e.$emit("vdropzone-s3-upload-error")}),this.dropzone.on("errormultiple",function(t,i,n){e.$emit("vdropzone-error-multiple",t,i,n)}),this.dropzone.on("sending",function(t,i,n){if(e.isS3)if(e.isS3OverridesServerPropagation){let e=t.s3Signature;Object.keys(e).forEach(function(t){n.append(t,e[t])})}else n.append("s3ObjectLocation",t.s3ObjectLocation);e.$emit("vdropzone-sending",t,i,n)}),this.dropzone.on("sendingmultiple",function(t,i,n){e.$emit("vdropzone-sending-multiple",t,i,n)}),this.dropzone.on("complete",function(t){e.$emit("vdropzone-complete",t)}),this.dropzone.on("completemultiple",function(t){e.$emit("vdropzone-complete-multiple",t)}),this.dropzone.on("canceled",function(t){e.$emit("vdropzone-canceled",t)}),this.dropzone.on("canceledmultiple",function(t){e.$emit("vdropzone-canceled-multiple",t)}),this.dropzone.on("maxfilesreached",function(t){e.$emit("vdropzone-max-files-reached",t)}),this.dropzone.on("maxfilesexceeded",function(t){e.$emit("vdropzone-max-files-exceeded",t)}),this.dropzone.on("processing",function(t){e.$emit("vdropzone-processing",t)}),this.dropzone.on("processingmultiple",function(t){e.$emit("vdropzone-processing-multiple",t)}),this.dropzone.on("uploadprogress",function(t,i,n){e.$emit("vdropzone-upload-progress",t,i,n)}),this.dropzone.on("totaluploadprogress",function(t,i,n){e.$emit("vdropzone-total-upload-progress",t,i,n)}),this.dropzone.on("reset",function(){e.$emit("vdropzone-reset")}),this.dropzone.on("queuecomplete",function(){e.$emit("vdropzone-queue-complete")}),this.dropzone.on("drop",function(t){e.$emit("vdropzone-drop",t)}),this.dropzone.on("dragstart",function(t){e.$emit("vdropzone-drag-start",t)}),this.dropzone.on("dragend",function(t){e.$emit("vdropzone-drag-end",t)}),this.dropzone.on("dragenter",function(t){e.$emit("vdropzone-drag-enter",t)}),this.dropzone.on("dragover",function(t){e.$emit("vdropzone-drag-over",t)}),this.dropzone.on("dragleave",function(t){e.$emit("vdropzone-drag-leave",t)}),e.$emit("vdropzone-mounted")},beforeDestroy(){this.destroyDropzone&&this.dropzone.destroy()},methods:{manuallyAddFile:function(e,t){e.manuallyAdded=!0,this.dropzone.emit("addedfile",e);let i=!1;if((t.indexOf(".svg")>-1||t.indexOf(".png")>-1||t.indexOf(".jpg")>-1||t.indexOf(".jpeg")>-1||t.indexOf(".gif")>-1||t.indexOf(".webp")>-1)&&(i=!0),this.dropzone.options.createImageThumbnails&&i&&e.size<=1024*this.dropzone.options.maxThumbnailFilesize*1024){t&&this.dropzone.emit("thumbnail",e,t);for(var n=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),r=0;r<n.length;r++)n[r].style.width=this.dropzoneSettings.thumbnailWidth+"px",n[r].style.height=this.dropzoneSettings.thumbnailHeight+"px",n[r].style["object-fit"]="contain"}this.dropzone.emit("complete",e),this.dropzone.options.maxFiles&&this.dropzone.options.maxFiles--,this.dropzone.files.push(e),this.$emit("vdropzone-file-added-manually",e)},setOption:function(e,t){this.dropzone.options[e]=t},removeAllFiles:function(e){this.dropzone.removeAllFiles(e)},processQueue:function(){let e=this.dropzone;this.isS3&&!this.wasQueueAutoProcess?this.getQueuedFiles().forEach(e=>{this.getSignedAndUploadToS3(e)}):this.dropzone.processQueue(),this.dropzone.on("success",function(){e.options.autoProcessQueue=!0}),this.dropzone.on("queuecomplete",function(){e.options.autoProcessQueue=!1})},init:function(){return this.dropzone.init()},destroy:function(){return this.dropzone.destroy()},updateTotalUploadProgress:function(){return this.dropzone.updateTotalUploadProgress()},getFallbackForm:function(){return this.dropzone.getFallbackForm()},getExistingFallback:function(){return this.dropzone.getExistingFallback()},setupEventListeners:function(){return this.dropzone.setupEventListeners()},removeEventListeners:function(){return this.dropzone.removeEventListeners()},disable:function(){return this.dropzone.disable()},enable:function(){return this.dropzone.enable()},filesize:function(e){return this.dropzone.filesize(e)},accept:function(e,t){return this.dropzone.accept(e,t)},addFile:function(e){return this.dropzone.addFile(e)},removeFile:function(e){this.dropzone.removeFile(e)},getAcceptedFiles:function(){return this.dropzone.getAcceptedFiles()},getRejectedFiles:function(){return this.dropzone.getRejectedFiles()},getFilesWithStatus:function(){return this.dropzone.getFilesWithStatus()},getQueuedFiles:function(){return this.dropzone.getQueuedFiles()},getUploadingFiles:function(){return this.dropzone.getUploadingFiles()},getAddedFiles:function(){return this.dropzone.getAddedFiles()},getActiveFiles:function(){return this.dropzone.getActiveFiles()},getSignedAndUploadToS3(e){var t=i.sendFile(e,this.awss3,this.isS3OverridesServerPropagation);this.isS3OverridesServerPropagation?t.then(()=>{setTimeout(()=>this.dropzone.processFile(e))}):t.then(t=>{t.success?(e.s3ObjectLocation=t.message,setTimeout(()=>this.dropzone.processFile(e)),this.$emit("vdropzone-s3-upload-success",t.message)):void 0!==t.message?this.$emit("vdropzone-s3-upload-error",t.message):this.$emit("vdropzone-s3-upload-error","Network Error : Could not send request to AWS. (Maybe CORS error)")}),t.catch(e=>{alert(e)})},setAWSSigningURL(e){this.isS3&&(this.awss3.signingURL=e)}}},void 0,!1,void 0,void 0,void 0)}); 77682//# sourceMappingURL=vue2Dropzone.js.map 77683 77684 77685/***/ }), 77686
vendor: 1,040 bytes, lines 77687-77716
77687/***/ "./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css": 77688/*!**************************************************************!*\ 77689 !*** ./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css ***! 77690 \**************************************************************/ 77691/*! no static exports found */ 77692/***/ (function(module, exports, __webpack_require__) { 77693 77694 77695var content = __webpack_require__(/*! !../../css-loader??ref--7-1!../../postcss-loader/src??ref--7-2!./vue2Dropzone.min.css */ "./node_modules/css-loader/index.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/vue2-dropzone/dist/vue2Dropzone.min.css"); 77696 77697if(typeof content === 'string') content = [[module.i, content, '']]; 77698 77699var transform; 77700var insertInto; 77701 77702 77703 77704var options = {"hmr":true} 77705 77706options.transform = transform 77707options.insertInto = undefined; 77708 77709var update = __webpack_require__(/*! ../../style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); 77710 77711if(content.locals) module.exports = content.locals; 77712 77713if(false) {} 77714 77715/***/ }), 77716
vendor: 724 bytes, lines 77717-77747
77717/***/ "./node_modules/webpack/buildin/global.js": 77718/*!***********************************!*\ 77719 !*** (webpack)/buildin/global.js ***! 77720 \***********************************/ 77721/*! no static exports found */ 77722/***/ (function(module, exports) { 77723 77724var g; 77725 77726// This works in non-strict mode 77727g = (function() { 77728 return this; 77729})(); 77730 77731try { 77732 // This works if eval is allowed (see CSP) 77733 g = g || new Function("return this")(); 77734} catch (e) { 77735 // This works if the window reference is available 77736 if (typeof window === "object") g = window; 77737} 77738 77739// g can still be undefined, but nothing to do about it... 77740// We return undefined, instead of nothing here, so it's 77741// easier to handle this case. if(!global) { ...} 77742 77743module.exports = g; 77744 77745 77746/***/ }), 77747
vendor: 749 bytes, lines 77748-77780
77748/***/ "./node_modules/webpack/buildin/module.js": 77749/*!***********************************!*\ 77750 !*** (webpack)/buildin/module.js ***! 77751 \***********************************/ 77752/*! no static exports found */ 77753/***/ (function(module, exports) { 77754 77755module.exports = function(module) { 77756 if (!module.webpackPolyfill) { 77757 module.deprecate = function() {}; 77758 module.paths = []; 77759 // module.parent = undefined by default 77760 if (!module.children) module.children = []; 77761 Object.defineProperty(module, "loaded", { 77762 enumerable: true, 77763 get: function() { 77764 return module.l; 77765 } 77766 }); 77767 Object.defineProperty(module, "id", { 77768 enumerable: true, 77769 get: function() { 77770 return module.i; 77771 } 77772 }); 77773 module.webpackPolyfill = 1; 77774 } 77775 return module; 77776}; 77777 77778 77779/***/ }), 77780
77781/***/ "./resources/js/components/frontends/BicycleInsuranceForm.vue": 77782/*!********************************************************************!*\ 77783 !*** ./resources/js/components/frontends/BicycleInsuranceForm.vue ***! 77784 \********************************************************************/ 77785/*! exports provided: default */ 77786/***/ (function(module, __webpack_exports__, __webpack_require__) { 77787 77788"use strict"; 77789__webpack_require__.r(__webpack_exports__); 77790/* harmony import */ var _BicycleInsuranceForm_vue_vue_type_template_id_a34d8950_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true& */ "./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true&"); 77791/* harmony import */ var _BicycleInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BicycleInsuranceForm.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=script&lang=js&"); 77792/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 77793 77794 77795 77796 77797 77798/* normalize component */ 77799 77800var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 77801 _BicycleInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 77802 _BicycleInsuranceForm_vue_vue_type_template_id_a34d8950_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], 77803 _BicycleInsuranceForm_vue_vue_type_template_id_a34d8950_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 77804 false, 77805 null, 77806 "a34d8950", 77807 null 77808 77809) 77810 77811/* hot reload */ 77812if (false) { var api; } 77813component.options.__file = "resources/js/components/frontends/BicycleInsuranceForm.vue" 77814/* harmony default export */ __webpack_exports__["default"] = (component.exports); 77815 77816/***/ }), 77817 77818/***/ "./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=script&lang=js&": 77819/*!*********************************************************************************************!*\ 77820 !*** ./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=script&lang=js& ***! 77821 \*********************************************************************************************/ 77822/*! exports provided: default */ 77823/***/ (function(module, __webpack_exports__, __webpack_require__) { 77824 77825"use strict"; 77826__webpack_require__.r(__webpack_exports__); 77827/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_BicycleInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./BicycleInsuranceForm.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=script&lang=js&"); 77828/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_BicycleInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 77829 77830/***/ }), 77831 77832/***/ "./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true&": 77833/*!***************************************************************************************************************!*\ 77834 !*** ./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true& ***! 77835 \***************************************************************************************************************/ 77836/*! exports provided: render, staticRenderFns */ 77837/***/ (function(module, __webpack_exports__, __webpack_require__) { 77838 77839"use strict"; 77840__webpack_require__.r(__webpack_exports__); 77841/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_BicycleInsuranceForm_vue_vue_type_template_id_a34d8950_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/BicycleInsuranceForm.vue?vue&type=template&id=a34d8950&scoped=true&"); 77842/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_BicycleInsuranceForm_vue_vue_type_template_id_a34d8950_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 77843 77844/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_BicycleInsuranceForm_vue_vue_type_template_id_a34d8950_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 77845 77846 77847 77848/***/ }), 77849
77850/***/ "./resources/js/components/frontends/CarInsuranceForm.vue": 77851/*!****************************************************************!*\ 77852 !*** ./resources/js/components/frontends/CarInsuranceForm.vue ***! 77853 \****************************************************************/ 77854/*! exports provided: default */ 77855/***/ (function(module, __webpack_exports__, __webpack_require__) { 77856 77857"use strict"; 77858__webpack_require__.r(__webpack_exports__); 77859/* harmony import */ var _CarInsuranceForm_vue_vue_type_template_id_5f8809a3___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CarInsuranceForm.vue?vue&type=template&id=5f8809a3& */ "./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=template&id=5f8809a3&"); 77860/* harmony import */ var _CarInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CarInsuranceForm.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=script&lang=js&"); 77861/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 77862 77863 77864 77865 77866 77867/* normalize component */ 77868 77869var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 77870 _CarInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 77871 _CarInsuranceForm_vue_vue_type_template_id_5f8809a3___WEBPACK_IMPORTED_MODULE_0__["render"], 77872 _CarInsuranceForm_vue_vue_type_template_id_5f8809a3___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 77873 false, 77874 null, 77875 null, 77876 null 77877 77878) 77879 77880/* hot reload */ 77881if (false) { var api; } 77882component.options.__file = "resources/js/components/frontends/CarInsuranceForm.vue" 77883/* harmony default export */ __webpack_exports__["default"] = (component.exports); 77884 77885/***/ }), 77886 77887/***/ "./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=script&lang=js&": 77888/*!*****************************************************************************************!*\ 77889 !*** ./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=script&lang=js& ***! 77890 \*****************************************************************************************/ 77891/*! exports provided: default */ 77892/***/ (function(module, __webpack_exports__, __webpack_require__) { 77893 77894"use strict"; 77895__webpack_require__.r(__webpack_exports__); 77896/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CarInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./CarInsuranceForm.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=script&lang=js&"); 77897/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CarInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 77898 77899/***/ }), 77900 77901/***/ "./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=template&id=5f8809a3&": 77902/*!***********************************************************************************************!*\ 77903 !*** ./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=template&id=5f8809a3& ***! 77904 \***********************************************************************************************/ 77905/*! exports provided: render, staticRenderFns */ 77906/***/ (function(module, __webpack_exports__, __webpack_require__) { 77907 77908"use strict"; 77909__webpack_require__.r(__webpack_exports__); 77910/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CarInsuranceForm_vue_vue_type_template_id_5f8809a3___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./CarInsuranceForm.vue?vue&type=template&id=5f8809a3& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CarInsuranceForm.vue?vue&type=template&id=5f8809a3&"); 77911/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CarInsuranceForm_vue_vue_type_template_id_5f8809a3___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 77912 77913/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CarInsuranceForm_vue_vue_type_template_id_5f8809a3___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 77914 77915 77916 77917/***/ }), 77918
77919/***/ "./resources/js/components/frontends/CheckPolicy.vue": 77920/*!***********************************************************!*\ 77921 !*** ./resources/js/components/frontends/CheckPolicy.vue ***! 77922 \***********************************************************/ 77923/*! exports provided: default */ 77924/***/ (function(module, __webpack_exports__, __webpack_require__) { 77925 77926"use strict"; 77927__webpack_require__.r(__webpack_exports__); 77928/* harmony import */ var _CheckPolicy_vue_vue_type_template_id_535d7891___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CheckPolicy.vue?vue&type=template&id=535d7891& */ "./resources/js/components/frontends/CheckPolicy.vue?vue&type=template&id=535d7891&"); 77929/* harmony import */ var _CheckPolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CheckPolicy.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/CheckPolicy.vue?vue&type=script&lang=js&"); 77930/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 77931 77932 77933 77934 77935 77936/* normalize component */ 77937 77938var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 77939 _CheckPolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 77940 _CheckPolicy_vue_vue_type_template_id_535d7891___WEBPACK_IMPORTED_MODULE_0__["render"], 77941 _CheckPolicy_vue_vue_type_template_id_535d7891___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 77942 false, 77943 null, 77944 null, 77945 null 77946 77947) 77948 77949/* hot reload */ 77950if (false) { var api; } 77951component.options.__file = "resources/js/components/frontends/CheckPolicy.vue" 77952/* harmony default export */ __webpack_exports__["default"] = (component.exports); 77953 77954/***/ }), 77955 77956/***/ "./resources/js/components/frontends/CheckPolicy.vue?vue&type=script&lang=js&": 77957/*!************************************************************************************!*\ 77958 !*** ./resources/js/components/frontends/CheckPolicy.vue?vue&type=script&lang=js& ***! 77959 \************************************************************************************/ 77960/*! exports provided: default */ 77961/***/ (function(module, __webpack_exports__, __webpack_require__) { 77962 77963"use strict"; 77964__webpack_require__.r(__webpack_exports__); 77965/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CheckPolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./CheckPolicy.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CheckPolicy.vue?vue&type=script&lang=js&"); 77966/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_CheckPolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 77967 77968/***/ }), 77969 77970/***/ "./resources/js/components/frontends/CheckPolicy.vue?vue&type=template&id=535d7891&": 77971/*!******************************************************************************************!*\ 77972 !*** ./resources/js/components/frontends/CheckPolicy.vue?vue&type=template&id=535d7891& ***! 77973 \******************************************************************************************/ 77974/*! exports provided: render, staticRenderFns */ 77975/***/ (function(module, __webpack_exports__, __webpack_require__) { 77976 77977"use strict"; 77978__webpack_require__.r(__webpack_exports__); 77979/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CheckPolicy_vue_vue_type_template_id_535d7891___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./CheckPolicy.vue?vue&type=template&id=535d7891& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/CheckPolicy.vue?vue&type=template&id=535d7891&"); 77980/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CheckPolicy_vue_vue_type_template_id_535d7891___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 77981 77982/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_CheckPolicy_vue_vue_type_template_id_535d7891___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 77983 77984 77985 77986/***/ }), 77987
77988/***/ "./resources/js/components/frontends/ClaimHospitalInsurance.vue": 77989/*!**********************************************************************!*\ 77990 !*** ./resources/js/components/frontends/ClaimHospitalInsurance.vue ***! 77991 \**********************************************************************/ 77992/*! exports provided: default */ 77993/***/ (function(module, __webpack_exports__, __webpack_require__) { 77994 77995"use strict"; 77996__webpack_require__.r(__webpack_exports__); 77997/* harmony import */ var _ClaimHospitalInsurance_vue_vue_type_template_id_32f7e57d___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d& */ "./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d&"); 77998/* harmony import */ var _ClaimHospitalInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ClaimHospitalInsurance.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=script&lang=js&"); 77999/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 78000 78001 78002 78003 78004 78005/* normalize component */ 78006 78007var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 78008 _ClaimHospitalInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 78009 _ClaimHospitalInsurance_vue_vue_type_template_id_32f7e57d___WEBPACK_IMPORTED_MODULE_0__["render"], 78010 _ClaimHospitalInsurance_vue_vue_type_template_id_32f7e57d___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 78011 false, 78012 null, 78013 null, 78014 null 78015 78016) 78017 78018/* hot reload */ 78019if (false) { var api; } 78020component.options.__file = "resources/js/components/frontends/ClaimHospitalInsurance.vue" 78021/* harmony default export */ __webpack_exports__["default"] = (component.exports); 78022 78023/***/ }), 78024 78025/***/ "./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=script&lang=js&": 78026/*!***********************************************************************************************!*\ 78027 !*** ./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=script&lang=js& ***! 78028 \***********************************************************************************************/ 78029/*! exports provided: default */ 78030/***/ (function(module, __webpack_exports__, __webpack_require__) { 78031 78032"use strict"; 78033__webpack_require__.r(__webpack_exports__); 78034/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimHospitalInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./ClaimHospitalInsurance.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=script&lang=js&"); 78035/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimHospitalInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 78036 78037/***/ }), 78038 78039/***/ "./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d&": 78040/*!*****************************************************************************************************!*\ 78041 !*** ./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d& ***! 78042 \*****************************************************************************************************/ 78043/*! exports provided: render, staticRenderFns */ 78044/***/ (function(module, __webpack_exports__, __webpack_require__) { 78045 78046"use strict"; 78047__webpack_require__.r(__webpack_exports__); 78048/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimHospitalInsurance_vue_vue_type_template_id_32f7e57d___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimHospitalInsurance.vue?vue&type=template&id=32f7e57d&"); 78049/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimHospitalInsurance_vue_vue_type_template_id_32f7e57d___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 78050 78051/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimHospitalInsurance_vue_vue_type_template_id_32f7e57d___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 78052 78053 78054 78055/***/ }), 78056
78057/***/ "./resources/js/components/frontends/ClaimMbuInsurance.vue": 78058/*!*****************************************************************!*\ 78059 !*** ./resources/js/components/frontends/ClaimMbuInsurance.vue ***! 78060 \*****************************************************************/ 78061/*! exports provided: default */ 78062/***/ (function(module, __webpack_exports__, __webpack_require__) { 78063 78064"use strict"; 78065__webpack_require__.r(__webpack_exports__); 78066/* harmony import */ var _ClaimMbuInsurance_vue_vue_type_template_id_80bbeae6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6& */ "./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6&"); 78067/* harmony import */ var _ClaimMbuInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ClaimMbuInsurance.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=script&lang=js&"); 78068/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 78069 78070 78071 78072 78073 78074/* normalize component */ 78075 78076var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 78077 _ClaimMbuInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 78078 _ClaimMbuInsurance_vue_vue_type_template_id_80bbeae6___WEBPACK_IMPORTED_MODULE_0__["render"], 78079 _ClaimMbuInsurance_vue_vue_type_template_id_80bbeae6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 78080 false, 78081 null, 78082 null, 78083 null 78084 78085) 78086 78087/* hot reload */ 78088if (false) { var api; } 78089component.options.__file = "resources/js/components/frontends/ClaimMbuInsurance.vue" 78090/* harmony default export */ __webpack_exports__["default"] = (component.exports); 78091 78092/***/ }), 78093 78094/***/ "./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=script&lang=js&": 78095/*!******************************************************************************************!*\ 78096 !*** ./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=script&lang=js& ***! 78097 \******************************************************************************************/ 78098/*! exports provided: default */ 78099/***/ (function(module, __webpack_exports__, __webpack_require__) { 78100 78101"use strict"; 78102__webpack_require__.r(__webpack_exports__); 78103/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimMbuInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./ClaimMbuInsurance.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=script&lang=js&"); 78104/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimMbuInsurance_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 78105 78106/***/ }), 78107 78108/***/ "./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6&": 78109/*!************************************************************************************************!*\ 78110 !*** ./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6& ***! 78111 \************************************************************************************************/ 78112/*! exports provided: render, staticRenderFns */ 78113/***/ (function(module, __webpack_exports__, __webpack_require__) { 78114 78115"use strict"; 78116__webpack_require__.r(__webpack_exports__); 78117/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimMbuInsurance_vue_vue_type_template_id_80bbeae6___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ClaimMbuInsurance.vue?vue&type=template&id=80bbeae6&"); 78118/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimMbuInsurance_vue_vue_type_template_id_80bbeae6___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 78119 78120/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ClaimMbuInsurance_vue_vue_type_template_id_80bbeae6___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 78121 78122 78123 78124/***/ }), 78125
78126/***/ "./resources/js/components/frontends/DataHospital.vue": 78127/*!************************************************************!*\ 78128 !*** ./resources/js/components/frontends/DataHospital.vue ***! 78129 \************************************************************/ 78130/*! exports provided: default */ 78131/***/ (function(module, __webpack_exports__, __webpack_require__) { 78132 78133"use strict"; 78134__webpack_require__.r(__webpack_exports__); 78135/* harmony import */ var _DataHospital_vue_vue_type_template_id_5e1a79dd_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true& */ "./resources/js/components/frontends/DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true&"); 78136/* harmony import */ var _DataHospital_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DataHospital.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/DataHospital.vue?vue&type=script&lang=js&"); 78137/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 78138 78139 78140 78141 78142 78143/* normalize component */ 78144 78145var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 78146 _DataHospital_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 78147 _DataHospital_vue_vue_type_template_id_5e1a79dd_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"], 78148 _DataHospital_vue_vue_type_template_id_5e1a79dd_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 78149 false, 78150 null, 78151 "5e1a79dd", 78152 null 78153 78154) 78155 78156/* hot reload */ 78157if (false) { var api; } 78158component.options.__file = "resources/js/components/frontends/DataHospital.vue" 78159/* harmony default export */ __webpack_exports__["default"] = (component.exports); 78160 78161/***/ }), 78162 78163/***/ "./resources/js/components/frontends/DataHospital.vue?vue&type=script&lang=js&": 78164/*!*************************************************************************************!*\ 78165 !*** ./resources/js/components/frontends/DataHospital.vue?vue&type=script&lang=js& ***! 78166 \*************************************************************************************/ 78167/*! exports provided: default */ 78168/***/ (function(module, __webpack_exports__, __webpack_require__) { 78169 78170"use strict"; 78171__webpack_require__.r(__webpack_exports__); 78172/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DataHospital_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./DataHospital.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/DataHospital.vue?vue&type=script&lang=js&"); 78173/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_DataHospital_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 78174 78175/***/ }), 78176 78177/***/ "./resources/js/components/frontends/DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true&": 78178/*!*******************************************************************************************************!*\ 78179 !*** ./resources/js/components/frontends/DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true& ***! 78180 \*******************************************************************************************************/ 78181/*! exports provided: render, staticRenderFns */ 78182/***/ (function(module, __webpack_exports__, __webpack_require__) { 78183 78184"use strict"; 78185__webpack_require__.r(__webpack_exports__); 78186/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DataHospital_vue_vue_type_template_id_5e1a79dd_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/DataHospital.vue?vue&type=template&id=5e1a79dd&scoped=true&"); 78187/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DataHospital_vue_vue_type_template_id_5e1a79dd_scoped_true___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 78188 78189/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_DataHospital_vue_vue_type_template_id_5e1a79dd_scoped_true___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 78190 78191 78192 78193/***/ }), 78194
78195/***/ "./resources/js/components/frontends/FireInsuranceForm.vue": 78196/*!*****************************************************************!*\ 78197 !*** ./resources/js/components/frontends/FireInsuranceForm.vue ***! 78198 \*****************************************************************/ 78199/*! exports provided: default */ 78200/***/ (function(module, __webpack_exports__, __webpack_require__) { 78201 78202"use strict"; 78203__webpack_require__.r(__webpack_exports__); 78204/* harmony import */ var _FireInsuranceForm_vue_vue_type_template_id_04184a1f___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./FireInsuranceForm.vue?vue&type=template&id=04184a1f& */ "./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=template&id=04184a1f&"); 78205/* harmony import */ var _FireInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./FireInsuranceForm.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=script&lang=js&"); 78206/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 78207 78208 78209 78210 78211 78212/* normalize component */ 78213 78214var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 78215 _FireInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 78216 _FireInsuranceForm_vue_vue_type_template_id_04184a1f___WEBPACK_IMPORTED_MODULE_0__["render"], 78217 _FireInsuranceForm_vue_vue_type_template_id_04184a1f___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 78218 false, 78219 null, 78220 null, 78221 null 78222 78223) 78224 78225/* hot reload */ 78226if (false) { var api; } 78227component.options.__file = "resources/js/components/frontends/FireInsuranceForm.vue" 78228/* harmony default export */ __webpack_exports__["default"] = (component.exports); 78229 78230/***/ }), 78231 78232/***/ "./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=script&lang=js&": 78233/*!******************************************************************************************!*\ 78234 !*** ./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=script&lang=js& ***! 78235 \******************************************************************************************/ 78236/*! exports provided: default */ 78237/***/ (function(module, __webpack_exports__, __webpack_require__) { 78238 78239"use strict"; 78240__webpack_require__.r(__webpack_exports__); 78241/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FireInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./FireInsuranceForm.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=script&lang=js&"); 78242/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_FireInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 78243 78244/***/ }), 78245 78246/***/ "./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=template&id=04184a1f&": 78247/*!************************************************************************************************!*\ 78248 !*** ./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=template&id=04184a1f& ***! 78249 \************************************************************************************************/ 78250/*! exports provided: render, staticRenderFns */ 78251/***/ (function(module, __webpack_exports__, __webpack_require__) { 78252 78253"use strict"; 78254__webpack_require__.r(__webpack_exports__); 78255/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FireInsuranceForm_vue_vue_type_template_id_04184a1f___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./FireInsuranceForm.vue?vue&type=template&id=04184a1f& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/FireInsuranceForm.vue?vue&type=template&id=04184a1f&"); 78256/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FireInsuranceForm_vue_vue_type_template_id_04184a1f___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 78257 78258/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_FireInsuranceForm_vue_vue_type_template_id_04184a1f___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 78259 78260 78261 78262/***/ }), 78263
78264/***/ "./resources/js/components/frontends/TravelInsuranceForm.vue": 78265/*!*******************************************************************!*\ 78266 !*** ./resources/js/components/frontends/TravelInsuranceForm.vue ***! 78267 \*******************************************************************/ 78268/*! exports provided: default */ 78269/***/ (function(module, __webpack_exports__, __webpack_require__) { 78270 78271"use strict"; 78272__webpack_require__.r(__webpack_exports__); 78273/* harmony import */ var _TravelInsuranceForm_vue_vue_type_template_id_0cddc9fb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb& */ "./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb&"); 78274/* harmony import */ var _TravelInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TravelInsuranceForm.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=script&lang=js&"); 78275/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 78276 78277 78278 78279 78280 78281/* normalize component */ 78282 78283var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 78284 _TravelInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 78285 _TravelInsuranceForm_vue_vue_type_template_id_0cddc9fb___WEBPACK_IMPORTED_MODULE_0__["render"], 78286 _TravelInsuranceForm_vue_vue_type_template_id_0cddc9fb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 78287 false, 78288 null, 78289 null, 78290 null 78291 78292) 78293 78294/* hot reload */ 78295if (false) { var api; } 78296component.options.__file = "resources/js/components/frontends/TravelInsuranceForm.vue" 78297/* harmony default export */ __webpack_exports__["default"] = (component.exports); 78298 78299/***/ }), 78300 78301/***/ "./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=script&lang=js&": 78302/*!********************************************************************************************!*\ 78303 !*** ./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=script&lang=js& ***! 78304 \********************************************************************************************/ 78305/*! exports provided: default */ 78306/***/ (function(module, __webpack_exports__, __webpack_require__) { 78307 78308"use strict"; 78309__webpack_require__.r(__webpack_exports__); 78310/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TravelInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./TravelInsuranceForm.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=script&lang=js&"); 78311/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TravelInsuranceForm_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 78312 78313/***/ }), 78314 78315/***/ "./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb&": 78316/*!**************************************************************************************************!*\ 78317 !*** ./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb& ***! 78318 \**************************************************************************************************/ 78319/*! exports provided: render, staticRenderFns */ 78320/***/ (function(module, __webpack_exports__, __webpack_require__) { 78321 78322"use strict"; 78323__webpack_require__.r(__webpack_exports__); 78324/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TravelInsuranceForm_vue_vue_type_template_id_0cddc9fb___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/TravelInsuranceForm.vue?vue&type=template&id=0cddc9fb&"); 78325/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TravelInsuranceForm_vue_vue_type_template_id_0cddc9fb___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 78326 78327/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_TravelInsuranceForm_vue_vue_type_template_id_0cddc9fb___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 78328 78329 78330 78331/***/ }), 78332
78333/***/ "./resources/js/components/frontends/ValidatePolicy.vue": 78334/*!**************************************************************!*\ 78335 !*** ./resources/js/components/frontends/ValidatePolicy.vue ***! 78336 \**************************************************************/ 78337/*! exports provided: default */ 78338/***/ (function(module, __webpack_exports__, __webpack_require__) { 78339 78340"use strict"; 78341__webpack_require__.r(__webpack_exports__); 78342/* harmony import */ var _ValidatePolicy_vue_vue_type_template_id_da4ad4fe___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ValidatePolicy.vue?vue&type=template&id=da4ad4fe& */ "./resources/js/components/frontends/ValidatePolicy.vue?vue&type=template&id=da4ad4fe&"); 78343/* harmony import */ var _ValidatePolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ValidatePolicy.vue?vue&type=script&lang=js& */ "./resources/js/components/frontends/ValidatePolicy.vue?vue&type=script&lang=js&"); 78344/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ "./node_modules/vue-loader/lib/runtime/componentNormalizer.js"); 78345 78346 78347 78348 78349 78350/* normalize component */ 78351 78352var component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__["default"])( 78353 _ValidatePolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__["default"], 78354 _ValidatePolicy_vue_vue_type_template_id_da4ad4fe___WEBPACK_IMPORTED_MODULE_0__["render"], 78355 _ValidatePolicy_vue_vue_type_template_id_da4ad4fe___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"], 78356 false, 78357 null, 78358 null, 78359 null 78360 78361) 78362 78363/* hot reload */ 78364if (false) { var api; } 78365component.options.__file = "resources/js/components/frontends/ValidatePolicy.vue" 78366/* harmony default export */ __webpack_exports__["default"] = (component.exports); 78367 78368/***/ }), 78369 78370/***/ "./resources/js/components/frontends/ValidatePolicy.vue?vue&type=script&lang=js&": 78371/*!***************************************************************************************!*\ 78372 !*** ./resources/js/components/frontends/ValidatePolicy.vue?vue&type=script&lang=js& ***! 78373 \***************************************************************************************/ 78374/*! exports provided: default */ 78375/***/ (function(module, __webpack_exports__, __webpack_require__) { 78376 78377"use strict"; 78378__webpack_require__.r(__webpack_exports__); 78379/* harmony import */ var _node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ValidatePolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/babel-loader/lib??ref--4-0!../../../../node_modules/vue-loader/lib??vue-loader-options!./ValidatePolicy.vue?vue&type=script&lang=js& */ "./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ValidatePolicy.vue?vue&type=script&lang=js&"); 78380/* empty/unused harmony star reexport */ /* harmony default export */ __webpack_exports__["default"] = (_node_modules_babel_loader_lib_index_js_ref_4_0_node_modules_vue_loader_lib_index_js_vue_loader_options_ValidatePolicy_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__["default"]); 78381 78382/***/ }), 78383 78384/***/ "./resources/js/components/frontends/ValidatePolicy.vue?vue&type=template&id=da4ad4fe&": 78385/*!*********************************************************************************************!*\ 78386 !*** ./resources/js/components/frontends/ValidatePolicy.vue?vue&type=template&id=da4ad4fe& ***! 78387 \*********************************************************************************************/ 78388/*! exports provided: render, staticRenderFns */ 78389/***/ (function(module, __webpack_exports__, __webpack_require__) { 78390 78391"use strict"; 78392__webpack_require__.r(__webpack_exports__); 78393/* harmony import */ var _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ValidatePolicy_vue_vue_type_template_id_da4ad4fe___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../../../node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../node_modules/vue-loader/lib??vue-loader-options!./ValidatePolicy.vue?vue&type=template&id=da4ad4fe& */ "./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/vue-loader/lib/index.js?!./resources/js/components/frontends/ValidatePolicy.vue?vue&type=template&id=da4ad4fe&"); 78394/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "render", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ValidatePolicy_vue_vue_type_template_id_da4ad4fe___WEBPACK_IMPORTED_MODULE_0__["render"]; }); 78395 78396/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "staticRenderFns", function() { return _node_modules_vue_loader_lib_loaders_templateLoader_js_vue_loader_options_node_modules_vue_loader_lib_index_js_vue_loader_options_ValidatePolicy_vue_vue_type_template_id_da4ad4fe___WEBPACK_IMPORTED_MODULE_0__["staticRenderFns"]; }); 78397 78398 78399 78400/***/ }), 78401
78402/***/ "./resources/js/frontends.js": 78403/*!***********************************!*\ 78404 !*** ./resources/js/frontends.js ***! 78405 \***********************************/ 78406/*! no exports provided */ 78407/***/ (function(module, __webpack_exports__, __webpack_require__) { 78408 78409"use strict"; 78410__webpack_require__.r(__webpack_exports__); 78411/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js"); 78412/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__); 78413/* harmony import */ var vue_content_placeholders__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! vue-content-placeholders */ "./node_modules/vue-content-placeholders/index.js"); 78414/* harmony import */ var vue_select__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-select */ "./node_modules/vue-select/dist/vue-select.js"); 78415/* harmony import */ var vue_select__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(vue_select__WEBPACK_IMPORTED_MODULE_2__); 78416/* harmony import */ var vue_flatpickr_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-flatpickr-component */ "./node_modules/vue-flatpickr-component/dist/vue-flatpickr.min.js"); 78417/* harmony import */ var vue_flatpickr_component__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(vue_flatpickr_component__WEBPACK_IMPORTED_MODULE_3__); 78418/* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! sweetalert2 */ "./node_modules/sweetalert2/dist/sweetalert2.all.js"); 78419/* harmony import */ var sweetalert2__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(sweetalert2__WEBPACK_IMPORTED_MODULE_4__); 78420/* harmony import */ var vue_toasted__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! vue-toasted */ "./node_modules/vue-toasted/dist/vue-toasted.min.js"); 78421/* harmony import */ var vue_toasted__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(vue_toasted__WEBPACK_IMPORTED_MODULE_5__); 78422window._ = __webpack_require__(/*! lodash */ "./node_modules/lodash/lodash.js"); 78423/** 78424 * We'll load jQuery and the Bootstrap jQuery plugin which provides support 78425 * for JavaScript based Bootstrap features such as modals and tabs. This 78426 * code may be modified to fit the specific needs of your application. 78427 */ 78428 78429try { 78430 window.Popper = __webpack_require__(/*! popper.js */ "./node_modules/popper.js/dist/esm/popper.js")["default"]; 78431 window.$ = window.jQuery = __webpack_require__(/*! jquery */ "./node_modules/jquery/dist/jquery.js"); 78432 78433 __webpack_require__(/*! bootstrap */ "./node_modules/bootstrap/dist/js/bootstrap.js"); 78434} catch (e) {} 78435/** 78436 * We'll load the axios HTTP library which allows us to easily issue requests 78437 * to our Laravel back-end. This library automatically handles sending the 78438 * CSRF token as a header based on the value of the "XSRF" token cookie. 78439 */ 78440 78441 78442window.axios = __webpack_require__(/*! axios */ "./node_modules/axios/index.js"); 78443window.AOS = __webpack_require__(/*! aos */ "./node_modules/aos/dist/aos.js"); 78444window.Swal = __webpack_require__(/*! sweetalert2 */ "./node_modules/sweetalert2/dist/sweetalert2.all.js"); 78445window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; 78446/** 78447 * Next we will register the CSRF Token as a common header with Axios so that 78448 * all outgoing HTTP requests automatically have it attached. This is just 78449 * a simple convenience so we don't have to attach every token manually. 78450 */ 78451 78452var token = document.head.querySelector('meta[name="csrf-token"]'); 78453 78454if (token) { 78455 window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content; 78456 window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // This will be set as request as ajax ($request->ajax() === true) 78457} else { 78458 console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token'); 78459} 78460/** 78461 * Echo exposes an expressive API for subscribing to channels and listening 78462 * for events that are broadcast by Laravel. Echo and event broadcasting 78463 * allows your team to easily build robust real-time web applications. 78464 */ 78465// import Echo from 'laravel-echo' 78466// window.Pusher = require('pusher-js'); 78467// window.Echo = new Echo({ 78468// broadcaster: 'pusher', 78469// key: process.env.MIX_PUSHER_APP_KEY, 78470// cluster: process.env.MIX_PUSHER_APP_CLUSTER, 78471// encrypted: true 78472// }); 78473 78474 78475window.Vue = __webpack_require__(/*! vue */ "./node_modules/vue/dist/vue.common.js"); 78476 //import Lightbox from 'vue-my-photos'; 78477//import VueImageMarker from 'vue-image-marker'; 78478 78479 78480 78481 78482 78483window.Swal = sweetalert2__WEBPACK_IMPORTED_MODULE_4___default.a; 78484 //Vue.component('VImageMarker', VueImageMarker); 78485//Vue.component('lightbox', Lightbox); 78486 78487vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_toasted__WEBPACK_IMPORTED_MODULE_5___default.a); 78488vue__WEBPACK_IMPORTED_MODULE_0___default.a.toasted.register('message', function (message) { 78489 return message; 78490}, { 78491 position: 'top-right', 78492 duration: 6000, 78493 type: 'success', 78494 action: { 78495 text: 'Close', 78496 onClick: function onClick(e, toastObject) { 78497 toastObject.goAway(0); 78498 } 78499 } 78500}); 78501vue__WEBPACK_IMPORTED_MODULE_0___default.a.toasted.register('error', function (message) { 78502 return message; 78503}, { 78504 position: 'top-right', 78505 duration: null,
78506 type: 'error', 78507 action: { 78508 text: 'Close', 78509 onClick: function onClick(e, toastObject) { 78510 toastObject.goAway(0); 78511 } 78512 } 78513}); 78514vue__WEBPACK_IMPORTED_MODULE_0___default.a.component("v-select", vue_select__WEBPACK_IMPORTED_MODULE_2___default.a); 78515vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('datetime', vue_flatpickr_component__WEBPACK_IMPORTED_MODULE_3___default.a); 78516vue__WEBPACK_IMPORTED_MODULE_0___default.a.use(vue_content_placeholders__WEBPACK_IMPORTED_MODULE_1__["default"]); // FRONTEND COmponent 78517 78518vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('bicycle-insurance-form', __webpack_require__(/*! ./components/frontends/BicycleInsuranceForm */ "./resources/js/components/frontends/BicycleInsuranceForm.vue")["default"]); 78519vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('car-insurance-form', __webpack_require__(/*! ./components/frontends/CarInsuranceForm */ "./resources/js/components/frontends/CarInsuranceForm.vue")["default"]); 78520vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('fire-insurance-form', __webpack_require__(/*! ./components/frontends/FireInsuranceForm */ "./resources/js/components/frontends/FireInsuranceForm.vue")["default"]); 78521vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('travel-insurance-form', __webpack_require__(/*! ./components/frontends/TravelInsuranceForm */ "./resources/js/components/frontends/TravelInsuranceForm.vue")["default"]); 78522vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('data-hospital', __webpack_require__(/*! ./components/frontends/DataHospital */ "./resources/js/components/frontends/DataHospital.vue")["default"]); 78523vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('check-policy', __webpack_require__(/*! ./components/frontends/CheckPolicy */ "./resources/js/components/frontends/CheckPolicy.vue")["default"]); 78524vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('validate-policy', __webpack_require__(/*! ./components/frontends/ValidatePolicy */ "./resources/js/components/frontends/ValidatePolicy.vue")["default"]); 78525vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('claim-mbu-insurance', __webpack_require__(/*! ./components/frontends/ClaimMbuInsurance */ "./resources/js/components/frontends/ClaimMbuInsurance.vue")["default"]); 78526vue__WEBPACK_IMPORTED_MODULE_0___default.a.component('claim-hospital-insurance', __webpack_require__(/*! ./components/frontends/ClaimHospitalInsurance */ "./resources/js/components/frontends/ClaimHospitalInsurance.vue")["default"]); 78527vue__WEBPACK_IMPORTED_MODULE_0___default.a.mixin({ 78528 data: function data() { 78529 return { 78530 errors: {} 78531 }; 78532 }, 78533 methods: { 78534 doHandleErrors: function doHandleErrors(error) { 78535 var showAlert = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; 78536 78537 if (error.response.status === 422) { 78538 // laravel validation 78539 var resData = error.response.data; 78540 console.log(resData); 78541 this.errors = error.response.data; 78542 78543 if (resData.hasOwnProperty('errors')) { 78544 this.errors = resData.errors; 78545 } else if (resData.hasOwnProperty('message')) { 78546 this.errors = resData.message; 78547 } 78548 } else { 78549 if (error.hasOwnProperty('data')) { 78550 console.log(error.data); 78551 78552 if (error.data.hasOwnProperty('message')) { 78553 this.errors = error.data.message; 78554 } else if (error.data.hasOwnProperty('errors')) { 78555 this.errors = error.data.errors; 78556 } else { 78557 this.errors = error.response; 78558 } 78559 } else if (error.hasOwnProperty('response')) { 78560 if (error.response.hasOwnProperty('data') && error.response.data.hasOwnProperty('message')) { 78561 this.errors = error.response.data.message; 78562 } else if (error.response.hasOwnProperty('message')) { 78563 this.errors = error.message; 78564 } else { 78565 this.errors = error.response; 78566 } 78567 } 78568 } 78569 78570 if (true === showAlert) { 78571 this.showErrorMessage(); 78572 } // Session Expired. 78573 78574 78575 if (error.response.status === 419) { 78576 this.$toasted.global.message('Sesi login berakhir!. Halaman akan segera dialihkan.'); 78577 window.location = '/home'; 78578 } 78579 }, 78580 showErrorMessage: function showErrorMessage() { 78581 //let debug = window.App.debug; 78582 var message = _.isString(this.errors) ? this.errors : JSON.stringify(this.errors); //if (debug) { 78583 // message = _.isString(this.errors) ? this.errors : JSON.stringify(this.errors); 78584 //} else { 78585 // message = 'Check error message on form or you can contact web administrator for more details.'; 78586 //} 78587 78588 console.log(this.errors); 78589 sweetalert2__WEBPACK_IMPORTED_MODULE_4___default.a.fire('Something Wrong!', message, 'error'); 78590 }, 78591 getSequence: function getSequence(index) { 78592 return (parseInt(this.filters.pagination.current_page) - 1) * parseInt(this.filters.pagination.per_page) + index + 1; 78593 }, 78594 getSlug: function getSlug(text) { 78595 var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "-"; 78596 return text.toString() // Cast to string 78597 .toLowerCase() // Convert the string to lowercase letters 78598 .normalize('NFD') // The normalize() method returns the Unicode Normalization Form of a given string.
78599 .trim() // Remove whitespace from both sides of a string 78600 .replace(/\s+/g, "-") // Replace spaces with - 78601 .replace(/[^\w\-]+/g, '') // Remove all non-word chars 78602 .replace(/\-\-+/g, "-") // Replace multiple - with single - 78603 .replace("-", separator); // Replace - With dynamic Separator. 78604 } 78605 } 78606}); // REGISTRATION YOUR COMPONENT BEFORE LOAD VUE ELECTION 78607 78608var app = new vue__WEBPACK_IMPORTED_MODULE_0___default.a({ 78609 el: '#app' 78610}); 78611 78612/***/ }), 78613
78614/***/ "./resources/js/mixins/customers.js": 78615/*!******************************************!*\ 78616 !*** ./resources/js/mixins/customers.js ***! 78617 \******************************************/ 78618/*! exports provided: customers */ 78619/***/ (function(module, __webpack_exports__, __webpack_require__) { 78620 78621"use strict"; 78622__webpack_require__.r(__webpack_exports__); 78623/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "customers", function() { return customers; }); 78624/* 78625 * Created by : Ade Sanusi. 78626 * Signature : bac1bad249559aa8c829adf5c08ae8d906991cfc 78627 * Email : [email protected] 78628 * Date : 2022-07-29 78629 * Time : 08:05:00 78630 * Copyright : SanSan CMS by Urang Software Development © 2018 - 2022 78631 * REUSABLE FUNCTION FOR FILTER DATA 78632 * */ 78633var customers = { 78634 data: function data() { 78635 return { 78636 customerProfile: {}, 78637 registrationResponse: {} 78638 }; 78639 }, 78640 methods: { 78641 checkProfile: function checkProfile() { 78642 var _this = this; 78643 78644 //if (!this.submitting) { 78645 //this.submitting = true; 78646 axios.post('/api/check-profile', { 78647 email: this.formData.email 78648 }).then(function (response) { 78649 //this.submitting = false; 78650 console.log(response); 78651 _this.customerProfile = response.data.data; 78652 78653 if (_this.customerProfile.hasOwnProperty("Email")) { 78654 _this.mappingProfileToForm(); 78655 } 78656 })["catch"](function (error) { 78657 //this.submitting = false; 78658 console.log(error); //this.doHandleErrors(error, true); 78659 }); //} 78660 }, 78661 registrationCustomer: function registrationCustomer() { 78662 var _this2 = this; 78663 78664 axios.post('/api/registration', { 78665 email: this.formData.email, 78666 name: this.formData.qq_name, 78667 hand_phone: this.formData.hand_phone 78668 }).then(function (response) { 78669 //this.submitting = false; 78670 console.log(response); 78671 _this2.registationResponse = response.data; 78672 })["catch"](function (error) { 78673 //this.submitting = false; 78674 console.log(error); //this.doHandleErrors(error, true); 78675 }); 78676 }, 78677 mappingProfileToForm: function mappingProfileToForm() { 78678 var data = this.customerProfile; 78679 this.formData.first_name = data.Nama; 78680 this.formData.hand_phone = data.No_HP; 78681 this.formData.telephone = data.No_Telp; 78682 this.formData.gender = data.Jenis_Kelamin === 'Laki-laki' ? '1' : '2'; 78683 this.formData.address = data.Alamat; 78684 this.formData.email = data.Email; 78685 this.formData.zip_code = data.Kode_Pos; 78686 this.formData.office_email = data.Email_K; 78687 this.formData.office_zip_code = data.Kode_Pos_K; 78688 78689 if (this.formData.hasOwnProperty("id_card")) { 78690 this.formData.id_card = data.No_Identitas; 78691 } 78692 } 78693 } 78694}; 78695 78696/***/ }), 78697
78698/***/ "./resources/js/mixins/helper.js": 78699/*!***************************************!*\ 78700 !*** ./resources/js/mixins/helper.js ***! 78701 \***************************************/ 78702/*! exports provided: helper */ 78703/***/ (function(module, __webpack_exports__, __webpack_require__) { 78704 78705"use strict"; 78706__webpack_require__.r(__webpack_exports__); 78707/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "helper", function() { return helper; }); 78708/* 78709 * Created by : Ade Sanusi. 78710 * Signature : bac1bad249559aa8c829adf5c08ae8d906991cfc 78711 * Email : [email protected] 78712 * Date : 2022-07-30 78713 * Time : 08:05:00 78714 * Copyright : SanSan CMS by Urang Software Development © 2018 - 2022 78715 * REUSABLE FUNCTION FOR FILTER DATA 78716 * */ 78717var helper = { 78718 methods: { 78719 copyData: function copyData(data) { 78720 var message = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "Total Payment"; 78721 78722 try { 78723 var el = document.createElement('textarea'); 78724 el.value = data; 78725 el.setAttribute('readonly', ''); 78726 el.style.position = 'absolute'; 78727 el.style.left = '-9999px'; 78728 document.body.appendChild(el); 78729 var selected = document.getSelection().rangeCount > 0 ? document.getSelection().getRangeAt(0) : false; 78730 el.select(); 78731 document.execCommand('copy'); 78732 document.body.removeChild(el); 78733 78734 if (selected) { 78735 document.getSelection().removeAllRanges(); 78736 document.getSelection().addRange(selected); 78737 } 78738 78739 this.$toasted.global.success("Success copy \"".concat(message, "\" : ").concat(data)); 78740 } catch ($e) { 78741 console.log($e); 78742 this.$toasted.global.error("Failed copy \"".concat(message, "\"!")); 78743 } 78744 }, 78745 processPayment: function processPayment() { 78746 var _this = this; 78747 78748 if (!this.submitting) { 78749 var formData = this.formData; 78750 var totalAmount = parseInt(formData.sum_payment_total); 78751 var dataPayment = Object.assign({ 78752 order_id: formData.id_transaction, 78753 gross_amount: totalAmount, 78754 tgl_order: formData.purchase_date, 78755 first_name: formData.first_name, 78756 last_name: formData.last_name, 78757 email: formData.email, 78758 phone: formData.telephone, 78759 address: formData.address, 78760 order_details: [{ 78761 id: formData.id_transaction, 78762 price: totalAmount, 78763 name: "Polis ".concat(formData.business_code, " ").concat(formData.policy_number, " ") 78764 }] 78765 }); 78766 this.submitting = true; 78767 axios.post('/api/payment', dataPayment).then(function (response) { 78768 _this.submitting = false; 78769 var data = response.data.data; 78770 console.log(response.data, data); 78771 78772 _this.$toasted.global.message('Halaman dialihkan ke pembayaran!'); 78773 78774 window.location = data.redirect_url; 78775 })["catch"](function (error) { 78776 console.log(error); 78777 _this.submitting = false; //if (error.response.data.hasOwnProperty("FeedbackMessage")) { 78778 // this.$toasted.global.error(error.response.data.FeedbackMessage); 78779 //} else { 78780 78781 _this.doHandleErrors(error, true); //} 78782 78783 }).then(function () { 78784 _this.submitting = false; 78785 }); 78786 } 78787 }, 78788 resetData: function resetData() { 78789 var _this2 = this; 78790 78791 // Toodo Reset Data 78792 Swal.fire({ 78793 title: "Anda Yakin?", 78794 text: "Formulir akan dikosongkan.", 78795 icon: "warning", 78796 showCancelButton: true, 78797 confirmButtonColor: '#d33', 78798 cancelButtonColor: '#3085d6', 78799 confirmButtonText: 'Yes!' 78800 }).then(function (result) { 78801 if (result.value) { 78802 localStorage.removeItem(_this2.storageForm); 78803 localStorage.removeItem(_this2.storageResponse); 78804 localStorage.removeItem(_this2.storageRequest); 78805 _this2.currentPage = 1; 78806 _this2.formData = JSON.parse(JSON.stringify(_this2.tempData)); 78807 } 78808 }); 78809 }, 78810 prepareForm: function prepareForm() { 78811 this.tempData = JSON.parse(JSON.stringify(this.formData)); 78812 78813 if (localStorage.getItem(this.storageForm)) { 78814 this.formData = JSON.parse(localStorage.getItem(this.storageForm)); 78815 } else { 78816 localStorage.setItem(this.storageForm, JSON.stringify(this.formData)); 78817 } 78818 78819 if (localStorage.getItem(this.storageResponse)) { 78820 this.responseData = JSON.parse(localStorage.getItem(this.storageResponse)); 78821 } else { 78822 localStorage.setItem(this.storageResponse, JSON.stringify(this.responseData)); 78823 } 78824 78825 if (localStorage.getItem(this.storagePage)) { 78826 this.currentPage = parseInt(localStorage.getItem(this.storagePage)); 78827 } else { 78828 localStorage.setItem(this.storagePage, this.currentPage.toString()); 78829 } 78830 },
78831 parsePrice: function parsePrice(val) { 78832 var newVal = String(val).replace(/\s/g, '') // Replace Space 78833 .replace(/\./g, '') // Replace . 78834 .replace(/,/g, '.'); // Replace , to . 78835 78836 return parseFloat(newVal); 78837 }, 78838 formatPrice: function formatPrice(price) { 78839 var locale = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "id"; 78840 return Number(price.toFixed()).toLocaleString(locale); 78841 }, 78842 changePage: function changePage(page) { 78843 this.currentPage = page; 78844 localStorage.setItem(this.storagePage, page); 78845 } 78846 }, 78847 watch: { 78848 'formData.first_name': { 78849 handler: function handler(val) { 78850 var fullName = "".concat(val.replace(/^\s+|\s+$/gm, ''), " ").concat(this.formData.last_name.replace(/^\s+|\s+$/gm, '')); 78851 fullName = fullName.replace(/^\s+|\s+$/gm, ''); 78852 this.formData.qq_name = fullName; 78853 this.formData.the_insured = fullName; 78854 }, 78855 deep: true 78856 }, 78857 'formData.last_name': { 78858 handler: function handler(val) { 78859 var fullName = "".concat(this.formData.first_name.replace(/^\s+|\s+$/gm, ''), " ").concat(val.replace(/^\s+|\s+$/gm, '')); 78860 fullName = fullName.replace(/^\s+|\s+$/gm, ''); 78861 this.formData.qq_name = fullName; 78862 this.formData.the_insured = fullName; 78863 } 78864 } 78865 }, 78866 computed: { 78867 listYears: function listYears() { 78868 var year = new Date().getFullYear(); 78869 var limitYear = year - 20; 78870 return Array.from({ 78871 length: year - limitYear 78872 }, function (value, index) { 78873 return limitYear + index; 78874 }); 78875 } 78876 } 78877}; 78878 78879/***/ })
78879, 78880 78881/***/ 1: 78882/*!*****************************************!*\ 78883 !*** multi ./resources/js/frontends.js ***! 78884 \*****************************************/ 78885/*! no static exports found */ 78886/***/ (function(module, exports, __webpack_require__) { 78887 78888module.exports = __webpack_require__(/*! C:\xampp1\htdocs\asuransi-sinarmas\resources\js\frontends.js */"./resources/js/frontends.js"); 78889 78890 78891/***/ }) 78892 78893/******/ });
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.