Everest Forms – Easy Contact Form and Form Builder - Version 1.6.6.1

Version Description

  • 10-05-2020 =
  • Fix - Sanitization of CSV exported field values.
  • Fix - Conflict within WooCommerce checkout page.
  • Fix - Flatpickr Calendar does not open on Android Chrome.
  • Tweak - Updated selectWoo JS library to v1.6.0.
  • Tweak - Updated flatpickr JS library to v4.6.3.
Download this release

Release Info

Developer everestforms
Plugin Icon 128x128 Everest Forms – Easy Contact Form and Form Builder
Version 1.6.6.1
Comparing to
See all releases

Code changes from version 1.6.6 to 1.6.6.1

assets/css/flatpickr.css CHANGED
@@ -1 +1 @@
1
- .flatpickr-calendar{background:0 0;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;box-sizing:border-box;touch-action:manipulation;background:#fff;box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08)}.flatpickr-calendar.inline,.flatpickr-calendar.open{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{position:absolute;display:block;pointer-events:none;border:solid transparent;content:'';height:0;width:0;left:22px}.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:flex}.flatpickr-months .flatpickr-month{background:0 0;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9);height:28px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;flex:1}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{text-decoration:none;cursor:pointer;position:absolute;top:0;line-height:16px;height:28px;padding:10px;z-index:3;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9)}.flatpickr-months .flatpickr-next-month.disabled,.flatpickr-months .flatpickr-prev-month.disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{content:"";display:block;position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:6.16px 0 0 0;line-height:1;height:28px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{background:0 0;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,.5);background:0 0;pointer-events:none}.flatpickr-weekdays{background:0 0;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:flex;-webkit-box-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:0 0;color:rgba(0,0,0,.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;box-sizing:border-box;display:inline-block;display:-webkit-box;display:flex;flex-wrap:wrap;-ms-flex-wrap:wrap;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:0 0;border:1px solid transparent;border-radius:150px;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.disabled,.flatpickr-day.disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{color:rgba(57,57,57,.3);background:0 0;border-color:transparent;cursor:default}.flatpickr-day.disabled,.flatpickr-day.disabled:hover{cursor:not-allowed;color:rgba(57,57,57,.1)}.flatpickr-day.week.selected{border-radius:0;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{display:inline-block;float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,.3);background:0 0;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:flex;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:0 0;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;box-sizing:border-box}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{height:inherit;display:inline-block;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#f3f3f3}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}
1
+ .flatpickr-calendar{background:0 0;opacity:0;display:none;text-align:center;visibility:hidden;padding:0;-webkit-animation:none;animation:none;direction:ltr;border:0;font-size:14px;line-height:24px;border-radius:5px;position:absolute;width:307.875px;box-sizing:border-box;touch-action:manipulation;background:#fff;box-shadow:1px 0 0 #e6e6e6,-1px 0 0 #e6e6e6,0 1px 0 #e6e6e6,0 -1px 0 #e6e6e6,0 3px 13px rgba(0,0,0,.08)}.flatpickr-calendar.inline,.flatpickr-calendar.open{opacity:1;max-height:640px;visibility:visible}.flatpickr-calendar.open{display:inline-block;z-index:99999}.flatpickr-calendar.animate.open{-webkit-animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1);animation:fpFadeInDown .3s cubic-bezier(.23,1,.32,1)}.flatpickr-calendar.inline{display:block;position:relative;top:2px}.flatpickr-calendar.static{position:absolute;top:calc(100% + 2px)}.flatpickr-calendar.static.open{z-index:999;display:block}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7){box-shadow:none!important}.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1){box-shadow:-2px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-calendar .hasTime .dayContainer,.flatpickr-calendar .hasWeeks .dayContainer{border-bottom:0;border-bottom-right-radius:0;border-bottom-left-radius:0}.flatpickr-calendar .hasWeeks .dayContainer{border-left:0}.flatpickr-calendar.showTimeInput.hasTime .flatpickr-time{height:40px;border-top:1px solid #e6e6e6}.flatpickr-calendar.noCalendar.hasTime .flatpickr-time{height:auto}.flatpickr-calendar:after,.flatpickr-calendar:before{position:absolute;display:block;pointer-events:none;border:solid transparent;content:"";height:0;width:0;left:22px}.flatpickr-calendar.rightMost:after,.flatpickr-calendar.rightMost:before{left:auto;right:22px}.flatpickr-calendar:before{border-width:5px;margin:0 -5px}.flatpickr-calendar:after{border-width:4px;margin:0 -4px}.flatpickr-calendar.arrowTop:after,.flatpickr-calendar.arrowTop:before{bottom:100%}.flatpickr-calendar.arrowTop:before{border-bottom-color:#e6e6e6}.flatpickr-calendar.arrowTop:after{border-bottom-color:#fff}.flatpickr-calendar.arrowBottom:after,.flatpickr-calendar.arrowBottom:before{top:100%}.flatpickr-calendar.arrowBottom:before{border-top-color:#e6e6e6}.flatpickr-calendar.arrowBottom:after{border-top-color:#fff}.flatpickr-calendar:focus{outline:0}.flatpickr-wrapper{position:relative;display:inline-block}.flatpickr-months{display:-webkit-box;display:flex}.flatpickr-months .flatpickr-month{background:0 0;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9);height:34px;line-height:1;text-align:center;position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;-webkit-box-flex:1;flex:1}.flatpickr-months .flatpickr-next-month,.flatpickr-months .flatpickr-prev-month{text-decoration:none;cursor:pointer;position:absolute;top:0;height:34px;padding:10px;z-index:3;color:rgba(0,0,0,.9);fill:rgba(0,0,0,.9)}.flatpickr-months .flatpickr-next-month.flatpickr-disabled,.flatpickr-months .flatpickr-prev-month.flatpickr-disabled{display:none}.flatpickr-months .flatpickr-next-month i,.flatpickr-months .flatpickr-prev-month i{position:relative}.flatpickr-months .flatpickr-next-month.flatpickr-prev-month,.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month{left:0}.flatpickr-months .flatpickr-next-month.flatpickr-next-month,.flatpickr-months .flatpickr-prev-month.flatpickr-next-month{right:0}.flatpickr-months .flatpickr-next-month:hover,.flatpickr-months .flatpickr-prev-month:hover{color:#959ea9}.flatpickr-months .flatpickr-next-month:hover svg,.flatpickr-months .flatpickr-prev-month:hover svg{fill:#f64747}.flatpickr-months .flatpickr-next-month svg,.flatpickr-months .flatpickr-prev-month svg{width:14px;height:14px}.flatpickr-months .flatpickr-next-month svg path,.flatpickr-months .flatpickr-prev-month svg path{-webkit-transition:fill .1s;transition:fill .1s;fill:inherit}.numInputWrapper{position:relative;height:auto}.numInputWrapper input,.numInputWrapper span{display:inline-block}.numInputWrapper input{width:100%}.numInputWrapper input::-ms-clear{display:none}.numInputWrapper input::-webkit-inner-spin-button,.numInputWrapper input::-webkit-outer-spin-button{margin:0;-webkit-appearance:none}.numInputWrapper span{position:absolute;right:0;width:14px;padding:0 4px 0 2px;height:50%;line-height:50%;opacity:0;cursor:pointer;border:1px solid rgba(57,57,57,.15);box-sizing:border-box}.numInputWrapper span:hover{background:rgba(0,0,0,.1)}.numInputWrapper span:active{background:rgba(0,0,0,.2)}.numInputWrapper span:after{display:block;content:"";position:absolute}.numInputWrapper span.arrowUp{top:0;border-bottom:0}.numInputWrapper span.arrowUp:after{border-left:4px solid transparent;border-right:4px solid transparent;border-bottom:4px solid rgba(57,57,57,.6);top:26%}.numInputWrapper span.arrowDown{top:50%}.numInputWrapper span.arrowDown:after{border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid rgba(57,57,57,.6);top:40%}.numInputWrapper span svg{width:inherit;height:auto}.numInputWrapper span svg path{fill:rgba(0,0,0,.5)}.numInputWrapper:hover{background:rgba(0,0,0,.05)}.numInputWrapper:hover span{opacity:1}.flatpickr-current-month{font-size:135%;line-height:inherit;font-weight:300;color:inherit;position:absolute;width:75%;left:12.5%;padding:7.48px 0 0 0;line-height:1;height:34px;display:inline-block;text-align:center;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.flatpickr-current-month span.cur-month{font-family:inherit;font-weight:700;color:inherit;display:inline-block;margin-left:.5ch;padding:0}.flatpickr-current-month span.cur-month:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .numInputWrapper{width:6ch;display:inline-block}.flatpickr-current-month .numInputWrapper span.arrowUp:after{border-bottom-color:rgba(0,0,0,.9)}.flatpickr-current-month .numInputWrapper span.arrowDown:after{border-top-color:rgba(0,0,0,.9)}.flatpickr-current-month input.cur-year{background:0 0;box-sizing:border-box;color:inherit;cursor:text;padding:0 0 0 .5ch;margin:0;display:inline-block;font-size:inherit;font-family:inherit;font-weight:300;line-height:inherit;height:auto;border:0;border-radius:0;vertical-align:initial;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-current-month input.cur-year:focus{outline:0}.flatpickr-current-month input.cur-year[disabled],.flatpickr-current-month input.cur-year[disabled]:hover{font-size:100%;color:rgba(0,0,0,.5);background:0 0;pointer-events:none}.flatpickr-current-month .flatpickr-monthDropdown-months{appearance:menulist;background:0 0;border:none;border-radius:0;box-sizing:border-box;color:inherit;cursor:pointer;font-size:inherit;font-family:inherit;font-weight:300;height:auto;line-height:inherit;margin:-1px 0 0 0;outline:0;padding:0 0 0 .5ch;position:relative;vertical-align:initial;-webkit-box-sizing:border-box;-webkit-appearance:menulist;-moz-appearance:menulist;width:auto}.flatpickr-current-month .flatpickr-monthDropdown-months:active,.flatpickr-current-month .flatpickr-monthDropdown-months:focus{outline:0}.flatpickr-current-month .flatpickr-monthDropdown-months:hover{background:rgba(0,0,0,.05)}.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month{background-color:transparent;outline:0;padding:0}.flatpickr-weekdays{background:0 0;text-align:center;overflow:hidden;width:100%;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;height:28px}.flatpickr-weekdays .flatpickr-weekdaycontainer{display:-webkit-box;display:flex;-webkit-box-flex:1;flex:1}span.flatpickr-weekday{cursor:default;font-size:90%;background:0 0;color:rgba(0,0,0,.54);line-height:1;margin:0;text-align:center;display:block;-webkit-box-flex:1;flex:1;font-weight:bolder}.dayContainer,.flatpickr-weeks{padding:1px 0 0 0}.flatpickr-days{position:relative;overflow:hidden;display:-webkit-box;display:flex;-webkit-box-align:start;align-items:flex-start;width:307.875px}.flatpickr-days:focus{outline:0}.dayContainer{padding:0;outline:0;text-align:left;width:307.875px;min-width:307.875px;max-width:307.875px;box-sizing:border-box;display:inline-block;display:-webkit-box;display:flex;flex-wrap:wrap;-ms-flex-wrap:wrap;justify-content:space-around;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);opacity:1}.dayContainer+.dayContainer{box-shadow:-1px 0 0 #e6e6e6}.flatpickr-day{background:0 0;border:1px solid transparent;border-radius:150px;box-sizing:border-box;color:#393939;cursor:pointer;font-weight:400;width:14.2857143%;flex-basis:14.2857143%;max-width:39px;height:39px;line-height:39px;margin:0;display:inline-block;position:relative;-webkit-box-pack:center;justify-content:center;text-align:center}.flatpickr-day.inRange,.flatpickr-day.nextMonthDay.inRange,.flatpickr-day.nextMonthDay.today.inRange,.flatpickr-day.nextMonthDay:focus,.flatpickr-day.nextMonthDay:hover,.flatpickr-day.prevMonthDay.inRange,.flatpickr-day.prevMonthDay.today.inRange,.flatpickr-day.prevMonthDay:focus,.flatpickr-day.prevMonthDay:hover,.flatpickr-day.today.inRange,.flatpickr-day:focus,.flatpickr-day:hover{cursor:pointer;outline:0;background:#e6e6e6;border-color:#e6e6e6}.flatpickr-day.today{border-color:#959ea9}.flatpickr-day.today:focus,.flatpickr-day.today:hover{border-color:#959ea9;background:#959ea9;color:#fff}.flatpickr-day.endRange,.flatpickr-day.endRange.inRange,.flatpickr-day.endRange.nextMonthDay,.flatpickr-day.endRange.prevMonthDay,.flatpickr-day.endRange:focus,.flatpickr-day.endRange:hover,.flatpickr-day.selected,.flatpickr-day.selected.inRange,.flatpickr-day.selected.nextMonthDay,.flatpickr-day.selected.prevMonthDay,.flatpickr-day.selected:focus,.flatpickr-day.selected:hover,.flatpickr-day.startRange,.flatpickr-day.startRange.inRange,.flatpickr-day.startRange.nextMonthDay,.flatpickr-day.startRange.prevMonthDay,.flatpickr-day.startRange:focus,.flatpickr-day.startRange:hover{background:#569ff7;box-shadow:none;color:#fff;border-color:#569ff7}.flatpickr-day.endRange.startRange,.flatpickr-day.selected.startRange,.flatpickr-day.startRange.startRange{border-radius:50px 0 0 50px}.flatpickr-day.endRange.endRange,.flatpickr-day.selected.endRange,.flatpickr-day.startRange.endRange{border-radius:0 50px 50px 0}.flatpickr-day.endRange.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.selected.startRange+.endRange:not(:nth-child(7n+1)),.flatpickr-day.startRange.startRange+.endRange:not(:nth-child(7n+1)){box-shadow:-10px 0 0 #569ff7}.flatpickr-day.endRange.startRange.endRange,.flatpickr-day.selected.startRange.endRange,.flatpickr-day.startRange.startRange.endRange{border-radius:50px}.flatpickr-day.inRange{border-radius:0;box-shadow:-5px 0 0 #e6e6e6,5px 0 0 #e6e6e6}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover,.flatpickr-day.nextMonthDay,.flatpickr-day.notAllowed,.flatpickr-day.notAllowed.nextMonthDay,.flatpickr-day.notAllowed.prevMonthDay,.flatpickr-day.prevMonthDay{color:rgba(57,57,57,.3);background:0 0;border-color:transparent;cursor:default}.flatpickr-day.flatpickr-disabled,.flatpickr-day.flatpickr-disabled:hover{cursor:not-allowed;color:rgba(57,57,57,.1)}.flatpickr-day.week.selected{border-radius:0;box-shadow:-5px 0 0 #569ff7,5px 0 0 #569ff7}.flatpickr-day.hidden{visibility:hidden}.rangeMode .flatpickr-day{margin-top:1px}.flatpickr-weekwrapper{float:left}.flatpickr-weekwrapper .flatpickr-weeks{padding:0 12px;box-shadow:1px 0 0 #e6e6e6}.flatpickr-weekwrapper .flatpickr-weekday{float:none;width:100%;line-height:28px}.flatpickr-weekwrapper span.flatpickr-day,.flatpickr-weekwrapper span.flatpickr-day:hover{display:block;width:100%;max-width:none;color:rgba(57,57,57,.3);background:0 0;cursor:default;border:none}.flatpickr-innerContainer{display:block;display:-webkit-box;display:flex;box-sizing:border-box;overflow:hidden}.flatpickr-rContainer{display:inline-block;padding:0;box-sizing:border-box}.flatpickr-time{text-align:center;outline:0;display:block;height:0;line-height:40px;max-height:40px;box-sizing:border-box;overflow:hidden;display:-webkit-box;display:flex}.flatpickr-time:after{content:"";display:table;clear:both}.flatpickr-time .numInputWrapper{-webkit-box-flex:1;flex:1;width:40%;height:40px;float:left}.flatpickr-time .numInputWrapper span.arrowUp:after{border-bottom-color:#393939}.flatpickr-time .numInputWrapper span.arrowDown:after{border-top-color:#393939}.flatpickr-time.hasSeconds .numInputWrapper{width:26%}.flatpickr-time.time24hr .numInputWrapper{width:49%}.flatpickr-time input{background:0 0;box-shadow:none;border:0;border-radius:0;text-align:center;margin:0;padding:0;height:inherit;line-height:inherit;color:#393939;font-size:14px;position:relative;box-sizing:border-box;-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield}.flatpickr-time input.flatpickr-hour{font-weight:700}.flatpickr-time input.flatpickr-minute,.flatpickr-time input.flatpickr-second{font-weight:400}.flatpickr-time input:focus{outline:0;border:0}.flatpickr-time .flatpickr-am-pm,.flatpickr-time .flatpickr-time-separator{height:inherit;float:left;line-height:inherit;color:#393939;font-weight:700;width:2%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-align-self:center;align-self:center}.flatpickr-time .flatpickr-am-pm{outline:0;width:18%;cursor:pointer;text-align:center;font-weight:400}.flatpickr-time .flatpickr-am-pm:focus,.flatpickr-time .flatpickr-am-pm:hover,.flatpickr-time input:focus,.flatpickr-time input:hover{background:#eee}.flatpickr-input[readonly]{cursor:pointer}@-webkit-keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}@keyframes fpFadeInDown{from{opacity:0;-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0)}to{opacity:1;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}}
assets/css/flatpickr.scss CHANGED
@@ -6,7 +6,7 @@
6
  visibility: hidden;
7
  padding: 0;
8
  -webkit-animation: none;
9
- animation: none;
10
  direction: ltr;
11
  border: 0;
12
  font-size: 14px;
@@ -15,12 +15,14 @@
15
  position: absolute;
16
  width: 307.875px;
17
  -webkit-box-sizing: border-box;
18
- box-sizing: border-box;
19
  -ms-touch-action: manipulation;
20
- touch-action: manipulation;
21
  background: #fff;
22
- -webkit-box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);
23
- box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);
 
 
24
  }
25
  .flatpickr-calendar.open,
26
  .flatpickr-calendar.inline {
@@ -34,7 +36,7 @@
34
  }
35
  .flatpickr-calendar.animate.open {
36
  -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
37
- animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
38
  }
39
  .flatpickr-calendar.inline {
40
  display: block;
@@ -49,13 +51,19 @@
49
  z-index: 999;
50
  display: block;
51
  }
52
- .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) {
 
 
 
53
  -webkit-box-shadow: none !important;
54
- box-shadow: none !important;
55
  }
56
- .flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {
57
- -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
58
- box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
 
 
 
59
  }
60
  .flatpickr-calendar .hasWeeks .dayContainer,
61
  .flatpickr-calendar .hasTime .dayContainer {
@@ -71,10 +79,10 @@
71
  border-top: 1px solid #e6e6e6;
72
  }
73
  .flatpickr-calendar.noCalendar.hasTime .flatpickr-time {
74
- height: auto;
75
  }
76
- .flatpickr-calendar:before,
77
- .flatpickr-calendar:after {
78
  position: absolute;
79
  display: block;
80
  pointer-events: none;
@@ -84,37 +92,37 @@
84
  width: 0;
85
  left: 22px;
86
  }
87
- .flatpickr-calendar.rightMost:before,
88
- .flatpickr-calendar.rightMost:after {
89
  left: auto;
90
  right: 22px;
91
  }
92
- .flatpickr-calendar:before {
93
  border-width: 5px;
94
  margin: 0 -5px;
95
  }
96
- .flatpickr-calendar:after {
97
  border-width: 4px;
98
  margin: 0 -4px;
99
  }
100
- .flatpickr-calendar.arrowTop:before,
101
- .flatpickr-calendar.arrowTop:after {
102
  bottom: 100%;
103
  }
104
- .flatpickr-calendar.arrowTop:before {
105
  border-bottom-color: #e6e6e6;
106
  }
107
- .flatpickr-calendar.arrowTop:after {
108
  border-bottom-color: #fff;
109
  }
110
- .flatpickr-calendar.arrowBottom:before,
111
- .flatpickr-calendar.arrowBottom:after {
112
  top: 100%;
113
  }
114
- .flatpickr-calendar.arrowBottom:before {
115
  border-top-color: #e6e6e6;
116
  }
117
- .flatpickr-calendar.arrowBottom:after {
118
  border-top-color: #fff;
119
  }
120
  .flatpickr-calendar:focus {
@@ -132,37 +140,36 @@
132
  }
133
  .flatpickr-months .flatpickr-month {
134
  background: transparent;
135
- color: rgba(0,0,0,0.9);
136
- fill: rgba(0,0,0,0.9);
137
- height: 28px;
138
  line-height: 1;
139
  text-align: center;
140
  position: relative;
141
  -webkit-user-select: none;
142
- -moz-user-select: none;
143
- -ms-user-select: none;
144
- user-select: none;
145
  overflow: hidden;
146
  -webkit-box-flex: 1;
147
  -webkit-flex: 1;
148
- -ms-flex: 1;
149
- flex: 1;
150
  }
151
  .flatpickr-months .flatpickr-prev-month,
152
  .flatpickr-months .flatpickr-next-month {
153
  text-decoration: none;
154
  cursor: pointer;
155
  position: absolute;
156
- top: 0px;
157
- line-height: 16px;
158
- height: 28px;
159
  padding: 10px;
160
  z-index: 3;
161
- color: rgba(0,0,0,0.9);
162
- fill: rgba(0,0,0,0.9);
163
  }
164
- .flatpickr-months .flatpickr-prev-month.disabled,
165
- .flatpickr-months .flatpickr-next-month.disabled {
166
  display: none;
167
  }
168
  .flatpickr-months .flatpickr-prev-month i,
@@ -171,36 +178,36 @@
171
  }
172
  .flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,
173
  .flatpickr-months .flatpickr-next-month.flatpickr-prev-month {
174
- /*
175
- /*rtl:begin:ignore*/
176
- /*
177
- */
178
- left: 0;
179
- /*
180
- /*rtl:end:ignore*/
181
- /*
182
- */
183
  }
184
  /*
185
- /*rtl:begin:ignore*/
186
  /*
187
- /*rtl:end:ignore*/
188
  .flatpickr-months .flatpickr-prev-month.flatpickr-next-month,
189
  .flatpickr-months .flatpickr-next-month.flatpickr-next-month {
190
- /*
191
- /*rtl:begin:ignore*/
192
- /*
193
- */
194
- right: 0;
195
- /*
196
- /*rtl:end:ignore*/
197
- /*
198
- */
199
  }
200
  /*
201
- /*rtl:begin:ignore*/
202
  /*
203
- /*rtl:end:ignore*/
204
  .flatpickr-months .flatpickr-prev-month:hover,
205
  .flatpickr-months .flatpickr-next-month:hover {
206
  color: #959ea9;
@@ -234,6 +241,11 @@
234
  .numInputWrapper input::-ms-clear {
235
  display: none;
236
  }
 
 
 
 
 
237
  .numInputWrapper span {
238
  position: absolute;
239
  right: 0;
@@ -243,37 +255,38 @@
243
  line-height: 50%;
244
  opacity: 0;
245
  cursor: pointer;
246
- border: 1px solid rgba(57,57,57,0.15);
 
247
  box-sizing: border-box;
248
  }
249
  .numInputWrapper span:hover {
250
- background: rgba(0,0,0,0.1);
251
  }
252
  .numInputWrapper span:active {
253
- background: rgba(0,0,0,0.2);
254
  }
255
- .numInputWrapper span:after {
256
- content: "";
257
  display: block;
 
258
  position: absolute;
259
  }
260
  .numInputWrapper span.arrowUp {
261
  top: 0;
262
  border-bottom: 0;
263
  }
264
- .numInputWrapper span.arrowUp:after {
265
  border-left: 4px solid transparent;
266
  border-right: 4px solid transparent;
267
- border-bottom: 4px solid rgba(57,57,57,0.6);
268
  top: 26%;
269
  }
270
  .numInputWrapper span.arrowDown {
271
  top: 50%;
272
  }
273
- .numInputWrapper span.arrowDown:after {
274
  border-left: 4px solid transparent;
275
  border-right: 4px solid transparent;
276
- border-top: 4px solid rgba(57,57,57,0.6);
277
  top: 40%;
278
  }
279
  .numInputWrapper span svg {
@@ -281,10 +294,10 @@
281
  height: auto;
282
  }
283
  .numInputWrapper span svg path {
284
- fill: rgba(0,0,0,0.5);
285
  }
286
  .numInputWrapper:hover {
287
- background: rgba(0,0,0,0.05);
288
  }
289
  .numInputWrapper:hover span {
290
  opacity: 1;
@@ -297,13 +310,13 @@
297
  position: absolute;
298
  width: 75%;
299
  left: 12.5%;
300
- padding: 6.16px 0 0 0;
301
  line-height: 1;
302
- height: 28px;
303
  display: inline-block;
304
  text-align: center;
305
- -webkit-transform: translate3d(0px, 0px, 0px);
306
- transform: translate3d(0px, 0px, 0px);
307
  }
308
  .flatpickr-current-month span.cur-month {
309
  font-family: inherit;
@@ -314,21 +327,22 @@
314
  padding: 0;
315
  }
316
  .flatpickr-current-month span.cur-month:hover {
317
- background: rgba(0,0,0,0.05);
318
  }
319
  .flatpickr-current-month .numInputWrapper {
320
  width: 6ch;
321
  width: 7ch\0;
322
  display: inline-block;
323
  }
324
- .flatpickr-current-month .numInputWrapper span.arrowUp:after {
325
- border-bottom-color: rgba(0,0,0,0.9);
326
  }
327
- .flatpickr-current-month .numInputWrapper span.arrowDown:after {
328
- border-top-color: rgba(0,0,0,0.9);
329
  }
330
  .flatpickr-current-month input.cur-year {
331
  background: transparent;
 
332
  box-sizing: border-box;
333
  color: inherit;
334
  cursor: text;
@@ -343,6 +357,9 @@
343
  border: 0;
344
  border-radius: 0;
345
  vertical-align: initial;
 
 
 
346
  }
347
  .flatpickr-current-month input.cur-year:focus {
348
  outline: 0;
@@ -350,10 +367,47 @@
350
  .flatpickr-current-month input.cur-year[disabled],
351
  .flatpickr-current-month input.cur-year[disabled]:hover {
352
  font-size: 100%;
353
- color: rgba(0,0,0,0.5);
354
  background: transparent;
355
  pointer-events: none;
356
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
  .flatpickr-weekdays {
358
  background: transparent;
359
  text-align: center;
@@ -365,8 +419,8 @@
365
  display: flex;
366
  -webkit-box-align: center;
367
  -webkit-align-items: center;
368
- -ms-flex-align: center;
369
- align-items: center;
370
  height: 28px;
371
  }
372
  .flatpickr-weekdays .flatpickr-weekdaycontainer {
@@ -376,22 +430,22 @@
376
  display: flex;
377
  -webkit-box-flex: 1;
378
  -webkit-flex: 1;
379
- -ms-flex: 1;
380
- flex: 1;
381
  }
382
  span.flatpickr-weekday {
383
  cursor: default;
384
  font-size: 90%;
385
  background: transparent;
386
- color: rgba(0,0,0,0.54);
387
  line-height: 1;
388
  margin: 0;
389
  text-align: center;
390
  display: block;
391
  -webkit-box-flex: 1;
392
  -webkit-flex: 1;
393
- -ms-flex: 1;
394
- flex: 1;
395
  font-weight: bolder;
396
  }
397
  .dayContainer,
@@ -407,8 +461,8 @@ span.flatpickr-weekday {
407
  display: flex;
408
  -webkit-box-align: start;
409
  -webkit-align-items: flex-start;
410
- -ms-flex-align: start;
411
- align-items: flex-start;
412
  width: 307.875px;
413
  }
414
  .flatpickr-days:focus {
@@ -422,38 +476,39 @@ span.flatpickr-weekday {
422
  min-width: 307.875px;
423
  max-width: 307.875px;
424
  -webkit-box-sizing: border-box;
425
- box-sizing: border-box;
426
  display: inline-block;
427
  display: -ms-flexbox;
428
  display: -webkit-box;
429
  display: -webkit-flex;
430
  display: flex;
431
  -webkit-flex-wrap: wrap;
432
- flex-wrap: wrap;
433
  -ms-flex-wrap: wrap;
434
  -ms-flex-pack: justify;
435
  -webkit-justify-content: space-around;
436
- justify-content: space-around;
437
- -webkit-transform: translate3d(0px, 0px, 0px);
438
- transform: translate3d(0px, 0px, 0px);
439
  opacity: 1;
440
  }
441
  .dayContainer + .dayContainer {
442
  -webkit-box-shadow: -1px 0 0 #e6e6e6;
443
- box-shadow: -1px 0 0 #e6e6e6;
444
  }
445
  .flatpickr-day {
446
  background: none;
447
  border: 1px solid transparent;
448
  border-radius: 150px;
 
449
  box-sizing: border-box;
450
  color: #393939;
451
  cursor: pointer;
452
  font-weight: 400;
453
  width: 14.2857143%;
454
  -webkit-flex-basis: 14.2857143%;
455
- -ms-flex-preferred-size: 14.2857143%;
456
- flex-basis: 14.2857143%;
457
  max-width: 39px;
458
  height: 39px;
459
  line-height: 39px;
@@ -462,8 +517,8 @@ span.flatpickr-weekday {
462
  position: relative;
463
  -webkit-box-pack: center;
464
  -webkit-justify-content: center;
465
- -ms-flex-pack: center;
466
- justify-content: center;
467
  text-align: center;
468
  }
469
  .flatpickr-day.inRange,
@@ -512,7 +567,7 @@ span.flatpickr-weekday {
512
  .flatpickr-day.endRange.nextMonthDay {
513
  background: #569ff7;
514
  -webkit-box-shadow: none;
515
- box-shadow: none;
516
  color: #fff;
517
  border-color: #569ff7;
518
  }
@@ -526,11 +581,11 @@ span.flatpickr-weekday {
526
  .flatpickr-day.endRange.endRange {
527
  border-radius: 0 50px 50px 0;
528
  }
529
- .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),
530
- .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),
531
- .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {
532
  -webkit-box-shadow: -10px 0 0 #569ff7;
533
- box-shadow: -10px 0 0 #569ff7;
534
  }
535
  .flatpickr-day.selected.startRange.endRange,
536
  .flatpickr-day.startRange.startRange.endRange,
@@ -540,29 +595,29 @@ span.flatpickr-weekday {
540
  .flatpickr-day.inRange {
541
  border-radius: 0;
542
  -webkit-box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
543
- box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
544
  }
545
- .flatpickr-day.disabled,
546
- .flatpickr-day.disabled:hover,
547
  .flatpickr-day.prevMonthDay,
548
  .flatpickr-day.nextMonthDay,
549
  .flatpickr-day.notAllowed,
550
  .flatpickr-day.notAllowed.prevMonthDay,
551
  .flatpickr-day.notAllowed.nextMonthDay {
552
- color: rgba(57,57,57,0.3);
553
  background: transparent;
554
  border-color: transparent;
555
  cursor: default;
556
  }
557
- .flatpickr-day.disabled,
558
- .flatpickr-day.disabled:hover {
559
  cursor: not-allowed;
560
- color: rgba(57,57,57,0.1);
561
  }
562
  .flatpickr-day.week.selected {
563
  border-radius: 0;
564
  -webkit-box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;
565
- box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;
566
  }
567
  .flatpickr-day.hidden {
568
  visibility: hidden;
@@ -571,13 +626,12 @@ span.flatpickr-weekday {
571
  margin-top: 1px;
572
  }
573
  .flatpickr-weekwrapper {
574
- display: inline-block;
575
  float: left;
576
  }
577
  .flatpickr-weekwrapper .flatpickr-weeks {
578
  padding: 0 12px;
579
  -webkit-box-shadow: 1px 0 0 #e6e6e6;
580
- box-shadow: 1px 0 0 #e6e6e6;
581
  }
582
  .flatpickr-weekwrapper .flatpickr-weekday {
583
  float: none;
@@ -589,7 +643,7 @@ span.flatpickr-weekday {
589
  display: block;
590
  width: 100%;
591
  max-width: none;
592
- color: rgba(57,57,57,0.3);
593
  background: transparent;
594
  cursor: default;
595
  border: none;
@@ -600,12 +654,14 @@ span.flatpickr-weekday {
600
  display: -webkit-flex;
601
  display: -ms-flexbox;
602
  display: flex;
 
603
  box-sizing: border-box;
604
  overflow: hidden;
605
  }
606
  .flatpickr-rContainer {
607
  display: inline-block;
608
  padding: 0;
 
609
  box-sizing: border-box;
610
  }
611
  .flatpickr-time {
@@ -615,6 +671,7 @@ span.flatpickr-weekday {
615
  height: 0;
616
  line-height: 40px;
617
  max-height: 40px;
 
618
  box-sizing: border-box;
619
  overflow: hidden;
620
  display: -webkit-box;
@@ -622,24 +679,24 @@ span.flatpickr-weekday {
622
  display: -ms-flexbox;
623
  display: flex;
624
  }
625
- .flatpickr-time:after {
626
- content: "";
627
  display: table;
628
  clear: both;
629
  }
630
  .flatpickr-time .numInputWrapper {
631
  -webkit-box-flex: 1;
632
  -webkit-flex: 1;
633
- -ms-flex: 1;
634
- flex: 1;
635
  width: 40%;
636
  height: 40px;
637
  float: left;
638
  }
639
- .flatpickr-time .numInputWrapper span.arrowUp:after {
640
  border-bottom-color: #393939;
641
  }
642
- .flatpickr-time .numInputWrapper span.arrowDown:after {
643
  border-top-color: #393939;
644
  }
645
  .flatpickr-time.hasSeconds .numInputWrapper {
@@ -651,7 +708,7 @@ span.flatpickr-weekday {
651
  .flatpickr-time input {
652
  background: transparent;
653
  -webkit-box-shadow: none;
654
- box-shadow: none;
655
  border: 0;
656
  border-radius: 0;
657
  text-align: center;
@@ -662,7 +719,11 @@ span.flatpickr-weekday {
662
  color: #393939;
663
  font-size: 14px;
664
  position: relative;
 
665
  box-sizing: border-box;
 
 
 
666
  }
667
  .flatpickr-time input.flatpickr-hour {
668
  font-weight: bold;
@@ -678,19 +739,18 @@ span.flatpickr-weekday {
678
  .flatpickr-time .flatpickr-time-separator,
679
  .flatpickr-time .flatpickr-am-pm {
680
  height: inherit;
681
- display: inline-block;
682
  float: left;
683
  line-height: inherit;
684
  color: #393939;
685
  font-weight: bold;
686
  width: 2%;
687
  -webkit-user-select: none;
688
- -moz-user-select: none;
689
- -ms-user-select: none;
690
- user-select: none;
691
  -webkit-align-self: center;
692
- -ms-flex-item-align: center;
693
- align-self: center;
694
  }
695
  .flatpickr-time .flatpickr-am-pm {
696
  outline: 0;
@@ -703,7 +763,7 @@ span.flatpickr-weekday {
703
  .flatpickr-time .flatpickr-am-pm:hover,
704
  .flatpickr-time input:focus,
705
  .flatpickr-time .flatpickr-am-pm:focus {
706
- background: #f3f3f3;
707
  }
708
  .flatpickr-input[readonly] {
709
  cursor: pointer;
@@ -712,23 +772,23 @@ span.flatpickr-weekday {
712
  from {
713
  opacity: 0;
714
  -webkit-transform: translate3d(0, -20px, 0);
715
- transform: translate3d(0, -20px, 0);
716
  }
717
  to {
718
  opacity: 1;
719
  -webkit-transform: translate3d(0, 0, 0);
720
- transform: translate3d(0, 0, 0);
721
  }
722
  }
723
  @keyframes fpFadeInDown {
724
  from {
725
  opacity: 0;
726
  -webkit-transform: translate3d(0, -20px, 0);
727
- transform: translate3d(0, -20px, 0);
728
  }
729
  to {
730
  opacity: 1;
731
  -webkit-transform: translate3d(0, 0, 0);
732
- transform: translate3d(0, 0, 0);
733
  }
734
  }
6
  visibility: hidden;
7
  padding: 0;
8
  -webkit-animation: none;
9
+ animation: none;
10
  direction: ltr;
11
  border: 0;
12
  font-size: 14px;
15
  position: absolute;
16
  width: 307.875px;
17
  -webkit-box-sizing: border-box;
18
+ box-sizing: border-box;
19
  -ms-touch-action: manipulation;
20
+ touch-action: manipulation;
21
  background: #fff;
22
+ -webkit-box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6,
23
+ 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0, 0, 0, 0.08);
24
+ box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6,
25
+ 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0, 0, 0, 0.08);
26
  }
27
  .flatpickr-calendar.open,
28
  .flatpickr-calendar.inline {
36
  }
37
  .flatpickr-calendar.animate.open {
38
  -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
39
+ animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);
40
  }
41
  .flatpickr-calendar.inline {
42
  display: block;
51
  z-index: 999;
52
  display: block;
53
  }
54
+ .flatpickr-calendar.multiMonth
55
+ .flatpickr-days
56
+ .dayContainer:nth-child(n + 1)
57
+ .flatpickr-day.inRange:nth-child(7n + 7) {
58
  -webkit-box-shadow: none !important;
59
+ box-shadow: none !important;
60
  }
61
+ .flatpickr-calendar.multiMonth
62
+ .flatpickr-days
63
+ .dayContainer:nth-child(n + 2)
64
+ .flatpickr-day.inRange:nth-child(7n + 1) {
65
+ -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
66
+ box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
67
  }
68
  .flatpickr-calendar .hasWeeks .dayContainer,
69
  .flatpickr-calendar .hasTime .dayContainer {
79
  border-top: 1px solid #e6e6e6;
80
  }
81
  .flatpickr-calendar.noCalendar.hasTime .flatpickr-time {
82
+ height: auto;
83
  }
84
+ .flatpickr-calendar::before,
85
+ .flatpickr-calendar::after {
86
  position: absolute;
87
  display: block;
88
  pointer-events: none;
92
  width: 0;
93
  left: 22px;
94
  }
95
+ .flatpickr-calendar.rightMost::before,
96
+ .flatpickr-calendar.rightMost::after {
97
  left: auto;
98
  right: 22px;
99
  }
100
+ .flatpickr-calendar::before {
101
  border-width: 5px;
102
  margin: 0 -5px;
103
  }
104
+ .flatpickr-calendar::after {
105
  border-width: 4px;
106
  margin: 0 -4px;
107
  }
108
+ .flatpickr-calendar.arrowTop::before,
109
+ .flatpickr-calendar.arrowTop::after {
110
  bottom: 100%;
111
  }
112
+ .flatpickr-calendar.arrowTop::before {
113
  border-bottom-color: #e6e6e6;
114
  }
115
+ .flatpickr-calendar.arrowTop::after {
116
  border-bottom-color: #fff;
117
  }
118
+ .flatpickr-calendar.arrowBottom::before,
119
+ .flatpickr-calendar.arrowBottom::after {
120
  top: 100%;
121
  }
122
+ .flatpickr-calendar.arrowBottom::before {
123
  border-top-color: #e6e6e6;
124
  }
125
+ .flatpickr-calendar.arrowBottom::after {
126
  border-top-color: #fff;
127
  }
128
  .flatpickr-calendar:focus {
140
  }
141
  .flatpickr-months .flatpickr-month {
142
  background: transparent;
143
+ color: rgba(0, 0, 0, 0.9);
144
+ fill: rgba(0, 0, 0, 0.9);
145
+ height: 34px;
146
  line-height: 1;
147
  text-align: center;
148
  position: relative;
149
  -webkit-user-select: none;
150
+ -moz-user-select: none;
151
+ -ms-user-select: none;
152
+ user-select: none;
153
  overflow: hidden;
154
  -webkit-box-flex: 1;
155
  -webkit-flex: 1;
156
+ -ms-flex: 1;
157
+ flex: 1;
158
  }
159
  .flatpickr-months .flatpickr-prev-month,
160
  .flatpickr-months .flatpickr-next-month {
161
  text-decoration: none;
162
  cursor: pointer;
163
  position: absolute;
164
+ top: 0;
165
+ height: 34px;
 
166
  padding: 10px;
167
  z-index: 3;
168
+ color: rgba(0, 0, 0, 0.9);
169
+ fill: rgba(0, 0, 0, 0.9);
170
  }
171
+ .flatpickr-months .flatpickr-prev-month.flatpickr-disabled,
172
+ .flatpickr-months .flatpickr-next-month.flatpickr-disabled {
173
  display: none;
174
  }
175
  .flatpickr-months .flatpickr-prev-month i,
178
  }
179
  .flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,
180
  .flatpickr-months .flatpickr-next-month.flatpickr-prev-month {
181
+ /*
182
+ /*rtl:begin:ignore*/
183
+ /*
184
+ */
185
+ left: 0;
186
+ /*
187
+ /*rtl:end:ignore*/
188
+ /*
189
+ */
190
  }
191
  /*
192
+ /*rtl:begin:ignore*/
193
  /*
194
+ /*rtl:end:ignore*/
195
  .flatpickr-months .flatpickr-prev-month.flatpickr-next-month,
196
  .flatpickr-months .flatpickr-next-month.flatpickr-next-month {
197
+ /*
198
+ /*rtl:begin:ignore*/
199
+ /*
200
+ */
201
+ right: 0;
202
+ /*
203
+ /*rtl:end:ignore*/
204
+ /*
205
+ */
206
  }
207
  /*
208
+ /*rtl:begin:ignore*/
209
  /*
210
+ /*rtl:end:ignore*/
211
  .flatpickr-months .flatpickr-prev-month:hover,
212
  .flatpickr-months .flatpickr-next-month:hover {
213
  color: #959ea9;
241
  .numInputWrapper input::-ms-clear {
242
  display: none;
243
  }
244
+ .numInputWrapper input::-webkit-outer-spin-button,
245
+ .numInputWrapper input::-webkit-inner-spin-button {
246
+ margin: 0;
247
+ -webkit-appearance: none;
248
+ }
249
  .numInputWrapper span {
250
  position: absolute;
251
  right: 0;
255
  line-height: 50%;
256
  opacity: 0;
257
  cursor: pointer;
258
+ border: 1px solid rgba(57, 57, 57, 0.15);
259
+ -webkit-box-sizing: border-box;
260
  box-sizing: border-box;
261
  }
262
  .numInputWrapper span:hover {
263
+ background: rgba(0, 0, 0, 0.1);
264
  }
265
  .numInputWrapper span:active {
266
+ background: rgba(0, 0, 0, 0.2);
267
  }
268
+ .numInputWrapper span::after {
 
269
  display: block;
270
+ content: '';
271
  position: absolute;
272
  }
273
  .numInputWrapper span.arrowUp {
274
  top: 0;
275
  border-bottom: 0;
276
  }
277
+ .numInputWrapper span.arrowUp::after {
278
  border-left: 4px solid transparent;
279
  border-right: 4px solid transparent;
280
+ border-bottom: 4px solid rgba(57, 57, 57, 0.6);
281
  top: 26%;
282
  }
283
  .numInputWrapper span.arrowDown {
284
  top: 50%;
285
  }
286
+ .numInputWrapper span.arrowDown::after {
287
  border-left: 4px solid transparent;
288
  border-right: 4px solid transparent;
289
+ border-top: 4px solid rgba(57, 57, 57, 0.6);
290
  top: 40%;
291
  }
292
  .numInputWrapper span svg {
294
  height: auto;
295
  }
296
  .numInputWrapper span svg path {
297
+ fill: rgba(0, 0, 0, 0.5);
298
  }
299
  .numInputWrapper:hover {
300
+ background: rgba(0, 0, 0, 0.05);
301
  }
302
  .numInputWrapper:hover span {
303
  opacity: 1;
310
  position: absolute;
311
  width: 75%;
312
  left: 12.5%;
313
+ padding: 7.48px 0 0 0;
314
  line-height: 1;
315
+ height: 34px;
316
  display: inline-block;
317
  text-align: center;
318
+ -webkit-transform: translate3d(0, 0, 0);
319
+ transform: translate3d(0, 0, 0);
320
  }
321
  .flatpickr-current-month span.cur-month {
322
  font-family: inherit;
327
  padding: 0;
328
  }
329
  .flatpickr-current-month span.cur-month:hover {
330
+ background: rgba(0, 0, 0, 0.05);
331
  }
332
  .flatpickr-current-month .numInputWrapper {
333
  width: 6ch;
334
  width: 7ch\0;
335
  display: inline-block;
336
  }
337
+ .flatpickr-current-month .numInputWrapper span.arrowUp::after {
338
+ border-bottom-color: rgba(0, 0, 0, 0.9);
339
  }
340
+ .flatpickr-current-month .numInputWrapper span.arrowDown::after {
341
+ border-top-color: rgba(0, 0, 0, 0.9);
342
  }
343
  .flatpickr-current-month input.cur-year {
344
  background: transparent;
345
+ -webkit-box-sizing: border-box;
346
  box-sizing: border-box;
347
  color: inherit;
348
  cursor: text;
357
  border: 0;
358
  border-radius: 0;
359
  vertical-align: initial;
360
+ -webkit-appearance: textfield;
361
+ -moz-appearance: textfield;
362
+ appearance: textfield;
363
  }
364
  .flatpickr-current-month input.cur-year:focus {
365
  outline: 0;
367
  .flatpickr-current-month input.cur-year[disabled],
368
  .flatpickr-current-month input.cur-year[disabled]:hover {
369
  font-size: 100%;
370
+ color: rgba(0, 0, 0, 0.5);
371
  background: transparent;
372
  pointer-events: none;
373
  }
374
+ .flatpickr-current-month .flatpickr-monthDropdown-months {
375
+ appearance: menulist;
376
+ background: transparent;
377
+ border: none;
378
+ border-radius: 0;
379
+ box-sizing: border-box;
380
+ color: inherit;
381
+ cursor: pointer;
382
+ font-size: inherit;
383
+ font-family: inherit;
384
+ font-weight: 300;
385
+ height: auto;
386
+ line-height: inherit;
387
+ margin: -1px 0 0 0;
388
+ outline: none;
389
+ padding: 0 0 0 0.5ch;
390
+ position: relative;
391
+ vertical-align: initial;
392
+ -webkit-box-sizing: border-box;
393
+ -webkit-appearance: menulist;
394
+ -moz-appearance: menulist;
395
+ width: auto;
396
+ }
397
+ .flatpickr-current-month .flatpickr-monthDropdown-months:focus,
398
+ .flatpickr-current-month .flatpickr-monthDropdown-months:active {
399
+ outline: none;
400
+ }
401
+ .flatpickr-current-month .flatpickr-monthDropdown-months:hover {
402
+ background: rgba(0, 0, 0, 0.05);
403
+ }
404
+ .flatpickr-current-month
405
+ .flatpickr-monthDropdown-months
406
+ .flatpickr-monthDropdown-month {
407
+ background-color: transparent;
408
+ outline: none;
409
+ padding: 0;
410
+ }
411
  .flatpickr-weekdays {
412
  background: transparent;
413
  text-align: center;
419
  display: flex;
420
  -webkit-box-align: center;
421
  -webkit-align-items: center;
422
+ -ms-flex-align: center;
423
+ align-items: center;
424
  height: 28px;
425
  }
426
  .flatpickr-weekdays .flatpickr-weekdaycontainer {
430
  display: flex;
431
  -webkit-box-flex: 1;
432
  -webkit-flex: 1;
433
+ -ms-flex: 1;
434
+ flex: 1;
435
  }
436
  span.flatpickr-weekday {
437
  cursor: default;
438
  font-size: 90%;
439
  background: transparent;
440
+ color: rgba(0, 0, 0, 0.54);
441
  line-height: 1;
442
  margin: 0;
443
  text-align: center;
444
  display: block;
445
  -webkit-box-flex: 1;
446
  -webkit-flex: 1;
447
+ -ms-flex: 1;
448
+ flex: 1;
449
  font-weight: bolder;
450
  }
451
  .dayContainer,
461
  display: flex;
462
  -webkit-box-align: start;
463
  -webkit-align-items: flex-start;
464
+ -ms-flex-align: start;
465
+ align-items: flex-start;
466
  width: 307.875px;
467
  }
468
  .flatpickr-days:focus {
476
  min-width: 307.875px;
477
  max-width: 307.875px;
478
  -webkit-box-sizing: border-box;
479
+ box-sizing: border-box;
480
  display: inline-block;
481
  display: -ms-flexbox;
482
  display: -webkit-box;
483
  display: -webkit-flex;
484
  display: flex;
485
  -webkit-flex-wrap: wrap;
486
+ flex-wrap: wrap;
487
  -ms-flex-wrap: wrap;
488
  -ms-flex-pack: justify;
489
  -webkit-justify-content: space-around;
490
+ justify-content: space-around;
491
+ -webkit-transform: translate3d(0, 0, 0);
492
+ transform: translate3d(0, 0, 0);
493
  opacity: 1;
494
  }
495
  .dayContainer + .dayContainer {
496
  -webkit-box-shadow: -1px 0 0 #e6e6e6;
497
+ box-shadow: -1px 0 0 #e6e6e6;
498
  }
499
  .flatpickr-day {
500
  background: none;
501
  border: 1px solid transparent;
502
  border-radius: 150px;
503
+ -webkit-box-sizing: border-box;
504
  box-sizing: border-box;
505
  color: #393939;
506
  cursor: pointer;
507
  font-weight: 400;
508
  width: 14.2857143%;
509
  -webkit-flex-basis: 14.2857143%;
510
+ -ms-flex-preferred-size: 14.2857143%;
511
+ flex-basis: 14.2857143%;
512
  max-width: 39px;
513
  height: 39px;
514
  line-height: 39px;
517
  position: relative;
518
  -webkit-box-pack: center;
519
  -webkit-justify-content: center;
520
+ -ms-flex-pack: center;
521
+ justify-content: center;
522
  text-align: center;
523
  }
524
  .flatpickr-day.inRange,
567
  .flatpickr-day.endRange.nextMonthDay {
568
  background: #569ff7;
569
  -webkit-box-shadow: none;
570
+ box-shadow: none;
571
  color: #fff;
572
  border-color: #569ff7;
573
  }
581
  .flatpickr-day.endRange.endRange {
582
  border-radius: 0 50px 50px 0;
583
  }
584
+ .flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n + 1)),
585
+ .flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n + 1)),
586
+ .flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n + 1)) {
587
  -webkit-box-shadow: -10px 0 0 #569ff7;
588
+ box-shadow: -10px 0 0 #569ff7;
589
  }
590
  .flatpickr-day.selected.startRange.endRange,
591
  .flatpickr-day.startRange.startRange.endRange,
595
  .flatpickr-day.inRange {
596
  border-radius: 0;
597
  -webkit-box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
598
+ box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;
599
  }
600
+ .flatpickr-day.flatpickr-disabled,
601
+ .flatpickr-day.flatpickr-disabled:hover,
602
  .flatpickr-day.prevMonthDay,
603
  .flatpickr-day.nextMonthDay,
604
  .flatpickr-day.notAllowed,
605
  .flatpickr-day.notAllowed.prevMonthDay,
606
  .flatpickr-day.notAllowed.nextMonthDay {
607
+ color: rgba(57, 57, 57, 0.3);
608
  background: transparent;
609
  border-color: transparent;
610
  cursor: default;
611
  }
612
+ .flatpickr-day.flatpickr-disabled,
613
+ .flatpickr-day.flatpickr-disabled:hover {
614
  cursor: not-allowed;
615
+ color: rgba(57, 57, 57, 0.1);
616
  }
617
  .flatpickr-day.week.selected {
618
  border-radius: 0;
619
  -webkit-box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;
620
+ box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;
621
  }
622
  .flatpickr-day.hidden {
623
  visibility: hidden;
626
  margin-top: 1px;
627
  }
628
  .flatpickr-weekwrapper {
 
629
  float: left;
630
  }
631
  .flatpickr-weekwrapper .flatpickr-weeks {
632
  padding: 0 12px;
633
  -webkit-box-shadow: 1px 0 0 #e6e6e6;
634
+ box-shadow: 1px 0 0 #e6e6e6;
635
  }
636
  .flatpickr-weekwrapper .flatpickr-weekday {
637
  float: none;
643
  display: block;
644
  width: 100%;
645
  max-width: none;
646
+ color: rgba(57, 57, 57, 0.3);
647
  background: transparent;
648
  cursor: default;
649
  border: none;
654
  display: -webkit-flex;
655
  display: -ms-flexbox;
656
  display: flex;
657
+ -webkit-box-sizing: border-box;
658
  box-sizing: border-box;
659
  overflow: hidden;
660
  }
661
  .flatpickr-rContainer {
662
  display: inline-block;
663
  padding: 0;
664
+ -webkit-box-sizing: border-box;
665
  box-sizing: border-box;
666
  }
667
  .flatpickr-time {
671
  height: 0;
672
  line-height: 40px;
673
  max-height: 40px;
674
+ -webkit-box-sizing: border-box;
675
  box-sizing: border-box;
676
  overflow: hidden;
677
  display: -webkit-box;
679
  display: -ms-flexbox;
680
  display: flex;
681
  }
682
+ .flatpickr-time::after {
683
+ content: '';
684
  display: table;
685
  clear: both;
686
  }
687
  .flatpickr-time .numInputWrapper {
688
  -webkit-box-flex: 1;
689
  -webkit-flex: 1;
690
+ -ms-flex: 1;
691
+ flex: 1;
692
  width: 40%;
693
  height: 40px;
694
  float: left;
695
  }
696
+ .flatpickr-time .numInputWrapper span.arrowUp::after {
697
  border-bottom-color: #393939;
698
  }
699
+ .flatpickr-time .numInputWrapper span.arrowDown::after {
700
  border-top-color: #393939;
701
  }
702
  .flatpickr-time.hasSeconds .numInputWrapper {
708
  .flatpickr-time input {
709
  background: transparent;
710
  -webkit-box-shadow: none;
711
+ box-shadow: none;
712
  border: 0;
713
  border-radius: 0;
714
  text-align: center;
719
  color: #393939;
720
  font-size: 14px;
721
  position: relative;
722
+ -webkit-box-sizing: border-box;
723
  box-sizing: border-box;
724
+ -webkit-appearance: textfield;
725
+ -moz-appearance: textfield;
726
+ appearance: textfield;
727
  }
728
  .flatpickr-time input.flatpickr-hour {
729
  font-weight: bold;
739
  .flatpickr-time .flatpickr-time-separator,
740
  .flatpickr-time .flatpickr-am-pm {
741
  height: inherit;
 
742
  float: left;
743
  line-height: inherit;
744
  color: #393939;
745
  font-weight: bold;
746
  width: 2%;
747
  -webkit-user-select: none;
748
+ -moz-user-select: none;
749
+ -ms-user-select: none;
750
+ user-select: none;
751
  -webkit-align-self: center;
752
+ -ms-flex-item-align: center;
753
+ align-self: center;
754
  }
755
  .flatpickr-time .flatpickr-am-pm {
756
  outline: 0;
763
  .flatpickr-time .flatpickr-am-pm:hover,
764
  .flatpickr-time input:focus,
765
  .flatpickr-time .flatpickr-am-pm:focus {
766
+ background: #eee;
767
  }
768
  .flatpickr-input[readonly] {
769
  cursor: pointer;
772
  from {
773
  opacity: 0;
774
  -webkit-transform: translate3d(0, -20px, 0);
775
+ transform: translate3d(0, -20px, 0);
776
  }
777
  to {
778
  opacity: 1;
779
  -webkit-transform: translate3d(0, 0, 0);
780
+ transform: translate3d(0, 0, 0);
781
  }
782
  }
783
  @keyframes fpFadeInDown {
784
  from {
785
  opacity: 0;
786
  -webkit-transform: translate3d(0, -20px, 0);
787
+ transform: translate3d(0, -20px, 0);
788
  }
789
  to {
790
  opacity: 1;
791
  -webkit-transform: translate3d(0, 0, 0);
792
+ transform: translate3d(0, 0, 0);
793
  }
794
  }
assets/js/flatpickr/flatpickr.js CHANGED
@@ -1,2156 +1,2605 @@
1
- /* flatpickr v4.5.1, @license MIT */
2
  (function (global, factory) {
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
  typeof define === 'function' && define.amd ? define(factory) :
5
- (global.flatpickr = factory());
6
- }(this, (function () { 'use strict';
7
-
8
- var pad = function pad(number) {
9
- return ("0" + number).slice(-2);
10
- };
11
- var int = function int(bool) {
12
- return bool === true ? 1 : 0;
13
- };
14
- function debounce(func, wait, immediate) {
15
- if (immediate === void 0) {
16
- immediate = false;
17
- }
18
-
19
- var timeout;
20
- return function () {
21
- var context = this,
22
- args = arguments;
23
- timeout !== null && clearTimeout(timeout);
24
- timeout = window.setTimeout(function () {
25
- timeout = null;
26
- if (!immediate) func.apply(context, args);
27
- }, wait);
28
- if (immediate && !timeout) func.apply(context, args);
29
- };
30
- }
31
- var arrayify = function arrayify(obj) {
32
- return obj instanceof Array ? obj : [obj];
33
- };
34
-
35
- var do_nothing = function do_nothing() {
36
- return undefined;
37
  };
38
 
39
- var monthToStr = function monthToStr(monthNumber, shorthand, locale) {
40
- return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber];
41
- };
42
- var revFormat = {
43
- D: do_nothing,
44
- F: function F(dateObj, monthName, locale) {
45
- dateObj.setMonth(locale.months.longhand.indexOf(monthName));
46
- },
47
- G: function G(dateObj, hour) {
48
- dateObj.setHours(parseFloat(hour));
49
- },
50
- H: function H(dateObj, hour) {
51
- dateObj.setHours(parseFloat(hour));
52
- },
53
- J: function J(dateObj, day) {
54
- dateObj.setDate(parseFloat(day));
55
- },
56
- K: function K(dateObj, amPM, locale) {
57
- dateObj.setHours(dateObj.getHours() % 12 + 12 * int(new RegExp(locale.amPM[1], "i").test(amPM)));
58
- },
59
- M: function M(dateObj, shortMonth, locale) {
60
- dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));
61
- },
62
- S: function S(dateObj, seconds) {
63
- dateObj.setSeconds(parseFloat(seconds));
64
- },
65
- U: function U(_, unixSeconds) {
66
- return new Date(parseFloat(unixSeconds) * 1000);
67
- },
68
- W: function W(dateObj, weekNum) {
69
- var weekNumber = parseInt(weekNum);
70
- return new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);
71
- },
72
- Y: function Y(dateObj, year) {
73
- dateObj.setFullYear(parseFloat(year));
74
- },
75
- Z: function Z(_, ISODate) {
76
- return new Date(ISODate);
77
- },
78
- d: function d(dateObj, day) {
79
- dateObj.setDate(parseFloat(day));
80
- },
81
- h: function h(dateObj, hour) {
82
- dateObj.setHours(parseFloat(hour));
83
- },
84
- i: function i(dateObj, minutes) {
85
- dateObj.setMinutes(parseFloat(minutes));
86
- },
87
- j: function j(dateObj, day) {
88
- dateObj.setDate(parseFloat(day));
89
- },
90
- l: do_nothing,
91
- m: function m(dateObj, month) {
92
- dateObj.setMonth(parseFloat(month) - 1);
93
- },
94
- n: function n(dateObj, month) {
95
- dateObj.setMonth(parseFloat(month) - 1);
96
- },
97
- s: function s(dateObj, seconds) {
98
- dateObj.setSeconds(parseFloat(seconds));
99
- },
100
- w: do_nothing,
101
- y: function y(dateObj, year) {
102
- dateObj.setFullYear(2000 + parseFloat(year));
103
- }
104
- };
105
- var tokenRegex = {
106
- D: "(\\w+)",
107
- F: "(\\w+)",
108
- G: "(\\d\\d|\\d)",
109
- H: "(\\d\\d|\\d)",
110
- J: "(\\d\\d|\\d)\\w+",
111
- K: "",
112
- M: "(\\w+)",
113
- S: "(\\d\\d|\\d)",
114
- U: "(.+)",
115
- W: "(\\d\\d|\\d)",
116
- Y: "(\\d{4})",
117
- Z: "(.+)",
118
- d: "(\\d\\d|\\d)",
119
- h: "(\\d\\d|\\d)",
120
- i: "(\\d\\d|\\d)",
121
- j: "(\\d\\d|\\d)",
122
- l: "(\\w+)",
123
- m: "(\\d\\d|\\d)",
124
- n: "(\\d\\d|\\d)",
125
- s: "(\\d\\d|\\d)",
126
- w: "(\\d\\d|\\d)",
127
- y: "(\\d{2})"
128
- };
129
- var formats = {
130
- Z: function Z(date) {
131
- return date.toISOString();
132
- },
133
- D: function D(date, locale, options) {
134
- return locale.weekdays.shorthand[formats.w(date, locale, options)];
135
- },
136
- F: function F(date, locale, options) {
137
- return monthToStr(formats.n(date, locale, options) - 1, false, locale);
138
- },
139
- G: function G(date, locale, options) {
140
- return pad(formats.h(date, locale, options));
141
- },
142
- H: function H(date) {
143
- return pad(date.getHours());
144
- },
145
- J: function J(date, locale) {
146
- return locale.ordinal !== undefined ? date.getDate() + locale.ordinal(date.getDate()) : date.getDate();
147
- },
148
- K: function K(date, locale) {
149
- return locale.amPM[int(date.getHours() > 11)];
150
- },
151
- M: function M(date, locale) {
152
- return monthToStr(date.getMonth(), true, locale);
153
- },
154
- S: function S(date) {
155
- return pad(date.getSeconds());
156
- },
157
- U: function U(date) {
158
- return date.getTime() / 1000;
159
- },
160
- W: function W(date, _, options) {
161
- return options.getWeek(date);
162
- },
163
- Y: function Y(date) {
164
- return date.getFullYear();
165
- },
166
- d: function d(date) {
167
- return pad(date.getDate());
168
- },
169
- h: function h(date) {
170
- return date.getHours() % 12 ? date.getHours() % 12 : 12;
171
- },
172
- i: function i(date) {
173
- return pad(date.getMinutes());
174
- },
175
- j: function j(date) {
176
- return date.getDate();
177
- },
178
- l: function l(date, locale) {
179
- return locale.weekdays.longhand[date.getDay()];
180
- },
181
- m: function m(date) {
182
- return pad(date.getMonth() + 1);
183
- },
184
- n: function n(date) {
185
- return date.getMonth() + 1;
186
- },
187
- s: function s(date) {
188
- return date.getSeconds();
189
- },
190
- w: function w(date) {
191
- return date.getDay();
192
- },
193
- y: function y(date) {
194
- return String(date.getFullYear()).substring(2);
195
- }
196
  };
197
 
198
  var english = {
199
- weekdays: {
200
- shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
201
- longhand: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
202
- },
203
- months: {
204
- shorthand: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
205
- longhand: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
206
- },
207
- daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
208
- firstDayOfWeek: 0,
209
- ordinal: function ordinal(nth) {
210
- var s = nth % 100;
211
- if (s > 3 && s < 21) return "th";
212
-
213
- switch (s % 10) {
214
- case 1:
215
- return "st";
216
-
217
- case 2:
218
- return "nd";
219
-
220
- case 3:
221
- return "rd";
222
-
223
- default:
224
- return "th";
225
- }
226
- },
227
- rangeSeparator: " to ",
228
- weekAbbreviation: "Wk",
229
- scrollTitle: "Scroll to increment",
230
- toggleTitle: "Click to toggle",
231
- amPM: ["AM", "PM"],
232
- yearAriaLabel: "Year"
233
- };
234
-
235
- var createDateFormatter = function createDateFormatter(_ref) {
236
- var _ref$config = _ref.config,
237
- config = _ref$config === void 0 ? defaults : _ref$config,
238
- _ref$l10n = _ref.l10n,
239
- l10n = _ref$l10n === void 0 ? english : _ref$l10n;
240
- return function (dateObj, frmt, overrideLocale) {
241
- if (config.formatDate !== undefined) return config.formatDate(dateObj, frmt);
242
- var locale = overrideLocale || l10n;
243
- return frmt.split("").map(function (c, i, arr) {
244
- return formats[c] && arr[i - 1] !== "\\" ? formats[c](dateObj, locale, config) : c !== "\\" ? c : "";
245
- }).join("");
246
- };
247
- };
248
- var createDateParser = function createDateParser(_ref2) {
249
- var _ref2$config = _ref2.config,
250
- config = _ref2$config === void 0 ? defaults : _ref2$config,
251
- _ref2$l10n = _ref2.l10n,
252
- l10n = _ref2$l10n === void 0 ? english : _ref2$l10n;
253
- return function (date, givenFormat, timeless, customLocale) {
254
- if (date !== 0 && !date) return undefined;
255
- var locale = customLocale || l10n;
256
- var parsedDate;
257
- var date_orig = date;
258
- if (date instanceof Date) parsedDate = new Date(date.getTime());else if (typeof date !== "string" && date.toFixed !== undefined) parsedDate = new Date(date);else if (typeof date === "string") {
259
- var format = givenFormat || (config || defaults).dateFormat;
260
- var datestr = String(date).trim();
261
-
262
- if (datestr === "today") {
263
- parsedDate = new Date();
264
- timeless = true;
265
- } else if (/Z$/.test(datestr) || /GMT$/.test(datestr)) parsedDate = new Date(date);else if (config && config.parseDate) parsedDate = config.parseDate(date, format);else {
266
- parsedDate = !config || !config.noCalendar ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) : new Date(new Date().setHours(0, 0, 0, 0));
267
- var matched,
268
- ops = [];
269
-
270
- for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) {
271
- var token = format[i];
272
- var isBackSlash = token === "\\";
273
- var escaped = format[i - 1] === "\\" || isBackSlash;
274
-
275
- if (tokenRegex[token] && !escaped) {
276
- regexStr += tokenRegex[token];
277
- var match = new RegExp(regexStr).exec(date);
278
-
279
- if (match && (matched = true)) {
280
- ops[token !== "Y" ? "push" : "unshift"]({
281
- fn: revFormat[token],
282
- val: match[++matchIndex]
283
- });
284
- }
285
- } else if (!isBackSlash) regexStr += ".";
286
-
287
- ops.forEach(function (_ref3) {
288
- var fn = _ref3.fn,
289
- val = _ref3.val;
290
- return parsedDate = fn(parsedDate, val, locale) || parsedDate;
291
- });
292
  }
293
-
294
- parsedDate = matched ? parsedDate : undefined;
295
- }
296
- }
297
-
298
- if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {
299
- config.errorHandler(new Error("Invalid date provided: " + date_orig));
300
- return undefined;
301
- }
302
-
303
- if (timeless === true) parsedDate.setHours(0, 0, 0, 0);
304
- return parsedDate;
305
- };
306
  };
307
- function compareDates(date1, date2, timeless) {
308
- if (timeless === void 0) {
309
- timeless = true;
310
- }
311
 
312
- if (timeless !== false) {
313
- return new Date(date1.getTime()).setHours(0, 0, 0, 0) - new Date(date2.getTime()).setHours(0, 0, 0, 0);
314
- }
315
-
316
- return date1.getTime() - date2.getTime();
 
 
 
 
 
 
 
 
 
 
 
 
317
  }
318
- var getWeek = function getWeek(givenDate) {
319
- var date = new Date(givenDate.getTime());
320
- date.setHours(0, 0, 0, 0);
321
- date.setDate(date.getDate() + 3 - (date.getDay() + 6) % 7);
322
- var week1 = new Date(date.getFullYear(), 0, 4);
323
- return 1 + Math.round(((date.getTime() - week1.getTime()) / 86400000 - 3 + (week1.getDay() + 6) % 7) / 7);
324
- };
325
- var isBetween = function isBetween(ts, ts1, ts2) {
326
- return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);
327
- };
328
- var duration = {
329
- DAY: 86400000
330
- };
331
-
332
- var defaults = {
333
- _disable: [],
334
- _enable: [],
335
- allowInput: false,
336
- altFormat: "F j, Y",
337
- altInput: false,
338
- altInputClass: "form-control input",
339
- animate: typeof window === "object" && window.navigator.userAgent.indexOf("MSIE") === -1,
340
- ariaDateFormat: "F j, Y",
341
- clickOpens: true,
342
- closeOnSelect: true,
343
- conjunction: ", ",
344
- dateFormat: "Y-m-d",
345
- defaultHour: 12,
346
- defaultMinute: 0,
347
- defaultSeconds: 0,
348
- disable: [],
349
- disableMobile: false,
350
- enable: [],
351
- enableSeconds: false,
352
- enableTime: false,
353
- errorHandler: function errorHandler(err) {
354
- return typeof console !== "undefined" && console.warn(err);
355
- },
356
- getWeek: getWeek,
357
- hourIncrement: 1,
358
- ignoredFocusElements: [],
359
- inline: false,
360
- locale: "default",
361
- minuteIncrement: 5,
362
- mode: "single",
363
- 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>",
364
- noCalendar: false,
365
- now: new Date(),
366
- onChange: [],
367
- onClose: [],
368
- onDayCreate: [],
369
- onDestroy: [],
370
- onKeyDown: [],
371
- onMonthChange: [],
372
- onOpen: [],
373
- onParseConfig: [],
374
- onReady: [],
375
- onValueUpdate: [],
376
- onYearChange: [],
377
- onPreCalendarPosition: [],
378
- plugins: [],
379
- position: "auto",
380
- positionElement: undefined,
381
- 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>",
382
- shorthandCurrentMonth: false,
383
- showMonths: 1,
384
- static: false,
385
- time_24hr: false,
386
- weekNumbers: false,
387
- wrap: false
388
  };
389
 
390
  function toggleClass(elem, className, bool) {
391
- if (bool === true) return elem.classList.add(className);
392
- elem.classList.remove(className);
 
393
  }
394
  function createElement(tag, className, content) {
395
- var e = window.document.createElement(tag);
396
- className = className || "";
397
- content = content || "";
398
- e.className = className;
399
- if (content !== undefined) e.textContent = content;
400
- return e;
 
401
  }
402
  function clearNode(node) {
403
- while (node.firstChild) {
404
- node.removeChild(node.firstChild);
405
- }
406
  }
407
  function findParent(node, condition) {
408
- if (condition(node)) return node;else if (node.parentNode) return findParent(node.parentNode, condition);
409
- return undefined;
 
 
 
410
  }
411
  function createNumberInput(inputClassName, opts) {
412
- var wrapper = createElement("div", "numInputWrapper"),
413
- numInput = createElement("input", "numInput " + inputClassName),
414
- arrowUp = createElement("span", "arrowUp"),
415
- arrowDown = createElement("span", "arrowDown");
416
- numInput.type = "text";
417
- numInput.pattern = "\\d*";
418
- if (opts !== undefined) for (var key in opts) {
419
- numInput.setAttribute(key, opts[key]);
420
- }
421
- wrapper.appendChild(numInput);
422
- wrapper.appendChild(arrowUp);
423
- wrapper.appendChild(arrowDown);
424
- return wrapper;
 
 
425
  }
426
-
427
- if (typeof Object.assign !== "function") {
428
- Object.assign = function (target) {
429
- if (!target) {
430
- throw TypeError("Cannot convert undefined or null to object");
431
  }
 
 
432
 
433
- for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
434
- args[_key - 1] = arguments[_key];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
435
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
436
 
437
- var _loop = function _loop() {
438
- var source = args[_i];
439
-
440
- if (source) {
441
- Object.keys(source).forEach(function (key) {
442
- return target[key] = source[key];
443
- });
444
- }
 
 
 
 
 
 
 
 
 
445
  };
446
-
447
- for (var _i = 0; _i < args.length; _i++) {
448
- _loop();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  }
 
 
 
 
 
 
 
 
450
 
451
- return target;
452
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
453
  }
454
 
455
  var DEBOUNCED_CHANGE_MS = 300;
456
-
457
  function FlatpickrInstance(element, instanceConfig) {
458
- var self = {
459
- config: Object.assign({}, flatpickr.defaultConfig),
460
- l10n: english
461
- };
462
- self.parseDate = createDateParser({
463
- config: self.config,
464
- l10n: self.l10n
465
- });
466
- self._handlers = [];
467
- self._bind = bind;
468
- self._setHoursFromDate = setHoursFromDate;
469
- self._positionCalendar = positionCalendar;
470
- self.changeMonth = changeMonth;
471
- self.changeYear = changeYear;
472
- self.clear = clear;
473
- self.close = close;
474
- self._createElement = createElement;
475
- self.destroy = destroy;
476
- self.isEnabled = isEnabled;
477
- self.jumpToDate = jumpToDate;
478
- self.open = open;
479
- self.redraw = redraw;
480
- self.set = set;
481
- self.setDate = setDate;
482
- self.toggle = toggle;
483
-
484
- function setupHelperFunctions() {
485
- self.utils = {
486
- getDaysInMonth: function getDaysInMonth(month, yr) {
487
- if (month === void 0) {
488
- month = self.currentMonth;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
  }
490
-
491
- if (yr === void 0) {
492
- yr = self.currentYear;
 
 
 
 
 
 
 
 
 
 
 
493
  }
494
-
495
- if (month === 1 && (yr % 4 === 0 && yr % 100 !== 0 || yr % 400 === 0)) return 29;
496
- return self.l10n.daysInMonth[month];
497
- }
498
- };
499
- }
500
-
501
- function init() {
502
- self.element = self.input = element;
503
- self.isOpen = false;
504
- parseConfig();
505
- setupLocale();
506
- setupInputs();
507
- setupDates();
508
- setupHelperFunctions();
509
- if (!self.isMobile) build();
510
- bindEvents();
511
-
512
- if (self.selectedDates.length || self.config.noCalendar) {
513
- if (self.config.enableTime) {
514
- setHoursFromDate(self.config.noCalendar ? self.latestSelectedDateObj || self.config.minDate : undefined);
515
- }
516
-
517
- updateValue(false);
518
- }
519
-
520
- setCalendarWidth();
521
- self.showTimeInput = self.selectedDates.length > 0 || self.config.noCalendar;
522
- var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
523
-
524
- if (!self.isMobile && isSafari) {
525
- positionCalendar();
526
- }
527
-
528
- triggerEvent("onReady");
529
- }
530
-
531
- function bindToInstance(fn) {
532
- return fn.bind(self);
533
- }
534
-
535
- function setCalendarWidth() {
536
- var config = self.config;
537
- if (config.weekNumbers === false && config.showMonths === 1) return;else if (config.noCalendar !== true) {
538
- window.requestAnimationFrame(function () {
539
- self.calendarContainer.style.visibility = "hidden";
540
- self.calendarContainer.style.display = "block";
541
-
542
- if (self.daysContainer !== undefined) {
543
- var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;
544
- self.daysContainer.style.width = daysWidth + "px";
545
- self.calendarContainer.style.width = daysWidth + (self.weekWrapper !== undefined ? self.weekWrapper.offsetWidth : 0) + "px";
546
- self.calendarContainer.style.removeProperty("visibility");
547
- self.calendarContainer.style.removeProperty("display");
548
  }
549
- });
550
  }
551
- }
552
-
553
- function updateTime(e) {
554
- if (self.selectedDates.length === 0) return;
555
-
556
- if (e !== undefined && e.type !== "blur") {
557
- timeWrapper(e);
 
 
 
 
 
 
 
 
 
558
  }
559
-
560
- var prevValue = self._input.value;
561
- setHoursFromInputs();
562
- updateValue();
563
-
564
- if (self._input.value !== prevValue) {
565
- self._debouncedChange();
566
  }
567
- }
568
-
569
- function ampm2military(hour, amPM) {
570
- return hour % 12 + 12 * int(amPM === self.l10n.amPM[1]);
571
- }
572
-
573
- function military2ampm(hour) {
574
- switch (hour % 24) {
575
- case 0:
576
- case 12:
577
- return 12;
578
-
579
- default:
580
- return hour % 12;
581
  }
582
- }
583
-
584
- function setHoursFromInputs() {
585
- if (self.hourElement === undefined || self.minuteElement === undefined) return;
586
- var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24,
587
- minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60,
588
- seconds = self.secondElement !== undefined ? (parseInt(self.secondElement.value, 10) || 0) % 60 : 0;
589
-
590
- if (self.amPM !== undefined) {
591
- hours = ampm2military(hours, self.amPM.textContent);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
592
  }
593
-
594
- var limitMinHours = self.config.minTime !== undefined || self.config.minDate && self.minDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.minDate, true) === 0;
595
- var limitMaxHours = self.config.maxTime !== undefined || self.config.maxDate && self.maxDateHasTime && self.latestSelectedDateObj && compareDates(self.latestSelectedDateObj, self.config.maxDate, true) === 0;
596
-
597
- if (limitMaxHours) {
598
- var maxTime = self.config.maxTime !== undefined ? self.config.maxTime : self.config.maxDate;
599
- hours = Math.min(hours, maxTime.getHours());
600
- if (hours === maxTime.getHours()) minutes = Math.min(minutes, maxTime.getMinutes());
601
- if (minutes === maxTime.getMinutes()) seconds = Math.min(seconds, maxTime.getSeconds());
 
 
 
 
 
 
 
 
 
602
  }
603
-
604
- if (limitMinHours) {
605
- var minTime = self.config.minTime !== undefined ? self.config.minTime : self.config.minDate;
606
- hours = Math.max(hours, minTime.getHours());
607
- if (hours === minTime.getHours()) minutes = Math.max(minutes, minTime.getMinutes());
608
- if (minutes === minTime.getMinutes()) seconds = Math.max(seconds, minTime.getSeconds());
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
609
  }
610
-
611
- setHours(hours, minutes, seconds);
612
- }
613
-
614
- function setHoursFromDate(dateObj) {
615
- var date = dateObj || self.latestSelectedDateObj;
616
- if (date) setHours(date.getHours(), date.getMinutes(), date.getSeconds());
617
- }
618
-
619
- function setDefaultHours() {
620
- var hours = self.config.defaultHour;
621
- var minutes = self.config.defaultMinute;
622
- var seconds = self.config.defaultSeconds;
623
-
624
- if (self.config.minDate !== undefined) {
625
- var min_hr = self.config.minDate.getHours();
626
- var min_minutes = self.config.minDate.getMinutes();
627
- hours = Math.max(hours, min_hr);
628
- if (hours === min_hr) minutes = Math.max(min_minutes, minutes);
629
- if (hours === min_hr && minutes === min_minutes) seconds = self.config.minDate.getSeconds();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
630
  }
631
-
632
- if (self.config.maxDate !== undefined) {
633
- var max_hr = self.config.maxDate.getHours();
634
- var max_minutes = self.config.maxDate.getMinutes();
635
- hours = Math.min(hours, max_hr);
636
- if (hours === max_hr) minutes = Math.min(max_minutes, minutes);
637
- if (hours === max_hr && minutes === max_minutes) seconds = self.config.maxDate.getSeconds();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
638
  }
639
-
640
- setHours(hours, minutes, seconds);
641
- }
642
-
643
- function setHours(hours, minutes, seconds) {
644
- if (self.latestSelectedDateObj !== undefined) {
645
- self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
646
  }
647
-
648
- if (!self.hourElement || !self.minuteElement || self.isMobile) return;
649
- self.hourElement.value = pad(!self.config.time_24hr ? (12 + hours) % 12 + 12 * int(hours % 12 === 0) : hours);
650
- self.minuteElement.value = pad(minutes);
651
- if (self.amPM !== undefined) self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];
652
- if (self.secondElement !== undefined) self.secondElement.value = pad(seconds);
653
- }
654
-
655
- function onYearInput(event) {
656
- var year = parseInt(event.target.value) + (event.delta || 0);
657
-
658
- if (year / 1000 > 1 || event.key === "Enter" && !/[^\d]/.test(year.toString())) {
659
- changeYear(year);
660
  }
661
- }
662
-
663
- function bind(element, event, handler, options) {
664
- if (event instanceof Array) return event.forEach(function (ev) {
665
- return bind(element, ev, handler, options);
666
- });
667
- if (element instanceof Array) return element.forEach(function (el) {
668
- return bind(el, event, handler, options);
669
- });
670
- element.addEventListener(event, handler, options);
671
-
672
- self._handlers.push({
673
- element: element,
674
- event: event,
675
- handler: handler,
676
- options: options
677
- });
678
- }
679
-
680
- function onClick(handler) {
681
- return function (evt) {
682
- evt.which === 1 && handler(evt);
683
- };
684
- }
685
-
686
- function triggerChange() {
687
- triggerEvent("onChange");
688
- }
689
-
690
- function bindEvents() {
691
- if (self.config.wrap) {
692
- ["open", "close", "toggle", "clear"].forEach(function (evt) {
693
- Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) {
694
- return bind(el, "click", self[evt]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
695
  });
696
- });
697
- }
698
-
699
- if (self.isMobile) {
700
- setupMobile();
701
- return;
702
  }
703
-
704
- var debouncedResize = debounce(onResize, 50);
705
- self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);
706
- if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent)) bind(self.daysContainer, "mouseover", function (e) {
707
- if (self.config.mode === "range") onMouseOver(e.target);
708
- });
709
- bind(window.document.body, "keydown", onKeyDown);
710
- if (!self.config.static) bind(self._input, "keydown", onKeyDown);
711
- if (!self.config.inline && !self.config.static) bind(window, "resize", debouncedResize);
712
- if (window.ontouchstart !== undefined) bind(window.document, "click", documentClick);else bind(window.document, "mousedown", onClick(documentClick));
713
- bind(window.document, "focus", documentClick, {
714
- capture: true
715
- });
716
-
717
- if (self.config.clickOpens === true) {
718
- bind(self._input, "focus", self.open);
719
- bind(self._input, "mousedown", onClick(self.open));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
720
  }
721
-
722
- if (self.daysContainer !== undefined) {
723
- bind(self.monthNav, "mousedown", onClick(onMonthNavClick));
724
- bind(self.monthNav, ["keyup", "increment"], onYearInput);
725
- bind(self.daysContainer, "mousedown", onClick(selectDate));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
726
  }
727
-
728
- if (self.timeContainer !== undefined && self.minuteElement !== undefined && self.hourElement !== undefined) {
729
- var selText = function selText(e) {
730
- return e.target.select();
731
- };
732
-
733
- bind(self.timeContainer, ["increment"], updateTime);
734
- bind(self.timeContainer, "blur", updateTime, {
735
- capture: true
736
- });
737
- bind(self.timeContainer, "mousedown", onClick(timeIncrement));
738
- bind([self.hourElement, self.minuteElement], ["focus", "click"], selText);
739
- if (self.secondElement !== undefined) bind(self.secondElement, "focus", function () {
740
- return self.secondElement && self.secondElement.select();
741
- });
742
-
743
- if (self.amPM !== undefined) {
744
- bind(self.amPM, "mousedown", onClick(function (e) {
745
- updateTime(e);
746
- triggerChange();
747
- }));
748
- }
749
- }
750
- }
751
-
752
- function jumpToDate(jumpDate) {
753
- var jumpTo = jumpDate !== undefined ? self.parseDate(jumpDate) : self.latestSelectedDateObj || (self.config.minDate && self.config.minDate > self.now ? self.config.minDate : self.config.maxDate && self.config.maxDate < self.now ? self.config.maxDate : self.now);
754
-
755
- try {
756
- if (jumpTo !== undefined) {
757
- self.currentYear = jumpTo.getFullYear();
758
- self.currentMonth = jumpTo.getMonth();
759
- }
760
- } catch (e) {
761
- e.message = "Invalid date supplied: " + jumpTo;
762
- self.config.errorHandler(e);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
763
  }
764
-
765
- self.redraw();
766
- }
767
-
768
- function timeIncrement(e) {
769
- if (~e.target.className.indexOf("arrow")) incrementNumInput(e, e.target.classList.contains("arrowUp") ? 1 : -1);
770
- }
771
-
772
- function incrementNumInput(e, delta, inputElem) {
773
- var target = e && e.target;
774
- var input = inputElem || target && target.parentNode && target.parentNode.firstChild;
775
- var event = createEvent("increment");
776
- event.delta = delta;
777
- input && input.dispatchEvent(event);
778
- }
779
-
780
- function build() {
781
- var fragment = window.document.createDocumentFragment();
782
- self.calendarContainer = createElement("div", "flatpickr-calendar");
783
- self.calendarContainer.tabIndex = -1;
784
-
785
- if (!self.config.noCalendar) {
786
- fragment.appendChild(buildMonthNav());
787
- self.innerContainer = createElement("div", "flatpickr-innerContainer");
788
-
789
- if (self.config.weekNumbers) {
790
- var _buildWeeks = buildWeeks(),
791
- weekWrapper = _buildWeeks.weekWrapper,
792
- weekNumbers = _buildWeeks.weekNumbers;
793
-
794
- self.innerContainer.appendChild(weekWrapper);
795
- self.weekNumbers = weekNumbers;
796
- self.weekWrapper = weekWrapper;
797
- }
798
-
799
- self.rContainer = createElement("div", "flatpickr-rContainer");
800
- self.rContainer.appendChild(buildWeekdays());
801
-
802
- if (!self.daysContainer) {
803
- self.daysContainer = createElement("div", "flatpickr-days");
804
- self.daysContainer.tabIndex = -1;
805
- }
806
-
807
- buildDays();
808
- self.rContainer.appendChild(self.daysContainer);
809
- self.innerContainer.appendChild(self.rContainer);
810
- fragment.appendChild(self.innerContainer);
 
 
 
 
 
 
 
 
 
 
 
811
  }
812
-
813
- if (self.config.enableTime) {
814
- fragment.appendChild(buildTime());
815
  }
816
-
817
- toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range");
818
- toggleClass(self.calendarContainer, "animate", self.config.animate === true);
819
- toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1);
820
- self.calendarContainer.appendChild(fragment);
821
- var customAppend = self.config.appendTo !== undefined && self.config.appendTo.nodeType !== undefined;
822
-
823
- if (self.config.inline || self.config.static) {
824
- self.calendarContainer.classList.add(self.config.inline ? "inline" : "static");
825
-
826
- if (self.config.inline) {
827
- if (!customAppend && self.element.parentNode) self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);else if (self.config.appendTo !== undefined) self.config.appendTo.appendChild(self.calendarContainer);
828
- }
829
-
830
- if (self.config.static) {
831
- var wrapper = createElement("div", "flatpickr-wrapper");
832
- if (self.element.parentNode) self.element.parentNode.insertBefore(wrapper, self.element);
833
- wrapper.appendChild(self.element);
834
- if (self.altInput) wrapper.appendChild(self.altInput);
835
- wrapper.appendChild(self.calendarContainer);
836
- }
837
  }
838
-
839
- if (!self.config.static && !self.config.inline) (self.config.appendTo !== undefined ? self.config.appendTo : window.document.body).appendChild(self.calendarContainer);
840
- }
841
-
842
- function createDay(className, date, dayNumber, i) {
843
- var dateIsEnabled = isEnabled(date, true),
844
- dayElement = createElement("span", "flatpickr-day " + className, date.getDate().toString());
845
- dayElement.dateObj = date;
846
- dayElement.$i = i;
847
- dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat));
848
-
849
- if (className.indexOf("hidden") === -1 && compareDates(date, self.now) === 0) {
850
- self.todayDateElem = dayElement;
851
- dayElement.classList.add("today");
852
- dayElement.setAttribute("aria-current", "date");
853
- }
854
-
855
- if (dateIsEnabled) {
856
- dayElement.tabIndex = -1;
857
-
858
- if (isDateSelected(date)) {
859
- dayElement.classList.add("selected");
860
- self.selectedDateElem = dayElement;
861
-
862
- if (self.config.mode === "range") {
863
- toggleClass(dayElement, "startRange", self.selectedDates[0] && compareDates(date, self.selectedDates[0], true) === 0);
864
- toggleClass(dayElement, "endRange", self.selectedDates[1] && compareDates(date, self.selectedDates[1], true) === 0);
865
- if (className === "nextMonthDay") dayElement.classList.add("inRange");
866
  }
867
- }
868
- } else {
869
- dayElement.classList.add("disabled");
870
- }
871
-
872
- if (self.config.mode === "range") {
873
- if (isDateInRange(date) && !isDateSelected(date)) dayElement.classList.add("inRange");
874
- }
875
-
876
- if (self.weekNumbers && self.config.showMonths === 1 && className !== "prevMonthDay" && dayNumber % 7 === 1) {
877
- self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>");
878
- }
879
-
880
- triggerEvent("onDayCreate", dayElement);
881
- return dayElement;
882
- }
883
-
884
- function focusOnDayElem(targetNode) {
885
- targetNode.focus();
886
- if (self.config.mode === "range") onMouseOver(targetNode);
887
- }
888
-
889
- function getFirstAvailableDay(delta) {
890
- var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;
891
- var endMonth = delta > 0 ? self.config.showMonths : -1;
892
-
893
- for (var m = startMonth; m != endMonth; m += delta) {
894
- var month = self.daysContainer.children[m];
895
- var startIndex = delta > 0 ? 0 : month.children.length - 1;
896
- var endIndex = delta > 0 ? month.children.length : -1;
897
-
898
- for (var i = startIndex; i != endIndex; i += delta) {
899
- var c = month.children[i];
900
- if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj)) return c;
901
- }
902
- }
903
-
904
- return undefined;
905
- }
906
-
907
- function getNextAvailableDay(current, delta) {
908
- var givenMonth = current.className.indexOf("Month") === -1 ? current.dateObj.getMonth() : self.currentMonth;
909
- var endMonth = delta > 0 ? self.config.showMonths : -1;
910
- var loopDelta = delta > 0 ? 1 : -1;
911
-
912
- for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {
913
- var month = self.daysContainer.children[m];
914
- var startIndex = givenMonth - self.currentMonth === m ? current.$i + delta : delta < 0 ? month.children.length - 1 : 0;
915
- var numMonthDays = month.children.length;
916
-
917
- for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {
918
- var c = month.children[i];
919
- if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj) && Math.abs(current.$i - i) >= Math.abs(delta)) return focusOnDayElem(c);
920
- }
921
- }
922
-
923
- self.changeMonth(loopDelta);
924
- focusOnDay(getFirstAvailableDay(loopDelta), 0);
925
- return undefined;
926
- }
927
-
928
- function focusOnDay(current, offset) {
929
- var dayFocused = isInView(document.activeElement);
930
- var startElem = current !== undefined ? current : dayFocused ? document.activeElement : self.selectedDateElem !== undefined && isInView(self.selectedDateElem) ? self.selectedDateElem : self.todayDateElem !== undefined && isInView(self.todayDateElem) ? self.todayDateElem : getFirstAvailableDay(offset > 0 ? 1 : -1);
931
- if (startElem === undefined) return self._input.focus();
932
- if (!dayFocused) return focusOnDayElem(startElem);
933
- getNextAvailableDay(startElem, offset);
934
- }
935
-
936
- function buildMonthDays(year, month) {
937
- var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;
938
- var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12);
939
- var daysInMonth = self.utils.getDaysInMonth(month),
940
- days = window.document.createDocumentFragment(),
941
- isMultiMonth = self.config.showMonths > 1,
942
- prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay",
943
- nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay";
944
- var dayNumber = prevMonthDays + 1 - firstOfMonth,
945
- dayIndex = 0;
946
-
947
- for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {
948
- days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));
949
- }
950
-
951
- for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {
952
- days.appendChild(createDay("", new Date(year, month, dayNumber), dayNumber, dayIndex));
953
- }
954
-
955
- for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth && (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {
956
- days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));
957
- }
958
-
959
- var dayContainer = createElement("div", "dayContainer");
960
- dayContainer.appendChild(days);
961
- return dayContainer;
962
- }
963
-
964
- function buildDays() {
965
- if (self.daysContainer === undefined) {
966
- return;
967
- }
968
-
969
- clearNode(self.daysContainer);
970
- if (self.weekNumbers) clearNode(self.weekNumbers);
971
- var frag = document.createDocumentFragment();
972
-
973
- for (var i = 0; i < self.config.showMonths; i++) {
974
- var d = new Date(self.currentYear, self.currentMonth, 1);
975
- d.setMonth(self.currentMonth + i);
976
- frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
977
- }
978
-
979
- self.daysContainer.appendChild(frag);
980
- self.days = self.daysContainer.firstChild;
981
-
982
- if (self.config.mode === "range" && self.selectedDates.length === 1) {
983
- onMouseOver();
984
- }
985
- }
986
-
987
- function buildMonth() {
988
- var container = createElement("div", "flatpickr-month");
989
- var monthNavFragment = window.document.createDocumentFragment();
990
- var monthElement = createElement("span", "cur-month");
991
- var yearInput = createNumberInput("cur-year", {
992
- tabindex: "-1"
993
- });
994
- var yearElement = yearInput.childNodes[0];
995
- yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel);
996
- if (self.config.minDate) yearElement.setAttribute("data-min", self.config.minDate.getFullYear().toString());
997
-
998
- if (self.config.maxDate) {
999
- yearElement.setAttribute("data-max", self.config.maxDate.getFullYear().toString());
1000
- yearElement.disabled = !!self.config.minDate && self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();
1001
- }
1002
-
1003
- var currentMonth = createElement("div", "flatpickr-current-month");
1004
- currentMonth.appendChild(monthElement);
1005
- currentMonth.appendChild(yearInput);
1006
- monthNavFragment.appendChild(currentMonth);
1007
- container.appendChild(monthNavFragment);
1008
- return {
1009
- container: container,
1010
- yearElement: yearElement,
1011
- monthElement: monthElement
1012
- };
1013
- }
1014
-
1015
- function buildMonths() {
1016
- clearNode(self.monthNav);
1017
- self.monthNav.appendChild(self.prevMonthNav);
1018
-
1019
- for (var m = self.config.showMonths; m--;) {
1020
- var month = buildMonth();
1021
- self.yearElements.push(month.yearElement);
1022
- self.monthElements.push(month.monthElement);
1023
- self.monthNav.appendChild(month.container);
1024
- }
1025
-
1026
- self.monthNav.appendChild(self.nextMonthNav);
1027
- }
1028
-
1029
- function buildMonthNav() {
1030
- self.monthNav = createElement("div", "flatpickr-months");
1031
- self.yearElements = [];
1032
- self.monthElements = [];
1033
- self.prevMonthNav = createElement("span", "flatpickr-prev-month");
1034
- self.prevMonthNav.innerHTML = self.config.prevArrow;
1035
- self.nextMonthNav = createElement("span", "flatpickr-next-month");
1036
- self.nextMonthNav.innerHTML = self.config.nextArrow;
1037
- buildMonths();
1038
- Object.defineProperty(self, "_hidePrevMonthArrow", {
1039
- get: function get() {
1040
- return self.__hidePrevMonthArrow;
1041
- },
1042
- set: function set(bool) {
1043
- if (self.__hidePrevMonthArrow !== bool) {
1044
- toggleClass(self.prevMonthNav, "disabled", bool);
1045
- self.__hidePrevMonthArrow = bool;
1046
- }
1047
- }
1048
- });
1049
- Object.defineProperty(self, "_hideNextMonthArrow", {
1050
- get: function get() {
1051
- return self.__hideNextMonthArrow;
1052
- },
1053
- set: function set(bool) {
1054
- if (self.__hideNextMonthArrow !== bool) {
1055
- toggleClass(self.nextMonthNav, "disabled", bool);
1056
- self.__hideNextMonthArrow = bool;
1057
- }
1058
- }
1059
- });
1060
- self.currentYearElement = self.yearElements[0];
1061
- updateNavigationCurrentMonth();
1062
- return self.monthNav;
1063
- }
1064
-
1065
- function buildTime() {
1066
- self.calendarContainer.classList.add("hasTime");
1067
- if (self.config.noCalendar) self.calendarContainer.classList.add("noCalendar");
1068
- self.timeContainer = createElement("div", "flatpickr-time");
1069
- self.timeContainer.tabIndex = -1;
1070
- var separator = createElement("span", "flatpickr-time-separator", ":");
1071
- var hourInput = createNumberInput("flatpickr-hour");
1072
- self.hourElement = hourInput.childNodes[0];
1073
- var minuteInput = createNumberInput("flatpickr-minute");
1074
- self.minuteElement = minuteInput.childNodes[0];
1075
- self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;
1076
- self.hourElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getHours() : self.config.time_24hr ? self.config.defaultHour : military2ampm(self.config.defaultHour));
1077
- self.minuteElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getMinutes() : self.config.defaultMinute);
1078
- self.hourElement.setAttribute("data-step", self.config.hourIncrement.toString());
1079
- self.minuteElement.setAttribute("data-step", self.config.minuteIncrement.toString());
1080
- self.hourElement.setAttribute("data-min", self.config.time_24hr ? "0" : "1");
1081
- self.hourElement.setAttribute("data-max", self.config.time_24hr ? "23" : "12");
1082
- self.minuteElement.setAttribute("data-min", "0");
1083
- self.minuteElement.setAttribute("data-max", "59");
1084
- self.timeContainer.appendChild(hourInput);
1085
- self.timeContainer.appendChild(separator);
1086
- self.timeContainer.appendChild(minuteInput);
1087
- if (self.config.time_24hr) self.timeContainer.classList.add("time24hr");
1088
-
1089
- if (self.config.enableSeconds) {
1090
- self.timeContainer.classList.add("hasSeconds");
1091
- var secondInput = createNumberInput("flatpickr-second");
1092
- self.secondElement = secondInput.childNodes[0];
1093
- self.secondElement.value = pad(self.latestSelectedDateObj ? self.latestSelectedDateObj.getSeconds() : self.config.defaultSeconds);
1094
- self.secondElement.setAttribute("data-step", self.minuteElement.getAttribute("data-step"));
1095
- self.secondElement.setAttribute("data-min", self.minuteElement.getAttribute("data-min"));
1096
- self.secondElement.setAttribute("data-max", self.minuteElement.getAttribute("data-max"));
1097
- self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":"));
1098
- self.timeContainer.appendChild(secondInput);
1099
- }
1100
-
1101
- if (!self.config.time_24hr) {
1102
- self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj ? self.hourElement.value : self.config.defaultHour) > 11)]);
1103
- self.amPM.title = self.l10n.toggleTitle;
1104
- self.amPM.tabIndex = -1;
1105
- self.timeContainer.appendChild(self.amPM);
1106
- }
1107
-
1108
- return self.timeContainer;
1109
- }
1110
-
1111
- function buildWeekdays() {
1112
- if (!self.weekdayContainer) self.weekdayContainer = createElement("div", "flatpickr-weekdays");else clearNode(self.weekdayContainer);
1113
-
1114
- for (var i = self.config.showMonths; i--;) {
1115
- var container = createElement("div", "flatpickr-weekdaycontainer");
1116
- self.weekdayContainer.appendChild(container);
1117
- }
1118
-
1119
- updateWeekdays();
1120
- return self.weekdayContainer;
1121
- }
1122
-
1123
- function updateWeekdays() {
1124
- var firstDayOfWeek = self.l10n.firstDayOfWeek;
1125
- var weekdays = self.l10n.weekdays.shorthand.concat();
1126
-
1127
- if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {
1128
- weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek));
1129
- }
1130
-
1131
- for (var i = self.config.showMonths; i--;) {
1132
- self.weekdayContainer.children[i].innerHTML = "\n <span class=flatpickr-weekday>\n " + weekdays.join("</span><span class=flatpickr-weekday>") + "\n </span>\n ";
1133
- }
1134
- }
1135
-
1136
- function buildWeeks() {
1137
- self.calendarContainer.classList.add("hasWeeks");
1138
- var weekWrapper = createElement("div", "flatpickr-weekwrapper");
1139
- weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
1140
- var weekNumbers = createElement("div", "flatpickr-weeks");
1141
- weekWrapper.appendChild(weekNumbers);
1142
- return {
1143
- weekWrapper: weekWrapper,
1144
- weekNumbers: weekNumbers
1145
- };
1146
- }
1147
-
1148
- function changeMonth(value, is_offset) {
1149
- if (is_offset === void 0) {
1150
- is_offset = true;
1151
- }
1152
-
1153
- var delta = is_offset ? value : value - self.currentMonth;
1154
- if (delta < 0 && self._hidePrevMonthArrow === true || delta > 0 && self._hideNextMonthArrow === true) return;
1155
- self.currentMonth += delta;
1156
-
1157
- if (self.currentMonth < 0 || self.currentMonth > 11) {
1158
- self.currentYear += self.currentMonth > 11 ? 1 : -1;
1159
- self.currentMonth = (self.currentMonth + 12) % 12;
1160
- triggerEvent("onYearChange");
1161
- }
1162
-
1163
- buildDays();
1164
- triggerEvent("onMonthChange");
1165
- updateNavigationCurrentMonth();
1166
- }
1167
-
1168
- function clear(triggerChangeEvent) {
1169
- if (triggerChangeEvent === void 0) {
1170
- triggerChangeEvent = true;
1171
- }
1172
-
1173
- self.input.value = "";
1174
- if (self.altInput !== undefined) self.altInput.value = "";
1175
- if (self.mobileInput !== undefined) self.mobileInput.value = "";
1176
- self.selectedDates = [];
1177
- self.latestSelectedDateObj = undefined;
1178
- self.showTimeInput = false;
1179
-
1180
- if (self.config.enableTime === true) {
1181
- setDefaultHours();
1182
- }
1183
-
1184
- self.redraw();
1185
- if (triggerChangeEvent) triggerEvent("onChange");
1186
- }
1187
-
1188
- function close() {
1189
- self.isOpen = false;
1190
-
1191
- if (!self.isMobile) {
1192
- self.calendarContainer.classList.remove("open");
1193
-
1194
- self._input.classList.remove("active");
1195
- }
1196
-
1197
- triggerEvent("onClose");
1198
- }
1199
-
1200
- function destroy() {
1201
- if (self.config !== undefined) triggerEvent("onDestroy");
1202
-
1203
- for (var i = self._handlers.length; i--;) {
1204
- var h = self._handlers[i];
1205
- h.element.removeEventListener(h.event, h.handler, h.options);
1206
- }
1207
-
1208
- self._handlers = [];
1209
-
1210
- if (self.mobileInput) {
1211
- if (self.mobileInput.parentNode) self.mobileInput.parentNode.removeChild(self.mobileInput);
1212
- self.mobileInput = undefined;
1213
- } else if (self.calendarContainer && self.calendarContainer.parentNode) {
1214
- if (self.config.static && self.calendarContainer.parentNode) {
1215
- var wrapper = self.calendarContainer.parentNode;
1216
- wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);
1217
-
1218
- while (wrapper.firstChild) {
1219
- wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);
1220
  }
1221
-
1222
- wrapper.parentNode.removeChild(wrapper);
1223
- } else self.calendarContainer.parentNode.removeChild(self.calendarContainer);
1224
- }
1225
-
1226
- if (self.altInput) {
1227
- self.input.type = "text";
1228
- if (self.altInput.parentNode) self.altInput.parentNode.removeChild(self.altInput);
1229
- delete self.altInput;
1230
- }
1231
-
1232
- if (self.input) {
1233
- self.input.type = self.input._type;
1234
- self.input.classList.remove("flatpickr-input");
1235
- self.input.removeAttribute("readonly");
1236
- self.input.value = "";
1237
- }
1238
-
1239
- ["_showTimeInput", "latestSelectedDateObj", "_hideNextMonthArrow", "_hidePrevMonthArrow", "__hideNextMonthArrow", "__hidePrevMonthArrow", "isMobile", "isOpen", "selectedDateElem", "minDateHasTime", "maxDateHasTime", "days", "daysContainer", "_input", "_positionElement", "innerContainer", "rContainer", "monthNav", "todayDateElem", "calendarContainer", "weekdayContainer", "prevMonthNav", "nextMonthNav", "currentMonthElement", "currentYearElement", "navigationCurrentMonth", "selectedDateElem", "config"].forEach(function (k) {
1240
- try {
1241
- delete self[k];
1242
- } catch (_) {}
1243
- });
1244
- }
1245
-
1246
- function isCalendarElem(elem) {
1247
- if (self.config.appendTo && self.config.appendTo.contains(elem)) return true;
1248
- return self.calendarContainer.contains(elem);
1249
- }
1250
-
1251
- function documentClick(e) {
1252
- if (self.isOpen && !self.config.inline) {
1253
- var isCalendarElement = isCalendarElem(e.target);
1254
- var isInput = e.target === self.input || e.target === self.altInput || self.element.contains(e.target) || e.path && e.path.indexOf && (~e.path.indexOf(self.input) || ~e.path.indexOf(self.altInput));
1255
- var lostFocus = e.type === "blur" ? isInput && e.relatedTarget && !isCalendarElem(e.relatedTarget) : !isInput && !isCalendarElement;
1256
- var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {
1257
- return elem.contains(e.target);
1258
- });
1259
-
1260
- if (lostFocus && isIgnored) {
1261
- self.close();
1262
-
1263
- if (self.config.mode === "range" && self.selectedDates.length === 1) {
1264
- self.clear(false);
1265
- self.redraw();
1266
  }
1267
- }
1268
  }
1269
- }
1270
-
1271
- function changeYear(newYear) {
1272
- if (!newYear || self.config.minDate && newYear < self.config.minDate.getFullYear() || self.config.maxDate && newYear > self.config.maxDate.getFullYear()) return;
1273
- var newYearNum = newYear,
1274
- isNewYear = self.currentYear !== newYearNum;
1275
- self.currentYear = newYearNum || self.currentYear;
1276
-
1277
- if (self.config.maxDate && self.currentYear === self.config.maxDate.getFullYear()) {
1278
- self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);
1279
- } else if (self.config.minDate && self.currentYear === self.config.minDate.getFullYear()) {
1280
- self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);
1281
- }
1282
-
1283
- if (isNewYear) {
1284
- self.redraw();
1285
- triggerEvent("onYearChange");
1286
- }
1287
- }
1288
-
1289
- function isEnabled(date, timeless) {
1290
- if (timeless === void 0) {
1291
- timeless = true;
1292
- }
1293
-
1294
- var dateToCheck = self.parseDate(date, undefined, timeless);
1295
- if (self.config.minDate && dateToCheck && compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0 || self.config.maxDate && dateToCheck && compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0) return false;
1296
- if (self.config.enable.length === 0 && self.config.disable.length === 0) return true;
1297
- if (dateToCheck === undefined) return false;
1298
- var bool = self.config.enable.length > 0,
1299
- array = bool ? self.config.enable : self.config.disable;
1300
-
1301
- for (var i = 0, d; i < array.length; i++) {
1302
- d = array[i];
1303
- if (typeof d === "function" && d(dateToCheck)) return bool;else if (d instanceof Date && dateToCheck !== undefined && d.getTime() === dateToCheck.getTime()) return bool;else if (typeof d === "string" && dateToCheck !== undefined) {
1304
- var parsed = self.parseDate(d, undefined, true);
1305
- return parsed && parsed.getTime() === dateToCheck.getTime() ? bool : !bool;
1306
- } else if (typeof d === "object" && dateToCheck !== undefined && d.from && d.to && dateToCheck.getTime() >= d.from.getTime() && dateToCheck.getTime() <= d.to.getTime()) return bool;
1307
- }
1308
-
1309
- return !bool;
1310
- }
1311
-
1312
- function isInView(elem) {
1313
- if (self.daysContainer !== undefined) return elem.className.indexOf("hidden") === -1 && self.daysContainer.contains(elem);
1314
- return false;
1315
- }
1316
-
1317
- function onKeyDown(e) {
1318
- var isInput = e.target === self._input;
1319
- var allowInput = self.config.allowInput;
1320
- var allowKeydown = self.isOpen && (!allowInput || !isInput);
1321
- var allowInlineKeydown = self.config.inline && isInput && !allowInput;
1322
-
1323
- if (e.keyCode === 13 && isInput) {
1324
- if (allowInput) {
1325
- self.setDate(self._input.value, true, e.target === self.altInput ? self.config.altFormat : self.config.dateFormat);
1326
- return e.target.blur();
1327
- } else self.open();
1328
- } else if (isCalendarElem(e.target) || allowKeydown || allowInlineKeydown) {
1329
- var isTimeObj = !!self.timeContainer && self.timeContainer.contains(e.target);
1330
-
1331
- switch (e.keyCode) {
1332
- case 13:
1333
- if (isTimeObj) updateTime();else selectDate(e);
1334
- break;
1335
-
1336
- case 27:
1337
- e.preventDefault();
1338
- focusAndClose();
1339
- break;
1340
-
1341
- case 8:
1342
- case 46:
1343
- if (isInput && !self.config.allowInput) {
1344
- e.preventDefault();
1345
- self.clear();
1346
- }
1347
-
1348
- break;
1349
-
1350
- case 37:
1351
- case 39:
1352
- if (!isTimeObj) {
1353
- e.preventDefault();
1354
-
1355
- if (self.daysContainer !== undefined && (allowInput === false || isInView(document.activeElement))) {
1356
- var _delta = e.keyCode === 39 ? 1 : -1;
1357
-
1358
- if (!e.ctrlKey) focusOnDay(undefined, _delta);else {
1359
- changeMonth(_delta);
1360
- focusOnDay(getFirstAvailableDay(1), 0);
1361
- }
1362
  }
1363
- } else if (self.hourElement) self.hourElement.focus();
1364
-
1365
- break;
1366
-
1367
- case 38:
1368
- case 40:
1369
- e.preventDefault();
1370
- var delta = e.keyCode === 40 ? 1 : -1;
1371
-
1372
- if (self.daysContainer) {
1373
- if (e.ctrlKey) {
1374
- changeYear(self.currentYear - delta);
1375
- focusOnDay(getFirstAvailableDay(1), 0);
1376
- } else if (!isTimeObj) focusOnDay(undefined, delta * 7);
1377
- } else if (self.config.enableTime) {
1378
- if (!isTimeObj && self.hourElement) self.hourElement.focus();
1379
- updateTime(e);
1380
-
1381
- self._debouncedChange();
1382
- }
1383
-
1384
- break;
1385
-
1386
- case 9:
1387
- if (!isTimeObj) break;
1388
- var elems = [self.hourElement, self.minuteElement, self.secondElement, self.amPM].filter(function (x) {
1389
- return x;
1390
- });
1391
- var i = elems.indexOf(e.target);
1392
-
1393
- if (i !== -1) {
1394
- var target = elems[i + (e.shiftKey ? -1 : 1)];
1395
-
1396
- if (target !== undefined) {
1397
- e.preventDefault();
1398
- target.focus();
 
 
 
 
 
 
 
1399
  }
1400
- }
1401
-
1402
- break;
1403
-
1404
- default:
1405
- break;
1406
- }
1407
- }
1408
-
1409
- if (self.amPM !== undefined && e.target === self.amPM) {
1410
- switch (e.key) {
1411
- case self.l10n.amPM[0].charAt(0):
1412
- case self.l10n.amPM[0].charAt(0).toLowerCase():
1413
- self.amPM.textContent = self.l10n.amPM[0];
1414
- setHoursFromInputs();
1415
- updateValue();
1416
- break;
1417
-
1418
- case self.l10n.amPM[1].charAt(0):
1419
- case self.l10n.amPM[1].charAt(0).toLowerCase():
1420
- self.amPM.textContent = self.l10n.amPM[1];
1421
- setHoursFromInputs();
1422
- updateValue();
1423
- break;
1424
- }
1425
- }
1426
-
1427
- triggerEvent("onKeyDown", e);
1428
- }
1429
-
1430
- function onMouseOver(elem) {
1431
- if (self.selectedDates.length !== 1 || elem && (!elem.classList.contains("flatpickr-day") || elem.classList.contains("disabled"))) return;
1432
- var hoverDate = elem ? elem.dateObj.getTime() : self.days.firstElementChild.dateObj.getTime(),
1433
- initialDate = self.parseDate(self.selectedDates[0], undefined, true).getTime(),
1434
- rangeStartDate = Math.min(hoverDate, self.selectedDates[0].getTime()),
1435
- rangeEndDate = Math.max(hoverDate, self.selectedDates[0].getTime()),
1436
- lastDate = self.daysContainer.lastChild.lastChild.dateObj.getTime();
1437
- var containsDisabled = false;
1438
- var minRange = 0,
1439
- maxRange = 0;
1440
-
1441
- for (var t = rangeStartDate; t < lastDate; t += duration.DAY) {
1442
- if (!isEnabled(new Date(t), true)) {
1443
- containsDisabled = containsDisabled || t > rangeStartDate && t < rangeEndDate;
1444
- if (t < initialDate && (!minRange || t > minRange)) minRange = t;else if (t > initialDate && (!maxRange || t < maxRange)) maxRange = t;
1445
- }
1446
- }
1447
-
1448
- for (var m = 0; m < self.config.showMonths; m++) {
1449
- var month = self.daysContainer.children[m];
1450
- var prevMonth = self.daysContainer.children[m - 1];
1451
-
1452
- var _loop = function _loop(i, l) {
1453
- var dayElem = month.children[i],
1454
- date = dayElem.dateObj;
1455
- var timestamp = date.getTime();
1456
- var outOfRange = minRange > 0 && timestamp < minRange || maxRange > 0 && timestamp > maxRange;
1457
-
1458
- if (outOfRange) {
1459
- dayElem.classList.add("notAllowed");
1460
- ["inRange", "startRange", "endRange"].forEach(function (c) {
1461
- dayElem.classList.remove(c);
1462
- });
1463
- return "continue";
1464
- } else if (containsDisabled && !outOfRange) return "continue";
1465
-
1466
- ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) {
1467
- dayElem.classList.remove(c);
1468
  });
1469
-
1470
- if (elem !== undefined) {
1471
- elem.classList.add(hoverDate < self.selectedDates[0].getTime() ? "startRange" : "endRange");
1472
-
1473
- if (month.contains(elem) || !(m > 0 && prevMonth && prevMonth.lastChild.dateObj.getTime() >= timestamp)) {
1474
- if (initialDate < hoverDate && timestamp === initialDate) dayElem.classList.add("startRange");else if (initialDate > hoverDate && timestamp === initialDate) dayElem.classList.add("endRange");
1475
- if (timestamp >= minRange && (maxRange === 0 || timestamp <= maxRange) && isBetween(timestamp, initialDate, hoverDate)) dayElem.classList.add("inRange");
1476
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1477
  }
1478
- };
1479
-
1480
- for (var i = 0, l = month.children.length; i < l; i++) {
1481
- var _ret = _loop(i, l);
1482
-
1483
- if (_ret === "continue") continue;
1484
- }
1485
  }
1486
- }
1487
-
1488
- function onResize() {
1489
- if (self.isOpen && !self.config.static && !self.config.inline) positionCalendar();
1490
- }
1491
-
1492
- function open(e, positionElement) {
1493
- if (positionElement === void 0) {
1494
- positionElement = self._positionElement;
 
 
 
 
 
 
 
1495
  }
1496
-
1497
- if (self.isMobile === true) {
1498
- if (e) {
1499
  e.preventDefault();
1500
- e.target && e.target.blur();
1501
- }
1502
-
1503
- setTimeout(function () {
1504
- self.mobileInput !== undefined && self.mobileInput.focus();
1505
- }, 0);
1506
- triggerEvent("onOpen");
1507
- return;
1508
- }
1509
-
1510
- if (self._input.disabled || self.config.inline) return;
1511
- var wasOpen = self.isOpen;
1512
- self.isOpen = true;
1513
-
1514
- if (!wasOpen) {
1515
- self.calendarContainer.classList.add("open");
1516
-
1517
- self._input.classList.add("active");
1518
-
1519
- triggerEvent("onOpen");
1520
- positionCalendar(positionElement);
1521
- }
1522
-
1523
- if (self.config.enableTime === true && self.config.noCalendar === true) {
1524
- if (self.selectedDates.length === 0) {
1525
- self.setDate(self.config.minDate !== undefined ? new Date(self.config.minDate.getTime()) : new Date(), false);
1526
- setDefaultHours();
1527
- updateValue();
1528
- }
1529
-
1530
- if (self.config.allowInput === false && (e === undefined || !self.timeContainer.contains(e.relatedTarget))) {
1531
- setTimeout(function () {
1532
- return self.hourElement.select();
1533
- }, 50);
1534
- }
1535
- }
1536
- }
1537
-
1538
- function minMaxDateSetter(type) {
1539
- return function (date) {
1540
- var dateObj = self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat);
1541
- var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"];
1542
-
1543
- if (dateObj !== undefined) {
1544
- self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] = dateObj.getHours() > 0 || dateObj.getMinutes() > 0 || dateObj.getSeconds() > 0;
1545
- }
1546
-
1547
- if (self.selectedDates) {
1548
- self.selectedDates = self.selectedDates.filter(function (d) {
1549
- return isEnabled(d);
1550
- });
1551
- if (!self.selectedDates.length && type === "min") setHoursFromDate(dateObj);
1552
  updateValue();
1553
- }
1554
-
1555
- if (self.daysContainer) {
1556
- redraw();
1557
- if (dateObj !== undefined) self.currentYearElement[type] = dateObj.getFullYear().toString();else self.currentYearElement.removeAttribute(type);
1558
- self.currentYearElement.disabled = !!inverseDateObj && dateObj !== undefined && inverseDateObj.getFullYear() === dateObj.getFullYear();
1559
- }
1560
- };
1561
- }
1562
-
1563
- function parseConfig() {
1564
- var boolOpts = ["wrap", "weekNumbers", "allowInput", "clickOpens", "time_24hr", "enableTime", "noCalendar", "altInput", "shorthandCurrentMonth", "inline", "static", "enableSeconds", "disableMobile"];
1565
- var hooks = ["onChange", "onClose", "onDayCreate", "onDestroy", "onKeyDown", "onMonthChange", "onOpen", "onParseConfig", "onReady", "onValueUpdate", "onYearChange", "onPreCalendarPosition"];
1566
- var userConfig = Object.assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));
1567
- var formats$$1 = {};
1568
- self.config.parseDate = userConfig.parseDate;
1569
- self.config.formatDate = userConfig.formatDate;
1570
- Object.defineProperty(self.config, "enable", {
1571
- get: function get() {
1572
- return self.config._enable;
1573
- },
1574
- set: function set(dates) {
1575
- self.config._enable = parseDateRules(dates);
1576
- }
1577
- });
1578
- Object.defineProperty(self.config, "disable", {
1579
- get: function get() {
1580
- return self.config._disable;
1581
- },
1582
- set: function set(dates) {
1583
- self.config._disable = parseDateRules(dates);
1584
- }
1585
- });
1586
- var timeMode = userConfig.mode === "time";
1587
-
1588
- if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {
1589
- formats$$1.dateFormat = userConfig.noCalendar || timeMode ? "H:i" + (userConfig.enableSeconds ? ":S" : "") : flatpickr.defaultConfig.dateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : "");
1590
- }
1591
-
1592
- if (userConfig.altInput && (userConfig.enableTime || timeMode) && !userConfig.altFormat) {
1593
- formats$$1.altFormat = userConfig.noCalendar || timeMode ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K") : flatpickr.defaultConfig.altFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K");
1594
- }
1595
-
1596
- Object.defineProperty(self.config, "minDate", {
1597
- get: function get() {
1598
- return self.config._minDate;
1599
- },
1600
- set: minMaxDateSetter("min")
1601
- });
1602
- Object.defineProperty(self.config, "maxDate", {
1603
- get: function get() {
1604
- return self.config._maxDate;
1605
- },
1606
- set: minMaxDateSetter("max")
1607
- });
1608
-
1609
- var minMaxTimeSetter = function minMaxTimeSetter(type) {
1610
- return function (val) {
1611
- self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i");
1612
- };
1613
- };
1614
-
1615
- Object.defineProperty(self.config, "minTime", {
1616
- get: function get() {
1617
- return self.config._minTime;
1618
- },
1619
- set: minMaxTimeSetter("min")
1620
- });
1621
- Object.defineProperty(self.config, "maxTime", {
1622
- get: function get() {
1623
- return self.config._maxTime;
1624
- },
1625
- set: minMaxTimeSetter("max")
1626
- });
1627
-
1628
- if (userConfig.mode === "time") {
1629
- self.config.noCalendar = true;
1630
- self.config.enableTime = true;
1631
- }
1632
-
1633
- Object.assign(self.config, formats$$1, userConfig);
1634
-
1635
- for (var i = 0; i < boolOpts.length; i++) {
1636
- self.config[boolOpts[i]] = self.config[boolOpts[i]] === true || self.config[boolOpts[i]] === "true";
1637
- }
1638
-
1639
- for (var _i = hooks.length; _i--;) {
1640
- if (self.config[hooks[_i]] !== undefined) {
1641
- self.config[hooks[_i]] = arrayify(self.config[hooks[_i]] || []).map(bindToInstance);
1642
- }
1643
- }
1644
-
1645
- self.isMobile = !self.config.disableMobile && !self.config.inline && self.config.mode === "single" && !self.config.disable.length && !self.config.enable.length && !self.config.weekNumbers && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1646
-
1647
- for (var _i2 = 0; _i2 < self.config.plugins.length; _i2++) {
1648
- var pluginConf = self.config.plugins[_i2](self) || {};
1649
-
1650
- for (var key in pluginConf) {
1651
- if (~hooks.indexOf(key)) {
1652
- self.config[key] = arrayify(pluginConf[key]).map(bindToInstance).concat(self.config[key]);
1653
- } else if (typeof userConfig[key] === "undefined") self.config[key] = pluginConf[key];
1654
- }
1655
- }
1656
-
1657
- triggerEvent("onParseConfig");
1658
- }
1659
-
1660
- function setupLocale() {
1661
- if (typeof self.config.locale !== "object" && typeof flatpickr.l10ns[self.config.locale] === "undefined") self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale));
1662
- self.l10n = Object.assign({}, flatpickr.l10ns.default, typeof self.config.locale === "object" ? self.config.locale : self.config.locale !== "default" ? flatpickr.l10ns[self.config.locale] : undefined);
1663
- tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")";
1664
- self.formatDate = createDateFormatter(self);
1665
- self.parseDate = createDateParser({
1666
- config: self.config,
1667
- l10n: self.l10n
1668
- });
1669
- }
1670
-
1671
- function positionCalendar(customPositionElement) {
1672
- if (self.calendarContainer === undefined) return;
1673
- triggerEvent("onPreCalendarPosition");
1674
- var positionElement = customPositionElement || self._positionElement;
1675
- var calendarHeight = Array.prototype.reduce.call(self.calendarContainer.children, function (acc, child) {
1676
- return acc + child.offsetHeight;
1677
- }, 0),
1678
- calendarWidth = self.calendarContainer.offsetWidth,
1679
- configPos = self.config.position.split(" "),
1680
- configPosVertical = configPos[0],
1681
- configPosHorizontal = configPos.length > 1 ? configPos[1] : null,
1682
- inputBounds = positionElement.getBoundingClientRect(),
1683
- distanceFromBottom = window.innerHeight - inputBounds.bottom,
1684
- showOnTop = configPosVertical === "above" || configPosVertical !== "below" && distanceFromBottom < calendarHeight && inputBounds.top > calendarHeight;
1685
- var top = window.pageYOffset + inputBounds.top + (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);
1686
- toggleClass(self.calendarContainer, "arrowTop", !showOnTop);
1687
- toggleClass(self.calendarContainer, "arrowBottom", showOnTop);
1688
- if (self.config.inline) return;
1689
- var left = window.pageXOffset + inputBounds.left - (configPosHorizontal != null && configPosHorizontal === "center" ? (calendarWidth - inputBounds.width) / 2 : 0);
1690
- var right = window.document.body.offsetWidth - inputBounds.right;
1691
- var rightMost = left + calendarWidth > window.document.body.offsetWidth;
1692
- toggleClass(self.calendarContainer, "rightMost", rightMost);
1693
- if (self.config.static) return;
1694
- self.calendarContainer.style.top = top + "px";
1695
-
1696
- if (!rightMost) {
1697
- self.calendarContainer.style.left = left + "px";
1698
- self.calendarContainer.style.right = "auto";
1699
- } else {
1700
- self.calendarContainer.style.left = "auto";
1701
- self.calendarContainer.style.right = right + "px";
1702
- }
1703
- }
1704
-
1705
- function redraw() {
1706
- if (self.config.noCalendar || self.isMobile) return;
1707
- updateNavigationCurrentMonth();
1708
- buildDays();
1709
- }
1710
-
1711
- function focusAndClose() {
1712
- self._input.focus();
1713
-
1714
- if (window.navigator.userAgent.indexOf("MSIE") !== -1 || navigator.msMaxTouchPoints !== undefined) {
1715
- setTimeout(self.close, 0);
1716
- } else {
1717
- self.close();
1718
  }
1719
- }
1720
-
1721
- function selectDate(e) {
1722
- e.preventDefault();
1723
- e.stopPropagation();
1724
-
1725
- var isSelectable = function isSelectable(day) {
1726
- return day.classList && day.classList.contains("flatpickr-day") && !day.classList.contains("disabled") && !day.classList.contains("notAllowed");
1727
  };
1728
-
1729
- var t = findParent(e.target, isSelectable);
1730
- if (t === undefined) return;
1731
- var target = t;
1732
- var selectedDate = self.latestSelectedDateObj = new Date(target.dateObj.getTime());
1733
- var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth || selectedDate.getMonth() > self.currentMonth + self.config.showMonths - 1) && self.config.mode !== "range";
1734
- self.selectedDateElem = target;
1735
- if (self.config.mode === "single") self.selectedDates = [selectedDate];else if (self.config.mode === "multiple") {
1736
- var selectedIndex = isDateSelected(selectedDate);
1737
- if (selectedIndex) self.selectedDates.splice(parseInt(selectedIndex), 1);else self.selectedDates.push(selectedDate);
1738
- } else if (self.config.mode === "range") {
1739
- if (self.selectedDates.length === 2) self.clear(false);
1740
- self.selectedDates.push(selectedDate);
1741
- if (compareDates(selectedDate, self.selectedDates[0], true) !== 0) self.selectedDates.sort(function (a, b) {
1742
- return a.getTime() - b.getTime();
1743
- });
1744
- }
1745
- setHoursFromInputs();
1746
-
1747
- if (shouldChangeMonth) {
1748
- var isNewYear = self.currentYear !== selectedDate.getFullYear();
1749
- self.currentYear = selectedDate.getFullYear();
1750
- self.currentMonth = selectedDate.getMonth();
1751
- if (isNewYear) triggerEvent("onYearChange");
1752
- triggerEvent("onMonthChange");
1753
- }
1754
-
1755
- updateNavigationCurrentMonth();
1756
- buildDays();
1757
- updateValue();
1758
- if (self.config.enableTime) setTimeout(function () {
1759
- return self.showTimeInput = true;
1760
- }, 50);
1761
- if (!shouldChangeMonth && self.config.mode !== "range" && self.config.showMonths === 1) focusOnDayElem(target);else self.selectedDateElem && self.selectedDateElem.focus();
1762
- if (self.hourElement !== undefined) setTimeout(function () {
1763
- return self.hourElement !== undefined && self.hourElement.select();
1764
- }, 451);
1765
-
1766
- if (self.config.closeOnSelect) {
1767
- var single = self.config.mode === "single" && !self.config.enableTime;
1768
- var range = self.config.mode === "range" && self.selectedDates.length === 2 && !self.config.enableTime;
1769
-
1770
- if (single || range) {
1771
- focusAndClose();
1772
- }
1773
- }
1774
-
1775
- triggerChange();
1776
- }
1777
-
1778
- var CALLBACKS = {
1779
- locale: [setupLocale, updateWeekdays],
1780
- showMonths: [buildMonths, setCalendarWidth, buildWeekdays]
1781
- };
1782
-
1783
- function set(option, value) {
1784
- if (option !== null && typeof option === "object") Object.assign(self.config, option);else {
1785
- self.config[option] = value;
1786
- if (CALLBACKS[option] !== undefined) CALLBACKS[option].forEach(function (x) {
1787
- return x();
1788
- });
1789
- }
1790
- self.redraw();
1791
- jumpToDate();
1792
- }
1793
-
1794
- function setSelectedDate(inputDate, format) {
1795
- var dates = [];
1796
- if (inputDate instanceof Array) dates = inputDate.map(function (d) {
1797
- return self.parseDate(d, format);
1798
- });else if (inputDate instanceof Date || typeof inputDate === "number") dates = [self.parseDate(inputDate, format)];else if (typeof inputDate === "string") {
1799
- switch (self.config.mode) {
1800
- case "single":
1801
- case "time":
1802
- dates = [self.parseDate(inputDate, format)];
1803
- break;
1804
-
1805
- case "multiple":
1806
- dates = inputDate.split(self.config.conjunction).map(function (date) {
1807
- return self.parseDate(date, format);
1808
- });
1809
- break;
1810
-
1811
- case "range":
1812
- dates = inputDate.split(self.l10n.rangeSeparator).map(function (date) {
1813
- return self.parseDate(date, format);
1814
- });
1815
- break;
1816
-
1817
- default:
1818
- break;
1819
- }
1820
- } else self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate)));
1821
- self.selectedDates = dates.filter(function (d) {
1822
- return d instanceof Date && isEnabled(d, false);
1823
- });
1824
- if (self.config.mode === "range") self.selectedDates.sort(function (a, b) {
1825
- return a.getTime() - b.getTime();
1826
- });
1827
- }
1828
-
1829
- function setDate(date, triggerChange, format) {
1830
- if (triggerChange === void 0) {
1831
- triggerChange = false;
1832
- }
1833
-
1834
- if (format === void 0) {
1835
- format = self.config.dateFormat;
1836
- }
1837
-
1838
- if (date !== 0 && !date || date instanceof Array && date.length === 0) return self.clear(triggerChange);
1839
- setSelectedDate(date, format);
1840
- self.showTimeInput = self.selectedDates.length > 0;
1841
- self.latestSelectedDateObj = self.selectedDates[0];
1842
- self.redraw();
1843
- jumpToDate();
1844
- setHoursFromDate();
1845
- updateValue(triggerChange);
1846
- if (triggerChange) triggerEvent("onChange");
1847
- }
1848
-
1849
- function parseDateRules(arr) {
1850
- return arr.slice().map(function (rule) {
1851
- if (typeof rule === "string" || typeof rule === "number" || rule instanceof Date) {
1852
- return self.parseDate(rule, undefined, true);
1853
- } else if (rule && typeof rule === "object" && rule.from && rule.to) return {
1854
- from: self.parseDate(rule.from, undefined),
1855
- to: self.parseDate(rule.to, undefined)
1856
- };
1857
-
1858
- return rule;
1859
- }).filter(function (x) {
1860
- return x;
1861
- });
1862
- }
1863
-
1864
- function setupDates() {
1865
- self.selectedDates = [];
1866
- self.now = self.parseDate(self.config.now) || new Date();
1867
- var preloadedDate = self.config.defaultDate || ((self.input.nodeName === "INPUT" || self.input.nodeName === "TEXTAREA") && self.input.placeholder && self.input.value === self.input.placeholder ? null : self.input.value);
1868
- if (preloadedDate) setSelectedDate(preloadedDate, self.config.dateFormat);
1869
- var initialDate = self.selectedDates.length > 0 ? self.selectedDates[0] : self.config.minDate && self.config.minDate.getTime() > self.now.getTime() ? self.config.minDate : self.config.maxDate && self.config.maxDate.getTime() < self.now.getTime() ? self.config.maxDate : self.now;
1870
- self.currentYear = initialDate.getFullYear();
1871
- self.currentMonth = initialDate.getMonth();
1872
- if (self.selectedDates.length > 0) self.latestSelectedDateObj = self.selectedDates[0];
1873
- if (self.config.minTime !== undefined) self.config.minTime = self.parseDate(self.config.minTime, "H:i");
1874
- if (self.config.maxTime !== undefined) self.config.maxTime = self.parseDate(self.config.maxTime, "H:i");
1875
- self.minDateHasTime = !!self.config.minDate && (self.config.minDate.getHours() > 0 || self.config.minDate.getMinutes() > 0 || self.config.minDate.getSeconds() > 0);
1876
- self.maxDateHasTime = !!self.config.maxDate && (self.config.maxDate.getHours() > 0 || self.config.maxDate.getMinutes() > 0 || self.config.maxDate.getSeconds() > 0);
1877
- Object.defineProperty(self, "showTimeInput", {
1878
- get: function get() {
1879
- return self._showTimeInput;
1880
- },
1881
- set: function set(bool) {
1882
- self._showTimeInput = bool;
1883
- if (self.calendarContainer) toggleClass(self.calendarContainer, "showTimeInput", bool);
1884
- self.isOpen && positionCalendar();
1885
- }
1886
- });
1887
- }
1888
-
1889
- function setupInputs() {
1890
- self.input = self.config.wrap ? element.querySelector("[data-input]") : element;
1891
-
1892
- if (!self.input) {
1893
- self.config.errorHandler(new Error("Invalid input element specified"));
1894
- return;
1895
- }
1896
-
1897
- self.input._type = self.input.type;
1898
- self.input.type = "text";
1899
- self.input.classList.add("flatpickr-input");
1900
- self._input = self.input;
1901
-
1902
- if (self.config.altInput) {
1903
- self.altInput = createElement(self.input.nodeName, self.input.className + " " + self.config.altInputClass);
1904
- self._input = self.altInput;
1905
- self.altInput.placeholder = self.input.placeholder;
1906
- self.altInput.disabled = self.input.disabled;
1907
- self.altInput.required = self.input.required;
1908
- self.altInput.tabIndex = self.input.tabIndex;
1909
- self.altInput.type = "text";
1910
- self.input.setAttribute("type", "hidden");
1911
- if (!self.config.static && self.input.parentNode) self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);
1912
- }
1913
-
1914
- if (!self.config.allowInput) self._input.setAttribute("readonly", "readonly");
1915
- self._positionElement = self.config.positionElement || self._input;
1916
- }
1917
-
1918
- function setupMobile() {
1919
- var inputType = self.config.enableTime ? self.config.noCalendar ? "time" : "datetime-local" : "date";
1920
- self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile");
1921
- self.mobileInput.step = self.input.getAttribute("step") || "any";
1922
- self.mobileInput.tabIndex = 1;
1923
- self.mobileInput.type = inputType;
1924
- self.mobileInput.disabled = self.input.disabled;
1925
- self.mobileInput.required = self.input.required;
1926
- self.mobileInput.placeholder = self.input.placeholder;
1927
- self.mobileFormatStr = inputType === "datetime-local" ? "Y-m-d\\TH:i:S" : inputType === "date" ? "Y-m-d" : "H:i:S";
1928
-
1929
- if (self.selectedDates.length > 0) {
1930
- self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);
1931
- }
1932
-
1933
- if (self.config.minDate) self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d");
1934
- if (self.config.maxDate) self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d");
1935
- self.input.type = "hidden";
1936
- if (self.altInput !== undefined) self.altInput.type = "hidden";
1937
-
1938
- try {
1939
- if (self.input.parentNode) self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);
1940
- } catch (_a) {}
1941
-
1942
- bind(self.mobileInput, "change", function (e) {
1943
- self.setDate(e.target.value, false, self.mobileFormatStr);
1944
- triggerEvent("onChange");
1945
- triggerEvent("onClose");
1946
- });
1947
- }
1948
-
1949
- function toggle(e) {
1950
- if (self.isOpen === true) return self.close();
1951
- self.open(e);
1952
- }
1953
-
1954
- function triggerEvent(event, data) {
1955
- var hooks = self.config[event];
1956
-
1957
- if (hooks !== undefined && hooks.length > 0) {
1958
- for (var i = 0; hooks[i] && i < hooks.length; i++) {
1959
- hooks[i](self.selectedDates, self.input.value, self, data);
1960
- }
1961
- }
1962
-
1963
- if (event === "onChange") {
1964
- self.input.dispatchEvent(createEvent("change"));
1965
- self.input.dispatchEvent(createEvent("input"));
1966
- }
1967
- }
1968
-
1969
- function createEvent(name) {
1970
- var e = document.createEvent("Event");
1971
- e.initEvent(name, true, true);
1972
- return e;
1973
- }
1974
-
1975
- function isDateSelected(date) {
1976
- for (var i = 0; i < self.selectedDates.length; i++) {
1977
- if (compareDates(self.selectedDates[i], date) === 0) return "" + i;
1978
  }
1979
-
1980
- return false;
1981
- }
1982
-
1983
- function isDateInRange(date) {
1984
- if (self.config.mode !== "range" || self.selectedDates.length < 2) return false;
1985
- return compareDates(date, self.selectedDates[0]) >= 0 && compareDates(date, self.selectedDates[1]) <= 0;
1986
- }
1987
-
1988
- function updateNavigationCurrentMonth() {
1989
- if (self.config.noCalendar || self.isMobile || !self.monthNav) return;
1990
- self.yearElements.forEach(function (yearElement, i) {
1991
- var d = new Date(self.currentYear, self.currentMonth, 1);
1992
- d.setMonth(self.currentMonth + i);
1993
- self.monthElements[i].textContent = monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " ";
1994
- yearElement.value = d.getFullYear().toString();
1995
- });
1996
- self._hidePrevMonthArrow = self.config.minDate !== undefined && (self.currentYear === self.config.minDate.getFullYear() ? self.currentMonth <= self.config.minDate.getMonth() : self.currentYear < self.config.minDate.getFullYear());
1997
- self._hideNextMonthArrow = self.config.maxDate !== undefined && (self.currentYear === self.config.maxDate.getFullYear() ? self.currentMonth + 1 > self.config.maxDate.getMonth() : self.currentYear > self.config.maxDate.getFullYear());
1998
- }
1999
-
2000
- function updateValue(triggerChange) {
2001
- if (triggerChange === void 0) {
2002
- triggerChange = true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2003
  }
2004
-
2005
- if (self.selectedDates.length === 0) return self.clear(triggerChange);
2006
-
2007
- if (self.mobileInput !== undefined && self.mobileFormatStr) {
2008
- self.mobileInput.value = self.latestSelectedDateObj !== undefined ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr) : "";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2009
  }
2010
-
2011
- var joinChar = self.config.mode !== "range" ? self.config.conjunction : self.l10n.rangeSeparator;
2012
- self.input.value = self.selectedDates.map(function (dObj) {
2013
- return self.formatDate(dObj, self.config.dateFormat);
2014
- }).join(joinChar);
2015
-
2016
- if (self.altInput !== undefined) {
2017
- self.altInput.value = self.selectedDates.map(function (dObj) {
2018
- return self.formatDate(dObj, self.config.altFormat);
2019
- }).join(joinChar);
2020
  }
2021
-
2022
- if (triggerChange !== false) triggerEvent("onValueUpdate");
2023
- }
2024
-
2025
- function onMonthNavClick(e) {
2026
- e.preventDefault();
2027
- var isPrevMonth = self.prevMonthNav.contains(e.target);
2028
- var isNextMonth = self.nextMonthNav.contains(e.target);
2029
-
2030
- if (isPrevMonth || isNextMonth) {
2031
- changeMonth(isPrevMonth ? -1 : 1);
2032
- } else if (self.yearElements.indexOf(e.target) >= 0) {
2033
- e.target.select();
2034
- } else if (e.target.classList.contains("arrowUp")) {
2035
- self.changeYear(self.currentYear + 1);
2036
- } else if (e.target.classList.contains("arrowDown")) {
2037
- self.changeYear(self.currentYear - 1);
2038
- }
2039
- }
2040
-
2041
- function timeWrapper(e) {
2042
- e.preventDefault();
2043
- var isKeyDown = e.type === "keydown",
2044
- input = e.target;
2045
-
2046
- if (self.amPM !== undefined && e.target === self.amPM) {
2047
- self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2048
  }
2049
-
2050
- var min = parseFloat(input.getAttribute("data-min")),
2051
- max = parseFloat(input.getAttribute("data-max")),
2052
- step = parseFloat(input.getAttribute("data-step")),
2053
- curValue = parseInt(input.value, 10),
2054
- delta = e.delta || (isKeyDown ? e.which === 38 ? 1 : -1 : 0);
2055
- var newValue = curValue + step * delta;
2056
-
2057
- if (typeof input.value !== "undefined" && input.value.length === 2) {
2058
- var isHourElem = input === self.hourElement,
2059
- isMinuteElem = input === self.minuteElement;
2060
-
2061
- if (newValue < min) {
2062
- newValue = max + newValue + int(!isHourElem) + (int(isHourElem) && int(!self.amPM));
2063
- if (isMinuteElem) incrementNumInput(undefined, -1, self.hourElement);
2064
- } else if (newValue > max) {
2065
- newValue = input === self.hourElement ? newValue - max - int(!self.amPM) : min;
2066
- if (isMinuteElem) incrementNumInput(undefined, 1, self.hourElement);
2067
- }
2068
-
2069
- if (self.amPM && isHourElem && (step === 1 ? newValue + curValue === 23 : Math.abs(newValue - curValue) > step)) {
2070
- self.amPM.textContent = self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
2071
- }
2072
-
2073
- input.value = pad(newValue);
 
 
 
 
 
 
 
 
 
 
 
 
2074
  }
2075
- }
2076
-
2077
- init();
2078
- return self;
2079
  }
2080
-
2081
  function _flatpickr(nodeList, config) {
2082
- var nodes = Array.prototype.slice.call(nodeList);
2083
- var instances = [];
2084
-
2085
- for (var i = 0; i < nodes.length; i++) {
2086
- var node = nodes[i];
2087
-
2088
- try {
2089
- if (node.getAttribute("data-fp-omit") !== null) continue;
2090
-
2091
- if (node._flatpickr !== undefined) {
2092
- node._flatpickr.destroy();
2093
-
2094
- node._flatpickr = undefined;
2095
- }
2096
-
2097
- node._flatpickr = FlatpickrInstance(node, config || {});
2098
- instances.push(node._flatpickr);
2099
- } catch (e) {
2100
- console.error(e);
 
2101
  }
2102
- }
2103
-
2104
- return instances.length === 1 ? instances[0] : instances;
2105
  }
2106
-
2107
- if (typeof HTMLElement !== "undefined") {
2108
- HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {
2109
- return _flatpickr(this, config);
2110
- };
2111
-
2112
- HTMLElement.prototype.flatpickr = function (config) {
2113
- return _flatpickr([this], config);
2114
- };
 
 
2115
  }
2116
-
2117
- var flatpickr = function flatpickr(selector, config) {
2118
- if (selector instanceof NodeList) return _flatpickr(selector, config);else if (typeof selector === "string") return _flatpickr(window.document.querySelectorAll(selector), config);
2119
- return _flatpickr([selector], config);
 
 
 
 
 
 
 
2120
  };
2121
-
2122
- flatpickr.defaultConfig = defaults;
2123
  flatpickr.l10ns = {
2124
- en: Object.assign({}, english),
2125
- default: Object.assign({}, english)
2126
  };
2127
-
2128
  flatpickr.localize = function (l10n) {
2129
- flatpickr.l10ns.default = Object.assign({}, flatpickr.l10ns.default, l10n);
2130
  };
2131
-
2132
  flatpickr.setDefaults = function (config) {
2133
- flatpickr.defaultConfig = Object.assign({}, flatpickr.defaultConfig, config);
2134
  };
2135
-
2136
  flatpickr.parseDate = createDateParser({});
2137
  flatpickr.formatDate = createDateFormatter({});
2138
  flatpickr.compareDates = compareDates;
2139
-
2140
- if (typeof jQuery !== "undefined") {
2141
- jQuery.fn.flatpickr = function (config) {
2142
- return _flatpickr(this, config);
2143
- };
2144
  }
2145
-
2146
  Date.prototype.fp_incr = function (days) {
2147
- return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days));
2148
  };
2149
-
2150
  if (typeof window !== "undefined") {
2151
- window.flatpickr = flatpickr;
2152
  }
2153
 
2154
  return flatpickr;
2155
 
2156
- })));
1
+ /* flatpickr v4.6.3, @license MIT */
2
  (function (global, factory) {
3
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
4
  typeof define === 'function' && define.amd ? define(factory) :
5
+ (global = global || self, global.flatpickr = factory());
6
+ }(this, function () { 'use strict';
7
+
8
+ /*! *****************************************************************************
9
+ Copyright (c) Microsoft Corporation. All rights reserved.
10
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
11
+ this file except in compliance with the License. You may obtain a copy of the
12
+ License at http://www.apache.org/licenses/LICENSE-2.0
13
+
14
+ THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16
+ WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17
+ MERCHANTABLITY OR NON-INFRINGEMENT.
18
+
19
+ See the Apache Version 2.0 License for specific language governing permissions
20
+ and limitations under the License.
21
+ ***************************************************************************** */
22
+
23
+ var __assign = function() {
24
+ __assign = Object.assign || function __assign(t) {
25
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
26
+ s = arguments[i];
27
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
28
+ }
29
+ return t;
30
+ };
31
+ return __assign.apply(this, arguments);
 
 
 
 
 
32
  };
33
 
34
+ var HOOKS = [
35
+ "onChange",
36
+ "onClose",
37
+ "onDayCreate",
38
+ "onDestroy",
39
+ "onKeyDown",
40
+ "onMonthChange",
41
+ "onOpen",
42
+ "onParseConfig",
43
+ "onReady",
44
+ "onValueUpdate",
45
+ "onYearChange",
46
+ "onPreCalendarPosition",
47
+ ];
48
+ var defaults = {
49
+ _disable: [],
50
+ _enable: [],
51
+ allowInput: false,
52
+ altFormat: "F j, Y",
53
+ altInput: false,
54
+ altInputClass: "form-control input",
55
+ animate: typeof window === "object" &&
56
+ window.navigator.userAgent.indexOf("MSIE") === -1,
57
+ ariaDateFormat: "F j, Y",
58
+ clickOpens: true,
59
+ closeOnSelect: true,
60
+ conjunction: ", ",
61
+ dateFormat: "Y-m-d",
62
+ defaultHour: 12,
63
+ defaultMinute: 0,
64
+ defaultSeconds: 0,
65
+ disable: [],
66
+ disableMobile: false,
67
+ enable: [],
68
+ enableSeconds: false,
69
+ enableTime: false,
70
+ errorHandler: function (err) {
71
+ return typeof console !== "undefined" && console.warn(err);
72
+ },
73
+ getWeek: function (givenDate) {
74
+ var date = new Date(givenDate.getTime());
75
+ date.setHours(0, 0, 0, 0);
76
+ // Thursday in current week decides the year.
77
+ date.setDate(date.getDate() + 3 - ((date.getDay() + 6) % 7));
78
+ // January 4 is always in week 1.
79
+ var week1 = new Date(date.getFullYear(), 0, 4);
80
+ // Adjust to Thursday in week 1 and count number of weeks from date to week1.
81
+ return (1 +
82
+ Math.round(((date.getTime() - week1.getTime()) / 86400000 -
83
+ 3 +
84
+ ((week1.getDay() + 6) % 7)) /
85
+ 7));
86
+ },
87
+ hourIncrement: 1,
88
+ ignoredFocusElements: [],
89
+ inline: false,
90
+ locale: "default",
91
+ minuteIncrement: 5,
92
+ mode: "single",
93
+ monthSelectorType: "dropdown",
94
+ 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>",
95
+ noCalendar: false,
96
+ now: new Date(),
97
+ onChange: [],
98
+ onClose: [],
99
+ onDayCreate: [],
100
+ onDestroy: [],
101
+ onKeyDown: [],
102
+ onMonthChange: [],
103
+ onOpen: [],
104
+ onParseConfig: [],
105
+ onReady: [],
106
+ onValueUpdate: [],
107
+ onYearChange: [],
108
+ onPreCalendarPosition: [],
109
+ plugins: [],
110
+ position: "auto",
111
+ positionElement: undefined,
112
+ 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>",
113
+ shorthandCurrentMonth: false,
114
+ showMonths: 1,
115
+ static: false,
116
+ time_24hr: false,
117
+ weekNumbers: false,
118
+ wrap: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
119
  };
120
 
121
  var english = {
122
+ weekdays: {
123
+ shorthand: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
124
+ longhand: [
125
+ "Sunday",
126
+ "Monday",
127
+ "Tuesday",
128
+ "Wednesday",
129
+ "Thursday",
130
+ "Friday",
131
+ "Saturday",
132
+ ]
133
+ },
134
+ months: {
135
+ shorthand: [
136
+ "Jan",
137
+ "Feb",
138
+ "Mar",
139
+ "Apr",
140
+ "May",
141
+ "Jun",
142
+ "Jul",
143
+ "Aug",
144
+ "Sep",
145
+ "Oct",
146
+ "Nov",
147
+ "Dec",
148
+ ],
149
+ longhand: [
150
+ "January",
151
+ "February",
152
+ "March",
153
+ "April",
154
+ "May",
155
+ "June",
156
+ "July",
157
+ "August",
158
+ "September",
159
+ "October",
160
+ "November",
161
+ "December",
162
+ ]
163
+ },
164
+ daysInMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
165
+ firstDayOfWeek: 0,
166
+ ordinal: function (nth) {
167
+ var s = nth % 100;
168
+ if (s > 3 && s < 21)
169
+ return "th";
170
+ switch (s % 10) {
171
+ case 1:
172
+ return "st";
173
+ case 2:
174
+ return "nd";
175
+ case 3:
176
+ return "rd";
177
+ default:
178
+ return "th";
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
179
  }
180
+ },
181
+ rangeSeparator: " to ",
182
+ weekAbbreviation: "Wk",
183
+ scrollTitle: "Scroll to increment",
184
+ toggleTitle: "Click to toggle",
185
+ amPM: ["AM", "PM"],
186
+ yearAriaLabel: "Year",
187
+ hourAriaLabel: "Hour",
188
+ minuteAriaLabel: "Minute",
189
+ time_24hr: false
 
 
 
190
  };
 
 
 
 
191
 
192
+ var pad = function (number) { return ("0" + number).slice(-2); };
193
+ var int = function (bool) { return (bool === true ? 1 : 0); };
194
+ /* istanbul ignore next */
195
+ function debounce(func, wait, immediate) {
196
+ if (immediate === void 0) { immediate = false; }
197
+ var timeout;
198
+ return function () {
199
+ var context = this, args = arguments;
200
+ timeout !== null && clearTimeout(timeout);
201
+ timeout = window.setTimeout(function () {
202
+ timeout = null;
203
+ if (!immediate)
204
+ func.apply(context, args);
205
+ }, wait);
206
+ if (immediate && !timeout)
207
+ func.apply(context, args);
208
+ };
209
  }
210
+ var arrayify = function (obj) {
211
+ return obj instanceof Array ? obj : [obj];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  };
213
 
214
  function toggleClass(elem, className, bool) {
215
+ if (bool === true)
216
+ return elem.classList.add(className);
217
+ elem.classList.remove(className);
218
  }
219
  function createElement(tag, className, content) {
220
+ var e = window.document.createElement(tag);
221
+ className = className || "";
222
+ content = content || "";
223
+ e.className = className;
224
+ if (content !== undefined)
225
+ e.textContent = content;
226
+ return e;
227
  }
228
  function clearNode(node) {
229
+ while (node.firstChild)
230
+ node.removeChild(node.firstChild);
 
231
  }
232
  function findParent(node, condition) {
233
+ if (condition(node))
234
+ return node;
235
+ else if (node.parentNode)
236
+ return findParent(node.parentNode, condition);
237
+ return undefined; // nothing found
238
  }
239
  function createNumberInput(inputClassName, opts) {
240
+ var wrapper = createElement("div", "numInputWrapper"), numInput = createElement("input", "numInput " + inputClassName), arrowUp = createElement("span", "arrowUp"), arrowDown = createElement("span", "arrowDown");
241
+ if (navigator.userAgent.indexOf("MSIE 9.0") === -1) {
242
+ numInput.type = "number";
243
+ }
244
+ else {
245
+ numInput.type = "text";
246
+ numInput.pattern = "\\d*";
247
+ }
248
+ if (opts !== undefined)
249
+ for (var key in opts)
250
+ numInput.setAttribute(key, opts[key]);
251
+ wrapper.appendChild(numInput);
252
+ wrapper.appendChild(arrowUp);
253
+ wrapper.appendChild(arrowDown);
254
+ return wrapper;
255
  }
256
+ function getEventTarget(event) {
257
+ if (typeof event.composedPath === "function") {
258
+ var path = event.composedPath();
259
+ return path[0];
 
260
  }
261
+ return event.target;
262
+ }
263
 
264
+ var doNothing = function () { return undefined; };
265
+ var monthToStr = function (monthNumber, shorthand, locale) { return locale.months[shorthand ? "shorthand" : "longhand"][monthNumber]; };
266
+ var revFormat = {
267
+ D: doNothing,
268
+ F: function (dateObj, monthName, locale) {
269
+ dateObj.setMonth(locale.months.longhand.indexOf(monthName));
270
+ },
271
+ G: function (dateObj, hour) {
272
+ dateObj.setHours(parseFloat(hour));
273
+ },
274
+ H: function (dateObj, hour) {
275
+ dateObj.setHours(parseFloat(hour));
276
+ },
277
+ J: function (dateObj, day) {
278
+ dateObj.setDate(parseFloat(day));
279
+ },
280
+ K: function (dateObj, amPM, locale) {
281
+ dateObj.setHours((dateObj.getHours() % 12) +
282
+ 12 * int(new RegExp(locale.amPM[1], "i").test(amPM)));
283
+ },
284
+ M: function (dateObj, shortMonth, locale) {
285
+ dateObj.setMonth(locale.months.shorthand.indexOf(shortMonth));
286
+ },
287
+ S: function (dateObj, seconds) {
288
+ dateObj.setSeconds(parseFloat(seconds));
289
+ },
290
+ U: function (_, unixSeconds) { return new Date(parseFloat(unixSeconds) * 1000); },
291
+ W: function (dateObj, weekNum, locale) {
292
+ var weekNumber = parseInt(weekNum);
293
+ var date = new Date(dateObj.getFullYear(), 0, 2 + (weekNumber - 1) * 7, 0, 0, 0, 0);
294
+ date.setDate(date.getDate() - date.getDay() + locale.firstDayOfWeek);
295
+ return date;
296
+ },
297
+ Y: function (dateObj, year) {
298
+ dateObj.setFullYear(parseFloat(year));
299
+ },
300
+ Z: function (_, ISODate) { return new Date(ISODate); },
301
+ d: function (dateObj, day) {
302
+ dateObj.setDate(parseFloat(day));
303
+ },
304
+ h: function (dateObj, hour) {
305
+ dateObj.setHours(parseFloat(hour));
306
+ },
307
+ i: function (dateObj, minutes) {
308
+ dateObj.setMinutes(parseFloat(minutes));
309
+ },
310
+ j: function (dateObj, day) {
311
+ dateObj.setDate(parseFloat(day));
312
+ },
313
+ l: doNothing,
314
+ m: function (dateObj, month) {
315
+ dateObj.setMonth(parseFloat(month) - 1);
316
+ },
317
+ n: function (dateObj, month) {
318
+ dateObj.setMonth(parseFloat(month) - 1);
319
+ },
320
+ s: function (dateObj, seconds) {
321
+ dateObj.setSeconds(parseFloat(seconds));
322
+ },
323
+ u: function (_, unixMillSeconds) {
324
+ return new Date(parseFloat(unixMillSeconds));
325
+ },
326
+ w: doNothing,
327
+ y: function (dateObj, year) {
328
+ dateObj.setFullYear(2000 + parseFloat(year));
329
  }
330
+ };
331
+ var tokenRegex = {
332
+ D: "(\\w+)",
333
+ F: "(\\w+)",
334
+ G: "(\\d\\d|\\d)",
335
+ H: "(\\d\\d|\\d)",
336
+ J: "(\\d\\d|\\d)\\w+",
337
+ K: "",
338
+ M: "(\\w+)",
339
+ S: "(\\d\\d|\\d)",
340
+ U: "(.+)",
341
+ W: "(\\d\\d|\\d)",
342
+ Y: "(\\d{4})",
343
+ Z: "(.+)",
344
+ d: "(\\d\\d|\\d)",
345
+ h: "(\\d\\d|\\d)",
346
+ i: "(\\d\\d|\\d)",
347
+ j: "(\\d\\d|\\d)",
348
+ l: "(\\w+)",
349
+ m: "(\\d\\d|\\d)",
350
+ n: "(\\d\\d|\\d)",
351
+ s: "(\\d\\d|\\d)",
352
+ u: "(.+)",
353
+ w: "(\\d\\d|\\d)",
354
+ y: "(\\d{2})"
355
+ };
356
+ var formats = {
357
+ // get the date in UTC
358
+ Z: function (date) { return date.toISOString(); },
359
+ // weekday name, short, e.g. Thu
360
+ D: function (date, locale, options) {
361
+ return locale.weekdays.shorthand[formats.w(date, locale, options)];
362
+ },
363
+ // full month name e.g. January
364
+ F: function (date, locale, options) {
365
+ return monthToStr(formats.n(date, locale, options) - 1, false, locale);
366
+ },
367
+ // padded hour 1-12
368
+ G: function (date, locale, options) {
369
+ return pad(formats.h(date, locale, options));
370
+ },
371
+ // hours with leading zero e.g. 03
372
+ H: function (date) { return pad(date.getHours()); },
373
+ // day (1-30) with ordinal suffix e.g. 1st, 2nd
374
+ J: function (date, locale) {
375
+ return locale.ordinal !== undefined
376
+ ? date.getDate() + locale.ordinal(date.getDate())
377
+ : date.getDate();
378
+ },
379
+ // AM/PM
380
+ K: function (date, locale) { return locale.amPM[int(date.getHours() > 11)]; },
381
+ // shorthand month e.g. Jan, Sep, Oct, etc
382
+ M: function (date, locale) {
383
+ return monthToStr(date.getMonth(), true, locale);
384
+ },
385
+ // seconds 00-59
386
+ S: function (date) { return pad(date.getSeconds()); },
387
+ // unix timestamp
388
+ U: function (date) { return date.getTime() / 1000; },
389
+ W: function (date, _, options) {
390
+ return options.getWeek(date);
391
+ },
392
+ // full year e.g. 2016
393
+ Y: function (date) { return date.getFullYear(); },
394
+ // day in month, padded (01-30)
395
+ d: function (date) { return pad(date.getDate()); },
396
+ // hour from 1-12 (am/pm)
397
+ h: function (date) { return (date.getHours() % 12 ? date.getHours() % 12 : 12); },
398
+ // minutes, padded with leading zero e.g. 09
399
+ i: function (date) { return pad(date.getMinutes()); },
400
+ // day in month (1-30)
401
+ j: function (date) { return date.getDate(); },
402
+ // weekday name, full, e.g. Thursday
403
+ l: function (date, locale) {
404
+ return locale.weekdays.longhand[date.getDay()];
405
+ },
406
+ // padded month number (01-12)
407
+ m: function (date) { return pad(date.getMonth() + 1); },
408
+ // the month number (1-12)
409
+ n: function (date) { return date.getMonth() + 1; },
410
+ // seconds 0-59
411
+ s: function (date) { return date.getSeconds(); },
412
+ // Unix Milliseconds
413
+ u: function (date) { return date.getTime(); },
414
+ // number of the day of the week
415
+ w: function (date) { return date.getDay(); },
416
+ // last two digits of year e.g. 16 for 2016
417
+ y: function (date) { return String(date.getFullYear()).substring(2); }
418
+ };
419
 
420
+ var createDateFormatter = function (_a) {
421
+ var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;
422
+ return function (dateObj, frmt, overrideLocale) {
423
+ var locale = overrideLocale || l10n;
424
+ if (config.formatDate !== undefined) {
425
+ return config.formatDate(dateObj, frmt, locale);
426
+ }
427
+ return frmt
428
+ .split("")
429
+ .map(function (c, i, arr) {
430
+ return formats[c] && arr[i - 1] !== "\\"
431
+ ? formats[c](dateObj, locale, config)
432
+ : c !== "\\"
433
+ ? c
434
+ : "";
435
+ })
436
+ .join("");
437
  };
438
+ };
439
+ var createDateParser = function (_a) {
440
+ var _b = _a.config, config = _b === void 0 ? defaults : _b, _c = _a.l10n, l10n = _c === void 0 ? english : _c;
441
+ return function (date, givenFormat, timeless, customLocale) {
442
+ if (date !== 0 && !date)
443
+ return undefined;
444
+ var locale = customLocale || l10n;
445
+ var parsedDate;
446
+ var dateOrig = date;
447
+ if (date instanceof Date)
448
+ parsedDate = new Date(date.getTime());
449
+ else if (typeof date !== "string" &&
450
+ date.toFixed !== undefined // timestamp
451
+ )
452
+ // create a copy
453
+ parsedDate = new Date(date);
454
+ else if (typeof date === "string") {
455
+ // date string
456
+ var format = givenFormat || (config || defaults).dateFormat;
457
+ var datestr = String(date).trim();
458
+ if (datestr === "today") {
459
+ parsedDate = new Date();
460
+ timeless = true;
461
+ }
462
+ else if (/Z$/.test(datestr) ||
463
+ /GMT$/.test(datestr) // datestrings w/ timezone
464
+ )
465
+ parsedDate = new Date(date);
466
+ else if (config && config.parseDate)
467
+ parsedDate = config.parseDate(date, format);
468
+ else {
469
+ parsedDate =
470
+ !config || !config.noCalendar
471
+ ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0)
472
+ : new Date(new Date().setHours(0, 0, 0, 0));
473
+ var matched = void 0, ops = [];
474
+ for (var i = 0, matchIndex = 0, regexStr = ""; i < format.length; i++) {
475
+ var token_1 = format[i];
476
+ var isBackSlash = token_1 === "\\";
477
+ var escaped = format[i - 1] === "\\" || isBackSlash;
478
+ if (tokenRegex[token_1] && !escaped) {
479
+ regexStr += tokenRegex[token_1];
480
+ var match = new RegExp(regexStr).exec(date);
481
+ if (match && (matched = true)) {
482
+ ops[token_1 !== "Y" ? "push" : "unshift"]({
483
+ fn: revFormat[token_1],
484
+ val: match[++matchIndex]
485
+ });
486
+ }
487
+ }
488
+ else if (!isBackSlash)
489
+ regexStr += "."; // don't really care
490
+ ops.forEach(function (_a) {
491
+ var fn = _a.fn, val = _a.val;
492
+ return (parsedDate = fn(parsedDate, val, locale) || parsedDate);
493
+ });
494
+ }
495
+ parsedDate = matched ? parsedDate : undefined;
496
+ }
497
+ }
498
+ /* istanbul ignore next */
499
+ if (!(parsedDate instanceof Date && !isNaN(parsedDate.getTime()))) {
500
+ config.errorHandler(new Error("Invalid date provided: " + dateOrig));
501
+ return undefined;
502
+ }
503
+ if (timeless === true)
504
+ parsedDate.setHours(0, 0, 0, 0);
505
+ return parsedDate;
506
+ };
507
+ };
508
+ /**
509
+ * Compute the difference in dates, measured in ms
510
+ */
511
+ function compareDates(date1, date2, timeless) {
512
+ if (timeless === void 0) { timeless = true; }
513
+ if (timeless !== false) {
514
+ return (new Date(date1.getTime()).setHours(0, 0, 0, 0) -
515
+ new Date(date2.getTime()).setHours(0, 0, 0, 0));
516
  }
517
+ return date1.getTime() - date2.getTime();
518
+ }
519
+ var isBetween = function (ts, ts1, ts2) {
520
+ return ts > Math.min(ts1, ts2) && ts < Math.max(ts1, ts2);
521
+ };
522
+ var duration = {
523
+ DAY: 86400000
524
+ };
525
 
526
+ if (typeof Object.assign !== "function") {
527
+ Object.assign = function (target) {
528
+ var args = [];
529
+ for (var _i = 1; _i < arguments.length; _i++) {
530
+ args[_i - 1] = arguments[_i];
531
+ }
532
+ if (!target) {
533
+ throw TypeError("Cannot convert undefined or null to object");
534
+ }
535
+ var _loop_1 = function (source) {
536
+ if (source) {
537
+ Object.keys(source).forEach(function (key) { return (target[key] = source[key]); });
538
+ }
539
+ };
540
+ for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {
541
+ var source = args_1[_a];
542
+ _loop_1(source);
543
+ }
544
+ return target;
545
+ };
546
  }
547
 
548
  var DEBOUNCED_CHANGE_MS = 300;
 
549
  function FlatpickrInstance(element, instanceConfig) {
550
+ var self = {
551
+ config: __assign({}, defaults, flatpickr.defaultConfig),
552
+ l10n: english
553
+ };
554
+ self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });
555
+ self._handlers = [];
556
+ self.pluginElements = [];
557
+ self.loadedPlugins = [];
558
+ self._bind = bind;
559
+ self._setHoursFromDate = setHoursFromDate;
560
+ self._positionCalendar = positionCalendar;
561
+ self.changeMonth = changeMonth;
562
+ self.changeYear = changeYear;
563
+ self.clear = clear;
564
+ self.close = close;
565
+ self._createElement = createElement;
566
+ self.destroy = destroy;
567
+ self.isEnabled = isEnabled;
568
+ self.jumpToDate = jumpToDate;
569
+ self.open = open;
570
+ self.redraw = redraw;
571
+ self.set = set;
572
+ self.setDate = setDate;
573
+ self.toggle = toggle;
574
+ function setupHelperFunctions() {
575
+ self.utils = {
576
+ getDaysInMonth: function (month, yr) {
577
+ if (month === void 0) { month = self.currentMonth; }
578
+ if (yr === void 0) { yr = self.currentYear; }
579
+ if (month === 1 && ((yr % 4 === 0 && yr % 100 !== 0) || yr % 400 === 0))
580
+ return 29;
581
+ return self.l10n.daysInMonth[month];
582
+ }
583
+ };
584
+ }
585
+ function init() {
586
+ self.element = self.input = element;
587
+ self.isOpen = false;
588
+ parseConfig();
589
+ setupLocale();
590
+ setupInputs();
591
+ setupDates();
592
+ setupHelperFunctions();
593
+ if (!self.isMobile)
594
+ build();
595
+ bindEvents();
596
+ if (self.selectedDates.length || self.config.noCalendar) {
597
+ if (self.config.enableTime) {
598
+ setHoursFromDate(self.config.noCalendar
599
+ ? self.latestSelectedDateObj || self.config.minDate
600
+ : undefined);
601
+ }
602
+ updateValue(false);
603
  }
604
+ setCalendarWidth();
605
+ self.showTimeInput =
606
+ self.selectedDates.length > 0 || self.config.noCalendar;
607
+ var isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
608
+ /* TODO: investigate this further
609
+
610
+ Currently, there is weird positioning behavior in safari causing pages
611
+ to scroll up. https://github.com/chmln/flatpickr/issues/563
612
+
613
+ However, most browsers are not Safari and positioning is expensive when used
614
+ in scale. https://github.com/chmln/flatpickr/issues/1096
615
+ */
616
+ if (!self.isMobile && isSafari) {
617
+ positionCalendar();
618
  }
619
+ triggerEvent("onReady");
620
+ }
621
+ function bindToInstance(fn) {
622
+ return fn.bind(self);
623
+ }
624
+ function setCalendarWidth() {
625
+ var config = self.config;
626
+ if (config.weekNumbers === false && config.showMonths === 1)
627
+ return;
628
+ else if (config.noCalendar !== true) {
629
+ window.requestAnimationFrame(function () {
630
+ if (self.calendarContainer !== undefined) {
631
+ self.calendarContainer.style.visibility = "hidden";
632
+ self.calendarContainer.style.display = "block";
633
+ }
634
+ if (self.daysContainer !== undefined) {
635
+ var daysWidth = (self.days.offsetWidth + 1) * config.showMonths;
636
+ self.daysContainer.style.width = daysWidth + "px";
637
+ self.calendarContainer.style.width =
638
+ daysWidth +
639
+ (self.weekWrapper !== undefined
640
+ ? self.weekWrapper.offsetWidth
641
+ : 0) +
642
+ "px";
643
+ self.calendarContainer.style.removeProperty("visibility");
644
+ self.calendarContainer.style.removeProperty("display");
645
+ }
646
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
647
  }
 
648
  }
649
+ /**
650
+ * The handler for all events targeting the time inputs
651
+ */
652
+ function updateTime(e) {
653
+ if (self.selectedDates.length === 0) {
654
+ setDefaultTime();
655
+ }
656
+ if (e !== undefined && e.type !== "blur") {
657
+ timeWrapper(e);
658
+ }
659
+ var prevValue = self._input.value;
660
+ setHoursFromInputs();
661
+ updateValue();
662
+ if (self._input.value !== prevValue) {
663
+ self._debouncedChange();
664
+ }
665
  }
666
+ function ampm2military(hour, amPM) {
667
+ return (hour % 12) + 12 * int(amPM === self.l10n.amPM[1]);
 
 
 
 
 
668
  }
669
+ function military2ampm(hour) {
670
+ switch (hour % 24) {
671
+ case 0:
672
+ case 12:
673
+ return 12;
674
+ default:
675
+ return hour % 12;
676
+ }
 
 
 
 
 
 
677
  }
678
+ /**
679
+ * Syncs the selected date object time with user's time input
680
+ */
681
+ function setHoursFromInputs() {
682
+ if (self.hourElement === undefined || self.minuteElement === undefined)
683
+ return;
684
+ var hours = (parseInt(self.hourElement.value.slice(-2), 10) || 0) % 24, minutes = (parseInt(self.minuteElement.value, 10) || 0) % 60, seconds = self.secondElement !== undefined
685
+ ? (parseInt(self.secondElement.value, 10) || 0) % 60
686
+ : 0;
687
+ if (self.amPM !== undefined) {
688
+ hours = ampm2military(hours, self.amPM.textContent);
689
+ }
690
+ var limitMinHours = self.config.minTime !== undefined ||
691
+ (self.config.minDate &&
692
+ self.minDateHasTime &&
693
+ self.latestSelectedDateObj &&
694
+ compareDates(self.latestSelectedDateObj, self.config.minDate, true) ===
695
+ 0);
696
+ var limitMaxHours = self.config.maxTime !== undefined ||
697
+ (self.config.maxDate &&
698
+ self.maxDateHasTime &&
699
+ self.latestSelectedDateObj &&
700
+ compareDates(self.latestSelectedDateObj, self.config.maxDate, true) ===
701
+ 0);
702
+ if (limitMaxHours) {
703
+ var maxTime = self.config.maxTime !== undefined
704
+ ? self.config.maxTime
705
+ : self.config.maxDate;
706
+ hours = Math.min(hours, maxTime.getHours());
707
+ if (hours === maxTime.getHours())
708
+ minutes = Math.min(minutes, maxTime.getMinutes());
709
+ if (minutes === maxTime.getMinutes())
710
+ seconds = Math.min(seconds, maxTime.getSeconds());
711
+ }
712
+ if (limitMinHours) {
713
+ var minTime = self.config.minTime !== undefined
714
+ ? self.config.minTime
715
+ : self.config.minDate;
716
+ hours = Math.max(hours, minTime.getHours());
717
+ if (hours === minTime.getHours())
718
+ minutes = Math.max(minutes, minTime.getMinutes());
719
+ if (minutes === minTime.getMinutes())
720
+ seconds = Math.max(seconds, minTime.getSeconds());
721
+ }
722
+ setHours(hours, minutes, seconds);
723
+ }
724
+ /**
725
+ * Syncs time input values with a date
726
+ */
727
+ function setHoursFromDate(dateObj) {
728
+ var date = dateObj || self.latestSelectedDateObj;
729
+ if (date)
730
+ setHours(date.getHours(), date.getMinutes(), date.getSeconds());
731
+ }
732
+ function setDefaultHours() {
733
+ var hours = self.config.defaultHour;
734
+ var minutes = self.config.defaultMinute;
735
+ var seconds = self.config.defaultSeconds;
736
+ if (self.config.minDate !== undefined) {
737
+ var minHr = self.config.minDate.getHours();
738
+ var minMinutes = self.config.minDate.getMinutes();
739
+ hours = Math.max(hours, minHr);
740
+ if (hours === minHr)
741
+ minutes = Math.max(minMinutes, minutes);
742
+ if (hours === minHr && minutes === minMinutes)
743
+ seconds = self.config.minDate.getSeconds();
744
+ }
745
+ if (self.config.maxDate !== undefined) {
746
+ var maxHr = self.config.maxDate.getHours();
747
+ var maxMinutes = self.config.maxDate.getMinutes();
748
+ hours = Math.min(hours, maxHr);
749
+ if (hours === maxHr)
750
+ minutes = Math.min(maxMinutes, minutes);
751
+ if (hours === maxHr && minutes === maxMinutes)
752
+ seconds = self.config.maxDate.getSeconds();
753
+ }
754
+ setHours(hours, minutes, seconds);
755
+ }
756
+ /**
757
+ * Sets the hours, minutes, and optionally seconds
758
+ * of the latest selected date object and the
759
+ * corresponding time inputs
760
+ * @param {Number} hours the hour. whether its military
761
+ * or am-pm gets inferred from config
762
+ * @param {Number} minutes the minutes
763
+ * @param {Number} seconds the seconds (optional)
764
+ */
765
+ function setHours(hours, minutes, seconds) {
766
+ if (self.latestSelectedDateObj !== undefined) {
767
+ self.latestSelectedDateObj.setHours(hours % 24, minutes, seconds || 0, 0);
768
+ }
769
+ if (!self.hourElement || !self.minuteElement || self.isMobile)
770
+ return;
771
+ self.hourElement.value = pad(!self.config.time_24hr
772
+ ? ((12 + hours) % 12) + 12 * int(hours % 12 === 0)
773
+ : hours);
774
+ self.minuteElement.value = pad(minutes);
775
+ if (self.amPM !== undefined)
776
+ self.amPM.textContent = self.l10n.amPM[int(hours >= 12)];
777
+ if (self.secondElement !== undefined)
778
+ self.secondElement.value = pad(seconds);
779
+ }
780
+ /**
781
+ * Handles the year input and incrementing events
782
+ * @param {Event} event the keyup or increment event
783
+ */
784
+ function onYearInput(event) {
785
+ var year = parseInt(event.target.value) + (event.delta || 0);
786
+ if (year / 1000 > 1 ||
787
+ (event.key === "Enter" && !/[^\d]/.test(year.toString()))) {
788
+ changeYear(year);
789
+ }
790
  }
791
+ /**
792
+ * Essentially addEventListener + tracking
793
+ * @param {Element} element the element to addEventListener to
794
+ * @param {String} event the event name
795
+ * @param {Function} handler the event handler
796
+ */
797
+ function bind(element, event, handler, options) {
798
+ if (event instanceof Array)
799
+ return event.forEach(function (ev) { return bind(element, ev, handler, options); });
800
+ if (element instanceof Array)
801
+ return element.forEach(function (el) { return bind(el, event, handler, options); });
802
+ element.addEventListener(event, handler, options);
803
+ self._handlers.push({
804
+ element: element,
805
+ event: event,
806
+ handler: handler,
807
+ options: options
808
+ });
809
  }
810
+ /**
811
+ * A mousedown handler which mimics click.
812
+ * Minimizes latency, since we don't need to wait for mouseup in most cases.
813
+ * Also, avoids handling right clicks.
814
+ *
815
+ * @param {Function} handler the event handler
816
+ */
817
+ function onClick(handler) {
818
+ return function (evt) {
819
+ evt.which === 1 && handler(evt);
820
+ };
821
+ }
822
+ function triggerChange() {
823
+ triggerEvent("onChange");
824
+ }
825
+ /**
826
+ * Adds all the necessary event listeners
827
+ */
828
+ function bindEvents() {
829
+ if (self.config.wrap) {
830
+ ["open", "close", "toggle", "clear"].forEach(function (evt) {
831
+ Array.prototype.forEach.call(self.element.querySelectorAll("[data-" + evt + "]"), function (el) {
832
+ return bind(el, "click", self[evt]);
833
+ });
834
+ });
835
+ }
836
+ if (self.isMobile) {
837
+ setupMobile();
838
+ return;
839
+ }
840
+ var debouncedResize = debounce(onResize, 50);
841
+ self._debouncedChange = debounce(triggerChange, DEBOUNCED_CHANGE_MS);
842
+ if (self.daysContainer && !/iPhone|iPad|iPod/i.test(navigator.userAgent))
843
+ bind(self.daysContainer, "mouseover", function (e) {
844
+ if (self.config.mode === "range")
845
+ onMouseOver(e.target);
846
+ });
847
+ bind(window.document.body, "keydown", onKeyDown);
848
+ if (!self.config.inline && !self.config.static)
849
+ bind(window, "resize", debouncedResize);
850
+ if (window.ontouchstart !== undefined)
851
+ bind(window.document, "touchstart", documentClick);
852
+ else
853
+ bind(window.document, "mousedown", onClick(documentClick));
854
+ bind(window.document, "focus", documentClick, { capture: true });
855
+ if (self.config.clickOpens === true) {
856
+ bind(self._input, "focus", self.open);
857
+ bind(self._input, "mousedown", onClick(self.open));
858
+ }
859
+ if (self.daysContainer !== undefined) {
860
+ bind(self.monthNav, "mousedown", onClick(onMonthNavClick));
861
+ bind(self.monthNav, ["keyup", "increment"], onYearInput);
862
+ bind(self.daysContainer, "mousedown", onClick(selectDate));
863
+ }
864
+ if (self.timeContainer !== undefined &&
865
+ self.minuteElement !== undefined &&
866
+ self.hourElement !== undefined) {
867
+ var selText = function (e) {
868
+ return e.target.select();
869
+ };
870
+ bind(self.timeContainer, ["increment"], updateTime);
871
+ bind(self.timeContainer, "blur", updateTime, { capture: true });
872
+ bind(self.timeContainer, "mousedown", onClick(timeIncrement));
873
+ bind([self.hourElement, self.minuteElement], ["focus", "click"], selText);
874
+ if (self.secondElement !== undefined)
875
+ bind(self.secondElement, "focus", function () { return self.secondElement && self.secondElement.select(); });
876
+ if (self.amPM !== undefined) {
877
+ bind(self.amPM, "mousedown", onClick(function (e) {
878
+ updateTime(e);
879
+ triggerChange();
880
+ }));
881
+ }
882
+ }
883
  }
884
+ /**
885
+ * Set the calendar view to a particular date.
886
+ * @param {Date} jumpDate the date to set the view to
887
+ * @param {boolean} triggerChange if change events should be triggered
888
+ */
889
+ function jumpToDate(jumpDate, triggerChange) {
890
+ var jumpTo = jumpDate !== undefined
891
+ ? self.parseDate(jumpDate)
892
+ : self.latestSelectedDateObj ||
893
+ (self.config.minDate && self.config.minDate > self.now
894
+ ? self.config.minDate
895
+ : self.config.maxDate && self.config.maxDate < self.now
896
+ ? self.config.maxDate
897
+ : self.now);
898
+ var oldYear = self.currentYear;
899
+ var oldMonth = self.currentMonth;
900
+ try {
901
+ if (jumpTo !== undefined) {
902
+ self.currentYear = jumpTo.getFullYear();
903
+ self.currentMonth = jumpTo.getMonth();
904
+ }
905
+ }
906
+ catch (e) {
907
+ /* istanbul ignore next */
908
+ e.message = "Invalid date supplied: " + jumpTo;
909
+ self.config.errorHandler(e);
910
+ }
911
+ if (triggerChange && self.currentYear !== oldYear) {
912
+ triggerEvent("onYearChange");
913
+ buildMonthSwitch();
914
+ }
915
+ if (triggerChange &&
916
+ (self.currentYear !== oldYear || self.currentMonth !== oldMonth)) {
917
+ triggerEvent("onMonthChange");
918
+ }
919
+ self.redraw();
920
+ }
921
+ /**
922
+ * The up/down arrow handler for time inputs
923
+ * @param {Event} e the click event
924
+ */
925
+ function timeIncrement(e) {
926
+ if (~e.target.className.indexOf("arrow"))
927
+ incrementNumInput(e, e.target.classList.contains("arrowUp") ? 1 : -1);
928
+ }
929
+ /**
930
+ * Increments/decrements the value of input associ-
931
+ * ated with the up/down arrow by dispatching an
932
+ * "increment" event on the input.
933
+ *
934
+ * @param {Event} e the click event
935
+ * @param {Number} delta the diff (usually 1 or -1)
936
+ * @param {Element} inputElem the input element
937
+ */
938
+ function incrementNumInput(e, delta, inputElem) {
939
+ var target = e && e.target;
940
+ var input = inputElem ||
941
+ (target && target.parentNode && target.parentNode.firstChild);
942
+ var event = createEvent("increment");
943
+ event.delta = delta;
944
+ input && input.dispatchEvent(event);
945
+ }
946
+ function build() {
947
+ var fragment = window.document.createDocumentFragment();
948
+ self.calendarContainer = createElement("div", "flatpickr-calendar");
949
+ self.calendarContainer.tabIndex = -1;
950
+ if (!self.config.noCalendar) {
951
+ fragment.appendChild(buildMonthNav());
952
+ self.innerContainer = createElement("div", "flatpickr-innerContainer");
953
+ if (self.config.weekNumbers) {
954
+ var _a = buildWeeks(), weekWrapper = _a.weekWrapper, weekNumbers = _a.weekNumbers;
955
+ self.innerContainer.appendChild(weekWrapper);
956
+ self.weekNumbers = weekNumbers;
957
+ self.weekWrapper = weekWrapper;
958
+ }
959
+ self.rContainer = createElement("div", "flatpickr-rContainer");
960
+ self.rContainer.appendChild(buildWeekdays());
961
+ if (!self.daysContainer) {
962
+ self.daysContainer = createElement("div", "flatpickr-days");
963
+ self.daysContainer.tabIndex = -1;
964
+ }
965
+ buildDays();
966
+ self.rContainer.appendChild(self.daysContainer);
967
+ self.innerContainer.appendChild(self.rContainer);
968
+ fragment.appendChild(self.innerContainer);
969
+ }
970
+ if (self.config.enableTime) {
971
+ fragment.appendChild(buildTime());
972
+ }
973
+ toggleClass(self.calendarContainer, "rangeMode", self.config.mode === "range");
974
+ toggleClass(self.calendarContainer, "animate", self.config.animate === true);
975
+ toggleClass(self.calendarContainer, "multiMonth", self.config.showMonths > 1);
976
+ self.calendarContainer.appendChild(fragment);
977
+ var customAppend = self.config.appendTo !== undefined &&
978
+ self.config.appendTo.nodeType !== undefined;
979
+ if (self.config.inline || self.config.static) {
980
+ self.calendarContainer.classList.add(self.config.inline ? "inline" : "static");
981
+ if (self.config.inline) {
982
+ if (!customAppend && self.element.parentNode)
983
+ self.element.parentNode.insertBefore(self.calendarContainer, self._input.nextSibling);
984
+ else if (self.config.appendTo !== undefined)
985
+ self.config.appendTo.appendChild(self.calendarContainer);
986
+ }
987
+ if (self.config.static) {
988
+ var wrapper = createElement("div", "flatpickr-wrapper");
989
+ if (self.element.parentNode)
990
+ self.element.parentNode.insertBefore(wrapper, self.element);
991
+ wrapper.appendChild(self.element);
992
+ if (self.altInput)
993
+ wrapper.appendChild(self.altInput);
994
+ wrapper.appendChild(self.calendarContainer);
995
+ }
996
+ }
997
+ if (!self.config.static && !self.config.inline)
998
+ (self.config.appendTo !== undefined
999
+ ? self.config.appendTo
1000
+ : window.document.body).appendChild(self.calendarContainer);
1001
+ }
1002
+ function createDay(className, date, dayNumber, i) {
1003
+ var dateIsEnabled = isEnabled(date, true), dayElement = createElement("span", "flatpickr-day " + className, date.getDate().toString());
1004
+ dayElement.dateObj = date;
1005
+ dayElement.$i = i;
1006
+ dayElement.setAttribute("aria-label", self.formatDate(date, self.config.ariaDateFormat));
1007
+ if (className.indexOf("hidden") === -1 &&
1008
+ compareDates(date, self.now) === 0) {
1009
+ self.todayDateElem = dayElement;
1010
+ dayElement.classList.add("today");
1011
+ dayElement.setAttribute("aria-current", "date");
1012
+ }
1013
+ if (dateIsEnabled) {
1014
+ dayElement.tabIndex = -1;
1015
+ if (isDateSelected(date)) {
1016
+ dayElement.classList.add("selected");
1017
+ self.selectedDateElem = dayElement;
1018
+ if (self.config.mode === "range") {
1019
+ toggleClass(dayElement, "startRange", self.selectedDates[0] &&
1020
+ compareDates(date, self.selectedDates[0], true) === 0);
1021
+ toggleClass(dayElement, "endRange", self.selectedDates[1] &&
1022
+ compareDates(date, self.selectedDates[1], true) === 0);
1023
+ if (className === "nextMonthDay")
1024
+ dayElement.classList.add("inRange");
1025
+ }
1026
+ }
1027
+ }
1028
+ else {
1029
+ dayElement.classList.add("flatpickr-disabled");
1030
+ }
1031
+ if (self.config.mode === "range") {
1032
+ if (isDateInRange(date) && !isDateSelected(date))
1033
+ dayElement.classList.add("inRange");
1034
+ }
1035
+ if (self.weekNumbers &&
1036
+ self.config.showMonths === 1 &&
1037
+ className !== "prevMonthDay" &&
1038
+ dayNumber % 7 === 1) {
1039
+ self.weekNumbers.insertAdjacentHTML("beforeend", "<span class='flatpickr-day'>" + self.config.getWeek(date) + "</span>");
1040
+ }
1041
+ triggerEvent("onDayCreate", dayElement);
1042
+ return dayElement;
1043
+ }
1044
+ function focusOnDayElem(targetNode) {
1045
+ targetNode.focus();
1046
+ if (self.config.mode === "range")
1047
+ onMouseOver(targetNode);
1048
+ }
1049
+ function getFirstAvailableDay(delta) {
1050
+ var startMonth = delta > 0 ? 0 : self.config.showMonths - 1;
1051
+ var endMonth = delta > 0 ? self.config.showMonths : -1;
1052
+ for (var m = startMonth; m != endMonth; m += delta) {
1053
+ var month = self.daysContainer.children[m];
1054
+ var startIndex = delta > 0 ? 0 : month.children.length - 1;
1055
+ var endIndex = delta > 0 ? month.children.length : -1;
1056
+ for (var i = startIndex; i != endIndex; i += delta) {
1057
+ var c = month.children[i];
1058
+ if (c.className.indexOf("hidden") === -1 && isEnabled(c.dateObj))
1059
+ return c;
1060
+ }
1061
+ }
1062
+ return undefined;
1063
+ }
1064
+ function getNextAvailableDay(current, delta) {
1065
+ var givenMonth = current.className.indexOf("Month") === -1
1066
+ ? current.dateObj.getMonth()
1067
+ : self.currentMonth;
1068
+ var endMonth = delta > 0 ? self.config.showMonths : -1;
1069
+ var loopDelta = delta > 0 ? 1 : -1;
1070
+ for (var m = givenMonth - self.currentMonth; m != endMonth; m += loopDelta) {
1071
+ var month = self.daysContainer.children[m];
1072
+ var startIndex = givenMonth - self.currentMonth === m
1073
+ ? current.$i + delta
1074
+ : delta < 0
1075
+ ? month.children.length - 1
1076
+ : 0;
1077
+ var numMonthDays = month.children.length;
1078
+ for (var i = startIndex; i >= 0 && i < numMonthDays && i != (delta > 0 ? numMonthDays : -1); i += loopDelta) {
1079
+ var c = month.children[i];
1080
+ if (c.className.indexOf("hidden") === -1 &&
1081
+ isEnabled(c.dateObj) &&
1082
+ Math.abs(current.$i - i) >= Math.abs(delta))
1083
+ return focusOnDayElem(c);
1084
+ }
1085
+ }
1086
+ self.changeMonth(loopDelta);
1087
+ focusOnDay(getFirstAvailableDay(loopDelta), 0);
1088
+ return undefined;
1089
+ }
1090
+ function focusOnDay(current, offset) {
1091
+ var dayFocused = isInView(document.activeElement || document.body);
1092
+ var startElem = current !== undefined
1093
+ ? current
1094
+ : dayFocused
1095
+ ? document.activeElement
1096
+ : self.selectedDateElem !== undefined && isInView(self.selectedDateElem)
1097
+ ? self.selectedDateElem
1098
+ : self.todayDateElem !== undefined && isInView(self.todayDateElem)
1099
+ ? self.todayDateElem
1100
+ : getFirstAvailableDay(offset > 0 ? 1 : -1);
1101
+ if (startElem === undefined)
1102
+ return self._input.focus();
1103
+ if (!dayFocused)
1104
+ return focusOnDayElem(startElem);
1105
+ getNextAvailableDay(startElem, offset);
1106
+ }
1107
+ function buildMonthDays(year, month) {
1108
+ var firstOfMonth = (new Date(year, month, 1).getDay() - self.l10n.firstDayOfWeek + 7) % 7;
1109
+ var prevMonthDays = self.utils.getDaysInMonth((month - 1 + 12) % 12);
1110
+ var daysInMonth = self.utils.getDaysInMonth(month), days = window.document.createDocumentFragment(), isMultiMonth = self.config.showMonths > 1, prevMonthDayClass = isMultiMonth ? "prevMonthDay hidden" : "prevMonthDay", nextMonthDayClass = isMultiMonth ? "nextMonthDay hidden" : "nextMonthDay";
1111
+ var dayNumber = prevMonthDays + 1 - firstOfMonth, dayIndex = 0;
1112
+ // prepend days from the ending of previous month
1113
+ for (; dayNumber <= prevMonthDays; dayNumber++, dayIndex++) {
1114
+ days.appendChild(createDay(prevMonthDayClass, new Date(year, month - 1, dayNumber), dayNumber, dayIndex));
1115
+ }
1116
+ // Start at 1 since there is no 0th day
1117
+ for (dayNumber = 1; dayNumber <= daysInMonth; dayNumber++, dayIndex++) {
1118
+ days.appendChild(createDay("", new Date(year, month, dayNumber), dayNumber, dayIndex));
1119
+ }
1120
+ // append days from the next month
1121
+ for (var dayNum = daysInMonth + 1; dayNum <= 42 - firstOfMonth &&
1122
+ (self.config.showMonths === 1 || dayIndex % 7 !== 0); dayNum++, dayIndex++) {
1123
+ days.appendChild(createDay(nextMonthDayClass, new Date(year, month + 1, dayNum % daysInMonth), dayNum, dayIndex));
1124
+ }
1125
+ //updateNavigationCurrentMonth();
1126
+ var dayContainer = createElement("div", "dayContainer");
1127
+ dayContainer.appendChild(days);
1128
+ return dayContainer;
1129
+ }
1130
+ function buildDays() {
1131
+ if (self.daysContainer === undefined) {
1132
+ return;
1133
+ }
1134
+ clearNode(self.daysContainer);
1135
+ // TODO: week numbers for each month
1136
+ if (self.weekNumbers)
1137
+ clearNode(self.weekNumbers);
1138
+ var frag = document.createDocumentFragment();
1139
+ for (var i = 0; i < self.config.showMonths; i++) {
1140
+ var d = new Date(self.currentYear, self.currentMonth, 1);
1141
+ d.setMonth(self.currentMonth + i);
1142
+ frag.appendChild(buildMonthDays(d.getFullYear(), d.getMonth()));
1143
+ }
1144
+ self.daysContainer.appendChild(frag);
1145
+ self.days = self.daysContainer.firstChild;
1146
+ if (self.config.mode === "range" && self.selectedDates.length === 1) {
1147
+ onMouseOver();
1148
+ }
1149
  }
1150
+ function buildMonthSwitch() {
1151
+ if (self.config.showMonths > 1 ||
1152
+ self.config.monthSelectorType !== "dropdown")
1153
+ return;
1154
+ var shouldBuildMonth = function (month) {
1155
+ if (self.config.minDate !== undefined &&
1156
+ self.currentYear === self.config.minDate.getFullYear() &&
1157
+ month < self.config.minDate.getMonth()) {
1158
+ return false;
1159
+ }
1160
+ return !(self.config.maxDate !== undefined &&
1161
+ self.currentYear === self.config.maxDate.getFullYear() &&
1162
+ month > self.config.maxDate.getMonth());
1163
+ };
1164
+ self.monthsDropdownContainer.tabIndex = -1;
1165
+ self.monthsDropdownContainer.innerHTML = "";
1166
+ for (var i = 0; i < 12; i++) {
1167
+ if (!shouldBuildMonth(i))
1168
+ continue;
1169
+ var month = createElement("option", "flatpickr-monthDropdown-month");
1170
+ month.value = new Date(self.currentYear, i).getMonth().toString();
1171
+ month.textContent = monthToStr(i, self.config.shorthandCurrentMonth, self.l10n);
1172
+ month.tabIndex = -1;
1173
+ if (self.currentMonth === i) {
1174
+ month.selected = true;
1175
+ }
1176
+ self.monthsDropdownContainer.appendChild(month);
1177
+ }
1178
  }
1179
+ function buildMonth() {
1180
+ var container = createElement("div", "flatpickr-month");
1181
+ var monthNavFragment = window.document.createDocumentFragment();
1182
+ var monthElement;
1183
+ if (self.config.showMonths > 1 ||
1184
+ self.config.monthSelectorType === "static") {
1185
+ monthElement = createElement("span", "cur-month");
1186
+ }
1187
+ else {
1188
+ self.monthsDropdownContainer = createElement("select", "flatpickr-monthDropdown-months");
1189
+ bind(self.monthsDropdownContainer, "change", function (e) {
1190
+ var target = e.target;
1191
+ var selectedMonth = parseInt(target.value, 10);
1192
+ self.changeMonth(selectedMonth - self.currentMonth);
1193
+ triggerEvent("onMonthChange");
1194
+ });
1195
+ buildMonthSwitch();
1196
+ monthElement = self.monthsDropdownContainer;
1197
+ }
1198
+ var yearInput = createNumberInput("cur-year", { tabindex: "-1" });
1199
+ var yearElement = yearInput.getElementsByTagName("input")[0];
1200
+ yearElement.setAttribute("aria-label", self.l10n.yearAriaLabel);
1201
+ if (self.config.minDate) {
1202
+ yearElement.setAttribute("min", self.config.minDate.getFullYear().toString());
1203
+ }
1204
+ if (self.config.maxDate) {
1205
+ yearElement.setAttribute("max", self.config.maxDate.getFullYear().toString());
1206
+ yearElement.disabled =
1207
+ !!self.config.minDate &&
1208
+ self.config.minDate.getFullYear() === self.config.maxDate.getFullYear();
1209
+ }
1210
+ var currentMonth = createElement("div", "flatpickr-current-month");
1211
+ currentMonth.appendChild(monthElement);
1212
+ currentMonth.appendChild(yearInput);
1213
+ monthNavFragment.appendChild(currentMonth);
1214
+ container.appendChild(monthNavFragment);
1215
+ return {
1216
+ container: container,
1217
+ yearElement: yearElement,
1218
+ monthElement: monthElement
1219
+ };
1220
+ }
1221
+ function buildMonths() {
1222
+ clearNode(self.monthNav);
1223
+ self.monthNav.appendChild(self.prevMonthNav);
1224
+ if (self.config.showMonths) {
1225
+ self.yearElements = [];
1226
+ self.monthElements = [];
1227
+ }
1228
+ for (var m = self.config.showMonths; m--;) {
1229
+ var month = buildMonth();
1230
+ self.yearElements.push(month.yearElement);
1231
+ self.monthElements.push(month.monthElement);
1232
+ self.monthNav.appendChild(month.container);
1233
+ }
1234
+ self.monthNav.appendChild(self.nextMonthNav);
1235
+ }
1236
+ function buildMonthNav() {
1237
+ self.monthNav = createElement("div", "flatpickr-months");
1238
+ self.yearElements = [];
1239
+ self.monthElements = [];
1240
+ self.prevMonthNav = createElement("span", "flatpickr-prev-month");
1241
+ self.prevMonthNav.innerHTML = self.config.prevArrow;
1242
+ self.nextMonthNav = createElement("span", "flatpickr-next-month");
1243
+ self.nextMonthNav.innerHTML = self.config.nextArrow;
1244
+ buildMonths();
1245
+ Object.defineProperty(self, "_hidePrevMonthArrow", {
1246
+ get: function () { return self.__hidePrevMonthArrow; },
1247
+ set: function (bool) {
1248
+ if (self.__hidePrevMonthArrow !== bool) {
1249
+ toggleClass(self.prevMonthNav, "flatpickr-disabled", bool);
1250
+ self.__hidePrevMonthArrow = bool;
1251
+ }
1252
+ }
1253
+ });
1254
+ Object.defineProperty(self, "_hideNextMonthArrow", {
1255
+ get: function () { return self.__hideNextMonthArrow; },
1256
+ set: function (bool) {
1257
+ if (self.__hideNextMonthArrow !== bool) {
1258
+ toggleClass(self.nextMonthNav, "flatpickr-disabled", bool);
1259
+ self.__hideNextMonthArrow = bool;
1260
+ }
1261
+ }
1262
+ });
1263
+ self.currentYearElement = self.yearElements[0];
1264
+ updateNavigationCurrentMonth();
1265
+ return self.monthNav;
1266
+ }
1267
+ function buildTime() {
1268
+ self.calendarContainer.classList.add("hasTime");
1269
+ if (self.config.noCalendar)
1270
+ self.calendarContainer.classList.add("noCalendar");
1271
+ self.timeContainer = createElement("div", "flatpickr-time");
1272
+ self.timeContainer.tabIndex = -1;
1273
+ var separator = createElement("span", "flatpickr-time-separator", ":");
1274
+ var hourInput = createNumberInput("flatpickr-hour", {
1275
+ "aria-label": self.l10n.hourAriaLabel
1276
+ });
1277
+ self.hourElement = hourInput.getElementsByTagName("input")[0];
1278
+ var minuteInput = createNumberInput("flatpickr-minute", {
1279
+ "aria-label": self.l10n.minuteAriaLabel
1280
+ });
1281
+ self.minuteElement = minuteInput.getElementsByTagName("input")[0];
1282
+ self.hourElement.tabIndex = self.minuteElement.tabIndex = -1;
1283
+ self.hourElement.value = pad(self.latestSelectedDateObj
1284
+ ? self.latestSelectedDateObj.getHours()
1285
+ : self.config.time_24hr
1286
+ ? self.config.defaultHour
1287
+ : military2ampm(self.config.defaultHour));
1288
+ self.minuteElement.value = pad(self.latestSelectedDateObj
1289
+ ? self.latestSelectedDateObj.getMinutes()
1290
+ : self.config.defaultMinute);
1291
+ self.hourElement.setAttribute("step", self.config.hourIncrement.toString());
1292
+ self.minuteElement.setAttribute("step", self.config.minuteIncrement.toString());
1293
+ self.hourElement.setAttribute("min", self.config.time_24hr ? "0" : "1");
1294
+ self.hourElement.setAttribute("max", self.config.time_24hr ? "23" : "12");
1295
+ self.minuteElement.setAttribute("min", "0");
1296
+ self.minuteElement.setAttribute("max", "59");
1297
+ self.timeContainer.appendChild(hourInput);
1298
+ self.timeContainer.appendChild(separator);
1299
+ self.timeContainer.appendChild(minuteInput);
1300
+ if (self.config.time_24hr)
1301
+ self.timeContainer.classList.add("time24hr");
1302
+ if (self.config.enableSeconds) {
1303
+ self.timeContainer.classList.add("hasSeconds");
1304
+ var secondInput = createNumberInput("flatpickr-second");
1305
+ self.secondElement = secondInput.getElementsByTagName("input")[0];
1306
+ self.secondElement.value = pad(self.latestSelectedDateObj
1307
+ ? self.latestSelectedDateObj.getSeconds()
1308
+ : self.config.defaultSeconds);
1309
+ self.secondElement.setAttribute("step", self.minuteElement.getAttribute("step"));
1310
+ self.secondElement.setAttribute("min", "0");
1311
+ self.secondElement.setAttribute("max", "59");
1312
+ self.timeContainer.appendChild(createElement("span", "flatpickr-time-separator", ":"));
1313
+ self.timeContainer.appendChild(secondInput);
1314
+ }
1315
+ if (!self.config.time_24hr) {
1316
+ // add self.amPM if appropriate
1317
+ self.amPM = createElement("span", "flatpickr-am-pm", self.l10n.amPM[int((self.latestSelectedDateObj
1318
+ ? self.hourElement.value
1319
+ : self.config.defaultHour) > 11)]);
1320
+ self.amPM.title = self.l10n.toggleTitle;
1321
+ self.amPM.tabIndex = -1;
1322
+ self.timeContainer.appendChild(self.amPM);
1323
+ }
1324
+ return self.timeContainer;
1325
+ }
1326
+ function buildWeekdays() {
1327
+ if (!self.weekdayContainer)
1328
+ self.weekdayContainer = createElement("div", "flatpickr-weekdays");
1329
+ else
1330
+ clearNode(self.weekdayContainer);
1331
+ for (var i = self.config.showMonths; i--;) {
1332
+ var container = createElement("div", "flatpickr-weekdaycontainer");
1333
+ self.weekdayContainer.appendChild(container);
1334
+ }
1335
+ updateWeekdays();
1336
+ return self.weekdayContainer;
1337
  }
1338
+ function updateWeekdays() {
1339
+ if (!self.weekdayContainer) {
1340
+ return;
1341
+ }
1342
+ var firstDayOfWeek = self.l10n.firstDayOfWeek;
1343
+ var weekdays = self.l10n.weekdays.shorthand.slice();
1344
+ if (firstDayOfWeek > 0 && firstDayOfWeek < weekdays.length) {
1345
+ weekdays = weekdays.splice(firstDayOfWeek, weekdays.length).concat(weekdays.splice(0, firstDayOfWeek));
1346
+ }
1347
+ for (var i = self.config.showMonths; i--;) {
1348
+ self.weekdayContainer.children[i].innerHTML = "\n <span class='flatpickr-weekday'>\n " + weekdays.join("</span><span class='flatpickr-weekday'>") + "\n </span>\n ";
1349
+ }
 
1350
  }
1351
+ /* istanbul ignore next */
1352
+ function buildWeeks() {
1353
+ self.calendarContainer.classList.add("hasWeeks");
1354
+ var weekWrapper = createElement("div", "flatpickr-weekwrapper");
1355
+ weekWrapper.appendChild(createElement("span", "flatpickr-weekday", self.l10n.weekAbbreviation));
1356
+ var weekNumbers = createElement("div", "flatpickr-weeks");
1357
+ weekWrapper.appendChild(weekNumbers);
1358
+ return {
1359
+ weekWrapper: weekWrapper,
1360
+ weekNumbers: weekNumbers
1361
+ };
1362
+ }
1363
+ function changeMonth(value, isOffset) {
1364
+ if (isOffset === void 0) { isOffset = true; }
1365
+ var delta = isOffset ? value : value - self.currentMonth;
1366
+ if ((delta < 0 && self._hidePrevMonthArrow === true) ||
1367
+ (delta > 0 && self._hideNextMonthArrow === true))
1368
+ return;
1369
+ self.currentMonth += delta;
1370
+ if (self.currentMonth < 0 || self.currentMonth > 11) {
1371
+ self.currentYear += self.currentMonth > 11 ? 1 : -1;
1372
+ self.currentMonth = (self.currentMonth + 12) % 12;
1373
+ triggerEvent("onYearChange");
1374
+ buildMonthSwitch();
1375
+ }
1376
+ buildDays();
1377
+ triggerEvent("onMonthChange");
1378
+ updateNavigationCurrentMonth();
1379
+ }
1380
+ function clear(triggerChangeEvent, toInitial) {
1381
+ if (triggerChangeEvent === void 0) { triggerChangeEvent = true; }
1382
+ if (toInitial === void 0) { toInitial = true; }
1383
+ self.input.value = "";
1384
+ if (self.altInput !== undefined)
1385
+ self.altInput.value = "";
1386
+ if (self.mobileInput !== undefined)
1387
+ self.mobileInput.value = "";
1388
+ self.selectedDates = [];
1389
+ self.latestSelectedDateObj = undefined;
1390
+ if (toInitial === true) {
1391
+ self.currentYear = self._initialDate.getFullYear();
1392
+ self.currentMonth = self._initialDate.getMonth();
1393
+ }
1394
+ self.showTimeInput = false;
1395
+ if (self.config.enableTime === true) {
1396
+ setDefaultHours();
1397
+ }
1398
+ self.redraw();
1399
+ if (triggerChangeEvent)
1400
+ // triggerChangeEvent is true (default) or an Event
1401
+ triggerEvent("onChange");
1402
+ }
1403
+ function close() {
1404
+ self.isOpen = false;
1405
+ if (!self.isMobile) {
1406
+ if (self.calendarContainer !== undefined) {
1407
+ self.calendarContainer.classList.remove("open");
1408
+ }
1409
+ if (self._input !== undefined) {
1410
+ self._input.classList.remove("active");
1411
+ }
1412
+ }
1413
+ triggerEvent("onClose");
1414
+ }
1415
+ function destroy() {
1416
+ if (self.config !== undefined)
1417
+ triggerEvent("onDestroy");
1418
+ for (var i = self._handlers.length; i--;) {
1419
+ var h = self._handlers[i];
1420
+ h.element.removeEventListener(h.event, h.handler, h.options);
1421
+ }
1422
+ self._handlers = [];
1423
+ if (self.mobileInput) {
1424
+ if (self.mobileInput.parentNode)
1425
+ self.mobileInput.parentNode.removeChild(self.mobileInput);
1426
+ self.mobileInput = undefined;
1427
+ }
1428
+ else if (self.calendarContainer && self.calendarContainer.parentNode) {
1429
+ if (self.config.static && self.calendarContainer.parentNode) {
1430
+ var wrapper = self.calendarContainer.parentNode;
1431
+ wrapper.lastChild && wrapper.removeChild(wrapper.lastChild);
1432
+ if (wrapper.parentNode) {
1433
+ while (wrapper.firstChild)
1434
+ wrapper.parentNode.insertBefore(wrapper.firstChild, wrapper);
1435
+ wrapper.parentNode.removeChild(wrapper);
1436
+ }
1437
+ }
1438
+ else
1439
+ self.calendarContainer.parentNode.removeChild(self.calendarContainer);
1440
+ }
1441
+ if (self.altInput) {
1442
+ self.input.type = "text";
1443
+ if (self.altInput.parentNode)
1444
+ self.altInput.parentNode.removeChild(self.altInput);
1445
+ delete self.altInput;
1446
+ }
1447
+ if (self.input) {
1448
+ self.input.type = self.input._type;
1449
+ self.input.classList.remove("flatpickr-input");
1450
+ self.input.removeAttribute("readonly");
1451
+ self.input.value = "";
1452
+ }
1453
+ [
1454
+ "_showTimeInput",
1455
+ "latestSelectedDateObj",
1456
+ "_hideNextMonthArrow",
1457
+ "_hidePrevMonthArrow",
1458
+ "__hideNextMonthArrow",
1459
+ "__hidePrevMonthArrow",
1460
+ "isMobile",
1461
+ "isOpen",
1462
+ "selectedDateElem",
1463
+ "minDateHasTime",
1464
+ "maxDateHasTime",
1465
+ "days",
1466
+ "daysContainer",
1467
+ "_input",
1468
+ "_positionElement",
1469
+ "innerContainer",
1470
+ "rContainer",
1471
+ "monthNav",
1472
+ "todayDateElem",
1473
+ "calendarContainer",
1474
+ "weekdayContainer",
1475
+ "prevMonthNav",
1476
+ "nextMonthNav",
1477
+ "monthsDropdownContainer",
1478
+ "currentMonthElement",
1479
+ "currentYearElement",
1480
+ "navigationCurrentMonth",
1481
+ "selectedDateElem",
1482
+ "config",
1483
+ ].forEach(function (k) {
1484
+ try {
1485
+ delete self[k];
1486
+ }
1487
+ catch (_) { }
1488
  });
 
 
 
 
 
 
1489
  }
1490
+ function isCalendarElem(elem) {
1491
+ if (self.config.appendTo && self.config.appendTo.contains(elem))
1492
+ return true;
1493
+ return self.calendarContainer.contains(elem);
1494
+ }
1495
+ function documentClick(e) {
1496
+ if (self.isOpen && !self.config.inline) {
1497
+ var eventTarget_1 = getEventTarget(e);
1498
+ var isCalendarElement = isCalendarElem(eventTarget_1);
1499
+ var isInput = eventTarget_1 === self.input ||
1500
+ eventTarget_1 === self.altInput ||
1501
+ self.element.contains(eventTarget_1) ||
1502
+ // web components
1503
+ // e.path is not present in all browsers. circumventing typechecks
1504
+ (e.path &&
1505
+ e.path.indexOf &&
1506
+ (~e.path.indexOf(self.input) ||
1507
+ ~e.path.indexOf(self.altInput)));
1508
+ var lostFocus = e.type === "blur"
1509
+ ? isInput &&
1510
+ e.relatedTarget &&
1511
+ !isCalendarElem(e.relatedTarget)
1512
+ : !isInput &&
1513
+ !isCalendarElement &&
1514
+ !isCalendarElem(e.relatedTarget);
1515
+ var isIgnored = !self.config.ignoredFocusElements.some(function (elem) {
1516
+ return elem.contains(eventTarget_1);
1517
+ });
1518
+ if (lostFocus && isIgnored) {
1519
+ if (self.timeContainer !== undefined &&
1520
+ self.minuteElement !== undefined &&
1521
+ self.hourElement !== undefined) {
1522
+ updateTime();
1523
+ }
1524
+ self.close();
1525
+ if (self.config.mode === "range" && self.selectedDates.length === 1) {
1526
+ self.clear(false);
1527
+ self.redraw();
1528
+ }
1529
+ }
1530
+ }
1531
  }
1532
+ function changeYear(newYear) {
1533
+ if (!newYear ||
1534
+ (self.config.minDate && newYear < self.config.minDate.getFullYear()) ||
1535
+ (self.config.maxDate && newYear > self.config.maxDate.getFullYear()))
1536
+ return;
1537
+ var newYearNum = newYear, isNewYear = self.currentYear !== newYearNum;
1538
+ self.currentYear = newYearNum || self.currentYear;
1539
+ if (self.config.maxDate &&
1540
+ self.currentYear === self.config.maxDate.getFullYear()) {
1541
+ self.currentMonth = Math.min(self.config.maxDate.getMonth(), self.currentMonth);
1542
+ }
1543
+ else if (self.config.minDate &&
1544
+ self.currentYear === self.config.minDate.getFullYear()) {
1545
+ self.currentMonth = Math.max(self.config.minDate.getMonth(), self.currentMonth);
1546
+ }
1547
+ if (isNewYear) {
1548
+ self.redraw();
1549
+ triggerEvent("onYearChange");
1550
+ buildMonthSwitch();
1551
+ }
1552
  }
1553
+ function isEnabled(date, timeless) {
1554
+ if (timeless === void 0) { timeless = true; }
1555
+ var dateToCheck = self.parseDate(date, undefined, timeless); // timeless
1556
+ if ((self.config.minDate &&
1557
+ dateToCheck &&
1558
+ compareDates(dateToCheck, self.config.minDate, timeless !== undefined ? timeless : !self.minDateHasTime) < 0) ||
1559
+ (self.config.maxDate &&
1560
+ dateToCheck &&
1561
+ compareDates(dateToCheck, self.config.maxDate, timeless !== undefined ? timeless : !self.maxDateHasTime) > 0))
1562
+ return false;
1563
+ if (self.config.enable.length === 0 && self.config.disable.length === 0)
1564
+ return true;
1565
+ if (dateToCheck === undefined)
1566
+ return false;
1567
+ var bool = self.config.enable.length > 0, array = bool ? self.config.enable : self.config.disable;
1568
+ for (var i = 0, d = void 0; i < array.length; i++) {
1569
+ d = array[i];
1570
+ if (typeof d === "function" &&
1571
+ d(dateToCheck) // disabled by function
1572
+ )
1573
+ return bool;
1574
+ else if (d instanceof Date &&
1575
+ dateToCheck !== undefined &&
1576
+ d.getTime() === dateToCheck.getTime())
1577
+ // disabled by date
1578
+ return bool;
1579
+ else if (typeof d === "string" && dateToCheck !== undefined) {
1580
+ // disabled by date string
1581
+ var parsed = self.parseDate(d, undefined, true);
1582
+ return parsed && parsed.getTime() === dateToCheck.getTime()
1583
+ ? bool
1584
+ : !bool;
1585
+ }
1586
+ else if (
1587
+ // disabled by range
1588
+ typeof d === "object" &&
1589
+ dateToCheck !== undefined &&
1590
+ d.from &&
1591
+ d.to &&
1592
+ dateToCheck.getTime() >= d.from.getTime() &&
1593
+ dateToCheck.getTime() <= d.to.getTime())
1594
+ return bool;
1595
+ }
1596
+ return !bool;
1597
+ }
1598
+ function isInView(elem) {
1599
+ if (self.daysContainer !== undefined)
1600
+ return (elem.className.indexOf("hidden") === -1 &&
1601
+ self.daysContainer.contains(elem));
1602
+ return false;
1603
+ }
1604
+ function onKeyDown(e) {
1605
+ // e.key e.keyCode
1606
+ // "Backspace" 8
1607
+ // "Tab" 9
1608
+ // "Enter" 13
1609
+ // "Escape" (IE "Esc") 27
1610
+ // "ArrowLeft" (IE "Left") 37
1611
+ // "ArrowUp" (IE "Up") 38
1612
+ // "ArrowRight" (IE "Right") 39
1613
+ // "ArrowDown" (IE "Down") 40
1614
+ // "Delete" (IE "Del") 46
1615
+ var isInput = e.target === self._input;
1616
+ var allowInput = self.config.allowInput;
1617
+ var allowKeydown = self.isOpen && (!allowInput || !isInput);
1618
+ var allowInlineKeydown = self.config.inline && isInput && !allowInput;
1619
+ if (e.keyCode === 13 && isInput) {
1620
+ if (allowInput) {
1621
+ self.setDate(self._input.value, true, e.target === self.altInput
1622
+ ? self.config.altFormat
1623
+ : self.config.dateFormat);
1624
+ return e.target.blur();
1625
+ }
1626
+ else {
1627
+ self.open();
1628
+ }
1629
+ }
1630
+ else if (isCalendarElem(e.target) ||
1631
+ allowKeydown ||
1632
+ allowInlineKeydown) {
1633
+ var isTimeObj = !!self.timeContainer &&
1634
+ self.timeContainer.contains(e.target);
1635
+ switch (e.keyCode) {
1636
+ case 13:
1637
+ if (isTimeObj) {
1638
+ e.preventDefault();
1639
+ updateTime();
1640
+ focusAndClose();
1641
+ }
1642
+ else
1643
+ selectDate(e);
1644
+ break;
1645
+ case 27: // escape
1646
+ e.preventDefault();
1647
+ focusAndClose();
1648
+ break;
1649
+ case 8:
1650
+ case 46:
1651
+ if (isInput && !self.config.allowInput) {
1652
+ e.preventDefault();
1653
+ self.clear();
1654
+ }
1655
+ break;
1656
+ case 37:
1657
+ case 39:
1658
+ if (!isTimeObj && !isInput) {
1659
+ e.preventDefault();
1660
+ if (self.daysContainer !== undefined &&
1661
+ (allowInput === false ||
1662
+ (document.activeElement && isInView(document.activeElement)))) {
1663
+ var delta_1 = e.keyCode === 39 ? 1 : -1;
1664
+ if (!e.ctrlKey)
1665
+ focusOnDay(undefined, delta_1);
1666
+ else {
1667
+ e.stopPropagation();
1668
+ changeMonth(delta_1);
1669
+ focusOnDay(getFirstAvailableDay(1), 0);
1670
+ }
1671
+ }
1672
+ }
1673
+ else if (self.hourElement)
1674
+ self.hourElement.focus();
1675
+ break;
1676
+ case 38:
1677
+ case 40:
1678
+ e.preventDefault();
1679
+ var delta = e.keyCode === 40 ? 1 : -1;
1680
+ if ((self.daysContainer && e.target.$i !== undefined) ||
1681
+ e.target === self.input ||
1682
+ e.target === self.altInput) {
1683
+ if (e.ctrlKey) {
1684
+ e.stopPropagation();
1685
+ changeYear(self.currentYear - delta);
1686
+ focusOnDay(getFirstAvailableDay(1), 0);
1687
+ }
1688
+ else if (!isTimeObj)
1689
+ focusOnDay(undefined, delta * 7);
1690
+ }
1691
+ else if (e.target === self.currentYearElement) {
1692
+ changeYear(self.currentYear - delta);
1693
+ }
1694
+ else if (self.config.enableTime) {
1695
+ if (!isTimeObj && self.hourElement)
1696
+ self.hourElement.focus();
1697
+ updateTime(e);
1698
+ self._debouncedChange();
1699
+ }
1700
+ break;
1701
+ case 9:
1702
+ if (isTimeObj) {
1703
+ var elems = [
1704
+ self.hourElement,
1705
+ self.minuteElement,
1706
+ self.secondElement,
1707
+ self.amPM,
1708
+ ]
1709
+ .concat(self.pluginElements)
1710
+ .filter(function (x) { return x; });
1711
+ var i = elems.indexOf(e.target);
1712
+ if (i !== -1) {
1713
+ var target = elems[i + (e.shiftKey ? -1 : 1)];
1714
+ e.preventDefault();
1715
+ (target || self._input).focus();
1716
+ }
1717
+ }
1718
+ else if (!self.config.noCalendar &&
1719
+ self.daysContainer &&
1720
+ self.daysContainer.contains(e.target) &&
1721
+ e.shiftKey) {
1722
+ e.preventDefault();
1723
+ self._input.focus();
1724
+ }
1725
+ break;
1726
+ default:
1727
+ break;
1728
+ }
1729
+ }
1730
+ if (self.amPM !== undefined && e.target === self.amPM) {
1731
+ switch (e.key) {
1732
+ case self.l10n.amPM[0].charAt(0):
1733
+ case self.l10n.amPM[0].charAt(0).toLowerCase():
1734
+ self.amPM.textContent = self.l10n.amPM[0];
1735
+ setHoursFromInputs();
1736
+ updateValue();
1737
+ break;
1738
+ case self.l10n.amPM[1].charAt(0):
1739
+ case self.l10n.amPM[1].charAt(0).toLowerCase():
1740
+ self.amPM.textContent = self.l10n.amPM[1];
1741
+ setHoursFromInputs();
1742
+ updateValue();
1743
+ break;
1744
+ }
1745
+ }
1746
+ if (isInput || isCalendarElem(e.target)) {
1747
+ triggerEvent("onKeyDown", e);
1748
+ }
1749
  }
1750
+ function onMouseOver(elem) {
1751
+ if (self.selectedDates.length !== 1 ||
1752
+ (elem &&
1753
+ (!elem.classList.contains("flatpickr-day") ||
1754
+ elem.classList.contains("flatpickr-disabled"))))
1755
+ return;
1756
+ var hoverDate = elem
1757
+ ? elem.dateObj.getTime()
1758
+ : 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());
1759
+ var containsDisabled = false;
1760
+ var minRange = 0, maxRange = 0;
1761
+ for (var t = rangeStartDate; t < rangeEndDate; t += duration.DAY) {
1762
+ if (!isEnabled(new Date(t), true)) {
1763
+ containsDisabled =
1764
+ containsDisabled || (t > rangeStartDate && t < rangeEndDate);
1765
+ if (t < initialDate && (!minRange || t > minRange))
1766
+ minRange = t;
1767
+ else if (t > initialDate && (!maxRange || t < maxRange))
1768
+ maxRange = t;
1769
+ }
1770
+ }
1771
+ for (var m = 0; m < self.config.showMonths; m++) {
1772
+ var month = self.daysContainer.children[m];
1773
+ var _loop_1 = function (i, l) {
1774
+ var dayElem = month.children[i], date = dayElem.dateObj;
1775
+ var timestamp = date.getTime();
1776
+ var outOfRange = (minRange > 0 && timestamp < minRange) ||
1777
+ (maxRange > 0 && timestamp > maxRange);
1778
+ if (outOfRange) {
1779
+ dayElem.classList.add("notAllowed");
1780
+ ["inRange", "startRange", "endRange"].forEach(function (c) {
1781
+ dayElem.classList.remove(c);
1782
+ });
1783
+ return "continue";
1784
+ }
1785
+ else if (containsDisabled && !outOfRange)
1786
+ return "continue";
1787
+ ["startRange", "inRange", "endRange", "notAllowed"].forEach(function (c) {
1788
+ dayElem.classList.remove(c);
1789
+ });
1790
+ if (elem !== undefined) {
1791
+ elem.classList.add(hoverDate <= self.selectedDates[0].getTime()
1792
+ ? "startRange"
1793
+ : "endRange");
1794
+ if (initialDate < hoverDate && timestamp === initialDate)
1795
+ dayElem.classList.add("startRange");
1796
+ else if (initialDate > hoverDate && timestamp === initialDate)
1797
+ dayElem.classList.add("endRange");
1798
+ if (timestamp >= minRange &&
1799
+ (maxRange === 0 || timestamp <= maxRange) &&
1800
+ isBetween(timestamp, initialDate, hoverDate))
1801
+ dayElem.classList.add("inRange");
1802
+ }
1803
+ };
1804
+ for (var i = 0, l = month.children.length; i < l; i++) {
1805
+ _loop_1(i, l);
1806
+ }
1807
+ }
1808
  }
1809
+ function onResize() {
1810
+ if (self.isOpen && !self.config.static && !self.config.inline)
1811
+ positionCalendar();
1812
  }
1813
+ function setDefaultTime() {
1814
+ self.setDate(self.config.minDate !== undefined
1815
+ ? new Date(self.config.minDate.getTime())
1816
+ : new Date(), true);
1817
+ setDefaultHours();
1818
+ updateValue();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1819
  }
1820
+ function open(e, positionElement) {
1821
+ if (positionElement === void 0) { positionElement = self._positionElement; }
1822
+ if (self.isMobile === true) {
1823
+ if (e) {
1824
+ e.preventDefault();
1825
+ e.target && e.target.blur();
1826
+ }
1827
+ if (self.mobileInput !== undefined) {
1828
+ self.mobileInput.focus();
1829
+ self.mobileInput.click();
1830
+ }
1831
+ triggerEvent("onOpen");
1832
+ return;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1833
  }
1834
+ if (self._input.disabled || self.config.inline)
1835
+ return;
1836
+ var wasOpen = self.isOpen;
1837
+ self.isOpen = true;
1838
+ if (!wasOpen) {
1839
+ self.calendarContainer.classList.add("open");
1840
+ self._input.classList.add("active");
1841
+ triggerEvent("onOpen");
1842
+ positionCalendar(positionElement);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1843
  }
1844
+ if (self.config.enableTime === true && self.config.noCalendar === true) {
1845
+ if (self.selectedDates.length === 0) {
1846
+ setDefaultTime();
1847
+ }
1848
+ if (self.config.allowInput === false &&
1849
+ (e === undefined ||
1850
+ !self.timeContainer.contains(e.relatedTarget))) {
1851
+ setTimeout(function () { return self.hourElement.select(); }, 50);
1852
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1853
  }
 
1854
  }
1855
+ function minMaxDateSetter(type) {
1856
+ return function (date) {
1857
+ var dateObj = (self.config["_" + type + "Date"] = self.parseDate(date, self.config.dateFormat));
1858
+ var inverseDateObj = self.config["_" + (type === "min" ? "max" : "min") + "Date"];
1859
+ if (dateObj !== undefined) {
1860
+ self[type === "min" ? "minDateHasTime" : "maxDateHasTime"] =
1861
+ dateObj.getHours() > 0 ||
1862
+ dateObj.getMinutes() > 0 ||
1863
+ dateObj.getSeconds() > 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1864
  }
1865
+ if (self.selectedDates) {
1866
+ self.selectedDates = self.selectedDates.filter(function (d) { return isEnabled(d); });
1867
+ if (!self.selectedDates.length && type === "min")
1868
+ setHoursFromDate(dateObj);
1869
+ updateValue();
1870
+ }
1871
+ if (self.daysContainer) {
1872
+ redraw();
1873
+ if (dateObj !== undefined)
1874
+ self.currentYearElement[type] = dateObj.getFullYear().toString();
1875
+ else
1876
+ self.currentYearElement.removeAttribute(type);
1877
+ self.currentYearElement.disabled =
1878
+ !!inverseDateObj &&
1879
+ dateObj !== undefined &&
1880
+ inverseDateObj.getFullYear() === dateObj.getFullYear();
1881
+ }
1882
+ };
1883
+ }
1884
+ function parseConfig() {
1885
+ var boolOpts = [
1886
+ "wrap",
1887
+ "weekNumbers",
1888
+ "allowInput",
1889
+ "clickOpens",
1890
+ "time_24hr",
1891
+ "enableTime",
1892
+ "noCalendar",
1893
+ "altInput",
1894
+ "shorthandCurrentMonth",
1895
+ "inline",
1896
+ "static",
1897
+ "enableSeconds",
1898
+ "disableMobile",
1899
+ ];
1900
+ var userConfig = __assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));
1901
+ var formats = {};
1902
+ self.config.parseDate = userConfig.parseDate;
1903
+ self.config.formatDate = userConfig.formatDate;
1904
+ Object.defineProperty(self.config, "enable", {
1905
+ get: function () { return self.config._enable; },
1906
+ set: function (dates) {
1907
+ self.config._enable = parseDateRules(dates);
1908
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1909
  });
1910
+ Object.defineProperty(self.config, "disable", {
1911
+ get: function () { return self.config._disable; },
1912
+ set: function (dates) {
1913
+ self.config._disable = parseDateRules(dates);
1914
+ }
1915
+ });
1916
+ var timeMode = userConfig.mode === "time";
1917
+ if (!userConfig.dateFormat && (userConfig.enableTime || timeMode)) {
1918
+ var defaultDateFormat = flatpickr.defaultConfig.dateFormat || defaults.dateFormat;
1919
+ formats.dateFormat =
1920
+ userConfig.noCalendar || timeMode
1921
+ ? "H:i" + (userConfig.enableSeconds ? ":S" : "")
1922
+ : defaultDateFormat + " H:i" + (userConfig.enableSeconds ? ":S" : "");
1923
+ }
1924
+ if (userConfig.altInput &&
1925
+ (userConfig.enableTime || timeMode) &&
1926
+ !userConfig.altFormat) {
1927
+ var defaultAltFormat = flatpickr.defaultConfig.altFormat || defaults.altFormat;
1928
+ formats.altFormat =
1929
+ userConfig.noCalendar || timeMode
1930
+ ? "h:i" + (userConfig.enableSeconds ? ":S K" : " K")
1931
+ : defaultAltFormat + (" h:i" + (userConfig.enableSeconds ? ":S" : "") + " K");
1932
+ }
1933
+ if (!userConfig.altInputClass) {
1934
+ self.config.altInputClass =
1935
+ self.input.className + " " + self.config.altInputClass;
1936
+ }
1937
+ Object.defineProperty(self.config, "minDate", {
1938
+ get: function () { return self.config._minDate; },
1939
+ set: minMaxDateSetter("min")
1940
+ });
1941
+ Object.defineProperty(self.config, "maxDate", {
1942
+ get: function () { return self.config._maxDate; },
1943
+ set: minMaxDateSetter("max")
1944
+ });
1945
+ var minMaxTimeSetter = function (type) { return function (val) {
1946
+ self.config[type === "min" ? "_minTime" : "_maxTime"] = self.parseDate(val, "H:i:S");
1947
+ }; };
1948
+ Object.defineProperty(self.config, "minTime", {
1949
+ get: function () { return self.config._minTime; },
1950
+ set: minMaxTimeSetter("min")
1951
+ });
1952
+ Object.defineProperty(self.config, "maxTime", {
1953
+ get: function () { return self.config._maxTime; },
1954
+ set: minMaxTimeSetter("max")
1955
+ });
1956
+ if (userConfig.mode === "time") {
1957
+ self.config.noCalendar = true;
1958
+ self.config.enableTime = true;
1959
+ }
1960
+ Object.assign(self.config, formats, userConfig);
1961
+ for (var i = 0; i < boolOpts.length; i++)
1962
+ self.config[boolOpts[i]] =
1963
+ self.config[boolOpts[i]] === true ||
1964
+ self.config[boolOpts[i]] === "true";
1965
+ HOOKS.filter(function (hook) { return self.config[hook] !== undefined; }).forEach(function (hook) {
1966
+ self.config[hook] = arrayify(self.config[hook] || []).map(bindToInstance);
1967
+ });
1968
+ self.isMobile =
1969
+ !self.config.disableMobile &&
1970
+ !self.config.inline &&
1971
+ self.config.mode === "single" &&
1972
+ !self.config.disable.length &&
1973
+ !self.config.enable.length &&
1974
+ !self.config.weekNumbers &&
1975
+ /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
1976
+ for (var i = 0; i < self.config.plugins.length; i++) {
1977
+ var pluginConf = self.config.plugins[i](self) || {};
1978
+ for (var key in pluginConf) {
1979
+ if (HOOKS.indexOf(key) > -1) {
1980
+ self.config[key] = arrayify(pluginConf[key])
1981
+ .map(bindToInstance)
1982
+ .concat(self.config[key]);
1983
+ }
1984
+ else if (typeof userConfig[key] === "undefined")
1985
+ self.config[key] = pluginConf[key];
1986
+ }
1987
+ }
1988
+ triggerEvent("onParseConfig");
1989
+ }
1990
+ function setupLocale() {
1991
+ if (typeof self.config.locale !== "object" &&
1992
+ typeof flatpickr.l10ns[self.config.locale] === "undefined")
1993
+ self.config.errorHandler(new Error("flatpickr: invalid locale " + self.config.locale));
1994
+ self.l10n = __assign({}, flatpickr.l10ns["default"], (typeof self.config.locale === "object"
1995
+ ? self.config.locale
1996
+ : self.config.locale !== "default"
1997
+ ? flatpickr.l10ns[self.config.locale]
1998
+ : undefined));
1999
+ tokenRegex.K = "(" + self.l10n.amPM[0] + "|" + self.l10n.amPM[1] + "|" + self.l10n.amPM[0].toLowerCase() + "|" + self.l10n.amPM[1].toLowerCase() + ")";
2000
+ var userConfig = __assign({}, instanceConfig, JSON.parse(JSON.stringify(element.dataset || {})));
2001
+ if (userConfig.time_24hr === undefined &&
2002
+ flatpickr.defaultConfig.time_24hr === undefined) {
2003
+ self.config.time_24hr = self.l10n.time_24hr;
2004
+ }
2005
+ self.formatDate = createDateFormatter(self);
2006
+ self.parseDate = createDateParser({ config: self.config, l10n: self.l10n });
2007
+ }
2008
+ function positionCalendar(customPositionElement) {
2009
+ if (self.calendarContainer === undefined)
2010
+ return;
2011
+ triggerEvent("onPreCalendarPosition");
2012
+ var positionElement = customPositionElement || self._positionElement;
2013
+ 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" ||
2014
+ (configPosVertical !== "below" &&
2015
+ distanceFromBottom < calendarHeight &&
2016
+ inputBounds.top > calendarHeight);
2017
+ var top = window.pageYOffset +
2018
+ inputBounds.top +
2019
+ (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);
2020
+ toggleClass(self.calendarContainer, "arrowTop", !showOnTop);
2021
+ toggleClass(self.calendarContainer, "arrowBottom", showOnTop);
2022
+ if (self.config.inline)
2023
+ return;
2024
+ var left = window.pageXOffset +
2025
+ inputBounds.left -
2026
+ (configPosHorizontal != null && configPosHorizontal === "center"
2027
+ ? (calendarWidth - inputBounds.width) / 2
2028
+ : 0);
2029
+ var right = window.document.body.offsetWidth - (window.pageXOffset + inputBounds.right);
2030
+ var rightMost = left + calendarWidth > window.document.body.offsetWidth;
2031
+ var centerMost = right + calendarWidth > window.document.body.offsetWidth;
2032
+ toggleClass(self.calendarContainer, "rightMost", rightMost);
2033
+ if (self.config.static)
2034
+ return;
2035
+ self.calendarContainer.style.top = top + "px";
2036
+ if (!rightMost) {
2037
+ self.calendarContainer.style.left = left + "px";
2038
+ self.calendarContainer.style.right = "auto";
2039
+ }
2040
+ else if (!centerMost) {
2041
+ self.calendarContainer.style.left = "auto";
2042
+ self.calendarContainer.style.right = right + "px";
2043
+ }
2044
+ else {
2045
+ var doc = document.styleSheets[0];
2046
+ // some testing environments don't have css support
2047
+ if (doc === undefined)
2048
+ return;
2049
+ var bodyWidth = window.document.body.offsetWidth;
2050
+ var centerLeft = Math.max(0, bodyWidth / 2 - calendarWidth / 2);
2051
+ var centerBefore = ".flatpickr-calendar.centerMost:before";
2052
+ var centerAfter = ".flatpickr-calendar.centerMost:after";
2053
+ var centerIndex = doc.cssRules.length;
2054
+ var centerStyle = "{left:" + inputBounds.left + "px;right:auto;}";
2055
+ toggleClass(self.calendarContainer, "rightMost", false);
2056
+ toggleClass(self.calendarContainer, "centerMost", true);
2057
+ doc.insertRule(centerBefore + "," + centerAfter + centerStyle, centerIndex);
2058
+ self.calendarContainer.style.left = centerLeft + "px";
2059
+ self.calendarContainer.style.right = "auto";
2060
  }
 
 
 
 
 
 
 
2061
  }
2062
+ function redraw() {
2063
+ if (self.config.noCalendar || self.isMobile)
2064
+ return;
2065
+ updateNavigationCurrentMonth();
2066
+ buildDays();
2067
+ }
2068
+ function focusAndClose() {
2069
+ self._input.focus();
2070
+ if (window.navigator.userAgent.indexOf("MSIE") !== -1 ||
2071
+ navigator.msMaxTouchPoints !== undefined) {
2072
+ // hack - bugs in the way IE handles focus keeps the calendar open
2073
+ setTimeout(self.close, 0);
2074
+ }
2075
+ else {
2076
+ self.close();
2077
+ }
2078
  }
2079
+ function selectDate(e) {
 
 
2080
  e.preventDefault();
2081
+ e.stopPropagation();
2082
+ var isSelectable = function (day) {
2083
+ return day.classList &&
2084
+ day.classList.contains("flatpickr-day") &&
2085
+ !day.classList.contains("flatpickr-disabled") &&
2086
+ !day.classList.contains("notAllowed");
2087
+ };
2088
+ var t = findParent(e.target, isSelectable);
2089
+ if (t === undefined)
2090
+ return;
2091
+ var target = t;
2092
+ var selectedDate = (self.latestSelectedDateObj = new Date(target.dateObj.getTime()));
2093
+ var shouldChangeMonth = (selectedDate.getMonth() < self.currentMonth ||
2094
+ selectedDate.getMonth() >
2095
+ self.currentMonth + self.config.showMonths - 1) &&
2096
+ self.config.mode !== "range";
2097
+ self.selectedDateElem = target;
2098
+ if (self.config.mode === "single")
2099
+ self.selectedDates = [selectedDate];
2100
+ else if (self.config.mode === "multiple") {
2101
+ var selectedIndex = isDateSelected(selectedDate);
2102
+ if (selectedIndex)
2103
+ self.selectedDates.splice(parseInt(selectedIndex), 1);
2104
+ else
2105
+ self.selectedDates.push(selectedDate);
2106
+ }
2107
+ else if (self.config.mode === "range") {
2108
+ if (self.selectedDates.length === 2) {
2109
+ self.clear(false, false);
2110
+ }
2111
+ self.latestSelectedDateObj = selectedDate;
2112
+ self.selectedDates.push(selectedDate);
2113
+ // unless selecting same date twice, sort ascendingly
2114
+ if (compareDates(selectedDate, self.selectedDates[0], true) !== 0)
2115
+ self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
2116
+ }
2117
+ setHoursFromInputs();
2118
+ if (shouldChangeMonth) {
2119
+ var isNewYear = self.currentYear !== selectedDate.getFullYear();
2120
+ self.currentYear = selectedDate.getFullYear();
2121
+ self.currentMonth = selectedDate.getMonth();
2122
+ if (isNewYear) {
2123
+ triggerEvent("onYearChange");
2124
+ buildMonthSwitch();
2125
+ }
2126
+ triggerEvent("onMonthChange");
2127
+ }
2128
+ updateNavigationCurrentMonth();
2129
+ buildDays();
 
 
 
2130
  updateValue();
2131
+ if (self.config.enableTime)
2132
+ setTimeout(function () { return (self.showTimeInput = true); }, 50);
2133
+ // maintain focus
2134
+ if (!shouldChangeMonth &&
2135
+ self.config.mode !== "range" &&
2136
+ self.config.showMonths === 1)
2137
+ focusOnDayElem(target);
2138
+ else if (self.selectedDateElem !== undefined &&
2139
+ self.hourElement === undefined) {
2140
+ self.selectedDateElem && self.selectedDateElem.focus();
2141
+ }
2142
+ if (self.hourElement !== undefined)
2143
+ self.hourElement !== undefined && self.hourElement.focus();
2144
+ if (self.config.closeOnSelect) {
2145
+ var single = self.config.mode === "single" && !self.config.enableTime;
2146
+ var range = self.config.mode === "range" &&
2147
+ self.selectedDates.length === 2 &&
2148
+ !self.config.enableTime;
2149
+ if (single || range) {
2150
+ focusAndClose();
2151
+ }
2152
+ }
2153
+ triggerChange();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2154
  }
2155
+ var CALLBACKS = {
2156
+ locale: [setupLocale, updateWeekdays],
2157
+ showMonths: [buildMonths, setCalendarWidth, buildWeekdays],
2158
+ minDate: [jumpToDate],
2159
+ maxDate: [jumpToDate]
 
 
 
2160
  };
2161
+ function set(option, value) {
2162
+ if (option !== null && typeof option === "object") {
2163
+ Object.assign(self.config, option);
2164
+ for (var key in option) {
2165
+ if (CALLBACKS[key] !== undefined)
2166
+ CALLBACKS[key].forEach(function (x) { return x(); });
2167
+ }
2168
+ }
2169
+ else {
2170
+ self.config[option] = value;
2171
+ if (CALLBACKS[option] !== undefined)
2172
+ CALLBACKS[option].forEach(function (x) { return x(); });
2173
+ else if (HOOKS.indexOf(option) > -1)
2174
+ self.config[option] = arrayify(value);
2175
+ }
2176
+ self.redraw();
2177
+ updateValue(false);
2178
+ }
2179
+ function setSelectedDate(inputDate, format) {
2180
+ var dates = [];
2181
+ if (inputDate instanceof Array)
2182
+ dates = inputDate.map(function (d) { return self.parseDate(d, format); });
2183
+ else if (inputDate instanceof Date || typeof inputDate === "number")
2184
+ dates = [self.parseDate(inputDate, format)];
2185
+ else if (typeof inputDate === "string") {
2186
+ switch (self.config.mode) {
2187
+ case "single":
2188
+ case "time":
2189
+ dates = [self.parseDate(inputDate, format)];
2190
+ break;
2191
+ case "multiple":
2192
+ dates = inputDate
2193
+ .split(self.config.conjunction)
2194
+ .map(function (date) { return self.parseDate(date, format); });
2195
+ break;
2196
+ case "range":
2197
+ dates = inputDate
2198
+ .split(self.l10n.rangeSeparator)
2199
+ .map(function (date) { return self.parseDate(date, format); });
2200
+ break;
2201
+ default:
2202
+ break;
2203
+ }
2204
+ }
2205
+ else
2206
+ self.config.errorHandler(new Error("Invalid date supplied: " + JSON.stringify(inputDate)));
2207
+ self.selectedDates = dates.filter(function (d) { return d instanceof Date && isEnabled(d, false); });
2208
+ if (self.config.mode === "range")
2209
+ self.selectedDates.sort(function (a, b) { return a.getTime() - b.getTime(); });
2210
+ }
2211
+ function setDate(date, triggerChange, format) {
2212
+ if (triggerChange === void 0) { triggerChange = false; }
2213
+ if (format === void 0) { format = self.config.dateFormat; }
2214
+ if ((date !== 0 && !date) || (date instanceof Array && date.length === 0))
2215
+ return self.clear(triggerChange);
2216
+ setSelectedDate(date, format);
2217
+ self.showTimeInput = self.selectedDates.length > 0;
2218
+ self.latestSelectedDateObj =
2219
+ self.selectedDates[self.selectedDates.length - 1];
2220
+ self.redraw();
2221
+ jumpToDate();
2222
+ setHoursFromDate();
2223
+ if (self.selectedDates.length === 0) {
2224
+ self.clear(false);
2225
+ }
2226
+ updateValue(triggerChange);
2227
+ if (triggerChange)
2228
+ triggerEvent("onChange");
2229
+ }
2230
+ function parseDateRules(arr) {
2231
+ return arr
2232
+ .slice()
2233
+ .map(function (rule) {
2234
+ if (typeof rule === "string" ||
2235
+ typeof rule === "number" ||
2236
+ rule instanceof Date) {
2237
+ return self.parseDate(rule, undefined, true);
2238
+ }
2239
+ else if (rule &&
2240
+ typeof rule === "object" &&
2241
+ rule.from &&
2242
+ rule.to)
2243
+ return {
2244
+ from: self.parseDate(rule.from, undefined),
2245
+ to: self.parseDate(rule.to, undefined)
2246
+ };
2247
+ return rule;
2248
+ })
2249
+ .filter(function (x) { return x; }); // remove falsy values
2250
+ }
2251
+ function setupDates() {
2252
+ self.selectedDates = [];
2253
+ self.now = self.parseDate(self.config.now) || new Date();
2254
+ // Workaround IE11 setting placeholder as the input's value
2255
+ var preloadedDate = self.config.defaultDate ||
2256
+ ((self.input.nodeName === "INPUT" ||
2257
+ self.input.nodeName === "TEXTAREA") &&
2258
+ self.input.placeholder &&
2259
+ self.input.value === self.input.placeholder
2260
+ ? null
2261
+ : self.input.value);
2262
+ if (preloadedDate)
2263
+ setSelectedDate(preloadedDate, self.config.dateFormat);
2264
+ self._initialDate =
2265
+ self.selectedDates.length > 0
2266
+ ? self.selectedDates[0]
2267
+ : self.config.minDate &&
2268
+ self.config.minDate.getTime() > self.now.getTime()
2269
+ ? self.config.minDate
2270
+ : self.config.maxDate &&
2271
+ self.config.maxDate.getTime() < self.now.getTime()
2272
+ ? self.config.maxDate
2273
+ : self.now;
2274
+ self.currentYear = self._initialDate.getFullYear();
2275
+ self.currentMonth = self._initialDate.getMonth();
2276
+ if (self.selectedDates.length > 0)
2277
+ self.latestSelectedDateObj = self.selectedDates[0];
2278
+ if (self.config.minTime !== undefined)
2279
+ self.config.minTime = self.parseDate(self.config.minTime, "H:i");
2280
+ if (self.config.maxTime !== undefined)
2281
+ self.config.maxTime = self.parseDate(self.config.maxTime, "H:i");
2282
+ self.minDateHasTime =
2283
+ !!self.config.minDate &&
2284
+ (self.config.minDate.getHours() > 0 ||
2285
+ self.config.minDate.getMinutes() > 0 ||
2286
+ self.config.minDate.getSeconds() > 0);
2287
+ self.maxDateHasTime =
2288
+ !!self.config.maxDate &&
2289
+ (self.config.maxDate.getHours() > 0 ||
2290
+ self.config.maxDate.getMinutes() > 0 ||
2291
+ self.config.maxDate.getSeconds() > 0);
2292
+ Object.defineProperty(self, "showTimeInput", {
2293
+ get: function () { return self._showTimeInput; },
2294
+ set: function (bool) {
2295
+ self._showTimeInput = bool;
2296
+ if (self.calendarContainer)
2297
+ toggleClass(self.calendarContainer, "showTimeInput", bool);
2298
+ self.isOpen && positionCalendar();
2299
+ }
2300
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2301
  }
2302
+ function setupInputs() {
2303
+ self.input = self.config.wrap
2304
+ ? element.querySelector("[data-input]")
2305
+ : element;
2306
+ /* istanbul ignore next */
2307
+ if (!self.input) {
2308
+ self.config.errorHandler(new Error("Invalid input element specified"));
2309
+ return;
2310
+ }
2311
+ // hack: store previous type to restore it after destroy()
2312
+ self.input._type = self.input.type;
2313
+ self.input.type = "text";
2314
+ self.input.classList.add("flatpickr-input");
2315
+ self._input = self.input;
2316
+ if (self.config.altInput) {
2317
+ // replicate self.element
2318
+ self.altInput = createElement(self.input.nodeName, self.config.altInputClass);
2319
+ self._input = self.altInput;
2320
+ self.altInput.placeholder = self.input.placeholder;
2321
+ self.altInput.disabled = self.input.disabled;
2322
+ self.altInput.required = self.input.required;
2323
+ self.altInput.tabIndex = self.input.tabIndex;
2324
+ self.altInput.type = "text";
2325
+ self.input.setAttribute("type", "hidden");
2326
+ if (!self.config.static && self.input.parentNode)
2327
+ self.input.parentNode.insertBefore(self.altInput, self.input.nextSibling);
2328
+ }
2329
+ if (!self.config.allowInput)
2330
+ self._input.setAttribute("readonly", "readonly");
2331
+ self._positionElement = self.config.positionElement || self._input;
2332
+ }
2333
+ function setupMobile() {
2334
+ var inputType = self.config.enableTime
2335
+ ? self.config.noCalendar
2336
+ ? "time"
2337
+ : "datetime-local"
2338
+ : "date";
2339
+ self.mobileInput = createElement("input", self.input.className + " flatpickr-mobile");
2340
+ self.mobileInput.step = self.input.getAttribute("step") || "any";
2341
+ self.mobileInput.tabIndex = 1;
2342
+ self.mobileInput.type = inputType;
2343
+ self.mobileInput.disabled = self.input.disabled;
2344
+ self.mobileInput.required = self.input.required;
2345
+ self.mobileInput.placeholder = self.input.placeholder;
2346
+ self.mobileFormatStr =
2347
+ inputType === "datetime-local"
2348
+ ? "Y-m-d\\TH:i:S"
2349
+ : inputType === "date"
2350
+ ? "Y-m-d"
2351
+ : "H:i:S";
2352
+ if (self.selectedDates.length > 0) {
2353
+ self.mobileInput.defaultValue = self.mobileInput.value = self.formatDate(self.selectedDates[0], self.mobileFormatStr);
2354
+ }
2355
+ if (self.config.minDate)
2356
+ self.mobileInput.min = self.formatDate(self.config.minDate, "Y-m-d");
2357
+ if (self.config.maxDate)
2358
+ self.mobileInput.max = self.formatDate(self.config.maxDate, "Y-m-d");
2359
+ self.input.type = "hidden";
2360
+ if (self.altInput !== undefined)
2361
+ self.altInput.type = "hidden";
2362
+ try {
2363
+ if (self.input.parentNode)
2364
+ self.input.parentNode.insertBefore(self.mobileInput, self.input.nextSibling);
2365
+ }
2366
+ catch (_a) { }
2367
+ bind(self.mobileInput, "change", function (e) {
2368
+ self.setDate(e.target.value, false, self.mobileFormatStr);
2369
+ triggerEvent("onChange");
2370
+ triggerEvent("onClose");
2371
+ });
2372
  }
2373
+ function toggle(e) {
2374
+ if (self.isOpen === true)
2375
+ return self.close();
2376
+ self.open(e);
2377
+ }
2378
+ function triggerEvent(event, data) {
2379
+ // If the instance has been destroyed already, all hooks have been removed
2380
+ if (self.config === undefined)
2381
+ return;
2382
+ var hooks = self.config[event];
2383
+ if (hooks !== undefined && hooks.length > 0) {
2384
+ for (var i = 0; hooks[i] && i < hooks.length; i++)
2385
+ hooks[i](self.selectedDates, self.input.value, self, data);
2386
+ }
2387
+ if (event === "onChange") {
2388
+ self.input.dispatchEvent(createEvent("change"));
2389
+ // many front-end frameworks bind to the input event
2390
+ self.input.dispatchEvent(createEvent("input"));
2391
+ }
2392
  }
2393
+ function createEvent(name) {
2394
+ var e = document.createEvent("Event");
2395
+ e.initEvent(name, true, true);
2396
+ return e;
 
 
 
 
 
 
2397
  }
2398
+ function isDateSelected(date) {
2399
+ for (var i = 0; i < self.selectedDates.length; i++) {
2400
+ if (compareDates(self.selectedDates[i], date) === 0)
2401
+ return "" + i;
2402
+ }
2403
+ return false;
2404
+ }
2405
+ function isDateInRange(date) {
2406
+ if (self.config.mode !== "range" || self.selectedDates.length < 2)
2407
+ return false;
2408
+ return (compareDates(date, self.selectedDates[0]) >= 0 &&
2409
+ compareDates(date, self.selectedDates[1]) <= 0);
2410
+ }
2411
+ function updateNavigationCurrentMonth() {
2412
+ if (self.config.noCalendar || self.isMobile || !self.monthNav)
2413
+ return;
2414
+ self.yearElements.forEach(function (yearElement, i) {
2415
+ var d = new Date(self.currentYear, self.currentMonth, 1);
2416
+ d.setMonth(self.currentMonth + i);
2417
+ if (self.config.showMonths > 1 ||
2418
+ self.config.monthSelectorType === "static") {
2419
+ self.monthElements[i].textContent =
2420
+ monthToStr(d.getMonth(), self.config.shorthandCurrentMonth, self.l10n) + " ";
2421
+ }
2422
+ else {
2423
+ self.monthsDropdownContainer.value = d.getMonth().toString();
2424
+ }
2425
+ yearElement.value = d.getFullYear().toString();
2426
+ });
2427
+ self._hidePrevMonthArrow =
2428
+ self.config.minDate !== undefined &&
2429
+ (self.currentYear === self.config.minDate.getFullYear()
2430
+ ? self.currentMonth <= self.config.minDate.getMonth()
2431
+ : self.currentYear < self.config.minDate.getFullYear());
2432
+ self._hideNextMonthArrow =
2433
+ self.config.maxDate !== undefined &&
2434
+ (self.currentYear === self.config.maxDate.getFullYear()
2435
+ ? self.currentMonth + 1 > self.config.maxDate.getMonth()
2436
+ : self.currentYear > self.config.maxDate.getFullYear());
2437
+ }
2438
+ function getDateStr(format) {
2439
+ return self.selectedDates
2440
+ .map(function (dObj) { return self.formatDate(dObj, format); })
2441
+ .filter(function (d, i, arr) {
2442
+ return self.config.mode !== "range" ||
2443
+ self.config.enableTime ||
2444
+ arr.indexOf(d) === i;
2445
+ })
2446
+ .join(self.config.mode !== "range"
2447
+ ? self.config.conjunction
2448
+ : self.l10n.rangeSeparator);
2449
+ }
2450
+ /**
2451
+ * Updates the values of inputs associated with the calendar
2452
+ */
2453
+ function updateValue(triggerChange) {
2454
+ if (triggerChange === void 0) { triggerChange = true; }
2455
+ if (self.mobileInput !== undefined && self.mobileFormatStr) {
2456
+ self.mobileInput.value =
2457
+ self.latestSelectedDateObj !== undefined
2458
+ ? self.formatDate(self.latestSelectedDateObj, self.mobileFormatStr)
2459
+ : "";
2460
+ }
2461
+ self.input.value = getDateStr(self.config.dateFormat);
2462
+ if (self.altInput !== undefined) {
2463
+ self.altInput.value = getDateStr(self.config.altFormat);
2464
+ }
2465
+ if (triggerChange !== false)
2466
+ triggerEvent("onValueUpdate");
2467
+ }
2468
+ function onMonthNavClick(e) {
2469
+ var isPrevMonth = self.prevMonthNav.contains(e.target);
2470
+ var isNextMonth = self.nextMonthNav.contains(e.target);
2471
+ if (isPrevMonth || isNextMonth) {
2472
+ changeMonth(isPrevMonth ? -1 : 1);
2473
+ }
2474
+ else if (self.yearElements.indexOf(e.target) >= 0) {
2475
+ e.target.select();
2476
+ }
2477
+ else if (e.target.classList.contains("arrowUp")) {
2478
+ self.changeYear(self.currentYear + 1);
2479
+ }
2480
+ else if (e.target.classList.contains("arrowDown")) {
2481
+ self.changeYear(self.currentYear - 1);
2482
+ }
2483
  }
2484
+ function timeWrapper(e) {
2485
+ e.preventDefault();
2486
+ var isKeyDown = e.type === "keydown", input = e.target;
2487
+ if (self.amPM !== undefined && e.target === self.amPM) {
2488
+ self.amPM.textContent =
2489
+ self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
2490
+ }
2491
+ var min = parseFloat(input.getAttribute("min")), max = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta ||
2492
+ (isKeyDown ? (e.which === 38 ? 1 : -1) : 0);
2493
+ var newValue = curValue + step * delta;
2494
+ if (typeof input.value !== "undefined" && input.value.length === 2) {
2495
+ var isHourElem = input === self.hourElement, isMinuteElem = input === self.minuteElement;
2496
+ if (newValue < min) {
2497
+ newValue =
2498
+ max +
2499
+ newValue +
2500
+ int(!isHourElem) +
2501
+ (int(isHourElem) && int(!self.amPM));
2502
+ if (isMinuteElem)
2503
+ incrementNumInput(undefined, -1, self.hourElement);
2504
+ }
2505
+ else if (newValue > max) {
2506
+ newValue =
2507
+ input === self.hourElement ? newValue - max - int(!self.amPM) : min;
2508
+ if (isMinuteElem)
2509
+ incrementNumInput(undefined, 1, self.hourElement);
2510
+ }
2511
+ if (self.amPM &&
2512
+ isHourElem &&
2513
+ (step === 1
2514
+ ? newValue + curValue === 23
2515
+ : Math.abs(newValue - curValue) > step)) {
2516
+ self.amPM.textContent =
2517
+ self.l10n.amPM[int(self.amPM.textContent === self.l10n.amPM[0])];
2518
+ }
2519
+ input.value = pad(newValue);
2520
+ }
2521
  }
2522
+ init();
2523
+ return self;
 
 
2524
  }
2525
+ /* istanbul ignore next */
2526
  function _flatpickr(nodeList, config) {
2527
+ // static list
2528
+ var nodes = Array.prototype.slice
2529
+ .call(nodeList)
2530
+ .filter(function (x) { return x instanceof HTMLElement; });
2531
+ var instances = [];
2532
+ for (var i = 0; i < nodes.length; i++) {
2533
+ var node = nodes[i];
2534
+ try {
2535
+ if (node.getAttribute("data-fp-omit") !== null)
2536
+ continue;
2537
+ if (node._flatpickr !== undefined) {
2538
+ node._flatpickr.destroy();
2539
+ node._flatpickr = undefined;
2540
+ }
2541
+ node._flatpickr = FlatpickrInstance(node, config || {});
2542
+ instances.push(node._flatpickr);
2543
+ }
2544
+ catch (e) {
2545
+ console.error(e);
2546
+ }
2547
  }
2548
+ return instances.length === 1 ? instances[0] : instances;
 
 
2549
  }
2550
+ /* istanbul ignore next */
2551
+ if (typeof HTMLElement !== "undefined" &&
2552
+ typeof HTMLCollection !== "undefined" &&
2553
+ typeof NodeList !== "undefined") {
2554
+ // browser env
2555
+ HTMLCollection.prototype.flatpickr = NodeList.prototype.flatpickr = function (config) {
2556
+ return _flatpickr(this, config);
2557
+ };
2558
+ HTMLElement.prototype.flatpickr = function (config) {
2559
+ return _flatpickr([this], config);
2560
+ };
2561
  }
2562
+ /* istanbul ignore next */
2563
+ var flatpickr = function (selector, config) {
2564
+ if (typeof selector === "string") {
2565
+ return _flatpickr(window.document.querySelectorAll(selector), config);
2566
+ }
2567
+ else if (selector instanceof Node) {
2568
+ return _flatpickr([selector], config);
2569
+ }
2570
+ else {
2571
+ return _flatpickr(selector, config);
2572
+ }
2573
  };
2574
+ /* istanbul ignore next */
2575
+ flatpickr.defaultConfig = {};
2576
  flatpickr.l10ns = {
2577
+ en: __assign({}, english),
2578
+ "default": __assign({}, english)
2579
  };
 
2580
  flatpickr.localize = function (l10n) {
2581
+ flatpickr.l10ns["default"] = __assign({}, flatpickr.l10ns["default"], l10n);
2582
  };
 
2583
  flatpickr.setDefaults = function (config) {
2584
+ flatpickr.defaultConfig = __assign({}, flatpickr.defaultConfig, config);
2585
  };
 
2586
  flatpickr.parseDate = createDateParser({});
2587
  flatpickr.formatDate = createDateFormatter({});
2588
  flatpickr.compareDates = compareDates;
2589
+ /* istanbul ignore next */
2590
+ if (typeof jQuery !== "undefined" && typeof jQuery.fn !== "undefined") {
2591
+ jQuery.fn.flatpickr = function (config) {
2592
+ return _flatpickr(this, config);
2593
+ };
2594
  }
2595
+ // eslint-disable-next-line @typescript-eslint/camelcase
2596
  Date.prototype.fp_incr = function (days) {
2597
+ return new Date(this.getFullYear(), this.getMonth(), this.getDate() + (typeof days === "string" ? parseInt(days, 10) : days));
2598
  };
 
2599
  if (typeof window !== "undefined") {
2600
+ window.flatpickr = flatpickr;
2601
  }
2602
 
2603
  return flatpickr;
2604
 
2605
+ }));
assets/js/flatpickr/flatpickr.min.js CHANGED
@@ -1,2 +1,2 @@
1
- /* flatpickr v4.5.1, @license MIT */
2
- !function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.flatpickr=n()}(this,function(){"use strict";var oe=function oe(e){return("0"+e).slice(-2)},re=function re(e){return!0===e?1:0};function de(t,a,i){var o;return void 0===i&&(i=!1),function(){var e=this,n=arguments;null!==o&&clearTimeout(o),o=window.setTimeout(function(){o=null,i||t.apply(e,n)},a),i&&!o&&t.apply(e,n)}}var le=function le(e){return e instanceof Array?e:[e]},e=function e(){return undefined},ce=function ce(e,n,t){return t.months[n?"shorthand":"longhand"][e]},b={D:e,F:function(e,n,t){e.setMonth(t.months.longhand.indexOf(n))},G:function(e,n){e.setHours(parseFloat(n))},H:function(e,n){e.setHours(parseFloat(n))},J:function(e,n){e.setDate(parseFloat(n))},K:function(e,n,t){e.setHours(e.getHours()%12+12*re(new RegExp(t.amPM[1],"i").test(n)))},M:function(e,n,t){e.setMonth(t.months.shorthand.indexOf(n))},S:function(e,n){e.setSeconds(parseFloat(n))},U:function(e,n){return new Date(1e3*parseFloat(n))},W:function(e,n){var t=parseInt(n);return new Date(e.getFullYear(),0,2+7*(t-1),0,0,0,0)},Y:function(e,n){e.setFullYear(parseFloat(n))},Z:function(e,n){return new Date(n)},d:function(e,n){e.setDate(parseFloat(n))},h:function(e,n){e.setHours(parseFloat(n))},i:function(e,n){e.setMinutes(parseFloat(n))},j:function(e,n){e.setDate(parseFloat(n))},l:e,m:function(e,n){e.setMonth(parseFloat(n)-1)},n:function(e,n){e.setMonth(parseFloat(n)-1)},s:function(e,n){e.setSeconds(parseFloat(n))},w:e,y:function(e,n){e.setFullYear(2e3+parseFloat(n))}},ue={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},d={Z:function(e){return e.toISOString()},D:function(e,n,t){return n.weekdays.shorthand[d.w(e,n,t)]},F:function(e,n,t){return ce(d.n(e,n,t)-1,!1,n)},G:function(e,n,t){return oe(d.h(e,n,t))},H:function(e){return oe(e.getHours())},J:function(e,n){return n.ordinal!==undefined?e.getDate()+n.ordinal(e.getDate()):e.getDate()},K:function(e,n){return n.amPM[re(11<e.getHours())]},M:function(e,n){return ce(e.getMonth(),!0,n)},S:function(e){return oe(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,n,t){return t.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return oe(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return oe(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,n){return n.weekdays.longhand[e.getDay()]},m:function(e){return oe(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},se={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var n=e%100;if(3<n&&n<21)return"th";switch(n%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year"},fe=function fe(e){var n=e.config,o=void 0===n?C:n,t=e.l10n,r=void 0===t?se:t;return function(a,e,n){if(o.formatDate!==undefined)return o.formatDate(a,e);var i=n||r;return e.split("").map(function(e,n,t){return d[e]&&"\\"!==t[n-1]?d[e](a,i,o):"\\"!==e?e:""}).join("")}},me=function me(e){var n=e.config,v=void 0===n?C:n,t=e.l10n,w=void 0===t?se:t;return function(e,n,t,a){if(0!==e&&!e)return undefined;var i,o=a||w,r=e;if(e instanceof Date)i=new Date(e.getTime());else if("string"!=typeof e&&e.toFixed!==undefined)i=new Date(e);else if("string"==typeof e){var d=n||(v||C).dateFormat,l=String(e).trim();if("today"===l)i=new Date,t=!0;else if(/Z$/.test(l)||/GMT$/.test(l))i=new Date(e);else if(v&&v.parseDate)i=v.parseDate(e,d);else{i=v&&v.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var c,u=[],s=0,f=0,m="";s<d.length;s++){var g=d[s],p="\\"===g,h="\\"===d[s-1]||p;if(ue[g]&&!h){m+=ue[g];var D=new RegExp(m).exec(e);D&&(c=!0)&&u["Y"!==g?"push":"unshift"]({fn:b[g],val:D[++f]})}else p||(m+=".");u.forEach(function(e){var n=e.fn,t=e.val;return i=n(i,t,o)||i})}i=c?i:undefined}}return i instanceof Date&&!isNaN(i.getTime())?(!0===t&&i.setHours(0,0,0,0),i):(v.errorHandler(new Error("Invalid date provided: "+r)),undefined)}};function ge(e,n,t){return void 0===t&&(t=!0),!1!==t?new Date(e.getTime()).setHours(0,0,0,0)-new Date(n.getTime()).setHours(0,0,0,0):e.getTime()-n.getTime()}var a=function a(e){var n=new Date(e.getTime());n.setHours(0,0,0,0),n.setDate(n.getDate()+3-(n.getDay()+6)%7);var t=new Date(n.getFullYear(),0,4);return 1+Math.round(((n.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},pe=function pe(e,n,t){return e>Math.min(n,t)&&e<Math.max(n,t)},he={DAY:864e5},C={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:a,hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",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>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:undefined,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>",shorthandCurrentMonth:!1,showMonths:1,"static":!1,time_24hr:!1,weekNumbers:!1,wrap:!1};function De(e,n,t){if(!0===t)return e.classList.add(n);e.classList.remove(n)}function ve(e,n,t){var a=window.document.createElement(e);return n=n||"",t=t||"",a.className=n,t!==undefined&&(a.textContent=t),a}function we(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function be(e,n){var t=ve("div","numInputWrapper"),a=ve("input","numInput "+e),i=ve("span","arrowUp"),o=ve("span","arrowDown");if(a.type="text",a.pattern="\\d*",n!==undefined)for(var r in n)a.setAttribute(r,n[r]);return t.appendChild(a),t.appendChild(i),t.appendChild(o),t}"function"!=typeof Object.assign&&(Object.assign=function(t){if(!t)throw TypeError("Cannot convert undefined or null to object");for(var e=arguments.length,a=new Array(1<e?e-1:0),n=1;n<e;n++)a[n-1]=arguments[n];for(var i=function i(){var n=a[o];n&&Object.keys(n).forEach(function(e){return t[e]=n[e]})},o=0;o<a.length;o++)i();return t});var Ce=300;function l(f,m){var h={config:Object.assign({},Me.defaultConfig),l10n:se};function g(e){return e.bind(h)}function o(){var n=h.config;!1===n.weekNumbers&&1===n.showMonths||!0!==n.noCalendar&&window.requestAnimationFrame(function(){if(h.calendarContainer.style.visibility="hidden",h.calendarContainer.style.display="block",h.daysContainer!==undefined){var e=(h.days.offsetWidth+1)*n.showMonths;h.daysContainer.style.width=e+"px",h.calendarContainer.style.width=e+(h.weekWrapper!==undefined?h.weekWrapper.offsetWidth:0)+"px",h.calendarContainer.style.removeProperty("visibility"),h.calendarContainer.style.removeProperty("display")}})}function p(e){if(0!==h.selectedDates.length){e!==undefined&&"blur"!==e.type&&!function s(e){e.preventDefault();var n="keydown"===e.type,t=e.target;h.amPM!==undefined&&e.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[re(h.amPM.textContent===h.l10n.amPM[0])]);var a=parseFloat(t.getAttribute("data-min")),i=parseFloat(t.getAttribute("data-max")),o=parseFloat(t.getAttribute("data-step")),r=parseInt(t.value,10),d=e.delta||(n?38===e.which?1:-1:0),l=r+o*d;if("undefined"!=typeof t.value&&2===t.value.length){var c=t===h.hourElement,u=t===h.minuteElement;l<a?(l=i+l+re(!c)+(re(c)&&re(!h.amPM)),u&&C(undefined,-1,h.hourElement)):i<l&&(l=t===h.hourElement?l-i-re(!h.amPM):a,u&&C(undefined,1,h.hourElement)),h.amPM&&c&&(1===o?l+r===23:Math.abs(l-r)>o)&&(h.amPM.textContent=h.l10n.amPM[re(h.amPM.textContent===h.l10n.amPM[0])]),t.value=oe(l)}}(e);var n=h._input.value;D(),Z(),h._input.value!==n&&h._debouncedChange()}}function D(){if(h.hourElement!==undefined&&h.minuteElement!==undefined){var e=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,n=(parseInt(h.minuteElement.value,10)||0)%60,t=h.secondElement!==undefined?(parseInt(h.secondElement.value,10)||0)%60:0;h.amPM!==undefined&&(e=function r(e,n){return e%12+12*re(n===h.l10n.amPM[1])}(e,h.amPM.textContent));var a=h.config.minTime!==undefined||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===ge(h.latestSelectedDateObj,h.config.minDate,!0);if(h.config.maxTime!==undefined||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===ge(h.latestSelectedDateObj,h.config.maxDate,!0)){var i=h.config.maxTime!==undefined?h.config.maxTime:h.config.maxDate;(e=Math.min(e,i.getHours()))===i.getHours()&&(n=Math.min(n,i.getMinutes())),n===i.getMinutes()&&(t=Math.min(t,i.getSeconds()))}if(a){var o=h.config.minTime!==undefined?h.config.minTime:h.config.minDate;(e=Math.max(e,o.getHours()))===o.getHours()&&(n=Math.max(n,o.getMinutes())),n===o.getMinutes()&&(t=Math.max(t,o.getSeconds()))}d(e,n,t)}}function r(e){var n=e||h.latestSelectedDateObj;n&&d(n.getHours(),n.getMinutes(),n.getSeconds())}function a(){var e=h.config.defaultHour,n=h.config.defaultMinute,t=h.config.defaultSeconds;if(h.config.minDate!==undefined){var a=h.config.minDate.getHours(),i=h.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(n=Math.max(i,n)),e===a&&n===i&&(t=h.config.minDate.getSeconds())}if(h.config.maxDate!==undefined){var o=h.config.maxDate.getHours(),r=h.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(n=Math.min(r,n)),e===o&&n===r&&(t=h.config.maxDate.getSeconds())}d(e,n,t)}function d(e,n,t){h.latestSelectedDateObj!==undefined&&h.latestSelectedDateObj.setHours(e%24,n,t||0,0),h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=oe(h.config.time_24hr?e:(12+e)%12+12*re(e%12==0)),h.minuteElement.value=oe(n),h.amPM!==undefined&&(h.amPM.textContent=h.l10n.amPM[re(12<=e)]),h.secondElement!==undefined&&(h.secondElement.value=oe(t)))}function l(e){var n=parseInt(e.target.value)+(e.delta||0);(1<n/1e3||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&N(n)}function u(n,t,a,i){return t instanceof Array?t.forEach(function(e){return u(n,e,a,i)}):n instanceof Array?n.forEach(function(e){return u(e,t,a,i)}):(n.addEventListener(t,a,i),void h._handlers.push({element:n,event:t,handler:a,options:i}))}function v(n){return function(e){1===e.which&&n(e)}}function w(){$("onChange")}function i(e){var n=e!==undefined?h.parseDate(e):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate<h.now?h.config.maxDate:h.now);try{n!==undefined&&(h.currentYear=n.getFullYear(),h.currentMonth=n.getMonth())}catch(t){t.message="Invalid date supplied: "+n,h.config.errorHandler(t)}h.redraw()}function b(e){~e.target.className.indexOf("arrow")&&C(e,e.target.classList.contains("arrowUp")?1:-1)}function C(e,n,t){var a=e&&e.target,i=t||a&&a.parentNode&&a.parentNode.firstChild,o=z("increment");o.delta=n,i&&i.dispatchEvent(o)}function M(e,n,t,a){var i=F(n,!0),o=ve("span","flatpickr-day "+e,n.getDate().toString());return o.dateObj=n,o.$i=a,o.setAttribute("aria-label",h.formatDate(n,h.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===ge(n,h.now)&&((h.todayDateElem=o).classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,G(n)&&(o.classList.add("selected"),h.selectedDateElem=o,"range"===h.config.mode&&(De(o,"startRange",h.selectedDates[0]&&0===ge(n,h.selectedDates[0],!0)),De(o,"endRange",h.selectedDates[1]&&0===ge(n,h.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("disabled"),"range"===h.config.mode&&(!function r(e){return!("range"!==h.config.mode||h.selectedDates.length<2)&&(0<=ge(e,h.selectedDates[0])&&ge(e,h.selectedDates[1])<=0)}(n)||G(n)||o.classList.add("inRange")),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==e&&t%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+h.config.getWeek(n)+"</span>"),$("onDayCreate",o),o}function y(e){e.focus(),"range"===h.config.mode&&j(e)}function x(e){for(var n=0<e?0:h.config.showMonths-1,t=0<e?h.config.showMonths:-1,a=n;a!=t;a+=e)for(var i=h.daysContainer.children[a],o=0<e?0:i.children.length-1,r=0<e?i.children.length:-1,d=o;d!=r;d+=e){var l=i.children[d];if(-1===l.className.indexOf("hidden")&&F(l.dateObj))return l}return undefined}function E(e,n){var t=A(document.activeElement),a=e!==undefined?e:t?document.activeElement:h.selectedDateElem!==undefined&&A(h.selectedDateElem)?h.selectedDateElem:h.todayDateElem!==undefined&&A(h.todayDateElem)?h.todayDateElem:x(0<n?1:-1);return a===undefined?h._input.focus():t?void function s(e,n){for(var t=-1===e.className.indexOf("Month")?e.dateObj.getMonth():h.currentMonth,a=0<n?h.config.showMonths:-1,i=0<n?1:-1,o=t-h.currentMonth;o!=a;o+=i)for(var r=h.daysContainer.children[o],d=t-h.currentMonth===o?e.$i+n:n<0?r.children.length-1:0,l=r.children.length,c=d;0<=c&&c<l&&c!=(0<n?l:-1);c+=i){var u=r.children[c];if(-1===u.className.indexOf("hidden")&&F(u.dateObj)&&Math.abs(e.$i-c)>=Math.abs(n))return y(u)}return h.changeMonth(i),E(x(i),0),undefined}(a,n):y(a)}function c(e,n){for(var t=(new Date(e,n,1).getDay()-h.l10n.firstDayOfWeek+7)%7,a=h.utils.getDaysInMonth((n-1+12)%12),i=h.utils.getDaysInMonth(n),o=window.document.createDocumentFragment(),r=1<h.config.showMonths,d=r?"prevMonthDay hidden":"prevMonthDay",l=r?"nextMonthDay hidden":"nextMonthDay",c=a+1-t,u=0;c<=a;c++,u++)o.appendChild(M(d,new Date(e,n-1,c),c,u));for(c=1;c<=i;c++,u++)o.appendChild(M("",new Date(e,n,c),c,u));for(var s=i+1;s<=42-t&&(1===h.config.showMonths||u%7!=0);s++,u++)o.appendChild(M(l,new Date(e,n+1,s%i),s,u));var f=ve("div","dayContainer");return f.appendChild(o),f}function T(){if(h.daysContainer!==undefined){we(h.daysContainer),h.weekNumbers&&we(h.weekNumbers);for(var e=document.createDocumentFragment(),n=0;n<h.config.showMonths;n++){var t=new Date(h.currentYear,h.currentMonth,1);t.setMonth(h.currentMonth+n),e.appendChild(c(t.getFullYear(),t.getMonth()))}h.daysContainer.appendChild(e),h.days=h.daysContainer.firstChild,"range"===h.config.mode&&1===h.selectedDates.length&&j()}}function t(){var e=ve("div","flatpickr-month"),n=window.document.createDocumentFragment(),t=ve("span","cur-month"),a=be("cur-year",{tabindex:"-1"}),i=a.childNodes[0];i.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&i.setAttribute("data-min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(i.setAttribute("data-max",h.config.maxDate.getFullYear().toString()),i.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear());var o=ve("div","flatpickr-current-month");return o.appendChild(t),o.appendChild(a),n.appendChild(o),e.appendChild(n),{container:e,yearElement:i,monthElement:t}}function k(){we(h.monthNav),h.monthNav.appendChild(h.prevMonthNav);for(var e=h.config.showMonths;e--;){var n=t();h.yearElements.push(n.yearElement),h.monthElements.push(n.monthElement),h.monthNav.appendChild(n.container)}h.monthNav.appendChild(h.nextMonthNav)}function I(){h.weekdayContainer?we(h.weekdayContainer):h.weekdayContainer=ve("div","flatpickr-weekdays");for(var e=h.config.showMonths;e--;){var n=ve("div","flatpickr-weekdaycontainer");h.weekdayContainer.appendChild(n)}return s(),h.weekdayContainer}function s(){var e=h.l10n.firstDayOfWeek,n=h.l10n.weekdays.shorthand.concat();0<e&&e<n.length&&(n=n.splice(e,n.length).concat(n.splice(0,e)));for(var t=h.config.showMonths;t--;)h.weekdayContainer.children[t].innerHTML="\n <span class=flatpickr-weekday>\n "+n.join("</span><span class=flatpickr-weekday>")+"\n </span>\n "}function O(e,n){void 0===n&&(n=!0);var t=n?e:e-h.currentMonth;t<0&&!0===h._hidePrevMonthArrow||0<t&&!0===h._hideNextMonthArrow||(h.currentMonth+=t,(h.currentMonth<0||11<h.currentMonth)&&(h.currentYear+=11<h.currentMonth?1:-1,h.currentMonth=(h.currentMonth+12)%12,$("onYearChange")),T(),$("onMonthChange"),V())}function S(e){return!(!h.config.appendTo||!h.config.appendTo.contains(e))||h.calendarContainer.contains(e)}function _(n){if(h.isOpen&&!h.config.inline){var e=S(n.target),t=n.target===h.input||n.target===h.altInput||h.element.contains(n.target)||n.path&&n.path.indexOf&&(~n.path.indexOf(h.input)||~n.path.indexOf(h.altInput)),a="blur"===n.type?t&&n.relatedTarget&&!S(n.relatedTarget):!t&&!e,i=!h.config.ignoredFocusElements.some(function(e){return e.contains(n.target)});a&&i&&(h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}}function N(e){if(!(!e||h.config.minDate&&e<h.config.minDate.getFullYear()||h.config.maxDate&&e>h.config.maxDate.getFullYear())){var n=e,t=h.currentYear!==n;h.currentYear=n||h.currentYear,h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth)),t&&(h.redraw(),$("onYearChange"))}}function F(e,n){void 0===n&&(n=!0);var t=h.parseDate(e,undefined,n);if(h.config.minDate&&t&&ge(t,h.config.minDate,n!==undefined?n:!h.minDateHasTime)<0||h.config.maxDate&&t&&0<ge(t,h.config.maxDate,n!==undefined?n:!h.maxDateHasTime))return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(t===undefined)return!1;for(var a,i=0<h.config.enable.length,o=i?h.config.enable:h.config.disable,r=0;r<o.length;r++){if("function"==typeof(a=o[r])&&a(t))return i;if(a instanceof Date&&t!==undefined&&a.getTime()===t.getTime())return i;if("string"==typeof a&&t!==undefined){var d=h.parseDate(a,undefined,!0);return d&&d.getTime()===t.getTime()?i:!i}if("object"==typeof a&&t!==undefined&&a.from&&a.to&&t.getTime()>=a.from.getTime()&&t.getTime()<=a.to.getTime())return i}return!i}function A(e){return h.daysContainer!==undefined&&(-1===e.className.indexOf("hidden")&&h.daysContainer.contains(e))}function P(e){var n=e.target===h._input,t=h.config.allowInput,a=h.isOpen&&(!t||!n),i=h.config.inline&&n&&!t;if(13===e.keyCode&&n){if(t)return h.setDate(h._input.value,!0,e.target===h.altInput?h.config.altFormat:h.config.dateFormat),e.target.blur();h.open()}else if(S(e.target)||a||i){var o=!!h.timeContainer&&h.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?p():J(e);break;case 27:e.preventDefault(),K();break;case 8:case 46:n&&!h.config.allowInput&&(e.preventDefault(),h.clear());break;case 37:case 39:if(o)h.hourElement&&h.hourElement.focus();else if(e.preventDefault(),h.daysContainer!==undefined&&(!1===t||A(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(O(r),E(x(1),0)):E(undefined,r)}break;case 38:case 40:e.preventDefault();var d=40===e.keyCode?1:-1;h.daysContainer?e.ctrlKey?(N(h.currentYear-d),E(x(1),0)):o||E(undefined,7*d):h.config.enableTime&&(!o&&h.hourElement&&h.hourElement.focus(),p(e),h._debouncedChange());break;case 9:if(!o)break;var l=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].filter(function(e){return e}),c=l.indexOf(e.target);if(-1!==c){var u=l[c+(e.shiftKey?-1:1)];u!==undefined&&(e.preventDefault(),u.focus())}}}if(h.amPM!==undefined&&e.target===h.amPM)switch(e.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0],D(),Z();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1],D(),Z()}$("onKeyDown",e)}function j(o){if(1===h.selectedDates.length&&(!o||o.classList.contains("flatpickr-day")&&!o.classList.contains("disabled"))){for(var r=o?o.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),d=h.parseDate(h.selectedDates[0],undefined,!0).getTime(),e=Math.min(r,h.selectedDates[0].getTime()),n=Math.max(r,h.selectedDates[0].getTime()),t=h.daysContainer.lastChild.lastChild.dateObj.getTime(),l=!1,c=0,u=0,a=e;a<t;a+=he.DAY)F(new Date(a),!0)||(l=l||e<a&&a<n,a<d&&(!c||c<a)?c=a:d<a&&(!u||a<u)&&(u=a));for(var s=0;s<h.config.showMonths;s++)for(var f=h.daysContainer.children[s],m=h.daysContainer.children[s-1],g=function g(e,n){var t=f.children[e],a=t.dateObj.getTime(),i=0<c&&a<c||0<u&&u<a;return i?(t.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)}),"continue"):l&&!i?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void(o!==undefined&&(o.classList.add(r<h.selectedDates[0].getTime()?"startRange":"endRange"),!f.contains(o)&&0<s&&m&&m.lastChild.dateObj.getTime()>=a||(d<r&&a===d?t.classList.add("startRange"):r<d&&a===d&&t.classList.add("endRange"),c<=a&&(0===u||a<=u)&&pe(a,d,r)&&t.classList.add("inRange")))))},i=0,p=f.children.length;i<p;i++)g(i,p)}}function Y(){!h.isOpen||h.config["static"]||h.config.inline||W()}function H(a){return function(e){var n=h.config["_"+a+"Date"]=h.parseDate(e,h.config.dateFormat),t=h.config["_"+("min"===a?"max":"min")+"Date"];n!==undefined&&(h["min"===a?"minDateHasTime":"maxDateHasTime"]=0<n.getHours()||0<n.getMinutes()||0<n.getSeconds()),h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(e){return F(e)}),h.selectedDates.length||"min"!==a||r(n),Z()),h.daysContainer&&(R(),n!==undefined?h.currentYearElement[a]=n.getFullYear().toString():h.currentYearElement.removeAttribute(a),h.currentYearElement.disabled=!!t&&n!==undefined&&t.getFullYear()===n.getFullYear())}}function L(){"object"!=typeof h.config.locale&&"undefined"==typeof Me.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale)),h.l10n=Object.assign({},Me.l10ns["default"],"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?Me.l10ns[h.config.locale]:undefined),ue.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")",h.formatDate=fe(h),h.parseDate=me({config:h.config,l10n:h.l10n})}function W(e){if(h.calendarContainer!==undefined){$("onPreCalendarPosition");var n=e||h._positionElement,t=Array.prototype.reduce.call(h.calendarContainer.children,function(e,n){return e+n.offsetHeight},0),a=h.calendarContainer.offsetWidth,i=h.config.position.split(" "),o=i[0],r=1<i.length?i[1]:null,d=n.getBoundingClientRect(),l=window.innerHeight-d.bottom,c="above"===o||"below"!==o&&l<t&&d.top>t,u=window.pageYOffset+d.top+(c?-t-2:n.offsetHeight+2);if(De(h.calendarContainer,"arrowTop",!c),De(h.calendarContainer,"arrowBottom",c),!h.config.inline){var s=window.pageXOffset+d.left-(null!=r&&"center"===r?(a-d.width)/2:0),f=window.document.body.offsetWidth-d.right,m=s+a>window.document.body.offsetWidth;De(h.calendarContainer,"rightMost",m),h.config["static"]||(h.calendarContainer.style.top=u+"px",m?(h.calendarContainer.style.left="auto",h.calendarContainer.style.right=f+"px"):(h.calendarContainer.style.left=s+"px",h.calendarContainer.style.right="auto"))}}}function R(){h.config.noCalendar||h.isMobile||(V(),T())}function K(){h._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||navigator.msMaxTouchPoints!==undefined?setTimeout(h.close,0):h.close()}function J(e){e.preventDefault(),e.stopPropagation();var n=function n(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("disabled")&&!e.classList.contains("notAllowed")},t=function u(e,n){return n(e)?e:e.parentNode?u(e.parentNode,n):undefined}(e.target,n);if(t!==undefined){var a=t,i=h.latestSelectedDateObj=new Date(a.dateObj.getTime()),o=(i.getMonth()<h.currentMonth||i.getMonth()>h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;if(h.selectedDateElem=a,"single"===h.config.mode)h.selectedDates=[i];else if("multiple"===h.config.mode){var r=G(i);r?h.selectedDates.splice(parseInt(r),1):h.selectedDates.push(i)}else"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1),h.selectedDates.push(i),0!==ge(i,h.selectedDates[0],!0)&&h.selectedDates.sort(function(e,n){return e.getTime()-n.getTime()}));if(D(),o){var d=h.currentYear!==i.getFullYear();h.currentYear=i.getFullYear(),h.currentMonth=i.getMonth(),d&&$("onYearChange"),$("onMonthChange")}if(V(),T(),Z(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),o||"range"===h.config.mode||1!==h.config.showMonths?h.selectedDateElem&&h.selectedDateElem.focus():y(a),h.hourElement!==undefined&&setTimeout(function(){return h.hourElement!==undefined&&h.hourElement.select()},451),h.config.closeOnSelect){var l="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime;(l||c)&&K()}w()}}h.parseDate=me({config:h.config,l10n:h.l10n}),h._handlers=[],h._bind=u,h._setHoursFromDate=r,h._positionCalendar=W,h.changeMonth=O,h.changeYear=N,h.clear=function n(e){void 0===e&&(e=!0);h.input.value="",h.altInput!==undefined&&(h.altInput.value="");h.mobileInput!==undefined&&(h.mobileInput.value="");h.selectedDates=[],h.latestSelectedDateObj=undefined,!(h.showTimeInput=!1)===h.config.enableTime&&a();h.redraw(),e&&$("onChange")},h.close=function e(){h.isOpen=!1,h.isMobile||(h.calendarContainer.classList.remove("open"),h._input.classList.remove("active"));$("onClose")},h._createElement=ve,h.destroy=function X(){h.config!==undefined&&$("onDestroy");for(var e=h._handlers.length;e--;){var n=h._handlers[e];n.element.removeEventListener(n.event,n.handler,n.options)}if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=undefined;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config["static"]&&h.calendarContainer.parentNode){var t=h.calendarContainer.parentNode;for(t.lastChild&&t.removeChild(t.lastChild);t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete h[e]}catch(n){}})},h.isEnabled=F,h.jumpToDate=i,h.open=function ee(e,n){void 0===n&&(n=h._positionElement);if(!0===h.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),setTimeout(function(){h.mobileInput!==undefined&&h.mobileInput.focus()},0),void $("onOpen");if(h._input.disabled||h.config.inline)return;var t=h.isOpen;h.isOpen=!0,t||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),$("onOpen"),W(n));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&(h.setDate(h.config.minDate!==undefined?new Date(h.config.minDate.getTime()):new Date,!1),a(),Z()),!1!==h.config.allowInput||e!==undefined&&h.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))},h.redraw=R,h.set=function ne(e,n){null!==e&&"object"==typeof e?Object.assign(h.config,e):(h.config[e]=n,B[e]!==undefined&&B[e].forEach(function(e){return e()}));h.redraw(),i()},h.setDate=function te(e,n,t){void 0===n&&(n=!1);void 0===t&&(t=h.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return h.clear(n);U(e,t),h.showTimeInput=0<h.selectedDates.length,h.latestSelectedDateObj=h.selectedDates[0],h.redraw(),i(),r(),Z(n),n&&$("onChange")},h.toggle=function ae(e){if(!0===h.isOpen)return h.close();h.open(e)};var B={locale:[L,s],showMonths:[k,o,I]};function U(e,n){var t=[];if(e instanceof Array)t=e.map(function(e){return h.parseDate(e,n)});else if(e instanceof Date||"number"==typeof e)t=[h.parseDate(e,n)];else if("string"==typeof e)switch(h.config.mode){case"single":case"time":t=[h.parseDate(e,n)];break;case"multiple":t=e.split(h.config.conjunction).map(function(e){return h.parseDate(e,n)});break;case"range":t=e.split(h.l10n.rangeSeparator).map(function(e){return h.parseDate(e,n)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));h.selectedDates=t.filter(function(e){return e instanceof Date&&F(e,!1)}),"range"===h.config.mode&&h.selectedDates.sort(function(e,n){return e.getTime()-n.getTime()})}function q(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?h.parseDate(e,undefined,!0):e&&"object"==typeof e&&e.from&&e.to?{from:h.parseDate(e.from,undefined),to:h.parseDate(e.to,undefined)}:e}).filter(function(e){return e})}function $(e,n){var t=h.config[e];if(t!==undefined&&0<t.length)for(var a=0;t[a]&&a<t.length;a++)t[a](h.selectedDates,h.input.value,h,n);"onChange"===e&&(h.input.dispatchEvent(z("change")),h.input.dispatchEvent(z("input")))}function z(e){var n=document.createEvent("Event");return n.initEvent(e,!0,!0),n}function G(e){for(var n=0;n<h.selectedDates.length;n++)if(0===ge(h.selectedDates[n],e))return""+n;return!1}function V(){h.config.noCalendar||h.isMobile||!h.monthNav||(h.yearElements.forEach(function(e,n){var t=new Date(h.currentYear,h.currentMonth,1);t.setMonth(h.currentMonth+n),h.monthElements[n].textContent=ce(t.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ",e.value=t.getFullYear().toString()}),h._hidePrevMonthArrow=h.config.minDate!==undefined&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYear<h.config.minDate.getFullYear()),h._hideNextMonthArrow=h.config.maxDate!==undefined&&(h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth+1>h.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function Z(e){if(void 0===e&&(e=!0),0===h.selectedDates.length)return h.clear(e);h.mobileInput!==undefined&&h.mobileFormatStr&&(h.mobileInput.value=h.latestSelectedDateObj!==undefined?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):"");var n="range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator;h.input.value=h.selectedDates.map(function(e){return h.formatDate(e,h.config.dateFormat)}).join(n),h.altInput!==undefined&&(h.altInput.value=h.selectedDates.map(function(e){return h.formatDate(e,h.config.altFormat)}).join(n)),!1!==e&&$("onValueUpdate")}function Q(e){e.preventDefault();var n=h.prevMonthNav.contains(e.target),t=h.nextMonthNav.contains(e.target);n||t?O(n?-1:1):0<=h.yearElements.indexOf(e.target)?e.target.select():e.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):e.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}return function ie(){h.element=h.input=f,h.isOpen=!1,function s(){var e=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],n=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],t=Object.assign({},m,JSON.parse(JSON.stringify(f.dataset||{}))),a={};h.config.parseDate=t.parseDate,h.config.formatDate=t.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(e){h.config._enable=q(e)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(e){h.config._disable=q(e)}});var i="time"===t.mode;t.dateFormat||!t.enableTime&&!i||(a.dateFormat=t.noCalendar||i?"H:i"+(t.enableSeconds?":S":""):Me.defaultConfig.dateFormat+" H:i"+(t.enableSeconds?":S":""));t.altInput&&(t.enableTime||i)&&!t.altFormat&&(a.altFormat=t.noCalendar||i?"h:i"+(t.enableSeconds?":S K":" K"):Me.defaultConfig.altFormat+" h:i"+(t.enableSeconds?":S":"")+" K");Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:H("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:H("max")});var o=function o(n){return function(e){h.config["min"===n?"_minTime":"_maxTime"]=h.parseDate(e,"H:i")}};Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:o("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:o("max")}),"time"===t.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0);Object.assign(h.config,a,t);for(var r=0;r<e.length;r++)h.config[e[r]]=!0===h.config[e[r]]||"true"===h.config[e[r]];for(var d=n.length;d--;)h.config[n[d]]!==undefined&&(h.config[n[d]]=le(h.config[n[d]]||[]).map(g));h.isMobile=!h.config.disableMobile&&!h.config.inline&&"single"===h.config.mode&&!h.config.disable.length&&!h.config.enable.length&&!h.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var l=0;l<h.config.plugins.length;l++){var c=h.config.plugins[l](h)||{};for(var u in c)~n.indexOf(u)?h.config[u]=le(c[u]).map(g).concat(h.config[u]):"undefined"==typeof t[u]&&(h.config[u]=c[u])}$("onParseConfig")}(),L(),function n(){if(h.input=h.config.wrap?f.querySelector("[data-input]"):f,!h.input)return void h.config.errorHandler(new Error("Invalid input element specified"));h.input._type=h.input.type,h.input.type="text",h.input.classList.add("flatpickr-input"),h._input=h.input,h.config.altInput&&(h.altInput=ve(h.input.nodeName,h.input.className+" "+h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config["static"]&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling));h.config.allowInput||h._input.setAttribute("readonly","readonly");h._positionElement=h.config.positionElement||h._input}(),function t(){h.selectedDates=[],h.now=h.parseDate(h.config.now)||new Date;var e=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);e&&U(e,h.config.dateFormat);var n=0<h.selectedDates.length?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()<h.now.getTime()?h.config.maxDate:h.now;h.currentYear=n.getFullYear(),h.currentMonth=n.getMonth(),0<h.selectedDates.length&&(h.latestSelectedDateObj=h.selectedDates[0]);h.config.minTime!==undefined&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i"));h.config.maxTime!==undefined&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i"));h.minDateHasTime=!!h.config.minDate&&(0<h.config.minDate.getHours()||0<h.config.minDate.getMinutes()||0<h.config.minDate.getSeconds()),h.maxDateHasTime=!!h.config.maxDate&&(0<h.config.maxDate.getHours()||0<h.config.maxDate.getMinutes()||0<h.config.maxDate.getSeconds()),Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(e){h._showTimeInput=e,h.calendarContainer&&De(h.calendarContainer,"showTimeInput",e),h.isOpen&&W()}})}(),function a(){h.utils={getDaysInMonth:function(e,n){return void 0===e&&(e=h.currentMonth),void 0===n&&(n=h.currentYear),1===e&&(n%4==0&&n%100!=0||n%400==0)?29:h.l10n.daysInMonth[e]}}}(),h.isMobile||function c(){var e=window.document.createDocumentFragment();if(h.calendarContainer=ve("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(e.appendChild(function r(){return h.monthNav=ve("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=ve("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=ve("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,k(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(e){h.__hidePrevMonthArrow!==e&&(De(h.prevMonthNav,"disabled",e),h.__hidePrevMonthArrow=e)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(e){h.__hideNextMonthArrow!==e&&(De(h.nextMonthNav,"disabled",e),h.__hideNextMonthArrow=e)}}),h.currentYearElement=h.yearElements[0],V(),h.monthNav}()),h.innerContainer=ve("div","flatpickr-innerContainer"),h.config.weekNumbers){var n=function d(){h.calendarContainer.classList.add("hasWeeks");var e=ve("div","flatpickr-weekwrapper");e.appendChild(ve("span","flatpickr-weekday",h.l10n.weekAbbreviation));var n=ve("div","flatpickr-weeks");return e.appendChild(n),{weekWrapper:e,weekNumbers:n}}(),t=n.weekWrapper,a=n.weekNumbers;h.innerContainer.appendChild(t),h.weekNumbers=a,h.weekWrapper=t}h.rContainer=ve("div","flatpickr-rContainer"),h.rContainer.appendChild(I()),h.daysContainer||(h.daysContainer=ve("div","flatpickr-days"),h.daysContainer.tabIndex=-1),T(),h.rContainer.appendChild(h.daysContainer),h.innerContainer.appendChild(h.rContainer),e.appendChild(h.innerContainer)}h.config.enableTime&&e.appendChild(function l(){h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar");h.timeContainer=ve("div","flatpickr-time"),h.timeContainer.tabIndex=-1;var e=ve("span","flatpickr-time-separator",":"),n=be("flatpickr-hour");h.hourElement=n.childNodes[0];var t=be("flatpickr-minute");h.minuteElement=t.childNodes[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=oe(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function i(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(h.config.defaultHour)),h.minuteElement.value=oe(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("data-step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("data-step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("data-min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("data-max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("data-min","0"),h.minuteElement.setAttribute("data-max","59"),h.timeContainer.appendChild(n),h.timeContainer.appendChild(e),h.timeContainer.appendChild(t),h.config.time_24hr&&h.timeContainer.classList.add("time24hr");if(h.config.enableSeconds){h.timeContainer.classList.add("hasSeconds");var a=be("flatpickr-second");h.secondElement=a.childNodes[0],h.secondElement.value=oe(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("data-step",h.minuteElement.getAttribute("data-step")),h.secondElement.setAttribute("data-min",h.minuteElement.getAttribute("data-min")),h.secondElement.setAttribute("data-max",h.minuteElement.getAttribute("data-max")),h.timeContainer.appendChild(ve("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(a)}h.config.time_24hr||(h.amPM=ve("span","flatpickr-am-pm",h.l10n.amPM[re(11<(h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour))]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM));return h.timeContainer}());De(h.calendarContainer,"rangeMode","range"===h.config.mode),De(h.calendarContainer,"animate",!0===h.config.animate),De(h.calendarContainer,"multiMonth",1<h.config.showMonths),h.calendarContainer.appendChild(e);var i=h.config.appendTo!==undefined&&h.config.appendTo.nodeType!==undefined;if((h.config.inline||h.config["static"])&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!i&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):h.config.appendTo!==undefined&&h.config.appendTo.appendChild(h.calendarContainer)),h.config["static"])){var o=ve("div","flatpickr-wrapper");h.element.parentNode&&h.element.parentNode.insertBefore(o,h.element),o.appendChild(h.element),h.altInput&&o.appendChild(h.altInput),o.appendChild(h.calendarContainer)}h.config["static"]||h.config.inline||(h.config.appendTo!==undefined?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function i(){h.config.wrap&&["open","close","toggle","clear"].forEach(function(n){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+n+"]"),function(e){return u(e,"click",h[n])})});if(h.isMobile)return void function t(){var e=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=ve("input",h.input.className+" flatpickr-mobile"),h.mobileInput.step=h.input.getAttribute("step")||"any",h.mobileInput.tabIndex=1,h.mobileInput.type=e,h.mobileInput.disabled=h.input.disabled,h.mobileInput.required=h.input.required,h.mobileInput.placeholder=h.input.placeholder,h.mobileFormatStr="datetime-local"==e?"Y-m-d\\TH:i:S":"date"==e?"Y-m-d":"H:i:S",0<h.selectedDates.length&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr));h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d"));h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d"));h.input.type="hidden",h.altInput!==undefined&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(n){}u(h.mobileInput,"change",function(e){h.setDate(e.target.value,!1,h.mobileFormatStr),$("onChange"),$("onClose")})}();var e=de(Y,50);h._debouncedChange=de(w,Ce),h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&u(h.daysContainer,"mouseover",function(e){"range"===h.config.mode&&j(e.target)});u(window.document.body,"keydown",P),h.config["static"]||u(h._input,"keydown",P);h.config.inline||h.config["static"]||u(window,"resize",e);window.ontouchstart!==undefined?u(window.document,"click",_):u(window.document,"mousedown",v(_));u(window.document,"focus",_,{capture:!0}),!0===h.config.clickOpens&&(u(h._input,"focus",h.open),u(h._input,"mousedown",v(h.open)));h.daysContainer!==undefined&&(u(h.monthNav,"mousedown",v(Q)),u(h.monthNav,["keyup","increment"],l),u(h.daysContainer,"mousedown",v(J)));if(h.timeContainer!==undefined&&h.minuteElement!==undefined&&h.hourElement!==undefined){var n=function n(e){return e.target.select()};u(h.timeContainer,["increment"],p),u(h.timeContainer,"blur",p,{capture:!0}),u(h.timeContainer,"mousedown",v(b)),u([h.hourElement,h.minuteElement],["focus","click"],n),h.secondElement!==undefined&&u(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),h.amPM!==undefined&&u(h.amPM,"mousedown",v(function(e){p(e),w()}))}}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&r(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:undefined),Z(!1)),o(),h.showTimeInput=0<h.selectedDates.length||h.config.noCalendar;var e=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&e&&W(),$("onReady")}(),h}function t(e,n){for(var t=Array.prototype.slice.call(e),a=[],i=0;i<t.length;i++){var o=t[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;o._flatpickr!==undefined&&(o._flatpickr.destroy(),o._flatpickr=undefined),o._flatpickr=l(o,n||{}),a.push(o._flatpickr)}catch(r){console.error(r)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return t(this,e)},HTMLElement.prototype.flatpickr=function(e){return t([this],e)});var Me=function Me(e,n){return e instanceof NodeList?t(e,n):t("string"==typeof e?window.document.querySelectorAll(e):[e],n)};return Me.defaultConfig=C,Me.l10ns={en:Object.assign({},se),"default":Object.assign({},se)},Me.localize=function(e){Me.l10ns["default"]=Object.assign({},Me.l10ns["default"],e)},Me.setDefaults=function(e){Me.defaultConfig=Object.assign({},Me.defaultConfig,e)},Me.parseDate=me({}),Me.formatDate=fe({}),Me.compareDates=ge,"undefined"!=typeof jQuery&&(jQuery.fn.flatpickr=function(e){return t(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=Me),Me});
1
+ /* flatpickr v4.6.3,, @license MIT */
2
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).flatpickr=t()}(this,function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,a=arguments.length;n<a;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)},t=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],n={_disable:[],_enable:[],allowInput:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enable:[],enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",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>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,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>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},a={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},i=function(e){return("0"+e).slice(-2)},o=function(e){return!0===e?1:0};function r(e,t,n){var a;return void 0===n&&(n=!1),function(){var i=this,o=arguments;null!==a&&clearTimeout(a),a=window.setTimeout(function(){a=null,n||e.apply(i,o)},t),n&&!a&&e.apply(i,o)}}var l=function(e){return e instanceof Array?e:[e]};function c(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function d(e,t,n){var a=window.document.createElement(e);return t=t||"",n=n||"",a.className=t,void 0!==n&&(a.textContent=n),a}function s(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function u(e,t){var n=d("div","numInputWrapper"),a=d("input","numInput "+e),i=d("span","arrowUp"),o=d("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?a.type="number":(a.type="text",a.pattern="\\d*"),void 0!==t)for(var r in t)a.setAttribute(r,t[r]);return n.appendChild(a),n.appendChild(i),n.appendChild(o),n}var f=function(){},m=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},g={D:f,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours(parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*o(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var a=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(a-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours(parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:f,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:f,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},p={D:"(\\w+)",F:"(\\w+)",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"(\\w+)",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"(\\w+)",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},h={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[h.w(e,t,n)]},F:function(e,t,n){return m(h.n(e,t,n)-1,!1,t)},G:function(e,t,n){return i(h.h(e,t,n))},H:function(e){return i(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[o(e.getHours()>11)]},M:function(e,t){return m(e.getMonth(),!0,t)},S:function(e){return i(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return e.getFullYear()},d:function(e){return i(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return i(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return i(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},v=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,n){var a=n||r;return void 0!==i.formatDate?i.formatDate(e,t,a):t.split("").map(function(t,n,o){return h[t]&&"\\"!==o[n-1]?h[t](e,a,i):"\\"!==t?t:""}).join("")}},D=function(e){var t=e.config,i=void 0===t?n:t,o=e.l10n,r=void 0===o?a:o;return function(e,t,a,o){if(0===e||e){var l,c=o||r,d=e;if(e instanceof Date)l=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)l=new Date(e);else if("string"==typeof e){var s=t||(i||n).dateFormat,u=String(e).trim();if("today"===u)l=new Date,a=!0;else if(/Z$/.test(u)||/GMT$/.test(u))l=new Date(e);else if(i&&i.parseDate)l=i.parseDate(e,s);else{l=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0);for(var f=void 0,m=[],h=0,v=0,D="";h<s.length;h++){var w=s[h],b="\\"===w,C="\\"===s[h-1]||b;if(p[w]&&!C){D+=p[w];var M=new RegExp(D).exec(e);M&&(f=!0)&&m["Y"!==w?"push":"unshift"]({fn:g[w],val:M[++v]})}else b||(D+=".");m.forEach(function(e){var t=e.fn,n=e.val;return l=t(l,n,c)||l})}l=f?l:void 0}}if(l instanceof Date&&!isNaN(l.getTime()))return!0===a&&l.setHours(0,0,0,0),l;i.errorHandler(new Error("Invalid date provided: "+d))}}};function w(e,t,n){return void 0===n&&(n=!0),!1!==n?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var b=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},C={DAY:864e5};"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var a=function(t){t&&Object.keys(t).forEach(function(n){return e[n]=t[n]})},i=0,o=t;i<o.length;i++){a(o[i])}return e});var M=300;function y(f,g){var h={config:e({},n,E.defaultConfig),l10n:a};function y(e){return e.bind(h)}function x(){var e=h.config;!1===e.weekNumbers&&1===e.showMonths||!0!==e.noCalendar&&window.requestAnimationFrame(function(){if(void 0!==h.calendarContainer&&(h.calendarContainer.style.visibility="hidden",h.calendarContainer.style.display="block"),void 0!==h.daysContainer){var t=(h.days.offsetWidth+1)*e.showMonths;h.daysContainer.style.width=t+"px",h.calendarContainer.style.width=t+(void 0!==h.weekWrapper?h.weekWrapper.offsetWidth:0)+"px",h.calendarContainer.style.removeProperty("visibility"),h.calendarContainer.style.removeProperty("display")}})}function T(e){0===h.selectedDates.length&&ie(),void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,n=e.target;void 0!==h.amPM&&e.target===h.amPM&&(h.amPM.textContent=h.l10n.amPM[o(h.amPM.textContent===h.l10n.amPM[0])]);var a=parseFloat(n.getAttribute("min")),r=parseFloat(n.getAttribute("max")),l=parseFloat(n.getAttribute("step")),c=parseInt(n.value,10),d=e.delta||(t?38===e.which?1:-1:0),s=c+l*d;if(void 0!==n.value&&2===n.value.length){var u=n===h.hourElement,f=n===h.minuteElement;s<a?(s=r+s+o(!u)+(o(u)&&o(!h.amPM)),f&&j(void 0,-1,h.hourElement)):s>r&&(s=n===h.hourElement?s-r-o(!h.amPM):a,f&&j(void 0,1,h.hourElement)),h.amPM&&u&&(1===l?s+c===23:Math.abs(s-c)>l)&&(h.amPM.textContent=h.l10n.amPM[o(h.amPM.textContent===h.l10n.amPM[0])]),n.value=i(s)}}(e);var t=h._input.value;k(),we(),h._input.value!==t&&h._debouncedChange()}function k(){if(void 0!==h.hourElement&&void 0!==h.minuteElement){var e,t,n=(parseInt(h.hourElement.value.slice(-2),10)||0)%24,a=(parseInt(h.minuteElement.value,10)||0)%60,i=void 0!==h.secondElement?(parseInt(h.secondElement.value,10)||0)%60:0;void 0!==h.amPM&&(e=n,t=h.amPM.textContent,n=e%12+12*o(t===h.l10n.amPM[1]));var r=void 0!==h.config.minTime||h.config.minDate&&h.minDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.minDate,!0);if(void 0!==h.config.maxTime||h.config.maxDate&&h.maxDateHasTime&&h.latestSelectedDateObj&&0===w(h.latestSelectedDateObj,h.config.maxDate,!0)){var l=void 0!==h.config.maxTime?h.config.maxTime:h.config.maxDate;(n=Math.min(n,l.getHours()))===l.getHours()&&(a=Math.min(a,l.getMinutes())),a===l.getMinutes()&&(i=Math.min(i,l.getSeconds()))}if(r){var c=void 0!==h.config.minTime?h.config.minTime:h.config.minDate;(n=Math.max(n,c.getHours()))===c.getHours()&&(a=Math.max(a,c.getMinutes())),a===c.getMinutes()&&(i=Math.max(i,c.getSeconds()))}O(n,a,i)}}function I(e){var t=e||h.latestSelectedDateObj;t&&O(t.getHours(),t.getMinutes(),t.getSeconds())}function S(){var e=h.config.defaultHour,t=h.config.defaultMinute,n=h.config.defaultSeconds;if(void 0!==h.config.minDate){var a=h.config.minDate.getHours(),i=h.config.minDate.getMinutes();(e=Math.max(e,a))===a&&(t=Math.max(i,t)),e===a&&t===i&&(n=h.config.minDate.getSeconds())}if(void 0!==h.config.maxDate){var o=h.config.maxDate.getHours(),r=h.config.maxDate.getMinutes();(e=Math.min(e,o))===o&&(t=Math.min(r,t)),e===o&&t===r&&(n=h.config.maxDate.getSeconds())}O(e,t,n)}function O(e,t,n){void 0!==h.latestSelectedDateObj&&h.latestSelectedDateObj.setHours(e%24,t,n||0,0),h.hourElement&&h.minuteElement&&!h.isMobile&&(h.hourElement.value=i(h.config.time_24hr?e:(12+e)%12+12*o(e%12==0)),h.minuteElement.value=i(t),void 0!==h.amPM&&(h.amPM.textContent=h.l10n.amPM[o(e>=12)]),void 0!==h.secondElement&&(h.secondElement.value=i(n)))}function _(e){var t=parseInt(e.target.value)+(e.delta||0);(t/1e3>1||"Enter"===e.key&&!/[^\d]/.test(t.toString()))&&Q(t)}function F(e,t,n,a){return t instanceof Array?t.forEach(function(t){return F(e,t,n,a)}):e instanceof Array?e.forEach(function(e){return F(e,t,n,a)}):(e.addEventListener(t,n,a),void h._handlers.push({element:e,event:t,handler:n,options:a}))}function N(e){return function(t){1===t.which&&e(t)}}function Y(){ge("onChange")}function A(e,t){var n=void 0!==e?h.parseDate(e):h.latestSelectedDateObj||(h.config.minDate&&h.config.minDate>h.now?h.config.minDate:h.config.maxDate&&h.config.maxDate<h.now?h.config.maxDate:h.now),a=h.currentYear,i=h.currentMonth;try{void 0!==n&&(h.currentYear=n.getFullYear(),h.currentMonth=n.getMonth())}catch(e){e.message="Invalid date supplied: "+n,h.config.errorHandler(e)}t&&h.currentYear!==a&&(ge("onYearChange"),K()),!t||h.currentYear===a&&h.currentMonth===i||ge("onMonthChange"),h.redraw()}function P(e){~e.target.className.indexOf("arrow")&&j(e,e.target.classList.contains("arrowUp")?1:-1)}function j(e,t,n){var a=e&&e.target,i=n||a&&a.parentNode&&a.parentNode.firstChild,o=pe("increment");o.delta=t,i&&i.dispatchEvent(o)}function H(e,t,n,a){var i=X(t,!0),o=d("span","flatpickr-day "+e,t.getDate().toString());return o.dateObj=t,o.$i=a,o.setAttribute("aria-label",h.formatDate(t,h.config.ariaDateFormat)),-1===e.indexOf("hidden")&&0===w(t,h.now)&&(h.todayDateElem=o,o.classList.add("today"),o.setAttribute("aria-current","date")),i?(o.tabIndex=-1,he(t)&&(o.classList.add("selected"),h.selectedDateElem=o,"range"===h.config.mode&&(c(o,"startRange",h.selectedDates[0]&&0===w(t,h.selectedDates[0],!0)),c(o,"endRange",h.selectedDates[1]&&0===w(t,h.selectedDates[1],!0)),"nextMonthDay"===e&&o.classList.add("inRange")))):o.classList.add("flatpickr-disabled"),"range"===h.config.mode&&function(e){return!("range"!==h.config.mode||h.selectedDates.length<2)&&w(e,h.selectedDates[0])>=0&&w(e,h.selectedDates[1])<=0}(t)&&!he(t)&&o.classList.add("inRange"),h.weekNumbers&&1===h.config.showMonths&&"prevMonthDay"!==e&&n%7==1&&h.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+h.config.getWeek(t)+"</span>"),ge("onDayCreate",o),o}function L(e){e.focus(),"range"===h.config.mode&&ne(e)}function W(e){for(var t=e>0?0:h.config.showMonths-1,n=e>0?h.config.showMonths:-1,a=t;a!=n;a+=e)for(var i=h.daysContainer.children[a],o=e>0?0:i.children.length-1,r=e>0?i.children.length:-1,l=o;l!=r;l+=e){var c=i.children[l];if(-1===c.className.indexOf("hidden")&&X(c.dateObj))return c}}function R(e,t){var n=ee(document.activeElement||document.body),a=void 0!==e?e:n?document.activeElement:void 0!==h.selectedDateElem&&ee(h.selectedDateElem)?h.selectedDateElem:void 0!==h.todayDateElem&&ee(h.todayDateElem)?h.todayDateElem:W(t>0?1:-1);return void 0===a?h._input.focus():n?void function(e,t){for(var n=-1===e.className.indexOf("Month")?e.dateObj.getMonth():h.currentMonth,a=t>0?h.config.showMonths:-1,i=t>0?1:-1,o=n-h.currentMonth;o!=a;o+=i)for(var r=h.daysContainer.children[o],l=n-h.currentMonth===o?e.$i+t:t<0?r.children.length-1:0,c=r.children.length,d=l;d>=0&&d<c&&d!=(t>0?c:-1);d+=i){var s=r.children[d];if(-1===s.className.indexOf("hidden")&&X(s.dateObj)&&Math.abs(e.$i-d)>=Math.abs(t))return L(s)}h.changeMonth(i),R(W(i),0)}(a,t):L(a)}function B(e,t){for(var n=(new Date(e,t,1).getDay()-h.l10n.firstDayOfWeek+7)%7,a=h.utils.getDaysInMonth((t-1+12)%12),i=h.utils.getDaysInMonth(t),o=window.document.createDocumentFragment(),r=h.config.showMonths>1,l=r?"prevMonthDay hidden":"prevMonthDay",c=r?"nextMonthDay hidden":"nextMonthDay",s=a+1-n,u=0;s<=a;s++,u++)o.appendChild(H(l,new Date(e,t-1,s),s,u));for(s=1;s<=i;s++,u++)o.appendChild(H("",new Date(e,t,s),s,u));for(var f=i+1;f<=42-n&&(1===h.config.showMonths||u%7!=0);f++,u++)o.appendChild(H(c,new Date(e,t+1,f%i),f,u));var m=d("div","dayContainer");return m.appendChild(o),m}function J(){if(void 0!==h.daysContainer){s(h.daysContainer),h.weekNumbers&&s(h.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t<h.config.showMonths;t++){var n=new Date(h.currentYear,h.currentMonth,1);n.setMonth(h.currentMonth+t),e.appendChild(B(n.getFullYear(),n.getMonth()))}h.daysContainer.appendChild(e),h.days=h.daysContainer.firstChild,"range"===h.config.mode&&1===h.selectedDates.length&&ne()}}function K(){if(!(h.config.showMonths>1||"dropdown"!==h.config.monthSelectorType)){var e=function(e){return!(void 0!==h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&e<h.config.minDate.getMonth())&&!(void 0!==h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()&&e>h.config.maxDate.getMonth())};h.monthsDropdownContainer.tabIndex=-1,h.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var n=d("option","flatpickr-monthDropdown-month");n.value=new Date(h.currentYear,t).getMonth().toString(),n.textContent=m(t,h.config.shorthandCurrentMonth,h.l10n),n.tabIndex=-1,h.currentMonth===t&&(n.selected=!0),h.monthsDropdownContainer.appendChild(n)}}}function U(){var e,t=d("div","flatpickr-month"),n=window.document.createDocumentFragment();h.config.showMonths>1||"static"===h.config.monthSelectorType?e=d("span","cur-month"):(h.monthsDropdownContainer=d("select","flatpickr-monthDropdown-months"),F(h.monthsDropdownContainer,"change",function(e){var t=e.target,n=parseInt(t.value,10);h.changeMonth(n-h.currentMonth),ge("onMonthChange")}),K(),e=h.monthsDropdownContainer);var a=u("cur-year",{tabindex:"-1"}),i=a.getElementsByTagName("input")[0];i.setAttribute("aria-label",h.l10n.yearAriaLabel),h.config.minDate&&i.setAttribute("min",h.config.minDate.getFullYear().toString()),h.config.maxDate&&(i.setAttribute("max",h.config.maxDate.getFullYear().toString()),i.disabled=!!h.config.minDate&&h.config.minDate.getFullYear()===h.config.maxDate.getFullYear());var o=d("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(a),n.appendChild(o),t.appendChild(n),{container:t,yearElement:i,monthElement:e}}function q(){s(h.monthNav),h.monthNav.appendChild(h.prevMonthNav),h.config.showMonths&&(h.yearElements=[],h.monthElements=[]);for(var e=h.config.showMonths;e--;){var t=U();h.yearElements.push(t.yearElement),h.monthElements.push(t.monthElement),h.monthNav.appendChild(t.container)}h.monthNav.appendChild(h.nextMonthNav)}function $(){h.weekdayContainer?s(h.weekdayContainer):h.weekdayContainer=d("div","flatpickr-weekdays");for(var e=h.config.showMonths;e--;){var t=d("div","flatpickr-weekdaycontainer");h.weekdayContainer.appendChild(t)}return z(),h.weekdayContainer}function z(){if(h.weekdayContainer){var e=h.l10n.firstDayOfWeek,t=h.l10n.weekdays.shorthand.slice();e>0&&e<t.length&&(t=t.splice(e,t.length).concat(t.splice(0,e)));for(var n=h.config.showMonths;n--;)h.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+t.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function G(e,t){void 0===t&&(t=!0);var n=t?e:e-h.currentMonth;n<0&&!0===h._hidePrevMonthArrow||n>0&&!0===h._hideNextMonthArrow||(h.currentMonth+=n,(h.currentMonth<0||h.currentMonth>11)&&(h.currentYear+=h.currentMonth>11?1:-1,h.currentMonth=(h.currentMonth+12)%12,ge("onYearChange"),K()),J(),ge("onMonthChange"),ve())}function V(e){return!(!h.config.appendTo||!h.config.appendTo.contains(e))||h.calendarContainer.contains(e)}function Z(e){if(h.isOpen&&!h.config.inline){var t="function"==typeof(r=e).composedPath?r.composedPath()[0]:r.target,n=V(t),a=t===h.input||t===h.altInput||h.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(h.input)||~e.path.indexOf(h.altInput)),i="blur"===e.type?a&&e.relatedTarget&&!V(e.relatedTarget):!a&&!n&&!V(e.relatedTarget),o=!h.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&o&&(void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&T(),h.close(),"range"===h.config.mode&&1===h.selectedDates.length&&(h.clear(!1),h.redraw()))}var r}function Q(e){if(!(!e||h.config.minDate&&e<h.config.minDate.getFullYear()||h.config.maxDate&&e>h.config.maxDate.getFullYear())){var t=e,n=h.currentYear!==t;h.currentYear=t||h.currentYear,h.config.maxDate&&h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth=Math.min(h.config.maxDate.getMonth(),h.currentMonth):h.config.minDate&&h.currentYear===h.config.minDate.getFullYear()&&(h.currentMonth=Math.max(h.config.minDate.getMonth(),h.currentMonth)),n&&(h.redraw(),ge("onYearChange"),K())}}function X(e,t){void 0===t&&(t=!0);var n=h.parseDate(e,void 0,t);if(h.config.minDate&&n&&w(n,h.config.minDate,void 0!==t?t:!h.minDateHasTime)<0||h.config.maxDate&&n&&w(n,h.config.maxDate,void 0!==t?t:!h.maxDateHasTime)>0)return!1;if(0===h.config.enable.length&&0===h.config.disable.length)return!0;if(void 0===n)return!1;for(var a=h.config.enable.length>0,i=a?h.config.enable:h.config.disable,o=0,r=void 0;o<i.length;o++){if("function"==typeof(r=i[o])&&r(n))return a;if(r instanceof Date&&void 0!==n&&r.getTime()===n.getTime())return a;if("string"==typeof r&&void 0!==n){var l=h.parseDate(r,void 0,!0);return l&&l.getTime()===n.getTime()?a:!a}if("object"==typeof r&&void 0!==n&&r.from&&r.to&&n.getTime()>=r.from.getTime()&&n.getTime()<=r.to.getTime())return a}return!a}function ee(e){return void 0!==h.daysContainer&&(-1===e.className.indexOf("hidden")&&h.daysContainer.contains(e))}function te(e){var t=e.target===h._input,n=h.config.allowInput,a=h.isOpen&&(!n||!t),i=h.config.inline&&t&&!n;if(13===e.keyCode&&t){if(n)return h.setDate(h._input.value,!0,e.target===h.altInput?h.config.altFormat:h.config.dateFormat),e.target.blur();h.open()}else if(V(e.target)||a||i){var o=!!h.timeContainer&&h.timeContainer.contains(e.target);switch(e.keyCode){case 13:o?(e.preventDefault(),T(),de()):se(e);break;case 27:e.preventDefault(),de();break;case 8:case 46:t&&!h.config.allowInput&&(e.preventDefault(),h.clear());break;case 37:case 39:if(o||t)h.hourElement&&h.hourElement.focus();else if(e.preventDefault(),void 0!==h.daysContainer&&(!1===n||document.activeElement&&ee(document.activeElement))){var r=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),G(r),R(W(1),0)):R(void 0,r)}break;case 38:case 40:e.preventDefault();var l=40===e.keyCode?1:-1;h.daysContainer&&void 0!==e.target.$i||e.target===h.input||e.target===h.altInput?e.ctrlKey?(e.stopPropagation(),Q(h.currentYear-l),R(W(1),0)):o||R(void 0,7*l):e.target===h.currentYearElement?Q(h.currentYear-l):h.config.enableTime&&(!o&&h.hourElement&&h.hourElement.focus(),T(e),h._debouncedChange());break;case 9:if(o){var c=[h.hourElement,h.minuteElement,h.secondElement,h.amPM].concat(h.pluginElements).filter(function(e){return e}),d=c.indexOf(e.target);if(-1!==d){var s=c[d+(e.shiftKey?-1:1)];e.preventDefault(),(s||h._input).focus()}}else!h.config.noCalendar&&h.daysContainer&&h.daysContainer.contains(e.target)&&e.shiftKey&&(e.preventDefault(),h._input.focus())}}if(void 0!==h.amPM&&e.target===h.amPM)switch(e.key){case h.l10n.amPM[0].charAt(0):case h.l10n.amPM[0].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[0],k(),we();break;case h.l10n.amPM[1].charAt(0):case h.l10n.amPM[1].charAt(0).toLowerCase():h.amPM.textContent=h.l10n.amPM[1],k(),we()}(t||V(e.target))&&ge("onKeyDown",e)}function ne(e){if(1===h.selectedDates.length&&(!e||e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled"))){for(var t=e?e.dateObj.getTime():h.days.firstElementChild.dateObj.getTime(),n=h.parseDate(h.selectedDates[0],void 0,!0).getTime(),a=Math.min(t,h.selectedDates[0].getTime()),i=Math.max(t,h.selectedDates[0].getTime()),o=!1,r=0,l=0,c=a;c<i;c+=C.DAY)X(new Date(c),!0)||(o=o||c>a&&c<i,c<n&&(!r||c>r)?r=c:c>n&&(!l||c<l)&&(l=c));for(var d=0;d<h.config.showMonths;d++)for(var s=h.daysContainer.children[d],u=function(a,i){var c=s.children[a],d=c.dateObj.getTime(),u=r>0&&d<r||l>0&&d>l;return u?(c.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(e){c.classList.remove(e)}),"continue"):o&&!u?"continue":(["startRange","inRange","endRange","notAllowed"].forEach(function(e){c.classList.remove(e)}),void(void 0!==e&&(e.classList.add(t<=h.selectedDates[0].getTime()?"startRange":"endRange"),n<t&&d===n?c.classList.add("startRange"):n>t&&d===n&&c.classList.add("endRange"),d>=r&&(0===l||d<=l)&&b(d,n,t)&&c.classList.add("inRange"))))},f=0,m=s.children.length;f<m;f++)u(f)}}function ae(){!h.isOpen||h.config.static||h.config.inline||le()}function ie(){h.setDate(void 0!==h.config.minDate?new Date(h.config.minDate.getTime()):new Date,!0),S(),we()}function oe(e){return function(t){var n=h.config["_"+e+"Date"]=h.parseDate(t,h.config.dateFormat),a=h.config["_"+("min"===e?"max":"min")+"Date"];void 0!==n&&(h["min"===e?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),h.selectedDates&&(h.selectedDates=h.selectedDates.filter(function(e){return X(e)}),h.selectedDates.length||"min"!==e||I(n),we()),h.daysContainer&&(ce(),void 0!==n?h.currentYearElement[e]=n.getFullYear().toString():h.currentYearElement.removeAttribute(e),h.currentYearElement.disabled=!!a&&void 0!==n&&a.getFullYear()===n.getFullYear())}}function re(){"object"!=typeof h.config.locale&&void 0===E.l10ns[h.config.locale]&&h.config.errorHandler(new Error("flatpickr: invalid locale "+h.config.locale)),h.l10n=e({},E.l10ns.default,"object"==typeof h.config.locale?h.config.locale:"default"!==h.config.locale?E.l10ns[h.config.locale]:void 0),p.K="("+h.l10n.amPM[0]+"|"+h.l10n.amPM[1]+"|"+h.l10n.amPM[0].toLowerCase()+"|"+h.l10n.amPM[1].toLowerCase()+")",void 0===e({},g,JSON.parse(JSON.stringify(f.dataset||{}))).time_24hr&&void 0===E.defaultConfig.time_24hr&&(h.config.time_24hr=h.l10n.time_24hr),h.formatDate=v(h),h.parseDate=D({config:h.config,l10n:h.l10n})}function le(e){if(void 0!==h.calendarContainer){ge("onPreCalendarPosition");var t=e||h._positionElement,n=Array.prototype.reduce.call(h.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),a=h.calendarContainer.offsetWidth,i=h.config.position.split(" "),o=i[0],r=i.length>1?i[1]:null,l=t.getBoundingClientRect(),d=window.innerHeight-l.bottom,s="above"===o||"below"!==o&&d<n&&l.top>n,u=window.pageYOffset+l.top+(s?-n-2:t.offsetHeight+2);if(c(h.calendarContainer,"arrowTop",!s),c(h.calendarContainer,"arrowBottom",s),!h.config.inline){var f=window.pageXOffset+l.left-(null!=r&&"center"===r?(a-l.width)/2:0),m=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=f+a>window.document.body.offsetWidth,p=m+a>window.document.body.offsetWidth;if(c(h.calendarContainer,"rightMost",g),!h.config.static)if(h.calendarContainer.style.top=u+"px",g)if(p){var v=document.styleSheets[0];if(void 0===v)return;var D=window.document.body.offsetWidth,w=Math.max(0,D/2-a/2),b=v.cssRules.length,C="{left:"+l.left+"px;right:auto;}";c(h.calendarContainer,"rightMost",!1),c(h.calendarContainer,"centerMost",!0),v.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+C,b),h.calendarContainer.style.left=w+"px",h.calendarContainer.style.right="auto"}else h.calendarContainer.style.left="auto",h.calendarContainer.style.right=m+"px";else h.calendarContainer.style.left=f+"px",h.calendarContainer.style.right="auto"}}}function ce(){h.config.noCalendar||h.isMobile||(ve(),J())}function de(){h._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(h.close,0):h.close()}function se(e){e.preventDefault(),e.stopPropagation();var t=function e(t,n){return n(t)?t:t.parentNode?e(t.parentNode,n):void 0}(e.target,function(e){return e.classList&&e.classList.contains("flatpickr-day")&&!e.classList.contains("flatpickr-disabled")&&!e.classList.contains("notAllowed")});if(void 0!==t){var n=t,a=h.latestSelectedDateObj=new Date(n.dateObj.getTime()),i=(a.getMonth()<h.currentMonth||a.getMonth()>h.currentMonth+h.config.showMonths-1)&&"range"!==h.config.mode;if(h.selectedDateElem=n,"single"===h.config.mode)h.selectedDates=[a];else if("multiple"===h.config.mode){var o=he(a);o?h.selectedDates.splice(parseInt(o),1):h.selectedDates.push(a)}else"range"===h.config.mode&&(2===h.selectedDates.length&&h.clear(!1,!1),h.latestSelectedDateObj=a,h.selectedDates.push(a),0!==w(a,h.selectedDates[0],!0)&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(k(),i){var r=h.currentYear!==a.getFullYear();h.currentYear=a.getFullYear(),h.currentMonth=a.getMonth(),r&&(ge("onYearChange"),K()),ge("onMonthChange")}if(ve(),J(),we(),h.config.enableTime&&setTimeout(function(){return h.showTimeInput=!0},50),i||"range"===h.config.mode||1!==h.config.showMonths?void 0!==h.selectedDateElem&&void 0===h.hourElement&&h.selectedDateElem&&h.selectedDateElem.focus():L(n),void 0!==h.hourElement&&void 0!==h.hourElement&&h.hourElement.focus(),h.config.closeOnSelect){var l="single"===h.config.mode&&!h.config.enableTime,c="range"===h.config.mode&&2===h.selectedDates.length&&!h.config.enableTime;(l||c)&&de()}Y()}}h.parseDate=D({config:h.config,l10n:h.l10n}),h._handlers=[],h.pluginElements=[],h.loadedPlugins=[],h._bind=F,h._setHoursFromDate=I,h._positionCalendar=le,h.changeMonth=G,h.changeYear=Q,h.clear=function(e,t){void 0===e&&(e=!0);void 0===t&&(t=!0);h.input.value="",void 0!==h.altInput&&(h.altInput.value="");void 0!==h.mobileInput&&(h.mobileInput.value="");h.selectedDates=[],h.latestSelectedDateObj=void 0,!0===t&&(h.currentYear=h._initialDate.getFullYear(),h.currentMonth=h._initialDate.getMonth());h.showTimeInput=!1,!0===h.config.enableTime&&S();h.redraw(),e&&ge("onChange")},h.close=function(){h.isOpen=!1,h.isMobile||(void 0!==h.calendarContainer&&h.calendarContainer.classList.remove("open"),void 0!==h._input&&h._input.classList.remove("active"));ge("onClose")},h._createElement=d,h.destroy=function(){void 0!==h.config&&ge("onDestroy");for(var e=h._handlers.length;e--;){var t=h._handlers[e];t.element.removeEventListener(t.event,t.handler,t.options)}if(h._handlers=[],h.mobileInput)h.mobileInput.parentNode&&h.mobileInput.parentNode.removeChild(h.mobileInput),h.mobileInput=void 0;else if(h.calendarContainer&&h.calendarContainer.parentNode)if(h.config.static&&h.calendarContainer.parentNode){var n=h.calendarContainer.parentNode;if(n.lastChild&&n.removeChild(n.lastChild),n.parentNode){for(;n.firstChild;)n.parentNode.insertBefore(n.firstChild,n);n.parentNode.removeChild(n)}}else h.calendarContainer.parentNode.removeChild(h.calendarContainer);h.altInput&&(h.input.type="text",h.altInput.parentNode&&h.altInput.parentNode.removeChild(h.altInput),delete h.altInput);h.input&&(h.input.type=h.input._type,h.input.classList.remove("flatpickr-input"),h.input.removeAttribute("readonly"),h.input.value="");["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete h[e]}catch(e){}})},h.isEnabled=X,h.jumpToDate=A,h.open=function(e,t){void 0===t&&(t=h._positionElement);if(!0===h.isMobile)return e&&(e.preventDefault(),e.target&&e.target.blur()),void 0!==h.mobileInput&&(h.mobileInput.focus(),h.mobileInput.click()),void ge("onOpen");if(h._input.disabled||h.config.inline)return;var n=h.isOpen;h.isOpen=!0,n||(h.calendarContainer.classList.add("open"),h._input.classList.add("active"),ge("onOpen"),le(t));!0===h.config.enableTime&&!0===h.config.noCalendar&&(0===h.selectedDates.length&&ie(),!1!==h.config.allowInput||void 0!==e&&h.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return h.hourElement.select()},50))},h.redraw=ce,h.set=function(e,n){if(null!==e&&"object"==typeof e)for(var a in Object.assign(h.config,e),e)void 0!==ue[a]&&ue[a].forEach(function(e){return e()});else h.config[e]=n,void 0!==ue[e]?ue[e].forEach(function(e){return e()}):t.indexOf(e)>-1&&(h.config[e]=l(n));h.redraw(),we(!1)},h.setDate=function(e,t,n){void 0===t&&(t=!1);void 0===n&&(n=h.config.dateFormat);if(0!==e&&!e||e instanceof Array&&0===e.length)return h.clear(t);fe(e,n),h.showTimeInput=h.selectedDates.length>0,h.latestSelectedDateObj=h.selectedDates[h.selectedDates.length-1],h.redraw(),A(),I(),0===h.selectedDates.length&&h.clear(!1);we(t),t&&ge("onChange")},h.toggle=function(e){if(!0===h.isOpen)return h.close();h.open(e)};var ue={locale:[re,z],showMonths:[q,x,$],minDate:[A],maxDate:[A]};function fe(e,t){var n=[];if(e instanceof Array)n=e.map(function(e){return h.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)n=[h.parseDate(e,t)];else if("string"==typeof e)switch(h.config.mode){case"single":case"time":n=[h.parseDate(e,t)];break;case"multiple":n=e.split(h.config.conjunction).map(function(e){return h.parseDate(e,t)});break;case"range":n=e.split(h.l10n.rangeSeparator).map(function(e){return h.parseDate(e,t)})}else h.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));h.selectedDates=n.filter(function(e){return e instanceof Date&&X(e,!1)}),"range"===h.config.mode&&h.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function me(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?h.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:h.parseDate(e.from,void 0),to:h.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(e,t){if(void 0!==h.config){var n=h.config[e];if(void 0!==n&&n.length>0)for(var a=0;n[a]&&a<n.length;a++)n[a](h.selectedDates,h.input.value,h,t);"onChange"===e&&(h.input.dispatchEvent(pe("change")),h.input.dispatchEvent(pe("input")))}}function pe(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!0),t}function he(e){for(var t=0;t<h.selectedDates.length;t++)if(0===w(h.selectedDates[t],e))return""+t;return!1}function ve(){h.config.noCalendar||h.isMobile||!h.monthNav||(h.yearElements.forEach(function(e,t){var n=new Date(h.currentYear,h.currentMonth,1);n.setMonth(h.currentMonth+t),h.config.showMonths>1||"static"===h.config.monthSelectorType?h.monthElements[t].textContent=m(n.getMonth(),h.config.shorthandCurrentMonth,h.l10n)+" ":h.monthsDropdownContainer.value=n.getMonth().toString(),e.value=n.getFullYear().toString()}),h._hidePrevMonthArrow=void 0!==h.config.minDate&&(h.currentYear===h.config.minDate.getFullYear()?h.currentMonth<=h.config.minDate.getMonth():h.currentYear<h.config.minDate.getFullYear()),h._hideNextMonthArrow=void 0!==h.config.maxDate&&(h.currentYear===h.config.maxDate.getFullYear()?h.currentMonth+1>h.config.maxDate.getMonth():h.currentYear>h.config.maxDate.getFullYear()))}function De(e){return h.selectedDates.map(function(t){return h.formatDate(t,e)}).filter(function(e,t,n){return"range"!==h.config.mode||h.config.enableTime||n.indexOf(e)===t}).join("range"!==h.config.mode?h.config.conjunction:h.l10n.rangeSeparator)}function we(e){void 0===e&&(e=!0),void 0!==h.mobileInput&&h.mobileFormatStr&&(h.mobileInput.value=void 0!==h.latestSelectedDateObj?h.formatDate(h.latestSelectedDateObj,h.mobileFormatStr):""),h.input.value=De(h.config.dateFormat),void 0!==h.altInput&&(h.altInput.value=De(h.config.altFormat)),!1!==e&&ge("onValueUpdate")}function be(e){var t=h.prevMonthNav.contains(e.target),n=h.nextMonthNav.contains(e.target);t||n?G(t?-1:1):h.yearElements.indexOf(e.target)>=0?e.target.select():e.target.classList.contains("arrowUp")?h.changeYear(h.currentYear+1):e.target.classList.contains("arrowDown")&&h.changeYear(h.currentYear-1)}return function(){h.element=h.input=f,h.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],i=e({},g,JSON.parse(JSON.stringify(f.dataset||{}))),o={};h.config.parseDate=i.parseDate,h.config.formatDate=i.formatDate,Object.defineProperty(h.config,"enable",{get:function(){return h.config._enable},set:function(e){h.config._enable=me(e)}}),Object.defineProperty(h.config,"disable",{get:function(){return h.config._disable},set:function(e){h.config._disable=me(e)}});var r="time"===i.mode;if(!i.dateFormat&&(i.enableTime||r)){var c=E.defaultConfig.dateFormat||n.dateFormat;o.dateFormat=i.noCalendar||r?"H:i"+(i.enableSeconds?":S":""):c+" H:i"+(i.enableSeconds?":S":"")}if(i.altInput&&(i.enableTime||r)&&!i.altFormat){var d=E.defaultConfig.altFormat||n.altFormat;o.altFormat=i.noCalendar||r?"h:i"+(i.enableSeconds?":S K":" K"):d+" h:i"+(i.enableSeconds?":S":"")+" K"}i.altInputClass||(h.config.altInputClass=h.input.className+" "+h.config.altInputClass),Object.defineProperty(h.config,"minDate",{get:function(){return h.config._minDate},set:oe("min")}),Object.defineProperty(h.config,"maxDate",{get:function(){return h.config._maxDate},set:oe("max")});var s=function(e){return function(t){h.config["min"===e?"_minTime":"_maxTime"]=h.parseDate(t,"H:i:S")}};Object.defineProperty(h.config,"minTime",{get:function(){return h.config._minTime},set:s("min")}),Object.defineProperty(h.config,"maxTime",{get:function(){return h.config._maxTime},set:s("max")}),"time"===i.mode&&(h.config.noCalendar=!0,h.config.enableTime=!0),Object.assign(h.config,o,i);for(var u=0;u<a.length;u++)h.config[a[u]]=!0===h.config[a[u]]||"true"===h.config[a[u]];t.filter(function(e){return void 0!==h.config[e]}).forEach(function(e){h.config[e]=l(h.config[e]||[]).map(y)}),h.isMobile=!h.config.disableMobile&&!h.config.inline&&"single"===h.config.mode&&!h.config.disable.length&&!h.config.enable.length&&!h.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var u=0;u<h.config.plugins.length;u++){var m=h.config.plugins[u](h)||{};for(var p in m)t.indexOf(p)>-1?h.config[p]=l(m[p]).map(y).concat(h.config[p]):void 0===i[p]&&(h.config[p]=m[p])}ge("onParseConfig")}(),re(),h.input=h.config.wrap?f.querySelector("[data-input]"):f,h.input?(h.input._type=h.input.type,h.input.type="text",h.input.classList.add("flatpickr-input"),h._input=h.input,h.config.altInput&&(h.altInput=d(h.input.nodeName,h.config.altInputClass),h._input=h.altInput,h.altInput.placeholder=h.input.placeholder,h.altInput.disabled=h.input.disabled,h.altInput.required=h.input.required,h.altInput.tabIndex=h.input.tabIndex,h.altInput.type="text",h.input.setAttribute("type","hidden"),!h.config.static&&h.input.parentNode&&h.input.parentNode.insertBefore(h.altInput,h.input.nextSibling)),h.config.allowInput||h._input.setAttribute("readonly","readonly"),h._positionElement=h.config.positionElement||h._input):h.config.errorHandler(new Error("Invalid input element specified")),function(){h.selectedDates=[],h.now=h.parseDate(h.config.now)||new Date;var e=h.config.defaultDate||("INPUT"!==h.input.nodeName&&"TEXTAREA"!==h.input.nodeName||!h.input.placeholder||h.input.value!==h.input.placeholder?h.input.value:null);e&&fe(e,h.config.dateFormat),h._initialDate=h.selectedDates.length>0?h.selectedDates[0]:h.config.minDate&&h.config.minDate.getTime()>h.now.getTime()?h.config.minDate:h.config.maxDate&&h.config.maxDate.getTime()<h.now.getTime()?h.config.maxDate:h.now,h.currentYear=h._initialDate.getFullYear(),h.currentMonth=h._initialDate.getMonth(),h.selectedDates.length>0&&(h.latestSelectedDateObj=h.selectedDates[0]),void 0!==h.config.minTime&&(h.config.minTime=h.parseDate(h.config.minTime,"H:i")),void 0!==h.config.maxTime&&(h.config.maxTime=h.parseDate(h.config.maxTime,"H:i")),h.minDateHasTime=!!h.config.minDate&&(h.config.minDate.getHours()>0||h.config.minDate.getMinutes()>0||h.config.minDate.getSeconds()>0),h.maxDateHasTime=!!h.config.maxDate&&(h.config.maxDate.getHours()>0||h.config.maxDate.getMinutes()>0||h.config.maxDate.getSeconds()>0),Object.defineProperty(h,"showTimeInput",{get:function(){return h._showTimeInput},set:function(e){h._showTimeInput=e,h.calendarContainer&&c(h.calendarContainer,"showTimeInput",e),h.isOpen&&le()}})}(),h.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=h.currentMonth),void 0===t&&(t=h.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:h.l10n.daysInMonth[e]}},h.isMobile||function(){var e=window.document.createDocumentFragment();if(h.calendarContainer=d("div","flatpickr-calendar"),h.calendarContainer.tabIndex=-1,!h.config.noCalendar){if(e.appendChild((h.monthNav=d("div","flatpickr-months"),h.yearElements=[],h.monthElements=[],h.prevMonthNav=d("span","flatpickr-prev-month"),h.prevMonthNav.innerHTML=h.config.prevArrow,h.nextMonthNav=d("span","flatpickr-next-month"),h.nextMonthNav.innerHTML=h.config.nextArrow,q(),Object.defineProperty(h,"_hidePrevMonthArrow",{get:function(){return h.__hidePrevMonthArrow},set:function(e){h.__hidePrevMonthArrow!==e&&(c(h.prevMonthNav,"flatpickr-disabled",e),h.__hidePrevMonthArrow=e)}}),Object.defineProperty(h,"_hideNextMonthArrow",{get:function(){return h.__hideNextMonthArrow},set:function(e){h.__hideNextMonthArrow!==e&&(c(h.nextMonthNav,"flatpickr-disabled",e),h.__hideNextMonthArrow=e)}}),h.currentYearElement=h.yearElements[0],ve(),h.monthNav)),h.innerContainer=d("div","flatpickr-innerContainer"),h.config.weekNumbers){var t=function(){h.calendarContainer.classList.add("hasWeeks");var e=d("div","flatpickr-weekwrapper");e.appendChild(d("span","flatpickr-weekday",h.l10n.weekAbbreviation));var t=d("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),n=t.weekWrapper,a=t.weekNumbers;h.innerContainer.appendChild(n),h.weekNumbers=a,h.weekWrapper=n}h.rContainer=d("div","flatpickr-rContainer"),h.rContainer.appendChild($()),h.daysContainer||(h.daysContainer=d("div","flatpickr-days"),h.daysContainer.tabIndex=-1),J(),h.rContainer.appendChild(h.daysContainer),h.innerContainer.appendChild(h.rContainer),e.appendChild(h.innerContainer)}h.config.enableTime&&e.appendChild(function(){h.calendarContainer.classList.add("hasTime"),h.config.noCalendar&&h.calendarContainer.classList.add("noCalendar"),h.timeContainer=d("div","flatpickr-time"),h.timeContainer.tabIndex=-1;var e=d("span","flatpickr-time-separator",":"),t=u("flatpickr-hour",{"aria-label":h.l10n.hourAriaLabel});h.hourElement=t.getElementsByTagName("input")[0];var n=u("flatpickr-minute",{"aria-label":h.l10n.minuteAriaLabel});if(h.minuteElement=n.getElementsByTagName("input")[0],h.hourElement.tabIndex=h.minuteElement.tabIndex=-1,h.hourElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getHours():h.config.time_24hr?h.config.defaultHour:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(h.config.defaultHour)),h.minuteElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getMinutes():h.config.defaultMinute),h.hourElement.setAttribute("step",h.config.hourIncrement.toString()),h.minuteElement.setAttribute("step",h.config.minuteIncrement.toString()),h.hourElement.setAttribute("min",h.config.time_24hr?"0":"1"),h.hourElement.setAttribute("max",h.config.time_24hr?"23":"12"),h.minuteElement.setAttribute("min","0"),h.minuteElement.setAttribute("max","59"),h.timeContainer.appendChild(t),h.timeContainer.appendChild(e),h.timeContainer.appendChild(n),h.config.time_24hr&&h.timeContainer.classList.add("time24hr"),h.config.enableSeconds){h.timeContainer.classList.add("hasSeconds");var a=u("flatpickr-second");h.secondElement=a.getElementsByTagName("input")[0],h.secondElement.value=i(h.latestSelectedDateObj?h.latestSelectedDateObj.getSeconds():h.config.defaultSeconds),h.secondElement.setAttribute("step",h.minuteElement.getAttribute("step")),h.secondElement.setAttribute("min","0"),h.secondElement.setAttribute("max","59"),h.timeContainer.appendChild(d("span","flatpickr-time-separator",":")),h.timeContainer.appendChild(a)}return h.config.time_24hr||(h.amPM=d("span","flatpickr-am-pm",h.l10n.amPM[o((h.latestSelectedDateObj?h.hourElement.value:h.config.defaultHour)>11)]),h.amPM.title=h.l10n.toggleTitle,h.amPM.tabIndex=-1,h.timeContainer.appendChild(h.amPM)),h.timeContainer}()),c(h.calendarContainer,"rangeMode","range"===h.config.mode),c(h.calendarContainer,"animate",!0===h.config.animate),c(h.calendarContainer,"multiMonth",h.config.showMonths>1),h.calendarContainer.appendChild(e);var r=void 0!==h.config.appendTo&&void 0!==h.config.appendTo.nodeType;if((h.config.inline||h.config.static)&&(h.calendarContainer.classList.add(h.config.inline?"inline":"static"),h.config.inline&&(!r&&h.element.parentNode?h.element.parentNode.insertBefore(h.calendarContainer,h._input.nextSibling):void 0!==h.config.appendTo&&h.config.appendTo.appendChild(h.calendarContainer)),h.config.static)){var l=d("div","flatpickr-wrapper");h.element.parentNode&&h.element.parentNode.insertBefore(l,h.element),l.appendChild(h.element),h.altInput&&l.appendChild(h.altInput),l.appendChild(h.calendarContainer)}h.config.static||h.config.inline||(void 0!==h.config.appendTo?h.config.appendTo:window.document.body).appendChild(h.calendarContainer)}(),function(){if(h.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(h.element.querySelectorAll("[data-"+e+"]"),function(t){return F(t,"click",h[e])})}),h.isMobile)!function(){var e=h.config.enableTime?h.config.noCalendar?"time":"datetime-local":"date";h.mobileInput=d("input",h.input.className+" flatpickr-mobile"),h.mobileInput.step=h.input.getAttribute("step")||"any",h.mobileInput.tabIndex=1,h.mobileInput.type=e,h.mobileInput.disabled=h.input.disabled,h.mobileInput.required=h.input.required,h.mobileInput.placeholder=h.input.placeholder,h.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",h.selectedDates.length>0&&(h.mobileInput.defaultValue=h.mobileInput.value=h.formatDate(h.selectedDates[0],h.mobileFormatStr)),h.config.minDate&&(h.mobileInput.min=h.formatDate(h.config.minDate,"Y-m-d")),h.config.maxDate&&(h.mobileInput.max=h.formatDate(h.config.maxDate,"Y-m-d")),h.input.type="hidden",void 0!==h.altInput&&(h.altInput.type="hidden");try{h.input.parentNode&&h.input.parentNode.insertBefore(h.mobileInput,h.input.nextSibling)}catch(e){}F(h.mobileInput,"change",function(e){h.setDate(e.target.value,!1,h.mobileFormatStr),ge("onChange"),ge("onClose")})}();else{var e=r(ae,50);h._debouncedChange=r(Y,M),h.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&F(h.daysContainer,"mouseover",function(e){"range"===h.config.mode&&ne(e.target)}),F(window.document.body,"keydown",te),h.config.inline||h.config.static||F(window,"resize",e),void 0!==window.ontouchstart?F(window.document,"touchstart",Z):F(window.document,"mousedown",N(Z)),F(window.document,"focus",Z,{capture:!0}),!0===h.config.clickOpens&&(F(h._input,"focus",h.open),F(h._input,"mousedown",N(h.open))),void 0!==h.daysContainer&&(F(h.monthNav,"mousedown",N(be)),F(h.monthNav,["keyup","increment"],_),F(h.daysContainer,"mousedown",N(se))),void 0!==h.timeContainer&&void 0!==h.minuteElement&&void 0!==h.hourElement&&(F(h.timeContainer,["increment"],T),F(h.timeContainer,"blur",T,{capture:!0}),F(h.timeContainer,"mousedown",N(P)),F([h.hourElement,h.minuteElement],["focus","click"],function(e){return e.target.select()}),void 0!==h.secondElement&&F(h.secondElement,"focus",function(){return h.secondElement&&h.secondElement.select()}),void 0!==h.amPM&&F(h.amPM,"mousedown",N(function(e){T(e),Y()})))}}(),(h.selectedDates.length||h.config.noCalendar)&&(h.config.enableTime&&I(h.config.noCalendar?h.latestSelectedDateObj||h.config.minDate:void 0),we(!1)),x(),h.showTimeInput=h.selectedDates.length>0||h.config.noCalendar;var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!h.isMobile&&a&&le(),ge("onReady")}(),h}function x(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),a=[],i=0;i<n.length;i++){var o=n[i];try{if(null!==o.getAttribute("data-fp-omit"))continue;void 0!==o._flatpickr&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=y(o,t||{}),a.push(o._flatpickr)}catch(e){console.error(e)}}return 1===a.length?a[0]:a}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return x(this,e)},HTMLElement.prototype.flatpickr=function(e){return x([this],e)});var E=function(e,t){return"string"==typeof e?x(window.document.querySelectorAll(e),t):e instanceof Node?x([e],t):x(e,t)};return E.defaultConfig={},E.l10ns={en:e({},a),default:e({},a)},E.localize=function(t){E.l10ns.default=e({},E.l10ns.default,t)},E.setDefaults=function(t){E.defaultConfig=e({},E.defaultConfig,t)},E.parseDate=D({}),E.formatDate=v({}),E.compareDates=w,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(e){return x(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof e?parseInt(e,10):e))},"undefined"!=typeof window&&(window.flatpickr=E),E});
assets/js/selectWoo/selectWoo.full.js CHANGED
@@ -1,5 +1,5 @@
1
  /*!
2
- * SelectWoo 1.0.1
3
  * https://github.com/woocommerce/selectWoo
4
  *
5
  * Released under the MIT license
@@ -1924,7 +1924,7 @@ S2.define('select2/selection/search',[
1924
  var $search = $(
1925
  '<li class="select2-search select2-search--inline">' +
1926
  '<input class="select2-search__field" type="text" tabindex="-1"' +
1927
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
1928
  ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1929
  '</li>'
1930
  );
@@ -3992,7 +3992,7 @@ S2.define('select2/dropdown/search',[
3992
  var $search = $(
3993
  '<span class="select2-search select2-search--dropdown">' +
3994
  '<input class="select2-search__field" type="text" tabindex="-1"' +
3995
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
3996
  ' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
3997
  '</span>'
3998
  );
@@ -4047,7 +4047,7 @@ S2.define('select2/dropdown/search',[
4047
  });
4048
 
4049
  container.on('focus', function () {
4050
- if (container.isOpen()) {
4051
  self.$search.focus();
4052
  }
4053
  });
@@ -6582,4 +6582,4 @@ S2.define('jquery.select2',[
6582
 
6583
  // Return the Select2 instance for anyone who is importing it.
6584
  return select2;
6585
- }));
1
  /*!
2
+ * SelectWoo 1.0.6
3
  * https://github.com/woocommerce/selectWoo
4
  *
5
  * Released under the MIT license
1924
  var $search = $(
1925
  '<li class="select2-search select2-search--inline">' +
1926
  '<input class="select2-search__field" type="text" tabindex="-1"' +
1927
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
1928
  ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1929
  '</li>'
1930
  );
3992
  var $search = $(
3993
  '<span class="select2-search select2-search--dropdown">' +
3994
  '<input class="select2-search__field" type="text" tabindex="-1"' +
3995
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
3996
  ' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
3997
  '</span>'
3998
  );
4047
  });
4048
 
4049
  container.on('focus', function () {
4050
+ if (!container.isOpen()) {
4051
  self.$search.focus();
4052
  }
4053
  });
6582
 
6583
  // Return the Select2 instance for anyone who is importing it.
6584
  return select2;
6585
+ }));
assets/js/selectWoo/selectWoo.full.min.js CHANGED
@@ -1 +1,16 @@
1
- /*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(r,a)||e(s,a)||(s[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){"function"==typeof b[d]&&("constructor"!==d&&c.push(d))}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return(e!==f||"hidden"!==f&&"visible"!==f)&&("scroll"===e||"scroll"===f||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[data-selected]"),b=a.filter("[data-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k<b.children.length;k++){var l=b.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">&times;</span></li>')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);"string"==typeof g&&(g=g.trim()),f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})}},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this;this.$element.children().each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),void 0!==a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(null!=(b=c.data(a[0],"data")))return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return!(a(c.data.results)<this.minimumResultsForSearch)&&b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}return D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h<i;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER||c===d.TAB?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n<f)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * SelectWoo 1.0.6
3
+ * https://github.com/woocommerce/selectWoo
4
+ *
5
+ * Released under the MIT license
6
+ * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
7
+ */
8
+ !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(i){var e=function(){if(i&&i.fn&&i.fn.select2&&i.fn.select2.amd)var e=i.fn.select2.amd;var t,o,c,n;return e&&e.requirejs||(e?o=e:e={},function(h){var s,r,f,g,m={},v={},y={},w={},n=Object.prototype.hasOwnProperty,i=[].slice,_=/\.js$/;function $(e,t){return n.call(e,t)}function a(e,t){var n,i,o,s,r,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(r=(e=e.split("/")).length-1,y.nodeIdCompat&&_.test(e[r])&&(e[r]=e[r].replace(_,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),u-=1;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;u-=1){if(i=n.slice(0,u).join("/"),h)for(d=h.length;0<d;d-=1)if((o=f[h.slice(0,d).join("/")])&&(o=o[i])){s=o,a=u;break}if(s)break;!l&&g&&g[i]&&(l=g[i],c=u)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function b(t,n){return function(){var e=i.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),r.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function A(e){if($(v,e)){var t=v[e];delete v[e],w[e]=!0,s.apply(h,t)}if(!$(m,e)&&!$(w,e))throw new Error("No "+e);return m[e]}function l(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function C(e){return e?l(e):[]}f=function(e,t){var n,i=l(e),o=i[0],s=t[1];return e=i[1],o&&(n=A(o=a(o,s))),o?e=n&&n.normalize?n.normalize(e,function r(t){return function(e){return a(e,t)}}(s)):a(e,s):(o=(i=l(e=a(e,s)))[0],e=i[1],o&&(n=A(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:n}},g={require:function(e){return b(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:function t(e){return function(){return y&&y.config&&y.config[e]||{}}}(e)}}},s=function(e,t,n,i){var o,s,r,a,l,c,u,d=[],p=typeof n;if(c=C(i=i||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(s=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===s)d[l]=g.exports(e),u=!0;else if("module"===s)o=d[l]=g.module(e);else if($(m,s)||$(v,s)||$(w,s))d[l]=A(s);else{if(!a.p)throw new Error(e+" missing "+s);a.p.load(a.n,b(i,!0),x(s),{}),d[l]=m[s]}r=n?n.apply(m[e],d):undefined,e&&(o&&o.exports!==h&&o.exports!==m[e]?m[e]=o.exports:r===h&&u||(m[e]=r))}else e&&(m[e]=n)},t=o=r=function(e,t,n,i,o){if("string"==typeof e)return g[e]?g[e](t):A(f(e,C(t)).f);if(!e.splice){if((y=e).deps&&r(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=i,i=o),i?s(h,e,t,n):setTimeout(function(){s(h,e,t,n)},4),r},r.config=function(e){return r(e)},t._defined=m,(c=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),$(m,e)||$(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0}}(),e.requirejs=t,e.require=o,e.define=c),e.define("almond",function(){}),e.define("jquery",[],function(){var e=i||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(s){var e={};function d(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}e.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var o in t)n.call(t,o)&&(e[o]=t[o]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},e.Decorate=function(i,o){var e=d(o),t=d(i);function s(){var e=Array.prototype.unshift,t=o.prototype.constructor.length,n=i.prototype.constructor;0<t&&(e.call(arguments,i.prototype.constructor),n=o.prototype.constructor),n.apply(this,arguments)}o.displayName=i.displayName,s.prototype=new function u(){this.constructor=s};for(var n=0;n<t.length;n++){var r=t[n];s.prototype[r]=i.prototype[r]}for(var a=function(e){var t=function(){};e in s.prototype&&(t=s.prototype[e]);var n=o.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}},l=0;l<e.length;l++){var c=e[l];s.prototype[c]=a(c)}return s};var t=function(){this.listeners={}};return t.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},t.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},t.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},e.Observable=t,e.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},e.bind=function(e,t){return function(){e.apply(t,arguments)}},e._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var o=0;o<n.length;o++){var s=n[o];(s=s.substring(0,1).toLowerCase()+s.substring(1))in i||(i[s]={}),o==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},e.hasScroll=function(e,t){var n=s(t),i=t.style.overflowX,o=t.style.overflowY;return(i!==o||"hidden"!==o&&"visible"!==o)&&("scroll"===i||"scroll"===o||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},e.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},e.appendMany=function(e,t){if("1.7"===s.fn.jquery.substr(0,3)){var n=s();s.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},e.isTouchscreen=function(){return"undefined"==typeof e._isTouchscreenCache&&(e._isTouchscreenCache="ontouchstart"in document.documentElement),e._isTouchscreenCache},e}),e.define("select2/results",["jquery","./utils"],function(h,e){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],o=this.option(i);t.push(o)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[data-selected]"),t=e.filter("[data-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(e){var i=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[data-selected]").each(function(){var e=h(this),t=h.data(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,i)?e.attr("data-selected","true"):e.attr("data-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","data-selected":"false",tabindex:-1};for(var i in e.disabled&&(delete n["data-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["data-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n["aria-label"]=e.text,delete n["data-selected"]),n){var o=n[i];t.setAttribute(i,o)}if(e.children){var s=h(t),r=document.createElement("strong");r.className="select2-results__group";var a=h(r);this.template(e,r),a.attr("role","presentation");for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{"class":"select2-results__options select2-results__options--nested",role:"listbox"});p.append(l),s.attr("role","list"),s.append(r),s.append(p)}else this.template(e,t);return h.data(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("data-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[data-selected]"),n=t.index(e);if(0!==n){var i=n-1;0===e.length&&(i=0);var o=t.eq(i);o.trigger("mouseenter");var s=l.$results.offset().top,r=o.offset().top,a=l.$results.scrollTop()+(r-s);0===i?l.$results.scrollTop(0):r-s<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[data-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var o=l.$results.offset().top+l.$results.outerHeight(!1),s=i.offset().top+i.outerHeight(!1),r=l.$results.scrollTop()+s-o;0===n?l.$results.scrollTop(0):o<s&&l.$results.scrollTop(r)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),l.$results.attr("aria-activedescendant",e.element.attr("id"))}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,i=0<e.deltaY&&t-e.deltaY<=0,o=e.deltaY<0&&n<=l.$results.height();i?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):o&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(e){var t=h(this),n=t.data("data");"true"!==t.attr("data-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(e){var t=h(this).data("data");l.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),l.trigger("results:focus",{data:t,element:h(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[data-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,o=this.$results.scrollTop()+(i-n),s=i-n;o-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(s>this.$results.outerHeight()||s<0)&&this.$results.scrollTop(o)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),o=n(e,t);null==o?t.style.display="none":"string"==typeof o?t.innerHTML=i(o):h(t).append(o)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(i,e,o){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=i('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e},n.prototype.bind=function(e,t){var n=this,i=(e.id,e.id+"-results");this.options.get("minimumResultsForSearch"),Infinity;this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===o.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),window.setTimeout(function(){n.$selection.focus()},1),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),e.on("disable",function(){n.$selection.attr("tabindex","-1")})},n.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||i.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},n.prototype._attachCloseHandler=function(e){i(document.body).on("mousedown.select2."+e.id,function(e){var t=i(e.target),n=t.closest(".select2");i(".select2.select2-container--open").each(function(){var e=i(this);this!=n[0]&&(e.data("element").select2("close"),setTimeout(function(){e.find("*:focus").blur(),t.focus()},1))})})},n.prototype._detachCloseHandler=function(e){i(document.body).off("mousedown.select2."+e.id)},n.prototype.position=function(e,t){t.find(".selection").append(e)},n.prototype.destroy=function(){this._detachCloseHandler(this.container)},n.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},n}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function o(){o.__super__.constructor.apply(this,arguments)}return n.Extend(o,t),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},o.prototype.bind=function(t,e){var n=this;o.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("keydown",function(e){!t.isOpen()&&48<=e.which&&e.which<=90&&t.open()}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()}),t.on("selection:update",function(e){n.update(e.data)})},o.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return e("<span></span>")},o.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)}else this.clear()},o}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,a){function o(e,t){o.__super__.constructor.apply(this,arguments)}return a.Extend(o,e),o.prototype.render=function(){var e=o.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),e},o.prototype.bind=function(t,e){var n=this;o.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!n.options.get("disabled")){var t=i(this).parent().data("data");n.trigger("unselect",{originalEvent:e,data:t})}}),this.$selection.on("keydown",function(e){!t.isOpen()&&48<=e.which&&e.which<=90&&t.open()}),t.on("focus",function(){n.focusOnSearch()})},o.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},o.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},o.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">&times;</span></li>')},o.prototype.focusOnSearch=function(){var e=this;"undefined"!=typeof e.$search&&setTimeout(function(){e._keyUpPrevented=!0,e.$search.focus()},1)},o.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var i=e[n],o=this.selectionContainer(),s=this.display(i,o);"string"==typeof s&&(s=s.trim()),o.append(s),o.prop("title",i.title||i.text),o.data("data",i),t.push(o)}var r=this.$selection.find(".select2-selection__rendered");a.appendMany(r,t)}},o}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),e.define("select2/selection/allowClear",["jquery","../keys"],function(i,o){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),o=0;o<i.length;o++){var s={data:i[o]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=o.DELETE&&t.which!=o.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=i('<span class="select2-selection__clear">&times;</span>');n.data("data",t),this.$selection.find(".select2-selection__rendered").prepend(n)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,e,a){function t(e,t,n){e.call(this,t,n)}return t.prototype.render=function(e){var t=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},t.prototype.bind=function(e,i,t){var o=this,n=i.id+"-results";e.call(this,i,t),i.on("open",function(){o.$search.attr("aria-owns",n),o.$search.trigger("focus")}),i.on("close",function(){o.$search.val(""),o.$search.removeAttr("aria-activedescendant"),o.$search.removeAttr("aria-owns"),o.$search.trigger("focus")}),i.on("enable",function(){o.$search.prop("disabled",!1),o._transferTabIndex()}),i.on("disable",function(){o.$search.prop("disabled",!0)}),i.on("focus",function(e){o.$search.trigger("focus")}),i.on("results:focus",function(e){o.$search.attr("aria-activedescendant",e.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(e){o.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){o._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),o.trigger("keypress",e),o._keyUpPrevented=e.isDefaultPrevented(),e.which===a.BACKSPACE&&""===o.$search.val()){var t=o.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=t.data("data");o.searchRemoveChoice(n),e.preventDefault()}}else e.which===a.ENTER&&(i.open(),e.preventDefault())});var s=document.documentMode,r=s&&s<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){r?o.$selection.off("input.search input.searchcheck"):o.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(r&&"input"===e.type)o.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=a.SHIFT&&t!=a.CTRL&&t!=a.ALT&&t!=a.TAB&&o.handleSearch(e)}})},t.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},t.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},t.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},t.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},t.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},t.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").innerWidth():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},t}),e.define("select2/selection/eventRelay",["jquery"],function(r){function e(){}return e.prototype.bind=function(e,t,n){var i=this,o=["open","opening","close","closing","select","selecting","unselect","unselecting"],s=["opening","closing","selecting","unselecting"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==r.inArray(e,o)){t=t||{};var n=r.Event("select2:"+e,{params:t});i.$element.trigger(n),-1!==r.inArray(e,s)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var t=n(e);i._cache[e]=t}return new i(i._cache[e])},i}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2/data/base",["../utils"],function(i){function n(e,t){n.__super__.constructor.call(this)}return i.Extend(n,i.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n="";return n+=null!=e?e.id:i.generateChars(4),n+="-result-",n+=i.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+i.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,t,a){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,e),n.prototype.current=function(e){var n=[],i=this;this.$element.find(":selected").each(function(){var e=a(this),t=i.item(e);n.push(t)}),e(n)},n.prototype.select=function(o){var s=this;if(o.selected=!0,a(o.element).is("option"))return o.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(o=[o]).push.apply(o,e);for(var n=0;n<o.length;n++){var i=o[n].id;-1===a.inArray(i,t)&&t.push(i)}s.$element.val(t),s.$element.trigger("change")});else{var e=o.id;this.$element.val(e),this.$element.trigger("change")}},n.prototype.unselect=function(o){var s=this;if(this.$element.prop("multiple")){if(o.selected=!1,a(o.element).is("option"))return o.element.selected=!1,void this.$element.trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n].id;i!==o.id&&-1===a.inArray(i,t)&&t.push(i)}s.$element.val(t),s.$element.trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.removeData(this,"data")})},n.prototype.query=function(i,e){var o=[],s=this;this.$element.children().each(function(){var e=a(this);if(e.is("option")||e.is("optgroup")){var t=s.item(e),n=s.matches(i,t);null!==n&&o.push(n)}}),e({results:o})},n.prototype.addOptions=function(e){t.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:(t=document.createElement("option")).textContent!==undefined?t.textContent=e.text:t.innerText=e.text,e.id!==undefined&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=a(t),i=this._normalizeItem(e);return i.element=t,a.data(t,"data",i),n},n.prototype.item=function(e){var t={};if(null!=(t=a.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),i=[],o=0;o<n.length;o++){var s=a(n[o]),r=this.item(s);i.push(r)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.data(e[0],"data",t),t},n.prototype._normalizeItem=function(e){a.isPlainObject(e)||(e={id:e,text:e});return null!=(e=a.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&(e._resultId=this.generateResultId(this.container,e)),a.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return f.Extend(i,e),i.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),i=n.map(function(){return t.item(g(this)).id}).get(),o=[];function s(e){return function(){return g(this).val()==e.id}}for(var r=0;r<e.length;r++){var a=this._normalizeItem(e[r]);if(0<=g.inArray(a.id,i)){var l=n.filter(s(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}o.push(p)}}return o},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,s){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return s.extend({},e,{q:e.term})},transport:function(e,t,n){var i=s.ajax(e);return i.then(t),i.fail(n),i}};return s.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,i){var o=this;null!=this._request&&(s.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=s.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=o.processResults(e,n);o.options.get("debug")&&window.console&&console.error&&(t&&t.results&&s.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(t),o.container.focusOnActiveElement()},function(){e.status&&"0"===e.status||o.trigger("results:message",{message:"errorLoading"})});o._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var i=n.get("tags"),o=n.get("createTag");o!==undefined&&(this.createTag=o);var s=n.get("insertTag");if(s!==undefined&&(this.insertTag=s),e.call(this,t,n),u.isArray(i))for(var r=0;r<i.length;r++){var a=i[r],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,l,c){var u=this;this._removeOldTags(),null!=l.term&&null==l.page?e.call(this,l,function d(e,t){for(var n=e.results,i=0;i<n.length;i++){var o=n[i],s=null!=o.children&&!d({results:o.children},!0);if((o.text||"").toUpperCase()===(l.term||"").toUpperCase()||s)return!t&&(e.data=n,void c(e))}if(t)return!0;var r=u.createTag(l);if(null!=r){var a=u.option(r);a.attr("data-select2-tag",!0),u.addOptions([a]),u.insertTag(n,r)}e.results=n,c(e)}):e.call(this,l,c)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var i=n.get("tokenizer");i!==undefined&&(this.tokenizer=i),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var o=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function s(e){var t=o._normalizeItem(e);if(!o.$element.find("option").filter(function(){return d(this).val()===t.id}).length){var n=o.option(t);n.attr("data-select2-tag",!0),o._removeOldTags(),o.addOptions([n])}!function i(e){o.trigger("select",{data:e})}(t)});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.focus()),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,i){for(var o=n.get("tokenSeparators")||[],s=t.term,r=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};r<s.length;){var l=s[r];if(-1!==d.inArray(l,o)){var c=s.substr(0,r),u=a(d.extend({},t,{term:c}));null!=u?(i(u),s=s.substr(r+1)||"",r=0):r++}else r++}return{term:s}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(n,i,o){var s=this;this.current(function(e){var t=null!=e?e.length:0;0<s.maximumSelectionLength&&t>=s.maximumSelectionLength?s.trigger("results:message",{message:"maximumSelected",args:{maximum:s.maximumSelectionLength}}):n.call(s,i,o)})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(s,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=s('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,o=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){s(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-owns",o),i.$search.focus(),window.setTimeout(function(){i.$search.focus()},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-activedescendant"),i.$search.removeAttr("aria-owns"),i.$search.val("")}),t.on("focus",function(){t.isOpen()||i.$search.focus()}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){i.$search.attr("aria-activedescendant",e.data._resultId)})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var o=t[i];this.placeholder.id===o.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(o){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",function(){var e=o.contains(document.documentElement,i.$loadingMore[0]);if(!i.loading&&e){var t=i.$results.offset().top+i.$results.outerHeight(!1);i.$loadingMore.offset().top+i.$loadingMore.outerHeight(!1)<=t+50&&i.loadMore()}})},e.prototype.loadMore=function(){this.loading=!0;var e=o.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=o('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=n.get("dropdownParent")||f(document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this,o=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),o||(o=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,o="resize.select2."+t.id,s="orientationchange.select2."+t.id,r=this.$container.parents().filter(a.hasScroll);r.each(function(){f(this).data("select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),r.on(i,function(e){var t=f(this).data("select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+o+" "+s,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,o="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+o)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,o=this.$container.offset();o.bottom=o.top+this.$container.outerHeight(!1);var s={height:this.$container.outerHeight(!1)};s.top=o.top,s.bottom=o.top+s.height;var r=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<o.top-r,u=l>o.bottom+r,d={left:o.left,top:s.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=s.top-h.top-r),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function o(e){for(var t=0,n=0;n<e.length;n++){var i=e[n];i.children?t+=o(i.children):t++}return t}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var o=i.data("data");null!=o.element&&o.element.selected||null==o.element&&o.selected||this.trigger("select",{data:o})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(m,v,y,w,_,$,b,x,A,C,S,n,O,E,D,T,q,j,L,k,P,I,M,R,z,H,U,N,e){function t(){this.reset()}return t.prototype.apply=function(e){if(null==(e=m.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=D:null!=e.data?e.dataAdapter=E:e.dataAdapter=O,0<e.minimumInputLength&&(e.dataAdapter=C.Decorate(e.dataAdapter,j)),0<e.maximumInputLength&&(e.dataAdapter=C.Decorate(e.dataAdapter,L)),0<e.maximumSelectionLength&&(e.dataAdapter=C.Decorate(e.dataAdapter,k)),e.tags&&(e.dataAdapter=C.Decorate(e.dataAdapter,T)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=C.Decorate(e.dataAdapter,q)),null!=e.query){var t=v(e.amdBase+"compat/query");e.dataAdapter=C.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=v(e.amdBase+"compat/initSelection");e.dataAdapter=C.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=y,null!=e.ajax&&(e.resultsAdapter=C.Decorate(e.resultsAdapter,R)),null!=e.placeholder&&(e.resultsAdapter=C.Decorate(e.resultsAdapter,M)),e.selectOnClose&&(e.resultsAdapter=C.Decorate(e.resultsAdapter,U))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=P;else{var i=C.Decorate(P,I);e.dropdownAdapter=i}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=C.Decorate(e.dropdownAdapter,H)),e.closeOnSelect&&(e.dropdownAdapter=C.Decorate(e.dropdownAdapter,N)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var o=v(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=C.Decorate(e.dropdownAdapter,o)}e.dropdownAdapter=C.Decorate(e.dropdownAdapter,z)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=_:e.selectionAdapter=w,null!=e.placeholder&&(e.selectionAdapter=C.Decorate(e.selectionAdapter,$)),e.allowClear&&(e.selectionAdapter=C.Decorate(e.selectionAdapter,b)),e.multiple&&(e.selectionAdapter=C.Decorate(e.selectionAdapter,x)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var s=v(e.amdBase+"compat/containerCss");e.selectionAdapter=C.Decorate(e.selectionAdapter,s)}e.selectionAdapter=C.Decorate(e.selectionAdapter,A)}if("string"==typeof e.language)if(0<e.language.indexOf("-")){var r=e.language.split("-")[0];e.language=[e.language,r]}else e.language=[e.language];if(m.isArray(e.language)){var a=new S;e.language.push("en");for(var l=e.language,c=0;c<l.length;c++){var u=l[c],d={};try{d=S.loadPath(u)}catch(f){try{u=this.defaults.amdLanguageBase+u,d=S.loadPath(u)}catch(g){e.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+u+'" could not be automatically loaded. A fallback will be used instead.');continue}}a.extend(d)}e.translations=a}else{var p=S.loadPath(this.defaults.amdLanguageBase+"en"),h=new S(e.language);h.extend(p),e.translations=h}return e},t.prototype.reset=function(){function r(e){return e.replace(/[^\u0000-\u007E]/g,function t(e){return n[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:C.escapeMarkup,language:e,matcher:function a(e,t){if(""===m.trim(e.term))return t;if(t.children&&0<t.children.length){for(var n=m.extend(!0,{},t),i=t.children.length-1;0<=i;i--)null==a(e,t.children[i])&&n.children.splice(i,1);return 0<n.children.length?n:a(e,n)}var o=r(t.text).toUpperCase(),s=r(e.term).toUpperCase();return-1<o.indexOf(s)?t:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},t.prototype.set=function(e,t){var n={};n[m.camelCase(e)]=t;var i=C._convertData(n);m.extend(this.defaults,i)},new t}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(i,s,o,r){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),this.options=o.apply(this.options),t&&t.is("input")){var n=i(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=r.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var n={};n=s.fn.jquery&&"1."==s.fn.jquery.substr(0,2)&&e[0].dataset?s.extend(!0,{},e[0].dataset,e.data()):e.data();var i=s.extend(!0,{},n);for(var o in i=r._convertData(i))-1<s.inArray(o,t)||(s.isPlainObject(this.options[o])?s.extend(this.options[o],i[o]):this.options[o]=i[o]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(o,c,n,s){var u=function(e,t){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),u.__super__.constructor.call(this);var n=e.attr("tabindex")||0;e.data("old-tabindex",n),e.attr("tabindex","-1");var i=this.options.get("dataAdapter");this.dataAdapter=new i(e,this.options);var o=this.render();this._placeContainer(o);var s=this.options.get("selectionAdapter");this.selection=new s(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,o);var r=this.options.get("dropdownAdapter");this.dropdown=new r(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,o);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(u,n.Observable),u.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},u.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},u.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var o=e.outerWidth(!1);return o<=0?"auto":o+"px"}if("style"!=t)return t;var s=e.attr("style");if("string"!=typeof s)return null;for(var r=s.split(";"),a=0,l=r.length;a<l;a+=1){var c=r[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},u.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},u.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){o.each(e,t._syncA),o.each(e,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},u.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===o.inArray(e,i)&&n.trigger(e,t)})},u.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerEvents=function(){var i=this;this.on("open",function(){i.$container.addClass("select2-container--open")}),this.on("close",function(){i.$container.removeClass("select2-container--open")}),this.on("enable",function(){i.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){i.$container.addClass("select2-container--disabled")}),this.on("blur",function(){i.$container.removeClass("select2-container--focus")}),this.on("query",function(t){i.isOpen()||i.trigger("open",{}),this.dataAdapter.query(t,function(e){i.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){i.trigger("results:append",{data:e,query:t})})}),this.on("open",function(){setTimeout(function(){i.focusOnActiveElement()},1)}),o(document).on("keydown",function(e){var t=e.which;if(i.isOpen()){t===s.ESC||t===s.UP&&e.altKey?(i.close(),e.preventDefault()):t===s.ENTER||t===s.TAB?(i.trigger("results:select",{}),e.preventDefault()):t===s.SPACE&&e.ctrlKey?(i.trigger("results:toggle",{}),e.preventDefault()):t===s.UP?(i.trigger("results:previous",{}),e.preventDefault()):t===s.DOWN&&(i.trigger("results:next",{}),e.preventDefault());var n=i.$dropdown.find(".select2-search__field");n.length||(n=i.$container.find(".select2-search__field")),t===s.DOWN||t===s.UP?i.focusOnActiveElement():(n.focus(),setTimeout(function(){i.focusOnActiveElement()},1e3))}else i.hasFocus()&&(t!==s.ENTER&&t!==s.SPACE&&t!==s.DOWN||(i.open(),e.preventDefault()))})},u.prototype.focusOnActiveElement=function(){this.isOpen()&&!n.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},u.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},u.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var o=0;o<t.addedNodes.length;o++){t.addedNodes[o].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},u.prototype.trigger=function(e,t){var n=u.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(t===undefined&&(t={}),e in i){var o=i[e],s={prevented:!1,name:e,args:t};if(n.call(this,o,s),s.prevented)return void(t.prevented=!0)}n.call(this,e,t)},u.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},u.prototype.open=function(){this.isOpen()||this.trigger("query",{})},u.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},u.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},u.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},u.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},u.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},u.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},u.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];o.isArray(t)&&(t=o.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("change")},u.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},u.prototype.render=function(){var e=o('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},u}),e.define("select2/compat/utils",["jquery"],function(r){return{syncCssClasses:function a(e,t,n){var i,o,s=[];(i=r.trim(e.attr("class")))&&r((i=""+i).split(/\s+/)).each(function(){0===this.indexOf("select2-")&&s.push(this)}),(i=r.trim(t.attr("class")))&&r((i=""+i).split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(o=n(this))&&s.push(o)}),e.attr("class",s.join(" "))}}}),e.define("select2/compat/containerCss",["jquery","./utils"],function(r,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("containerCssClass")||"";r.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptContainerCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var o=i;i=function(e){var t=o(e);return null!=t?t+" "+e:e}}var s=this.options.get("containerCss")||{};return r.isFunction(s)&&(s=s(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(s),t.addClass(n),t},e}),e.define("select2/compat/dropdownCss",["jquery","./utils"],function(r,a){function l(e){return null}function e(){}return e.prototype.render=function(e){var t=e.call(this),n=this.options.get("dropdownCssClass")||"";r.isFunction(n)&&(n=n(this.$element));var i=this.options.get("adaptDropdownCssClass");if(i=i||l,-1!==n.indexOf(":all:")){n=n.replace(":all:","");var o=i;i=function(e){var t=o(e);return null!=t?t+" "+e:e}}var s=this.options.get("dropdownCss")||{};return r.isFunction(s)&&(s=s(this.$element)),a.syncCssClasses(t,this.$element,i),t.css(s),t.addClass(n),t},e}),e.define("select2/compat/initSelection",["jquery"],function(i){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return e.prototype.current=function(e,t){var n=this;this._isInitialized?e.call(this,t):this.initSelection.call(null,this.$element,function(e){n._isInitialized=!0,i.isArray(e)||(e=[e]),t(e)})},e}),e.define("select2/compat/inputData",["jquery"],function(r){function e(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),e.call(this,t,n)}return e.prototype.current=function(e,t){function i(e,t){var n=[];return e.selected||-1!==r.inArray(e.id,t)?(e.selected=!0,n.push(e)):e.selected=!1,e.children&&n.push.apply(n,i(e.children,t)),n}for(var n=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o];n.push.apply(n,i(s,this.$element.val().split(this._valueSeparator)))}t(n)},e.prototype.select=function(e,t){if(this.options.get("multiple")){var n=this.$element.val();n+=this._valueSeparator+t.id,this.$element.val(n),this.$element.trigger("change")}else this.current(function(e){r.map(e,function(e){e.selected=!1})}),this.$element.val(t.id),this.$element.trigger("change")},e.prototype.unselect=function(e,o){var s=this;o.selected=!1,this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n];o.id!=i.id&&t.push(i.id)}s.$element.val(t.join(s._valueSeparator)),s.$element.trigger("change")})},e.prototype.query=function(e,t,n){for(var i=[],o=0;o<this._currentData.length;o++){var s=this._currentData[o],r=this.matches(t,s);null!==r&&i.push(r)}n({results:i})},e.prototype.addOptions=function(e,t){var n=r.map(t,function(e){return r.data(e[0],"data")});this._currentData.push.apply(this._currentData,n)},e}),e.define("select2/compat/matcher",["jquery"],function(a){return function e(s){return function r(e,t){var n=a.extend(!0,{},t);if(null==e.term||""===a.trim(e.term))return n;if(t.children){for(var i=t.children.length-1;0<=i;i--){var o=t.children[i];s(e.term,o.text,o)||n.children.splice(i,1)}if(0<n.children.length)return n}return s(e.term,t.text,t)?n:null}}}),e.define("select2/compat/query",[],function(){function e(e,t,n){n.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n,this.options.get("query").call(null,t)},e}),e.define("select2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){n.find(".dropdown-wrapper").append(t),t.addClass("select2-dropdown--below"),n.addClass("select2-container--below")},e}),e.define("select2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$dropdown.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),e.define("select2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);this.$selection.on(["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"].join(" "),function(e){e.stopPropagation()})},e}),
9
+ /*!
10
+ * jQuery Mousewheel 3.1.13
11
+ *
12
+ * Copyright jQuery Foundation and other contributors
13
+ * Released under the MIT license
14
+ * http://jquery.org/license
15
+ */
16
+ n=function(p){var h,f,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in document||9<=document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],g=Array.prototype.slice;if(p.event.fixHooks)for(var n=e.length;n;)p.event.fixHooks[e[--n]]=p.event.mouseHooks;var m=p.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],i,!1);else this.onmousewheel=i;p.data(this,"mousewheel-line-height",m.getLineHeight(this)),p.data(this,"mousewheel-page-height",m.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],i,!1);else this.onmousewheel=null;p.removeData(this,"mousewheel-line-height"),p.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=p(e),n=t["offsetParent"in p.fn?"offsetParent":"parent"]();return n.length||(n=p("body")),parseInt(n.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return p(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function i(e){var t,n=e||window.event,i=g.call(arguments,1),o=0,s=0,r=0,a=0,l=0;if((e=p.event.fix(n)).type="mousewheel","detail"in n&&(r=-1*n.detail),"wheelDelta"in n&&(r=n.wheelDelta),"wheelDeltaY"in n&&(r=n.wheelDeltaY),"wheelDeltaX"in n&&(s=-1*n.wheelDeltaX),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(s=-1*r,r=0),o=0===r?s:r,"deltaY"in n&&(o=r=-1*n.deltaY),"deltaX"in n&&(s=n.deltaX,0===r&&(o=-1*s)),0!==r||0!==s){if(1===n.deltaMode){var c=p.data(this,"mousewheel-line-height");o*=c,r*=c,s*=c}else if(2===n.deltaMode){var u=p.data(this,"mousewheel-page-height");o*=u,r*=u,s*=u}if(t=Math.max(Math.abs(r),Math.abs(s)),(!f||t<f)&&y(n,f=t)&&(f/=40),y(n,t)&&(o/=40,s/=40,r/=40),o=Math[1<=o?"floor":"ceil"](o/f),s=Math[1<=s?"floor":"ceil"](s/f),r=Math[1<=r?"floor":"ceil"](r/f),m.settings.normalizeOffset&&this.getBoundingClientRect){var d=this.getBoundingClientRect();a=e.clientX-d.left,l=e.clientY-d.top}return e.deltaX=s,e.deltaY=r,e.deltaFactor=f,e.offsetX=a,e.offsetY=l,e.deltaMode=0,i.unshift(e,o,s,r),h&&clearTimeout(h),h=setTimeout(v,200),(p.event.dispatch||p.event.handle).apply(this,i)}}function v(){f=null}function y(e,t){return m.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}p.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})},"function"==typeof e.define&&e.define.amd?e.define("jquery-mousewheel",["jquery"],n):"object"==typeof exports?module.exports=n:n(i),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(o,e,s,t){if(null==o.fn.selectWoo){var r=["open","close","destroy"];o.fn.selectWoo=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=o.extend(!0,{},t);new s(o(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=o(this).data("select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1<o.inArray(t,r)?this:n}}return null!=o.fn.select2&&null!=o.fn.select2.defaults&&(o.fn.selectWoo.defaults=o.fn.select2.defaults),null==o.fn.selectWoo.defaults&&(o.fn.selectWoo.defaults=t),o.fn.select2=o.fn.select2||o.fn.selectWoo,s}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return i.fn.select2.amd=e,i.fn.selectWoo.amd=e,t});
assets/js/selectWoo/selectWoo.js CHANGED
@@ -1,5874 +1,5874 @@
1
  /*!
2
- * SelectWoo 1.0.1
3
  * https://github.com/woocommerce/selectWoo
4
  *
5
  * Released under the MIT license
6
  * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
7
  */
8
  (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD. Register as an anonymous module.
11
- define(['jquery'], factory);
12
- } else if (typeof module === 'object' && module.exports) {
13
- // Node/CommonJS
14
- module.exports = function (root, jQuery) {
15
- if (jQuery === undefined) {
16
- // require('jQuery') returns a factory that requires window to
17
- // build a jQuery instance, we normalize how we use modules
18
- // that require this pattern but the window provided is a noop
19
- // if it's defined (how jquery works)
20
- if (typeof window !== 'undefined') {
21
- jQuery = require('jquery');
22
- }
23
- else {
24
- jQuery = require('jquery')(root);
25
- }
26
- }
27
- factory(jQuery);
28
- return jQuery;
29
- };
30
- } else {
31
- // Browser globals
32
- factory(jQuery);
33
- }
34
- } (function (jQuery) {
35
- // This is needed so we can catch the AMD loader configuration and use it
36
- // The inner file should be wrapped (by `banner.start.js`) in a function that
37
- // returns the AMD loader references.
38
- var S2 =(function () {
39
- // Restore the Select2 AMD loader so it can be used
40
- // Needed mostly in the language files, where the loader is not inserted
41
- if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
42
- var S2 = jQuery.fn.select2.amd;
43
- }
44
- var S2;(function () { if (!S2 || !S2.requirejs) {
45
- if (!S2) { S2 = {}; } else { require = S2; }
46
- /**
47
- * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
48
- * Released under MIT license, http://github.com/requirejs/almond/LICENSE
49
- */
50
- //Going sloppy to avoid 'use strict' string cost, but strict practices should
51
- //be followed.
52
- /*global setTimeout: false */
53
-
54
- var requirejs, require, define;
55
- (function (undef) {
56
- var main, req, makeMap, handlers,
57
- defined = {},
58
- waiting = {},
59
- config = {},
60
- defining = {},
61
- hasOwn = Object.prototype.hasOwnProperty,
62
- aps = [].slice,
63
- jsSuffixRegExp = /\.js$/;
64
-
65
- function hasProp(obj, prop) {
66
- return hasOwn.call(obj, prop);
67
- }
68
-
69
- /**
70
- * Given a relative module name, like ./something, normalize it to
71
- * a real name that can be mapped to a path.
72
- * @param {String} name the relative name
73
- * @param {String} baseName a real name that the name arg is relative
74
- * to.
75
- * @returns {String} normalized name
76
- */
77
- function normalize(name, baseName) {
78
- var nameParts, nameSegment, mapValue, foundMap, lastIndex,
79
- foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
80
- baseParts = baseName && baseName.split("/"),
81
- map = config.map,
82
- starMap = (map && map['*']) || {};
83
-
84
- //Adjust any relative paths.
85
- if (name) {
86
- name = name.split('/');
87
- lastIndex = name.length - 1;
88
-
89
- // If wanting node ID compatibility, strip .js from end
90
- // of IDs. Have to do this here, and not in nameToUrl
91
- // because node allows either .js or non .js to map
92
- // to same file.
93
- if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
94
- name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
95
- }
96
-
97
- // Starts with a '.' so need the baseName
98
- if (name[0].charAt(0) === '.' && baseParts) {
99
- //Convert baseName to array, and lop off the last part,
100
- //so that . matches that 'directory' and not name of the baseName's
101
- //module. For instance, baseName of 'one/two/three', maps to
102
- //'one/two/three.js', but we want the directory, 'one/two' for
103
- //this normalization.
104
- normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
105
- name = normalizedBaseParts.concat(name);
106
- }
107
-
108
- //start trimDots
109
- for (i = 0; i < name.length; i++) {
110
- part = name[i];
111
- if (part === '.') {
112
- name.splice(i, 1);
113
- i -= 1;
114
- } else if (part === '..') {
115
- // If at the start, or previous value is still ..,
116
- // keep them so that when converted to a path it may
117
- // still work when converted to a path, even though
118
- // as an ID it is less than ideal. In larger point
119
- // releases, may be better to just kick out an error.
120
- if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
121
- continue;
122
- } else if (i > 0) {
123
- name.splice(i - 1, 2);
124
- i -= 2;
125
- }
126
- }
127
- }
128
- //end trimDots
129
-
130
- name = name.join('/');
131
- }
132
-
133
- //Apply map config if available.
134
- if ((baseParts || starMap) && map) {
135
- nameParts = name.split('/');
136
-
137
- for (i = nameParts.length; i > 0; i -= 1) {
138
- nameSegment = nameParts.slice(0, i).join("/");
139
-
140
- if (baseParts) {
141
- //Find the longest baseName segment match in the config.
142
- //So, do joins on the biggest to smallest lengths of baseParts.
143
- for (j = baseParts.length; j > 0; j -= 1) {
144
- mapValue = map[baseParts.slice(0, j).join('/')];
145
-
146
- //baseName segment has config, find if it has one for
147
- //this name.
148
- if (mapValue) {
149
- mapValue = mapValue[nameSegment];
150
- if (mapValue) {
151
- //Match, update name to the new value.
152
- foundMap = mapValue;
153
- foundI = i;
154
- break;
155
- }
156
- }
157
- }
158
- }
159
-
160
- if (foundMap) {
161
- break;
162
- }
163
-
164
- //Check for a star map match, but just hold on to it,
165
- //if there is a shorter segment match later in a matching
166
- //config, then favor over this star map.
167
- if (!foundStarMap && starMap && starMap[nameSegment]) {
168
- foundStarMap = starMap[nameSegment];
169
- starI = i;
170
- }
171
- }
172
-
173
- if (!foundMap && foundStarMap) {
174
- foundMap = foundStarMap;
175
- foundI = starI;
176
- }
177
-
178
- if (foundMap) {
179
- nameParts.splice(0, foundI, foundMap);
180
- name = nameParts.join('/');
181
- }
182
- }
183
-
184
- return name;
185
- }
186
-
187
- function makeRequire(relName, forceSync) {
188
- return function () {
189
- //A version of a require function that passes a moduleName
190
- //value for items that may need to
191
- //look up paths relative to the moduleName
192
- var args = aps.call(arguments, 0);
193
-
194
- //If first arg is not require('string'), and there is only
195
- //one arg, it is the array form without a callback. Insert
196
- //a null so that the following concat is correct.
197
- if (typeof args[0] !== 'string' && args.length === 1) {
198
- args.push(null);
199
- }
200
- return req.apply(undef, args.concat([relName, forceSync]));
201
- };
202
- }
203
-
204
- function makeNormalize(relName) {
205
- return function (name) {
206
- return normalize(name, relName);
207
- };
208
- }
209
-
210
- function makeLoad(depName) {
211
- return function (value) {
212
- defined[depName] = value;
213
- };
214
- }
215
-
216
- function callDep(name) {
217
- if (hasProp(waiting, name)) {
218
- var args = waiting[name];
219
- delete waiting[name];
220
- defining[name] = true;
221
- main.apply(undef, args);
222
- }
223
-
224
- if (!hasProp(defined, name) && !hasProp(defining, name)) {
225
- throw new Error('No ' + name);
226
- }
227
- return defined[name];
228
- }
229
-
230
- //Turns a plugin!resource to [plugin, resource]
231
- //with the plugin being undefined if the name
232
- //did not have a plugin prefix.
233
- function splitPrefix(name) {
234
- var prefix,
235
- index = name ? name.indexOf('!') : -1;
236
- if (index > -1) {
237
- prefix = name.substring(0, index);
238
- name = name.substring(index + 1, name.length);
239
- }
240
- return [prefix, name];
241
- }
242
-
243
- //Creates a parts array for a relName where first part is plugin ID,
244
- //second part is resource ID. Assumes relName has already been normalized.
245
- function makeRelParts(relName) {
246
- return relName ? splitPrefix(relName) : [];
247
- }
248
-
249
- /**
250
- * Makes a name map, normalizing the name, and using a plugin
251
- * for normalization if necessary. Grabs a ref to plugin
252
- * too, as an optimization.
253
- */
254
- makeMap = function (name, relParts) {
255
- var plugin,
256
- parts = splitPrefix(name),
257
- prefix = parts[0],
258
- relResourceName = relParts[1];
259
-
260
- name = parts[1];
261
-
262
- if (prefix) {
263
- prefix = normalize(prefix, relResourceName);
264
- plugin = callDep(prefix);
265
- }
266
-
267
- //Normalize according
268
- if (prefix) {
269
- if (plugin && plugin.normalize) {
270
- name = plugin.normalize(name, makeNormalize(relResourceName));
271
- } else {
272
- name = normalize(name, relResourceName);
273
- }
274
- } else {
275
- name = normalize(name, relResourceName);
276
- parts = splitPrefix(name);
277
- prefix = parts[0];
278
- name = parts[1];
279
- if (prefix) {
280
- plugin = callDep(prefix);
281
- }
282
- }
283
-
284
- //Using ridiculous property names for space reasons
285
- return {
286
- f: prefix ? prefix + '!' + name : name, //fullName
287
- n: name,
288
- pr: prefix,
289
- p: plugin
290
- };
291
- };
292
-
293
- function makeConfig(name) {
294
- return function () {
295
- return (config && config.config && config.config[name]) || {};
296
- };
297
- }
298
-
299
- handlers = {
300
- require: function (name) {
301
- return makeRequire(name);
302
- },
303
- exports: function (name) {
304
- var e = defined[name];
305
- if (typeof e !== 'undefined') {
306
- return e;
307
- } else {
308
- return (defined[name] = {});
309
- }
310
- },
311
- module: function (name) {
312
- return {
313
- id: name,
314
- uri: '',
315
- exports: defined[name],
316
- config: makeConfig(name)
317
- };
318
- }
319
- };
320
-
321
- main = function (name, deps, callback, relName) {
322
- var cjsModule, depName, ret, map, i, relParts,
323
- args = [],
324
- callbackType = typeof callback,
325
- usingExports;
326
-
327
- //Use name if no relName
328
- relName = relName || name;
329
- relParts = makeRelParts(relName);
330
-
331
- //Call the callback to define the module, if necessary.
332
- if (callbackType === 'undefined' || callbackType === 'function') {
333
- //Pull out the defined dependencies and pass the ordered
334
- //values to the callback.
335
- //Default to [require, exports, module] if no deps
336
- deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
337
- for (i = 0; i < deps.length; i += 1) {
338
- map = makeMap(deps[i], relParts);
339
- depName = map.f;
340
-
341
- //Fast path CommonJS standard dependencies.
342
- if (depName === "require") {
343
- args[i] = handlers.require(name);
344
- } else if (depName === "exports") {
345
- //CommonJS module spec 1.1
346
- args[i] = handlers.exports(name);
347
- usingExports = true;
348
- } else if (depName === "module") {
349
- //CommonJS module spec 1.1
350
- cjsModule = args[i] = handlers.module(name);
351
- } else if (hasProp(defined, depName) ||
352
- hasProp(waiting, depName) ||
353
- hasProp(defining, depName)) {
354
- args[i] = callDep(depName);
355
- } else if (map.p) {
356
- map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
357
- args[i] = defined[depName];
358
- } else {
359
- throw new Error(name + ' missing ' + depName);
360
- }
361
- }
362
-
363
- ret = callback ? callback.apply(defined[name], args) : undefined;
364
-
365
- if (name) {
366
- //If setting exports via "module" is in play,
367
- //favor that over return value and exports. After that,
368
- //favor a non-undefined return value over exports use.
369
- if (cjsModule && cjsModule.exports !== undef &&
370
- cjsModule.exports !== defined[name]) {
371
- defined[name] = cjsModule.exports;
372
- } else if (ret !== undef || !usingExports) {
373
- //Use the return value from the function.
374
- defined[name] = ret;
375
- }
376
- }
377
- } else if (name) {
378
- //May just be an object definition for the module. Only
379
- //worry about defining if have a module name.
380
- defined[name] = callback;
381
- }
382
- };
383
-
384
- requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
385
- if (typeof deps === "string") {
386
- if (handlers[deps]) {
387
- //callback in this case is really relName
388
- return handlers[deps](callback);
389
- }
390
- //Just return the module wanted. In this scenario, the
391
- //deps arg is the module name, and second arg (if passed)
392
- //is just the relName.
393
- //Normalize module name, if it contains . or ..
394
- return callDep(makeMap(deps, makeRelParts(callback)).f);
395
- } else if (!deps.splice) {
396
- //deps is a config object, not an array.
397
- config = deps;
398
- if (config.deps) {
399
- req(config.deps, config.callback);
400
- }
401
- if (!callback) {
402
- return;
403
- }
404
-
405
- if (callback.splice) {
406
- //callback is an array, which means it is a dependency list.
407
- //Adjust args if there are dependencies
408
- deps = callback;
409
- callback = relName;
410
- relName = null;
411
- } else {
412
- deps = undef;
413
- }
414
- }
415
-
416
- //Support require(['a'])
417
- callback = callback || function () {};
418
-
419
- //If relName is a function, it is an errback handler,
420
- //so remove it.
421
- if (typeof relName === 'function') {
422
- relName = forceSync;
423
- forceSync = alt;
424
- }
425
-
426
- //Simulate async callback;
427
- if (forceSync) {
428
- main(undef, deps, callback, relName);
429
- } else {
430
- //Using a non-zero value because of concern for what old browsers
431
- //do, and latest browsers "upgrade" to 4 if lower value is used:
432
- //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
433
- //If want a value immediately, use require('id') instead -- something
434
- //that works in almond on the global level, but not guaranteed and
435
- //unlikely to work in other AMD implementations.
436
- setTimeout(function () {
437
- main(undef, deps, callback, relName);
438
- }, 4);
439
- }
440
-
441
- return req;
442
- };
443
-
444
- /**
445
- * Just drops the config on the floor, but returns req in case
446
- * the config return value is used.
447
- */
448
- req.config = function (cfg) {
449
- return req(cfg);
450
- };
451
-
452
- /**
453
- * Expose module registry for debugging and tooling
454
- */
455
- requirejs._defined = defined;
456
-
457
- define = function (name, deps, callback) {
458
- if (typeof name !== 'string') {
459
- throw new Error('See almond README: incorrect module build, no module name');
460
- }
461
-
462
- //This module may not have dependencies
463
- if (!deps.splice) {
464
- //deps is not an array, so probably means
465
- //an object literal or factory function for
466
- //the value. Adjust args.
467
- callback = deps;
468
- deps = [];
469
- }
470
-
471
- if (!hasProp(defined, name) && !hasProp(waiting, name)) {
472
- waiting[name] = [name, deps, callback];
473
- }
474
- };
475
-
476
- define.amd = {
477
- jQuery: true
478
- };
479
- }());
480
-
481
- S2.requirejs = requirejs;S2.require = require;S2.define = define;
482
- }
483
- }());
484
- S2.define("almond", function(){});
485
-
486
- /* global jQuery:false, $:false */
487
- S2.define('jquery',[],function () {
488
- var _$ = jQuery || $;
489
-
490
- if (_$ == null && console && console.error) {
491
- console.error(
492
- 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
493
- 'found. Make sure that you are including jQuery before Select2 on your ' +
494
- 'web page.'
495
- );
496
  }
 
 
497
 
498
- return _$;
499
- });
500
-
501
- S2.define('select2/utils',[
502
- 'jquery'
503
- ], function ($) {
504
- var Utils = {};
505
-
506
- Utils.Extend = function (ChildClass, SuperClass) {
507
- var __hasProp = {}.hasOwnProperty;
508
-
509
- function BaseConstructor () {
510
- this.constructor = ChildClass;
511
- }
512
-
513
- for (var key in SuperClass) {
514
- if (__hasProp.call(SuperClass, key)) {
515
- ChildClass[key] = SuperClass[key];
516
- }
517
- }
518
-
519
- BaseConstructor.prototype = SuperClass.prototype;
520
- ChildClass.prototype = new BaseConstructor();
521
- ChildClass.__super__ = SuperClass.prototype;
522
 
523
- return ChildClass;
524
- };
 
 
 
 
 
525
 
526
- function getMethods (theClass) {
527
- var proto = theClass.prototype;
528
 
529
- var methods = [];
 
 
 
530
 
531
- for (var methodName in proto) {
532
- var m = proto[methodName];
533
 
534
- if (typeof m !== 'function') {
535
- continue;
536
- }
537
 
538
- if (methodName === 'constructor') {
539
- continue;
540
- }
 
 
541
 
542
- methods.push(methodName);
543
- }
 
544
 
545
- return methods;
546
- }
547
-
548
- Utils.Decorate = function (SuperClass, DecoratorClass) {
549
- var decoratedMethods = getMethods(DecoratorClass);
550
- var superMethods = getMethods(SuperClass);
551
-
552
- function DecoratedClass () {
553
- var unshift = Array.prototype.unshift;
554
 
555
- var argCount = DecoratorClass.prototype.constructor.length;
 
556
 
557
- var calledConstructor = SuperClass.prototype.constructor;
558
 
559
- if (argCount > 0) {
560
- unshift.call(arguments, SuperClass.prototype.constructor);
561
 
562
- calledConstructor = DecoratorClass.prototype.constructor;
563
- }
 
564
 
565
- calledConstructor.apply(this, arguments);
566
- }
 
567
 
568
- DecoratorClass.displayName = SuperClass.displayName;
 
569
 
570
- function ctr () {
571
- this.constructor = DecoratedClass;
572
- }
573
 
574
- DecoratedClass.prototype = new ctr();
 
 
575
 
576
- for (var m = 0; m < superMethods.length; m++) {
577
- var superMethod = superMethods[m];
578
 
579
- DecoratedClass.prototype[superMethod] =
580
- SuperClass.prototype[superMethod];
581
- }
582
 
583
- var calledMethod = function (methodName) {
584
- // Stub out the original method if it's not decorating an actual method
585
- var originalMethod = function () {};
586
 
587
- if (methodName in DecoratedClass.prototype) {
588
- originalMethod = DecoratedClass.prototype[methodName];
589
- }
590
 
591
- var decoratedMethod = DecoratorClass.prototype[methodName];
 
592
 
593
- return function () {
594
- var unshift = Array.prototype.unshift;
595
 
596
- unshift.call(arguments, originalMethod);
597
 
598
- return decoratedMethod.apply(this, arguments);
599
- };
600
- };
601
 
602
- for (var d = 0; d < decoratedMethods.length; d++) {
603
- var decoratedMethod = decoratedMethods[d];
604
 
605
- DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
606
- }
607
 
608
- return DecoratedClass;
609
- };
 
610
 
611
- var Observable = function () {
612
- this.listeners = {};
613
- };
614
 
615
- Observable.prototype.on = function (event, callback) {
616
- this.listeners = this.listeners || {};
 
617
 
618
- if (event in this.listeners) {
619
- this.listeners[event].push(callback);
620
- } else {
621
- this.listeners[event] = [callback];
622
- }
623
- };
624
 
625
- Observable.prototype.trigger = function (event) {
626
- var slice = Array.prototype.slice;
627
- var params = slice.call(arguments, 1);
628
 
629
- this.listeners = this.listeners || {};
630
 
631
- // Params should always come in as an array
632
- if (params == null) {
633
- params = [];
634
- }
635
 
636
- // If there are no arguments to the event, use a temporary object
637
- if (params.length === 0) {
638
- params.push({});
639
- }
640
 
641
- // Set the `_type` of the first object to the event
642
- params[0]._type = event;
643
 
644
- if (event in this.listeners) {
645
- this.invoke(this.listeners[event], slice.call(arguments, 1));
646
- }
647
 
648
- if ('*' in this.listeners) {
649
- this.invoke(this.listeners['*'], arguments);
650
- }
651
- };
652
 
653
- Observable.prototype.invoke = function (listeners, params) {
654
- for (var i = 0, len = listeners.length; i < len; i++) {
655
- listeners[i].apply(this, params);
656
- }
657
- };
658
 
659
- Utils.Observable = Observable;
 
 
 
 
 
660
 
661
- Utils.generateChars = function (length) {
662
- var chars = '';
 
663
 
664
- for (var i = 0; i < length; i++) {
665
- var randomChar = Math.floor(Math.random() * 36);
666
- chars += randomChar.toString(36);
667
- }
668
 
669
- return chars;
670
- };
671
-
672
- Utils.bind = function (func, context) {
673
- return function () {
674
- func.apply(context, arguments);
675
- };
676
- };
677
-
678
- Utils._convertData = function (data) {
679
- for (var originalKey in data) {
680
- var keys = originalKey.split('-');
681
-
682
- var dataLevel = data;
683
-
684
- if (keys.length === 1) {
685
- continue;
686
- }
687
-
688
- for (var k = 0; k < keys.length; k++) {
689
- var key = keys[k];
690
-
691
- // Lowercase the first letter
692
- // By default, dash-separated becomes camelCase
693
- key = key.substring(0, 1).toLowerCase() + key.substring(1);
694
-
695
- if (!(key in dataLevel)) {
696
- dataLevel[key] = {};
697
- }
698
-
699
- if (k == keys.length - 1) {
700
- dataLevel[key] = data[originalKey];
701
- }
702
-
703
- dataLevel = dataLevel[key];
704
- }
705
-
706
- delete data[originalKey];
707
- }
708
-
709
- return data;
710
- };
711
-
712
- Utils.hasScroll = function (index, el) {
713
- // Adapted from the function created by @ShadowScripter
714
- // and adapted by @BillBarry on the Stack Exchange Code Review website.
715
- // The original code can be found at
716
- // http://codereview.stackexchange.com/q/13338
717
- // and was designed to be used with the Sizzle selector engine.
718
-
719
- var $el = $(el);
720
- var overflowX = el.style.overflowX;
721
- var overflowY = el.style.overflowY;
722
-
723
- //Check both x and y declarations
724
- if (overflowX === overflowY &&
725
- (overflowY === 'hidden' || overflowY === 'visible')) {
726
- return false;
727
- }
728
-
729
- if (overflowX === 'scroll' || overflowY === 'scroll') {
730
- return true;
731
- }
732
-
733
- return ($el.innerHeight() < el.scrollHeight ||
734
- $el.innerWidth() < el.scrollWidth);
735
- };
736
-
737
- Utils.escapeMarkup = function (markup) {
738
- var replaceMap = {
739
- '\\': '&#92;',
740
- '&': '&amp;',
741
- '<': '&lt;',
742
- '>': '&gt;',
743
- '"': '&quot;',
744
- '\'': '&#39;',
745
- '/': '&#47;'
746
- };
747
-
748
- // Do not try to escape the markup if it's not a string
749
- if (typeof markup !== 'string') {
750
- return markup;
751
- }
752
-
753
- return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
754
- return replaceMap[match];
755
- });
756
- };
757
-
758
- // Append an array of jQuery nodes to a given element.
759
- Utils.appendMany = function ($element, $nodes) {
760
- // jQuery 1.7.x does not support $.fn.append() with an array
761
- // Fall back to a jQuery object collection using $.fn.add()
762
- if ($.fn.jquery.substr(0, 3) === '1.7') {
763
- var $jqNodes = $();
764
-
765
- $.map($nodes, function (node) {
766
- $jqNodes = $jqNodes.add(node);
767
- });
768
-
769
- $nodes = $jqNodes;
770
- }
771
-
772
- $element.append($nodes);
773
- };
774
-
775
- // Determine whether the browser is on a touchscreen device.
776
- Utils.isTouchscreen = function() {
777
- if ('undefined' === typeof Utils._isTouchscreenCache) {
778
- Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
779
- }
780
- return Utils._isTouchscreenCache;
781
- }
782
 
783
- return Utils;
784
- });
 
 
785
 
786
- S2.define('select2/results',[
787
- 'jquery',
788
- './utils'
789
- ], function ($, Utils) {
790
- function Results ($element, options, dataAdapter) {
791
- this.$element = $element;
792
- this.data = dataAdapter;
793
- this.options = options;
794
 
795
- Results.__super__.constructor.call(this);
796
- }
 
797
 
798
- Utils.Extend(Results, Utils.Observable);
 
 
 
799
 
800
- Results.prototype.render = function () {
801
- var $results = $(
802
- '<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>'
803
- );
 
804
 
805
- if (this.options.get('multiple')) {
806
- $results.attr('aria-multiselectable', 'true');
807
- }
808
 
809
- this.$results = $results;
 
810
 
811
- return $results;
812
- };
 
 
813
 
814
- Results.prototype.clear = function () {
815
- this.$results.empty();
816
- };
817
 
818
- Results.prototype.displayMessage = function (params) {
819
- var escapeMarkup = this.options.get('escapeMarkup');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
820
 
821
- this.clear();
822
- this.hideLoading();
823
 
824
- var $message = $(
825
- '<li role="alert" aria-live="assertive"' +
826
- ' class="select2-results__option"></li>'
827
- );
828
 
829
- var message = this.options.get('translations').get(params.message);
 
 
 
 
 
 
830
 
831
- $message.append(
832
- escapeMarkup(
833
- message(params.args)
834
- )
835
- );
836
 
837
- $message[0].className += ' select2-results__message';
 
 
 
 
 
 
 
838
 
839
- this.$results.append($message);
840
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
841
 
842
- Results.prototype.hideMessages = function () {
843
- this.$results.find('.select2-results__message').remove();
844
- };
845
 
846
- Results.prototype.append = function (data) {
847
- this.hideLoading();
848
 
849
- var $options = [];
 
 
 
850
 
851
- if (data.results == null || data.results.length === 0) {
852
- if (this.$results.children().length === 0) {
853
- this.trigger('results:message', {
854
- message: 'noResults'
855
- });
856
- }
857
 
858
- return;
859
- }
 
 
 
860
 
861
- data.results = this.sort(data.results);
862
 
863
- for (var d = 0; d < data.results.length; d++) {
864
- var item = data.results[d];
865
 
866
- var $option = this.option(item);
 
 
867
 
868
- $options.push($option);
869
- }
870
 
871
- this.$results.append($options);
872
- };
873
 
874
- Results.prototype.position = function ($results, $dropdown) {
875
- var $resultsContainer = $dropdown.find('.select2-results');
876
- $resultsContainer.append($results);
877
- };
 
 
878
 
879
- Results.prototype.sort = function (data) {
880
- var sorter = this.options.get('sorter');
881
 
882
- return sorter(data);
883
- };
884
 
885
- Results.prototype.highlightFirstItem = function () {
886
- var $options = this.$results
887
- .find('.select2-results__option[data-selected]');
888
 
889
- var $selected = $options.filter('[data-selected=true]');
890
 
891
- // Check if there are any selected options
892
- if ($selected.length > 0) {
893
- // If there are selected options, highlight the first
894
- $selected.first().trigger('mouseenter');
895
- } else {
896
- // If there are no selected options, highlight the first option
897
- // in the dropdown
898
- $options.first().trigger('mouseenter');
899
- }
900
 
901
- this.ensureHighlightVisible();
902
- };
903
 
904
- Results.prototype.setClasses = function () {
905
- var self = this;
 
 
906
 
907
- this.data.current(function (selected) {
908
- var selectedIds = $.map(selected, function (s) {
909
- return s.id.toString();
910
- });
911
 
912
- var $options = self.$results
913
- .find('.select2-results__option[data-selected]');
914
 
915
- $options.each(function () {
916
- var $option = $(this);
 
917
 
918
- var item = $.data(this, 'data');
919
 
920
- // id needs to be converted to a string when comparing
921
- var id = '' + item.id;
 
 
 
 
 
 
 
922
 
923
- if ((item.element != null && item.element.selected) ||
924
- (item.element == null && $.inArray(id, selectedIds) > -1)) {
925
- $option.attr('data-selected', 'true');
926
- } else {
927
- $option.attr('data-selected', 'false');
928
- }
929
- });
930
 
931
- });
932
- };
933
 
934
- Results.prototype.showLoading = function (params) {
935
- this.hideLoading();
 
 
936
 
937
- var loadingMore = this.options.get('translations').get('searching');
 
938
 
939
- var loading = {
940
- disabled: true,
941
- loading: true,
942
- text: loadingMore(params)
943
- };
944
- var $loading = this.option(loading);
945
- $loading.className += ' loading-results';
946
 
947
- this.$results.prepend($loading);
948
- };
949
 
950
- Results.prototype.hideLoading = function () {
951
- this.$results.find('.loading-results').remove();
952
- };
953
 
954
- Results.prototype.option = function (data) {
955
- var option = document.createElement('li');
956
- option.className = 'select2-results__option';
 
 
 
 
957
 
958
- var attrs = {
959
- 'role': 'option',
960
- 'data-selected': 'false',
961
- 'tabindex': -1
962
- };
963
 
964
- if (data.disabled) {
965
- delete attrs['data-selected'];
966
- attrs['aria-disabled'] = 'true';
967
- }
968
 
969
- if (data.id == null) {
970
- delete attrs['data-selected'];
971
- }
972
 
973
- if (data._resultId != null) {
974
- option.id = data._resultId;
975
- }
 
 
 
 
976
 
977
- if (data.title) {
978
- option.title = data.title;
979
- }
980
 
981
- if (data.children) {
982
- attrs['aria-label'] = data.text;
983
- delete attrs['data-selected'];
984
- }
985
 
986
- for (var attr in attrs) {
987
- var val = attrs[attr];
 
988
 
989
- option.setAttribute(attr, val);
990
- }
991
-
992
- if (data.children) {
993
- var $option = $(option);
994
 
995
- var label = document.createElement('strong');
996
- label.className = 'select2-results__group';
 
 
997
 
998
- var $label = $(label);
999
- this.template(data, label);
1000
- $label.attr('role', 'presentation');
1001
 
1002
- var $children = [];
 
 
1003
 
1004
- for (var c = 0; c < data.children.length; c++) {
1005
- var child = data.children[c];
 
1006
 
1007
- var $child = this.option(child);
 
 
 
1008
 
1009
- $children.push($child);
1010
- }
1011
 
1012
- var $childrenContainer = $('<ul></ul>', {
1013
- 'class': 'select2-results__options select2-results__options--nested',
1014
- 'role': 'listbox'
1015
- });
1016
- $childrenContainer.append($children);
1017
- $option.attr('role', 'list');
1018
 
1019
- $option.append(label);
1020
- $option.append($childrenContainer);
1021
- } else {
1022
- this.template(data, option);
1023
- }
1024
 
1025
- $.data(option, 'data', data);
 
 
1026
 
1027
- return option;
1028
- };
1029
 
1030
- Results.prototype.bind = function (container, $container) {
1031
- var self = this;
1032
 
1033
- var id = container.id + '-results';
1034
 
1035
- this.$results.attr('id', id);
 
1036
 
1037
- container.on('results:all', function (params) {
1038
- self.clear();
1039
- self.append(params.data);
 
 
 
1040
 
1041
- if (container.isOpen()) {
1042
- self.setClasses();
1043
- self.highlightFirstItem();
1044
- }
1045
- });
1046
 
1047
- container.on('results:append', function (params) {
1048
- self.append(params.data);
1049
 
1050
- if (container.isOpen()) {
1051
- self.setClasses();
1052
- }
1053
- });
1054
 
1055
- container.on('query', function (params) {
1056
- self.hideMessages();
1057
- self.showLoading(params);
1058
- });
1059
 
1060
- container.on('select', function () {
1061
- if (!container.isOpen()) {
1062
- return;
1063
- }
1064
 
1065
- self.setClasses();
1066
- self.highlightFirstItem();
1067
- });
1068
 
1069
- container.on('unselect', function () {
1070
- if (!container.isOpen()) {
1071
- return;
1072
- }
1073
 
1074
- self.setClasses();
1075
- self.highlightFirstItem();
1076
- });
 
 
1077
 
1078
- container.on('open', function () {
1079
- // When the dropdown is open, aria-expended="true"
1080
- self.$results.attr('aria-expanded', 'true');
1081
- self.$results.attr('aria-hidden', 'false');
1082
 
1083
- self.setClasses();
1084
- self.ensureHighlightVisible();
1085
- });
 
1086
 
1087
- container.on('close', function () {
1088
- // When the dropdown is closed, aria-expended="false"
1089
- self.$results.attr('aria-expanded', 'false');
1090
- self.$results.attr('aria-hidden', 'true');
1091
- self.$results.removeAttr('aria-activedescendant');
1092
- });
1093
 
1094
- container.on('results:toggle', function () {
1095
- var $highlighted = self.getHighlightedResults();
 
 
1096
 
1097
- if ($highlighted.length === 0) {
1098
- return;
1099
- }
1100
 
1101
- $highlighted.trigger('mouseup');
1102
- });
 
 
1103
 
1104
- container.on('results:select', function () {
1105
- var $highlighted = self.getHighlightedResults();
 
1106
 
1107
- if ($highlighted.length === 0) {
1108
- return;
1109
- }
 
1110
 
1111
- var data = $highlighted.data('data');
 
 
1112
 
1113
- if ($highlighted.attr('data-selected') == 'true') {
1114
- self.trigger('close', {});
1115
- } else {
1116
- self.trigger('select', {
1117
- data: data
1118
- });
1119
- }
1120
- });
1121
 
1122
- container.on('results:previous', function () {
1123
- var $highlighted = self.getHighlightedResults();
1124
 
1125
- var $options = self.$results.find('[data-selected]');
 
 
1126
 
1127
- var currentIndex = $options.index($highlighted);
 
1128
 
1129
- // If we are already at te top, don't move further
1130
- if (currentIndex === 0) {
1131
- return;
1132
- }
1133
 
1134
- var nextIndex = currentIndex - 1;
 
 
1135
 
1136
- // If none are highlighted, highlight the first
1137
- if ($highlighted.length === 0) {
1138
- nextIndex = 0;
1139
- }
1140
 
1141
- var $next = $options.eq(nextIndex);
1142
-
1143
- $next.trigger('mouseenter');
 
 
 
 
 
1144
 
1145
- var currentOffset = self.$results.offset().top;
1146
- var nextTop = $next.offset().top;
1147
- var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1148
 
1149
- if (nextIndex === 0) {
1150
- self.$results.scrollTop(0);
1151
- } else if (nextTop - currentOffset < 0) {
1152
- self.$results.scrollTop(nextOffset);
1153
- }
1154
- });
1155
-
1156
- container.on('results:next', function () {
1157
- var $highlighted = self.getHighlightedResults();
1158
-
1159
- var $options = self.$results.find('[data-selected]');
1160
-
1161
- var currentIndex = $options.index($highlighted);
1162
-
1163
- var nextIndex = currentIndex + 1;
1164
 
1165
- // If we are at the last option, stay there
1166
- if (nextIndex >= $options.length) {
1167
- return;
1168
- }
1169
-
1170
- var $next = $options.eq(nextIndex);
1171
 
1172
- $next.trigger('mouseenter');
 
 
 
1173
 
1174
- var currentOffset = self.$results.offset().top +
1175
- self.$results.outerHeight(false);
1176
- var nextBottom = $next.offset().top + $next.outerHeight(false);
1177
- var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1178
 
1179
- if (nextIndex === 0) {
1180
- self.$results.scrollTop(0);
1181
- } else if (nextBottom > currentOffset) {
1182
- self.$results.scrollTop(nextOffset);
1183
- }
1184
- });
1185
 
1186
- container.on('results:focus', function (params) {
1187
- params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
1188
- self.$results.attr('aria-activedescendant', params.element.attr('id'));
1189
- });
1190
 
1191
- container.on('results:message', function (params) {
1192
- self.displayMessage(params);
1193
- });
1194
 
1195
- if ($.fn.mousewheel) {
1196
- this.$results.on('mousewheel', function (e) {
1197
- var top = self.$results.scrollTop();
 
 
 
 
 
 
 
 
 
 
 
 
1198
 
1199
- var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
 
 
 
 
 
1200
 
1201
- var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1202
- var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
1203
 
1204
- if (isAtTop) {
1205
- self.$results.scrollTop(0);
 
 
1206
 
1207
- e.preventDefault();
1208
- e.stopPropagation();
1209
- } else if (isAtBottom) {
1210
- self.$results.scrollTop(
1211
- self.$results.get(0).scrollHeight - self.$results.height()
1212
- );
1213
 
1214
- e.preventDefault();
1215
- e.stopPropagation();
1216
- }
1217
- });
1218
- }
1219
 
1220
- this.$results.on('mouseup', '.select2-results__option[data-selected]',
1221
- function (evt) {
1222
- var $this = $(this);
1223
 
1224
- var data = $this.data('data');
1225
-
1226
- if ($this.attr('data-selected') === 'true') {
1227
- if (self.options.get('multiple')) {
1228
- self.trigger('unselect', {
1229
- originalEvent: evt,
1230
- data: data
1231
- });
1232
- } else {
1233
- self.trigger('close', {});
1234
- }
1235
-
1236
- return;
1237
- }
1238
-
1239
- self.trigger('select', {
1240
- originalEvent: evt,
1241
- data: data
1242
- });
1243
- });
1244
-
1245
- this.$results.on('mouseenter', '.select2-results__option[data-selected]',
1246
- function (evt) {
1247
- var data = $(this).data('data');
1248
-
1249
- self.getHighlightedResults()
1250
- .removeClass('select2-results__option--highlighted')
1251
- .attr('aria-selected', 'false');
1252
-
1253
- self.trigger('results:focus', {
1254
- data: data,
1255
- element: $(this)
1256
- });
1257
- });
1258
- };
1259
-
1260
- Results.prototype.getHighlightedResults = function () {
1261
- var $highlighted = this.$results
1262
- .find('.select2-results__option--highlighted');
1263
-
1264
- return $highlighted;
1265
- };
1266
-
1267
- Results.prototype.destroy = function () {
1268
- this.$results.remove();
1269
- };
1270
-
1271
- Results.prototype.ensureHighlightVisible = function () {
1272
- var $highlighted = this.getHighlightedResults();
1273
-
1274
- if ($highlighted.length === 0) {
1275
- return;
1276
- }
1277
-
1278
- var $options = this.$results.find('[data-selected]');
1279
-
1280
- var currentIndex = $options.index($highlighted);
1281
-
1282
- var currentOffset = this.$results.offset().top;
1283
- var nextTop = $highlighted.offset().top;
1284
- var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1285
-
1286
- var offsetDelta = nextTop - currentOffset;
1287
- nextOffset -= $highlighted.outerHeight(false) * 2;
1288
-
1289
- if (currentIndex <= 2) {
1290
- this.$results.scrollTop(0);
1291
- } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1292
- this.$results.scrollTop(nextOffset);
1293
- }
1294
- };
1295
-
1296
- Results.prototype.template = function (result, container) {
1297
- var template = this.options.get('templateResult');
1298
- var escapeMarkup = this.options.get('escapeMarkup');
1299
-
1300
- var content = template(result, container);
1301
-
1302
- if (content == null) {
1303
- container.style.display = 'none';
1304
- } else if (typeof content === 'string') {
1305
- container.innerHTML = escapeMarkup(content);
1306
- } else {
1307
- $(container).append(content);
1308
- }
1309
- };
1310
-
1311
- return Results;
1312
- });
1313
-
1314
- S2.define('select2/keys',[
1315
-
1316
- ], function () {
1317
- var KEYS = {
1318
- BACKSPACE: 8,
1319
- TAB: 9,
1320
- ENTER: 13,
1321
- SHIFT: 16,
1322
- CTRL: 17,
1323
- ALT: 18,
1324
- ESC: 27,
1325
- SPACE: 32,
1326
- PAGE_UP: 33,
1327
- PAGE_DOWN: 34,
1328
- END: 35,
1329
- HOME: 36,
1330
- LEFT: 37,
1331
- UP: 38,
1332
- RIGHT: 39,
1333
- DOWN: 40,
1334
- DELETE: 46
1335
- };
1336
-
1337
- return KEYS;
1338
- });
1339
-
1340
- S2.define('select2/selection/base',[
1341
- 'jquery',
1342
- '../utils',
1343
- '../keys'
1344
- ], function ($, Utils, KEYS) {
1345
- function BaseSelection ($element, options) {
1346
- this.$element = $element;
1347
- this.options = options;
1348
-
1349
- BaseSelection.__super__.constructor.call(this);
1350
- }
1351
 
1352
- Utils.Extend(BaseSelection, Utils.Observable);
1353
 
1354
- BaseSelection.prototype.render = function () {
1355
- var $selection = $(
1356
- '<span class="select2-selection" ' +
1357
- ' aria-haspopup="true" aria-expanded="false">' +
1358
- '</span>'
1359
- );
1360
 
1361
- this._tabindex = 0;
 
1362
 
1363
- if (this.$element.data('old-tabindex') != null) {
1364
- this._tabindex = this.$element.data('old-tabindex');
1365
- } else if (this.$element.attr('tabindex') != null) {
1366
- this._tabindex = this.$element.attr('tabindex');
1367
- }
 
1368
 
1369
- $selection.attr('title', this.$element.attr('title'));
1370
- $selection.attr('tabindex', this._tabindex);
 
 
 
1371
 
1372
- this.$selection = $selection;
 
 
1373
 
1374
- return $selection;
1375
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1376
 
1377
- BaseSelection.prototype.bind = function (container, $container) {
1378
- var self = this;
 
 
 
 
 
 
 
 
 
 
 
 
1379
 
1380
- var id = container.id + '-container';
1381
- var resultsId = container.id + '-results';
1382
- var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
 
 
 
 
1383
 
1384
- this.container = container;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1385
 
1386
- this.$selection.on('focus', function (evt) {
1387
- self.trigger('focus', evt);
1388
- });
 
 
1389
 
1390
- this.$selection.on('blur', function (evt) {
1391
- self._handleBlur(evt);
1392
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1393
 
1394
- this.$selection.on('keydown', function (evt) {
1395
- self.trigger('keypress', evt);
 
 
 
 
 
 
 
 
 
 
 
 
 
1396
 
1397
- if (evt.which === KEYS.SPACE) {
1398
- evt.preventDefault();
1399
- }
1400
- });
1401
 
1402
- container.on('results:focus', function (params) {
1403
- self.$selection.attr('aria-activedescendant', params.data._resultId);
1404
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1405
 
1406
- container.on('selection:update', function (params) {
1407
- self.update(params.data);
1408
- });
 
 
1409
 
1410
- container.on('open', function () {
1411
- // When the dropdown is open, aria-expanded="true"
1412
- self.$selection.attr('aria-expanded', 'true');
1413
- self.$selection.attr('aria-owns', resultsId);
1414
-
1415
- self._attachCloseHandler(container);
1416
- });
1417
-
1418
- container.on('close', function () {
1419
- // When the dropdown is closed, aria-expanded="false"
1420
- self.$selection.attr('aria-expanded', 'false');
1421
- self.$selection.removeAttr('aria-activedescendant');
1422
- self.$selection.removeAttr('aria-owns');
1423
-
1424
- // This needs to be delayed as the active element is the body when the
1425
- // key is pressed.
1426
- window.setTimeout(function () {
1427
- self.$selection.focus();
1428
- }, 1);
1429
-
1430
- self._detachCloseHandler(container);
1431
- });
1432
-
1433
- container.on('enable', function () {
1434
- self.$selection.attr('tabindex', self._tabindex);
1435
- });
1436
-
1437
- container.on('disable', function () {
1438
- self.$selection.attr('tabindex', '-1');
1439
- });
1440
- };
1441
-
1442
- BaseSelection.prototype._handleBlur = function (evt) {
1443
- var self = this;
1444
-
1445
- // This needs to be delayed as the active element is the body when the tab
1446
- // key is pressed, possibly along with others.
1447
- window.setTimeout(function () {
1448
- // Don't trigger `blur` if the focus is still in the selection
1449
- if (
1450
- (document.activeElement == self.$selection[0]) ||
1451
- ($.contains(self.$selection[0], document.activeElement))
1452
- ) {
1453
- return;
1454
- }
1455
-
1456
- self.trigger('blur', evt);
1457
- }, 1);
1458
- };
1459
-
1460
- BaseSelection.prototype._attachCloseHandler = function (container) {
1461
- var self = this;
1462
-
1463
- $(document.body).on('mousedown.select2.' + container.id, function (e) {
1464
- var $target = $(e.target);
1465
-
1466
- var $select = $target.closest('.select2');
1467
-
1468
- var $all = $('.select2.select2-container--open');
1469
-
1470
- $all.each(function () {
1471
- var $this = $(this);
1472
-
1473
- if (this == $select[0]) {
1474
- return;
1475
- }
1476
-
1477
- var $element = $this.data('element');
1478
- $element.select2('close');
1479
-
1480
- // Remove any focus when dropdown is closed by clicking outside the select area.
1481
- // Timeout of 1 required for close to finish wrapping up.
1482
- setTimeout(function(){
1483
- $this.find('*:focus').blur();
1484
- $target.focus();
1485
- }, 1);
1486
- });
1487
- });
1488
- };
1489
-
1490
- BaseSelection.prototype._detachCloseHandler = function (container) {
1491
- $(document.body).off('mousedown.select2.' + container.id);
1492
- };
1493
-
1494
- BaseSelection.prototype.position = function ($selection, $container) {
1495
- var $selectionContainer = $container.find('.selection');
1496
- $selectionContainer.append($selection);
1497
- };
1498
-
1499
- BaseSelection.prototype.destroy = function () {
1500
- this._detachCloseHandler(this.container);
1501
- };
1502
-
1503
- BaseSelection.prototype.update = function (data) {
1504
- throw new Error('The `update` method must be defined in child classes.');
1505
- };
1506
-
1507
- return BaseSelection;
1508
- });
1509
-
1510
- S2.define('select2/selection/single',[
1511
- 'jquery',
1512
- './base',
1513
- '../utils',
1514
- '../keys'
1515
- ], function ($, BaseSelection, Utils, KEYS) {
1516
- function SingleSelection () {
1517
- SingleSelection.__super__.constructor.apply(this, arguments);
1518
- }
1519
 
1520
- Utils.Extend(SingleSelection, BaseSelection);
 
1521
 
1522
- SingleSelection.prototype.render = function () {
1523
- var $selection = SingleSelection.__super__.render.call(this);
 
 
 
1524
 
1525
- $selection.addClass('select2-selection--single');
 
 
 
 
1526
 
1527
- $selection.html(
1528
- '<span class="select2-selection__rendered"></span>' +
1529
- '<span class="select2-selection__arrow" role="presentation">' +
1530
- '<b role="presentation"></b>' +
1531
- '</span>'
1532
- );
1533
 
1534
- return $selection;
1535
- };
1536
 
1537
- SingleSelection.prototype.bind = function (container, $container) {
1538
- var self = this;
1539
 
1540
- SingleSelection.__super__.bind.apply(this, arguments);
 
 
 
 
 
 
 
1541
 
1542
- var id = container.id + '-container';
1543
 
1544
- this.$selection.find('.select2-selection__rendered')
1545
- .attr('id', id)
1546
- .attr('role', 'textbox')
1547
- .attr('aria-readonly', 'true');
1548
- this.$selection.attr('aria-labelledby', id);
 
 
 
 
 
 
 
 
1549
 
1550
- // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
1551
- this.$selection.attr('role', 'combobox');
 
 
1552
 
1553
- this.$selection.on('mousedown', function (evt) {
1554
- // Only respond to left clicks
1555
- if (evt.which !== 1) {
1556
- return;
1557
- }
1558
 
1559
- self.trigger('toggle', {
1560
- originalEvent: evt
1561
- });
1562
- });
1563
 
1564
- this.$selection.on('focus', function (evt) {
1565
- // User focuses on the container
1566
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1567
 
1568
- this.$selection.on('keydown', function (evt) {
1569
- // If user starts typing an alphanumeric key on the keyboard, open if not opened.
1570
- if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
1571
- container.open();
1572
- }
1573
- });
 
 
 
1574
 
1575
- this.$selection.on('blur', function (evt) {
1576
- // User exits the container
1577
- });
1578
 
1579
- container.on('focus', function (evt) {
1580
- if (!container.isOpen()) {
1581
- self.$selection.focus();
1582
- }
1583
- });
1584
 
1585
- container.on('selection:update', function (params) {
1586
- self.update(params.data);
1587
- });
1588
- };
 
 
1589
 
1590
- SingleSelection.prototype.clear = function () {
1591
- this.$selection.find('.select2-selection__rendered').empty();
1592
- };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1593
 
1594
- SingleSelection.prototype.display = function (data, container) {
1595
- var template = this.options.get('templateSelection');
1596
- var escapeMarkup = this.options.get('escapeMarkup');
1597
 
1598
- return escapeMarkup(template(data, container));
1599
- };
 
1600
 
1601
- SingleSelection.prototype.selectionContainer = function () {
1602
- return $('<span></span>');
1603
- };
1604
 
1605
- SingleSelection.prototype.update = function (data) {
1606
- if (data.length === 0) {
1607
- this.clear();
1608
- return;
1609
- }
1610
 
1611
- var selection = data[0];
 
 
1612
 
1613
- var $rendered = this.$selection.find('.select2-selection__rendered');
1614
- var formatted = this.display(selection, $rendered);
1615
 
1616
- $rendered.empty().append(formatted);
1617
- $rendered.prop('title', selection.title || selection.text);
1618
- };
1619
 
1620
- return SingleSelection;
1621
- });
1622
-
1623
- S2.define('select2/selection/multiple',[
1624
- 'jquery',
1625
- './base',
1626
- '../utils'
1627
- ], function ($, BaseSelection, Utils) {
1628
- function MultipleSelection ($element, options) {
1629
- MultipleSelection.__super__.constructor.apply(this, arguments);
1630
- }
1631
 
1632
- Utils.Extend(MultipleSelection, BaseSelection);
 
 
 
 
1633
 
1634
- MultipleSelection.prototype.render = function () {
1635
- var $selection = MultipleSelection.__super__.render.call(this);
 
 
1636
 
1637
- $selection.addClass('select2-selection--multiple');
 
1638
 
1639
- $selection.html(
1640
- '<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'
1641
- );
1642
 
1643
- return $selection;
1644
- };
1645
 
1646
- MultipleSelection.prototype.bind = function (container, $container) {
1647
- var self = this;
1648
 
1649
- MultipleSelection.__super__.bind.apply(this, arguments);
1650
 
1651
- this.$selection.on('click', function (evt) {
1652
- self.trigger('toggle', {
1653
- originalEvent: evt
1654
- });
1655
- });
1656
 
1657
- this.$selection.on(
1658
- 'click',
1659
- '.select2-selection__choice__remove',
1660
- function (evt) {
1661
- // Ignore the event if it is disabled
1662
- if (self.options.get('disabled')) {
1663
- return;
1664
- }
1665
 
1666
- var $remove = $(this);
1667
- var $selection = $remove.parent();
1668
 
1669
- var data = $selection.data('data');
 
 
 
1670
 
1671
- self.trigger('unselect', {
1672
- originalEvent: evt,
1673
- data: data
1674
- });
1675
- }
1676
- );
1677
 
1678
- this.$selection.on('keydown', function (evt) {
1679
- // If user starts typing an alphanumeric key on the keyboard, open if not opened.
1680
- if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
1681
- container.open();
1682
- }
1683
- });
1684
 
1685
- // Focus on the search field when the container is focused instead of the main container.
1686
- container.on( 'focus', function(){
1687
- self.focusOnSearch();
1688
- });
1689
- };
1690
 
1691
- MultipleSelection.prototype.clear = function () {
1692
- this.$selection.find('.select2-selection__rendered').empty();
1693
- };
1694
 
1695
- MultipleSelection.prototype.display = function (data, container) {
1696
- var template = this.options.get('templateSelection');
1697
- var escapeMarkup = this.options.get('escapeMarkup');
1698
 
1699
- return escapeMarkup(template(data, container));
1700
- };
 
 
1701
 
1702
- MultipleSelection.prototype.selectionContainer = function () {
1703
- var $container = $(
1704
- '<li class="select2-selection__choice">' +
1705
- '<span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">' +
1706
- '&times;' +
1707
- '</span>' +
1708
- '</li>'
1709
- );
1710
 
1711
- return $container;
1712
- };
 
1713
 
1714
- /**
1715
- * Focus on the search field instead of the main multiselect container.
1716
- */
1717
- MultipleSelection.prototype.focusOnSearch = function() {
1718
- var self = this;
1719
-
1720
- if ('undefined' !== typeof self.$search) {
1721
- // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
1722
- setTimeout(function(){
1723
- // Prevent the dropdown opening again when focused from this.
1724
- // This gets reset automatically when focus is triggered.
1725
- self._keyUpPrevented = true;
1726
-
1727
- self.$search.focus();
1728
- }, 1);
1729
- }
1730
- }
1731
 
1732
- MultipleSelection.prototype.update = function (data) {
1733
- this.clear();
1734
 
1735
- if (data.length === 0) {
1736
- return;
1737
- }
1738
 
1739
- var $selections = [];
1740
 
1741
- for (var d = 0; d < data.length; d++) {
1742
- var selection = data[d];
1743
 
1744
- var $selection = this.selectionContainer();
1745
- var formatted = this.display(selection, $selection);
1746
- if ('string' === typeof formatted) {
1747
- formatted = formatted.trim();
1748
- }
1749
 
1750
- $selection.append(formatted);
1751
- $selection.prop('title', selection.title || selection.text);
 
 
1752
 
1753
- $selection.data('data', selection);
 
 
1754
 
1755
- $selections.push($selection);
1756
- }
1757
 
1758
- var $rendered = this.$selection.find('.select2-selection__rendered');
 
 
 
 
1759
 
1760
- Utils.appendMany($rendered, $selections);
1761
- };
 
 
 
 
1762
 
1763
- return MultipleSelection;
1764
- });
 
1765
 
1766
- S2.define('select2/selection/placeholder',[
1767
- '../utils'
1768
- ], function (Utils) {
1769
- function Placeholder (decorated, $element, options) {
1770
- this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1771
 
1772
- decorated.call(this, $element, options);
1773
- }
 
1774
 
1775
- Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1776
- if (typeof placeholder === 'string') {
1777
- placeholder = {
1778
- id: '',
1779
- text: placeholder
1780
- };
1781
- }
1782
 
1783
- return placeholder;
1784
- };
1785
 
1786
- Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1787
- var $placeholder = this.selectionContainer();
1788
 
1789
- $placeholder.html(this.display(placeholder));
1790
- $placeholder.addClass('select2-selection__placeholder')
1791
- .removeClass('select2-selection__choice');
1792
 
1793
- return $placeholder;
1794
- };
1795
 
1796
- Placeholder.prototype.update = function (decorated, data) {
1797
- var singlePlaceholder = (
1798
- data.length == 1 && data[0].id != this.placeholder.id
1799
- );
1800
- var multipleSelections = data.length > 1;
1801
 
1802
- if (multipleSelections || singlePlaceholder) {
1803
- return decorated.call(this, data);
1804
- }
1805
-
1806
- this.clear();
1807
 
1808
- var $placeholder = this.createPlaceholder(this.placeholder);
1809
-
1810
- this.$selection.find('.select2-selection__rendered').append($placeholder);
1811
- };
1812
 
1813
- return Placeholder;
1814
- });
 
 
 
 
 
 
 
 
 
 
 
 
1815
 
1816
- S2.define('select2/selection/allowClear',[
1817
- 'jquery',
1818
- '../keys'
1819
- ], function ($, KEYS) {
1820
- function AllowClear () { }
1821
-
1822
- AllowClear.prototype.bind = function (decorated, container, $container) {
1823
- var self = this;
1824
-
1825
- decorated.call(this, container, $container);
1826
-
1827
- if (this.placeholder == null) {
1828
- if (this.options.get('debug') && window.console && console.error) {
1829
- console.error(
1830
- 'Select2: The `allowClear` option should be used in combination ' +
1831
- 'with the `placeholder` option.'
1832
- );
1833
- }
1834
- }
1835
-
1836
- this.$selection.on('mousedown', '.select2-selection__clear',
1837
- function (evt) {
1838
- self._handleClear(evt);
1839
- });
1840
-
1841
- container.on('keypress', function (evt) {
1842
- self._handleKeyboardClear(evt, container);
1843
- });
1844
- };
1845
-
1846
- AllowClear.prototype._handleClear = function (_, evt) {
1847
- // Ignore the event if it is disabled
1848
- if (this.options.get('disabled')) {
1849
- return;
1850
- }
1851
-
1852
- var $clear = this.$selection.find('.select2-selection__clear');
1853
-
1854
- // Ignore the event if nothing has been selected
1855
- if ($clear.length === 0) {
1856
- return;
1857
- }
1858
-
1859
- evt.stopPropagation();
1860
-
1861
- var data = $clear.data('data');
1862
-
1863
- for (var d = 0; d < data.length; d++) {
1864
- var unselectData = {
1865
- data: data[d]
1866
- };
1867
-
1868
- // Trigger the `unselect` event, so people can prevent it from being
1869
- // cleared.
1870
- this.trigger('unselect', unselectData);
1871
-
1872
- // If the event was prevented, don't clear it out.
1873
- if (unselectData.prevented) {
1874
- return;
1875
- }
1876
- }
1877
-
1878
- this.$element.val(this.placeholder.id).trigger('change');
1879
-
1880
- this.trigger('toggle', {});
1881
- };
1882
 
1883
- AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1884
- if (container.isOpen()) {
1885
- return;
1886
- }
1887
-
1888
- if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1889
- this._handleClear(evt);
1890
- }
1891
- };
1892
-
1893
- AllowClear.prototype.update = function (decorated, data) {
1894
- decorated.call(this, data);
1895
-
1896
- if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1897
- data.length === 0) {
1898
- return;
1899
- }
1900
-
1901
- var $remove = $(
1902
- '<span class="select2-selection__clear">' +
1903
- '&times;' +
1904
- '</span>'
1905
- );
1906
- $remove.data('data', data);
1907
-
1908
- this.$selection.find('.select2-selection__rendered').prepend($remove);
1909
- };
1910
-
1911
- return AllowClear;
1912
- });
1913
-
1914
- S2.define('select2/selection/search',[
1915
- 'jquery',
1916
- '../utils',
1917
- '../keys'
1918
- ], function ($, Utils, KEYS) {
1919
- function Search (decorated, $element, options) {
1920
- decorated.call(this, $element, options);
1921
- }
1922
 
1923
- Search.prototype.render = function (decorated) {
1924
- var $search = $(
1925
- '<li class="select2-search select2-search--inline">' +
1926
- '<input class="select2-search__field" type="text" tabindex="-1"' +
1927
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
1928
- ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1929
- '</li>'
1930
- );
1931
-
1932
- this.$searchContainer = $search;
1933
- this.$search = $search.find('input');
1934
-
1935
- var $rendered = decorated.call(this);
1936
-
1937
- this._transferTabIndex();
1938
-
1939
- return $rendered;
1940
- };
1941
-
1942
- Search.prototype.bind = function (decorated, container, $container) {
1943
- var self = this;
1944
- var resultsId = container.id + '-results';
1945
-
1946
- decorated.call(this, container, $container);
1947
-
1948
- container.on('open', function () {
1949
- self.$search.attr('aria-owns', resultsId);
1950
- self.$search.trigger('focus');
1951
- });
1952
-
1953
- container.on('close', function () {
1954
- self.$search.val('');
1955
- self.$search.removeAttr('aria-activedescendant');
1956
- self.$search.removeAttr('aria-owns');
1957
- self.$search.trigger('focus');
1958
- });
1959
-
1960
- container.on('enable', function () {
1961
- self.$search.prop('disabled', false);
1962
-
1963
- self._transferTabIndex();
1964
- });
1965
-
1966
- container.on('disable', function () {
1967
- self.$search.prop('disabled', true);
1968
- });
1969
-
1970
- container.on('focus', function (evt) {
1971
- self.$search.trigger('focus');
1972
- });
1973
-
1974
- container.on('results:focus', function (params) {
1975
- self.$search.attr('aria-activedescendant', params.data._resultId);
1976
- });
1977
-
1978
- this.$selection.on('focusin', '.select2-search--inline', function (evt) {
1979
- self.trigger('focus', evt);
1980
- });
1981
-
1982
- this.$selection.on('focusout', '.select2-search--inline', function (evt) {
1983
- self._handleBlur(evt);
1984
- });
1985
-
1986
- this.$selection.on('keydown', '.select2-search--inline', function (evt) {
1987
- evt.stopPropagation();
1988
-
1989
- self.trigger('keypress', evt);
1990
-
1991
- self._keyUpPrevented = evt.isDefaultPrevented();
1992
-
1993
- var key = evt.which;
1994
-
1995
- if (key === KEYS.BACKSPACE && self.$search.val() === '') {
1996
- var $previousChoice = self.$searchContainer
1997
- .prev('.select2-selection__choice');
1998
-
1999
- if ($previousChoice.length > 0) {
2000
- var item = $previousChoice.data('data');
2001
-
2002
- self.searchRemoveChoice(item);
2003
-
2004
- evt.preventDefault();
2005
- }
2006
- } else if (evt.which === KEYS.ENTER) {
2007
- container.open();
2008
- evt.preventDefault();
2009
- }
2010
- });
2011
-
2012
- // Try to detect the IE version should the `documentMode` property that
2013
- // is stored on the document. This is only implemented in IE and is
2014
- // slightly cleaner than doing a user agent check.
2015
- // This property is not available in Edge, but Edge also doesn't have
2016
- // this bug.
2017
- var msie = document.documentMode;
2018
- var disableInputEvents = msie && msie <= 11;
2019
-
2020
- // Workaround for browsers which do not support the `input` event
2021
- // This will prevent double-triggering of events for browsers which support
2022
- // both the `keyup` and `input` events.
2023
- this.$selection.on(
2024
- 'input.searchcheck',
2025
- '.select2-search--inline',
2026
- function (evt) {
2027
- // IE will trigger the `input` event when a placeholder is used on a
2028
- // search box. To get around this issue, we are forced to ignore all
2029
- // `input` events in IE and keep using `keyup`.
2030
- if (disableInputEvents) {
2031
- self.$selection.off('input.search input.searchcheck');
2032
- return;
2033
- }
2034
-
2035
- // Unbind the duplicated `keyup` event
2036
- self.$selection.off('keyup.search');
2037
- }
2038
- );
2039
-
2040
- this.$selection.on(
2041
- 'keyup.search input.search',
2042
- '.select2-search--inline',
2043
- function (evt) {
2044
- // IE will trigger the `input` event when a placeholder is used on a
2045
- // search box. To get around this issue, we are forced to ignore all
2046
- // `input` events in IE and keep using `keyup`.
2047
- if (disableInputEvents && evt.type === 'input') {
2048
- self.$selection.off('input.search input.searchcheck');
2049
- return;
2050
- }
2051
-
2052
- var key = evt.which;
2053
-
2054
- // We can freely ignore events from modifier keys
2055
- if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
2056
- return;
2057
- }
2058
-
2059
- // Tabbing will be handled during the `keydown` phase
2060
- if (key == KEYS.TAB) {
2061
- return;
2062
- }
2063
-
2064
- self.handleSearch(evt);
2065
- }
2066
- );
2067
- };
2068
 
2069
- /**
2070
- * This method will transfer the tabindex attribute from the rendered
2071
- * selection to the search box. This allows for the search box to be used as
2072
- * the primary focus instead of the selection container.
2073
- *
2074
- * @private
2075
- */
2076
- Search.prototype._transferTabIndex = function (decorated) {
2077
- this.$search.attr('tabindex', this.$selection.attr('tabindex'));
2078
- this.$selection.attr('tabindex', '-1');
2079
- };
2080
 
2081
- Search.prototype.createPlaceholder = function (decorated, placeholder) {
2082
- this.$search.attr('placeholder', placeholder.text);
2083
- };
2084
 
2085
- Search.prototype.update = function (decorated, data) {
2086
- var searchHadFocus = this.$search[0] == document.activeElement;
2087
 
2088
- this.$search.attr('placeholder', '');
2089
 
2090
- decorated.call(this, data);
 
2091
 
2092
- this.$selection.find('.select2-selection__rendered')
2093
- .append(this.$searchContainer);
 
 
 
 
 
2094
 
2095
- this.resizeSearch();
2096
- if (searchHadFocus) {
2097
- this.$search.focus();
2098
- }
2099
- };
2100
 
2101
- Search.prototype.handleSearch = function () {
2102
- this.resizeSearch();
 
 
2103
 
2104
- if (!this._keyUpPrevented) {
2105
- var input = this.$search.val();
 
2106
 
2107
- this.trigger('query', {
2108
- term: input
2109
- });
2110
- }
2111
 
2112
- this._keyUpPrevented = false;
2113
- };
 
2114
 
2115
- Search.prototype.searchRemoveChoice = function (decorated, item) {
2116
- this.trigger('unselect', {
2117
- data: item
2118
- });
2119
 
2120
- this.$search.val(item.text);
2121
- this.handleSearch();
2122
- };
2123
 
2124
- Search.prototype.resizeSearch = function () {
2125
- this.$search.css('width', '25px');
2126
 
2127
- var width = '';
 
2128
 
2129
- if (this.$search.attr('placeholder') !== '') {
2130
- width = this.$selection.find('.select2-selection__rendered').innerWidth();
2131
- } else {
2132
- var minimumWidth = this.$search.val().length + 1;
 
 
 
2133
 
2134
- width = (minimumWidth * 0.75) + 'em';
2135
- }
2136
 
2137
- this.$search.css('width', width);
2138
- };
2139
 
2140
- return Search;
2141
- });
2142
 
2143
- S2.define('select2/selection/eventRelay',[
2144
- 'jquery'
2145
- ], function ($) {
2146
- function EventRelay () { }
2147
 
2148
- EventRelay.prototype.bind = function (decorated, container, $container) {
2149
- var self = this;
2150
- var relayEvents = [
2151
- 'open', 'opening',
2152
- 'close', 'closing',
2153
- 'select', 'selecting',
2154
- 'unselect', 'unselecting'
2155
- ];
2156
 
2157
- var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
 
2158
 
2159
- decorated.call(this, container, $container);
 
2160
 
2161
- container.on('*', function (name, params) {
2162
- // Ignore events that should not be relayed
2163
- if ($.inArray(name, relayEvents) === -1) {
2164
- return;
2165
- }
2166
 
2167
- // The parameters should always be an object
2168
- params = params || {};
 
 
2169
 
2170
- // Generate the jQuery event for the Select2 event
2171
- var evt = $.Event('select2:' + name, {
2172
- params: params
2173
- });
2174
 
2175
- self.$element.trigger(evt);
 
 
 
 
 
2176
 
2177
- // Only handle preventable events if it was one
2178
- if ($.inArray(name, preventableEvents) === -1) {
2179
- return;
2180
- }
2181
 
2182
- params.prevented = evt.isDefaultPrevented();
2183
- });
2184
- };
2185
 
2186
- return EventRelay;
2187
- });
2188
 
2189
- S2.define('select2/translation',[
2190
- 'jquery',
2191
- 'require'
2192
- ], function ($, require) {
2193
- function Translation (dict) {
2194
- this.dict = dict || {};
2195
- }
2196
 
2197
- Translation.prototype.all = function () {
2198
- return this.dict;
2199
- };
2200
-
2201
- Translation.prototype.get = function (key) {
2202
- return this.dict[key];
2203
- };
2204
-
2205
- Translation.prototype.extend = function (translation) {
2206
- this.dict = $.extend({}, translation.all(), this.dict);
2207
- };
2208
-
2209
- // Static functions
2210
-
2211
- Translation._cache = {};
2212
-
2213
- Translation.loadPath = function (path) {
2214
- if (!(path in Translation._cache)) {
2215
- var translations = require(path);
2216
-
2217
- Translation._cache[path] = translations;
2218
- }
2219
-
2220
- return new Translation(Translation._cache[path]);
2221
- };
2222
-
2223
- return Translation;
2224
- });
2225
-
2226
- S2.define('select2/diacritics',[
2227
-
2228
- ], function () {
2229
- var diacritics = {
2230
- '\u24B6': 'A',
2231
- '\uFF21': 'A',
2232
- '\u00C0': 'A',
2233
- '\u00C1': 'A',
2234
- '\u00C2': 'A',
2235
- '\u1EA6': 'A',
2236
- '\u1EA4': 'A',
2237
- '\u1EAA': 'A',
2238
- '\u1EA8': 'A',
2239
- '\u00C3': 'A',
2240
- '\u0100': 'A',
2241
- '\u0102': 'A',
2242
- '\u1EB0': 'A',
2243
- '\u1EAE': 'A',
2244
- '\u1EB4': 'A',
2245
- '\u1EB2': 'A',
2246
- '\u0226': 'A',
2247
- '\u01E0': 'A',
2248
- '\u00C4': 'A',
2249
- '\u01DE': 'A',
2250
- '\u1EA2': 'A',
2251
- '\u00C5': 'A',
2252
- '\u01FA': 'A',
2253
- '\u01CD': 'A',
2254
- '\u0200': 'A',
2255
- '\u0202': 'A',
2256
- '\u1EA0': 'A',
2257
- '\u1EAC': 'A',
2258
- '\u1EB6': 'A',
2259
- '\u1E00': 'A',
2260
- '\u0104': 'A',
2261
- '\u023A': 'A',
2262
- '\u2C6F': 'A',
2263
- '\uA732': 'AA',
2264
- '\u00C6': 'AE',
2265
- '\u01FC': 'AE',
2266
- '\u01E2': 'AE',
2267
- '\uA734': 'AO',
2268
- '\uA736': 'AU',
2269
- '\uA738': 'AV',
2270
- '\uA73A': 'AV',
2271
- '\uA73C': 'AY',
2272
- '\u24B7': 'B',
2273
- '\uFF22': 'B',
2274
- '\u1E02': 'B',
2275
- '\u1E04': 'B',
2276
- '\u1E06': 'B',
2277
- '\u0243': 'B',
2278
- '\u0182': 'B',
2279
- '\u0181': 'B',
2280
- '\u24B8': 'C',
2281
- '\uFF23': 'C',
2282
- '\u0106': 'C',
2283
- '\u0108': 'C',
2284
- '\u010A': 'C',
2285
- '\u010C': 'C',
2286
- '\u00C7': 'C',
2287
- '\u1E08': 'C',
2288
- '\u0187': 'C',
2289
- '\u023B': 'C',
2290
- '\uA73E': 'C',
2291
- '\u24B9': 'D',
2292
- '\uFF24': 'D',
2293
- '\u1E0A': 'D',
2294
- '\u010E': 'D',
2295
- '\u1E0C': 'D',
2296
- '\u1E10': 'D',
2297
- '\u1E12': 'D',
2298
- '\u1E0E': 'D',
2299
- '\u0110': 'D',
2300
- '\u018B': 'D',
2301
- '\u018A': 'D',
2302
- '\u0189': 'D',
2303
- '\uA779': 'D',
2304
- '\u01F1': 'DZ',
2305
- '\u01C4': 'DZ',
2306
- '\u01F2': 'Dz',
2307
- '\u01C5': 'Dz',
2308
- '\u24BA': 'E',
2309
- '\uFF25': 'E',
2310
- '\u00C8': 'E',
2311
- '\u00C9': 'E',
2312
- '\u00CA': 'E',
2313
- '\u1EC0': 'E',
2314
- '\u1EBE': 'E',
2315
- '\u1EC4': 'E',
2316
- '\u1EC2': 'E',
2317
- '\u1EBC': 'E',
2318
- '\u0112': 'E',
2319
- '\u1E14': 'E',
2320
- '\u1E16': 'E',
2321
- '\u0114': 'E',
2322
- '\u0116': 'E',
2323
- '\u00CB': 'E',
2324
- '\u1EBA': 'E',
2325
- '\u011A': 'E',
2326
- '\u0204': 'E',
2327
- '\u0206': 'E',
2328
- '\u1EB8': 'E',
2329
- '\u1EC6': 'E',
2330
- '\u0228': 'E',
2331
- '\u1E1C': 'E',
2332
- '\u0118': 'E',
2333
- '\u1E18': 'E',
2334
- '\u1E1A': 'E',
2335
- '\u0190': 'E',
2336
- '\u018E': 'E',
2337
- '\u24BB': 'F',
2338
- '\uFF26': 'F',
2339
- '\u1E1E': 'F',
2340
- '\u0191': 'F',
2341
- '\uA77B': 'F',
2342
- '\u24BC': 'G',
2343
- '\uFF27': 'G',
2344
- '\u01F4': 'G',
2345
- '\u011C': 'G',
2346
- '\u1E20': 'G',
2347
- '\u011E': 'G',
2348
- '\u0120': 'G',
2349
- '\u01E6': 'G',
2350
- '\u0122': 'G',
2351
- '\u01E4': 'G',
2352
- '\u0193': 'G',
2353
- '\uA7A0': 'G',
2354
- '\uA77D': 'G',
2355
- '\uA77E': 'G',
2356
- '\u24BD': 'H',
2357
- '\uFF28': 'H',
2358
- '\u0124': 'H',
2359
- '\u1E22': 'H',
2360
- '\u1E26': 'H',
2361
- '\u021E': 'H',
2362
- '\u1E24': 'H',
2363
- '\u1E28': 'H',
2364
- '\u1E2A': 'H',
2365
- '\u0126': 'H',
2366
- '\u2C67': 'H',
2367
- '\u2C75': 'H',
2368
- '\uA78D': 'H',
2369
- '\u24BE': 'I',
2370
- '\uFF29': 'I',
2371
- '\u00CC': 'I',
2372
- '\u00CD': 'I',
2373
- '\u00CE': 'I',
2374
- '\u0128': 'I',
2375
- '\u012A': 'I',
2376
- '\u012C': 'I',
2377
- '\u0130': 'I',
2378
- '\u00CF': 'I',
2379
- '\u1E2E': 'I',
2380
- '\u1EC8': 'I',
2381
- '\u01CF': 'I',
2382
- '\u0208': 'I',
2383
- '\u020A': 'I',
2384
- '\u1ECA': 'I',
2385
- '\u012E': 'I',
2386
- '\u1E2C': 'I',
2387
- '\u0197': 'I',
2388
- '\u24BF': 'J',
2389
- '\uFF2A': 'J',
2390
- '\u0134': 'J',
2391
- '\u0248': 'J',
2392
- '\u24C0': 'K',
2393
- '\uFF2B': 'K',
2394
- '\u1E30': 'K',
2395
- '\u01E8': 'K',
2396
- '\u1E32': 'K',
2397
- '\u0136': 'K',
2398
- '\u1E34': 'K',
2399
- '\u0198': 'K',
2400
- '\u2C69': 'K',
2401
- '\uA740': 'K',
2402
- '\uA742': 'K',
2403
- '\uA744': 'K',
2404
- '\uA7A2': 'K',
2405
- '\u24C1': 'L',
2406
- '\uFF2C': 'L',
2407
- '\u013F': 'L',
2408
- '\u0139': 'L',
2409
- '\u013D': 'L',
2410
- '\u1E36': 'L',
2411
- '\u1E38': 'L',
2412
- '\u013B': 'L',
2413
- '\u1E3C': 'L',
2414
- '\u1E3A': 'L',
2415
- '\u0141': 'L',
2416
- '\u023D': 'L',
2417
- '\u2C62': 'L',
2418
- '\u2C60': 'L',
2419
- '\uA748': 'L',
2420
- '\uA746': 'L',
2421
- '\uA780': 'L',
2422
- '\u01C7': 'LJ',
2423
- '\u01C8': 'Lj',
2424
- '\u24C2': 'M',
2425
- '\uFF2D': 'M',
2426
- '\u1E3E': 'M',
2427
- '\u1E40': 'M',
2428
- '\u1E42': 'M',
2429
- '\u2C6E': 'M',
2430
- '\u019C': 'M',
2431
- '\u24C3': 'N',
2432
- '\uFF2E': 'N',
2433
- '\u01F8': 'N',
2434
- '\u0143': 'N',
2435
- '\u00D1': 'N',
2436
- '\u1E44': 'N',
2437
- '\u0147': 'N',
2438
- '\u1E46': 'N',
2439
- '\u0145': 'N',
2440
- '\u1E4A': 'N',
2441
- '\u1E48': 'N',
2442
- '\u0220': 'N',
2443
- '\u019D': 'N',
2444
- '\uA790': 'N',
2445
- '\uA7A4': 'N',
2446
- '\u01CA': 'NJ',
2447
- '\u01CB': 'Nj',
2448
- '\u24C4': 'O',
2449
- '\uFF2F': 'O',
2450
- '\u00D2': 'O',
2451
- '\u00D3': 'O',
2452
- '\u00D4': 'O',
2453
- '\u1ED2': 'O',
2454
- '\u1ED0': 'O',
2455
- '\u1ED6': 'O',
2456
- '\u1ED4': 'O',
2457
- '\u00D5': 'O',
2458
- '\u1E4C': 'O',
2459
- '\u022C': 'O',
2460
- '\u1E4E': 'O',
2461
- '\u014C': 'O',
2462
- '\u1E50': 'O',
2463
- '\u1E52': 'O',
2464
- '\u014E': 'O',
2465
- '\u022E': 'O',
2466
- '\u0230': 'O',
2467
- '\u00D6': 'O',
2468
- '\u022A': 'O',
2469
- '\u1ECE': 'O',
2470
- '\u0150': 'O',
2471
- '\u01D1': 'O',
2472
- '\u020C': 'O',
2473
- '\u020E': 'O',
2474
- '\u01A0': 'O',
2475
- '\u1EDC': 'O',
2476
- '\u1EDA': 'O',
2477
- '\u1EE0': 'O',
2478
- '\u1EDE': 'O',
2479
- '\u1EE2': 'O',
2480
- '\u1ECC': 'O',
2481
- '\u1ED8': 'O',
2482
- '\u01EA': 'O',
2483
- '\u01EC': 'O',
2484
- '\u00D8': 'O',
2485
- '\u01FE': 'O',
2486
- '\u0186': 'O',
2487
- '\u019F': 'O',
2488
- '\uA74A': 'O',
2489
- '\uA74C': 'O',
2490
- '\u01A2': 'OI',
2491
- '\uA74E': 'OO',
2492
- '\u0222': 'OU',
2493
- '\u24C5': 'P',
2494
- '\uFF30': 'P',
2495
- '\u1E54': 'P',
2496
- '\u1E56': 'P',
2497
- '\u01A4': 'P',
2498
- '\u2C63': 'P',
2499
- '\uA750': 'P',
2500
- '\uA752': 'P',
2501
- '\uA754': 'P',
2502
- '\u24C6': 'Q',
2503
- '\uFF31': 'Q',
2504
- '\uA756': 'Q',
2505
- '\uA758': 'Q',
2506
- '\u024A': 'Q',
2507
- '\u24C7': 'R',
2508
- '\uFF32': 'R',
2509
- '\u0154': 'R',
2510
- '\u1E58': 'R',
2511
- '\u0158': 'R',
2512
- '\u0210': 'R',
2513
- '\u0212': 'R',
2514
- '\u1E5A': 'R',
2515
- '\u1E5C': 'R',
2516
- '\u0156': 'R',
2517
- '\u1E5E': 'R',
2518
- '\u024C': 'R',
2519
- '\u2C64': 'R',
2520
- '\uA75A': 'R',
2521
- '\uA7A6': 'R',
2522
- '\uA782': 'R',
2523
- '\u24C8': 'S',
2524
- '\uFF33': 'S',
2525
- '\u1E9E': 'S',
2526
- '\u015A': 'S',
2527
- '\u1E64': 'S',
2528
- '\u015C': 'S',
2529
- '\u1E60': 'S',
2530
- '\u0160': 'S',
2531
- '\u1E66': 'S',
2532
- '\u1E62': 'S',
2533
- '\u1E68': 'S',
2534
- '\u0218': 'S',
2535
- '\u015E': 'S',
2536
- '\u2C7E': 'S',
2537
- '\uA7A8': 'S',
2538
- '\uA784': 'S',
2539
- '\u24C9': 'T',
2540
- '\uFF34': 'T',
2541
- '\u1E6A': 'T',
2542
- '\u0164': 'T',
2543
- '\u1E6C': 'T',
2544
- '\u021A': 'T',
2545
- '\u0162': 'T',
2546
- '\u1E70': 'T',
2547
- '\u1E6E': 'T',
2548
- '\u0166': 'T',
2549
- '\u01AC': 'T',
2550
- '\u01AE': 'T',
2551
- '\u023E': 'T',
2552
- '\uA786': 'T',
2553
- '\uA728': 'TZ',
2554
- '\u24CA': 'U',
2555
- '\uFF35': 'U',
2556
- '\u00D9': 'U',
2557
- '\u00DA': 'U',
2558
- '\u00DB': 'U',
2559
- '\u0168': 'U',
2560
- '\u1E78': 'U',
2561
- '\u016A': 'U',
2562
- '\u1E7A': 'U',
2563
- '\u016C': 'U',
2564
- '\u00DC': 'U',
2565
- '\u01DB': 'U',
2566
- '\u01D7': 'U',
2567
- '\u01D5': 'U',
2568
- '\u01D9': 'U',
2569
- '\u1EE6': 'U',
2570
- '\u016E': 'U',
2571
- '\u0170': 'U',
2572
- '\u01D3': 'U',
2573
- '\u0214': 'U',
2574
- '\u0216': 'U',
2575
- '\u01AF': 'U',
2576
- '\u1EEA': 'U',
2577
- '\u1EE8': 'U',
2578
- '\u1EEE': 'U',
2579
- '\u1EEC': 'U',
2580
- '\u1EF0': 'U',
2581
- '\u1EE4': 'U',
2582
- '\u1E72': 'U',
2583
- '\u0172': 'U',
2584
- '\u1E76': 'U',
2585
- '\u1E74': 'U',
2586
- '\u0244': 'U',
2587
- '\u24CB': 'V',
2588
- '\uFF36': 'V',
2589
- '\u1E7C': 'V',
2590
- '\u1E7E': 'V',
2591
- '\u01B2': 'V',
2592
- '\uA75E': 'V',
2593
- '\u0245': 'V',
2594
- '\uA760': 'VY',
2595
- '\u24CC': 'W',
2596
- '\uFF37': 'W',
2597
- '\u1E80': 'W',
2598
- '\u1E82': 'W',
2599
- '\u0174': 'W',
2600
- '\u1E86': 'W',
2601
- '\u1E84': 'W',
2602
- '\u1E88': 'W',
2603
- '\u2C72': 'W',
2604
- '\u24CD': 'X',
2605
- '\uFF38': 'X',
2606
- '\u1E8A': 'X',
2607
- '\u1E8C': 'X',
2608
- '\u24CE': 'Y',
2609
- '\uFF39': 'Y',
2610
- '\u1EF2': 'Y',
2611
- '\u00DD': 'Y',
2612
- '\u0176': 'Y',
2613
- '\u1EF8': 'Y',
2614
- '\u0232': 'Y',
2615
- '\u1E8E': 'Y',
2616
- '\u0178': 'Y',
2617
- '\u1EF6': 'Y',
2618
- '\u1EF4': 'Y',
2619
- '\u01B3': 'Y',
2620
- '\u024E': 'Y',
2621
- '\u1EFE': 'Y',
2622
- '\u24CF': 'Z',
2623
- '\uFF3A': 'Z',
2624
- '\u0179': 'Z',
2625
- '\u1E90': 'Z',
2626
- '\u017B': 'Z',
2627
- '\u017D': 'Z',
2628
- '\u1E92': 'Z',
2629
- '\u1E94': 'Z',
2630
- '\u01B5': 'Z',
2631
- '\u0224': 'Z',
2632
- '\u2C7F': 'Z',
2633
- '\u2C6B': 'Z',
2634
- '\uA762': 'Z',
2635
- '\u24D0': 'a',
2636
- '\uFF41': 'a',
2637
- '\u1E9A': 'a',
2638
- '\u00E0': 'a',
2639
- '\u00E1': 'a',
2640
- '\u00E2': 'a',
2641
- '\u1EA7': 'a',
2642
- '\u1EA5': 'a',
2643
- '\u1EAB': 'a',
2644
- '\u1EA9': 'a',
2645
- '\u00E3': 'a',
2646
- '\u0101': 'a',
2647
- '\u0103': 'a',
2648
- '\u1EB1': 'a',
2649
- '\u1EAF': 'a',
2650
- '\u1EB5': 'a',
2651
- '\u1EB3': 'a',
2652
- '\u0227': 'a',
2653
- '\u01E1': 'a',
2654
- '\u00E4': 'a',
2655
- '\u01DF': 'a',
2656
- '\u1EA3': 'a',
2657
- '\u00E5': 'a',
2658
- '\u01FB': 'a',
2659
- '\u01CE': 'a',
2660
- '\u0201': 'a',
2661
- '\u0203': 'a',
2662
- '\u1EA1': 'a',
2663
- '\u1EAD': 'a',
2664
- '\u1EB7': 'a',
2665
- '\u1E01': 'a',
2666
- '\u0105': 'a',
2667
- '\u2C65': 'a',
2668
- '\u0250': 'a',
2669
- '\uA733': 'aa',
2670
- '\u00E6': 'ae',
2671
- '\u01FD': 'ae',
2672
- '\u01E3': 'ae',
2673
- '\uA735': 'ao',
2674
- '\uA737': 'au',
2675
- '\uA739': 'av',
2676
- '\uA73B': 'av',
2677
- '\uA73D': 'ay',
2678
- '\u24D1': 'b',
2679
- '\uFF42': 'b',
2680
- '\u1E03': 'b',
2681
- '\u1E05': 'b',
2682
- '\u1E07': 'b',
2683
- '\u0180': 'b',
2684
- '\u0183': 'b',
2685
- '\u0253': 'b',
2686
- '\u24D2': 'c',
2687
- '\uFF43': 'c',
2688
- '\u0107': 'c',
2689
- '\u0109': 'c',
2690
- '\u010B': 'c',
2691
- '\u010D': 'c',
2692
- '\u00E7': 'c',
2693
- '\u1E09': 'c',
2694
- '\u0188': 'c',
2695
- '\u023C': 'c',
2696
- '\uA73F': 'c',
2697
- '\u2184': 'c',
2698
- '\u24D3': 'd',
2699
- '\uFF44': 'd',
2700
- '\u1E0B': 'd',
2701
- '\u010F': 'd',
2702
- '\u1E0D': 'd',
2703
- '\u1E11': 'd',
2704
- '\u1E13': 'd',
2705
- '\u1E0F': 'd',
2706
- '\u0111': 'd',
2707
- '\u018C': 'd',
2708
- '\u0256': 'd',
2709
- '\u0257': 'd',
2710
- '\uA77A': 'd',
2711
- '\u01F3': 'dz',
2712
- '\u01C6': 'dz',
2713
- '\u24D4': 'e',
2714
- '\uFF45': 'e',
2715
- '\u00E8': 'e',
2716
- '\u00E9': 'e',
2717
- '\u00EA': 'e',
2718
- '\u1EC1': 'e',
2719
- '\u1EBF': 'e',
2720
- '\u1EC5': 'e',
2721
- '\u1EC3': 'e',
2722
- '\u1EBD': 'e',
2723
- '\u0113': 'e',
2724
- '\u1E15': 'e',
2725
- '\u1E17': 'e',
2726
- '\u0115': 'e',
2727
- '\u0117': 'e',
2728
- '\u00EB': 'e',
2729
- '\u1EBB': 'e',
2730
- '\u011B': 'e',
2731
- '\u0205': 'e',
2732
- '\u0207': 'e',
2733
- '\u1EB9': 'e',
2734
- '\u1EC7': 'e',
2735
- '\u0229': 'e',
2736
- '\u1E1D': 'e',
2737
- '\u0119': 'e',
2738
- '\u1E19': 'e',
2739
- '\u1E1B': 'e',
2740
- '\u0247': 'e',
2741
- '\u025B': 'e',
2742
- '\u01DD': 'e',
2743
- '\u24D5': 'f',
2744
- '\uFF46': 'f',
2745
- '\u1E1F': 'f',
2746
- '\u0192': 'f',
2747
- '\uA77C': 'f',
2748
- '\u24D6': 'g',
2749
- '\uFF47': 'g',
2750
- '\u01F5': 'g',
2751
- '\u011D': 'g',
2752
- '\u1E21': 'g',
2753
- '\u011F': 'g',
2754
- '\u0121': 'g',
2755
- '\u01E7': 'g',
2756
- '\u0123': 'g',
2757
- '\u01E5': 'g',
2758
- '\u0260': 'g',
2759
- '\uA7A1': 'g',
2760
- '\u1D79': 'g',
2761
- '\uA77F': 'g',
2762
- '\u24D7': 'h',
2763
- '\uFF48': 'h',
2764
- '\u0125': 'h',
2765
- '\u1E23': 'h',
2766
- '\u1E27': 'h',
2767
- '\u021F': 'h',
2768
- '\u1E25': 'h',
2769
- '\u1E29': 'h',
2770
- '\u1E2B': 'h',
2771
- '\u1E96': 'h',
2772
- '\u0127': 'h',
2773
- '\u2C68': 'h',
2774
- '\u2C76': 'h',
2775
- '\u0265': 'h',
2776
- '\u0195': 'hv',
2777
- '\u24D8': 'i',
2778
- '\uFF49': 'i',
2779
- '\u00EC': 'i',
2780
- '\u00ED': 'i',
2781
- '\u00EE': 'i',
2782
- '\u0129': 'i',
2783
- '\u012B': 'i',
2784
- '\u012D': 'i',
2785
- '\u00EF': 'i',
2786
- '\u1E2F': 'i',
2787
- '\u1EC9': 'i',
2788
- '\u01D0': 'i',
2789
- '\u0209': 'i',
2790
- '\u020B': 'i',
2791
- '\u1ECB': 'i',
2792
- '\u012F': 'i',
2793
- '\u1E2D': 'i',
2794
- '\u0268': 'i',
2795
- '\u0131': 'i',
2796
- '\u24D9': 'j',
2797
- '\uFF4A': 'j',
2798
- '\u0135': 'j',
2799
- '\u01F0': 'j',
2800
- '\u0249': 'j',
2801
- '\u24DA': 'k',
2802
- '\uFF4B': 'k',
2803
- '\u1E31': 'k',
2804
- '\u01E9': 'k',
2805
- '\u1E33': 'k',
2806
- '\u0137': 'k',
2807
- '\u1E35': 'k',
2808
- '\u0199': 'k',
2809
- '\u2C6A': 'k',
2810
- '\uA741': 'k',
2811
- '\uA743': 'k',
2812
- '\uA745': 'k',
2813
- '\uA7A3': 'k',
2814
- '\u24DB': 'l',
2815
- '\uFF4C': 'l',
2816
- '\u0140': 'l',
2817
- '\u013A': 'l',
2818
- '\u013E': 'l',
2819
- '\u1E37': 'l',
2820
- '\u1E39': 'l',
2821
- '\u013C': 'l',
2822
- '\u1E3D': 'l',
2823
- '\u1E3B': 'l',
2824
- '\u017F': 'l',
2825
- '\u0142': 'l',
2826
- '\u019A': 'l',
2827
- '\u026B': 'l',
2828
- '\u2C61': 'l',
2829
- '\uA749': 'l',
2830
- '\uA781': 'l',
2831
- '\uA747': 'l',
2832
- '\u01C9': 'lj',
2833
- '\u24DC': 'm',
2834
- '\uFF4D': 'm',
2835
- '\u1E3F': 'm',
2836
- '\u1E41': 'm',
2837
- '\u1E43': 'm',
2838
- '\u0271': 'm',
2839
- '\u026F': 'm',
2840
- '\u24DD': 'n',
2841
- '\uFF4E': 'n',
2842
- '\u01F9': 'n',
2843
- '\u0144': 'n',
2844
- '\u00F1': 'n',
2845
- '\u1E45': 'n',
2846
- '\u0148': 'n',
2847
- '\u1E47': 'n',
2848
- '\u0146': 'n',
2849
- '\u1E4B': 'n',
2850
- '\u1E49': 'n',
2851
- '\u019E': 'n',
2852
- '\u0272': 'n',
2853
- '\u0149': 'n',
2854
- '\uA791': 'n',
2855
- '\uA7A5': 'n',
2856
- '\u01CC': 'nj',
2857
- '\u24DE': 'o',
2858
- '\uFF4F': 'o',
2859
- '\u00F2': 'o',
2860
- '\u00F3': 'o',
2861
- '\u00F4': 'o',
2862
- '\u1ED3': 'o',
2863
- '\u1ED1': 'o',
2864
- '\u1ED7': 'o',
2865
- '\u1ED5': 'o',
2866
- '\u00F5': 'o',
2867
- '\u1E4D': 'o',
2868
- '\u022D': 'o',
2869
- '\u1E4F': 'o',
2870
- '\u014D': 'o',
2871
- '\u1E51': 'o',
2872
- '\u1E53': 'o',
2873
- '\u014F': 'o',
2874
- '\u022F': 'o',
2875
- '\u0231': 'o',
2876
- '\u00F6': 'o',
2877
- '\u022B': 'o',
2878
- '\u1ECF': 'o',
2879
- '\u0151': 'o',
2880
- '\u01D2': 'o',
2881
- '\u020D': 'o',
2882
- '\u020F': 'o',
2883
- '\u01A1': 'o',
2884
- '\u1EDD': 'o',
2885
- '\u1EDB': 'o',
2886
- '\u1EE1': 'o',
2887
- '\u1EDF': 'o',
2888
- '\u1EE3': 'o',
2889
- '\u1ECD': 'o',
2890
- '\u1ED9': 'o',
2891
- '\u01EB': 'o',
2892
- '\u01ED': 'o',
2893
- '\u00F8': 'o',
2894
- '\u01FF': 'o',
2895
- '\u0254': 'o',
2896
- '\uA74B': 'o',
2897
- '\uA74D': 'o',
2898
- '\u0275': 'o',
2899
- '\u01A3': 'oi',
2900
- '\u0223': 'ou',
2901
- '\uA74F': 'oo',
2902
- '\u24DF': 'p',
2903
- '\uFF50': 'p',
2904
- '\u1E55': 'p',
2905
- '\u1E57': 'p',
2906
- '\u01A5': 'p',
2907
- '\u1D7D': 'p',
2908
- '\uA751': 'p',
2909
- '\uA753': 'p',
2910
- '\uA755': 'p',
2911
- '\u24E0': 'q',
2912
- '\uFF51': 'q',
2913
- '\u024B': 'q',
2914
- '\uA757': 'q',
2915
- '\uA759': 'q',
2916
- '\u24E1': 'r',
2917
- '\uFF52': 'r',
2918
- '\u0155': 'r',
2919
- '\u1E59': 'r',
2920
- '\u0159': 'r',
2921
- '\u0211': 'r',
2922
- '\u0213': 'r',
2923
- '\u1E5B': 'r',
2924
- '\u1E5D': 'r',
2925
- '\u0157': 'r',
2926
- '\u1E5F': 'r',
2927
- '\u024D': 'r',
2928
- '\u027D': 'r',
2929
- '\uA75B': 'r',
2930
- '\uA7A7': 'r',
2931
- '\uA783': 'r',
2932
- '\u24E2': 's',
2933
- '\uFF53': 's',
2934
- '\u00DF': 's',
2935
- '\u015B': 's',
2936
- '\u1E65': 's',
2937
- '\u015D': 's',
2938
- '\u1E61': 's',
2939
- '\u0161': 's',
2940
- '\u1E67': 's',
2941
- '\u1E63': 's',
2942
- '\u1E69': 's',
2943
- '\u0219': 's',
2944
- '\u015F': 's',
2945
- '\u023F': 's',
2946
- '\uA7A9': 's',
2947
- '\uA785': 's',
2948
- '\u1E9B': 's',
2949
- '\u24E3': 't',
2950
- '\uFF54': 't',
2951
- '\u1E6B': 't',
2952
- '\u1E97': 't',
2953
- '\u0165': 't',
2954
- '\u1E6D': 't',
2955
- '\u021B': 't',
2956
- '\u0163': 't',
2957
- '\u1E71': 't',
2958
- '\u1E6F': 't',
2959
- '\u0167': 't',
2960
- '\u01AD': 't',
2961
- '\u0288': 't',
2962
- '\u2C66': 't',
2963
- '\uA787': 't',
2964
- '\uA729': 'tz',
2965
- '\u24E4': 'u',
2966
- '\uFF55': 'u',
2967
- '\u00F9': 'u',
2968
- '\u00FA': 'u',
2969
- '\u00FB': 'u',
2970
- '\u0169': 'u',
2971
- '\u1E79': 'u',
2972
- '\u016B': 'u',
2973
- '\u1E7B': 'u',
2974
- '\u016D': 'u',
2975
- '\u00FC': 'u',
2976
- '\u01DC': 'u',
2977
- '\u01D8': 'u',
2978
- '\u01D6': 'u',
2979
- '\u01DA': 'u',
2980
- '\u1EE7': 'u',
2981
- '\u016F': 'u',
2982
- '\u0171': 'u',
2983
- '\u01D4': 'u',
2984
- '\u0215': 'u',
2985
- '\u0217': 'u',
2986
- '\u01B0': 'u',
2987
- '\u1EEB': 'u',
2988
- '\u1EE9': 'u',
2989
- '\u1EEF': 'u',
2990
- '\u1EED': 'u',
2991
- '\u1EF1': 'u',
2992
- '\u1EE5': 'u',
2993
- '\u1E73': 'u',
2994
- '\u0173': 'u',
2995
- '\u1E77': 'u',
2996
- '\u1E75': 'u',
2997
- '\u0289': 'u',
2998
- '\u24E5': 'v',
2999
- '\uFF56': 'v',
3000
- '\u1E7D': 'v',
3001
- '\u1E7F': 'v',
3002
- '\u028B': 'v',
3003
- '\uA75F': 'v',
3004
- '\u028C': 'v',
3005
- '\uA761': 'vy',
3006
- '\u24E6': 'w',
3007
- '\uFF57': 'w',
3008
- '\u1E81': 'w',
3009
- '\u1E83': 'w',
3010
- '\u0175': 'w',
3011
- '\u1E87': 'w',
3012
- '\u1E85': 'w',
3013
- '\u1E98': 'w',
3014
- '\u1E89': 'w',
3015
- '\u2C73': 'w',
3016
- '\u24E7': 'x',
3017
- '\uFF58': 'x',
3018
- '\u1E8B': 'x',
3019
- '\u1E8D': 'x',
3020
- '\u24E8': 'y',
3021
- '\uFF59': 'y',
3022
- '\u1EF3': 'y',
3023
- '\u00FD': 'y',
3024
- '\u0177': 'y',
3025
- '\u1EF9': 'y',
3026
- '\u0233': 'y',
3027
- '\u1E8F': 'y',
3028
- '\u00FF': 'y',
3029
- '\u1EF7': 'y',
3030
- '\u1E99': 'y',
3031
- '\u1EF5': 'y',
3032
- '\u01B4': 'y',
3033
- '\u024F': 'y',
3034
- '\u1EFF': 'y',
3035
- '\u24E9': 'z',
3036
- '\uFF5A': 'z',
3037
- '\u017A': 'z',
3038
- '\u1E91': 'z',
3039
- '\u017C': 'z',
3040
- '\u017E': 'z',
3041
- '\u1E93': 'z',
3042
- '\u1E95': 'z',
3043
- '\u01B6': 'z',
3044
- '\u0225': 'z',
3045
- '\u0240': 'z',
3046
- '\u2C6C': 'z',
3047
- '\uA763': 'z',
3048
- '\u0386': '\u0391',
3049
- '\u0388': '\u0395',
3050
- '\u0389': '\u0397',
3051
- '\u038A': '\u0399',
3052
- '\u03AA': '\u0399',
3053
- '\u038C': '\u039F',
3054
- '\u038E': '\u03A5',
3055
- '\u03AB': '\u03A5',
3056
- '\u038F': '\u03A9',
3057
- '\u03AC': '\u03B1',
3058
- '\u03AD': '\u03B5',
3059
- '\u03AE': '\u03B7',
3060
- '\u03AF': '\u03B9',
3061
- '\u03CA': '\u03B9',
3062
- '\u0390': '\u03B9',
3063
- '\u03CC': '\u03BF',
3064
- '\u03CD': '\u03C5',
3065
- '\u03CB': '\u03C5',
3066
- '\u03B0': '\u03C5',
3067
- '\u03C9': '\u03C9',
3068
- '\u03C2': '\u03C3'
3069
- };
3070
-
3071
- return diacritics;
3072
- });
3073
-
3074
- S2.define('select2/data/base',[
3075
- '../utils'
3076
- ], function (Utils) {
3077
- function BaseAdapter ($element, options) {
3078
- BaseAdapter.__super__.constructor.call(this);
3079
- }
3080
 
3081
- Utils.Extend(BaseAdapter, Utils.Observable);
3082
-
3083
- BaseAdapter.prototype.current = function (callback) {
3084
- throw new Error('The `current` method must be defined in child classes.');
3085
- };
3086
-
3087
- BaseAdapter.prototype.query = function (params, callback) {
3088
- throw new Error('The `query` method must be defined in child classes.');
3089
- };
3090
-
3091
- BaseAdapter.prototype.bind = function (container, $container) {
3092
- // Can be implemented in subclasses
3093
- };
3094
-
3095
- BaseAdapter.prototype.destroy = function () {
3096
- // Can be implemented in subclasses
3097
- };
3098
-
3099
- BaseAdapter.prototype.generateResultId = function (container, data) {
3100
- var id = '';
3101
-
3102
- if (container != null) {
3103
- id += container.id
3104
- } else {
3105
- id += Utils.generateChars(4);
3106
- }
3107
-
3108
- id += '-result-';
3109
- id += Utils.generateChars(4);
3110
-
3111
- if (data.id != null) {
3112
- id += '-' + data.id.toString();
3113
- } else {
3114
- id += '-' + Utils.generateChars(4);
3115
- }
3116
- return id;
3117
- };
3118
-
3119
- return BaseAdapter;
3120
- });
3121
-
3122
- S2.define('select2/data/select',[
3123
- './base',
3124
- '../utils',
3125
- 'jquery'
3126
- ], function (BaseAdapter, Utils, $) {
3127
- function SelectAdapter ($element, options) {
3128
- this.$element = $element;
3129
- this.options = options;
3130
-
3131
- SelectAdapter.__super__.constructor.call(this);
3132
- }
3133
 
3134
- Utils.Extend(SelectAdapter, BaseAdapter);
3135
 
3136
- SelectAdapter.prototype.current = function (callback) {
3137
- var data = [];
3138
- var self = this;
3139
 
3140
- this.$element.find(':selected').each(function () {
3141
- var $option = $(this);
3142
 
3143
- var option = self.item($option);
 
3144
 
3145
- data.push(option);
3146
- });
3147
 
3148
- callback(data);
3149
- };
3150
 
3151
- SelectAdapter.prototype.select = function (data) {
3152
- var self = this;
 
 
 
 
 
3153
 
3154
- data.selected = true;
 
 
3155
 
3156
- // If data.element is a DOM node, use it instead
3157
- if ($(data.element).is('option')) {
3158
- data.element.selected = true;
 
3159
 
3160
- this.$element.trigger('change');
 
 
 
 
 
 
 
 
3161
 
3162
- return;
3163
- }
3164
 
3165
- if (this.$element.prop('multiple')) {
3166
- this.current(function (currentData) {
3167
- var val = [];
3168
 
3169
- data = [data];
3170
- data.push.apply(data, currentData);
3171
 
3172
- for (var d = 0; d < data.length; d++) {
3173
- var id = data[d].id;
 
3174
 
3175
- if ($.inArray(id, val) === -1) {
3176
- val.push(id);
3177
- }
3178
- }
3179
 
3180
- self.$element.val(val);
3181
- self.$element.trigger('change');
3182
- });
3183
- } else {
3184
- var val = data.id;
3185
 
3186
- this.$element.val(val);
3187
- this.$element.trigger('change');
3188
- }
3189
- };
3190
 
3191
- SelectAdapter.prototype.unselect = function (data) {
3192
- var self = this;
 
3193
 
3194
- if (!this.$element.prop('multiple')) {
3195
- return;
3196
- }
3197
 
3198
- data.selected = false;
 
 
3199
 
3200
- if ($(data.element).is('option')) {
3201
- data.element.selected = false;
 
3202
 
3203
- this.$element.trigger('change');
 
 
 
 
 
 
 
 
3204
 
3205
- return;
3206
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3207
 
3208
- this.current(function (currentData) {
3209
- var val = [];
3210
 
3211
- for (var d = 0; d < currentData.length; d++) {
3212
- var id = currentData[d].id;
 
 
 
3213
 
3214
- if (id !== data.id && $.inArray(id, val) === -1) {
3215
- val.push(id);
3216
- }
3217
- }
3218
 
3219
- self.$element.val(val);
 
 
3220
 
3221
- self.$element.trigger('change');
3222
- });
3223
- };
3224
 
3225
- SelectAdapter.prototype.bind = function (container, $container) {
3226
- var self = this;
 
3227
 
3228
- this.container = container;
3229
 
3230
- container.on('select', function (params) {
3231
- self.select(params.data);
3232
- });
 
3233
 
3234
- container.on('unselect', function (params) {
3235
- self.unselect(params.data);
3236
- });
3237
- };
3238
 
3239
- SelectAdapter.prototype.destroy = function () {
3240
- // Remove anything added to child elements
3241
- this.$element.find('*').each(function () {
3242
- // Remove any custom data set by Select2
3243
- $.removeData(this, 'data');
3244
- });
3245
- };
3246
 
3247
- SelectAdapter.prototype.query = function (params, callback) {
3248
- var data = [];
3249
- var self = this;
3250
 
3251
- var $options = this.$element.children();
3252
 
3253
- $options.each(function () {
3254
- var $option = $(this);
 
 
3255
 
3256
- if (!$option.is('option') && !$option.is('optgroup')) {
3257
- return;
3258
- }
3259
 
3260
- var option = self.item($option);
 
3261
 
3262
- var matches = self.matches(params, option);
 
 
 
 
 
3263
 
3264
- if (matches !== null) {
3265
- data.push(matches);
3266
- }
3267
- });
3268
 
3269
- callback({
3270
- results: data
3271
- });
3272
- };
3273
 
3274
- SelectAdapter.prototype.addOptions = function ($options) {
3275
- Utils.appendMany(this.$element, $options);
3276
- };
 
3277
 
3278
- SelectAdapter.prototype.option = function (data) {
3279
- var option;
3280
 
3281
- if (data.children) {
3282
- option = document.createElement('optgroup');
3283
- option.label = data.text;
3284
- } else {
3285
- option = document.createElement('option');
3286
 
3287
- if (option.textContent !== undefined) {
3288
- option.textContent = data.text;
3289
- } else {
3290
- option.innerText = data.text;
3291
- }
3292
- }
3293
 
3294
- if (data.id !== undefined) {
3295
- option.value = data.id;
3296
- }
3297
 
3298
- if (data.disabled) {
3299
- option.disabled = true;
3300
- }
3301
 
3302
- if (data.selected) {
3303
- option.selected = true;
3304
- }
3305
 
3306
- if (data.title) {
3307
- option.title = data.title;
3308
- }
3309
 
3310
- var $option = $(option);
3311
 
3312
- var normalizedData = this._normalizeItem(data);
3313
- normalizedData.element = option;
3314
 
3315
- // Override the option's data with the combined data
3316
- $.data(option, 'data', normalizedData);
3317
 
3318
- return $option;
3319
- };
3320
 
3321
- SelectAdapter.prototype.item = function ($option) {
3322
- var data = {};
 
3323
 
3324
- data = $.data($option[0], 'data');
 
 
 
 
3325
 
3326
- if (data != null) {
3327
- return data;
3328
- }
3329
 
3330
- if ($option.is('option')) {
3331
- data = {
3332
- id: $option.val(),
3333
- text: $option.text(),
3334
- disabled: $option.prop('disabled'),
3335
- selected: $option.prop('selected'),
3336
- title: $option.prop('title')
3337
- };
3338
- } else if ($option.is('optgroup')) {
3339
- data = {
3340
- text: $option.prop('label'),
3341
- children: [],
3342
- title: $option.prop('title')
3343
- };
3344
 
3345
- var $children = $option.children('option');
3346
- var children = [];
3347
 
3348
- for (var c = 0; c < $children.length; c++) {
3349
- var $child = $($children[c]);
 
 
3350
 
3351
- var child = this.item($child);
 
 
3352
 
3353
- children.push(child);
3354
- }
3355
 
3356
- data.children = children;
3357
- }
 
 
 
3358
 
3359
- data = this._normalizeItem(data);
3360
- data.element = $option[0];
 
3361
 
3362
- $.data($option[0], 'data', data);
 
3363
 
3364
- return data;
3365
- };
3366
 
3367
- SelectAdapter.prototype._normalizeItem = function (item) {
3368
- if (!$.isPlainObject(item)) {
3369
- item = {
3370
- id: item,
3371
- text: item
3372
- };
3373
- }
3374
 
3375
- item = $.extend({}, {
3376
- text: ''
3377
- }, item);
3378
 
3379
- var defaults = {
3380
- selected: false,
3381
- disabled: false
3382
- };
3383
 
3384
- if (item.id != null) {
3385
- item.id = item.id.toString();
3386
- }
 
 
3387
 
3388
- if (item.text != null) {
3389
- item.text = item.text.toString();
3390
- }
 
3391
 
3392
- if (item._resultId == null && item.id) {
3393
- item._resultId = this.generateResultId(this.container, item);
3394
- }
3395
 
3396
- return $.extend({}, defaults, item);
3397
- };
 
3398
 
3399
- SelectAdapter.prototype.matches = function (params, data) {
3400
- var matcher = this.options.get('matcher');
 
 
 
3401
 
3402
- return matcher(params, data);
3403
- };
3404
 
3405
- return SelectAdapter;
3406
- });
3407
 
3408
- S2.define('select2/data/array',[
3409
- './select',
3410
- '../utils',
3411
- 'jquery'
3412
- ], function (SelectAdapter, Utils, $) {
3413
- function ArrayAdapter ($element, options) {
3414
- var data = options.get('data') || [];
3415
 
3416
- ArrayAdapter.__super__.constructor.call(this, $element, options);
 
3417
 
3418
- this.addOptions(this.convertToOptions(data));
3419
- }
3420
 
3421
- Utils.Extend(ArrayAdapter, SelectAdapter);
 
 
 
3422
 
3423
- ArrayAdapter.prototype.select = function (data) {
3424
- var $option = this.$element.find('option').filter(function (i, elm) {
3425
- return elm.value == data.id.toString();
3426
- });
 
 
3427
 
3428
- if ($option.length === 0) {
3429
- $option = this.option(data);
3430
 
3431
- this.addOptions($option);
3432
- }
3433
 
3434
- ArrayAdapter.__super__.select.call(this, data);
3435
- };
3436
 
3437
- ArrayAdapter.prototype.convertToOptions = function (data) {
3438
- var self = this;
 
 
3439
 
3440
- var $existing = this.$element.find('option');
3441
- var existingIds = $existing.map(function () {
3442
- return self.item($(this)).id;
3443
- }).get();
3444
 
3445
- var $options = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3446
 
3447
- // Filter out all items except for the one passed in the argument
3448
- function onlyItem (item) {
3449
- return function () {
3450
- return $(this).val() == item.id;
3451
- };
3452
- }
3453
 
3454
- for (var d = 0; d < data.length; d++) {
3455
- var item = this._normalizeItem(data[d]);
3456
 
3457
- // Skip items which were pre-loaded, only merge the data
3458
- if ($.inArray(item.id, existingIds) >= 0) {
3459
- var $existingOption = $existing.filter(onlyItem(item));
3460
 
3461
- var existingData = this.item($existingOption);
3462
- var newData = $.extend(true, {}, item, existingData);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3463
 
3464
- var $newOption = this.option(newData);
 
 
 
 
 
 
3465
 
3466
- $existingOption.replaceWith($newOption);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3467
 
3468
- continue;
3469
- }
3470
 
3471
- var $option = this.option(item);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3472
 
3473
- if (item.children) {
3474
- var $children = this.convertToOptions(item.children);
3475
 
3476
- Utils.appendMany($option, $children);
3477
- }
3478
 
3479
- $options.push($option);
3480
- }
 
 
 
3481
 
3482
- return $options;
3483
- };
3484
 
3485
- return ArrayAdapter;
3486
- });
 
3487
 
3488
- S2.define('select2/data/ajax',[
3489
- './array',
3490
- '../utils',
3491
- 'jquery'
3492
- ], function (ArrayAdapter, Utils, $) {
3493
- function AjaxAdapter ($element, options) {
3494
- this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3495
 
3496
- if (this.ajaxOptions.processResults != null) {
3497
- this.processResults = this.ajaxOptions.processResults;
3498
- }
3499
 
3500
- AjaxAdapter.__super__.constructor.call(this, $element, options);
3501
- }
 
 
3502
 
3503
- Utils.Extend(AjaxAdapter, ArrayAdapter);
3504
-
3505
- AjaxAdapter.prototype._applyDefaults = function (options) {
3506
- var defaults = {
3507
- data: function (params) {
3508
- return $.extend({}, params, {
3509
- q: params.term
3510
- });
3511
- },
3512
- transport: function (params, success, failure) {
3513
- var $request = $.ajax(params);
3514
-
3515
- $request.then(success);
3516
- $request.fail(failure);
3517
-
3518
- return $request;
3519
- }
3520
- };
3521
-
3522
- return $.extend({}, defaults, options, true);
3523
- };
3524
-
3525
- AjaxAdapter.prototype.processResults = function (results) {
3526
- return results;
3527
- };
3528
-
3529
- AjaxAdapter.prototype.query = function (params, callback) {
3530
- var matches = [];
3531
- var self = this;
3532
-
3533
- if (this._request != null) {
3534
- // JSONP requests cannot always be aborted
3535
- if ($.isFunction(this._request.abort)) {
3536
- this._request.abort();
3537
- }
3538
-
3539
- this._request = null;
3540
- }
3541
-
3542
- var options = $.extend({
3543
- type: 'GET'
3544
- }, this.ajaxOptions);
3545
-
3546
- if (typeof options.url === 'function') {
3547
- options.url = options.url.call(this.$element, params);
3548
- }
3549
-
3550
- if (typeof options.data === 'function') {
3551
- options.data = options.data.call(this.$element, params);
3552
- }
3553
-
3554
- function request () {
3555
- var $request = options.transport(options, function (data) {
3556
- var results = self.processResults(data, params);
3557
-
3558
- if (self.options.get('debug') && window.console && console.error) {
3559
- // Check to make sure that the response included a `results` key.
3560
- if (!results || !results.results || !$.isArray(results.results)) {
3561
- console.error(
3562
- 'Select2: The AJAX results did not return an array in the ' +
3563
- '`results` key of the response.'
3564
- );
3565
- }
3566
- }
3567
-
3568
- callback(results);
3569
- self.container.focusOnActiveElement();
3570
- }, function () {
3571
- // Attempt to detect if a request was aborted
3572
- // Only works if the transport exposes a status property
3573
- if ($request.status && $request.status === '0') {
3574
- return;
3575
- }
3576
-
3577
- self.trigger('results:message', {
3578
- message: 'errorLoading'
3579
- });
3580
- });
3581
-
3582
- self._request = $request;
3583
- }
3584
-
3585
- if (this.ajaxOptions.delay && params.term != null) {
3586
- if (this._queryTimeout) {
3587
- window.clearTimeout(this._queryTimeout);
3588
- }
3589
-
3590
- this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3591
- } else {
3592
- request();
3593
- }
3594
- };
3595
-
3596
- return AjaxAdapter;
3597
- });
3598
-
3599
- S2.define('select2/data/tags',[
3600
- 'jquery'
3601
- ], function ($) {
3602
- function Tags (decorated, $element, options) {
3603
- var tags = options.get('tags');
3604
-
3605
- var createTag = options.get('createTag');
3606
-
3607
- if (createTag !== undefined) {
3608
- this.createTag = createTag;
3609
- }
3610
-
3611
- var insertTag = options.get('insertTag');
3612
-
3613
- if (insertTag !== undefined) {
3614
- this.insertTag = insertTag;
3615
- }
3616
-
3617
- decorated.call(this, $element, options);
3618
-
3619
- if ($.isArray(tags)) {
3620
- for (var t = 0; t < tags.length; t++) {
3621
- var tag = tags[t];
3622
- var item = this._normalizeItem(tag);
3623
-
3624
- var $option = this.option(item);
3625
-
3626
- this.$element.append($option);
3627
- }
3628
- }
3629
- }
3630
 
3631
- Tags.prototype.query = function (decorated, params, callback) {
3632
- var self = this;
3633
 
3634
- this._removeOldTags();
 
 
 
3635
 
3636
- if (params.term == null || params.page != null) {
3637
- decorated.call(this, params, callback);
3638
- return;
3639
- }
3640
 
3641
- function wrapper (obj, child) {
3642
- var data = obj.results;
 
 
 
3643
 
3644
- for (var i = 0; i < data.length; i++) {
3645
- var option = data[i];
 
3646
 
3647
- var checkChildren = (
3648
- option.children != null &&
3649
- !wrapper({
3650
- results: option.children
3651
- }, true)
3652
- );
3653
 
3654
- var optionText = (option.text || '').toUpperCase();
3655
- var paramsTerm = (params.term || '').toUpperCase();
 
 
 
3656
 
3657
- var checkText = optionText === paramsTerm;
 
3658
 
3659
- if (checkText || checkChildren) {
3660
- if (child) {
3661
- return false;
3662
- }
3663
 
3664
- obj.data = data;
3665
- callback(obj);
3666
 
3667
- return;
3668
- }
3669
- }
3670
 
3671
- if (child) {
3672
- return true;
3673
- }
3674
 
3675
- var tag = self.createTag(params);
 
 
 
 
 
3676
 
3677
- if (tag != null) {
3678
- var $option = self.option(tag);
3679
- $option.attr('data-select2-tag', true);
3680
 
3681
- self.addOptions([$option]);
3682
 
3683
- self.insertTag(data, tag);
3684
- }
3685
 
3686
- obj.results = data;
 
3687
 
3688
- callback(obj);
3689
- }
 
 
 
 
3690
 
3691
- decorated.call(this, params, wrapper);
3692
- };
3693
 
3694
- Tags.prototype.createTag = function (decorated, params) {
3695
- var term = $.trim(params.term);
3696
 
3697
- if (term === '') {
3698
- return null;
3699
- }
3700
 
3701
- return {
3702
- id: term,
3703
- text: term
3704
- };
3705
- };
3706
 
3707
- Tags.prototype.insertTag = function (_, data, tag) {
3708
- data.unshift(tag);
3709
- };
3710
 
3711
- Tags.prototype._removeOldTags = function (_) {
3712
- var tag = this._lastTag;
3713
 
3714
- var $options = this.$element.find('option[data-select2-tag]');
 
 
 
3715
 
3716
- $options.each(function () {
3717
- if (this.selected) {
3718
- return;
3719
- }
 
 
3720
 
3721
- $(this).remove();
3722
- });
3723
- };
 
3724
 
3725
- return Tags;
3726
- });
 
 
3727
 
3728
- S2.define('select2/data/tokenizer',[
3729
- 'jquery'
3730
- ], function ($) {
3731
- function Tokenizer (decorated, $element, options) {
3732
- var tokenizer = options.get('tokenizer');
3733
 
3734
- if (tokenizer !== undefined) {
3735
- this.tokenizer = tokenizer;
3736
- }
3737
 
3738
- decorated.call(this, $element, options);
3739
- }
 
3740
 
3741
- Tokenizer.prototype.bind = function (decorated, container, $container) {
3742
- decorated.call(this, container, $container);
3743
 
3744
- this.$search = container.dropdown.$search || container.selection.$search ||
3745
- $container.find('.select2-search__field');
3746
- };
 
3747
 
3748
- Tokenizer.prototype.query = function (decorated, params, callback) {
3749
- var self = this;
3750
 
3751
- function createAndSelect (data) {
3752
- // Normalize the data object so we can use it for checks
3753
- var item = self._normalizeItem(data);
3754
 
3755
- // Check if the data object already exists as a tag
3756
- // Select it if it doesn't
3757
- var $existingOptions = self.$element.find('option').filter(function () {
3758
- return $(this).val() === item.id;
3759
- });
3760
 
3761
- // If an existing option wasn't found for it, create the option
3762
- if (!$existingOptions.length) {
3763
- var $option = self.option(item);
3764
- $option.attr('data-select2-tag', true);
3765
 
3766
- self._removeOldTags();
3767
- self.addOptions([$option]);
3768
- }
3769
 
3770
- // Select the item, now that we know there is an option for it
3771
- select(item);
3772
- }
3773
 
3774
- function select (data) {
3775
- self.trigger('select', {
3776
- data: data
3777
- });
3778
- }
3779
 
3780
- params.term = params.term || '';
 
 
3781
 
3782
- var tokenData = this.tokenizer(params, this.options, createAndSelect);
 
 
 
 
 
 
3783
 
3784
- if (tokenData.term !== params.term) {
3785
- // Replace the search term if we have the search box
3786
- if (this.$search.length) {
3787
- this.$search.val(tokenData.term);
3788
- this.$search.focus();
3789
- }
3790
 
3791
- params.term = tokenData.term;
3792
- }
 
 
 
 
3793
 
3794
- decorated.call(this, params, callback);
3795
- };
 
 
 
3796
 
3797
- Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3798
- var separators = options.get('tokenSeparators') || [];
3799
- var term = params.term;
3800
- var i = 0;
 
 
 
 
3801
 
3802
- var createTag = this.createTag || function (params) {
3803
- return {
3804
- id: params.term,
3805
- text: params.term
3806
- };
3807
- };
3808
 
3809
- while (i < term.length) {
3810
- var termChar = term[i];
3811
 
3812
- if ($.inArray(termChar, separators) === -1) {
3813
- i++;
3814
 
3815
- continue;
3816
- }
3817
 
3818
- var part = term.substr(0, i);
3819
- var partParams = $.extend({}, params, {
3820
- term: part
3821
- });
3822
 
3823
- var data = createTag(partParams);
 
3824
 
3825
- if (data == null) {
3826
- i++;
3827
- continue;
3828
- }
3829
 
3830
- callback(data);
 
 
 
3831
 
3832
- // Reset the term to not include the tokenized portion
3833
- term = term.substr(i + 1) || '';
3834
- i = 0;
3835
- }
3836
 
3837
- return {
3838
- term: term
3839
- };
3840
- };
3841
 
3842
- return Tokenizer;
3843
- });
3844
 
3845
- S2.define('select2/data/minimumInputLength',[
 
 
 
 
3846
 
3847
- ], function () {
3848
- function MinimumInputLength (decorated, $e, options) {
3849
- this.minimumInputLength = options.get('minimumInputLength');
3850
 
3851
- decorated.call(this, $e, options);
3852
- }
3853
 
3854
- MinimumInputLength.prototype.query = function (decorated, params, callback) {
3855
- params.term = params.term || '';
 
3856
 
3857
- if (params.term.length < this.minimumInputLength) {
3858
- this.trigger('results:message', {
3859
- message: 'inputTooShort',
3860
- args: {
3861
- minimum: this.minimumInputLength,
3862
- input: params.term,
3863
- params: params
3864
- }
3865
- });
3866
 
3867
- return;
3868
- }
 
 
3869
 
3870
- decorated.call(this, params, callback);
3871
- };
 
 
 
 
 
 
3872
 
3873
- return MinimumInputLength;
3874
- });
3875
 
3876
- S2.define('select2/data/maximumInputLength',[
 
 
 
3877
 
3878
- ], function () {
3879
- function MaximumInputLength (decorated, $e, options) {
3880
- this.maximumInputLength = options.get('maximumInputLength');
 
 
3881
 
3882
- decorated.call(this, $e, options);
3883
- }
3884
 
3885
- MaximumInputLength.prototype.query = function (decorated, params, callback) {
3886
- params.term = params.term || '';
3887
 
3888
- if (this.maximumInputLength > 0 &&
3889
- params.term.length > this.maximumInputLength) {
3890
- this.trigger('results:message', {
3891
- message: 'inputTooLong',
3892
- args: {
3893
- maximum: this.maximumInputLength,
3894
- input: params.term,
3895
- params: params
3896
- }
3897
- });
3898
 
3899
- return;
3900
- }
3901
 
3902
- decorated.call(this, params, callback);
3903
- };
3904
 
3905
- return MaximumInputLength;
3906
- });
 
3907
 
3908
- S2.define('select2/data/maximumSelectionLength',[
 
3909
 
3910
- ], function (){
3911
- function MaximumSelectionLength (decorated, $e, options) {
3912
- this.maximumSelectionLength = options.get('maximumSelectionLength');
 
 
 
3913
 
3914
- decorated.call(this, $e, options);
3915
- }
3916
 
3917
- MaximumSelectionLength.prototype.query =
3918
- function (decorated, params, callback) {
3919
- var self = this;
3920
-
3921
- this.current(function (currentData) {
3922
- var count = currentData != null ? currentData.length : 0;
3923
- if (self.maximumSelectionLength > 0 &&
3924
- count >= self.maximumSelectionLength) {
3925
- self.trigger('results:message', {
3926
- message: 'maximumSelected',
3927
- args: {
3928
- maximum: self.maximumSelectionLength
3929
- }
3930
- });
3931
- return;
3932
- }
3933
- decorated.call(self, params, callback);
3934
- });
3935
- };
3936
-
3937
- return MaximumSelectionLength;
3938
- });
3939
-
3940
- S2.define('select2/dropdown',[
3941
- 'jquery',
3942
- './utils'
3943
- ], function ($, Utils) {
3944
- function Dropdown ($element, options) {
3945
- this.$element = $element;
3946
- this.options = options;
3947
-
3948
- Dropdown.__super__.constructor.call(this);
3949
- }
3950
 
3951
- Utils.Extend(Dropdown, Utils.Observable);
 
 
3952
 
3953
- Dropdown.prototype.render = function () {
3954
- var $dropdown = $(
3955
- '<span class="select2-dropdown">' +
3956
- '<span class="select2-results"></span>' +
3957
- '</span>'
3958
- );
3959
 
3960
- $dropdown.attr('dir', this.options.get('dir'));
3961
-
3962
- this.$dropdown = $dropdown;
3963
-
3964
- return $dropdown;
3965
- };
3966
-
3967
- Dropdown.prototype.bind = function () {
3968
- // Should be implemented in subclasses
3969
- };
3970
-
3971
- Dropdown.prototype.position = function ($dropdown, $container) {
3972
- // Should be implmented in subclasses
3973
- };
3974
-
3975
- Dropdown.prototype.destroy = function () {
3976
- // Remove the dropdown from the DOM
3977
- this.$dropdown.remove();
3978
- };
3979
-
3980
- return Dropdown;
3981
- });
3982
-
3983
- S2.define('select2/dropdown/search',[
3984
- 'jquery',
3985
- '../utils'
3986
- ], function ($, Utils) {
3987
- function Search () { }
3988
-
3989
- Search.prototype.render = function (decorated) {
3990
- var $rendered = decorated.call(this);
3991
-
3992
- var $search = $(
3993
- '<span class="select2-search select2-search--dropdown">' +
3994
- '<input class="select2-search__field" type="text" tabindex="-1"' +
3995
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
3996
- ' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
3997
- '</span>'
3998
- );
3999
-
4000
- this.$searchContainer = $search;
4001
- this.$search = $search.find('input');
4002
-
4003
- $rendered.prepend($search);
4004
-
4005
- return $rendered;
4006
- };
4007
-
4008
- Search.prototype.bind = function (decorated, container, $container) {
4009
- var self = this;
4010
- var resultsId = container.id + '-results';
4011
-
4012
- decorated.call(this, container, $container);
4013
-
4014
- this.$search.on('keydown', function (evt) {
4015
- self.trigger('keypress', evt);
4016
-
4017
- self._keyUpPrevented = evt.isDefaultPrevented();
4018
- });
4019
-
4020
- // Workaround for browsers which do not support the `input` event
4021
- // This will prevent double-triggering of events for browsers which support
4022
- // both the `keyup` and `input` events.
4023
- this.$search.on('input', function (evt) {
4024
- // Unbind the duplicated `keyup` event
4025
- $(this).off('keyup');
4026
- });
4027
-
4028
- this.$search.on('keyup input', function (evt) {
4029
- self.handleSearch(evt);
4030
- });
4031
-
4032
- container.on('open', function () {
4033
- self.$search.attr('tabindex', 0);
4034
- self.$search.attr('aria-owns', resultsId);
4035
- self.$search.focus();
4036
-
4037
- window.setTimeout(function () {
4038
- self.$search.focus();
4039
- }, 0);
4040
- });
4041
-
4042
- container.on('close', function () {
4043
- self.$search.attr('tabindex', -1);
4044
- self.$search.removeAttr('aria-activedescendant');
4045
- self.$search.removeAttr('aria-owns');
4046
- self.$search.val('');
4047
- });
4048
-
4049
- container.on('focus', function () {
4050
- if (container.isOpen()) {
4051
- self.$search.focus();
4052
- }
4053
- });
4054
-
4055
- container.on('results:all', function (params) {
4056
- if (params.query.term == null || params.query.term === '') {
4057
- var showSearch = self.showSearch(params);
4058
-
4059
- if (showSearch) {
4060
- self.$searchContainer.removeClass('select2-search--hide');
4061
- } else {
4062
- self.$searchContainer.addClass('select2-search--hide');
4063
- }
4064
- }
4065
- });
4066
-
4067
- container.on('results:focus', function (params) {
4068
- self.$search.attr('aria-activedescendant', params.data._resultId);
4069
- });
4070
- };
4071
-
4072
- Search.prototype.handleSearch = function (evt) {
4073
- if (!this._keyUpPrevented) {
4074
- var input = this.$search.val();
4075
-
4076
- this.trigger('query', {
4077
- term: input
4078
- });
4079
- }
4080
-
4081
- this._keyUpPrevented = false;
4082
- };
4083
-
4084
- Search.prototype.showSearch = function (_, params) {
4085
- return true;
4086
- };
4087
-
4088
- return Search;
4089
- });
4090
-
4091
- S2.define('select2/dropdown/hidePlaceholder',[
4092
-
4093
- ], function () {
4094
- function HidePlaceholder (decorated, $element, options, dataAdapter) {
4095
- this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4096
-
4097
- decorated.call(this, $element, options, dataAdapter);
4098
- }
4099
 
4100
- HidePlaceholder.prototype.append = function (decorated, data) {
4101
- data.results = this.removePlaceholder(data.results);
4102
 
4103
- decorated.call(this, data);
4104
- };
4105
 
4106
- HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
4107
- if (typeof placeholder === 'string') {
4108
- placeholder = {
4109
- id: '',
4110
- text: placeholder
4111
- };
4112
- }
4113
 
4114
- return placeholder;
4115
- };
4116
 
4117
- HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4118
- var modifiedData = data.slice(0);
4119
 
4120
- for (var d = data.length - 1; d >= 0; d--) {
4121
- var item = data[d];
4122
 
4123
- if (this.placeholder.id === item.id) {
4124
- modifiedData.splice(d, 1);
4125
- }
4126
- }
 
 
 
 
4127
 
4128
- return modifiedData;
4129
- };
 
 
 
 
 
 
 
 
 
 
 
4130
 
4131
- return HidePlaceholder;
4132
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4133
 
4134
- S2.define('select2/dropdown/infiniteScroll',[
4135
- 'jquery'
4136
- ], function ($) {
4137
- function InfiniteScroll (decorated, $element, options, dataAdapter) {
4138
- this.lastParams = {};
4139
 
4140
- decorated.call(this, $element, options, dataAdapter);
4141
 
4142
- this.$loadingMore = this.createLoadingMore();
4143
- this.loading = false;
4144
- }
 
 
 
 
4145
 
4146
- InfiniteScroll.prototype.append = function (decorated, data) {
4147
- this.$loadingMore.remove();
4148
- this.loading = false;
4149
 
4150
- decorated.call(this, data);
4151
 
4152
- if (this.showLoadingMore(data)) {
4153
- this.$results.append(this.$loadingMore);
4154
- }
4155
- };
 
 
 
 
 
 
 
4156
 
4157
- InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4158
- var self = this;
4159
 
4160
- decorated.call(this, container, $container);
 
 
4161
 
4162
- container.on('query', function (params) {
4163
- self.lastParams = params;
4164
- self.loading = true;
4165
- });
4166
 
4167
- container.on('query:append', function (params) {
4168
- self.lastParams = params;
4169
- self.loading = true;
4170
- });
4171
 
4172
- this.$results.on('scroll', function () {
4173
- var isLoadMoreVisible = $.contains(
4174
- document.documentElement,
4175
- self.$loadingMore[0]
4176
- );
 
 
 
 
 
4177
 
4178
- if (self.loading || !isLoadMoreVisible) {
4179
- return;
4180
- }
4181
 
4182
- var currentOffset = self.$results.offset().top +
4183
- self.$results.outerHeight(false);
4184
- var loadingMoreOffset = self.$loadingMore.offset().top +
4185
- self.$loadingMore.outerHeight(false);
4186
 
4187
- if (currentOffset + 50 >= loadingMoreOffset) {
4188
- self.loadMore();
4189
- }
4190
- });
4191
- };
4192
 
4193
- InfiniteScroll.prototype.loadMore = function () {
4194
- this.loading = true;
4195
 
4196
- var params = $.extend({}, {page: 1}, this.lastParams);
4197
 
4198
- params.page++;
4199
 
4200
- this.trigger('query:append', params);
4201
- };
 
4202
 
4203
- InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4204
- return data.pagination && data.pagination.more;
4205
- };
4206
 
4207
- InfiniteScroll.prototype.createLoadingMore = function () {
4208
- var $option = $(
4209
- '<li ' +
4210
- 'class="select2-results__option select2-results__option--load-more"' +
4211
- 'role="option" aria-disabled="true"></li>'
4212
- );
4213
 
4214
- var message = this.options.get('translations').get('loadingMore');
4215
 
4216
- $option.html(message(this.lastParams));
4217
 
4218
- return $option;
4219
- };
 
4220
 
4221
- return InfiniteScroll;
4222
- });
4223
 
4224
- S2.define('select2/dropdown/attachBody',[
4225
- 'jquery',
4226
- '../utils'
4227
- ], function ($, Utils) {
4228
- function AttachBody (decorated, $element, options) {
4229
- this.$dropdownParent = options.get('dropdownParent') || $(document.body);
4230
 
4231
- decorated.call(this, $element, options);
4232
- }
4233
 
4234
- AttachBody.prototype.bind = function (decorated, container, $container) {
4235
- var self = this;
 
4236
 
4237
- var setupResultsEvents = false;
4238
 
4239
- decorated.call(this, container, $container);
4240
 
4241
- container.on('open', function () {
4242
- self._showDropdown();
4243
- self._attachPositioningHandler(container);
4244
 
4245
- if (!setupResultsEvents) {
4246
- setupResultsEvents = true;
4247
 
4248
- container.on('results:all', function () {
4249
- self._positionDropdown();
4250
- self._resizeDropdown();
4251
- });
4252
 
4253
- container.on('results:append', function () {
4254
- self._positionDropdown();
4255
- self._resizeDropdown();
4256
- });
4257
- }
4258
- });
4259
 
4260
- container.on('close', function () {
4261
- self._hideDropdown();
4262
- self._detachPositioningHandler(container);
4263
- });
 
 
4264
 
4265
- this.$dropdownContainer.on('mousedown', function (evt) {
4266
- evt.stopPropagation();
4267
- });
4268
- };
4269
 
4270
- AttachBody.prototype.destroy = function (decorated) {
4271
- decorated.call(this);
4272
 
4273
- this.$dropdownContainer.remove();
4274
- };
4275
 
4276
- AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4277
- // Clone all of the container classes
4278
- $dropdown.attr('class', $container.attr('class'));
4279
 
4280
- $dropdown.removeClass('select2');
4281
- $dropdown.addClass('select2-container--open');
4282
 
4283
- $dropdown.css({
4284
- position: 'absolute',
4285
- top: -999999
4286
- });
 
 
 
4287
 
4288
- this.$container = $container;
4289
- };
4290
 
4291
- AttachBody.prototype.render = function (decorated) {
4292
- var $container = $('<span></span>');
4293
-
4294
- var $dropdown = decorated.call(this);
4295
- $container.append($dropdown);
4296
-
4297
- this.$dropdownContainer = $container;
4298
-
4299
- return $container;
4300
- };
4301
-
4302
- AttachBody.prototype._hideDropdown = function (decorated) {
4303
- this.$dropdownContainer.detach();
4304
- };
4305
-
4306
- AttachBody.prototype._attachPositioningHandler =
4307
- function (decorated, container) {
4308
- var self = this;
4309
-
4310
- var scrollEvent = 'scroll.select2.' + container.id;
4311
- var resizeEvent = 'resize.select2.' + container.id;
4312
- var orientationEvent = 'orientationchange.select2.' + container.id;
4313
-
4314
- var $watchers = this.$container.parents().filter(Utils.hasScroll);
4315
- $watchers.each(function () {
4316
- $(this).data('select2-scroll-position', {
4317
- x: $(this).scrollLeft(),
4318
- y: $(this).scrollTop()
4319
- });
4320
- });
4321
-
4322
- $watchers.on(scrollEvent, function (ev) {
4323
- var position = $(this).data('select2-scroll-position');
4324
- $(this).scrollTop(position.y);
4325
- });
4326
-
4327
- $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4328
- function (e) {
4329
- self._positionDropdown();
4330
- self._resizeDropdown();
4331
- });
4332
- };
4333
-
4334
- AttachBody.prototype._detachPositioningHandler =
4335
- function (decorated, container) {
4336
- var scrollEvent = 'scroll.select2.' + container.id;
4337
- var resizeEvent = 'resize.select2.' + container.id;
4338
- var orientationEvent = 'orientationchange.select2.' + container.id;
4339
-
4340
- var $watchers = this.$container.parents().filter(Utils.hasScroll);
4341
- $watchers.off(scrollEvent);
4342
-
4343
- $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4344
- };
4345
-
4346
- AttachBody.prototype._positionDropdown = function () {
4347
- var $window = $(window);
4348
-
4349
- var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4350
- var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
4351
-
4352
- var newDirection = null;
4353
-
4354
- var offset = this.$container.offset();
4355
-
4356
- offset.bottom = offset.top + this.$container.outerHeight(false);
4357
-
4358
- var container = {
4359
- height: this.$container.outerHeight(false)
4360
- };
4361
-
4362
- container.top = offset.top;
4363
- container.bottom = offset.top + container.height;
4364
-
4365
- var dropdown = {
4366
- height: this.$dropdown.outerHeight(false)
4367
- };
4368
-
4369
- var viewport = {
4370
- top: $window.scrollTop(),
4371
- bottom: $window.scrollTop() + $window.height()
4372
- };
4373
-
4374
- var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4375
- var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
4376
-
4377
- var css = {
4378
- left: offset.left,
4379
- top: container.bottom
4380
- };
4381
-
4382
- // Determine what the parent element is to use for calciulating the offset
4383
- var $offsetParent = this.$dropdownParent;
4384
-
4385
- // For statically positoned elements, we need to get the element
4386
- // that is determining the offset
4387
- if ($offsetParent.css('position') === 'static') {
4388
- $offsetParent = $offsetParent.offsetParent();
4389
- }
4390
-
4391
- var parentOffset = $offsetParent.offset();
4392
-
4393
- css.top -= parentOffset.top;
4394
- css.left -= parentOffset.left;
4395
-
4396
- if (!isCurrentlyAbove && !isCurrentlyBelow) {
4397
- newDirection = 'below';
4398
- }
4399
-
4400
- if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4401
- newDirection = 'above';
4402
- } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4403
- newDirection = 'below';
4404
- }
4405
-
4406
- if (newDirection == 'above' ||
4407
- (isCurrentlyAbove && newDirection !== 'below')) {
4408
- css.top = container.top - parentOffset.top - dropdown.height;
4409
- }
4410
-
4411
- if (newDirection != null) {
4412
- this.$dropdown
4413
- .removeClass('select2-dropdown--below select2-dropdown--above')
4414
- .addClass('select2-dropdown--' + newDirection);
4415
- this.$container
4416
- .removeClass('select2-container--below select2-container--above')
4417
- .addClass('select2-container--' + newDirection);
4418
- }
4419
-
4420
- this.$dropdownContainer.css(css);
4421
- };
4422
-
4423
- AttachBody.prototype._resizeDropdown = function () {
4424
- var css = {
4425
- width: this.$container.outerWidth(false) + 'px'
4426
- };
4427
-
4428
- if (this.options.get('dropdownAutoWidth')) {
4429
- css.minWidth = css.width;
4430
- css.position = 'relative';
4431
- css.width = 'auto';
4432
- }
4433
-
4434
- this.$dropdown.css(css);
4435
- };
4436
-
4437
- AttachBody.prototype._showDropdown = function (decorated) {
4438
- this.$dropdownContainer.appendTo(this.$dropdownParent);
4439
-
4440
- this._positionDropdown();
4441
- this._resizeDropdown();
4442
- };
4443
-
4444
- return AttachBody;
4445
- });
4446
-
4447
- S2.define('select2/dropdown/minimumResultsForSearch',[
4448
-
4449
- ], function () {
4450
- function countResults (data) {
4451
- var count = 0;
4452
-
4453
- for (var d = 0; d < data.length; d++) {
4454
- var item = data[d];
4455
-
4456
- if (item.children) {
4457
- count += countResults(item.children);
4458
- } else {
4459
- count++;
4460
- }
4461
- }
4462
-
4463
- return count;
4464
- }
4465
 
4466
- function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4467
- this.minimumResultsForSearch = options.get('minimumResultsForSearch');
4468
-
4469
- if (this.minimumResultsForSearch < 0) {
4470
- this.minimumResultsForSearch = Infinity;
4471
- }
4472
-
4473
- decorated.call(this, $element, options, dataAdapter);
4474
- }
4475
-
4476
- MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4477
- if (countResults(params.data.results) < this.minimumResultsForSearch) {
4478
- return false;
4479
- }
4480
-
4481
- return decorated.call(this, params);
4482
- };
4483
-
4484
- return MinimumResultsForSearch;
4485
- });
4486
-
4487
- S2.define('select2/dropdown/selectOnClose',[
4488
-
4489
- ], function () {
4490
- function SelectOnClose () { }
4491
-
4492
- SelectOnClose.prototype.bind = function (decorated, container, $container) {
4493
- var self = this;
4494
-
4495
- decorated.call(this, container, $container);
4496
-
4497
- container.on('close', function (params) {
4498
- self._handleSelectOnClose(params);
4499
- });
4500
- };
4501
-
4502
- SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4503
- if (params && params.originalSelect2Event != null) {
4504
- var event = params.originalSelect2Event;
4505
-
4506
- // Don't select an item if the close event was triggered from a select or
4507
- // unselect event
4508
- if (event._type === 'select' || event._type === 'unselect') {
4509
- return;
4510
- }
4511
- }
4512
-
4513
- var $highlightedResults = this.getHighlightedResults();
4514
-
4515
- // Only select highlighted results
4516
- if ($highlightedResults.length < 1) {
4517
- return;
4518
- }
4519
-
4520
- var data = $highlightedResults.data('data');
4521
-
4522
- // Don't re-select already selected resulte
4523
- if (
4524
- (data.element != null && data.element.selected) ||
4525
- (data.element == null && data.selected)
4526
- ) {
4527
- return;
4528
- }
4529
-
4530
- this.trigger('select', {
4531
- data: data
4532
- });
4533
- };
4534
-
4535
- return SelectOnClose;
4536
- });
4537
-
4538
- S2.define('select2/dropdown/closeOnSelect',[
4539
-
4540
- ], function () {
4541
- function CloseOnSelect () { }
4542
-
4543
- CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4544
- var self = this;
4545
-
4546
- decorated.call(this, container, $container);
4547
-
4548
- container.on('select', function (evt) {
4549
- self._selectTriggered(evt);
4550
- });
4551
-
4552
- container.on('unselect', function (evt) {
4553
- self._selectTriggered(evt);
4554
- });
4555
- };
4556
-
4557
- CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4558
- var originalEvent = evt.originalEvent;
4559
-
4560
- // Don't close if the control key is being held
4561
- if (originalEvent && originalEvent.ctrlKey) {
4562
- return;
4563
- }
4564
-
4565
- this.trigger('close', {
4566
- originalEvent: originalEvent,
4567
- originalSelect2Event: evt
4568
- });
4569
- };
4570
-
4571
- return CloseOnSelect;
4572
- });
4573
-
4574
- S2.define('select2/i18n/en',[],function () {
4575
- // English
4576
- return {
4577
- errorLoading: function () {
4578
- return 'The results could not be loaded.';
4579
- },
4580
- inputTooLong: function (args) {
4581
- var overChars = args.input.length - args.maximum;
4582
-
4583
- var message = 'Please delete ' + overChars + ' character';
4584
-
4585
- if (overChars != 1) {
4586
- message += 's';
4587
- }
4588
-
4589
- return message;
4590
- },
4591
- inputTooShort: function (args) {
4592
- var remainingChars = args.minimum - args.input.length;
4593
-
4594
- var message = 'Please enter ' + remainingChars + ' or more characters';
4595
-
4596
- return message;
4597
- },
4598
- loadingMore: function () {
4599
- return 'Loading more results…';
4600
- },
4601
- maximumSelected: function (args) {
4602
- var message = 'You can only select ' + args.maximum + ' item';
4603
-
4604
- if (args.maximum != 1) {
4605
- message += 's';
4606
- }
4607
-
4608
- return message;
4609
- },
4610
- noResults: function () {
4611
- return 'No results found';
4612
- },
4613
- searching: function () {
4614
- return 'Searching…';
4615
- }
4616
- };
4617
- });
4618
-
4619
- S2.define('select2/defaults',[
4620
- 'jquery',
4621
- 'require',
4622
-
4623
- './results',
4624
-
4625
- './selection/single',
4626
- './selection/multiple',
4627
- './selection/placeholder',
4628
- './selection/allowClear',
4629
- './selection/search',
4630
- './selection/eventRelay',
4631
-
4632
- './utils',
4633
- './translation',
4634
- './diacritics',
4635
-
4636
- './data/select',
4637
- './data/array',
4638
- './data/ajax',
4639
- './data/tags',
4640
- './data/tokenizer',
4641
- './data/minimumInputLength',
4642
- './data/maximumInputLength',
4643
- './data/maximumSelectionLength',
4644
-
4645
- './dropdown',
4646
- './dropdown/search',
4647
- './dropdown/hidePlaceholder',
4648
- './dropdown/infiniteScroll',
4649
- './dropdown/attachBody',
4650
- './dropdown/minimumResultsForSearch',
4651
- './dropdown/selectOnClose',
4652
- './dropdown/closeOnSelect',
4653
-
4654
- './i18n/en'
4655
- ], function ($, require,
4656
-
4657
- ResultsList,
4658
-
4659
- SingleSelection, MultipleSelection, Placeholder, AllowClear,
4660
- SelectionSearch, EventRelay,
4661
-
4662
- Utils, Translation, DIACRITICS,
4663
-
4664
- SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4665
- MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4666
-
4667
- Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4668
- AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4669
-
4670
- EnglishTranslation) {
4671
- function Defaults () {
4672
- this.reset();
4673
- }
4674
-
4675
- Defaults.prototype.apply = function (options) {
4676
- options = $.extend(true, {}, this.defaults, options);
4677
-
4678
- if (options.dataAdapter == null) {
4679
- if (options.ajax != null) {
4680
- options.dataAdapter = AjaxData;
4681
- } else if (options.data != null) {
4682
- options.dataAdapter = ArrayData;
4683
- } else {
4684
- options.dataAdapter = SelectData;
4685
- }
4686
-
4687
- if (options.minimumInputLength > 0) {
4688
- options.dataAdapter = Utils.Decorate(
4689
- options.dataAdapter,
4690
- MinimumInputLength
4691
- );
4692
- }
4693
-
4694
- if (options.maximumInputLength > 0) {
4695
- options.dataAdapter = Utils.Decorate(
4696
- options.dataAdapter,
4697
- MaximumInputLength
4698
- );
4699
- }
4700
-
4701
- if (options.maximumSelectionLength > 0) {
4702
- options.dataAdapter = Utils.Decorate(
4703
- options.dataAdapter,
4704
- MaximumSelectionLength
4705
- );
4706
- }
4707
-
4708
- if (options.tags) {
4709
- options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4710
- }
4711
-
4712
- if (options.tokenSeparators != null || options.tokenizer != null) {
4713
- options.dataAdapter = Utils.Decorate(
4714
- options.dataAdapter,
4715
- Tokenizer
4716
- );
4717
- }
4718
-
4719
- if (options.query != null) {
4720
- var Query = require(options.amdBase + 'compat/query');
4721
-
4722
- options.dataAdapter = Utils.Decorate(
4723
- options.dataAdapter,
4724
- Query
4725
- );
4726
- }
4727
-
4728
- if (options.initSelection != null) {
4729
- var InitSelection = require(options.amdBase + 'compat/initSelection');
4730
-
4731
- options.dataAdapter = Utils.Decorate(
4732
- options.dataAdapter,
4733
- InitSelection
4734
- );
4735
- }
4736
- }
4737
-
4738
- if (options.resultsAdapter == null) {
4739
- options.resultsAdapter = ResultsList;
4740
-
4741
- if (options.ajax != null) {
4742
- options.resultsAdapter = Utils.Decorate(
4743
- options.resultsAdapter,
4744
- InfiniteScroll
4745
- );
4746
- }
4747
-
4748
- if (options.placeholder != null) {
4749
- options.resultsAdapter = Utils.Decorate(
4750
- options.resultsAdapter,
4751
- HidePlaceholder
4752
- );
4753
- }
4754
-
4755
- if (options.selectOnClose) {
4756
- options.resultsAdapter = Utils.Decorate(
4757
- options.resultsAdapter,
4758
- SelectOnClose
4759
- );
4760
- }
4761
- }
4762
-
4763
- if (options.dropdownAdapter == null) {
4764
- if (options.multiple) {
4765
- options.dropdownAdapter = Dropdown;
4766
- } else {
4767
- var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4768
-
4769
- options.dropdownAdapter = SearchableDropdown;
4770
- }
4771
-
4772
- if (options.minimumResultsForSearch !== 0) {
4773
- options.dropdownAdapter = Utils.Decorate(
4774
- options.dropdownAdapter,
4775
- MinimumResultsForSearch
4776
- );
4777
- }
4778
-
4779
- if (options.closeOnSelect) {
4780
- options.dropdownAdapter = Utils.Decorate(
4781
- options.dropdownAdapter,
4782
- CloseOnSelect
4783
- );
4784
- }
4785
-
4786
- if (
4787
- options.dropdownCssClass != null ||
4788
- options.dropdownCss != null ||
4789
- options.adaptDropdownCssClass != null
4790
- ) {
4791
- var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4792
-
4793
- options.dropdownAdapter = Utils.Decorate(
4794
- options.dropdownAdapter,
4795
- DropdownCSS
4796
- );
4797
- }
4798
-
4799
- options.dropdownAdapter = Utils.Decorate(
4800
- options.dropdownAdapter,
4801
- AttachBody
4802
- );
4803
- }
4804
-
4805
- if (options.selectionAdapter == null) {
4806
- if (options.multiple) {
4807
- options.selectionAdapter = MultipleSelection;
4808
- } else {
4809
- options.selectionAdapter = SingleSelection;
4810
- }
4811
-
4812
- // Add the placeholder mixin if a placeholder was specified
4813
- if (options.placeholder != null) {
4814
- options.selectionAdapter = Utils.Decorate(
4815
- options.selectionAdapter,
4816
- Placeholder
4817
- );
4818
- }
4819
-
4820
- if (options.allowClear) {
4821
- options.selectionAdapter = Utils.Decorate(
4822
- options.selectionAdapter,
4823
- AllowClear
4824
- );
4825
- }
4826
-
4827
- if (options.multiple) {
4828
- options.selectionAdapter = Utils.Decorate(
4829
- options.selectionAdapter,
4830
- SelectionSearch
4831
- );
4832
- }
4833
-
4834
- if (
4835
- options.containerCssClass != null ||
4836
- options.containerCss != null ||
4837
- options.adaptContainerCssClass != null
4838
- ) {
4839
- var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4840
-
4841
- options.selectionAdapter = Utils.Decorate(
4842
- options.selectionAdapter,
4843
- ContainerCSS
4844
- );
4845
- }
4846
-
4847
- options.selectionAdapter = Utils.Decorate(
4848
- options.selectionAdapter,
4849
- EventRelay
4850
- );
4851
- }
4852
-
4853
- if (typeof options.language === 'string') {
4854
- // Check if the language is specified with a region
4855
- if (options.language.indexOf('-') > 0) {
4856
- // Extract the region information if it is included
4857
- var languageParts = options.language.split('-');
4858
- var baseLanguage = languageParts[0];
4859
-
4860
- options.language = [options.language, baseLanguage];
4861
- } else {
4862
- options.language = [options.language];
4863
- }
4864
- }
4865
-
4866
- if ($.isArray(options.language)) {
4867
- var languages = new Translation();
4868
- options.language.push('en');
4869
-
4870
- var languageNames = options.language;
4871
-
4872
- for (var l = 0; l < languageNames.length; l++) {
4873
- var name = languageNames[l];
4874
- var language = {};
4875
-
4876
- try {
4877
- // Try to load it with the original name
4878
- language = Translation.loadPath(name);
4879
- } catch (e) {
4880
- try {
4881
- // If we couldn't load it, check if it wasn't the full path
4882
- name = this.defaults.amdLanguageBase + name;
4883
- language = Translation.loadPath(name);
4884
- } catch (ex) {
4885
- // The translation could not be loaded at all. Sometimes this is
4886
- // because of a configuration problem, other times this can be
4887
- // because of how Select2 helps load all possible translation files.
4888
- if (options.debug && window.console && console.warn) {
4889
- console.warn(
4890
- 'Select2: The language file for "' + name + '" could not be ' +
4891
- 'automatically loaded. A fallback will be used instead.'
4892
- );
4893
- }
4894
-
4895
- continue;
4896
- }
4897
- }
4898
-
4899
- languages.extend(language);
4900
- }
4901
-
4902
- options.translations = languages;
4903
- } else {
4904
- var baseTranslation = Translation.loadPath(
4905
- this.defaults.amdLanguageBase + 'en'
4906
- );
4907
- var customTranslation = new Translation(options.language);
4908
-
4909
- customTranslation.extend(baseTranslation);
4910
-
4911
- options.translations = customTranslation;
4912
- }
4913
-
4914
- return options;
4915
- };
4916
-
4917
- Defaults.prototype.reset = function () {
4918
- function stripDiacritics (text) {
4919
- // Used 'uni range + named function' from http://jsperf.com/diacritics/18
4920
- function match(a) {
4921
- return DIACRITICS[a] || a;
4922
- }
4923
-
4924
- return text.replace(/[^\u0000-\u007E]/g, match);
4925
- }
4926
-
4927
- function matcher (params, data) {
4928
- // Always return the object if there is nothing to compare
4929
- if ($.trim(params.term) === '') {
4930
- return data;
4931
- }
4932
-
4933
- // Do a recursive check for options with children
4934
- if (data.children && data.children.length > 0) {
4935
- // Clone the data object if there are children
4936
- // This is required as we modify the object to remove any non-matches
4937
- var match = $.extend(true, {}, data);
4938
-
4939
- // Check each child of the option
4940
- for (var c = data.children.length - 1; c >= 0; c--) {
4941
- var child = data.children[c];
4942
-
4943
- var matches = matcher(params, child);
4944
-
4945
- // If there wasn't a match, remove the object in the array
4946
- if (matches == null) {
4947
- match.children.splice(c, 1);
4948
- }
4949
- }
4950
-
4951
- // If any children matched, return the new object
4952
- if (match.children.length > 0) {
4953
- return match;
4954
- }
4955
-
4956
- // If there were no matching children, check just the plain object
4957
- return matcher(params, match);
4958
- }
4959
-
4960
- var original = stripDiacritics(data.text).toUpperCase();
4961
- var term = stripDiacritics(params.term).toUpperCase();
4962
-
4963
- // Check if the text contains the term
4964
- if (original.indexOf(term) > -1) {
4965
- return data;
4966
- }
4967
-
4968
- // If it doesn't contain the term, don't return anything
4969
- return null;
4970
- }
4971
-
4972
- this.defaults = {
4973
- amdBase: './',
4974
- amdLanguageBase: './i18n/',
4975
- closeOnSelect: true,
4976
- debug: false,
4977
- dropdownAutoWidth: false,
4978
- escapeMarkup: Utils.escapeMarkup,
4979
- language: EnglishTranslation,
4980
- matcher: matcher,
4981
- minimumInputLength: 0,
4982
- maximumInputLength: 0,
4983
- maximumSelectionLength: 0,
4984
- minimumResultsForSearch: 0,
4985
- selectOnClose: false,
4986
- sorter: function (data) {
4987
- return data;
4988
- },
4989
- templateResult: function (result) {
4990
- return result.text;
4991
- },
4992
- templateSelection: function (selection) {
4993
- return selection.text;
4994
- },
4995
- theme: 'default',
4996
- width: 'resolve'
4997
- };
4998
- };
4999
-
5000
- Defaults.prototype.set = function (key, value) {
5001
- var camelKey = $.camelCase(key);
5002
-
5003
- var data = {};
5004
- data[camelKey] = value;
5005
-
5006
- var convertedData = Utils._convertData(data);
5007
-
5008
- $.extend(this.defaults, convertedData);
5009
- };
5010
-
5011
- var defaults = new Defaults();
5012
-
5013
- return defaults;
5014
- });
5015
-
5016
- S2.define('select2/options',[
5017
- 'require',
5018
- 'jquery',
5019
- './defaults',
5020
- './utils'
5021
- ], function (require, $, Defaults, Utils) {
5022
- function Options (options, $element) {
5023
- this.options = options;
5024
-
5025
- if ($element != null) {
5026
- this.fromElement($element);
5027
- }
5028
-
5029
- this.options = Defaults.apply(this.options);
5030
-
5031
- if ($element && $element.is('input')) {
5032
- var InputCompat = require(this.get('amdBase') + 'compat/inputData');
5033
-
5034
- this.options.dataAdapter = Utils.Decorate(
5035
- this.options.dataAdapter,
5036
- InputCompat
5037
- );
5038
- }
5039
- }
5040
-
5041
- Options.prototype.fromElement = function ($e) {
5042
- var excludedData = ['select2'];
5043
-
5044
- if (this.options.multiple == null) {
5045
- this.options.multiple = $e.prop('multiple');
5046
- }
5047
-
5048
- if (this.options.disabled == null) {
5049
- this.options.disabled = $e.prop('disabled');
5050
- }
5051
-
5052
- if (this.options.language == null) {
5053
- if ($e.prop('lang')) {
5054
- this.options.language = $e.prop('lang').toLowerCase();
5055
- } else if ($e.closest('[lang]').prop('lang')) {
5056
- this.options.language = $e.closest('[lang]').prop('lang');
5057
- }
5058
- }
5059
-
5060
- if (this.options.dir == null) {
5061
- if ($e.prop('dir')) {
5062
- this.options.dir = $e.prop('dir');
5063
- } else if ($e.closest('[dir]').prop('dir')) {
5064
- this.options.dir = $e.closest('[dir]').prop('dir');
5065
- } else {
5066
- this.options.dir = 'ltr';
5067
- }
5068
- }
5069
-
5070
- $e.prop('disabled', this.options.disabled);
5071
- $e.prop('multiple', this.options.multiple);
5072
-
5073
- if ($e.data('select2Tags')) {
5074
- if (this.options.debug && window.console && console.warn) {
5075
- console.warn(
5076
- 'Select2: The `data-select2-tags` attribute has been changed to ' +
5077
- 'use the `data-data` and `data-tags="true"` attributes and will be ' +
5078
- 'removed in future versions of Select2.'
5079
- );
5080
- }
5081
-
5082
- $e.data('data', $e.data('select2Tags'));
5083
- $e.data('tags', true);
5084
- }
5085
-
5086
- if ($e.data('ajaxUrl')) {
5087
- if (this.options.debug && window.console && console.warn) {
5088
- console.warn(
5089
- 'Select2: The `data-ajax-url` attribute has been changed to ' +
5090
- '`data-ajax--url` and support for the old attribute will be removed' +
5091
- ' in future versions of Select2.'
5092
- );
5093
- }
5094
-
5095
- $e.attr('ajax--url', $e.data('ajaxUrl'));
5096
- $e.data('ajax--url', $e.data('ajaxUrl'));
5097
- }
5098
-
5099
- var dataset = {};
5100
-
5101
- // Prefer the element's `dataset` attribute if it exists
5102
- // jQuery 1.x does not correctly handle data attributes with multiple dashes
5103
- if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
5104
- dataset = $.extend(true, {}, $e[0].dataset, $e.data());
5105
- } else {
5106
- dataset = $e.data();
5107
- }
5108
-
5109
- var data = $.extend(true, {}, dataset);
5110
-
5111
- data = Utils._convertData(data);
5112
-
5113
- for (var key in data) {
5114
- if ($.inArray(key, excludedData) > -1) {
5115
- continue;
5116
- }
5117
-
5118
- if ($.isPlainObject(this.options[key])) {
5119
- $.extend(this.options[key], data[key]);
5120
- } else {
5121
- this.options[key] = data[key];
5122
- }
5123
- }
5124
-
5125
- return this;
5126
- };
5127
-
5128
- Options.prototype.get = function (key) {
5129
- return this.options[key];
5130
- };
5131
-
5132
- Options.prototype.set = function (key, val) {
5133
- this.options[key] = val;
5134
- };
5135
-
5136
- return Options;
5137
- });
5138
-
5139
- S2.define('select2/core',[
5140
- 'jquery',
5141
- './options',
5142
- './utils',
5143
- './keys'
5144
- ], function ($, Options, Utils, KEYS) {
5145
- var Select2 = function ($element, options) {
5146
- if ($element.data('select2') != null) {
5147
- $element.data('select2').destroy();
5148
- }
5149
-
5150
- this.$element = $element;
5151
-
5152
- this.id = this._generateId($element);
5153
-
5154
- options = options || {};
5155
-
5156
- this.options = new Options(options, $element);
5157
-
5158
- Select2.__super__.constructor.call(this);
5159
-
5160
- // Set up the tabindex
5161
-
5162
- var tabindex = $element.attr('tabindex') || 0;
5163
- $element.data('old-tabindex', tabindex);
5164
- $element.attr('tabindex', '-1');
5165
-
5166
- // Set up containers and adapters
5167
-
5168
- var DataAdapter = this.options.get('dataAdapter');
5169
- this.dataAdapter = new DataAdapter($element, this.options);
5170
-
5171
- var $container = this.render();
5172
-
5173
- this._placeContainer($container);
5174
-
5175
- var SelectionAdapter = this.options.get('selectionAdapter');
5176
- this.selection = new SelectionAdapter($element, this.options);
5177
- this.$selection = this.selection.render();
5178
-
5179
- this.selection.position(this.$selection, $container);
5180
-
5181
- var DropdownAdapter = this.options.get('dropdownAdapter');
5182
- this.dropdown = new DropdownAdapter($element, this.options);
5183
- this.$dropdown = this.dropdown.render();
5184
-
5185
- this.dropdown.position(this.$dropdown, $container);
5186
-
5187
- var ResultsAdapter = this.options.get('resultsAdapter');
5188
- this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5189
- this.$results = this.results.render();
5190
-
5191
- this.results.position(this.$results, this.$dropdown);
5192
-
5193
- // Bind events
5194
-
5195
- var self = this;
5196
-
5197
- // Bind the container to all of the adapters
5198
- this._bindAdapters();
5199
-
5200
- // Register any DOM event handlers
5201
- this._registerDomEvents();
5202
-
5203
- // Register any internal event handlers
5204
- this._registerDataEvents();
5205
- this._registerSelectionEvents();
5206
- this._registerDropdownEvents();
5207
- this._registerResultsEvents();
5208
- this._registerEvents();
5209
-
5210
- // Set the initial state
5211
- this.dataAdapter.current(function (initialData) {
5212
- self.trigger('selection:update', {
5213
- data: initialData
5214
- });
5215
- });
5216
-
5217
- // Hide the original select
5218
- $element.addClass('select2-hidden-accessible');
5219
- $element.attr('aria-hidden', 'true');
5220
-
5221
- // Synchronize any monitored attributes
5222
- this._syncAttributes();
5223
-
5224
- $element.data('select2', this);
5225
- };
5226
-
5227
- Utils.Extend(Select2, Utils.Observable);
5228
-
5229
- Select2.prototype._generateId = function ($element) {
5230
- var id = '';
5231
-
5232
- if ($element.attr('id') != null) {
5233
- id = $element.attr('id');
5234
- } else if ($element.attr('name') != null) {
5235
- id = $element.attr('name') + '-' + Utils.generateChars(2);
5236
- } else {
5237
- id = Utils.generateChars(4);
5238
- }
5239
-
5240
- id = id.replace(/(:|\.|\[|\]|,)/g, '');
5241
- id = 'select2-' + id;
5242
-
5243
- return id;
5244
- };
5245
-
5246
- Select2.prototype._placeContainer = function ($container) {
5247
- $container.insertAfter(this.$element);
5248
-
5249
- var width = this._resolveWidth(this.$element, this.options.get('width'));
5250
-
5251
- if (width != null) {
5252
- $container.css('width', width);
5253
- }
5254
- };
5255
-
5256
- Select2.prototype._resolveWidth = function ($element, method) {
5257
- var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5258
-
5259
- if (method == 'resolve') {
5260
- var styleWidth = this._resolveWidth($element, 'style');
5261
-
5262
- if (styleWidth != null) {
5263
- return styleWidth;
5264
- }
5265
-
5266
- return this._resolveWidth($element, 'element');
5267
- }
5268
-
5269
- if (method == 'element') {
5270
- var elementWidth = $element.outerWidth(false);
5271
-
5272
- if (elementWidth <= 0) {
5273
- return 'auto';
5274
- }
5275
-
5276
- return elementWidth + 'px';
5277
- }
5278
-
5279
- if (method == 'style') {
5280
- var style = $element.attr('style');
5281
-
5282
- if (typeof(style) !== 'string') {
5283
- return null;
5284
- }
5285
-
5286
- var attrs = style.split(';');
5287
-
5288
- for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5289
- var attr = attrs[i].replace(/\s/g, '');
5290
- var matches = attr.match(WIDTH);
5291
-
5292
- if (matches !== null && matches.length >= 1) {
5293
- return matches[1];
5294
- }
5295
- }
5296
-
5297
- return null;
5298
- }
5299
-
5300
- return method;
5301
- };
5302
-
5303
- Select2.prototype._bindAdapters = function () {
5304
- this.dataAdapter.bind(this, this.$container);
5305
- this.selection.bind(this, this.$container);
5306
-
5307
- this.dropdown.bind(this, this.$container);
5308
- this.results.bind(this, this.$container);
5309
- };
5310
-
5311
- Select2.prototype._registerDomEvents = function () {
5312
- var self = this;
5313
-
5314
- this.$element.on('change.select2', function () {
5315
- self.dataAdapter.current(function (data) {
5316
- self.trigger('selection:update', {
5317
- data: data
5318
- });
5319
- });
5320
- });
5321
-
5322
- this.$element.on('focus.select2', function (evt) {
5323
- self.trigger('focus', evt);
5324
- });
5325
-
5326
- this._syncA = Utils.bind(this._syncAttributes, this);
5327
- this._syncS = Utils.bind(this._syncSubtree, this);
5328
-
5329
- if (this.$element[0].attachEvent) {
5330
- this.$element[0].attachEvent('onpropertychange', this._syncA);
5331
- }
5332
-
5333
- var observer = window.MutationObserver ||
5334
- window.WebKitMutationObserver ||
5335
- window.MozMutationObserver
5336
- ;
5337
-
5338
- if (observer != null) {
5339
- this._observer = new observer(function (mutations) {
5340
- $.each(mutations, self._syncA);
5341
- $.each(mutations, self._syncS);
5342
- });
5343
- this._observer.observe(this.$element[0], {
5344
- attributes: true,
5345
- childList: true,
5346
- subtree: false
5347
- });
5348
- } else if (this.$element[0].addEventListener) {
5349
- this.$element[0].addEventListener(
5350
- 'DOMAttrModified',
5351
- self._syncA,
5352
- false
5353
- );
5354
- this.$element[0].addEventListener(
5355
- 'DOMNodeInserted',
5356
- self._syncS,
5357
- false
5358
- );
5359
- this.$element[0].addEventListener(
5360
- 'DOMNodeRemoved',
5361
- self._syncS,
5362
- false
5363
- );
5364
- }
5365
- };
5366
-
5367
- Select2.prototype._registerDataEvents = function () {
5368
- var self = this;
5369
-
5370
- this.dataAdapter.on('*', function (name, params) {
5371
- self.trigger(name, params);
5372
- });
5373
- };
5374
-
5375
- Select2.prototype._registerSelectionEvents = function () {
5376
- var self = this;
5377
- var nonRelayEvents = ['toggle', 'focus'];
5378
-
5379
- this.selection.on('toggle', function () {
5380
- self.toggleDropdown();
5381
- });
5382
-
5383
- this.selection.on('focus', function (params) {
5384
- self.focus(params);
5385
- });
5386
-
5387
- this.selection.on('*', function (name, params) {
5388
- if ($.inArray(name, nonRelayEvents) !== -1) {
5389
- return;
5390
- }
5391
-
5392
- self.trigger(name, params);
5393
- });
5394
- };
5395
-
5396
- Select2.prototype._registerDropdownEvents = function () {
5397
- var self = this;
5398
-
5399
- this.dropdown.on('*', function (name, params) {
5400
- self.trigger(name, params);
5401
- });
5402
- };
5403
-
5404
- Select2.prototype._registerResultsEvents = function () {
5405
- var self = this;
5406
-
5407
- this.results.on('*', function (name, params) {
5408
- self.trigger(name, params);
5409
- });
5410
- };
5411
-
5412
- Select2.prototype._registerEvents = function () {
5413
- var self = this;
5414
-
5415
- this.on('open', function () {
5416
- self.$container.addClass('select2-container--open');
5417
- });
5418
-
5419
- this.on('close', function () {
5420
- self.$container.removeClass('select2-container--open');
5421
- });
5422
-
5423
- this.on('enable', function () {
5424
- self.$container.removeClass('select2-container--disabled');
5425
- });
5426
-
5427
- this.on('disable', function () {
5428
- self.$container.addClass('select2-container--disabled');
5429
- });
5430
-
5431
- this.on('blur', function () {
5432
- self.$container.removeClass('select2-container--focus');
5433
- });
5434
-
5435
- this.on('query', function (params) {
5436
- if (!self.isOpen()) {
5437
- self.trigger('open', {});
5438
- }
5439
-
5440
- this.dataAdapter.query(params, function (data) {
5441
- self.trigger('results:all', {
5442
- data: data,
5443
- query: params
5444
- });
5445
- });
5446
- });
5447
-
5448
- this.on('query:append', function (params) {
5449
- this.dataAdapter.query(params, function (data) {
5450
- self.trigger('results:append', {
5451
- data: data,
5452
- query: params
5453
- });
5454
- });
5455
- });
5456
-
5457
- this.on('open', function(){
5458
- // Focus on the active element when opening dropdown.
5459
- // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
5460
- setTimeout(function(){
5461
- self.focusOnActiveElement();
5462
- }, 1);
5463
- });
5464
-
5465
- $(document).on('keydown', function (evt) {
5466
- var key = evt.which;
5467
- if (self.isOpen()) {
5468
- if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
5469
- self.close();
5470
-
5471
- evt.preventDefault();
5472
- } else if (key === KEYS.ENTER || key === KEYS.TAB) {
5473
- self.trigger('results:select', {});
5474
-
5475
- evt.preventDefault();
5476
- } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5477
- self.trigger('results:toggle', {});
5478
-
5479
- evt.preventDefault();
5480
- } else if (key === KEYS.UP) {
5481
- self.trigger('results:previous', {});
5482
-
5483
- evt.preventDefault();
5484
- } else if (key === KEYS.DOWN) {
5485
- self.trigger('results:next', {});
5486
-
5487
- evt.preventDefault();
5488
- }
5489
-
5490
- var $searchField = self.$dropdown.find('.select2-search__field');
5491
- if (! $searchField.length) {
5492
- $searchField = self.$container.find('.select2-search__field');
5493
- }
5494
-
5495
- // Move the focus to the selected element on keyboard navigation.
5496
- // Required for screen readers to work properly.
5497
- if (key === KEYS.DOWN || key === KEYS.UP) {
5498
- self.focusOnActiveElement();
5499
- } else {
5500
- // Focus on the search if user starts typing.
5501
- $searchField.focus();
5502
- // Focus back to active selection when finished typing.
5503
- // Small delay so typed character can be read by screen reader.
5504
- setTimeout(function(){
5505
- self.focusOnActiveElement();
5506
- }, 1000);
5507
- }
5508
- } else if (self.hasFocus()) {
5509
- if (key === KEYS.ENTER || key === KEYS.SPACE ||
5510
- key === KEYS.DOWN) {
5511
- self.open();
5512
- evt.preventDefault();
5513
- }
5514
- }
5515
- });
5516
- };
5517
-
5518
- Select2.prototype.focusOnActiveElement = function () {
5519
- // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
5520
- if (this.isOpen() && ! Utils.isTouchscreen()) {
5521
- this.$results.find('li.select2-results__option--highlighted').focus();
5522
- }
5523
- };
5524
-
5525
- Select2.prototype._syncAttributes = function () {
5526
- this.options.set('disabled', this.$element.prop('disabled'));
5527
-
5528
- if (this.options.get('disabled')) {
5529
- if (this.isOpen()) {
5530
- this.close();
5531
- }
5532
-
5533
- this.trigger('disable', {});
5534
- } else {
5535
- this.trigger('enable', {});
5536
- }
5537
- };
5538
-
5539
- Select2.prototype._syncSubtree = function (evt, mutations) {
5540
- var changed = false;
5541
- var self = this;
5542
-
5543
- // Ignore any mutation events raised for elements that aren't options or
5544
- // optgroups. This handles the case when the select element is destroyed
5545
- if (
5546
- evt && evt.target && (
5547
- evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5548
- )
5549
- ) {
5550
- return;
5551
- }
5552
-
5553
- if (!mutations) {
5554
- // If mutation events aren't supported, then we can only assume that the
5555
- // change affected the selections
5556
- changed = true;
5557
- } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5558
- for (var n = 0; n < mutations.addedNodes.length; n++) {
5559
- var node = mutations.addedNodes[n];
5560
-
5561
- if (node.selected) {
5562
- changed = true;
5563
- }
5564
- }
5565
- } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5566
- changed = true;
5567
- }
5568
-
5569
- // Only re-pull the data if we think there is a change
5570
- if (changed) {
5571
- this.dataAdapter.current(function (currentData) {
5572
- self.trigger('selection:update', {
5573
- data: currentData
5574
- });
5575
- });
5576
- }
5577
- };
5578
-
5579
- /**
5580
- * Override the trigger method to automatically trigger pre-events when
5581
- * there are events that can be prevented.
5582
- */
5583
- Select2.prototype.trigger = function (name, args) {
5584
- var actualTrigger = Select2.__super__.trigger;
5585
- var preTriggerMap = {
5586
- 'open': 'opening',
5587
- 'close': 'closing',
5588
- 'select': 'selecting',
5589
- 'unselect': 'unselecting'
5590
- };
5591
-
5592
- if (args === undefined) {
5593
- args = {};
5594
- }
5595
-
5596
- if (name in preTriggerMap) {
5597
- var preTriggerName = preTriggerMap[name];
5598
- var preTriggerArgs = {
5599
- prevented: false,
5600
- name: name,
5601
- args: args
5602
- };
5603
-
5604
- actualTrigger.call(this, preTriggerName, preTriggerArgs);
5605
-
5606
- if (preTriggerArgs.prevented) {
5607
- args.prevented = true;
5608
-
5609
- return;
5610
- }
5611
- }
5612
-
5613
- actualTrigger.call(this, name, args);
5614
- };
5615
-
5616
- Select2.prototype.toggleDropdown = function () {
5617
- if (this.options.get('disabled')) {
5618
- return;
5619
- }
5620
-
5621
- if (this.isOpen()) {
5622
- this.close();
5623
- } else {
5624
- this.open();
5625
- }
5626
- };
5627
-
5628
- Select2.prototype.open = function () {
5629
- if (this.isOpen()) {
5630
- return;
5631
- }
5632
-
5633
- this.trigger('query', {});
5634
- };
5635
-
5636
- Select2.prototype.close = function () {
5637
- if (!this.isOpen()) {
5638
- return;
5639
- }
5640
-
5641
- this.trigger('close', {});
5642
- };
5643
-
5644
- Select2.prototype.isOpen = function () {
5645
- return this.$container.hasClass('select2-container--open');
5646
- };
5647
-
5648
- Select2.prototype.hasFocus = function () {
5649
- return this.$container.hasClass('select2-container--focus');
5650
- };
5651
-
5652
- Select2.prototype.focus = function (data) {
5653
- // No need to re-trigger focus events if we are already focused
5654
- if (this.hasFocus()) {
5655
- return;
5656
- }
5657
-
5658
- this.$container.addClass('select2-container--focus');
5659
- this.trigger('focus', {});
5660
- };
5661
-
5662
- Select2.prototype.enable = function (args) {
5663
- if (this.options.get('debug') && window.console && console.warn) {
5664
- console.warn(
5665
- 'Select2: The `select2("enable")` method has been deprecated and will' +
5666
- ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5667
- ' instead.'
5668
- );
5669
- }
5670
-
5671
- if (args == null || args.length === 0) {
5672
- args = [true];
5673
- }
5674
-
5675
- var disabled = !args[0];
5676
-
5677
- this.$element.prop('disabled', disabled);
5678
- };
5679
-
5680
- Select2.prototype.data = function () {
5681
- if (this.options.get('debug') &&
5682
- arguments.length > 0 && window.console && console.warn) {
5683
- console.warn(
5684
- 'Select2: Data can no longer be set using `select2("data")`. You ' +
5685
- 'should consider setting the value instead using `$element.val()`.'
5686
- );
5687
- }
5688
-
5689
- var data = [];
5690
-
5691
- this.dataAdapter.current(function (currentData) {
5692
- data = currentData;
5693
- });
5694
-
5695
- return data;
5696
- };
5697
-
5698
- Select2.prototype.val = function (args) {
5699
- if (this.options.get('debug') && window.console && console.warn) {
5700
- console.warn(
5701
- 'Select2: The `select2("val")` method has been deprecated and will be' +
5702
- ' removed in later Select2 versions. Use $element.val() instead.'
5703
- );
5704
- }
5705
-
5706
- if (args == null || args.length === 0) {
5707
- return this.$element.val();
5708
- }
5709
-
5710
- var newVal = args[0];
5711
-
5712
- if ($.isArray(newVal)) {
5713
- newVal = $.map(newVal, function (obj) {
5714
- return obj.toString();
5715
- });
5716
- }
5717
-
5718
- this.$element.val(newVal).trigger('change');
5719
- };
5720
-
5721
- Select2.prototype.destroy = function () {
5722
- this.$container.remove();
5723
-
5724
- if (this.$element[0].detachEvent) {
5725
- this.$element[0].detachEvent('onpropertychange', this._syncA);
5726
- }
5727
-
5728
- if (this._observer != null) {
5729
- this._observer.disconnect();
5730
- this._observer = null;
5731
- } else if (this.$element[0].removeEventListener) {
5732
- this.$element[0]
5733
- .removeEventListener('DOMAttrModified', this._syncA, false);
5734
- this.$element[0]
5735
- .removeEventListener('DOMNodeInserted', this._syncS, false);
5736
- this.$element[0]
5737
- .removeEventListener('DOMNodeRemoved', this._syncS, false);
5738
- }
5739
-
5740
- this._syncA = null;
5741
- this._syncS = null;
5742
-
5743
- this.$element.off('.select2');
5744
- this.$element.attr('tabindex', this.$element.data('old-tabindex'));
5745
-
5746
- this.$element.removeClass('select2-hidden-accessible');
5747
- this.$element.attr('aria-hidden', 'false');
5748
- this.$element.removeData('select2');
5749
-
5750
- this.dataAdapter.destroy();
5751
- this.selection.destroy();
5752
- this.dropdown.destroy();
5753
- this.results.destroy();
5754
-
5755
- this.dataAdapter = null;
5756
- this.selection = null;
5757
- this.dropdown = null;
5758
- this.results = null;
5759
- };
5760
-
5761
- Select2.prototype.render = function () {
5762
- var $container = $(
5763
- '<span class="select2 select2-container">' +
5764
- '<span class="selection"></span>' +
5765
- '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
5766
- '</span>'
5767
- );
5768
-
5769
- $container.attr('dir', this.options.get('dir'));
5770
-
5771
- this.$container = $container;
5772
-
5773
- this.$container.addClass('select2-container--' + this.options.get('theme'));
5774
-
5775
- $container.data('element', this.$element);
5776
-
5777
- return $container;
5778
- };
5779
-
5780
- return Select2;
5781
- });
5782
-
5783
- S2.define('jquery-mousewheel',[
5784
- 'jquery'
5785
- ], function ($) {
5786
- // Used to shim jQuery.mousewheel for non-full builds.
5787
- return $;
5788
- });
5789
-
5790
- S2.define('jquery.select2',[
5791
- 'jquery',
5792
- 'jquery-mousewheel',
5793
-
5794
- './select2/core',
5795
- './select2/defaults'
5796
- ], function ($, _, Select2, Defaults) {
5797
- if ($.fn.selectWoo == null) {
5798
- // All methods that should return the element
5799
- var thisMethods = ['open', 'close', 'destroy'];
5800
-
5801
- $.fn.selectWoo = function (options) {
5802
- options = options || {};
5803
-
5804
- if (typeof options === 'object') {
5805
- this.each(function () {
5806
- var instanceOptions = $.extend(true, {}, options);
5807
-
5808
- var instance = new Select2($(this), instanceOptions);
5809
- });
5810
-
5811
- return this;
5812
- } else if (typeof options === 'string') {
5813
- var ret;
5814
- var args = Array.prototype.slice.call(arguments, 1);
5815
-
5816
- this.each(function () {
5817
- var instance = $(this).data('select2');
5818
-
5819
- if (instance == null && window.console && console.error) {
5820
- console.error(
5821
- 'The select2(\'' + options + '\') method was called on an ' +
5822
- 'element that is not using Select2.'
5823
- );
5824
- }
5825
-
5826
- ret = instance[options].apply(instance, args);
5827
- });
5828
-
5829
- // Check if we should be returning `this`
5830
- if ($.inArray(options, thisMethods) > -1) {
5831
- return this;
5832
- }
5833
-
5834
- return ret;
5835
- } else {
5836
- throw new Error('Invalid arguments for Select2: ' + options);
5837
- }
5838
- };
5839
- }
5840
-
5841
- if ($.fn.select2 != null && $.fn.select2.defaults != null) {
5842
- $.fn.selectWoo.defaults = $.fn.select2.defaults;
5843
- }
5844
-
5845
- if ($.fn.selectWoo.defaults == null) {
5846
- $.fn.selectWoo.defaults = Defaults;
5847
- }
5848
 
5849
- // Also register selectWoo under select2 if select2 is not already present.
5850
- $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
5851
 
5852
- return Select2;
5853
- });
 
 
5854
 
5855
- // Return the AMD loader configuration so it can be used outside of this file
5856
- return {
5857
- define: S2.define,
5858
- require: S2.require
5859
- };
5860
- }());
5861
 
5862
- // Autoload the jQuery bindings
5863
- // We know that all of the modules exist above this, so we're safe
5864
- var select2 = S2.require('jquery.select2');
5865
 
5866
- // Hold the AMD module references on the jQuery function that was just loaded
5867
- // This allows Select2 to use the internal loader outside of this file, such
5868
- // as in the language files.
5869
- jQuery.fn.select2.amd = S2;
5870
- jQuery.fn.selectWoo.amd = S2;
5871
 
5872
- // Return the Select2 instance for anyone who is importing it.
5873
- return select2;
5874
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  /*!
2
+ * SelectWoo 1.0.6
3
  * https://github.com/woocommerce/selectWoo
4
  *
5
  * Released under the MIT license
6
  * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
7
  */
8
  (function (factory) {
9
+ if (typeof define === 'function' && define.amd) {
10
+ // AMD. Register as an anonymous module.
11
+ define(['jquery'], factory);
12
+ } else if (typeof module === 'object' && module.exports) {
13
+ // Node/CommonJS
14
+ module.exports = function (root, jQuery) {
15
+ if (jQuery === undefined) {
16
+ // require('jQuery') returns a factory that requires window to
17
+ // build a jQuery instance, we normalize how we use modules
18
+ // that require this pattern but the window provided is a noop
19
+ // if it's defined (how jquery works)
20
+ if (typeof window !== 'undefined') {
21
+ jQuery = require('jquery');
22
+ }
23
+ else {
24
+ jQuery = require('jquery')(root);
25
+ }
26
+ }
27
+ factory(jQuery);
28
+ return jQuery;
29
+ };
30
+ } else {
31
+ // Browser globals
32
+ factory(jQuery);
33
+ }
34
+ } (function (jQuery) {
35
+ // This is needed so we can catch the AMD loader configuration and use it
36
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
37
+ // returns the AMD loader references.
38
+ var S2 =(function () {
39
+ // Restore the Select2 AMD loader so it can be used
40
+ // Needed mostly in the language files, where the loader is not inserted
41
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
42
+ var S2 = jQuery.fn.select2.amd;
43
+ }
44
+ var S2;(function () { if (!S2 || !S2.requirejs) {
45
+ if (!S2) { S2 = {}; } else { require = S2; }
46
+ /**
47
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
48
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
49
+ */
50
+ //Going sloppy to avoid 'use strict' string cost, but strict practices should
51
+ //be followed.
52
+ /*global setTimeout: false */
53
+
54
+ var requirejs, require, define;
55
+ (function (undef) {
56
+ var main, req, makeMap, handlers,
57
+ defined = {},
58
+ waiting = {},
59
+ config = {},
60
+ defining = {},
61
+ hasOwn = Object.prototype.hasOwnProperty,
62
+ aps = [].slice,
63
+ jsSuffixRegExp = /\.js$/;
64
+
65
+ function hasProp(obj, prop) {
66
+ return hasOwn.call(obj, prop);
67
+ }
68
+
69
+ /**
70
+ * Given a relative module name, like ./something, normalize it to
71
+ * a real name that can be mapped to a path.
72
+ * @param {String} name the relative name
73
+ * @param {String} baseName a real name that the name arg is relative
74
+ * to.
75
+ * @returns {String} normalized name
76
+ */
77
+ function normalize(name, baseName) {
78
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
79
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
80
+ baseParts = baseName && baseName.split("/"),
81
+ map = config.map,
82
+ starMap = (map && map['*']) || {};
83
+
84
+ //Adjust any relative paths.
85
+ if (name) {
86
+ name = name.split('/');
87
+ lastIndex = name.length - 1;
88
+
89
+ // If wanting node ID compatibility, strip .js from end
90
+ // of IDs. Have to do this here, and not in nameToUrl
91
+ // because node allows either .js or non .js to map
92
+ // to same file.
93
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
94
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
95
+ }
96
+
97
+ // Starts with a '.' so need the baseName
98
+ if (name[0].charAt(0) === '.' && baseParts) {
99
+ //Convert baseName to array, and lop off the last part,
100
+ //so that . matches that 'directory' and not name of the baseName's
101
+ //module. For instance, baseName of 'one/two/three', maps to
102
+ //'one/two/three.js', but we want the directory, 'one/two' for
103
+ //this normalization.
104
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
105
+ name = normalizedBaseParts.concat(name);
106
+ }
107
+
108
+ //start trimDots
109
+ for (i = 0; i < name.length; i++) {
110
+ part = name[i];
111
+ if (part === '.') {
112
+ name.splice(i, 1);
113
+ i -= 1;
114
+ } else if (part === '..') {
115
+ // If at the start, or previous value is still ..,
116
+ // keep them so that when converted to a path it may
117
+ // still work when converted to a path, even though
118
+ // as an ID it is less than ideal. In larger point
119
+ // releases, may be better to just kick out an error.
120
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
121
+ continue;
122
+ } else if (i > 0) {
123
+ name.splice(i - 1, 2);
124
+ i -= 2;
125
+ }
126
+ }
127
+ }
128
+ //end trimDots
129
+
130
+ name = name.join('/');
131
+ }
132
+
133
+ //Apply map config if available.
134
+ if ((baseParts || starMap) && map) {
135
+ nameParts = name.split('/');
136
+
137
+ for (i = nameParts.length; i > 0; i -= 1) {
138
+ nameSegment = nameParts.slice(0, i).join("/");
139
+
140
+ if (baseParts) {
141
+ //Find the longest baseName segment match in the config.
142
+ //So, do joins on the biggest to smallest lengths of baseParts.
143
+ for (j = baseParts.length; j > 0; j -= 1) {
144
+ mapValue = map[baseParts.slice(0, j).join('/')];
145
+
146
+ //baseName segment has config, find if it has one for
147
+ //this name.
148
+ if (mapValue) {
149
+ mapValue = mapValue[nameSegment];
150
+ if (mapValue) {
151
+ //Match, update name to the new value.
152
+ foundMap = mapValue;
153
+ foundI = i;
154
+ break;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ if (foundMap) {
161
+ break;
162
+ }
163
+
164
+ //Check for a star map match, but just hold on to it,
165
+ //if there is a shorter segment match later in a matching
166
+ //config, then favor over this star map.
167
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
168
+ foundStarMap = starMap[nameSegment];
169
+ starI = i;
170
+ }
171
+ }
172
+
173
+ if (!foundMap && foundStarMap) {
174
+ foundMap = foundStarMap;
175
+ foundI = starI;
176
+ }
177
+
178
+ if (foundMap) {
179
+ nameParts.splice(0, foundI, foundMap);
180
+ name = nameParts.join('/');
181
+ }
182
+ }
183
+
184
+ return name;
185
+ }
186
+
187
+ function makeRequire(relName, forceSync) {
188
+ return function () {
189
+ //A version of a require function that passes a moduleName
190
+ //value for items that may need to
191
+ //look up paths relative to the moduleName
192
+ var args = aps.call(arguments, 0);
193
+
194
+ //If first arg is not require('string'), and there is only
195
+ //one arg, it is the array form without a callback. Insert
196
+ //a null so that the following concat is correct.
197
+ if (typeof args[0] !== 'string' && args.length === 1) {
198
+ args.push(null);
199
+ }
200
+ return req.apply(undef, args.concat([relName, forceSync]));
201
+ };
202
+ }
203
+
204
+ function makeNormalize(relName) {
205
+ return function (name) {
206
+ return normalize(name, relName);
207
+ };
208
+ }
209
+
210
+ function makeLoad(depName) {
211
+ return function (value) {
212
+ defined[depName] = value;
213
+ };
214
+ }
215
+
216
+ function callDep(name) {
217
+ if (hasProp(waiting, name)) {
218
+ var args = waiting[name];
219
+ delete waiting[name];
220
+ defining[name] = true;
221
+ main.apply(undef, args);
222
+ }
223
+
224
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
225
+ throw new Error('No ' + name);
226
+ }
227
+ return defined[name];
228
+ }
229
+
230
+ //Turns a plugin!resource to [plugin, resource]
231
+ //with the plugin being undefined if the name
232
+ //did not have a plugin prefix.
233
+ function splitPrefix(name) {
234
+ var prefix,
235
+ index = name ? name.indexOf('!') : -1;
236
+ if (index > -1) {
237
+ prefix = name.substring(0, index);
238
+ name = name.substring(index + 1, name.length);
239
+ }
240
+ return [prefix, name];
241
+ }
242
+
243
+ //Creates a parts array for a relName where first part is plugin ID,
244
+ //second part is resource ID. Assumes relName has already been normalized.
245
+ function makeRelParts(relName) {
246
+ return relName ? splitPrefix(relName) : [];
247
+ }
248
+
249
+ /**
250
+ * Makes a name map, normalizing the name, and using a plugin
251
+ * for normalization if necessary. Grabs a ref to plugin
252
+ * too, as an optimization.
253
+ */
254
+ makeMap = function (name, relParts) {
255
+ var plugin,
256
+ parts = splitPrefix(name),
257
+ prefix = parts[0],
258
+ relResourceName = relParts[1];
259
+
260
+ name = parts[1];
261
+
262
+ if (prefix) {
263
+ prefix = normalize(prefix, relResourceName);
264
+ plugin = callDep(prefix);
265
+ }
266
+
267
+ //Normalize according
268
+ if (prefix) {
269
+ if (plugin && plugin.normalize) {
270
+ name = plugin.normalize(name, makeNormalize(relResourceName));
271
+ } else {
272
+ name = normalize(name, relResourceName);
273
+ }
274
+ } else {
275
+ name = normalize(name, relResourceName);
276
+ parts = splitPrefix(name);
277
+ prefix = parts[0];
278
+ name = parts[1];
279
+ if (prefix) {
280
+ plugin = callDep(prefix);
281
+ }
282
+ }
283
+
284
+ //Using ridiculous property names for space reasons
285
+ return {
286
+ f: prefix ? prefix + '!' + name : name, //fullName
287
+ n: name,
288
+ pr: prefix,
289
+ p: plugin
290
+ };
291
+ };
292
+
293
+ function makeConfig(name) {
294
+ return function () {
295
+ return (config && config.config && config.config[name]) || {};
296
+ };
297
+ }
298
+
299
+ handlers = {
300
+ require: function (name) {
301
+ return makeRequire(name);
302
+ },
303
+ exports: function (name) {
304
+ var e = defined[name];
305
+ if (typeof e !== 'undefined') {
306
+ return e;
307
+ } else {
308
+ return (defined[name] = {});
309
+ }
310
+ },
311
+ module: function (name) {
312
+ return {
313
+ id: name,
314
+ uri: '',
315
+ exports: defined[name],
316
+ config: makeConfig(name)
317
+ };
318
+ }
319
+ };
320
+
321
+ main = function (name, deps, callback, relName) {
322
+ var cjsModule, depName, ret, map, i, relParts,
323
+ args = [],
324
+ callbackType = typeof callback,
325
+ usingExports;
326
+
327
+ //Use name if no relName
328
+ relName = relName || name;
329
+ relParts = makeRelParts(relName);
330
+
331
+ //Call the callback to define the module, if necessary.
332
+ if (callbackType === 'undefined' || callbackType === 'function') {
333
+ //Pull out the defined dependencies and pass the ordered
334
+ //values to the callback.
335
+ //Default to [require, exports, module] if no deps
336
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
337
+ for (i = 0; i < deps.length; i += 1) {
338
+ map = makeMap(deps[i], relParts);
339
+ depName = map.f;
340
+
341
+ //Fast path CommonJS standard dependencies.
342
+ if (depName === "require") {
343
+ args[i] = handlers.require(name);
344
+ } else if (depName === "exports") {
345
+ //CommonJS module spec 1.1
346
+ args[i] = handlers.exports(name);
347
+ usingExports = true;
348
+ } else if (depName === "module") {
349
+ //CommonJS module spec 1.1
350
+ cjsModule = args[i] = handlers.module(name);
351
+ } else if (hasProp(defined, depName) ||
352
+ hasProp(waiting, depName) ||
353
+ hasProp(defining, depName)) {
354
+ args[i] = callDep(depName);
355
+ } else if (map.p) {
356
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
357
+ args[i] = defined[depName];
358
+ } else {
359
+ throw new Error(name + ' missing ' + depName);
360
+ }
361
+ }
362
+
363
+ ret = callback ? callback.apply(defined[name], args) : undefined;
364
+
365
+ if (name) {
366
+ //If setting exports via "module" is in play,
367
+ //favor that over return value and exports. After that,
368
+ //favor a non-undefined return value over exports use.
369
+ if (cjsModule && cjsModule.exports !== undef &&
370
+ cjsModule.exports !== defined[name]) {
371
+ defined[name] = cjsModule.exports;
372
+ } else if (ret !== undef || !usingExports) {
373
+ //Use the return value from the function.
374
+ defined[name] = ret;
375
+ }
376
+ }
377
+ } else if (name) {
378
+ //May just be an object definition for the module. Only
379
+ //worry about defining if have a module name.
380
+ defined[name] = callback;
381
+ }
382
+ };
383
+
384
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
385
+ if (typeof deps === "string") {
386
+ if (handlers[deps]) {
387
+ //callback in this case is really relName
388
+ return handlers[deps](callback);
389
+ }
390
+ //Just return the module wanted. In this scenario, the
391
+ //deps arg is the module name, and second arg (if passed)
392
+ //is just the relName.
393
+ //Normalize module name, if it contains . or ..
394
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
395
+ } else if (!deps.splice) {
396
+ //deps is a config object, not an array.
397
+ config = deps;
398
+ if (config.deps) {
399
+ req(config.deps, config.callback);
400
+ }
401
+ if (!callback) {
402
+ return;
403
+ }
404
+
405
+ if (callback.splice) {
406
+ //callback is an array, which means it is a dependency list.
407
+ //Adjust args if there are dependencies
408
+ deps = callback;
409
+ callback = relName;
410
+ relName = null;
411
+ } else {
412
+ deps = undef;
413
+ }
414
+ }
415
+
416
+ //Support require(['a'])
417
+ callback = callback || function () {};
418
+
419
+ //If relName is a function, it is an errback handler,
420
+ //so remove it.
421
+ if (typeof relName === 'function') {
422
+ relName = forceSync;
423
+ forceSync = alt;
424
+ }
425
+
426
+ //Simulate async callback;
427
+ if (forceSync) {
428
+ main(undef, deps, callback, relName);
429
+ } else {
430
+ //Using a non-zero value because of concern for what old browsers
431
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
432
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
433
+ //If want a value immediately, use require('id') instead -- something
434
+ //that works in almond on the global level, but not guaranteed and
435
+ //unlikely to work in other AMD implementations.
436
+ setTimeout(function () {
437
+ main(undef, deps, callback, relName);
438
+ }, 4);
439
+ }
440
+
441
+ return req;
442
+ };
443
+
444
+ /**
445
+ * Just drops the config on the floor, but returns req in case
446
+ * the config return value is used.
447
+ */
448
+ req.config = function (cfg) {
449
+ return req(cfg);
450
+ };
451
+
452
+ /**
453
+ * Expose module registry for debugging and tooling
454
+ */
455
+ requirejs._defined = defined;
456
+
457
+ define = function (name, deps, callback) {
458
+ if (typeof name !== 'string') {
459
+ throw new Error('See almond README: incorrect module build, no module name');
460
+ }
461
+
462
+ //This module may not have dependencies
463
+ if (!deps.splice) {
464
+ //deps is not an array, so probably means
465
+ //an object literal or factory function for
466
+ //the value. Adjust args.
467
+ callback = deps;
468
+ deps = [];
469
+ }
470
+
471
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
472
+ waiting[name] = [name, deps, callback];
473
+ }
474
+ };
475
+
476
+ define.amd = {
477
+ jQuery: true
478
+ };
479
+ }());
480
+
481
+ S2.requirejs = requirejs;S2.require = require;S2.define = define;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
482
  }
483
+ }());
484
+ S2.define("almond", function(){});
485
 
486
+ /* global jQuery:false, $:false */
487
+ S2.define('jquery',[],function () {
488
+ var _$ = jQuery || $;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
489
 
490
+ if (_$ == null && console && console.error) {
491
+ console.error(
492
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
493
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
494
+ 'web page.'
495
+ );
496
+ }
497
 
498
+ return _$;
499
+ });
500
 
501
+ S2.define('select2/utils',[
502
+ 'jquery'
503
+ ], function ($) {
504
+ var Utils = {};
505
 
506
+ Utils.Extend = function (ChildClass, SuperClass) {
507
+ var __hasProp = {}.hasOwnProperty;
508
 
509
+ function BaseConstructor () {
510
+ this.constructor = ChildClass;
511
+ }
512
 
513
+ for (var key in SuperClass) {
514
+ if (__hasProp.call(SuperClass, key)) {
515
+ ChildClass[key] = SuperClass[key];
516
+ }
517
+ }
518
 
519
+ BaseConstructor.prototype = SuperClass.prototype;
520
+ ChildClass.prototype = new BaseConstructor();
521
+ ChildClass.__super__ = SuperClass.prototype;
522
 
523
+ return ChildClass;
524
+ };
 
 
 
 
 
 
 
525
 
526
+ function getMethods (theClass) {
527
+ var proto = theClass.prototype;
528
 
529
+ var methods = [];
530
 
531
+ for (var methodName in proto) {
532
+ var m = proto[methodName];
533
 
534
+ if (typeof m !== 'function') {
535
+ continue;
536
+ }
537
 
538
+ if (methodName === 'constructor') {
539
+ continue;
540
+ }
541
 
542
+ methods.push(methodName);
543
+ }
544
 
545
+ return methods;
546
+ }
 
547
 
548
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
549
+ var decoratedMethods = getMethods(DecoratorClass);
550
+ var superMethods = getMethods(SuperClass);
551
 
552
+ function DecoratedClass () {
553
+ var unshift = Array.prototype.unshift;
554
 
555
+ var argCount = DecoratorClass.prototype.constructor.length;
 
 
556
 
557
+ var calledConstructor = SuperClass.prototype.constructor;
 
 
558
 
559
+ if (argCount > 0) {
560
+ unshift.call(arguments, SuperClass.prototype.constructor);
 
561
 
562
+ calledConstructor = DecoratorClass.prototype.constructor;
563
+ }
564
 
565
+ calledConstructor.apply(this, arguments);
566
+ }
567
 
568
+ DecoratorClass.displayName = SuperClass.displayName;
569
 
570
+ function ctr () {
571
+ this.constructor = DecoratedClass;
572
+ }
573
 
574
+ DecoratedClass.prototype = new ctr();
 
575
 
576
+ for (var m = 0; m < superMethods.length; m++) {
577
+ var superMethod = superMethods[m];
578
 
579
+ DecoratedClass.prototype[superMethod] =
580
+ SuperClass.prototype[superMethod];
581
+ }
582
 
583
+ var calledMethod = function (methodName) {
584
+ // Stub out the original method if it's not decorating an actual method
585
+ var originalMethod = function () {};
586
 
587
+ if (methodName in DecoratedClass.prototype) {
588
+ originalMethod = DecoratedClass.prototype[methodName];
589
+ }
590
 
591
+ var decoratedMethod = DecoratorClass.prototype[methodName];
 
 
 
 
 
592
 
593
+ return function () {
594
+ var unshift = Array.prototype.unshift;
 
595
 
596
+ unshift.call(arguments, originalMethod);
597
 
598
+ return decoratedMethod.apply(this, arguments);
599
+ };
600
+ };
 
601
 
602
+ for (var d = 0; d < decoratedMethods.length; d++) {
603
+ var decoratedMethod = decoratedMethods[d];
 
 
604
 
605
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
606
+ }
607
 
608
+ return DecoratedClass;
609
+ };
 
610
 
611
+ var Observable = function () {
612
+ this.listeners = {};
613
+ };
 
614
 
615
+ Observable.prototype.on = function (event, callback) {
616
+ this.listeners = this.listeners || {};
 
 
 
617
 
618
+ if (event in this.listeners) {
619
+ this.listeners[event].push(callback);
620
+ } else {
621
+ this.listeners[event] = [callback];
622
+ }
623
+ };
624
 
625
+ Observable.prototype.trigger = function (event) {
626
+ var slice = Array.prototype.slice;
627
+ var params = slice.call(arguments, 1);
628
 
629
+ this.listeners = this.listeners || {};
 
 
 
630
 
631
+ // Params should always come in as an array
632
+ if (params == null) {
633
+ params = [];
634
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
635
 
636
+ // If there are no arguments to the event, use a temporary object
637
+ if (params.length === 0) {
638
+ params.push({});
639
+ }
640
 
641
+ // Set the `_type` of the first object to the event
642
+ params[0]._type = event;
 
 
 
 
 
 
643
 
644
+ if (event in this.listeners) {
645
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
646
+ }
647
 
648
+ if ('*' in this.listeners) {
649
+ this.invoke(this.listeners['*'], arguments);
650
+ }
651
+ };
652
 
653
+ Observable.prototype.invoke = function (listeners, params) {
654
+ for (var i = 0, len = listeners.length; i < len; i++) {
655
+ listeners[i].apply(this, params);
656
+ }
657
+ };
658
 
659
+ Utils.Observable = Observable;
 
 
660
 
661
+ Utils.generateChars = function (length) {
662
+ var chars = '';
663
 
664
+ for (var i = 0; i < length; i++) {
665
+ var randomChar = Math.floor(Math.random() * 36);
666
+ chars += randomChar.toString(36);
667
+ }
668
 
669
+ return chars;
670
+ };
 
671
 
672
+ Utils.bind = function (func, context) {
673
+ return function () {
674
+ func.apply(context, arguments);
675
+ };
676
+ };
677
+
678
+ Utils._convertData = function (data) {
679
+ for (var originalKey in data) {
680
+ var keys = originalKey.split('-');
681
+
682
+ var dataLevel = data;
683
+
684
+ if (keys.length === 1) {
685
+ continue;
686
+ }
687
+
688
+ for (var k = 0; k < keys.length; k++) {
689
+ var key = keys[k];
690
+
691
+ // Lowercase the first letter
692
+ // By default, dash-separated becomes camelCase
693
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
694
+
695
+ if (!(key in dataLevel)) {
696
+ dataLevel[key] = {};
697
+ }
698
+
699
+ if (k == keys.length - 1) {
700
+ dataLevel[key] = data[originalKey];
701
+ }
702
+
703
+ dataLevel = dataLevel[key];
704
+ }
705
+
706
+ delete data[originalKey];
707
+ }
708
+
709
+ return data;
710
+ };
711
+
712
+ Utils.hasScroll = function (index, el) {
713
+ // Adapted from the function created by @ShadowScripter
714
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
715
+ // The original code can be found at
716
+ // http://codereview.stackexchange.com/q/13338
717
+ // and was designed to be used with the Sizzle selector engine.
718
+
719
+ var $el = $(el);
720
+ var overflowX = el.style.overflowX;
721
+ var overflowY = el.style.overflowY;
722
+
723
+ //Check both x and y declarations
724
+ if (overflowX === overflowY &&
725
+ (overflowY === 'hidden' || overflowY === 'visible')) {
726
+ return false;
727
+ }
728
+
729
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
730
+ return true;
731
+ }
732
+
733
+ return ($el.innerHeight() < el.scrollHeight ||
734
+ $el.innerWidth() < el.scrollWidth);
735
+ };
736
+
737
+ Utils.escapeMarkup = function (markup) {
738
+ var replaceMap = {
739
+ '\\': '&#92;',
740
+ '&': '&amp;',
741
+ '<': '&lt;',
742
+ '>': '&gt;',
743
+ '"': '&quot;',
744
+ '\'': '&#39;',
745
+ '/': '&#47;'
746
+ };
747
+
748
+ // Do not try to escape the markup if it's not a string
749
+ if (typeof markup !== 'string') {
750
+ return markup;
751
+ }
752
+
753
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
754
+ return replaceMap[match];
755
+ });
756
+ };
757
+
758
+ // Append an array of jQuery nodes to a given element.
759
+ Utils.appendMany = function ($element, $nodes) {
760
+ // jQuery 1.7.x does not support $.fn.append() with an array
761
+ // Fall back to a jQuery object collection using $.fn.add()
762
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
763
+ var $jqNodes = $();
764
+
765
+ $.map($nodes, function (node) {
766
+ $jqNodes = $jqNodes.add(node);
767
+ });
768
 
769
+ $nodes = $jqNodes;
770
+ }
771
 
772
+ $element.append($nodes);
773
+ };
 
 
774
 
775
+ // Determine whether the browser is on a touchscreen device.
776
+ Utils.isTouchscreen = function() {
777
+ if ('undefined' === typeof Utils._isTouchscreenCache) {
778
+ Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
779
+ }
780
+ return Utils._isTouchscreenCache;
781
+ }
782
 
783
+ return Utils;
784
+ });
 
 
 
785
 
786
+ S2.define('select2/results',[
787
+ 'jquery',
788
+ './utils'
789
+ ], function ($, Utils) {
790
+ function Results ($element, options, dataAdapter) {
791
+ this.$element = $element;
792
+ this.data = dataAdapter;
793
+ this.options = options;
794
 
795
+ Results.__super__.constructor.call(this);
796
+ }
797
+
798
+ Utils.Extend(Results, Utils.Observable);
799
+
800
+ Results.prototype.render = function () {
801
+ var $results = $(
802
+ '<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>'
803
+ );
804
+
805
+ if (this.options.get('multiple')) {
806
+ $results.attr('aria-multiselectable', 'true');
807
+ }
808
+
809
+ this.$results = $results;
810
+
811
+ return $results;
812
+ };
813
+
814
+ Results.prototype.clear = function () {
815
+ this.$results.empty();
816
+ };
817
 
818
+ Results.prototype.displayMessage = function (params) {
819
+ var escapeMarkup = this.options.get('escapeMarkup');
 
820
 
821
+ this.clear();
822
+ this.hideLoading();
823
 
824
+ var $message = $(
825
+ '<li role="alert" aria-live="assertive"' +
826
+ ' class="select2-results__option"></li>'
827
+ );
828
 
829
+ var message = this.options.get('translations').get(params.message);
 
 
 
 
 
830
 
831
+ $message.append(
832
+ escapeMarkup(
833
+ message(params.args)
834
+ )
835
+ );
836
 
837
+ $message[0].className += ' select2-results__message';
838
 
839
+ this.$results.append($message);
840
+ };
841
 
842
+ Results.prototype.hideMessages = function () {
843
+ this.$results.find('.select2-results__message').remove();
844
+ };
845
 
846
+ Results.prototype.append = function (data) {
847
+ this.hideLoading();
848
 
849
+ var $options = [];
 
850
 
851
+ if (data.results == null || data.results.length === 0) {
852
+ if (this.$results.children().length === 0) {
853
+ this.trigger('results:message', {
854
+ message: 'noResults'
855
+ });
856
+ }
857
 
858
+ return;
859
+ }
860
 
861
+ data.results = this.sort(data.results);
 
862
 
863
+ for (var d = 0; d < data.results.length; d++) {
864
+ var item = data.results[d];
 
865
 
866
+ var $option = this.option(item);
867
 
868
+ $options.push($option);
869
+ }
 
 
 
 
 
 
 
870
 
871
+ this.$results.append($options);
872
+ };
873
 
874
+ Results.prototype.position = function ($results, $dropdown) {
875
+ var $resultsContainer = $dropdown.find('.select2-results');
876
+ $resultsContainer.append($results);
877
+ };
878
 
879
+ Results.prototype.sort = function (data) {
880
+ var sorter = this.options.get('sorter');
 
 
881
 
882
+ return sorter(data);
883
+ };
884
 
885
+ Results.prototype.highlightFirstItem = function () {
886
+ var $options = this.$results
887
+ .find('.select2-results__option[data-selected]');
888
 
889
+ var $selected = $options.filter('[data-selected=true]');
890
 
891
+ // Check if there are any selected options
892
+ if ($selected.length > 0) {
893
+ // If there are selected options, highlight the first
894
+ $selected.first().trigger('mouseenter');
895
+ } else {
896
+ // If there are no selected options, highlight the first option
897
+ // in the dropdown
898
+ $options.first().trigger('mouseenter');
899
+ }
900
 
901
+ this.ensureHighlightVisible();
902
+ };
 
 
 
 
 
903
 
904
+ Results.prototype.setClasses = function () {
905
+ var self = this;
906
 
907
+ this.data.current(function (selected) {
908
+ var selectedIds = $.map(selected, function (s) {
909
+ return s.id.toString();
910
+ });
911
 
912
+ var $options = self.$results
913
+ .find('.select2-results__option[data-selected]');
914
 
915
+ $options.each(function () {
916
+ var $option = $(this);
 
 
 
 
 
917
 
918
+ var item = $.data(this, 'data');
 
919
 
920
+ // id needs to be converted to a string when comparing
921
+ var id = '' + item.id;
 
922
 
923
+ if ((item.element != null && item.element.selected) ||
924
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
925
+ $option.attr('data-selected', 'true');
926
+ } else {
927
+ $option.attr('data-selected', 'false');
928
+ }
929
+ });
930
 
931
+ });
932
+ };
 
 
 
933
 
934
+ Results.prototype.showLoading = function (params) {
935
+ this.hideLoading();
 
 
936
 
937
+ var loadingMore = this.options.get('translations').get('searching');
 
 
938
 
939
+ var loading = {
940
+ disabled: true,
941
+ loading: true,
942
+ text: loadingMore(params)
943
+ };
944
+ var $loading = this.option(loading);
945
+ $loading.className += ' loading-results';
946
 
947
+ this.$results.prepend($loading);
948
+ };
 
949
 
950
+ Results.prototype.hideLoading = function () {
951
+ this.$results.find('.loading-results').remove();
952
+ };
 
953
 
954
+ Results.prototype.option = function (data) {
955
+ var option = document.createElement('li');
956
+ option.className = 'select2-results__option';
957
 
958
+ var attrs = {
959
+ 'role': 'option',
960
+ 'data-selected': 'false',
961
+ 'tabindex': -1
962
+ };
963
 
964
+ if (data.disabled) {
965
+ delete attrs['data-selected'];
966
+ attrs['aria-disabled'] = 'true';
967
+ }
968
 
969
+ if (data.id == null) {
970
+ delete attrs['data-selected'];
971
+ }
972
 
973
+ if (data._resultId != null) {
974
+ option.id = data._resultId;
975
+ }
976
 
977
+ if (data.title) {
978
+ option.title = data.title;
979
+ }
980
 
981
+ if (data.children) {
982
+ attrs['aria-label'] = data.text;
983
+ delete attrs['data-selected'];
984
+ }
985
 
986
+ for (var attr in attrs) {
987
+ var val = attrs[attr];
988
 
989
+ option.setAttribute(attr, val);
990
+ }
991
+
992
+ if (data.children) {
993
+ var $option = $(option);
 
994
 
995
+ var label = document.createElement('strong');
996
+ label.className = 'select2-results__group';
 
 
 
997
 
998
+ var $label = $(label);
999
+ this.template(data, label);
1000
+ $label.attr('role', 'presentation');
1001
 
1002
+ var $children = [];
 
1003
 
1004
+ for (var c = 0; c < data.children.length; c++) {
1005
+ var child = data.children[c];
1006
 
1007
+ var $child = this.option(child);
1008
 
1009
+ $children.push($child);
1010
+ }
1011
 
1012
+ var $childrenContainer = $('<ul></ul>', {
1013
+ 'class': 'select2-results__options select2-results__options--nested',
1014
+ 'role': 'listbox'
1015
+ });
1016
+ $childrenContainer.append($children);
1017
+ $option.attr('role', 'list');
1018
 
1019
+ $option.append(label);
1020
+ $option.append($childrenContainer);
1021
+ } else {
1022
+ this.template(data, option);
1023
+ }
1024
 
1025
+ $.data(option, 'data', data);
 
1026
 
1027
+ return option;
1028
+ };
 
 
1029
 
1030
+ Results.prototype.bind = function (container, $container) {
1031
+ var self = this;
 
 
1032
 
1033
+ var id = container.id + '-results';
 
 
 
1034
 
1035
+ this.$results.attr('id', id);
 
 
1036
 
1037
+ container.on('results:all', function (params) {
1038
+ self.clear();
1039
+ self.append(params.data);
 
1040
 
1041
+ if (container.isOpen()) {
1042
+ self.setClasses();
1043
+ self.highlightFirstItem();
1044
+ }
1045
+ });
1046
 
1047
+ container.on('results:append', function (params) {
1048
+ self.append(params.data);
 
 
1049
 
1050
+ if (container.isOpen()) {
1051
+ self.setClasses();
1052
+ }
1053
+ });
1054
 
1055
+ container.on('query', function (params) {
1056
+ self.hideMessages();
1057
+ self.showLoading(params);
1058
+ });
 
 
1059
 
1060
+ container.on('select', function () {
1061
+ if (!container.isOpen()) {
1062
+ return;
1063
+ }
1064
 
1065
+ self.setClasses();
1066
+ self.highlightFirstItem();
1067
+ });
1068
 
1069
+ container.on('unselect', function () {
1070
+ if (!container.isOpen()) {
1071
+ return;
1072
+ }
1073
 
1074
+ self.setClasses();
1075
+ self.highlightFirstItem();
1076
+ });
1077
 
1078
+ container.on('open', function () {
1079
+ // When the dropdown is open, aria-expended="true"
1080
+ self.$results.attr('aria-expanded', 'true');
1081
+ self.$results.attr('aria-hidden', 'false');
1082
 
1083
+ self.setClasses();
1084
+ self.ensureHighlightVisible();
1085
+ });
1086
 
1087
+ container.on('close', function () {
1088
+ // When the dropdown is closed, aria-expended="false"
1089
+ self.$results.attr('aria-expanded', 'false');
1090
+ self.$results.attr('aria-hidden', 'true');
1091
+ self.$results.removeAttr('aria-activedescendant');
1092
+ });
 
 
1093
 
1094
+ container.on('results:toggle', function () {
1095
+ var $highlighted = self.getHighlightedResults();
1096
 
1097
+ if ($highlighted.length === 0) {
1098
+ return;
1099
+ }
1100
 
1101
+ $highlighted.trigger('mouseup');
1102
+ });
1103
 
1104
+ container.on('results:select', function () {
1105
+ var $highlighted = self.getHighlightedResults();
 
 
1106
 
1107
+ if ($highlighted.length === 0) {
1108
+ return;
1109
+ }
1110
 
1111
+ var data = $highlighted.data('data');
 
 
 
1112
 
1113
+ if ($highlighted.attr('data-selected') == 'true') {
1114
+ self.trigger('close', {});
1115
+ } else {
1116
+ self.trigger('select', {
1117
+ data: data
1118
+ });
1119
+ }
1120
+ });
1121
 
1122
+ container.on('results:previous', function () {
1123
+ var $highlighted = self.getHighlightedResults();
 
1124
 
1125
+ var $options = self.$results.find('[data-selected]');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1126
 
1127
+ var currentIndex = $options.index($highlighted);
 
 
 
 
 
1128
 
1129
+ // If we are already at te top, don't move further
1130
+ if (currentIndex === 0) {
1131
+ return;
1132
+ }
1133
 
1134
+ var nextIndex = currentIndex - 1;
 
 
 
1135
 
1136
+ // If none are highlighted, highlight the first
1137
+ if ($highlighted.length === 0) {
1138
+ nextIndex = 0;
1139
+ }
 
 
1140
 
1141
+ var $next = $options.eq(nextIndex);
1142
+
1143
+ $next.trigger('mouseenter');
 
1144
 
1145
+ var currentOffset = self.$results.offset().top;
1146
+ var nextTop = $next.offset().top;
1147
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1148
 
1149
+ if (nextIndex === 0) {
1150
+ self.$results.scrollTop(0);
1151
+ } else if (nextTop - currentOffset < 0) {
1152
+ self.$results.scrollTop(nextOffset);
1153
+ }
1154
+ });
1155
+
1156
+ container.on('results:next', function () {
1157
+ var $highlighted = self.getHighlightedResults();
1158
+
1159
+ var $options = self.$results.find('[data-selected]');
1160
+
1161
+ var currentIndex = $options.index($highlighted);
1162
+
1163
+ var nextIndex = currentIndex + 1;
1164
 
1165
+ // If we are at the last option, stay there
1166
+ if (nextIndex >= $options.length) {
1167
+ return;
1168
+ }
1169
+
1170
+ var $next = $options.eq(nextIndex);
1171
 
1172
+ $next.trigger('mouseenter');
 
1173
 
1174
+ var currentOffset = self.$results.offset().top +
1175
+ self.$results.outerHeight(false);
1176
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
1177
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1178
 
1179
+ if (nextIndex === 0) {
1180
+ self.$results.scrollTop(0);
1181
+ } else if (nextBottom > currentOffset) {
1182
+ self.$results.scrollTop(nextOffset);
1183
+ }
1184
+ });
1185
 
1186
+ container.on('results:focus', function (params) {
1187
+ params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
1188
+ self.$results.attr('aria-activedescendant', params.element.attr('id'));
1189
+ });
 
1190
 
1191
+ container.on('results:message', function (params) {
1192
+ self.displayMessage(params);
1193
+ });
1194
 
1195
+ if ($.fn.mousewheel) {
1196
+ this.$results.on('mousewheel', function (e) {
1197
+ var top = self.$results.scrollTop();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1198
 
1199
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
1200
 
1201
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1202
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
 
 
 
 
1203
 
1204
+ if (isAtTop) {
1205
+ self.$results.scrollTop(0);
1206
 
1207
+ e.preventDefault();
1208
+ e.stopPropagation();
1209
+ } else if (isAtBottom) {
1210
+ self.$results.scrollTop(
1211
+ self.$results.get(0).scrollHeight - self.$results.height()
1212
+ );
1213
 
1214
+ e.preventDefault();
1215
+ e.stopPropagation();
1216
+ }
1217
+ });
1218
+ }
1219
 
1220
+ this.$results.on('mouseup', '.select2-results__option[data-selected]',
1221
+ function (evt) {
1222
+ var $this = $(this);
1223
 
1224
+ var data = $this.data('data');
1225
+
1226
+ if ($this.attr('data-selected') === 'true') {
1227
+ if (self.options.get('multiple')) {
1228
+ self.trigger('unselect', {
1229
+ originalEvent: evt,
1230
+ data: data
1231
+ });
1232
+ } else {
1233
+ self.trigger('close', {});
1234
+ }
1235
+
1236
+ return;
1237
+ }
1238
+
1239
+ self.trigger('select', {
1240
+ originalEvent: evt,
1241
+ data: data
1242
+ });
1243
+ });
1244
+
1245
+ this.$results.on('mouseenter', '.select2-results__option[data-selected]',
1246
+ function (evt) {
1247
+ var data = $(this).data('data');
1248
+
1249
+ self.getHighlightedResults()
1250
+ .removeClass('select2-results__option--highlighted')
1251
+ .attr('aria-selected', 'false');
1252
+
1253
+ self.trigger('results:focus', {
1254
+ data: data,
1255
+ element: $(this)
1256
+ });
1257
+ });
1258
+ };
1259
+
1260
+ Results.prototype.getHighlightedResults = function () {
1261
+ var $highlighted = this.$results
1262
+ .find('.select2-results__option--highlighted');
1263
+
1264
+ return $highlighted;
1265
+ };
1266
+
1267
+ Results.prototype.destroy = function () {
1268
+ this.$results.remove();
1269
+ };
1270
+
1271
+ Results.prototype.ensureHighlightVisible = function () {
1272
+ var $highlighted = this.getHighlightedResults();
1273
+
1274
+ if ($highlighted.length === 0) {
1275
+ return;
1276
+ }
1277
+
1278
+ var $options = this.$results.find('[data-selected]');
1279
+
1280
+ var currentIndex = $options.index($highlighted);
1281
+
1282
+ var currentOffset = this.$results.offset().top;
1283
+ var nextTop = $highlighted.offset().top;
1284
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1285
+
1286
+ var offsetDelta = nextTop - currentOffset;
1287
+ nextOffset -= $highlighted.outerHeight(false) * 2;
1288
+
1289
+ if (currentIndex <= 2) {
1290
+ this.$results.scrollTop(0);
1291
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1292
+ this.$results.scrollTop(nextOffset);
1293
+ }
1294
+ };
1295
+
1296
+ Results.prototype.template = function (result, container) {
1297
+ var template = this.options.get('templateResult');
1298
+ var escapeMarkup = this.options.get('escapeMarkup');
1299
+
1300
+ var content = template(result, container);
1301
+
1302
+ if (content == null) {
1303
+ container.style.display = 'none';
1304
+ } else if (typeof content === 'string') {
1305
+ container.innerHTML = escapeMarkup(content);
1306
+ } else {
1307
+ $(container).append(content);
1308
+ }
1309
+ };
1310
+
1311
+ return Results;
1312
+ });
1313
+
1314
+ S2.define('select2/keys',[
1315
+
1316
+ ], function () {
1317
+ var KEYS = {
1318
+ BACKSPACE: 8,
1319
+ TAB: 9,
1320
+ ENTER: 13,
1321
+ SHIFT: 16,
1322
+ CTRL: 17,
1323
+ ALT: 18,
1324
+ ESC: 27,
1325
+ SPACE: 32,
1326
+ PAGE_UP: 33,
1327
+ PAGE_DOWN: 34,
1328
+ END: 35,
1329
+ HOME: 36,
1330
+ LEFT: 37,
1331
+ UP: 38,
1332
+ RIGHT: 39,
1333
+ DOWN: 40,
1334
+ DELETE: 46
1335
+ };
1336
+
1337
+ return KEYS;
1338
+ });
1339
+
1340
+ S2.define('select2/selection/base',[
1341
+ 'jquery',
1342
+ '../utils',
1343
+ '../keys'
1344
+ ], function ($, Utils, KEYS) {
1345
+ function BaseSelection ($element, options) {
1346
+ this.$element = $element;
1347
+ this.options = options;
1348
+
1349
+ BaseSelection.__super__.constructor.call(this);
1350
+ }
1351
+
1352
+ Utils.Extend(BaseSelection, Utils.Observable);
1353
+
1354
+ BaseSelection.prototype.render = function () {
1355
+ var $selection = $(
1356
+ '<span class="select2-selection" ' +
1357
+ ' aria-haspopup="true" aria-expanded="false">' +
1358
+ '</span>'
1359
+ );
1360
+
1361
+ this._tabindex = 0;
1362
+
1363
+ if (this.$element.data('old-tabindex') != null) {
1364
+ this._tabindex = this.$element.data('old-tabindex');
1365
+ } else if (this.$element.attr('tabindex') != null) {
1366
+ this._tabindex = this.$element.attr('tabindex');
1367
+ }
1368
+
1369
+ $selection.attr('title', this.$element.attr('title'));
1370
+ $selection.attr('tabindex', this._tabindex);
1371
+
1372
+ this.$selection = $selection;
1373
+
1374
+ return $selection;
1375
+ };
1376
+
1377
+ BaseSelection.prototype.bind = function (container, $container) {
1378
+ var self = this;
1379
+
1380
+ var id = container.id + '-container';
1381
+ var resultsId = container.id + '-results';
1382
+ var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
1383
+
1384
+ this.container = container;
1385
+
1386
+ this.$selection.on('focus', function (evt) {
1387
+ self.trigger('focus', evt);
1388
+ });
1389
+
1390
+ this.$selection.on('blur', function (evt) {
1391
+ self._handleBlur(evt);
1392
+ });
1393
+
1394
+ this.$selection.on('keydown', function (evt) {
1395
+ self.trigger('keypress', evt);
1396
+
1397
+ if (evt.which === KEYS.SPACE) {
1398
+ evt.preventDefault();
1399
+ }
1400
+ });
1401
+
1402
+ container.on('results:focus', function (params) {
1403
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
1404
+ });
1405
+
1406
+ container.on('selection:update', function (params) {
1407
+ self.update(params.data);
1408
+ });
1409
+
1410
+ container.on('open', function () {
1411
+ // When the dropdown is open, aria-expanded="true"
1412
+ self.$selection.attr('aria-expanded', 'true');
1413
+ self.$selection.attr('aria-owns', resultsId);
1414
+
1415
+ self._attachCloseHandler(container);
1416
+ });
1417
+
1418
+ container.on('close', function () {
1419
+ // When the dropdown is closed, aria-expanded="false"
1420
+ self.$selection.attr('aria-expanded', 'false');
1421
+ self.$selection.removeAttr('aria-activedescendant');
1422
+ self.$selection.removeAttr('aria-owns');
1423
+
1424
+ // This needs to be delayed as the active element is the body when the
1425
+ // key is pressed.
1426
+ window.setTimeout(function () {
1427
+ self.$selection.focus();
1428
+ }, 1);
1429
+
1430
+ self._detachCloseHandler(container);
1431
+ });
1432
+
1433
+ container.on('enable', function () {
1434
+ self.$selection.attr('tabindex', self._tabindex);
1435
+ });
1436
+
1437
+ container.on('disable', function () {
1438
+ self.$selection.attr('tabindex', '-1');
1439
+ });
1440
+ };
1441
+
1442
+ BaseSelection.prototype._handleBlur = function (evt) {
1443
+ var self = this;
1444
 
1445
+ // This needs to be delayed as the active element is the body when the tab
1446
+ // key is pressed, possibly along with others.
1447
+ window.setTimeout(function () {
1448
+ // Don't trigger `blur` if the focus is still in the selection
1449
+ if (
1450
+ (document.activeElement == self.$selection[0]) ||
1451
+ ($.contains(self.$selection[0], document.activeElement))
1452
+ ) {
1453
+ return;
1454
+ }
1455
+
1456
+ self.trigger('blur', evt);
1457
+ }, 1);
1458
+ };
1459
 
1460
+ BaseSelection.prototype._attachCloseHandler = function (container) {
1461
+ var self = this;
1462
+
1463
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
1464
+ var $target = $(e.target);
1465
+
1466
+ var $select = $target.closest('.select2');
1467
 
1468
+ var $all = $('.select2.select2-container--open');
1469
+
1470
+ $all.each(function () {
1471
+ var $this = $(this);
1472
+
1473
+ if (this == $select[0]) {
1474
+ return;
1475
+ }
1476
+
1477
+ var $element = $this.data('element');
1478
+ $element.select2('close');
1479
+
1480
+ // Remove any focus when dropdown is closed by clicking outside the select area.
1481
+ // Timeout of 1 required for close to finish wrapping up.
1482
+ setTimeout(function(){
1483
+ $this.find('*:focus').blur();
1484
+ $target.focus();
1485
+ }, 1);
1486
+ });
1487
+ });
1488
+ };
1489
+
1490
+ BaseSelection.prototype._detachCloseHandler = function (container) {
1491
+ $(document.body).off('mousedown.select2.' + container.id);
1492
+ };
1493
+
1494
+ BaseSelection.prototype.position = function ($selection, $container) {
1495
+ var $selectionContainer = $container.find('.selection');
1496
+ $selectionContainer.append($selection);
1497
+ };
1498
+
1499
+ BaseSelection.prototype.destroy = function () {
1500
+ this._detachCloseHandler(this.container);
1501
+ };
1502
+
1503
+ BaseSelection.prototype.update = function (data) {
1504
+ throw new Error('The `update` method must be defined in child classes.');
1505
+ };
1506
+
1507
+ return BaseSelection;
1508
+ });
1509
+
1510
+ S2.define('select2/selection/single',[
1511
+ 'jquery',
1512
+ './base',
1513
+ '../utils',
1514
+ '../keys'
1515
+ ], function ($, BaseSelection, Utils, KEYS) {
1516
+ function SingleSelection () {
1517
+ SingleSelection.__super__.constructor.apply(this, arguments);
1518
+ }
1519
+
1520
+ Utils.Extend(SingleSelection, BaseSelection);
1521
+
1522
+ SingleSelection.prototype.render = function () {
1523
+ var $selection = SingleSelection.__super__.render.call(this);
1524
+
1525
+ $selection.addClass('select2-selection--single');
1526
+
1527
+ $selection.html(
1528
+ '<span class="select2-selection__rendered"></span>' +
1529
+ '<span class="select2-selection__arrow" role="presentation">' +
1530
+ '<b role="presentation"></b>' +
1531
+ '</span>'
1532
+ );
1533
+
1534
+ return $selection;
1535
+ };
1536
+
1537
+ SingleSelection.prototype.bind = function (container, $container) {
1538
+ var self = this;
1539
+
1540
+ SingleSelection.__super__.bind.apply(this, arguments);
1541
+
1542
+ var id = container.id + '-container';
1543
+
1544
+ this.$selection.find('.select2-selection__rendered')
1545
+ .attr('id', id)
1546
+ .attr('role', 'textbox')
1547
+ .attr('aria-readonly', 'true');
1548
+ this.$selection.attr('aria-labelledby', id);
1549
+
1550
+ // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
1551
+ this.$selection.attr('role', 'combobox');
1552
 
1553
+ this.$selection.on('mousedown', function (evt) {
1554
+ // Only respond to left clicks
1555
+ if (evt.which !== 1) {
1556
+ return;
1557
+ }
1558
 
1559
+ self.trigger('toggle', {
1560
+ originalEvent: evt
1561
+ });
1562
+ });
1563
+
1564
+ this.$selection.on('focus', function (evt) {
1565
+ // User focuses on the container
1566
+ });
1567
+
1568
+ this.$selection.on('keydown', function (evt) {
1569
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
1570
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
1571
+ container.open();
1572
+ }
1573
+ });
1574
+
1575
+ this.$selection.on('blur', function (evt) {
1576
+ // User exits the container
1577
+ });
1578
+
1579
+ container.on('focus', function (evt) {
1580
+ if (!container.isOpen()) {
1581
+ self.$selection.focus();
1582
+ }
1583
+ });
1584
+
1585
+ container.on('selection:update', function (params) {
1586
+ self.update(params.data);
1587
+ });
1588
+ };
1589
+
1590
+ SingleSelection.prototype.clear = function () {
1591
+ this.$selection.find('.select2-selection__rendered').empty();
1592
+ };
1593
+
1594
+ SingleSelection.prototype.display = function (data, container) {
1595
+ var template = this.options.get('templateSelection');
1596
+ var escapeMarkup = this.options.get('escapeMarkup');
1597
+
1598
+ return escapeMarkup(template(data, container));
1599
+ };
1600
+
1601
+ SingleSelection.prototype.selectionContainer = function () {
1602
+ return $('<span></span>');
1603
+ };
1604
+
1605
+ SingleSelection.prototype.update = function (data) {
1606
+ if (data.length === 0) {
1607
+ this.clear();
1608
+ return;
1609
+ }
1610
+
1611
+ var selection = data[0];
1612
+
1613
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1614
+ var formatted = this.display(selection, $rendered);
1615
+
1616
+ $rendered.empty().append(formatted);
1617
+ $rendered.prop('title', selection.title || selection.text);
1618
+ };
1619
+
1620
+ return SingleSelection;
1621
+ });
1622
+
1623
+ S2.define('select2/selection/multiple',[
1624
+ 'jquery',
1625
+ './base',
1626
+ '../utils'
1627
+ ], function ($, BaseSelection, Utils) {
1628
+ function MultipleSelection ($element, options) {
1629
+ MultipleSelection.__super__.constructor.apply(this, arguments);
1630
+ }
1631
+
1632
+ Utils.Extend(MultipleSelection, BaseSelection);
1633
+
1634
+ MultipleSelection.prototype.render = function () {
1635
+ var $selection = MultipleSelection.__super__.render.call(this);
1636
+
1637
+ $selection.addClass('select2-selection--multiple');
1638
+
1639
+ $selection.html(
1640
+ '<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'
1641
+ );
1642
+
1643
+ return $selection;
1644
+ };
1645
+
1646
+ MultipleSelection.prototype.bind = function (container, $container) {
1647
+ var self = this;
1648
+
1649
+ MultipleSelection.__super__.bind.apply(this, arguments);
1650
+
1651
+ this.$selection.on('click', function (evt) {
1652
+ self.trigger('toggle', {
1653
+ originalEvent: evt
1654
+ });
1655
+ });
1656
+
1657
+ this.$selection.on(
1658
+ 'click',
1659
+ '.select2-selection__choice__remove',
1660
+ function (evt) {
1661
+ // Ignore the event if it is disabled
1662
+ if (self.options.get('disabled')) {
1663
+ return;
1664
+ }
1665
+
1666
+ var $remove = $(this);
1667
+ var $selection = $remove.parent();
1668
+
1669
+ var data = $selection.data('data');
1670
+
1671
+ self.trigger('unselect', {
1672
+ originalEvent: evt,
1673
+ data: data
1674
+ });
1675
+ }
1676
+ );
1677
+
1678
+ this.$selection.on('keydown', function (evt) {
1679
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
1680
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
1681
+ container.open();
1682
+ }
1683
+ });
1684
+
1685
+ // Focus on the search field when the container is focused instead of the main container.
1686
+ container.on( 'focus', function(){
1687
+ self.focusOnSearch();
1688
+ });
1689
+ };
1690
+
1691
+ MultipleSelection.prototype.clear = function () {
1692
+ this.$selection.find('.select2-selection__rendered').empty();
1693
+ };
1694
+
1695
+ MultipleSelection.prototype.display = function (data, container) {
1696
+ var template = this.options.get('templateSelection');
1697
+ var escapeMarkup = this.options.get('escapeMarkup');
1698
+
1699
+ return escapeMarkup(template(data, container));
1700
+ };
1701
+
1702
+ MultipleSelection.prototype.selectionContainer = function () {
1703
+ var $container = $(
1704
+ '<li class="select2-selection__choice">' +
1705
+ '<span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">' +
1706
+ '&times;' +
1707
+ '</span>' +
1708
+ '</li>'
1709
+ );
1710
 
1711
+ return $container;
1712
+ };
1713
+
1714
+ /**
1715
+ * Focus on the search field instead of the main multiselect container.
1716
+ */
1717
+ MultipleSelection.prototype.focusOnSearch = function() {
1718
+ var self = this;
1719
+
1720
+ if ('undefined' !== typeof self.$search) {
1721
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
1722
+ setTimeout(function(){
1723
+ // Prevent the dropdown opening again when focused from this.
1724
+ // This gets reset automatically when focus is triggered.
1725
+ self._keyUpPrevented = true;
1726
 
1727
+ self.$search.focus();
1728
+ }, 1);
1729
+ }
1730
+ }
1731
 
1732
+ MultipleSelection.prototype.update = function (data) {
1733
+ this.clear();
1734
+
1735
+ if (data.length === 0) {
1736
+ return;
1737
+ }
1738
+
1739
+ var $selections = [];
1740
+
1741
+ for (var d = 0; d < data.length; d++) {
1742
+ var selection = data[d];
1743
+
1744
+ var $selection = this.selectionContainer();
1745
+ var formatted = this.display(selection, $selection);
1746
+ if ('string' === typeof formatted) {
1747
+ formatted = formatted.trim();
1748
+ }
1749
+
1750
+ $selection.append(formatted);
1751
+ $selection.prop('title', selection.title || selection.text);
1752
+
1753
+ $selection.data('data', selection);
1754
+
1755
+ $selections.push($selection);
1756
+ }
1757
+
1758
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1759
+
1760
+ Utils.appendMany($rendered, $selections);
1761
+ };
1762
+
1763
+ return MultipleSelection;
1764
+ });
1765
+
1766
+ S2.define('select2/selection/placeholder',[
1767
+ '../utils'
1768
+ ], function (Utils) {
1769
+ function Placeholder (decorated, $element, options) {
1770
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1771
+
1772
+ decorated.call(this, $element, options);
1773
+ }
1774
+
1775
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1776
+ if (typeof placeholder === 'string') {
1777
+ placeholder = {
1778
+ id: '',
1779
+ text: placeholder
1780
+ };
1781
+ }
1782
 
1783
+ return placeholder;
1784
+ };
1785
+
1786
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1787
+ var $placeholder = this.selectionContainer();
1788
 
1789
+ $placeholder.html(this.display(placeholder));
1790
+ $placeholder.addClass('select2-selection__placeholder')
1791
+ .removeClass('select2-selection__choice');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1792
 
1793
+ return $placeholder;
1794
+ };
1795
 
1796
+ Placeholder.prototype.update = function (decorated, data) {
1797
+ var singlePlaceholder = (
1798
+ data.length == 1 && data[0].id != this.placeholder.id
1799
+ );
1800
+ var multipleSelections = data.length > 1;
1801
 
1802
+ if (multipleSelections || singlePlaceholder) {
1803
+ return decorated.call(this, data);
1804
+ }
1805
+
1806
+ this.clear();
1807
 
1808
+ var $placeholder = this.createPlaceholder(this.placeholder);
 
 
 
 
 
1809
 
1810
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
1811
+ };
1812
 
1813
+ return Placeholder;
1814
+ });
1815
 
1816
+ S2.define('select2/selection/allowClear',[
1817
+ 'jquery',
1818
+ '../keys'
1819
+ ], function ($, KEYS) {
1820
+ function AllowClear () { }
1821
+
1822
+ AllowClear.prototype.bind = function (decorated, container, $container) {
1823
+ var self = this;
1824
 
1825
+ decorated.call(this, container, $container);
1826
 
1827
+ if (this.placeholder == null) {
1828
+ if (this.options.get('debug') && window.console && console.error) {
1829
+ console.error(
1830
+ 'Select2: The `allowClear` option should be used in combination ' +
1831
+ 'with the `placeholder` option.'
1832
+ );
1833
+ }
1834
+ }
1835
+
1836
+ this.$selection.on('mousedown', '.select2-selection__clear',
1837
+ function (evt) {
1838
+ self._handleClear(evt);
1839
+ });
1840
 
1841
+ container.on('keypress', function (evt) {
1842
+ self._handleKeyboardClear(evt, container);
1843
+ });
1844
+ };
1845
 
1846
+ AllowClear.prototype._handleClear = function (_, evt) {
1847
+ // Ignore the event if it is disabled
1848
+ if (this.options.get('disabled')) {
1849
+ return;
1850
+ }
1851
 
1852
+ var $clear = this.$selection.find('.select2-selection__clear');
 
 
 
1853
 
1854
+ // Ignore the event if nothing has been selected
1855
+ if ($clear.length === 0) {
1856
+ return;
1857
+ }
1858
+
1859
+ evt.stopPropagation();
1860
+
1861
+ var data = $clear.data('data');
1862
+
1863
+ for (var d = 0; d < data.length; d++) {
1864
+ var unselectData = {
1865
+ data: data[d]
1866
+ };
1867
+
1868
+ // Trigger the `unselect` event, so people can prevent it from being
1869
+ // cleared.
1870
+ this.trigger('unselect', unselectData);
1871
+
1872
+ // If the event was prevented, don't clear it out.
1873
+ if (unselectData.prevented) {
1874
+ return;
1875
+ }
1876
+ }
1877
+
1878
+ this.$element.val(this.placeholder.id).trigger('change');
1879
+
1880
+ this.trigger('toggle', {});
1881
+ };
1882
 
1883
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1884
+ if (container.isOpen()) {
1885
+ return;
1886
+ }
1887
+
1888
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1889
+ this._handleClear(evt);
1890
+ }
1891
+ };
1892
 
1893
+ AllowClear.prototype.update = function (decorated, data) {
1894
+ decorated.call(this, data);
 
1895
 
1896
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1897
+ data.length === 0) {
1898
+ return;
1899
+ }
 
1900
 
1901
+ var $remove = $(
1902
+ '<span class="select2-selection__clear">' +
1903
+ '&times;' +
1904
+ '</span>'
1905
+ );
1906
+ $remove.data('data', data);
1907
 
1908
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
1909
+ };
1910
+
1911
+ return AllowClear;
1912
+ });
1913
+
1914
+ S2.define('select2/selection/search',[
1915
+ 'jquery',
1916
+ '../utils',
1917
+ '../keys'
1918
+ ], function ($, Utils, KEYS) {
1919
+ function Search (decorated, $element, options) {
1920
+ decorated.call(this, $element, options);
1921
+ }
1922
+
1923
+ Search.prototype.render = function (decorated) {
1924
+ var $search = $(
1925
+ '<li class="select2-search select2-search--inline">' +
1926
+ '<input class="select2-search__field" type="text" tabindex="-1"' +
1927
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
1928
+ ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1929
+ '</li>'
1930
+ );
1931
+
1932
+ this.$searchContainer = $search;
1933
+ this.$search = $search.find('input');
1934
+
1935
+ var $rendered = decorated.call(this);
1936
+
1937
+ this._transferTabIndex();
1938
+
1939
+ return $rendered;
1940
+ };
1941
+
1942
+ Search.prototype.bind = function (decorated, container, $container) {
1943
+ var self = this;
1944
+ var resultsId = container.id + '-results';
1945
+
1946
+ decorated.call(this, container, $container);
1947
+
1948
+ container.on('open', function () {
1949
+ self.$search.attr('aria-owns', resultsId);
1950
+ self.$search.trigger('focus');
1951
+ });
1952
+
1953
+ container.on('close', function () {
1954
+ self.$search.val('');
1955
+ self.$search.removeAttr('aria-activedescendant');
1956
+ self.$search.removeAttr('aria-owns');
1957
+ self.$search.trigger('focus');
1958
+ });
1959
+
1960
+ container.on('enable', function () {
1961
+ self.$search.prop('disabled', false);
1962
+
1963
+ self._transferTabIndex();
1964
+ });
1965
+
1966
+ container.on('disable', function () {
1967
+ self.$search.prop('disabled', true);
1968
+ });
1969
+
1970
+ container.on('focus', function (evt) {
1971
+ self.$search.trigger('focus');
1972
+ });
1973
+
1974
+ container.on('results:focus', function (params) {
1975
+ self.$search.attr('aria-activedescendant', params.data._resultId);
1976
+ });
1977
+
1978
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
1979
+ self.trigger('focus', evt);
1980
+ });
1981
+
1982
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
1983
+ self._handleBlur(evt);
1984
+ });
1985
+
1986
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
1987
+ evt.stopPropagation();
1988
+
1989
+ self.trigger('keypress', evt);
1990
+
1991
+ self._keyUpPrevented = evt.isDefaultPrevented();
1992
+
1993
+ var key = evt.which;
1994
+
1995
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
1996
+ var $previousChoice = self.$searchContainer
1997
+ .prev('.select2-selection__choice');
1998
+
1999
+ if ($previousChoice.length > 0) {
2000
+ var item = $previousChoice.data('data');
2001
+
2002
+ self.searchRemoveChoice(item);
2003
+
2004
+ evt.preventDefault();
2005
+ }
2006
+ } else if (evt.which === KEYS.ENTER) {
2007
+ container.open();
2008
+ evt.preventDefault();
2009
+ }
2010
+ });
2011
+
2012
+ // Try to detect the IE version should the `documentMode` property that
2013
+ // is stored on the document. This is only implemented in IE and is
2014
+ // slightly cleaner than doing a user agent check.
2015
+ // This property is not available in Edge, but Edge also doesn't have
2016
+ // this bug.
2017
+ var msie = document.documentMode;
2018
+ var disableInputEvents = msie && msie <= 11;
2019
+
2020
+ // Workaround for browsers which do not support the `input` event
2021
+ // This will prevent double-triggering of events for browsers which support
2022
+ // both the `keyup` and `input` events.
2023
+ this.$selection.on(
2024
+ 'input.searchcheck',
2025
+ '.select2-search--inline',
2026
+ function (evt) {
2027
+ // IE will trigger the `input` event when a placeholder is used on a
2028
+ // search box. To get around this issue, we are forced to ignore all
2029
+ // `input` events in IE and keep using `keyup`.
2030
+ if (disableInputEvents) {
2031
+ self.$selection.off('input.search input.searchcheck');
2032
+ return;
2033
+ }
2034
+
2035
+ // Unbind the duplicated `keyup` event
2036
+ self.$selection.off('keyup.search');
2037
+ }
2038
+ );
2039
+
2040
+ this.$selection.on(
2041
+ 'keyup.search input.search',
2042
+ '.select2-search--inline',
2043
+ function (evt) {
2044
+ // IE will trigger the `input` event when a placeholder is used on a
2045
+ // search box. To get around this issue, we are forced to ignore all
2046
+ // `input` events in IE and keep using `keyup`.
2047
+ if (disableInputEvents && evt.type === 'input') {
2048
+ self.$selection.off('input.search input.searchcheck');
2049
+ return;
2050
+ }
2051
+
2052
+ var key = evt.which;
2053
+
2054
+ // We can freely ignore events from modifier keys
2055
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
2056
+ return;
2057
+ }
2058
+
2059
+ // Tabbing will be handled during the `keydown` phase
2060
+ if (key == KEYS.TAB) {
2061
+ return;
2062
+ }
2063
+
2064
+ self.handleSearch(evt);
2065
+ }
2066
+ );
2067
+ };
2068
+
2069
+ /**
2070
+ * This method will transfer the tabindex attribute from the rendered
2071
+ * selection to the search box. This allows for the search box to be used as
2072
+ * the primary focus instead of the selection container.
2073
+ *
2074
+ * @private
2075
+ */
2076
+ Search.prototype._transferTabIndex = function (decorated) {
2077
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
2078
+ this.$selection.attr('tabindex', '-1');
2079
+ };
2080
+
2081
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
2082
+ this.$search.attr('placeholder', placeholder.text);
2083
+ };
2084
+
2085
+ Search.prototype.update = function (decorated, data) {
2086
+ var searchHadFocus = this.$search[0] == document.activeElement;
2087
+
2088
+ this.$search.attr('placeholder', '');
2089
+
2090
+ decorated.call(this, data);
2091
+
2092
+ this.$selection.find('.select2-selection__rendered')
2093
+ .append(this.$searchContainer);
2094
+
2095
+ this.resizeSearch();
2096
+ if (searchHadFocus) {
2097
+ this.$search.focus();
2098
+ }
2099
+ };
2100
+
2101
+ Search.prototype.handleSearch = function () {
2102
+ this.resizeSearch();
2103
+
2104
+ if (!this._keyUpPrevented) {
2105
+ var input = this.$search.val();
2106
+
2107
+ this.trigger('query', {
2108
+ term: input
2109
+ });
2110
+ }
2111
+
2112
+ this._keyUpPrevented = false;
2113
+ };
2114
+
2115
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
2116
+ this.trigger('unselect', {
2117
+ data: item
2118
+ });
2119
+
2120
+ this.$search.val(item.text);
2121
+ this.handleSearch();
2122
+ };
2123
+
2124
+ Search.prototype.resizeSearch = function () {
2125
+ this.$search.css('width', '25px');
2126
+
2127
+ var width = '';
2128
+
2129
+ if (this.$search.attr('placeholder') !== '') {
2130
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
2131
+ } else {
2132
+ var minimumWidth = this.$search.val().length + 1;
2133
+
2134
+ width = (minimumWidth * 0.75) + 'em';
2135
+ }
2136
+
2137
+ this.$search.css('width', width);
2138
+ };
2139
+
2140
+ return Search;
2141
+ });
2142
+
2143
+ S2.define('select2/selection/eventRelay',[
2144
+ 'jquery'
2145
+ ], function ($) {
2146
+ function EventRelay () { }
2147
+
2148
+ EventRelay.prototype.bind = function (decorated, container, $container) {
2149
+ var self = this;
2150
+ var relayEvents = [
2151
+ 'open', 'opening',
2152
+ 'close', 'closing',
2153
+ 'select', 'selecting',
2154
+ 'unselect', 'unselecting'
2155
+ ];
2156
+
2157
+ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
2158
+
2159
+ decorated.call(this, container, $container);
2160
+
2161
+ container.on('*', function (name, params) {
2162
+ // Ignore events that should not be relayed
2163
+ if ($.inArray(name, relayEvents) === -1) {
2164
+ return;
2165
+ }
2166
+
2167
+ // The parameters should always be an object
2168
+ params = params || {};
2169
+
2170
+ // Generate the jQuery event for the Select2 event
2171
+ var evt = $.Event('select2:' + name, {
2172
+ params: params
2173
+ });
2174
+
2175
+ self.$element.trigger(evt);
2176
+
2177
+ // Only handle preventable events if it was one
2178
+ if ($.inArray(name, preventableEvents) === -1) {
2179
+ return;
2180
+ }
2181
+
2182
+ params.prevented = evt.isDefaultPrevented();
2183
+ });
2184
+ };
2185
+
2186
+ return EventRelay;
2187
+ });
2188
+
2189
+ S2.define('select2/translation',[
2190
+ 'jquery',
2191
+ 'require'
2192
+ ], function ($, require) {
2193
+ function Translation (dict) {
2194
+ this.dict = dict || {};
2195
+ }
2196
+
2197
+ Translation.prototype.all = function () {
2198
+ return this.dict;
2199
+ };
2200
+
2201
+ Translation.prototype.get = function (key) {
2202
+ return this.dict[key];
2203
+ };
2204
+
2205
+ Translation.prototype.extend = function (translation) {
2206
+ this.dict = $.extend({}, translation.all(), this.dict);
2207
+ };
2208
+
2209
+ // Static functions
2210
+
2211
+ Translation._cache = {};
2212
+
2213
+ Translation.loadPath = function (path) {
2214
+ if (!(path in Translation._cache)) {
2215
+ var translations = require(path);
2216
+
2217
+ Translation._cache[path] = translations;
2218
+ }
2219
+
2220
+ return new Translation(Translation._cache[path]);
2221
+ };
2222
+
2223
+ return Translation;
2224
+ });
2225
+
2226
+ S2.define('select2/diacritics',[
2227
+
2228
+ ], function () {
2229
+ var diacritics = {
2230
+ '\u24B6': 'A',
2231
+ '\uFF21': 'A',
2232
+ '\u00C0': 'A',
2233
+ '\u00C1': 'A',
2234
+ '\u00C2': 'A',
2235
+ '\u1EA6': 'A',
2236
+ '\u1EA4': 'A',
2237
+ '\u1EAA': 'A',
2238
+ '\u1EA8': 'A',
2239
+ '\u00C3': 'A',
2240
+ '\u0100': 'A',
2241
+ '\u0102': 'A',
2242
+ '\u1EB0': 'A',
2243
+ '\u1EAE': 'A',
2244
+ '\u1EB4': 'A',
2245
+ '\u1EB2': 'A',
2246
+ '\u0226': 'A',
2247
+ '\u01E0': 'A',
2248
+ '\u00C4': 'A',
2249
+ '\u01DE': 'A',
2250
+ '\u1EA2': 'A',
2251
+ '\u00C5': 'A',
2252
+ '\u01FA': 'A',
2253
+ '\u01CD': 'A',
2254
+ '\u0200': 'A',
2255
+ '\u0202': 'A',
2256
+ '\u1EA0': 'A',
2257
+ '\u1EAC': 'A',
2258
+ '\u1EB6': 'A',
2259
+ '\u1E00': 'A',
2260
+ '\u0104': 'A',
2261
+ '\u023A': 'A',
2262
+ '\u2C6F': 'A',
2263
+ '\uA732': 'AA',
2264
+ '\u00C6': 'AE',
2265
+ '\u01FC': 'AE',
2266
+ '\u01E2': 'AE',
2267
+ '\uA734': 'AO',
2268
+ '\uA736': 'AU',
2269
+ '\uA738': 'AV',
2270
+ '\uA73A': 'AV',
2271
+ '\uA73C': 'AY',
2272
+ '\u24B7': 'B',
2273
+ '\uFF22': 'B',
2274
+ '\u1E02': 'B',
2275
+ '\u1E04': 'B',
2276
+ '\u1E06': 'B',
2277
+ '\u0243': 'B',
2278
+ '\u0182': 'B',
2279
+ '\u0181': 'B',
2280
+ '\u24B8': 'C',
2281
+ '\uFF23': 'C',
2282
+ '\u0106': 'C',
2283
+ '\u0108': 'C',
2284
+ '\u010A': 'C',
2285
+ '\u010C': 'C',
2286
+ '\u00C7': 'C',
2287
+ '\u1E08': 'C',
2288
+ '\u0187': 'C',
2289
+ '\u023B': 'C',
2290
+ '\uA73E': 'C',
2291
+ '\u24B9': 'D',
2292
+ '\uFF24': 'D',
2293
+ '\u1E0A': 'D',
2294
+ '\u010E': 'D',
2295
+ '\u1E0C': 'D',
2296
+ '\u1E10': 'D',
2297
+ '\u1E12': 'D',
2298
+ '\u1E0E': 'D',
2299
+ '\u0110': 'D',
2300
+ '\u018B': 'D',
2301
+ '\u018A': 'D',
2302
+ '\u0189': 'D',
2303
+ '\uA779': 'D',
2304
+ '\u01F1': 'DZ',
2305
+ '\u01C4': 'DZ',
2306
+ '\u01F2': 'Dz',
2307
+ '\u01C5': 'Dz',
2308
+ '\u24BA': 'E',
2309
+ '\uFF25': 'E',
2310
+ '\u00C8': 'E',
2311
+ '\u00C9': 'E',
2312
+ '\u00CA': 'E',
2313
+ '\u1EC0': 'E',
2314
+ '\u1EBE': 'E',
2315
+ '\u1EC4': 'E',
2316
+ '\u1EC2': 'E',
2317
+ '\u1EBC': 'E',
2318
+ '\u0112': 'E',
2319
+ '\u1E14': 'E',
2320
+ '\u1E16': 'E',
2321
+ '\u0114': 'E',
2322
+ '\u0116': 'E',
2323
+ '\u00CB': 'E',
2324
+ '\u1EBA': 'E',
2325
+ '\u011A': 'E',
2326
+ '\u0204': 'E',
2327
+ '\u0206': 'E',
2328
+ '\u1EB8': 'E',
2329
+ '\u1EC6': 'E',
2330
+ '\u0228': 'E',
2331
+ '\u1E1C': 'E',
2332
+ '\u0118': 'E',
2333
+ '\u1E18': 'E',
2334
+ '\u1E1A': 'E',
2335
+ '\u0190': 'E',
2336
+ '\u018E': 'E',
2337
+ '\u24BB': 'F',
2338
+ '\uFF26': 'F',
2339
+ '\u1E1E': 'F',
2340
+ '\u0191': 'F',
2341
+ '\uA77B': 'F',
2342
+ '\u24BC': 'G',
2343
+ '\uFF27': 'G',
2344
+ '\u01F4': 'G',
2345
+ '\u011C': 'G',
2346
+ '\u1E20': 'G',
2347
+ '\u011E': 'G',
2348
+ '\u0120': 'G',
2349
+ '\u01E6': 'G',
2350
+ '\u0122': 'G',
2351
+ '\u01E4': 'G',
2352
+ '\u0193': 'G',
2353
+ '\uA7A0': 'G',
2354
+ '\uA77D': 'G',
2355
+ '\uA77E': 'G',
2356
+ '\u24BD': 'H',
2357
+ '\uFF28': 'H',
2358
+ '\u0124': 'H',
2359
+ '\u1E22': 'H',
2360
+ '\u1E26': 'H',
2361
+ '\u021E': 'H',
2362
+ '\u1E24': 'H',
2363
+ '\u1E28': 'H',
2364
+ '\u1E2A': 'H',
2365
+ '\u0126': 'H',
2366
+ '\u2C67': 'H',
2367
+ '\u2C75': 'H',
2368
+ '\uA78D': 'H',
2369
+ '\u24BE': 'I',
2370
+ '\uFF29': 'I',
2371
+ '\u00CC': 'I',
2372
+ '\u00CD': 'I',
2373
+ '\u00CE': 'I',
2374
+ '\u0128': 'I',
2375
+ '\u012A': 'I',
2376
+ '\u012C': 'I',
2377
+ '\u0130': 'I',
2378
+ '\u00CF': 'I',
2379
+ '\u1E2E': 'I',
2380
+ '\u1EC8': 'I',
2381
+ '\u01CF': 'I',
2382
+ '\u0208': 'I',
2383
+ '\u020A': 'I',
2384
+ '\u1ECA': 'I',
2385
+ '\u012E': 'I',
2386
+ '\u1E2C': 'I',
2387
+ '\u0197': 'I',
2388
+ '\u24BF': 'J',
2389
+ '\uFF2A': 'J',
2390
+ '\u0134': 'J',
2391
+ '\u0248': 'J',
2392
+ '\u24C0': 'K',
2393
+ '\uFF2B': 'K',
2394
+ '\u1E30': 'K',
2395
+ '\u01E8': 'K',
2396
+ '\u1E32': 'K',
2397
+ '\u0136': 'K',
2398
+ '\u1E34': 'K',
2399
+ '\u0198': 'K',
2400
+ '\u2C69': 'K',
2401
+ '\uA740': 'K',
2402
+ '\uA742': 'K',
2403
+ '\uA744': 'K',
2404
+ '\uA7A2': 'K',
2405
+ '\u24C1': 'L',
2406
+ '\uFF2C': 'L',
2407
+ '\u013F': 'L',
2408
+ '\u0139': 'L',
2409
+ '\u013D': 'L',
2410
+ '\u1E36': 'L',
2411
+ '\u1E38': 'L',
2412
+ '\u013B': 'L',
2413
+ '\u1E3C': 'L',
2414
+ '\u1E3A': 'L',
2415
+ '\u0141': 'L',
2416
+ '\u023D': 'L',
2417
+ '\u2C62': 'L',
2418
+ '\u2C60': 'L',
2419
+ '\uA748': 'L',
2420
+ '\uA746': 'L',
2421
+ '\uA780': 'L',
2422
+ '\u01C7': 'LJ',
2423
+ '\u01C8': 'Lj',
2424
+ '\u24C2': 'M',
2425
+ '\uFF2D': 'M',
2426
+ '\u1E3E': 'M',
2427
+ '\u1E40': 'M',
2428
+ '\u1E42': 'M',
2429
+ '\u2C6E': 'M',
2430
+ '\u019C': 'M',
2431
+ '\u24C3': 'N',
2432
+ '\uFF2E': 'N',
2433
+ '\u01F8': 'N',
2434
+ '\u0143': 'N',
2435
+ '\u00D1': 'N',
2436
+ '\u1E44': 'N',
2437
+ '\u0147': 'N',
2438
+ '\u1E46': 'N',
2439
+ '\u0145': 'N',
2440
+ '\u1E4A': 'N',
2441
+ '\u1E48': 'N',
2442
+ '\u0220': 'N',
2443
+ '\u019D': 'N',
2444
+ '\uA790': 'N',
2445
+ '\uA7A4': 'N',
2446
+ '\u01CA': 'NJ',
2447
+ '\u01CB': 'Nj',
2448
+ '\u24C4': 'O',
2449
+ '\uFF2F': 'O',
2450
+ '\u00D2': 'O',
2451
+ '\u00D3': 'O',
2452
+ '\u00D4': 'O',
2453
+ '\u1ED2': 'O',
2454
+ '\u1ED0': 'O',
2455
+ '\u1ED6': 'O',
2456
+ '\u1ED4': 'O',
2457
+ '\u00D5': 'O',
2458
+ '\u1E4C': 'O',
2459
+ '\u022C': 'O',
2460
+ '\u1E4E': 'O',
2461
+ '\u014C': 'O',
2462
+ '\u1E50': 'O',
2463
+ '\u1E52': 'O',
2464
+ '\u014E': 'O',
2465
+ '\u022E': 'O',
2466
+ '\u0230': 'O',
2467
+ '\u00D6': 'O',
2468
+ '\u022A': 'O',
2469
+ '\u1ECE': 'O',
2470
+ '\u0150': 'O',
2471
+ '\u01D1': 'O',
2472
+ '\u020C': 'O',
2473
+ '\u020E': 'O',
2474
+ '\u01A0': 'O',
2475
+ '\u1EDC': 'O',
2476
+ '\u1EDA': 'O',
2477
+ '\u1EE0': 'O',
2478
+ '\u1EDE': 'O',
2479
+ '\u1EE2': 'O',
2480
+ '\u1ECC': 'O',
2481
+ '\u1ED8': 'O',
2482
+ '\u01EA': 'O',
2483
+ '\u01EC': 'O',
2484
+ '\u00D8': 'O',
2485
+ '\u01FE': 'O',
2486
+ '\u0186': 'O',
2487
+ '\u019F': 'O',
2488
+ '\uA74A': 'O',
2489
+ '\uA74C': 'O',
2490
+ '\u01A2': 'OI',
2491
+ '\uA74E': 'OO',
2492
+ '\u0222': 'OU',
2493
+ '\u24C5': 'P',
2494
+ '\uFF30': 'P',
2495
+ '\u1E54': 'P',
2496
+ '\u1E56': 'P',
2497
+ '\u01A4': 'P',
2498
+ '\u2C63': 'P',
2499
+ '\uA750': 'P',
2500
+ '\uA752': 'P',
2501
+ '\uA754': 'P',
2502
+ '\u24C6': 'Q',
2503
+ '\uFF31': 'Q',
2504
+ '\uA756': 'Q',
2505
+ '\uA758': 'Q',
2506
+ '\u024A': 'Q',
2507
+ '\u24C7': 'R',
2508
+ '\uFF32': 'R',
2509
+ '\u0154': 'R',
2510
+ '\u1E58': 'R',
2511
+ '\u0158': 'R',
2512
+ '\u0210': 'R',
2513
+ '\u0212': 'R',
2514
+ '\u1E5A': 'R',
2515
+ '\u1E5C': 'R',
2516
+ '\u0156': 'R',
2517
+ '\u1E5E': 'R',
2518
+ '\u024C': 'R',
2519
+ '\u2C64': 'R',
2520
+ '\uA75A': 'R',
2521
+ '\uA7A6': 'R',
2522
+ '\uA782': 'R',
2523
+ '\u24C8': 'S',
2524
+ '\uFF33': 'S',
2525
+ '\u1E9E': 'S',
2526
+ '\u015A': 'S',
2527
+ '\u1E64': 'S',
2528
+ '\u015C': 'S',
2529
+ '\u1E60': 'S',
2530
+ '\u0160': 'S',
2531
+ '\u1E66': 'S',
2532
+ '\u1E62': 'S',
2533
+ '\u1E68': 'S',
2534
+ '\u0218': 'S',
2535
+ '\u015E': 'S',
2536
+ '\u2C7E': 'S',
2537
+ '\uA7A8': 'S',
2538
+ '\uA784': 'S',
2539
+ '\u24C9': 'T',
2540
+ '\uFF34': 'T',
2541
+ '\u1E6A': 'T',
2542
+ '\u0164': 'T',
2543
+ '\u1E6C': 'T',
2544
+ '\u021A': 'T',
2545
+ '\u0162': 'T',
2546
+ '\u1E70': 'T',
2547
+ '\u1E6E': 'T',
2548
+ '\u0166': 'T',
2549
+ '\u01AC': 'T',
2550
+ '\u01AE': 'T',
2551
+ '\u023E': 'T',
2552
+ '\uA786': 'T',
2553
+ '\uA728': 'TZ',
2554
+ '\u24CA': 'U',
2555
+ '\uFF35': 'U',
2556
+ '\u00D9': 'U',
2557
+ '\u00DA': 'U',
2558
+ '\u00DB': 'U',
2559
+ '\u0168': 'U',
2560
+ '\u1E78': 'U',
2561
+ '\u016A': 'U',
2562
+ '\u1E7A': 'U',
2563
+ '\u016C': 'U',
2564
+ '\u00DC': 'U',
2565
+ '\u01DB': 'U',
2566
+ '\u01D7': 'U',
2567
+ '\u01D5': 'U',
2568
+ '\u01D9': 'U',
2569
+ '\u1EE6': 'U',
2570
+ '\u016E': 'U',
2571
+ '\u0170': 'U',
2572
+ '\u01D3': 'U',
2573
+ '\u0214': 'U',
2574
+ '\u0216': 'U',
2575
+ '\u01AF': 'U',
2576
+ '\u1EEA': 'U',
2577
+ '\u1EE8': 'U',
2578
+ '\u1EEE': 'U',
2579
+ '\u1EEC': 'U',
2580
+ '\u1EF0': 'U',
2581
+ '\u1EE4': 'U',
2582
+ '\u1E72': 'U',
2583
+ '\u0172': 'U',
2584
+ '\u1E76': 'U',
2585
+ '\u1E74': 'U',
2586
+ '\u0244': 'U',
2587
+ '\u24CB': 'V',
2588
+ '\uFF36': 'V',
2589
+ '\u1E7C': 'V',
2590
+ '\u1E7E': 'V',
2591
+ '\u01B2': 'V',
2592
+ '\uA75E': 'V',
2593
+ '\u0245': 'V',
2594
+ '\uA760': 'VY',
2595
+ '\u24CC': 'W',
2596
+ '\uFF37': 'W',
2597
+ '\u1E80': 'W',
2598
+ '\u1E82': 'W',
2599
+ '\u0174': 'W',
2600
+ '\u1E86': 'W',
2601
+ '\u1E84': 'W',
2602
+ '\u1E88': 'W',
2603
+ '\u2C72': 'W',
2604
+ '\u24CD': 'X',
2605
+ '\uFF38': 'X',
2606
+ '\u1E8A': 'X',
2607
+ '\u1E8C': 'X',
2608
+ '\u24CE': 'Y',
2609
+ '\uFF39': 'Y',
2610
+ '\u1EF2': 'Y',
2611
+ '\u00DD': 'Y',
2612
+ '\u0176': 'Y',
2613
+ '\u1EF8': 'Y',
2614
+ '\u0232': 'Y',
2615
+ '\u1E8E': 'Y',
2616
+ '\u0178': 'Y',
2617
+ '\u1EF6': 'Y',
2618
+ '\u1EF4': 'Y',
2619
+ '\u01B3': 'Y',
2620
+ '\u024E': 'Y',
2621
+ '\u1EFE': 'Y',
2622
+ '\u24CF': 'Z',
2623
+ '\uFF3A': 'Z',
2624
+ '\u0179': 'Z',
2625
+ '\u1E90': 'Z',
2626
+ '\u017B': 'Z',
2627
+ '\u017D': 'Z',
2628
+ '\u1E92': 'Z',
2629
+ '\u1E94': 'Z',
2630
+ '\u01B5': 'Z',
2631
+ '\u0224': 'Z',
2632
+ '\u2C7F': 'Z',
2633
+ '\u2C6B': 'Z',
2634
+ '\uA762': 'Z',
2635
+ '\u24D0': 'a',
2636
+ '\uFF41': 'a',
2637
+ '\u1E9A': 'a',
2638
+ '\u00E0': 'a',
2639
+ '\u00E1': 'a',
2640
+ '\u00E2': 'a',
2641
+ '\u1EA7': 'a',
2642
+ '\u1EA5': 'a',
2643
+ '\u1EAB': 'a',
2644
+ '\u1EA9': 'a',
2645
+ '\u00E3': 'a',
2646
+ '\u0101': 'a',
2647
+ '\u0103': 'a',
2648
+ '\u1EB1': 'a',
2649
+ '\u1EAF': 'a',
2650
+ '\u1EB5': 'a',
2651
+ '\u1EB3': 'a',
2652
+ '\u0227': 'a',
2653
+ '\u01E1': 'a',
2654
+ '\u00E4': 'a',
2655
+ '\u01DF': 'a',
2656
+ '\u1EA3': 'a',
2657
+ '\u00E5': 'a',
2658
+ '\u01FB': 'a',
2659
+ '\u01CE': 'a',
2660
+ '\u0201': 'a',
2661
+ '\u0203': 'a',
2662
+ '\u1EA1': 'a',
2663
+ '\u1EAD': 'a',
2664
+ '\u1EB7': 'a',
2665
+ '\u1E01': 'a',
2666
+ '\u0105': 'a',
2667
+ '\u2C65': 'a',
2668
+ '\u0250': 'a',
2669
+ '\uA733': 'aa',
2670
+ '\u00E6': 'ae',
2671
+ '\u01FD': 'ae',
2672
+ '\u01E3': 'ae',
2673
+ '\uA735': 'ao',
2674
+ '\uA737': 'au',
2675
+ '\uA739': 'av',
2676
+ '\uA73B': 'av',
2677
+ '\uA73D': 'ay',
2678
+ '\u24D1': 'b',
2679
+ '\uFF42': 'b',
2680
+ '\u1E03': 'b',
2681
+ '\u1E05': 'b',
2682
+ '\u1E07': 'b',
2683
+ '\u0180': 'b',
2684
+ '\u0183': 'b',
2685
+ '\u0253': 'b',
2686
+ '\u24D2': 'c',
2687
+ '\uFF43': 'c',
2688
+ '\u0107': 'c',
2689
+ '\u0109': 'c',
2690
+ '\u010B': 'c',
2691
+ '\u010D': 'c',
2692
+ '\u00E7': 'c',
2693
+ '\u1E09': 'c',
2694
+ '\u0188': 'c',
2695
+ '\u023C': 'c',
2696
+ '\uA73F': 'c',
2697
+ '\u2184': 'c',
2698
+ '\u24D3': 'd',
2699
+ '\uFF44': 'd',
2700
+ '\u1E0B': 'd',
2701
+ '\u010F': 'd',
2702
+ '\u1E0D': 'd',
2703
+ '\u1E11': 'd',
2704
+ '\u1E13': 'd',
2705
+ '\u1E0F': 'd',
2706
+ '\u0111': 'd',
2707
+ '\u018C': 'd',
2708
+ '\u0256': 'd',
2709
+ '\u0257': 'd',
2710
+ '\uA77A': 'd',
2711
+ '\u01F3': 'dz',
2712
+ '\u01C6': 'dz',
2713
+ '\u24D4': 'e',
2714
+ '\uFF45': 'e',
2715
+ '\u00E8': 'e',
2716
+ '\u00E9': 'e',
2717
+ '\u00EA': 'e',
2718
+ '\u1EC1': 'e',
2719
+ '\u1EBF': 'e',
2720
+ '\u1EC5': 'e',
2721
+ '\u1EC3': 'e',
2722
+ '\u1EBD': 'e',
2723
+ '\u0113': 'e',
2724
+ '\u1E15': 'e',
2725
+ '\u1E17': 'e',
2726
+ '\u0115': 'e',
2727
+ '\u0117': 'e',
2728
+ '\u00EB': 'e',
2729
+ '\u1EBB': 'e',
2730
+ '\u011B': 'e',
2731
+ '\u0205': 'e',
2732
+ '\u0207': 'e',
2733
+ '\u1EB9': 'e',
2734
+ '\u1EC7': 'e',
2735
+ '\u0229': 'e',
2736
+ '\u1E1D': 'e',
2737
+ '\u0119': 'e',
2738
+ '\u1E19': 'e',
2739
+ '\u1E1B': 'e',
2740
+ '\u0247': 'e',
2741
+ '\u025B': 'e',
2742
+ '\u01DD': 'e',
2743
+ '\u24D5': 'f',
2744
+ '\uFF46': 'f',
2745
+ '\u1E1F': 'f',
2746
+ '\u0192': 'f',
2747
+ '\uA77C': 'f',
2748
+ '\u24D6': 'g',
2749
+ '\uFF47': 'g',
2750
+ '\u01F5': 'g',
2751
+ '\u011D': 'g',
2752
+ '\u1E21': 'g',
2753
+ '\u011F': 'g',
2754
+ '\u0121': 'g',
2755
+ '\u01E7': 'g',
2756
+ '\u0123': 'g',
2757
+ '\u01E5': 'g',
2758
+ '\u0260': 'g',
2759
+ '\uA7A1': 'g',
2760
+ '\u1D79': 'g',
2761
+ '\uA77F': 'g',
2762
+ '\u24D7': 'h',
2763
+ '\uFF48': 'h',
2764
+ '\u0125': 'h',
2765
+ '\u1E23': 'h',
2766
+ '\u1E27': 'h',
2767
+ '\u021F': 'h',
2768
+ '\u1E25': 'h',
2769
+ '\u1E29': 'h',
2770
+ '\u1E2B': 'h',
2771
+ '\u1E96': 'h',
2772
+ '\u0127': 'h',
2773
+ '\u2C68': 'h',
2774
+ '\u2C76': 'h',
2775
+ '\u0265': 'h',
2776
+ '\u0195': 'hv',
2777
+ '\u24D8': 'i',
2778
+ '\uFF49': 'i',
2779
+ '\u00EC': 'i',
2780
+ '\u00ED': 'i',
2781
+ '\u00EE': 'i',
2782
+ '\u0129': 'i',
2783
+ '\u012B': 'i',
2784
+ '\u012D': 'i',
2785
+ '\u00EF': 'i',
2786
+ '\u1E2F': 'i',
2787
+ '\u1EC9': 'i',
2788
+ '\u01D0': 'i',
2789
+ '\u0209': 'i',
2790
+ '\u020B': 'i',
2791
+ '\u1ECB': 'i',
2792
+ '\u012F': 'i',
2793
+ '\u1E2D': 'i',
2794
+ '\u0268': 'i',
2795
+ '\u0131': 'i',
2796
+ '\u24D9': 'j',
2797
+ '\uFF4A': 'j',
2798
+ '\u0135': 'j',
2799
+ '\u01F0': 'j',
2800
+ '\u0249': 'j',
2801
+ '\u24DA': 'k',
2802
+ '\uFF4B': 'k',
2803
+ '\u1E31': 'k',
2804
+ '\u01E9': 'k',
2805
+ '\u1E33': 'k',
2806
+ '\u0137': 'k',
2807
+ '\u1E35': 'k',
2808
+ '\u0199': 'k',
2809
+ '\u2C6A': 'k',
2810
+ '\uA741': 'k',
2811
+ '\uA743': 'k',
2812
+ '\uA745': 'k',
2813
+ '\uA7A3': 'k',
2814
+ '\u24DB': 'l',
2815
+ '\uFF4C': 'l',
2816
+ '\u0140': 'l',
2817
+ '\u013A': 'l',
2818
+ '\u013E': 'l',
2819
+ '\u1E37': 'l',
2820
+ '\u1E39': 'l',
2821
+ '\u013C': 'l',
2822
+ '\u1E3D': 'l',
2823
+ '\u1E3B': 'l',
2824
+ '\u017F': 'l',
2825
+ '\u0142': 'l',
2826
+ '\u019A': 'l',
2827
+ '\u026B': 'l',
2828
+ '\u2C61': 'l',
2829
+ '\uA749': 'l',
2830
+ '\uA781': 'l',
2831
+ '\uA747': 'l',
2832
+ '\u01C9': 'lj',
2833
+ '\u24DC': 'm',
2834
+ '\uFF4D': 'm',
2835
+ '\u1E3F': 'm',
2836
+ '\u1E41': 'm',
2837
+ '\u1E43': 'm',
2838
+ '\u0271': 'm',
2839
+ '\u026F': 'm',
2840
+ '\u24DD': 'n',
2841
+ '\uFF4E': 'n',
2842
+ '\u01F9': 'n',
2843
+ '\u0144': 'n',
2844
+ '\u00F1': 'n',
2845
+ '\u1E45': 'n',
2846
+ '\u0148': 'n',
2847
+ '\u1E47': 'n',
2848
+ '\u0146': 'n',
2849
+ '\u1E4B': 'n',
2850
+ '\u1E49': 'n',
2851
+ '\u019E': 'n',
2852
+ '\u0272': 'n',
2853
+ '\u0149': 'n',
2854
+ '\uA791': 'n',
2855
+ '\uA7A5': 'n',
2856
+ '\u01CC': 'nj',
2857
+ '\u24DE': 'o',
2858
+ '\uFF4F': 'o',
2859
+ '\u00F2': 'o',
2860
+ '\u00F3': 'o',
2861
+ '\u00F4': 'o',
2862
+ '\u1ED3': 'o',
2863
+ '\u1ED1': 'o',
2864
+ '\u1ED7': 'o',
2865
+ '\u1ED5': 'o',
2866
+ '\u00F5': 'o',
2867
+ '\u1E4D': 'o',
2868
+ '\u022D': 'o',
2869
+ '\u1E4F': 'o',
2870
+ '\u014D': 'o',
2871
+ '\u1E51': 'o',
2872
+ '\u1E53': 'o',
2873
+ '\u014F': 'o',
2874
+ '\u022F': 'o',
2875
+ '\u0231': 'o',
2876
+ '\u00F6': 'o',
2877
+ '\u022B': 'o',
2878
+ '\u1ECF': 'o',
2879
+ '\u0151': 'o',
2880
+ '\u01D2': 'o',
2881
+ '\u020D': 'o',
2882
+ '\u020F': 'o',
2883
+ '\u01A1': 'o',
2884
+ '\u1EDD': 'o',
2885
+ '\u1EDB': 'o',
2886
+ '\u1EE1': 'o',
2887
+ '\u1EDF': 'o',
2888
+ '\u1EE3': 'o',
2889
+ '\u1ECD': 'o',
2890
+ '\u1ED9': 'o',
2891
+ '\u01EB': 'o',
2892
+ '\u01ED': 'o',
2893
+ '\u00F8': 'o',
2894
+ '\u01FF': 'o',
2895
+ '\u0254': 'o',
2896
+ '\uA74B': 'o',
2897
+ '\uA74D': 'o',
2898
+ '\u0275': 'o',
2899
+ '\u01A3': 'oi',
2900
+ '\u0223': 'ou',
2901
+ '\uA74F': 'oo',
2902
+ '\u24DF': 'p',
2903
+ '\uFF50': 'p',
2904
+ '\u1E55': 'p',
2905
+ '\u1E57': 'p',
2906
+ '\u01A5': 'p',
2907
+ '\u1D7D': 'p',
2908
+ '\uA751': 'p',
2909
+ '\uA753': 'p',
2910
+ '\uA755': 'p',
2911
+ '\u24E0': 'q',
2912
+ '\uFF51': 'q',
2913
+ '\u024B': 'q',
2914
+ '\uA757': 'q',
2915
+ '\uA759': 'q',
2916
+ '\u24E1': 'r',
2917
+ '\uFF52': 'r',
2918
+ '\u0155': 'r',
2919
+ '\u1E59': 'r',
2920
+ '\u0159': 'r',
2921
+ '\u0211': 'r',
2922
+ '\u0213': 'r',
2923
+ '\u1E5B': 'r',
2924
+ '\u1E5D': 'r',
2925
+ '\u0157': 'r',
2926
+ '\u1E5F': 'r',
2927
+ '\u024D': 'r',
2928
+ '\u027D': 'r',
2929
+ '\uA75B': 'r',
2930
+ '\uA7A7': 'r',
2931
+ '\uA783': 'r',
2932
+ '\u24E2': 's',
2933
+ '\uFF53': 's',
2934
+ '\u00DF': 's',
2935
+ '\u015B': 's',
2936
+ '\u1E65': 's',
2937
+ '\u015D': 's',
2938
+ '\u1E61': 's',
2939
+ '\u0161': 's',
2940
+ '\u1E67': 's',
2941
+ '\u1E63': 's',
2942
+ '\u1E69': 's',
2943
+ '\u0219': 's',
2944
+ '\u015F': 's',
2945
+ '\u023F': 's',
2946
+ '\uA7A9': 's',
2947
+ '\uA785': 's',
2948
+ '\u1E9B': 's',
2949
+ '\u24E3': 't',
2950
+ '\uFF54': 't',
2951
+ '\u1E6B': 't',
2952
+ '\u1E97': 't',
2953
+ '\u0165': 't',
2954
+ '\u1E6D': 't',
2955
+ '\u021B': 't',
2956
+ '\u0163': 't',
2957
+ '\u1E71': 't',
2958
+ '\u1E6F': 't',
2959
+ '\u0167': 't',
2960
+ '\u01AD': 't',
2961
+ '\u0288': 't',
2962
+ '\u2C66': 't',
2963
+ '\uA787': 't',
2964
+ '\uA729': 'tz',
2965
+ '\u24E4': 'u',
2966
+ '\uFF55': 'u',
2967
+ '\u00F9': 'u',
2968
+ '\u00FA': 'u',
2969
+ '\u00FB': 'u',
2970
+ '\u0169': 'u',
2971
+ '\u1E79': 'u',
2972
+ '\u016B': 'u',
2973
+ '\u1E7B': 'u',
2974
+ '\u016D': 'u',
2975
+ '\u00FC': 'u',
2976
+ '\u01DC': 'u',
2977
+ '\u01D8': 'u',
2978
+ '\u01D6': 'u',
2979
+ '\u01DA': 'u',
2980
+ '\u1EE7': 'u',
2981
+ '\u016F': 'u',
2982
+ '\u0171': 'u',
2983
+ '\u01D4': 'u',
2984
+ '\u0215': 'u',
2985
+ '\u0217': 'u',
2986
+ '\u01B0': 'u',
2987
+ '\u1EEB': 'u',
2988
+ '\u1EE9': 'u',
2989
+ '\u1EEF': 'u',
2990
+ '\u1EED': 'u',
2991
+ '\u1EF1': 'u',
2992
+ '\u1EE5': 'u',
2993
+ '\u1E73': 'u',
2994
+ '\u0173': 'u',
2995
+ '\u1E77': 'u',
2996
+ '\u1E75': 'u',
2997
+ '\u0289': 'u',
2998
+ '\u24E5': 'v',
2999
+ '\uFF56': 'v',
3000
+ '\u1E7D': 'v',
3001
+ '\u1E7F': 'v',
3002
+ '\u028B': 'v',
3003
+ '\uA75F': 'v',
3004
+ '\u028C': 'v',
3005
+ '\uA761': 'vy',
3006
+ '\u24E6': 'w',
3007
+ '\uFF57': 'w',
3008
+ '\u1E81': 'w',
3009
+ '\u1E83': 'w',
3010
+ '\u0175': 'w',
3011
+ '\u1E87': 'w',
3012
+ '\u1E85': 'w',
3013
+ '\u1E98': 'w',
3014
+ '\u1E89': 'w',
3015
+ '\u2C73': 'w',
3016
+ '\u24E7': 'x',
3017
+ '\uFF58': 'x',
3018
+ '\u1E8B': 'x',
3019
+ '\u1E8D': 'x',
3020
+ '\u24E8': 'y',
3021
+ '\uFF59': 'y',
3022
+ '\u1EF3': 'y',
3023
+ '\u00FD': 'y',
3024
+ '\u0177': 'y',
3025
+ '\u1EF9': 'y',
3026
+ '\u0233': 'y',
3027
+ '\u1E8F': 'y',
3028
+ '\u00FF': 'y',
3029
+ '\u1EF7': 'y',
3030
+ '\u1E99': 'y',
3031
+ '\u1EF5': 'y',
3032
+ '\u01B4': 'y',
3033
+ '\u024F': 'y',
3034
+ '\u1EFF': 'y',
3035
+ '\u24E9': 'z',
3036
+ '\uFF5A': 'z',
3037
+ '\u017A': 'z',
3038
+ '\u1E91': 'z',
3039
+ '\u017C': 'z',
3040
+ '\u017E': 'z',
3041
+ '\u1E93': 'z',
3042
+ '\u1E95': 'z',
3043
+ '\u01B6': 'z',
3044
+ '\u0225': 'z',
3045
+ '\u0240': 'z',
3046
+ '\u2C6C': 'z',
3047
+ '\uA763': 'z',
3048
+ '\u0386': '\u0391',
3049
+ '\u0388': '\u0395',
3050
+ '\u0389': '\u0397',
3051
+ '\u038A': '\u0399',
3052
+ '\u03AA': '\u0399',
3053
+ '\u038C': '\u039F',
3054
+ '\u038E': '\u03A5',
3055
+ '\u03AB': '\u03A5',
3056
+ '\u038F': '\u03A9',
3057
+ '\u03AC': '\u03B1',
3058
+ '\u03AD': '\u03B5',
3059
+ '\u03AE': '\u03B7',
3060
+ '\u03AF': '\u03B9',
3061
+ '\u03CA': '\u03B9',
3062
+ '\u0390': '\u03B9',
3063
+ '\u03CC': '\u03BF',
3064
+ '\u03CD': '\u03C5',
3065
+ '\u03CB': '\u03C5',
3066
+ '\u03B0': '\u03C5',
3067
+ '\u03C9': '\u03C9',
3068
+ '\u03C2': '\u03C3'
3069
+ };
3070
+
3071
+ return diacritics;
3072
+ });
3073
+
3074
+ S2.define('select2/data/base',[
3075
+ '../utils'
3076
+ ], function (Utils) {
3077
+ function BaseAdapter ($element, options) {
3078
+ BaseAdapter.__super__.constructor.call(this);
3079
+ }
3080
+
3081
+ Utils.Extend(BaseAdapter, Utils.Observable);
3082
+
3083
+ BaseAdapter.prototype.current = function (callback) {
3084
+ throw new Error('The `current` method must be defined in child classes.');
3085
+ };
3086
+
3087
+ BaseAdapter.prototype.query = function (params, callback) {
3088
+ throw new Error('The `query` method must be defined in child classes.');
3089
+ };
3090
+
3091
+ BaseAdapter.prototype.bind = function (container, $container) {
3092
+ // Can be implemented in subclasses
3093
+ };
3094
+
3095
+ BaseAdapter.prototype.destroy = function () {
3096
+ // Can be implemented in subclasses
3097
+ };
3098
+
3099
+ BaseAdapter.prototype.generateResultId = function (container, data) {
3100
+ var id = '';
3101
+
3102
+ if (container != null) {
3103
+ id += container.id
3104
+ } else {
3105
+ id += Utils.generateChars(4);
3106
+ }
3107
+
3108
+ id += '-result-';
3109
+ id += Utils.generateChars(4);
3110
+
3111
+ if (data.id != null) {
3112
+ id += '-' + data.id.toString();
3113
+ } else {
3114
+ id += '-' + Utils.generateChars(4);
3115
+ }
3116
+ return id;
3117
+ };
3118
+
3119
+ return BaseAdapter;
3120
+ });
3121
+
3122
+ S2.define('select2/data/select',[
3123
+ './base',
3124
+ '../utils',
3125
+ 'jquery'
3126
+ ], function (BaseAdapter, Utils, $) {
3127
+ function SelectAdapter ($element, options) {
3128
+ this.$element = $element;
3129
+ this.options = options;
3130
+
3131
+ SelectAdapter.__super__.constructor.call(this);
3132
+ }
3133
+
3134
+ Utils.Extend(SelectAdapter, BaseAdapter);
3135
+
3136
+ SelectAdapter.prototype.current = function (callback) {
3137
+ var data = [];
3138
+ var self = this;
3139
+
3140
+ this.$element.find(':selected').each(function () {
3141
+ var $option = $(this);
3142
+
3143
+ var option = self.item($option);
3144
+
3145
+ data.push(option);
3146
+ });
3147
+
3148
+ callback(data);
3149
+ };
3150
+
3151
+ SelectAdapter.prototype.select = function (data) {
3152
+ var self = this;
3153
 
3154
+ data.selected = true;
 
 
3155
 
3156
+ // If data.element is a DOM node, use it instead
3157
+ if ($(data.element).is('option')) {
3158
+ data.element.selected = true;
3159
 
3160
+ this.$element.trigger('change');
 
 
3161
 
3162
+ return;
3163
+ }
 
 
 
3164
 
3165
+ if (this.$element.prop('multiple')) {
3166
+ this.current(function (currentData) {
3167
+ var val = [];
3168
 
3169
+ data = [data];
3170
+ data.push.apply(data, currentData);
3171
 
3172
+ for (var d = 0; d < data.length; d++) {
3173
+ var id = data[d].id;
 
3174
 
3175
+ if ($.inArray(id, val) === -1) {
3176
+ val.push(id);
3177
+ }
3178
+ }
 
 
 
 
 
 
 
3179
 
3180
+ self.$element.val(val);
3181
+ self.$element.trigger('change');
3182
+ });
3183
+ } else {
3184
+ var val = data.id;
3185
 
3186
+ this.$element.val(val);
3187
+ this.$element.trigger('change');
3188
+ }
3189
+ };
3190
 
3191
+ SelectAdapter.prototype.unselect = function (data) {
3192
+ var self = this;
3193
 
3194
+ if (!this.$element.prop('multiple')) {
3195
+ return;
3196
+ }
3197
 
3198
+ data.selected = false;
 
3199
 
3200
+ if ($(data.element).is('option')) {
3201
+ data.element.selected = false;
3202
 
3203
+ this.$element.trigger('change');
3204
 
3205
+ return;
3206
+ }
 
 
 
3207
 
3208
+ this.current(function (currentData) {
3209
+ var val = [];
 
 
 
 
 
 
3210
 
3211
+ for (var d = 0; d < currentData.length; d++) {
3212
+ var id = currentData[d].id;
3213
 
3214
+ if (id !== data.id && $.inArray(id, val) === -1) {
3215
+ val.push(id);
3216
+ }
3217
+ }
3218
 
3219
+ self.$element.val(val);
 
 
 
 
 
3220
 
3221
+ self.$element.trigger('change');
3222
+ });
3223
+ };
 
 
 
3224
 
3225
+ SelectAdapter.prototype.bind = function (container, $container) {
3226
+ var self = this;
 
 
 
3227
 
3228
+ this.container = container;
 
 
3229
 
3230
+ container.on('select', function (params) {
3231
+ self.select(params.data);
3232
+ });
3233
 
3234
+ container.on('unselect', function (params) {
3235
+ self.unselect(params.data);
3236
+ });
3237
+ };
3238
 
3239
+ SelectAdapter.prototype.destroy = function () {
3240
+ // Remove anything added to child elements
3241
+ this.$element.find('*').each(function () {
3242
+ // Remove any custom data set by Select2
3243
+ $.removeData(this, 'data');
3244
+ });
3245
+ };
 
3246
 
3247
+ SelectAdapter.prototype.query = function (params, callback) {
3248
+ var data = [];
3249
+ var self = this;
3250
 
3251
+ var $options = this.$element.children();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3252
 
3253
+ $options.each(function () {
3254
+ var $option = $(this);
3255
 
3256
+ if (!$option.is('option') && !$option.is('optgroup')) {
3257
+ return;
3258
+ }
3259
 
3260
+ var option = self.item($option);
3261
 
3262
+ var matches = self.matches(params, option);
 
3263
 
3264
+ if (matches !== null) {
3265
+ data.push(matches);
3266
+ }
3267
+ });
 
3268
 
3269
+ callback({
3270
+ results: data
3271
+ });
3272
+ };
3273
 
3274
+ SelectAdapter.prototype.addOptions = function ($options) {
3275
+ Utils.appendMany(this.$element, $options);
3276
+ };
3277
 
3278
+ SelectAdapter.prototype.option = function (data) {
3279
+ var option;
3280
 
3281
+ if (data.children) {
3282
+ option = document.createElement('optgroup');
3283
+ option.label = data.text;
3284
+ } else {
3285
+ option = document.createElement('option');
3286
 
3287
+ if (option.textContent !== undefined) {
3288
+ option.textContent = data.text;
3289
+ } else {
3290
+ option.innerText = data.text;
3291
+ }
3292
+ }
3293
 
3294
+ if (data.id !== undefined) {
3295
+ option.value = data.id;
3296
+ }
3297
 
3298
+ if (data.disabled) {
3299
+ option.disabled = true;
3300
+ }
 
 
3301
 
3302
+ if (data.selected) {
3303
+ option.selected = true;
3304
+ }
3305
 
3306
+ if (data.title) {
3307
+ option.title = data.title;
3308
+ }
 
 
 
 
3309
 
3310
+ var $option = $(option);
 
3311
 
3312
+ var normalizedData = this._normalizeItem(data);
3313
+ normalizedData.element = option;
3314
 
3315
+ // Override the option's data with the combined data
3316
+ $.data(option, 'data', normalizedData);
 
3317
 
3318
+ return $option;
3319
+ };
3320
 
3321
+ SelectAdapter.prototype.item = function ($option) {
3322
+ var data = {};
 
 
 
3323
 
3324
+ data = $.data($option[0], 'data');
 
 
 
 
3325
 
3326
+ if (data != null) {
3327
+ return data;
3328
+ }
 
3329
 
3330
+ if ($option.is('option')) {
3331
+ data = {
3332
+ id: $option.val(),
3333
+ text: $option.text(),
3334
+ disabled: $option.prop('disabled'),
3335
+ selected: $option.prop('selected'),
3336
+ title: $option.prop('title')
3337
+ };
3338
+ } else if ($option.is('optgroup')) {
3339
+ data = {
3340
+ text: $option.prop('label'),
3341
+ children: [],
3342
+ title: $option.prop('title')
3343
+ };
3344
 
3345
+ var $children = $option.children('option');
3346
+ var children = [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3347
 
3348
+ for (var c = 0; c < $children.length; c++) {
3349
+ var $child = $($children[c]);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3350
 
3351
+ var child = this.item($child);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3352
 
3353
+ children.push(child);
3354
+ }
 
 
 
 
 
 
 
 
 
3355
 
3356
+ data.children = children;
3357
+ }
 
3358
 
3359
+ data = this._normalizeItem(data);
3360
+ data.element = $option[0];
3361
 
3362
+ $.data($option[0], 'data', data);
3363
 
3364
+ return data;
3365
+ };
3366
 
3367
+ SelectAdapter.prototype._normalizeItem = function (item) {
3368
+ if (!$.isPlainObject(item)) {
3369
+ item = {
3370
+ id: item,
3371
+ text: item
3372
+ };
3373
+ }
3374
 
3375
+ item = $.extend({}, {
3376
+ text: ''
3377
+ }, item);
 
 
3378
 
3379
+ var defaults = {
3380
+ selected: false,
3381
+ disabled: false
3382
+ };
3383
 
3384
+ if (item.id != null) {
3385
+ item.id = item.id.toString();
3386
+ }
3387
 
3388
+ if (item.text != null) {
3389
+ item.text = item.text.toString();
3390
+ }
 
3391
 
3392
+ if (item._resultId == null && item.id) {
3393
+ item._resultId = this.generateResultId(this.container, item);
3394
+ }
3395
 
3396
+ return $.extend({}, defaults, item);
3397
+ };
 
 
3398
 
3399
+ SelectAdapter.prototype.matches = function (params, data) {
3400
+ var matcher = this.options.get('matcher');
 
3401
 
3402
+ return matcher(params, data);
3403
+ };
3404
 
3405
+ return SelectAdapter;
3406
+ });
3407
 
3408
+ S2.define('select2/data/array',[
3409
+ './select',
3410
+ '../utils',
3411
+ 'jquery'
3412
+ ], function (SelectAdapter, Utils, $) {
3413
+ function ArrayAdapter ($element, options) {
3414
+ var data = options.get('data') || [];
3415
 
3416
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
 
3417
 
3418
+ this.addOptions(this.convertToOptions(data));
3419
+ }
3420
 
3421
+ Utils.Extend(ArrayAdapter, SelectAdapter);
 
3422
 
3423
+ ArrayAdapter.prototype.select = function (data) {
3424
+ var $option = this.$element.find('option').filter(function (i, elm) {
3425
+ return elm.value == data.id.toString();
3426
+ });
3427
 
3428
+ if ($option.length === 0) {
3429
+ $option = this.option(data);
 
 
 
 
 
 
3430
 
3431
+ this.addOptions($option);
3432
+ }
3433
 
3434
+ ArrayAdapter.__super__.select.call(this, data);
3435
+ };
3436
 
3437
+ ArrayAdapter.prototype.convertToOptions = function (data) {
3438
+ var self = this;
 
 
 
3439
 
3440
+ var $existing = this.$element.find('option');
3441
+ var existingIds = $existing.map(function () {
3442
+ return self.item($(this)).id;
3443
+ }).get();
3444
 
3445
+ var $options = [];
 
 
 
3446
 
3447
+ // Filter out all items except for the one passed in the argument
3448
+ function onlyItem (item) {
3449
+ return function () {
3450
+ return $(this).val() == item.id;
3451
+ };
3452
+ }
3453
 
3454
+ for (var d = 0; d < data.length; d++) {
3455
+ var item = this._normalizeItem(data[d]);
 
 
3456
 
3457
+ // Skip items which were pre-loaded, only merge the data
3458
+ if ($.inArray(item.id, existingIds) >= 0) {
3459
+ var $existingOption = $existing.filter(onlyItem(item));
3460
 
3461
+ var existingData = this.item($existingOption);
3462
+ var newData = $.extend(true, {}, item, existingData);
3463
 
3464
+ var $newOption = this.option(newData);
 
 
 
 
 
 
3465
 
3466
+ $existingOption.replaceWith($newOption);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3467
 
3468
+ continue;
3469
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3470
 
3471
+ var $option = this.option(item);
3472
 
3473
+ if (item.children) {
3474
+ var $children = this.convertToOptions(item.children);
 
3475
 
3476
+ Utils.appendMany($option, $children);
3477
+ }
3478
 
3479
+ $options.push($option);
3480
+ }
3481
 
3482
+ return $options;
3483
+ };
3484
 
3485
+ return ArrayAdapter;
3486
+ });
3487
 
3488
+ S2.define('select2/data/ajax',[
3489
+ './array',
3490
+ '../utils',
3491
+ 'jquery'
3492
+ ], function (ArrayAdapter, Utils, $) {
3493
+ function AjaxAdapter ($element, options) {
3494
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3495
 
3496
+ if (this.ajaxOptions.processResults != null) {
3497
+ this.processResults = this.ajaxOptions.processResults;
3498
+ }
3499
 
3500
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
3501
+ }
3502
+
3503
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
3504
 
3505
+ AjaxAdapter.prototype._applyDefaults = function (options) {
3506
+ var defaults = {
3507
+ data: function (params) {
3508
+ return $.extend({}, params, {
3509
+ q: params.term
3510
+ });
3511
+ },
3512
+ transport: function (params, success, failure) {
3513
+ var $request = $.ajax(params);
3514
 
3515
+ $request.then(success);
3516
+ $request.fail(failure);
3517
 
3518
+ return $request;
3519
+ }
3520
+ };
3521
 
3522
+ return $.extend({}, defaults, options, true);
3523
+ };
3524
 
3525
+ AjaxAdapter.prototype.processResults = function (results) {
3526
+ return results;
3527
+ };
3528
 
3529
+ AjaxAdapter.prototype.query = function (params, callback) {
3530
+ var matches = [];
3531
+ var self = this;
 
3532
 
3533
+ if (this._request != null) {
3534
+ // JSONP requests cannot always be aborted
3535
+ if ($.isFunction(this._request.abort)) {
3536
+ this._request.abort();
3537
+ }
3538
 
3539
+ this._request = null;
3540
+ }
 
 
3541
 
3542
+ var options = $.extend({
3543
+ type: 'GET'
3544
+ }, this.ajaxOptions);
3545
 
3546
+ if (typeof options.url === 'function') {
3547
+ options.url = options.url.call(this.$element, params);
3548
+ }
3549
 
3550
+ if (typeof options.data === 'function') {
3551
+ options.data = options.data.call(this.$element, params);
3552
+ }
3553
 
3554
+ function request () {
3555
+ var $request = options.transport(options, function (data) {
3556
+ var results = self.processResults(data, params);
3557
 
3558
+ if (self.options.get('debug') && window.console && console.error) {
3559
+ // Check to make sure that the response included a `results` key.
3560
+ if (!results || !results.results || !$.isArray(results.results)) {
3561
+ console.error(
3562
+ 'Select2: The AJAX results did not return an array in the ' +
3563
+ '`results` key of the response.'
3564
+ );
3565
+ }
3566
+ }
3567
 
3568
+ callback(results);
3569
+ self.container.focusOnActiveElement();
3570
+ }, function () {
3571
+ // Attempt to detect if a request was aborted
3572
+ // Only works if the transport exposes a status property
3573
+ if ($request.status && $request.status === '0') {
3574
+ return;
3575
+ }
3576
+
3577
+ self.trigger('results:message', {
3578
+ message: 'errorLoading'
3579
+ });
3580
+ });
3581
+
3582
+ self._request = $request;
3583
+ }
3584
+
3585
+ if (this.ajaxOptions.delay && params.term != null) {
3586
+ if (this._queryTimeout) {
3587
+ window.clearTimeout(this._queryTimeout);
3588
+ }
3589
+
3590
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3591
+ } else {
3592
+ request();
3593
+ }
3594
+ };
3595
 
3596
+ return AjaxAdapter;
3597
+ });
3598
 
3599
+ S2.define('select2/data/tags',[
3600
+ 'jquery'
3601
+ ], function ($) {
3602
+ function Tags (decorated, $element, options) {
3603
+ var tags = options.get('tags');
3604
 
3605
+ var createTag = options.get('createTag');
 
 
 
3606
 
3607
+ if (createTag !== undefined) {
3608
+ this.createTag = createTag;
3609
+ }
3610
 
3611
+ var insertTag = options.get('insertTag');
 
 
3612
 
3613
+ if (insertTag !== undefined) {
3614
+ this.insertTag = insertTag;
3615
+ }
3616
 
3617
+ decorated.call(this, $element, options);
3618
 
3619
+ if ($.isArray(tags)) {
3620
+ for (var t = 0; t < tags.length; t++) {
3621
+ var tag = tags[t];
3622
+ var item = this._normalizeItem(tag);
3623
 
3624
+ var $option = this.option(item);
 
 
 
3625
 
3626
+ this.$element.append($option);
3627
+ }
3628
+ }
3629
+ }
 
 
 
3630
 
3631
+ Tags.prototype.query = function (decorated, params, callback) {
3632
+ var self = this;
 
3633
 
3634
+ this._removeOldTags();
3635
 
3636
+ if (params.term == null || params.page != null) {
3637
+ decorated.call(this, params, callback);
3638
+ return;
3639
+ }
3640
 
3641
+ function wrapper (obj, child) {
3642
+ var data = obj.results;
 
3643
 
3644
+ for (var i = 0; i < data.length; i++) {
3645
+ var option = data[i];
3646
 
3647
+ var checkChildren = (
3648
+ option.children != null &&
3649
+ !wrapper({
3650
+ results: option.children
3651
+ }, true)
3652
+ );
3653
 
3654
+ var optionText = (option.text || '').toUpperCase();
3655
+ var paramsTerm = (params.term || '').toUpperCase();
 
 
3656
 
3657
+ var checkText = optionText === paramsTerm;
 
 
 
3658
 
3659
+ if (checkText || checkChildren) {
3660
+ if (child) {
3661
+ return false;
3662
+ }
3663
 
3664
+ obj.data = data;
3665
+ callback(obj);
3666
 
3667
+ return;
3668
+ }
3669
+ }
 
 
3670
 
3671
+ if (child) {
3672
+ return true;
3673
+ }
 
 
 
3674
 
3675
+ var tag = self.createTag(params);
 
 
3676
 
3677
+ if (tag != null) {
3678
+ var $option = self.option(tag);
3679
+ $option.attr('data-select2-tag', true);
3680
 
3681
+ self.addOptions([$option]);
 
 
3682
 
3683
+ self.insertTag(data, tag);
3684
+ }
 
3685
 
3686
+ obj.results = data;
3687
 
3688
+ callback(obj);
3689
+ }
3690
 
3691
+ decorated.call(this, params, wrapper);
3692
+ };
3693
 
3694
+ Tags.prototype.createTag = function (decorated, params) {
3695
+ var term = $.trim(params.term);
3696
 
3697
+ if (term === '') {
3698
+ return null;
3699
+ }
3700
 
3701
+ return {
3702
+ id: term,
3703
+ text: term
3704
+ };
3705
+ };
3706
 
3707
+ Tags.prototype.insertTag = function (_, data, tag) {
3708
+ data.unshift(tag);
3709
+ };
3710
 
3711
+ Tags.prototype._removeOldTags = function (_) {
3712
+ var tag = this._lastTag;
 
 
 
 
 
 
 
 
 
 
 
 
3713
 
3714
+ var $options = this.$element.find('option[data-select2-tag]');
 
3715
 
3716
+ $options.each(function () {
3717
+ if (this.selected) {
3718
+ return;
3719
+ }
3720
 
3721
+ $(this).remove();
3722
+ });
3723
+ };
3724
 
3725
+ return Tags;
3726
+ });
3727
 
3728
+ S2.define('select2/data/tokenizer',[
3729
+ 'jquery'
3730
+ ], function ($) {
3731
+ function Tokenizer (decorated, $element, options) {
3732
+ var tokenizer = options.get('tokenizer');
3733
 
3734
+ if (tokenizer !== undefined) {
3735
+ this.tokenizer = tokenizer;
3736
+ }
3737
 
3738
+ decorated.call(this, $element, options);
3739
+ }
3740
 
3741
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
3742
+ decorated.call(this, container, $container);
3743
 
3744
+ this.$search = container.dropdown.$search || container.selection.$search ||
3745
+ $container.find('.select2-search__field');
3746
+ };
 
 
 
 
3747
 
3748
+ Tokenizer.prototype.query = function (decorated, params, callback) {
3749
+ var self = this;
 
3750
 
3751
+ function createAndSelect (data) {
3752
+ // Normalize the data object so we can use it for checks
3753
+ var item = self._normalizeItem(data);
 
3754
 
3755
+ // Check if the data object already exists as a tag
3756
+ // Select it if it doesn't
3757
+ var $existingOptions = self.$element.find('option').filter(function () {
3758
+ return $(this).val() === item.id;
3759
+ });
3760
 
3761
+ // If an existing option wasn't found for it, create the option
3762
+ if (!$existingOptions.length) {
3763
+ var $option = self.option(item);
3764
+ $option.attr('data-select2-tag', true);
3765
 
3766
+ self._removeOldTags();
3767
+ self.addOptions([$option]);
3768
+ }
3769
 
3770
+ // Select the item, now that we know there is an option for it
3771
+ select(item);
3772
+ }
3773
 
3774
+ function select (data) {
3775
+ self.trigger('select', {
3776
+ data: data
3777
+ });
3778
+ }
3779
 
3780
+ params.term = params.term || '';
 
3781
 
3782
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
 
3783
 
3784
+ if (tokenData.term !== params.term) {
3785
+ // Replace the search term if we have the search box
3786
+ if (this.$search.length) {
3787
+ this.$search.val(tokenData.term);
3788
+ this.$search.focus();
3789
+ }
 
3790
 
3791
+ params.term = tokenData.term;
3792
+ }
3793
 
3794
+ decorated.call(this, params, callback);
3795
+ };
3796
 
3797
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3798
+ var separators = options.get('tokenSeparators') || [];
3799
+ var term = params.term;
3800
+ var i = 0;
3801
 
3802
+ var createTag = this.createTag || function (params) {
3803
+ return {
3804
+ id: params.term,
3805
+ text: params.term
3806
+ };
3807
+ };
3808
 
3809
+ while (i < term.length) {
3810
+ var termChar = term[i];
3811
 
3812
+ if ($.inArray(termChar, separators) === -1) {
3813
+ i++;
3814
 
3815
+ continue;
3816
+ }
3817
 
3818
+ var part = term.substr(0, i);
3819
+ var partParams = $.extend({}, params, {
3820
+ term: part
3821
+ });
3822
 
3823
+ var data = createTag(partParams);
 
 
 
3824
 
3825
+ if (data == null) {
3826
+ i++;
3827
+ continue;
3828
+ }
3829
+
3830
+ callback(data);
3831
+
3832
+ // Reset the term to not include the tokenized portion
3833
+ term = term.substr(i + 1) || '';
3834
+ i = 0;
3835
+ }
3836
+
3837
+ return {
3838
+ term: term
3839
+ };
3840
+ };
3841
+
3842
+ return Tokenizer;
3843
+ });
3844
+
3845
+ S2.define('select2/data/minimumInputLength',[
3846
+
3847
+ ], function () {
3848
+ function MinimumInputLength (decorated, $e, options) {
3849
+ this.minimumInputLength = options.get('minimumInputLength');
3850
+
3851
+ decorated.call(this, $e, options);
3852
+ }
3853
+
3854
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
3855
+ params.term = params.term || '';
3856
+
3857
+ if (params.term.length < this.minimumInputLength) {
3858
+ this.trigger('results:message', {
3859
+ message: 'inputTooShort',
3860
+ args: {
3861
+ minimum: this.minimumInputLength,
3862
+ input: params.term,
3863
+ params: params
3864
+ }
3865
+ });
3866
+
3867
+ return;
3868
+ }
3869
+
3870
+ decorated.call(this, params, callback);
3871
+ };
3872
+
3873
+ return MinimumInputLength;
3874
+ });
3875
+
3876
+ S2.define('select2/data/maximumInputLength',[
3877
+
3878
+ ], function () {
3879
+ function MaximumInputLength (decorated, $e, options) {
3880
+ this.maximumInputLength = options.get('maximumInputLength');
3881
+
3882
+ decorated.call(this, $e, options);
3883
+ }
3884
+
3885
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
3886
+ params.term = params.term || '';
3887
+
3888
+ if (this.maximumInputLength > 0 &&
3889
+ params.term.length > this.maximumInputLength) {
3890
+ this.trigger('results:message', {
3891
+ message: 'inputTooLong',
3892
+ args: {
3893
+ maximum: this.maximumInputLength,
3894
+ input: params.term,
3895
+ params: params
3896
+ }
3897
+ });
3898
+
3899
+ return;
3900
+ }
3901
+
3902
+ decorated.call(this, params, callback);
3903
+ };
3904
+
3905
+ return MaximumInputLength;
3906
+ });
3907
 
3908
+ S2.define('select2/data/maximumSelectionLength',[
3909
+
3910
+ ], function (){
3911
+ function MaximumSelectionLength (decorated, $e, options) {
3912
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
 
3913
 
3914
+ decorated.call(this, $e, options);
3915
+ }
3916
 
3917
+ MaximumSelectionLength.prototype.query =
3918
+ function (decorated, params, callback) {
3919
+ var self = this;
3920
 
3921
+ this.current(function (currentData) {
3922
+ var count = currentData != null ? currentData.length : 0;
3923
+ if (self.maximumSelectionLength > 0 &&
3924
+ count >= self.maximumSelectionLength) {
3925
+ self.trigger('results:message', {
3926
+ message: 'maximumSelected',
3927
+ args: {
3928
+ maximum: self.maximumSelectionLength
3929
+ }
3930
+ });
3931
+ return;
3932
+ }
3933
+ decorated.call(self, params, callback);
3934
+ });
3935
+ };
3936
+
3937
+ return MaximumSelectionLength;
3938
+ });
3939
+
3940
+ S2.define('select2/dropdown',[
3941
+ 'jquery',
3942
+ './utils'
3943
+ ], function ($, Utils) {
3944
+ function Dropdown ($element, options) {
3945
+ this.$element = $element;
3946
+ this.options = options;
3947
+
3948
+ Dropdown.__super__.constructor.call(this);
3949
+ }
3950
+
3951
+ Utils.Extend(Dropdown, Utils.Observable);
3952
+
3953
+ Dropdown.prototype.render = function () {
3954
+ var $dropdown = $(
3955
+ '<span class="select2-dropdown">' +
3956
+ '<span class="select2-results"></span>' +
3957
+ '</span>'
3958
+ );
3959
+
3960
+ $dropdown.attr('dir', this.options.get('dir'));
3961
+
3962
+ this.$dropdown = $dropdown;
3963
+
3964
+ return $dropdown;
3965
+ };
3966
+
3967
+ Dropdown.prototype.bind = function () {
3968
+ // Should be implemented in subclasses
3969
+ };
3970
+
3971
+ Dropdown.prototype.position = function ($dropdown, $container) {
3972
+ // Should be implmented in subclasses
3973
+ };
3974
+
3975
+ Dropdown.prototype.destroy = function () {
3976
+ // Remove the dropdown from the DOM
3977
+ this.$dropdown.remove();
3978
+ };
3979
+
3980
+ return Dropdown;
3981
+ });
3982
+
3983
+ S2.define('select2/dropdown/search',[
3984
+ 'jquery',
3985
+ '../utils'
3986
+ ], function ($, Utils) {
3987
+ function Search () { }
3988
+
3989
+ Search.prototype.render = function (decorated) {
3990
+ var $rendered = decorated.call(this);
3991
+
3992
+ var $search = $(
3993
+ '<span class="select2-search select2-search--dropdown">' +
3994
+ '<input class="select2-search__field" type="text" tabindex="-1"' +
3995
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
3996
+ ' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
3997
+ '</span>'
3998
+ );
3999
+
4000
+ this.$searchContainer = $search;
4001
+ this.$search = $search.find('input');
4002
+
4003
+ $rendered.prepend($search);
4004
+
4005
+ return $rendered;
4006
+ };
4007
+
4008
+ Search.prototype.bind = function (decorated, container, $container) {
4009
+ var self = this;
4010
+ var resultsId = container.id + '-results';
4011
+
4012
+ decorated.call(this, container, $container);
4013
+
4014
+ this.$search.on('keydown', function (evt) {
4015
+ self.trigger('keypress', evt);
4016
+
4017
+ self._keyUpPrevented = evt.isDefaultPrevented();
4018
+ });
4019
+
4020
+ // Workaround for browsers which do not support the `input` event
4021
+ // This will prevent double-triggering of events for browsers which support
4022
+ // both the `keyup` and `input` events.
4023
+ this.$search.on('input', function (evt) {
4024
+ // Unbind the duplicated `keyup` event
4025
+ $(this).off('keyup');
4026
+ });
4027
+
4028
+ this.$search.on('keyup input', function (evt) {
4029
+ self.handleSearch(evt);
4030
+ });
4031
+
4032
+ container.on('open', function () {
4033
+ self.$search.attr('tabindex', 0);
4034
+ self.$search.attr('aria-owns', resultsId);
4035
+ self.$search.focus();
4036
+
4037
+ window.setTimeout(function () {
4038
+ self.$search.focus();
4039
+ }, 0);
4040
+ });
4041
+
4042
+ container.on('close', function () {
4043
+ self.$search.attr('tabindex', -1);
4044
+ self.$search.removeAttr('aria-activedescendant');
4045
+ self.$search.removeAttr('aria-owns');
4046
+ self.$search.val('');
4047
+ });
4048
+
4049
+ container.on('focus', function () {
4050
+ if (!container.isOpen()) {
4051
+ self.$search.focus();
4052
+ }
4053
+ });
4054
+
4055
+ container.on('results:all', function (params) {
4056
+ if (params.query.term == null || params.query.term === '') {
4057
+ var showSearch = self.showSearch(params);
4058
 
4059
+ if (showSearch) {
4060
+ self.$searchContainer.removeClass('select2-search--hide');
4061
+ } else {
4062
+ self.$searchContainer.addClass('select2-search--hide');
4063
+ }
4064
+ }
4065
+ });
4066
 
4067
+ container.on('results:focus', function (params) {
4068
+ self.$search.attr('aria-activedescendant', params.data._resultId);
4069
+ });
4070
+ };
4071
+
4072
+ Search.prototype.handleSearch = function (evt) {
4073
+ if (!this._keyUpPrevented) {
4074
+ var input = this.$search.val();
4075
+
4076
+ this.trigger('query', {
4077
+ term: input
4078
+ });
4079
+ }
4080
+
4081
+ this._keyUpPrevented = false;
4082
+ };
4083
+
4084
+ Search.prototype.showSearch = function (_, params) {
4085
+ return true;
4086
+ };
4087
+
4088
+ return Search;
4089
+ });
4090
+
4091
+ S2.define('select2/dropdown/hidePlaceholder',[
4092
+
4093
+ ], function () {
4094
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
4095
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4096
+
4097
+ decorated.call(this, $element, options, dataAdapter);
4098
+ }
4099
 
4100
+ HidePlaceholder.prototype.append = function (decorated, data) {
4101
+ data.results = this.removePlaceholder(data.results);
4102
 
4103
+ decorated.call(this, data);
4104
+ };
4105
+
4106
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
4107
+ if (typeof placeholder === 'string') {
4108
+ placeholder = {
4109
+ id: '',
4110
+ text: placeholder
4111
+ };
4112
+ }
4113
+
4114
+ return placeholder;
4115
+ };
4116
+
4117
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4118
+ var modifiedData = data.slice(0);
4119
+
4120
+ for (var d = data.length - 1; d >= 0; d--) {
4121
+ var item = data[d];
4122
+
4123
+ if (this.placeholder.id === item.id) {
4124
+ modifiedData.splice(d, 1);
4125
+ }
4126
+ }
4127
 
4128
+ return modifiedData;
4129
+ };
4130
 
4131
+ return HidePlaceholder;
4132
+ });
4133
 
4134
+ S2.define('select2/dropdown/infiniteScroll',[
4135
+ 'jquery'
4136
+ ], function ($) {
4137
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
4138
+ this.lastParams = {};
4139
 
4140
+ decorated.call(this, $element, options, dataAdapter);
 
4141
 
4142
+ this.$loadingMore = this.createLoadingMore();
4143
+ this.loading = false;
4144
+ }
4145
 
4146
+ InfiniteScroll.prototype.append = function (decorated, data) {
4147
+ this.$loadingMore.remove();
4148
+ this.loading = false;
 
 
 
 
4149
 
4150
+ decorated.call(this, data);
 
 
4151
 
4152
+ if (this.showLoadingMore(data)) {
4153
+ this.$results.append(this.$loadingMore);
4154
+ }
4155
+ };
4156
 
4157
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4158
+ var self = this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4159
 
4160
+ decorated.call(this, container, $container);
 
4161
 
4162
+ container.on('query', function (params) {
4163
+ self.lastParams = params;
4164
+ self.loading = true;
4165
+ });
4166
 
4167
+ container.on('query:append', function (params) {
4168
+ self.lastParams = params;
4169
+ self.loading = true;
4170
+ });
4171
 
4172
+ this.$results.on('scroll', function () {
4173
+ var isLoadMoreVisible = $.contains(
4174
+ document.documentElement,
4175
+ self.$loadingMore[0]
4176
+ );
4177
 
4178
+ if (self.loading || !isLoadMoreVisible) {
4179
+ return;
4180
+ }
4181
 
4182
+ var currentOffset = self.$results.offset().top +
4183
+ self.$results.outerHeight(false);
4184
+ var loadingMoreOffset = self.$loadingMore.offset().top +
4185
+ self.$loadingMore.outerHeight(false);
 
 
4186
 
4187
+ if (currentOffset + 50 >= loadingMoreOffset) {
4188
+ self.loadMore();
4189
+ }
4190
+ });
4191
+ };
4192
 
4193
+ InfiniteScroll.prototype.loadMore = function () {
4194
+ this.loading = true;
4195
 
4196
+ var params = $.extend({}, {page: 1}, this.lastParams);
 
 
 
4197
 
4198
+ params.page++;
 
4199
 
4200
+ this.trigger('query:append', params);
4201
+ };
 
4202
 
4203
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4204
+ return data.pagination && data.pagination.more;
4205
+ };
4206
 
4207
+ InfiniteScroll.prototype.createLoadingMore = function () {
4208
+ var $option = $(
4209
+ '<li ' +
4210
+ 'class="select2-results__option select2-results__option--load-more"' +
4211
+ 'role="option" aria-disabled="true"></li>'
4212
+ );
4213
 
4214
+ var message = this.options.get('translations').get('loadingMore');
 
 
4215
 
4216
+ $option.html(message(this.lastParams));
4217
 
4218
+ return $option;
4219
+ };
4220
 
4221
+ return InfiniteScroll;
4222
+ });
4223
 
4224
+ S2.define('select2/dropdown/attachBody',[
4225
+ 'jquery',
4226
+ '../utils'
4227
+ ], function ($, Utils) {
4228
+ function AttachBody (decorated, $element, options) {
4229
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
4230
 
4231
+ decorated.call(this, $element, options);
4232
+ }
4233
 
4234
+ AttachBody.prototype.bind = function (decorated, container, $container) {
4235
+ var self = this;
4236
 
4237
+ var setupResultsEvents = false;
 
 
4238
 
4239
+ decorated.call(this, container, $container);
 
 
 
 
4240
 
4241
+ container.on('open', function () {
4242
+ self._showDropdown();
4243
+ self._attachPositioningHandler(container);
4244
 
4245
+ if (!setupResultsEvents) {
4246
+ setupResultsEvents = true;
4247
 
4248
+ container.on('results:all', function () {
4249
+ self._positionDropdown();
4250
+ self._resizeDropdown();
4251
+ });
4252
 
4253
+ container.on('results:append', function () {
4254
+ self._positionDropdown();
4255
+ self._resizeDropdown();
4256
+ });
4257
+ }
4258
+ });
4259
 
4260
+ container.on('close', function () {
4261
+ self._hideDropdown();
4262
+ self._detachPositioningHandler(container);
4263
+ });
4264
 
4265
+ this.$dropdownContainer.on('mousedown', function (evt) {
4266
+ evt.stopPropagation();
4267
+ });
4268
+ };
4269
 
4270
+ AttachBody.prototype.destroy = function (decorated) {
4271
+ decorated.call(this);
 
 
 
4272
 
4273
+ this.$dropdownContainer.remove();
4274
+ };
 
4275
 
4276
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4277
+ // Clone all of the container classes
4278
+ $dropdown.attr('class', $container.attr('class'));
4279
 
4280
+ $dropdown.removeClass('select2');
4281
+ $dropdown.addClass('select2-container--open');
4282
 
4283
+ $dropdown.css({
4284
+ position: 'absolute',
4285
+ top: -999999
4286
+ });
4287
 
4288
+ this.$container = $container;
4289
+ };
4290
 
4291
+ AttachBody.prototype.render = function (decorated) {
4292
+ var $container = $('<span></span>');
 
4293
 
4294
+ var $dropdown = decorated.call(this);
4295
+ $container.append($dropdown);
 
 
 
4296
 
4297
+ this.$dropdownContainer = $container;
 
 
 
4298
 
4299
+ return $container;
4300
+ };
 
4301
 
4302
+ AttachBody.prototype._hideDropdown = function (decorated) {
4303
+ this.$dropdownContainer.detach();
4304
+ };
4305
 
4306
+ AttachBody.prototype._attachPositioningHandler =
4307
+ function (decorated, container) {
4308
+ var self = this;
 
 
4309
 
4310
+ var scrollEvent = 'scroll.select2.' + container.id;
4311
+ var resizeEvent = 'resize.select2.' + container.id;
4312
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4313
 
4314
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4315
+ $watchers.each(function () {
4316
+ $(this).data('select2-scroll-position', {
4317
+ x: $(this).scrollLeft(),
4318
+ y: $(this).scrollTop()
4319
+ });
4320
+ });
4321
 
4322
+ $watchers.on(scrollEvent, function (ev) {
4323
+ var position = $(this).data('select2-scroll-position');
4324
+ $(this).scrollTop(position.y);
4325
+ });
 
 
4326
 
4327
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4328
+ function (e) {
4329
+ self._positionDropdown();
4330
+ self._resizeDropdown();
4331
+ });
4332
+ };
4333
 
4334
+ AttachBody.prototype._detachPositioningHandler =
4335
+ function (decorated, container) {
4336
+ var scrollEvent = 'scroll.select2.' + container.id;
4337
+ var resizeEvent = 'resize.select2.' + container.id;
4338
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4339
 
4340
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4341
+ $watchers.off(scrollEvent);
4342
+
4343
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4344
+ };
4345
+
4346
+ AttachBody.prototype._positionDropdown = function () {
4347
+ var $window = $(window);
4348
 
4349
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4350
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
 
 
 
 
4351
 
4352
+ var newDirection = null;
 
4353
 
4354
+ var offset = this.$container.offset();
 
4355
 
4356
+ offset.bottom = offset.top + this.$container.outerHeight(false);
 
4357
 
4358
+ var container = {
4359
+ height: this.$container.outerHeight(false)
4360
+ };
 
4361
 
4362
+ container.top = offset.top;
4363
+ container.bottom = offset.top + container.height;
4364
 
4365
+ var dropdown = {
4366
+ height: this.$dropdown.outerHeight(false)
4367
+ };
 
4368
 
4369
+ var viewport = {
4370
+ top: $window.scrollTop(),
4371
+ bottom: $window.scrollTop() + $window.height()
4372
+ };
4373
 
4374
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4375
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
 
 
4376
 
4377
+ var css = {
4378
+ left: offset.left,
4379
+ top: container.bottom
4380
+ };
4381
 
4382
+ // Determine what the parent element is to use for calciulating the offset
4383
+ var $offsetParent = this.$dropdownParent;
4384
 
4385
+ // For statically positoned elements, we need to get the element
4386
+ // that is determining the offset
4387
+ if ($offsetParent.css('position') === 'static') {
4388
+ $offsetParent = $offsetParent.offsetParent();
4389
+ }
4390
 
4391
+ var parentOffset = $offsetParent.offset();
 
 
4392
 
4393
+ css.top -= parentOffset.top;
4394
+ css.left -= parentOffset.left;
4395
 
4396
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
4397
+ newDirection = 'below';
4398
+ }
4399
 
4400
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4401
+ newDirection = 'above';
4402
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4403
+ newDirection = 'below';
4404
+ }
 
 
 
 
4405
 
4406
+ if (newDirection == 'above' ||
4407
+ (isCurrentlyAbove && newDirection !== 'below')) {
4408
+ css.top = container.top - parentOffset.top - dropdown.height;
4409
+ }
4410
 
4411
+ if (newDirection != null) {
4412
+ this.$dropdown
4413
+ .removeClass('select2-dropdown--below select2-dropdown--above')
4414
+ .addClass('select2-dropdown--' + newDirection);
4415
+ this.$container
4416
+ .removeClass('select2-container--below select2-container--above')
4417
+ .addClass('select2-container--' + newDirection);
4418
+ }
4419
 
4420
+ this.$dropdownContainer.css(css);
4421
+ };
4422
 
4423
+ AttachBody.prototype._resizeDropdown = function () {
4424
+ var css = {
4425
+ width: this.$container.outerWidth(false) + 'px'
4426
+ };
4427
 
4428
+ if (this.options.get('dropdownAutoWidth')) {
4429
+ css.minWidth = css.width;
4430
+ css.position = 'relative';
4431
+ css.width = 'auto';
4432
+ }
4433
 
4434
+ this.$dropdown.css(css);
4435
+ };
4436
 
4437
+ AttachBody.prototype._showDropdown = function (decorated) {
4438
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
4439
 
4440
+ this._positionDropdown();
4441
+ this._resizeDropdown();
4442
+ };
 
 
 
 
 
 
 
4443
 
4444
+ return AttachBody;
4445
+ });
4446
 
4447
+ S2.define('select2/dropdown/minimumResultsForSearch',[
 
4448
 
4449
+ ], function () {
4450
+ function countResults (data) {
4451
+ var count = 0;
4452
 
4453
+ for (var d = 0; d < data.length; d++) {
4454
+ var item = data[d];
4455
 
4456
+ if (item.children) {
4457
+ count += countResults(item.children);
4458
+ } else {
4459
+ count++;
4460
+ }
4461
+ }
4462
 
4463
+ return count;
4464
+ }
4465
 
4466
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4467
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4468
 
4469
+ if (this.minimumResultsForSearch < 0) {
4470
+ this.minimumResultsForSearch = Infinity;
4471
+ }
4472
 
4473
+ decorated.call(this, $element, options, dataAdapter);
4474
+ }
 
 
 
 
4475
 
4476
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4477
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
4478
+ return false;
4479
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4480
 
4481
+ return decorated.call(this, params);
4482
+ };
4483
 
4484
+ return MinimumResultsForSearch;
4485
+ });
4486
 
4487
+ S2.define('select2/dropdown/selectOnClose',[
 
 
 
 
 
 
4488
 
4489
+ ], function () {
4490
+ function SelectOnClose () { }
4491
 
4492
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
4493
+ var self = this;
4494
 
4495
+ decorated.call(this, container, $container);
 
4496
 
4497
+ container.on('close', function (params) {
4498
+ self._handleSelectOnClose(params);
4499
+ });
4500
+ };
4501
+
4502
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4503
+ if (params && params.originalSelect2Event != null) {
4504
+ var event = params.originalSelect2Event;
4505
 
4506
+ // Don't select an item if the close event was triggered from a select or
4507
+ // unselect event
4508
+ if (event._type === 'select' || event._type === 'unselect') {
4509
+ return;
4510
+ }
4511
+ }
4512
+
4513
+ var $highlightedResults = this.getHighlightedResults();
4514
+
4515
+ // Only select highlighted results
4516
+ if ($highlightedResults.length < 1) {
4517
+ return;
4518
+ }
4519
 
4520
+ var data = $highlightedResults.data('data');
4521
+
4522
+ // Don't re-select already selected resulte
4523
+ if (
4524
+ (data.element != null && data.element.selected) ||
4525
+ (data.element == null && data.selected)
4526
+ ) {
4527
+ return;
4528
+ }
4529
+
4530
+ this.trigger('select', {
4531
+ data: data
4532
+ });
4533
+ };
4534
+
4535
+ return SelectOnClose;
4536
+ });
4537
+
4538
+ S2.define('select2/dropdown/closeOnSelect',[
4539
+
4540
+ ], function () {
4541
+ function CloseOnSelect () { }
4542
+
4543
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4544
+ var self = this;
4545
+
4546
+ decorated.call(this, container, $container);
4547
+
4548
+ container.on('select', function (evt) {
4549
+ self._selectTriggered(evt);
4550
+ });
4551
+
4552
+ container.on('unselect', function (evt) {
4553
+ self._selectTriggered(evt);
4554
+ });
4555
+ };
4556
+
4557
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4558
+ var originalEvent = evt.originalEvent;
4559
+
4560
+ // Don't close if the control key is being held
4561
+ if (originalEvent && originalEvent.ctrlKey) {
4562
+ return;
4563
+ }
4564
+
4565
+ this.trigger('close', {
4566
+ originalEvent: originalEvent,
4567
+ originalSelect2Event: evt
4568
+ });
4569
+ };
4570
+
4571
+ return CloseOnSelect;
4572
+ });
4573
+
4574
+ S2.define('select2/i18n/en',[],function () {
4575
+ // English
4576
+ return {
4577
+ errorLoading: function () {
4578
+ return 'The results could not be loaded.';
4579
+ },
4580
+ inputTooLong: function (args) {
4581
+ var overChars = args.input.length - args.maximum;
4582
+
4583
+ var message = 'Please delete ' + overChars + ' character';
4584
+
4585
+ if (overChars != 1) {
4586
+ message += 's';
4587
+ }
4588
+
4589
+ return message;
4590
+ },
4591
+ inputTooShort: function (args) {
4592
+ var remainingChars = args.minimum - args.input.length;
4593
+
4594
+ var message = 'Please enter ' + remainingChars + ' or more characters';
4595
+
4596
+ return message;
4597
+ },
4598
+ loadingMore: function () {
4599
+ return 'Loading more results…';
4600
+ },
4601
+ maximumSelected: function (args) {
4602
+ var message = 'You can only select ' + args.maximum + ' item';
4603
+
4604
+ if (args.maximum != 1) {
4605
+ message += 's';
4606
+ }
4607
+
4608
+ return message;
4609
+ },
4610
+ noResults: function () {
4611
+ return 'No results found';
4612
+ },
4613
+ searching: function () {
4614
+ return 'Searching…';
4615
+ }
4616
+ };
4617
+ });
4618
+
4619
+ S2.define('select2/defaults',[
4620
+ 'jquery',
4621
+ 'require',
4622
+
4623
+ './results',
4624
+
4625
+ './selection/single',
4626
+ './selection/multiple',
4627
+ './selection/placeholder',
4628
+ './selection/allowClear',
4629
+ './selection/search',
4630
+ './selection/eventRelay',
4631
+
4632
+ './utils',
4633
+ './translation',
4634
+ './diacritics',
4635
+
4636
+ './data/select',
4637
+ './data/array',
4638
+ './data/ajax',
4639
+ './data/tags',
4640
+ './data/tokenizer',
4641
+ './data/minimumInputLength',
4642
+ './data/maximumInputLength',
4643
+ './data/maximumSelectionLength',
4644
+
4645
+ './dropdown',
4646
+ './dropdown/search',
4647
+ './dropdown/hidePlaceholder',
4648
+ './dropdown/infiniteScroll',
4649
+ './dropdown/attachBody',
4650
+ './dropdown/minimumResultsForSearch',
4651
+ './dropdown/selectOnClose',
4652
+ './dropdown/closeOnSelect',
4653
+
4654
+ './i18n/en'
4655
+ ], function ($, require,
4656
+
4657
+ ResultsList,
4658
+
4659
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
4660
+ SelectionSearch, EventRelay,
4661
+
4662
+ Utils, Translation, DIACRITICS,
4663
+
4664
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4665
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4666
+
4667
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4668
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4669
+
4670
+ EnglishTranslation) {
4671
+ function Defaults () {
4672
+ this.reset();
4673
+ }
4674
+
4675
+ Defaults.prototype.apply = function (options) {
4676
+ options = $.extend(true, {}, this.defaults, options);
4677
+
4678
+ if (options.dataAdapter == null) {
4679
+ if (options.ajax != null) {
4680
+ options.dataAdapter = AjaxData;
4681
+ } else if (options.data != null) {
4682
+ options.dataAdapter = ArrayData;
4683
+ } else {
4684
+ options.dataAdapter = SelectData;
4685
+ }
4686
+
4687
+ if (options.minimumInputLength > 0) {
4688
+ options.dataAdapter = Utils.Decorate(
4689
+ options.dataAdapter,
4690
+ MinimumInputLength
4691
+ );
4692
+ }
4693
+
4694
+ if (options.maximumInputLength > 0) {
4695
+ options.dataAdapter = Utils.Decorate(
4696
+ options.dataAdapter,
4697
+ MaximumInputLength
4698
+ );
4699
+ }
4700
+
4701
+ if (options.maximumSelectionLength > 0) {
4702
+ options.dataAdapter = Utils.Decorate(
4703
+ options.dataAdapter,
4704
+ MaximumSelectionLength
4705
+ );
4706
+ }
4707
+
4708
+ if (options.tags) {
4709
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4710
+ }
4711
+
4712
+ if (options.tokenSeparators != null || options.tokenizer != null) {
4713
+ options.dataAdapter = Utils.Decorate(
4714
+ options.dataAdapter,
4715
+ Tokenizer
4716
+ );
4717
+ }
4718
+
4719
+ if (options.query != null) {
4720
+ var Query = require(options.amdBase + 'compat/query');
4721
+
4722
+ options.dataAdapter = Utils.Decorate(
4723
+ options.dataAdapter,
4724
+ Query
4725
+ );
4726
+ }
4727
+
4728
+ if (options.initSelection != null) {
4729
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
4730
+
4731
+ options.dataAdapter = Utils.Decorate(
4732
+ options.dataAdapter,
4733
+ InitSelection
4734
+ );
4735
+ }
4736
+ }
4737
+
4738
+ if (options.resultsAdapter == null) {
4739
+ options.resultsAdapter = ResultsList;
4740
+
4741
+ if (options.ajax != null) {
4742
+ options.resultsAdapter = Utils.Decorate(
4743
+ options.resultsAdapter,
4744
+ InfiniteScroll
4745
+ );
4746
+ }
4747
+
4748
+ if (options.placeholder != null) {
4749
+ options.resultsAdapter = Utils.Decorate(
4750
+ options.resultsAdapter,
4751
+ HidePlaceholder
4752
+ );
4753
+ }
4754
+
4755
+ if (options.selectOnClose) {
4756
+ options.resultsAdapter = Utils.Decorate(
4757
+ options.resultsAdapter,
4758
+ SelectOnClose
4759
+ );
4760
+ }
4761
+ }
4762
+
4763
+ if (options.dropdownAdapter == null) {
4764
+ if (options.multiple) {
4765
+ options.dropdownAdapter = Dropdown;
4766
+ } else {
4767
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4768
+
4769
+ options.dropdownAdapter = SearchableDropdown;
4770
+ }
4771
+
4772
+ if (options.minimumResultsForSearch !== 0) {
4773
+ options.dropdownAdapter = Utils.Decorate(
4774
+ options.dropdownAdapter,
4775
+ MinimumResultsForSearch
4776
+ );
4777
+ }
4778
+
4779
+ if (options.closeOnSelect) {
4780
+ options.dropdownAdapter = Utils.Decorate(
4781
+ options.dropdownAdapter,
4782
+ CloseOnSelect
4783
+ );
4784
+ }
4785
+
4786
+ if (
4787
+ options.dropdownCssClass != null ||
4788
+ options.dropdownCss != null ||
4789
+ options.adaptDropdownCssClass != null
4790
+ ) {
4791
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4792
+
4793
+ options.dropdownAdapter = Utils.Decorate(
4794
+ options.dropdownAdapter,
4795
+ DropdownCSS
4796
+ );
4797
+ }
4798
+
4799
+ options.dropdownAdapter = Utils.Decorate(
4800
+ options.dropdownAdapter,
4801
+ AttachBody
4802
+ );
4803
+ }
4804
+
4805
+ if (options.selectionAdapter == null) {
4806
+ if (options.multiple) {
4807
+ options.selectionAdapter = MultipleSelection;
4808
+ } else {
4809
+ options.selectionAdapter = SingleSelection;
4810
+ }
4811
+
4812
+ // Add the placeholder mixin if a placeholder was specified
4813
+ if (options.placeholder != null) {
4814
+ options.selectionAdapter = Utils.Decorate(
4815
+ options.selectionAdapter,
4816
+ Placeholder
4817
+ );
4818
+ }
4819
+
4820
+ if (options.allowClear) {
4821
+ options.selectionAdapter = Utils.Decorate(
4822
+ options.selectionAdapter,
4823
+ AllowClear
4824
+ );
4825
+ }
4826
+
4827
+ if (options.multiple) {
4828
+ options.selectionAdapter = Utils.Decorate(
4829
+ options.selectionAdapter,
4830
+ SelectionSearch
4831
+ );
4832
+ }
4833
+
4834
+ if (
4835
+ options.containerCssClass != null ||
4836
+ options.containerCss != null ||
4837
+ options.adaptContainerCssClass != null
4838
+ ) {
4839
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4840
+
4841
+ options.selectionAdapter = Utils.Decorate(
4842
+ options.selectionAdapter,
4843
+ ContainerCSS
4844
+ );
4845
+ }
4846
+
4847
+ options.selectionAdapter = Utils.Decorate(
4848
+ options.selectionAdapter,
4849
+ EventRelay
4850
+ );
4851
+ }
4852
+
4853
+ if (typeof options.language === 'string') {
4854
+ // Check if the language is specified with a region
4855
+ if (options.language.indexOf('-') > 0) {
4856
+ // Extract the region information if it is included
4857
+ var languageParts = options.language.split('-');
4858
+ var baseLanguage = languageParts[0];
4859
+
4860
+ options.language = [options.language, baseLanguage];
4861
+ } else {
4862
+ options.language = [options.language];
4863
+ }
4864
+ }
4865
+
4866
+ if ($.isArray(options.language)) {
4867
+ var languages = new Translation();
4868
+ options.language.push('en');
4869
+
4870
+ var languageNames = options.language;
4871
+
4872
+ for (var l = 0; l < languageNames.length; l++) {
4873
+ var name = languageNames[l];
4874
+ var language = {};
4875
+
4876
+ try {
4877
+ // Try to load it with the original name
4878
+ language = Translation.loadPath(name);
4879
+ } catch (e) {
4880
+ try {
4881
+ // If we couldn't load it, check if it wasn't the full path
4882
+ name = this.defaults.amdLanguageBase + name;
4883
+ language = Translation.loadPath(name);
4884
+ } catch (ex) {
4885
+ // The translation could not be loaded at all. Sometimes this is
4886
+ // because of a configuration problem, other times this can be
4887
+ // because of how Select2 helps load all possible translation files.
4888
+ if (options.debug && window.console && console.warn) {
4889
+ console.warn(
4890
+ 'Select2: The language file for "' + name + '" could not be ' +
4891
+ 'automatically loaded. A fallback will be used instead.'
4892
+ );
4893
+ }
4894
+
4895
+ continue;
4896
+ }
4897
+ }
4898
+
4899
+ languages.extend(language);
4900
+ }
4901
+
4902
+ options.translations = languages;
4903
+ } else {
4904
+ var baseTranslation = Translation.loadPath(
4905
+ this.defaults.amdLanguageBase + 'en'
4906
+ );
4907
+ var customTranslation = new Translation(options.language);
4908
+
4909
+ customTranslation.extend(baseTranslation);
4910
+
4911
+ options.translations = customTranslation;
4912
+ }
4913
+
4914
+ return options;
4915
+ };
4916
+
4917
+ Defaults.prototype.reset = function () {
4918
+ function stripDiacritics (text) {
4919
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
4920
+ function match(a) {
4921
+ return DIACRITICS[a] || a;
4922
+ }
4923
+
4924
+ return text.replace(/[^\u0000-\u007E]/g, match);
4925
+ }
4926
+
4927
+ function matcher (params, data) {
4928
+ // Always return the object if there is nothing to compare
4929
+ if ($.trim(params.term) === '') {
4930
+ return data;
4931
+ }
4932
+
4933
+ // Do a recursive check for options with children
4934
+ if (data.children && data.children.length > 0) {
4935
+ // Clone the data object if there are children
4936
+ // This is required as we modify the object to remove any non-matches
4937
+ var match = $.extend(true, {}, data);
4938
+
4939
+ // Check each child of the option
4940
+ for (var c = data.children.length - 1; c >= 0; c--) {
4941
+ var child = data.children[c];
4942
+
4943
+ var matches = matcher(params, child);
4944
+
4945
+ // If there wasn't a match, remove the object in the array
4946
+ if (matches == null) {
4947
+ match.children.splice(c, 1);
4948
+ }
4949
+ }
4950
+
4951
+ // If any children matched, return the new object
4952
+ if (match.children.length > 0) {
4953
+ return match;
4954
+ }
4955
+
4956
+ // If there were no matching children, check just the plain object
4957
+ return matcher(params, match);
4958
+ }
4959
+
4960
+ var original = stripDiacritics(data.text).toUpperCase();
4961
+ var term = stripDiacritics(params.term).toUpperCase();
4962
+
4963
+ // Check if the text contains the term
4964
+ if (original.indexOf(term) > -1) {
4965
+ return data;
4966
+ }
4967
+
4968
+ // If it doesn't contain the term, don't return anything
4969
+ return null;
4970
+ }
4971
+
4972
+ this.defaults = {
4973
+ amdBase: './',
4974
+ amdLanguageBase: './i18n/',
4975
+ closeOnSelect: true,
4976
+ debug: false,
4977
+ dropdownAutoWidth: false,
4978
+ escapeMarkup: Utils.escapeMarkup,
4979
+ language: EnglishTranslation,
4980
+ matcher: matcher,
4981
+ minimumInputLength: 0,
4982
+ maximumInputLength: 0,
4983
+ maximumSelectionLength: 0,
4984
+ minimumResultsForSearch: 0,
4985
+ selectOnClose: false,
4986
+ sorter: function (data) {
4987
+ return data;
4988
+ },
4989
+ templateResult: function (result) {
4990
+ return result.text;
4991
+ },
4992
+ templateSelection: function (selection) {
4993
+ return selection.text;
4994
+ },
4995
+ theme: 'default',
4996
+ width: 'resolve'
4997
+ };
4998
+ };
4999
+
5000
+ Defaults.prototype.set = function (key, value) {
5001
+ var camelKey = $.camelCase(key);
5002
+
5003
+ var data = {};
5004
+ data[camelKey] = value;
5005
+
5006
+ var convertedData = Utils._convertData(data);
5007
+
5008
+ $.extend(this.defaults, convertedData);
5009
+ };
5010
+
5011
+ var defaults = new Defaults();
5012
+
5013
+ return defaults;
5014
+ });
5015
+
5016
+ S2.define('select2/options',[
5017
+ 'require',
5018
+ 'jquery',
5019
+ './defaults',
5020
+ './utils'
5021
+ ], function (require, $, Defaults, Utils) {
5022
+ function Options (options, $element) {
5023
+ this.options = options;
5024
+
5025
+ if ($element != null) {
5026
+ this.fromElement($element);
5027
+ }
5028
+
5029
+ this.options = Defaults.apply(this.options);
5030
+
5031
+ if ($element && $element.is('input')) {
5032
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
5033
+
5034
+ this.options.dataAdapter = Utils.Decorate(
5035
+ this.options.dataAdapter,
5036
+ InputCompat
5037
+ );
5038
+ }
5039
+ }
5040
+
5041
+ Options.prototype.fromElement = function ($e) {
5042
+ var excludedData = ['select2'];
5043
+
5044
+ if (this.options.multiple == null) {
5045
+ this.options.multiple = $e.prop('multiple');
5046
+ }
5047
+
5048
+ if (this.options.disabled == null) {
5049
+ this.options.disabled = $e.prop('disabled');
5050
+ }
5051
+
5052
+ if (this.options.language == null) {
5053
+ if ($e.prop('lang')) {
5054
+ this.options.language = $e.prop('lang').toLowerCase();
5055
+ } else if ($e.closest('[lang]').prop('lang')) {
5056
+ this.options.language = $e.closest('[lang]').prop('lang');
5057
+ }
5058
+ }
5059
+
5060
+ if (this.options.dir == null) {
5061
+ if ($e.prop('dir')) {
5062
+ this.options.dir = $e.prop('dir');
5063
+ } else if ($e.closest('[dir]').prop('dir')) {
5064
+ this.options.dir = $e.closest('[dir]').prop('dir');
5065
+ } else {
5066
+ this.options.dir = 'ltr';
5067
+ }
5068
+ }
5069
+
5070
+ $e.prop('disabled', this.options.disabled);
5071
+ $e.prop('multiple', this.options.multiple);
5072
+
5073
+ if ($e.data('select2Tags')) {
5074
+ if (this.options.debug && window.console && console.warn) {
5075
+ console.warn(
5076
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
5077
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
5078
+ 'removed in future versions of Select2.'
5079
+ );
5080
+ }
5081
+
5082
+ $e.data('data', $e.data('select2Tags'));
5083
+ $e.data('tags', true);
5084
+ }
5085
+
5086
+ if ($e.data('ajaxUrl')) {
5087
+ if (this.options.debug && window.console && console.warn) {
5088
+ console.warn(
5089
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
5090
+ '`data-ajax--url` and support for the old attribute will be removed' +
5091
+ ' in future versions of Select2.'
5092
+ );
5093
+ }
5094
 
5095
+ $e.attr('ajax--url', $e.data('ajaxUrl'));
5096
+ $e.data('ajax--url', $e.data('ajaxUrl'));
5097
+ }
 
 
5098
 
5099
+ var dataset = {};
5100
 
5101
+ // Prefer the element's `dataset` attribute if it exists
5102
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
5103
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
5104
+ dataset = $.extend(true, {}, $e[0].dataset, $e.data());
5105
+ } else {
5106
+ dataset = $e.data();
5107
+ }
5108
 
5109
+ var data = $.extend(true, {}, dataset);
 
 
5110
 
5111
+ data = Utils._convertData(data);
5112
 
5113
+ for (var key in data) {
5114
+ if ($.inArray(key, excludedData) > -1) {
5115
+ continue;
5116
+ }
5117
+
5118
+ if ($.isPlainObject(this.options[key])) {
5119
+ $.extend(this.options[key], data[key]);
5120
+ } else {
5121
+ this.options[key] = data[key];
5122
+ }
5123
+ }
5124
 
5125
+ return this;
5126
+ };
5127
 
5128
+ Options.prototype.get = function (key) {
5129
+ return this.options[key];
5130
+ };
5131
 
5132
+ Options.prototype.set = function (key, val) {
5133
+ this.options[key] = val;
5134
+ };
 
5135
 
5136
+ return Options;
5137
+ });
 
 
5138
 
5139
+ S2.define('select2/core',[
5140
+ 'jquery',
5141
+ './options',
5142
+ './utils',
5143
+ './keys'
5144
+ ], function ($, Options, Utils, KEYS) {
5145
+ var Select2 = function ($element, options) {
5146
+ if ($element.data('select2') != null) {
5147
+ $element.data('select2').destroy();
5148
+ }
5149
 
5150
+ this.$element = $element;
 
 
5151
 
5152
+ this.id = this._generateId($element);
 
 
 
5153
 
5154
+ options = options || {};
 
 
 
 
5155
 
5156
+ this.options = new Options(options, $element);
 
5157
 
5158
+ Select2.__super__.constructor.call(this);
5159
 
5160
+ // Set up the tabindex
5161
 
5162
+ var tabindex = $element.attr('tabindex') || 0;
5163
+ $element.data('old-tabindex', tabindex);
5164
+ $element.attr('tabindex', '-1');
5165
 
5166
+ // Set up containers and adapters
 
 
5167
 
5168
+ var DataAdapter = this.options.get('dataAdapter');
5169
+ this.dataAdapter = new DataAdapter($element, this.options);
 
 
 
 
5170
 
5171
+ var $container = this.render();
5172
 
5173
+ this._placeContainer($container);
5174
 
5175
+ var SelectionAdapter = this.options.get('selectionAdapter');
5176
+ this.selection = new SelectionAdapter($element, this.options);
5177
+ this.$selection = this.selection.render();
5178
 
5179
+ this.selection.position(this.$selection, $container);
 
5180
 
5181
+ var DropdownAdapter = this.options.get('dropdownAdapter');
5182
+ this.dropdown = new DropdownAdapter($element, this.options);
5183
+ this.$dropdown = this.dropdown.render();
 
 
 
5184
 
5185
+ this.dropdown.position(this.$dropdown, $container);
 
5186
 
5187
+ var ResultsAdapter = this.options.get('resultsAdapter');
5188
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5189
+ this.$results = this.results.render();
5190
 
5191
+ this.results.position(this.$results, this.$dropdown);
5192
 
5193
+ // Bind events
5194
 
5195
+ var self = this;
 
 
5196
 
5197
+ // Bind the container to all of the adapters
5198
+ this._bindAdapters();
5199
 
5200
+ // Register any DOM event handlers
5201
+ this._registerDomEvents();
 
 
5202
 
5203
+ // Register any internal event handlers
5204
+ this._registerDataEvents();
5205
+ this._registerSelectionEvents();
5206
+ this._registerDropdownEvents();
5207
+ this._registerResultsEvents();
5208
+ this._registerEvents();
5209
 
5210
+ // Set the initial state
5211
+ this.dataAdapter.current(function (initialData) {
5212
+ self.trigger('selection:update', {
5213
+ data: initialData
5214
+ });
5215
+ });
5216
 
5217
+ // Hide the original select
5218
+ $element.addClass('select2-hidden-accessible');
5219
+ $element.attr('aria-hidden', 'true');
 
5220
 
5221
+ // Synchronize any monitored attributes
5222
+ this._syncAttributes();
5223
 
5224
+ $element.data('select2', this);
5225
+ };
5226
 
5227
+ Utils.Extend(Select2, Utils.Observable);
 
 
5228
 
5229
+ Select2.prototype._generateId = function ($element) {
5230
+ var id = '';
5231
 
5232
+ if ($element.attr('id') != null) {
5233
+ id = $element.attr('id');
5234
+ } else if ($element.attr('name') != null) {
5235
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
5236
+ } else {
5237
+ id = Utils.generateChars(4);
5238
+ }
5239
 
5240
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
5241
+ id = 'select2-' + id;
5242
 
5243
+ return id;
5244
+ };
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5245
 
5246
+ Select2.prototype._placeContainer = function ($container) {
5247
+ $container.insertAfter(this.$element);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5248
 
5249
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
 
5250
 
5251
+ if (width != null) {
5252
+ $container.css('width', width);
5253
+ }
5254
+ };
5255
 
5256
+ Select2.prototype._resolveWidth = function ($element, method) {
5257
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
 
 
 
 
5258
 
5259
+ if (method == 'resolve') {
5260
+ var styleWidth = this._resolveWidth($element, 'style');
 
5261
 
5262
+ if (styleWidth != null) {
5263
+ return styleWidth;
5264
+ }
 
 
5265
 
5266
+ return this._resolveWidth($element, 'element');
5267
+ }
5268
+
5269
+ if (method == 'element') {
5270
+ var elementWidth = $element.outerWidth(false);
5271
+
5272
+ if (elementWidth <= 0) {
5273
+ return 'auto';
5274
+ }
5275
+
5276
+ return elementWidth + 'px';
5277
+ }
5278
+
5279
+ if (method == 'style') {
5280
+ var style = $element.attr('style');
5281
+
5282
+ if (typeof(style) !== 'string') {
5283
+ return null;
5284
+ }
5285
+
5286
+ var attrs = style.split(';');
5287
+
5288
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5289
+ var attr = attrs[i].replace(/\s/g, '');
5290
+ var matches = attr.match(WIDTH);
5291
+
5292
+ if (matches !== null && matches.length >= 1) {
5293
+ return matches[1];
5294
+ }
5295
+ }
5296
+
5297
+ return null;
5298
+ }
5299
+
5300
+ return method;
5301
+ };
5302
+
5303
+ Select2.prototype._bindAdapters = function () {
5304
+ this.dataAdapter.bind(this, this.$container);
5305
+ this.selection.bind(this, this.$container);
5306
+
5307
+ this.dropdown.bind(this, this.$container);
5308
+ this.results.bind(this, this.$container);
5309
+ };
5310
+
5311
+ Select2.prototype._registerDomEvents = function () {
5312
+ var self = this;
5313
+
5314
+ this.$element.on('change.select2', function () {
5315
+ self.dataAdapter.current(function (data) {
5316
+ self.trigger('selection:update', {
5317
+ data: data
5318
+ });
5319
+ });
5320
+ });
5321
+
5322
+ this.$element.on('focus.select2', function (evt) {
5323
+ self.trigger('focus', evt);
5324
+ });
5325
+
5326
+ this._syncA = Utils.bind(this._syncAttributes, this);
5327
+ this._syncS = Utils.bind(this._syncSubtree, this);
5328
+
5329
+ if (this.$element[0].attachEvent) {
5330
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
5331
+ }
5332
+
5333
+ var observer = window.MutationObserver ||
5334
+ window.WebKitMutationObserver ||
5335
+ window.MozMutationObserver
5336
+ ;
5337
+
5338
+ if (observer != null) {
5339
+ this._observer = new observer(function (mutations) {
5340
+ $.each(mutations, self._syncA);
5341
+ $.each(mutations, self._syncS);
5342
+ });
5343
+ this._observer.observe(this.$element[0], {
5344
+ attributes: true,
5345
+ childList: true,
5346
+ subtree: false
5347
+ });
5348
+ } else if (this.$element[0].addEventListener) {
5349
+ this.$element[0].addEventListener(
5350
+ 'DOMAttrModified',
5351
+ self._syncA,
5352
+ false
5353
+ );
5354
+ this.$element[0].addEventListener(
5355
+ 'DOMNodeInserted',
5356
+ self._syncS,
5357
+ false
5358
+ );
5359
+ this.$element[0].addEventListener(
5360
+ 'DOMNodeRemoved',
5361
+ self._syncS,
5362
+ false
5363
+ );
5364
+ }
5365
+ };
5366
+
5367
+ Select2.prototype._registerDataEvents = function () {
5368
+ var self = this;
5369
+
5370
+ this.dataAdapter.on('*', function (name, params) {
5371
+ self.trigger(name, params);
5372
+ });
5373
+ };
5374
+
5375
+ Select2.prototype._registerSelectionEvents = function () {
5376
+ var self = this;
5377
+ var nonRelayEvents = ['toggle', 'focus'];
5378
+
5379
+ this.selection.on('toggle', function () {
5380
+ self.toggleDropdown();
5381
+ });
5382
+
5383
+ this.selection.on('focus', function (params) {
5384
+ self.focus(params);
5385
+ });
5386
+
5387
+ this.selection.on('*', function (name, params) {
5388
+ if ($.inArray(name, nonRelayEvents) !== -1) {
5389
+ return;
5390
+ }
5391
+
5392
+ self.trigger(name, params);
5393
+ });
5394
+ };
5395
+
5396
+ Select2.prototype._registerDropdownEvents = function () {
5397
+ var self = this;
5398
+
5399
+ this.dropdown.on('*', function (name, params) {
5400
+ self.trigger(name, params);
5401
+ });
5402
+ };
5403
+
5404
+ Select2.prototype._registerResultsEvents = function () {
5405
+ var self = this;
5406
+
5407
+ this.results.on('*', function (name, params) {
5408
+ self.trigger(name, params);
5409
+ });
5410
+ };
5411
+
5412
+ Select2.prototype._registerEvents = function () {
5413
+ var self = this;
5414
+
5415
+ this.on('open', function () {
5416
+ self.$container.addClass('select2-container--open');
5417
+ });
5418
+
5419
+ this.on('close', function () {
5420
+ self.$container.removeClass('select2-container--open');
5421
+ });
5422
+
5423
+ this.on('enable', function () {
5424
+ self.$container.removeClass('select2-container--disabled');
5425
+ });
5426
+
5427
+ this.on('disable', function () {
5428
+ self.$container.addClass('select2-container--disabled');
5429
+ });
5430
+
5431
+ this.on('blur', function () {
5432
+ self.$container.removeClass('select2-container--focus');
5433
+ });
5434
+
5435
+ this.on('query', function (params) {
5436
+ if (!self.isOpen()) {
5437
+ self.trigger('open', {});
5438
+ }
5439
+
5440
+ this.dataAdapter.query(params, function (data) {
5441
+ self.trigger('results:all', {
5442
+ data: data,
5443
+ query: params
5444
+ });
5445
+ });
5446
+ });
5447
+
5448
+ this.on('query:append', function (params) {
5449
+ this.dataAdapter.query(params, function (data) {
5450
+ self.trigger('results:append', {
5451
+ data: data,
5452
+ query: params
5453
+ });
5454
+ });
5455
+ });
5456
+
5457
+ this.on('open', function(){
5458
+ // Focus on the active element when opening dropdown.
5459
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
5460
+ setTimeout(function(){
5461
+ self.focusOnActiveElement();
5462
+ }, 1);
5463
+ });
5464
+
5465
+ $(document).on('keydown', function (evt) {
5466
+ var key = evt.which;
5467
+ if (self.isOpen()) {
5468
+ if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
5469
+ self.close();
5470
+
5471
+ evt.preventDefault();
5472
+ } else if (key === KEYS.ENTER || key === KEYS.TAB) {
5473
+ self.trigger('results:select', {});
5474
+
5475
+ evt.preventDefault();
5476
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5477
+ self.trigger('results:toggle', {});
5478
+
5479
+ evt.preventDefault();
5480
+ } else if (key === KEYS.UP) {
5481
+ self.trigger('results:previous', {});
5482
+
5483
+ evt.preventDefault();
5484
+ } else if (key === KEYS.DOWN) {
5485
+ self.trigger('results:next', {});
5486
+
5487
+ evt.preventDefault();
5488
+ }
5489
+
5490
+ var $searchField = self.$dropdown.find('.select2-search__field');
5491
+ if (! $searchField.length) {
5492
+ $searchField = self.$container.find('.select2-search__field');
5493
+ }
5494
+
5495
+ // Move the focus to the selected element on keyboard navigation.
5496
+ // Required for screen readers to work properly.
5497
+ if (key === KEYS.DOWN || key === KEYS.UP) {
5498
+ self.focusOnActiveElement();
5499
+ } else {
5500
+ // Focus on the search if user starts typing.
5501
+ $searchField.focus();
5502
+ // Focus back to active selection when finished typing.
5503
+ // Small delay so typed character can be read by screen reader.
5504
+ setTimeout(function(){
5505
+ self.focusOnActiveElement();
5506
+ }, 1000);
5507
+ }
5508
+ } else if (self.hasFocus()) {
5509
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
5510
+ key === KEYS.DOWN) {
5511
+ self.open();
5512
+ evt.preventDefault();
5513
+ }
5514
+ }
5515
+ });
5516
+ };
5517
+
5518
+ Select2.prototype.focusOnActiveElement = function () {
5519
+ // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
5520
+ if (this.isOpen() && ! Utils.isTouchscreen()) {
5521
+ this.$results.find('li.select2-results__option--highlighted').focus();
5522
+ }
5523
+ };
5524
+
5525
+ Select2.prototype._syncAttributes = function () {
5526
+ this.options.set('disabled', this.$element.prop('disabled'));
5527
+
5528
+ if (this.options.get('disabled')) {
5529
+ if (this.isOpen()) {
5530
+ this.close();
5531
+ }
5532
+
5533
+ this.trigger('disable', {});
5534
+ } else {
5535
+ this.trigger('enable', {});
5536
+ }
5537
+ };
5538
+
5539
+ Select2.prototype._syncSubtree = function (evt, mutations) {
5540
+ var changed = false;
5541
+ var self = this;
5542
+
5543
+ // Ignore any mutation events raised for elements that aren't options or
5544
+ // optgroups. This handles the case when the select element is destroyed
5545
+ if (
5546
+ evt && evt.target && (
5547
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5548
+ )
5549
+ ) {
5550
+ return;
5551
+ }
5552
+
5553
+ if (!mutations) {
5554
+ // If mutation events aren't supported, then we can only assume that the
5555
+ // change affected the selections
5556
+ changed = true;
5557
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5558
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
5559
+ var node = mutations.addedNodes[n];
5560
+
5561
+ if (node.selected) {
5562
+ changed = true;
5563
+ }
5564
+ }
5565
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5566
+ changed = true;
5567
+ }
5568
+
5569
+ // Only re-pull the data if we think there is a change
5570
+ if (changed) {
5571
+ this.dataAdapter.current(function (currentData) {
5572
+ self.trigger('selection:update', {
5573
+ data: currentData
5574
+ });
5575
+ });
5576
+ }
5577
+ };
5578
+
5579
+ /**
5580
+ * Override the trigger method to automatically trigger pre-events when
5581
+ * there are events that can be prevented.
5582
+ */
5583
+ Select2.prototype.trigger = function (name, args) {
5584
+ var actualTrigger = Select2.__super__.trigger;
5585
+ var preTriggerMap = {
5586
+ 'open': 'opening',
5587
+ 'close': 'closing',
5588
+ 'select': 'selecting',
5589
+ 'unselect': 'unselecting'
5590
+ };
5591
+
5592
+ if (args === undefined) {
5593
+ args = {};
5594
+ }
5595
+
5596
+ if (name in preTriggerMap) {
5597
+ var preTriggerName = preTriggerMap[name];
5598
+ var preTriggerArgs = {
5599
+ prevented: false,
5600
+ name: name,
5601
+ args: args
5602
+ };
5603
+
5604
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
5605
+
5606
+ if (preTriggerArgs.prevented) {
5607
+ args.prevented = true;
5608
+
5609
+ return;
5610
+ }
5611
+ }
5612
+
5613
+ actualTrigger.call(this, name, args);
5614
+ };
5615
+
5616
+ Select2.prototype.toggleDropdown = function () {
5617
+ if (this.options.get('disabled')) {
5618
+ return;
5619
+ }
5620
+
5621
+ if (this.isOpen()) {
5622
+ this.close();
5623
+ } else {
5624
+ this.open();
5625
+ }
5626
+ };
5627
+
5628
+ Select2.prototype.open = function () {
5629
+ if (this.isOpen()) {
5630
+ return;
5631
+ }
5632
+
5633
+ this.trigger('query', {});
5634
+ };
5635
+
5636
+ Select2.prototype.close = function () {
5637
+ if (!this.isOpen()) {
5638
+ return;
5639
+ }
5640
+
5641
+ this.trigger('close', {});
5642
+ };
5643
+
5644
+ Select2.prototype.isOpen = function () {
5645
+ return this.$container.hasClass('select2-container--open');
5646
+ };
5647
+
5648
+ Select2.prototype.hasFocus = function () {
5649
+ return this.$container.hasClass('select2-container--focus');
5650
+ };
5651
+
5652
+ Select2.prototype.focus = function (data) {
5653
+ // No need to re-trigger focus events if we are already focused
5654
+ if (this.hasFocus()) {
5655
+ return;
5656
+ }
5657
+
5658
+ this.$container.addClass('select2-container--focus');
5659
+ this.trigger('focus', {});
5660
+ };
5661
+
5662
+ Select2.prototype.enable = function (args) {
5663
+ if (this.options.get('debug') && window.console && console.warn) {
5664
+ console.warn(
5665
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
5666
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5667
+ ' instead.'
5668
+ );
5669
+ }
5670
+
5671
+ if (args == null || args.length === 0) {
5672
+ args = [true];
5673
+ }
5674
+
5675
+ var disabled = !args[0];
5676
+
5677
+ this.$element.prop('disabled', disabled);
5678
+ };
5679
+
5680
+ Select2.prototype.data = function () {
5681
+ if (this.options.get('debug') &&
5682
+ arguments.length > 0 && window.console && console.warn) {
5683
+ console.warn(
5684
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
5685
+ 'should consider setting the value instead using `$element.val()`.'
5686
+ );
5687
+ }
5688
+
5689
+ var data = [];
5690
+
5691
+ this.dataAdapter.current(function (currentData) {
5692
+ data = currentData;
5693
+ });
5694
+
5695
+ return data;
5696
+ };
5697
+
5698
+ Select2.prototype.val = function (args) {
5699
+ if (this.options.get('debug') && window.console && console.warn) {
5700
+ console.warn(
5701
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
5702
+ ' removed in later Select2 versions. Use $element.val() instead.'
5703
+ );
5704
+ }
5705
+
5706
+ if (args == null || args.length === 0) {
5707
+ return this.$element.val();
5708
+ }
5709
+
5710
+ var newVal = args[0];
5711
+
5712
+ if ($.isArray(newVal)) {
5713
+ newVal = $.map(newVal, function (obj) {
5714
+ return obj.toString();
5715
+ });
5716
+ }
5717
+
5718
+ this.$element.val(newVal).trigger('change');
5719
+ };
5720
+
5721
+ Select2.prototype.destroy = function () {
5722
+ this.$container.remove();
5723
+
5724
+ if (this.$element[0].detachEvent) {
5725
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
5726
+ }
5727
+
5728
+ if (this._observer != null) {
5729
+ this._observer.disconnect();
5730
+ this._observer = null;
5731
+ } else if (this.$element[0].removeEventListener) {
5732
+ this.$element[0]
5733
+ .removeEventListener('DOMAttrModified', this._syncA, false);
5734
+ this.$element[0]
5735
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
5736
+ this.$element[0]
5737
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
5738
+ }
5739
+
5740
+ this._syncA = null;
5741
+ this._syncS = null;
5742
+
5743
+ this.$element.off('.select2');
5744
+ this.$element.attr('tabindex', this.$element.data('old-tabindex'));
5745
+
5746
+ this.$element.removeClass('select2-hidden-accessible');
5747
+ this.$element.attr('aria-hidden', 'false');
5748
+ this.$element.removeData('select2');
5749
+
5750
+ this.dataAdapter.destroy();
5751
+ this.selection.destroy();
5752
+ this.dropdown.destroy();
5753
+ this.results.destroy();
5754
+
5755
+ this.dataAdapter = null;
5756
+ this.selection = null;
5757
+ this.dropdown = null;
5758
+ this.results = null;
5759
+ };
5760
+
5761
+ Select2.prototype.render = function () {
5762
+ var $container = $(
5763
+ '<span class="select2 select2-container">' +
5764
+ '<span class="selection"></span>' +
5765
+ '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
5766
+ '</span>'
5767
+ );
5768
+
5769
+ $container.attr('dir', this.options.get('dir'));
5770
+
5771
+ this.$container = $container;
5772
+
5773
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
5774
+
5775
+ $container.data('element', this.$element);
5776
+
5777
+ return $container;
5778
+ };
5779
+
5780
+ return Select2;
5781
+ });
5782
+
5783
+ S2.define('jquery-mousewheel',[
5784
+ 'jquery'
5785
+ ], function ($) {
5786
+ // Used to shim jQuery.mousewheel for non-full builds.
5787
+ return $;
5788
+ });
5789
+
5790
+ S2.define('jquery.select2',[
5791
+ 'jquery',
5792
+ 'jquery-mousewheel',
5793
+
5794
+ './select2/core',
5795
+ './select2/defaults'
5796
+ ], function ($, _, Select2, Defaults) {
5797
+ if ($.fn.selectWoo == null) {
5798
+ // All methods that should return the element
5799
+ var thisMethods = ['open', 'close', 'destroy'];
5800
+
5801
+ $.fn.selectWoo = function (options) {
5802
+ options = options || {};
5803
+
5804
+ if (typeof options === 'object') {
5805
+ this.each(function () {
5806
+ var instanceOptions = $.extend(true, {}, options);
5807
+
5808
+ var instance = new Select2($(this), instanceOptions);
5809
+ });
5810
+
5811
+ return this;
5812
+ } else if (typeof options === 'string') {
5813
+ var ret;
5814
+ var args = Array.prototype.slice.call(arguments, 1);
5815
+
5816
+ this.each(function () {
5817
+ var instance = $(this).data('select2');
5818
+
5819
+ if (instance == null && window.console && console.error) {
5820
+ console.error(
5821
+ 'The select2(\'' + options + '\') method was called on an ' +
5822
+ 'element that is not using Select2.'
5823
+ );
5824
+ }
5825
+
5826
+ ret = instance[options].apply(instance, args);
5827
+ });
5828
+
5829
+ // Check if we should be returning `this`
5830
+ if ($.inArray(options, thisMethods) > -1) {
5831
+ return this;
5832
+ }
5833
+
5834
+ return ret;
5835
+ } else {
5836
+ throw new Error('Invalid arguments for Select2: ' + options);
5837
+ }
5838
+ };
5839
+ }
5840
+
5841
+ if ($.fn.select2 != null && $.fn.select2.defaults != null) {
5842
+ $.fn.selectWoo.defaults = $.fn.select2.defaults;
5843
+ }
5844
+
5845
+ if ($.fn.selectWoo.defaults == null) {
5846
+ $.fn.selectWoo.defaults = Defaults;
5847
+ }
5848
+
5849
+ // Also register selectWoo under select2 if select2 is not already present.
5850
+ $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
5851
+
5852
+ return Select2;
5853
+ });
5854
+
5855
+ // Return the AMD loader configuration so it can be used outside of this file
5856
+ return {
5857
+ define: S2.define,
5858
+ require: S2.require
5859
+ };
5860
+ }());
5861
+
5862
+ // Autoload the jQuery bindings
5863
+ // We know that all of the modules exist above this, so we're safe
5864
+ var select2 = S2.require('jquery.select2');
5865
+
5866
+ // Hold the AMD module references on the jQuery function that was just loaded
5867
+ // This allows Select2 to use the internal loader outside of this file, such
5868
+ // as in the language files.
5869
+ jQuery.fn.select2.amd = S2;
5870
+ jQuery.fn.selectWoo.amd = S2;
5871
+
5872
+ // Return the Select2 instance for anyone who is importing it.
5873
+ return select2;
5874
+ }));
assets/js/selectWoo/selectWoo.min.js CHANGED
@@ -1,8 +1,8 @@
1
  /*!
2
- * SelectWoo 1.0.1
3
  * https://github.com/woocommerce/selectWoo
4
  *
5
  * Released under the MIT license
6
  * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
7
  */
8
- !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(u){var e=function(){if(u&&u.fn&&u.fn.select2&&u.fn.select2.amd)var e=u.fn.select2.amd;var t,n,i,h,o,s,f,g,m,v,y,_,r,a,w;function b(e,t){return r.call(e,t)}function l(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&w.test(e[s])&&(e[s]=e[s].replace(w,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),u-=1;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;u-=1){if(i=n.slice(0,u).join("/"),h)for(d=h.length;0<d;d-=1)if(r=(r=f[h.slice(0,d).join("/")])&&r[i]){o=r,a=u;break}if(o)break;!l&&g&&g[i]&&(l=g[i],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function A(t,n){return function(){var e=a.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function x(t){return function(e){m[t]=e}}function E(e){if(b(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!b(m,e)&&!b(_,e))throw new Error("No "+e);return m[e]}function c(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function O(e){return e?c(e):[]}return e&&e.requirejs||(e?n=e:e={},m={},v={},y={},_={},r=Object.prototype.hasOwnProperty,a=[].slice,w=/\.js$/,f=function(e,t){var n,i=c(e),r=i[0],o=t[1];return e=i[1],r&&(n=E(r=l(r,o))),r?e=n&&n.normalize?n.normalize(e,function s(t){return function(e){return l(e,t)}}(o)):l(e,o):(r=(i=c(e=l(e,o)))[0],e=i[1],r&&(n=E(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return A(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:function t(e){return function(){return y&&y.config&&y.config[e]||{}}}(e)}}},o=function(e,t,n,i){var r,o,s,a,l,c,u,d=[],p=typeof n;if(c=O(i=i||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)r=d[l]=g.module(e);else if(b(m,o)||b(v,o)||b(_,o))d[l]=E(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,A(i,!0),x(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):undefined,e&&(r&&r.exports!==h&&r.exports!==m[e]?m[e]=r.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=n=s=function(e,t,n,i,r){if("string"==typeof e)return g[e]?g[e](t):E(f(e,O(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=i,i=r),i?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),b(m,e)||b(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0},e.requirejs=t,e.require=n,e.define=i),e.define("almond",function(){}),e.define("jquery",[],function(){var e=u||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var e={};function d(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&"constructor"!==i&&n.push(i)}return n}e.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},e.Decorate=function(i,r){var e=d(r),t=d(i);function o(){var e=Array.prototype.unshift,t=r.prototype.constructor.length,n=i.prototype.constructor;0<t&&(e.call(arguments,i.prototype.constructor),n=r.prototype.constructor),n.apply(this,arguments)}r.displayName=i.displayName,o.prototype=new function u(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=i.prototype[s]}function a(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=r.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}}for(var l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};function t(){this.listeners={}}return t.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},t.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},t.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},e.Observable=t,e.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},e.bind=function(e,t){return function(){e.apply(t,arguments)}},e._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},e.hasScroll=function(e,t){var n=o(t),i=t.style.overflowX,r=t.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},e.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},e.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},e.isTouchscreen=function(){return"undefined"==typeof e._isTouchscreenCache&&(e._isTouchscreenCache="ontouchstart"in document.documentElement),e._isTouchscreenCache},e}),e.define("select2/results",["jquery","./utils"],function(h,e){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[data-selected]"),t=e.filter("[data-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(e){var i=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[data-selected]").each(function(){var e=h(this),t=h.data(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,i)?e.attr("data-selected","true"):e.attr("data-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","data-selected":"false",tabindex:-1};for(var i in e.disabled&&(delete n["data-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["data-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n["aria-label"]=e.text,delete n["data-selected"]),n){var r=n[i];t.setAttribute(i,r)}if(e.children){var o=h(t),s=document.createElement("strong");s.className="select2-results__group";var a=h(s);this.template(e,s),a.attr("role","presentation");for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{"class":"select2-results__options select2-results__options--nested",role:"listbox"});p.append(l),o.attr("role","list"),o.append(s),o.append(p)}else this.template(e,t);return h.data(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("data-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[data-selected]"),n=t.index(e);if(0!==n){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[data-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):r<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),l.$results.attr("aria-activedescendant",e.element.attr("id"))}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,i=0<e.deltaY&&t-e.deltaY<=0,r=e.deltaY<0&&n<=l.$results.height();i?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):r&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(e){var t=h(this),n=t.data("data");"true"!==t.attr("data-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(e){var t=h(this).data("data");l.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),l.trigger("results:focus",{data:t,element:h(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[data-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(i,e,r){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=i('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e},n.prototype.bind=function(e,t){var n=this,i=(e.id,e.id+"-results");this.options.get("minimumResultsForSearch"),Infinity;this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),window.setTimeout(function(){n.$selection.focus()},1),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),e.on("disable",function(){n.$selection.attr("tabindex","-1")})},n.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||i.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},n.prototype._attachCloseHandler=function(e){i(document.body).on("mousedown.select2."+e.id,function(e){var t=i(e.target),n=t.closest(".select2");i(".select2.select2-container--open").each(function(){var e=i(this);this!=n[0]&&(e.data("element").select2("close"),setTimeout(function(){e.find("*:focus").blur(),t.focus()},1))})})},n.prototype._detachCloseHandler=function(e){i(document.body).off("mousedown.select2."+e.id)},n.prototype.position=function(e,t){t.find(".selection").append(e)},n.prototype.destroy=function(){this._detachCloseHandler(this.container)},n.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},n}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("keydown",function(e){!t.isOpen()&&48<=e.which&&e.which<=90&&t.open()}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()}),t.on("selection:update",function(e){n.update(e.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,a){function r(e,t){r.__super__.constructor.apply(this,arguments)}return a.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!n.options.get("disabled")){var t=i(this).parent().data("data");n.trigger("unselect",{originalEvent:e,data:t})}}),this.$selection.on("keydown",function(e){!t.isOpen()&&48<=e.which&&e.which<=90&&t.open()}),t.on("focus",function(){n.focusOnSearch()})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">&times;</span></li>')},r.prototype.focusOnSearch=function(){var e=this;"undefined"!=typeof e.$search&&setTimeout(function(){e._keyUpPrevented=!0,e.$search.focus()},1)},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=this.selectionContainer(),o=this.display(i,r);"string"==typeof o&&(o=o.trim()),r.append(o),r.prop("title",i.title||i.text),r.data("data",i),t.push(r)}var s=this.$selection.find(".select2-selection__rendered");a.appendMany(s,t)}},r}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),e.define("select2/selection/allowClear",["jquery","../keys"],function(i,r){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),r=0;r<i.length;r++){var o={data:i[r]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=r.DELETE&&t.which!=r.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=i('<span class="select2-selection__clear">&times;</span>');n.data("data",t),this.$selection.find(".select2-selection__rendered").prepend(n)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,e,a){function t(e,t,n){e.call(this,t,n)}return t.prototype.render=function(e){var t=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},t.prototype.bind=function(e,i,t){var r=this,n=i.id+"-results";e.call(this,i,t),i.on("open",function(){r.$search.attr("aria-owns",n),r.$search.trigger("focus")}),i.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.removeAttr("aria-owns"),r.$search.trigger("focus")}),i.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),i.on("disable",function(){r.$search.prop("disabled",!0)}),i.on("focus",function(e){r.$search.trigger("focus")}),i.on("results:focus",function(e){r.$search.attr("aria-activedescendant",e.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===a.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=t.data("data");r.searchRemoveChoice(n),e.preventDefault()}}else e.which===a.ENTER&&(i.open(),e.preventDefault())});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=a.SHIFT&&t!=a.CTRL&&t!=a.ALT&&t!=a.TAB&&r.handleSearch(e)}})},t.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},t.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},t.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},t.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},t.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},t.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").innerWidth():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},t}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting"],o=["opening","closing","selecting","unselecting"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,r)){t=t||{};var n=s.Event("select2:"+e,{params:t});i.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var t=n(e);i._cache[e]=t}return new i(i._cache[e])},i}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2/data/base",["../utils"],function(i){function n(e,t){n.__super__.constructor.call(this)}return i.Extend(n,i.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n="";return n+=null!=e?e.id:i.generateChars(4),n+="-result-",n+=i.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+i.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,t,a){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,e),n.prototype.current=function(e){var n=[],i=this;this.$element.find(":selected").each(function(){var e=a(this),t=i.item(e);n.push(t)}),e(n)},n.prototype.select=function(r){var o=this;if(r.selected=!0,a(r.element).is("option"))return r.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(r=[r]).push.apply(r,e);for(var n=0;n<r.length;n++){var i=r[n].id;-1===a.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("change")});else{var e=r.id;this.$element.val(e),this.$element.trigger("change")}},n.prototype.unselect=function(r){var o=this;if(this.$element.prop("multiple")){if(r.selected=!1,a(r.element).is("option"))return r.element.selected=!1,void this.$element.trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n].id;i!==r.id&&-1===a.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.removeData(this,"data")})},n.prototype.query=function(i,e){var r=[],o=this;this.$element.children().each(function(){var e=a(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(i,t);null!==n&&r.push(n)}}),e({results:r})},n.prototype.addOptions=function(e){t.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:(t=document.createElement("option")).textContent!==undefined?t.textContent=e.text:t.innerText=e.text,e.id!==undefined&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=a(t),i=this._normalizeItem(e);return i.element=t,a.data(t,"data",i),n},n.prototype.item=function(e){var t={};if(null!=(t=a.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),i=[],r=0;r<n.length;r++){var o=a(n[r]),s=this.item(o);i.push(s)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.data(e[0],"data",t),t},n.prototype._normalizeItem=function(e){a.isPlainObject(e)||(e={id:e,text:e});return null!=(e=a.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&(e._resultId=this.generateResultId(this.container,e)),a.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return f.Extend(i,e),i.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),i=n.map(function(){return t.item(g(this)).id}).get(),r=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,i)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}r.push(p)}}return r},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var i=o.ajax(e);return i.then(t),i.fail(n),i}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,i){var r=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=r.processResults(e,n);r.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(t),r.container.focusOnActiveElement()},function(){e.status&&"0"===e.status||r.trigger("results:message",{message:"errorLoading"})});r._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var i=n.get("tags"),r=n.get("createTag");r!==undefined&&(this.createTag=r);var o=n.get("insertTag");if(o!==undefined&&(this.insertTag=o),e.call(this,t,n),u.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,l,c){var u=this;this._removeOldTags(),null!=l.term&&null==l.page?e.call(this,l,function d(e,t){for(var n=e.results,i=0;i<n.length;i++){var r=n[i],o=null!=r.children&&!d({results:r.children},!0);if((r.text||"").toUpperCase()===(l.term||"").toUpperCase()||o)return!t&&(e.data=n,void c(e))}if(t)return!0;var s=u.createTag(l);if(null!=s){var a=u.option(s);a.attr("data-select2-tag",!0),u.addOptions([a]),u.insertTag(n,s)}e.results=n,c(e)}):e.call(this,l,c)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var i=n.get("tokenizer");i!==undefined&&(this.tokenizer=i),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var r=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function o(e){var t=r._normalizeItem(e);if(!r.$element.find("option").filter(function(){return d(this).val()===t.id}).length){var n=r.option(t);n.attr("data-select2-tag",!0),r._removeOldTags(),r.addOptions([n])}!function i(e){r.trigger("select",{data:e})}(t)});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.focus()),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,i){for(var r=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,r)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(i(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(n,i,r){var o=this;this.current(function(e){var t=null!=e?e.length:0;0<o.maximumSelectionLength&&t>=o.maximumSelectionLength?o.trigger("results:message",{message:"maximumSelected",args:{maximum:o.maximumSelectionLength}}):n.call(o,i,r)})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-owns",r),i.$search.focus(),window.setTimeout(function(){i.$search.focus()},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-activedescendant"),i.$search.removeAttr("aria-owns"),i.$search.val("")}),t.on("focus",function(){t.isOpen()&&i.$search.focus()}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){i.$search.attr("aria-activedescendant",e.data._resultId)})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(r){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",function(){var e=r.contains(document.documentElement,i.$loadingMore[0]);if(!i.loading&&e){var t=i.$results.offset().top+i.$results.outerHeight(!1);i.$loadingMore.offset().top+i.$loadingMore.outerHeight(!1)<=t+50&&i.loadMore()}})},e.prototype.loadMore=function(){this.loading=!0;var e=r.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=r('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=n.get("dropdownParent")||f(document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this,r=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),r||(r=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){f(this).data("select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=f(this).data("select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<r.top-s,u=l>r.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function r(e){for(var t=0,n=0;n<e.length;n++){var i=e[n];i.children?t+=r(i.children):t++}return t}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=i.data("data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(m,v,y,_,$,w,b,A,x,E,O,n,C,S,T,D,q,L,j,P,k,I,R,U,M,H,z,N,e){function t(){this.reset()}return t.prototype.apply=function(e){if(null==(e=m.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=T:null!=e.data?e.dataAdapter=S:e.dataAdapter=C,0<e.minimumInputLength&&(e.dataAdapter=E.Decorate(e.dataAdapter,L)),0<e.maximumInputLength&&(e.dataAdapter=E.Decorate(e.dataAdapter,j)),0<e.maximumSelectionLength&&(e.dataAdapter=E.Decorate(e.dataAdapter,P)),e.tags&&(e.dataAdapter=E.Decorate(e.dataAdapter,D)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=E.Decorate(e.dataAdapter,q)),null!=e.query){var t=v(e.amdBase+"compat/query");e.dataAdapter=E.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=v(e.amdBase+"compat/initSelection");e.dataAdapter=E.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=y,null!=e.ajax&&(e.resultsAdapter=E.Decorate(e.resultsAdapter,U)),null!=e.placeholder&&(e.resultsAdapter=E.Decorate(e.resultsAdapter,R)),e.selectOnClose&&(e.resultsAdapter=E.Decorate(e.resultsAdapter,z))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=k;else{var i=E.Decorate(k,I);e.dropdownAdapter=i}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=E.Decorate(e.dropdownAdapter,H)),e.closeOnSelect&&(e.dropdownAdapter=E.Decorate(e.dropdownAdapter,N)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var r=v(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=E.Decorate(e.dropdownAdapter,r)}e.dropdownAdapter=E.Decorate(e.dropdownAdapter,M)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=$:e.selectionAdapter=_,null!=e.placeholder&&(e.selectionAdapter=E.Decorate(e.selectionAdapter,w)),e.allowClear&&(e.selectionAdapter=E.Decorate(e.selectionAdapter,b)),e.multiple&&(e.selectionAdapter=E.Decorate(e.selectionAdapter,A)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=v(e.amdBase+"compat/containerCss");e.selectionAdapter=E.Decorate(e.selectionAdapter,o)}e.selectionAdapter=E.Decorate(e.selectionAdapter,x)}if("string"==typeof e.language)if(0<e.language.indexOf("-")){var s=e.language.split("-")[0];e.language=[e.language,s]}else e.language=[e.language];if(m.isArray(e.language)){var a=new O;e.language.push("en");for(var l=e.language,c=0;c<l.length;c++){var u=l[c],d={};try{d=O.loadPath(u)}catch(f){try{u=this.defaults.amdLanguageBase+u,d=O.loadPath(u)}catch(g){e.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+u+'" could not be automatically loaded. A fallback will be used instead.');continue}}a.extend(d)}e.translations=a}else{var p=O.loadPath(this.defaults.amdLanguageBase+"en"),h=new O(e.language);h.extend(p),e.translations=h}return e},t.prototype.reset=function(){function s(e){return e.replace(/[^\u0000-\u007E]/g,function t(e){return n[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:E.escapeMarkup,language:e,matcher:function a(e,t){if(""===m.trim(e.term))return t;if(t.children&&0<t.children.length){for(var n=m.extend(!0,{},t),i=t.children.length-1;0<=i;i--)null==a(e,t.children[i])&&n.children.splice(i,1);return 0<n.children.length?n:a(e,n)}var r=s(t.text).toUpperCase(),o=s(e.term).toUpperCase();return-1<r.indexOf(o)?t:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},t.prototype.set=function(e,t){var n={};n[m.camelCase(e)]=t;var i=E._convertData(n);m.extend(this.defaults,i)},new t}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(i,o,r,s){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),this.options=r.apply(this.options),t&&t.is("input")){var n=i(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=s.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var n={};n=o.fn.jquery&&"1."==o.fn.jquery.substr(0,2)&&e[0].dataset?o.extend(!0,{},e[0].dataset,e.data()):e.data();var i=o.extend(!0,{},n);for(var r in i=s._convertData(i))-1<o.inArray(r,t)||(o.isPlainObject(this.options[r])?o.extend(this.options[r],i[r]):this.options[r]=i[r]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(r,c,n,o){var u=function(e,t){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),u.__super__.constructor.call(this);var n=e.attr("tabindex")||0;e.data("old-tabindex",n),e.attr("tabindex","-1");var i=this.options.get("dataAdapter");this.dataAdapter=new i(e,this.options);var r=this.render();this._placeContainer(r);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(u,n.Observable),u.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},u.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},u.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"!=t)return t;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},u.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},u.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){r.each(e,t._syncA),r.each(e,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},u.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===r.inArray(e,i)&&n.trigger(e,t)})},u.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerEvents=function(){var i=this;this.on("open",function(){i.$container.addClass("select2-container--open")}),this.on("close",function(){i.$container.removeClass("select2-container--open")}),this.on("enable",function(){i.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){i.$container.addClass("select2-container--disabled")}),this.on("blur",function(){i.$container.removeClass("select2-container--focus")}),this.on("query",function(t){i.isOpen()||i.trigger("open",{}),this.dataAdapter.query(t,function(e){i.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){i.trigger("results:append",{data:e,query:t})})}),this.on("open",function(){setTimeout(function(){i.focusOnActiveElement()},1)}),r(document).on("keydown",function(e){var t=e.which;if(i.isOpen()){t===o.ESC||t===o.UP&&e.altKey?(i.close(),e.preventDefault()):t===o.ENTER||t===o.TAB?(i.trigger("results:select",{}),e.preventDefault()):t===o.SPACE&&e.ctrlKey?(i.trigger("results:toggle",{}),e.preventDefault()):t===o.UP?(i.trigger("results:previous",{}),e.preventDefault()):t===o.DOWN&&(i.trigger("results:next",{}),e.preventDefault());var n=i.$dropdown.find(".select2-search__field");n.length||(n=i.$container.find(".select2-search__field")),t===o.DOWN||t===o.UP?i.focusOnActiveElement():(n.focus(),setTimeout(function(){i.focusOnActiveElement()},1e3))}else i.hasFocus()&&(t!==o.ENTER&&t!==o.SPACE&&t!==o.DOWN||(i.open(),e.preventDefault()))})},u.prototype.focusOnActiveElement=function(){this.isOpen()&&!n.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},u.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},u.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var r=0;r<t.addedNodes.length;r++){t.addedNodes[r].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},u.prototype.trigger=function(e,t){var n=u.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(t===undefined&&(t={}),e in i){var r=i[e],o={prevented:!1,name:e,args:t};if(n.call(this,r,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},u.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},u.prototype.open=function(){this.isOpen()||this.trigger("query",{})},u.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},u.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},u.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},u.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},u.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},u.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},u.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];r.isArray(t)&&(t=r.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("change")},u.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},u.prototype.render=function(){var e=r('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},u}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(r,e,o,t){if(null==r.fn.selectWoo){var s=["open","close","destroy"];r.fn.selectWoo=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=r.extend(!0,{},t);new o(r(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=r(this).data("select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1<r.inArray(t,s)?this:n}}return null!=r.fn.select2&&null!=r.fn.select2.defaults&&(r.fn.selectWoo.defaults=r.fn.select2.defaults),null==r.fn.selectWoo.defaults&&(r.fn.selectWoo.defaults=t),r.fn.select2=r.fn.select2||r.fn.selectWoo,o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return u.fn.select2.amd=e,u.fn.selectWoo.amd=e,t});
1
  /*!
2
+ * SelectWoo 1.0.6
3
  * https://github.com/woocommerce/selectWoo
4
  *
5
  * Released under the MIT license
6
  * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
7
  */
8
+ !function(n){"function"==typeof define&&define.amd?define(["jquery"],n):"object"==typeof module&&module.exports?module.exports=function(e,t){return t===undefined&&(t="undefined"!=typeof window?require("jquery"):require("jquery")(e)),n(t),t}:n(jQuery)}(function(n){var e=function(){if(n&&n.fn&&n.fn.select2&&n.fn.select2.amd)var e=n.fn.select2.amd;var t,r,c;return e&&e.requirejs||(e?r=e:e={},function(h){var o,s,f,g,m={},v={},y={},_={},n=Object.prototype.hasOwnProperty,i=[].slice,$=/\.js$/;function w(e,t){return n.call(e,t)}function a(e,t){var n,i,r,o,s,a,l,c,u,d,p,h=t&&t.split("/"),f=y.map,g=f&&f["*"]||{};if(e){for(s=(e=e.split("/")).length-1,y.nodeIdCompat&&$.test(e[s])&&(e[s]=e[s].replace($,"")),"."===e[0].charAt(0)&&h&&(e=h.slice(0,h.length-1).concat(e)),u=0;u<e.length;u++)if("."===(p=e[u]))e.splice(u,1),u-=1;else if(".."===p){if(0===u||1===u&&".."===e[2]||".."===e[u-1])continue;0<u&&(e.splice(u-1,2),u-=2)}e=e.join("/")}if((h||g)&&f){for(u=(n=e.split("/")).length;0<u;u-=1){if(i=n.slice(0,u).join("/"),h)for(d=h.length;0<d;d-=1)if((r=f[h.slice(0,d).join("/")])&&(r=r[i])){o=r,a=u;break}if(o)break;!l&&g&&g[i]&&(l=g[i],c=u)}!o&&l&&(o=l,a=c),o&&(n.splice(0,a,o),e=n.join("/"))}return e}function b(t,n){return function(){var e=i.call(arguments,0);return"string"!=typeof e[0]&&1===e.length&&e.push(null),s.apply(h,e.concat([t,n]))}}function A(t){return function(e){m[t]=e}}function x(e){if(w(v,e)){var t=v[e];delete v[e],_[e]=!0,o.apply(h,t)}if(!w(m,e)&&!w(_,e))throw new Error("No "+e);return m[e]}function l(e){var t,n=e?e.indexOf("!"):-1;return-1<n&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function E(e){return e?l(e):[]}f=function(e,t){var n,i=l(e),r=i[0],o=t[1];return e=i[1],r&&(n=x(r=a(r,o))),r?e=n&&n.normalize?n.normalize(e,function s(t){return function(e){return a(e,t)}}(o)):a(e,o):(r=(i=l(e=a(e,o)))[0],e=i[1],r&&(n=x(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},g={require:function(e){return b(e)},exports:function(e){var t=m[e];return void 0!==t?t:m[e]={}},module:function(e){return{id:e,uri:"",exports:m[e],config:function t(e){return function(){return y&&y.config&&y.config[e]||{}}}(e)}}},o=function(e,t,n,i){var r,o,s,a,l,c,u,d=[],p=typeof n;if(c=E(i=i||e),"undefined"==p||"function"==p){for(t=!t.length&&n.length?["require","exports","module"]:t,l=0;l<t.length;l+=1)if("require"===(o=(a=f(t[l],c)).f))d[l]=g.require(e);else if("exports"===o)d[l]=g.exports(e),u=!0;else if("module"===o)r=d[l]=g.module(e);else if(w(m,o)||w(v,o)||w(_,o))d[l]=x(o);else{if(!a.p)throw new Error(e+" missing "+o);a.p.load(a.n,b(i,!0),A(o),{}),d[l]=m[o]}s=n?n.apply(m[e],d):undefined,e&&(r&&r.exports!==h&&r.exports!==m[e]?m[e]=r.exports:s===h&&u||(m[e]=s))}else e&&(m[e]=n)},t=r=s=function(e,t,n,i,r){if("string"==typeof e)return g[e]?g[e](t):x(f(e,E(t)).f);if(!e.splice){if((y=e).deps&&s(y.deps,y.callback),!t)return;t.splice?(e=t,t=n,n=null):e=h}return t=t||function(){},"function"==typeof n&&(n=i,i=r),i?o(h,e,t,n):setTimeout(function(){o(h,e,t,n)},4),s},s.config=function(e){return s(e)},t._defined=m,(c=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),w(m,e)||w(v,e)||(v[e]=[e,t,n])}).amd={jQuery:!0}}(),e.requirejs=t,e.require=r,e.define=c),e.define("almond",function(){}),e.define("jquery",[],function(){var e=n||$;return null==e&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),e}),e.define("select2/utils",["jquery"],function(o){var e={};function d(e){var t=e.prototype,n=[];for(var i in t){"function"==typeof t[i]&&("constructor"!==i&&n.push(i))}return n}e.Extend=function(e,t){var n={}.hasOwnProperty;function i(){this.constructor=e}for(var r in t)n.call(t,r)&&(e[r]=t[r]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},e.Decorate=function(i,r){var e=d(r),t=d(i);function o(){var e=Array.prototype.unshift,t=r.prototype.constructor.length,n=i.prototype.constructor;0<t&&(e.call(arguments,i.prototype.constructor),n=r.prototype.constructor),n.apply(this,arguments)}r.displayName=i.displayName,o.prototype=new function u(){this.constructor=o};for(var n=0;n<t.length;n++){var s=t[n];o.prototype[s]=i.prototype[s]}for(var a=function(e){var t=function(){};e in o.prototype&&(t=o.prototype[e]);var n=r.prototype[e];return function(){return Array.prototype.unshift.call(arguments,t),n.apply(this,arguments)}},l=0;l<e.length;l++){var c=e[l];o.prototype[c]=a(c)}return o};var t=function(){this.listeners={}};return t.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},t.prototype.trigger=function(e){var t=Array.prototype.slice,n=t.call(arguments,1);this.listeners=this.listeners||{},null==n&&(n=[]),0===n.length&&n.push({}),(n[0]._type=e)in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},t.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},e.Observable=t,e.generateChars=function(e){for(var t="",n=0;n<e;n++){t+=Math.floor(36*Math.random()).toString(36)}return t},e.bind=function(e,t){return function(){e.apply(t,arguments)}},e._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var o=n[r];(o=o.substring(0,1).toLowerCase()+o.substring(1))in i||(i[o]={}),r==n.length-1&&(i[o]=e[t]),i=i[o]}delete e[t]}}return e},e.hasScroll=function(e,t){var n=o(t),i=t.style.overflowX,r=t.style.overflowY;return(i!==r||"hidden"!==r&&"visible"!==r)&&("scroll"===i||"scroll"===r||(n.innerHeight()<t.scrollHeight||n.innerWidth()<t.scrollWidth))},e.escapeMarkup=function(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},e.appendMany=function(e,t){if("1.7"===o.fn.jquery.substr(0,3)){var n=o();o.map(t,function(e){n=n.add(e)}),t=n}e.append(t)},e.isTouchscreen=function(){return"undefined"==typeof e._isTouchscreenCache&&(e._isTouchscreenCache="ontouchstart"in document.documentElement),e._isTouchscreenCache},e}),e.define("select2/results",["jquery","./utils"],function(h,e){function i(e,t,n){this.$element=e,this.data=n,this.options=t,i.__super__.constructor.call(this)}return e.Extend(i,e.Observable),i.prototype.render=function(){var e=h('<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>');return this.options.get("multiple")&&e.attr("aria-multiselectable","true"),this.$results=e},i.prototype.clear=function(){this.$results.empty()},i.prototype.displayMessage=function(e){var t=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var n=h('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),i=this.options.get("translations").get(e.message);n.append(t(i(e.args))),n[0].className+=" select2-results__message",this.$results.append(n)},i.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},i.prototype.append=function(e){this.hideLoading();var t=[];if(null!=e.results&&0!==e.results.length){e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},i.prototype.position=function(e,t){t.find(".select2-results").append(e)},i.prototype.sort=function(e){return this.options.get("sorter")(e)},i.prototype.highlightFirstItem=function(){var e=this.$results.find(".select2-results__option[data-selected]"),t=e.filter("[data-selected=true]");0<t.length?t.first().trigger("mouseenter"):e.first().trigger("mouseenter"),this.ensureHighlightVisible()},i.prototype.setClasses=function(){var t=this;this.data.current(function(e){var i=h.map(e,function(e){return e.id.toString()});t.$results.find(".select2-results__option[data-selected]").each(function(){var e=h(this),t=h.data(this,"data"),n=""+t.id;null!=t.element&&t.element.selected||null==t.element&&-1<h.inArray(n,i)?e.attr("data-selected","true"):e.attr("data-selected","false")})})},i.prototype.showLoading=function(e){this.hideLoading();var t={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(e)},n=this.option(t);n.className+=" loading-results",this.$results.prepend(n)},i.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},i.prototype.option=function(e){var t=document.createElement("li");t.className="select2-results__option";var n={role:"option","data-selected":"false",tabindex:-1};for(var i in e.disabled&&(delete n["data-selected"],n["aria-disabled"]="true"),null==e.id&&delete n["data-selected"],null!=e._resultId&&(t.id=e._resultId),e.title&&(t.title=e.title),e.children&&(n["aria-label"]=e.text,delete n["data-selected"]),n){var r=n[i];t.setAttribute(i,r)}if(e.children){var o=h(t),s=document.createElement("strong");s.className="select2-results__group";var a=h(s);this.template(e,s),a.attr("role","presentation");for(var l=[],c=0;c<e.children.length;c++){var u=e.children[c],d=this.option(u);l.push(d)}var p=h("<ul></ul>",{"class":"select2-results__options select2-results__options--nested",role:"listbox"});p.append(l),o.attr("role","list"),o.append(s),o.append(p)}else this.template(e,t);return h.data(t,"data",e),t},i.prototype.bind=function(t,e){var l=this,n=t.id+"-results";this.$results.attr("id",n),t.on("results:all",function(e){l.clear(),l.append(e.data),t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("results:append",function(e){l.append(e.data),t.isOpen()&&l.setClasses()}),t.on("query",function(e){l.hideMessages(),l.showLoading(e)}),t.on("select",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("unselect",function(){t.isOpen()&&(l.setClasses(),l.highlightFirstItem())}),t.on("open",function(){l.$results.attr("aria-expanded","true"),l.$results.attr("aria-hidden","false"),l.setClasses(),l.ensureHighlightVisible()}),t.on("close",function(){l.$results.attr("aria-expanded","false"),l.$results.attr("aria-hidden","true"),l.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=l.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=l.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("data-selected")?l.trigger("close",{}):l.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=l.getHighlightedResults(),t=l.$results.find("[data-selected]"),n=t.index(e);if(0!==n){var i=n-1;0===e.length&&(i=0);var r=t.eq(i);r.trigger("mouseenter");var o=l.$results.offset().top,s=r.offset().top,a=l.$results.scrollTop()+(s-o);0===i?l.$results.scrollTop(0):s-o<0&&l.$results.scrollTop(a)}}),t.on("results:next",function(){var e=l.getHighlightedResults(),t=l.$results.find("[data-selected]"),n=t.index(e)+1;if(!(n>=t.length)){var i=t.eq(n);i.trigger("mouseenter");var r=l.$results.offset().top+l.$results.outerHeight(!1),o=i.offset().top+i.outerHeight(!1),s=l.$results.scrollTop()+o-r;0===n?l.$results.scrollTop(0):r<o&&l.$results.scrollTop(s)}}),t.on("results:focus",function(e){e.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),l.$results.attr("aria-activedescendant",e.element.attr("id"))}),t.on("results:message",function(e){l.displayMessage(e)}),h.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=l.$results.scrollTop(),n=l.$results.get(0).scrollHeight-t+e.deltaY,i=0<e.deltaY&&t-e.deltaY<=0,r=e.deltaY<0&&n<=l.$results.height();i?(l.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):r&&(l.$results.scrollTop(l.$results.get(0).scrollHeight-l.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(e){var t=h(this),n=t.data("data");"true"!==t.attr("data-selected")?l.trigger("select",{originalEvent:e,data:n}):l.options.get("multiple")?l.trigger("unselect",{originalEvent:e,data:n}):l.trigger("close",{})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(e){var t=h(this).data("data");l.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),l.trigger("results:focus",{data:t,element:h(this)})})},i.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},i.prototype.destroy=function(){this.$results.remove()},i.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[data-selected]").index(e),n=this.$results.offset().top,i=e.offset().top,r=this.$results.scrollTop()+(i-n),o=i-n;r-=2*e.outerHeight(!1),t<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(r)}},i.prototype.template=function(e,t){var n=this.options.get("templateResult"),i=this.options.get("escapeMarkup"),r=n(e,t);null==r?t.style.display="none":"string"==typeof r?t.innerHTML=i(r):h(t).append(r)},i}),e.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),e.define("select2/selection/base",["jquery","../utils","../keys"],function(i,e,r){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=i('<span class="select2-selection" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),e.attr("title",this.$element.attr("title")),e.attr("tabindex",this._tabindex),this.$selection=e},n.prototype.bind=function(e,t){var n=this,i=(e.id,e.id+"-results");this.options.get("minimumResultsForSearch"),Infinity;this.container=e,this.$selection.on("focus",function(e){n.trigger("focus",e)}),this.$selection.on("blur",function(e){n._handleBlur(e)}),this.$selection.on("keydown",function(e){n.trigger("keypress",e),e.which===r.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){n.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){n.update(e.data)}),e.on("open",function(){n.$selection.attr("aria-expanded","true"),n.$selection.attr("aria-owns",i),n._attachCloseHandler(e)}),e.on("close",function(){n.$selection.attr("aria-expanded","false"),n.$selection.removeAttr("aria-activedescendant"),n.$selection.removeAttr("aria-owns"),window.setTimeout(function(){n.$selection.focus()},1),n._detachCloseHandler(e)}),e.on("enable",function(){n.$selection.attr("tabindex",n._tabindex)}),e.on("disable",function(){n.$selection.attr("tabindex","-1")})},n.prototype._handleBlur=function(e){var t=this;window.setTimeout(function(){document.activeElement==t.$selection[0]||i.contains(t.$selection[0],document.activeElement)||t.trigger("blur",e)},1)},n.prototype._attachCloseHandler=function(e){i(document.body).on("mousedown.select2."+e.id,function(e){var t=i(e.target),n=t.closest(".select2");i(".select2.select2-container--open").each(function(){var e=i(this);this!=n[0]&&(e.data("element").select2("close"),setTimeout(function(){e.find("*:focus").blur(),t.focus()},1))})})},n.prototype._detachCloseHandler=function(e){i(document.body).off("mousedown.select2."+e.id)},n.prototype.position=function(e,t){t.find(".selection").append(e)},n.prototype.destroy=function(){this._detachCloseHandler(this.container)},n.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},n}),e.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--single"),e.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments);var i=t.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",i).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",i),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("keydown",function(e){!t.isOpen()&&48<=e.which&&e.which<=90&&t.open()}),this.$selection.on("blur",function(e){}),t.on("focus",function(e){t.isOpen()||n.$selection.focus()}),t.on("selection:update",function(e){n.update(e.data)})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0!==e.length){var t=e[0],n=this.$selection.find(".select2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)}else this.clear()},r}),e.define("select2/selection/multiple",["jquery","./base","../utils"],function(i,e,a){function r(e,t){r.__super__.constructor.apply(this,arguments)}return a.Extend(r,e),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("select2-selection--multiple"),e.html('<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'),e},r.prototype.bind=function(t,e){var n=this;r.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){n.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".select2-selection__choice__remove",function(e){if(!n.options.get("disabled")){var t=i(this).parent().data("data");n.trigger("unselect",{originalEvent:e,data:t})}}),this.$selection.on("keydown",function(e){!t.isOpen()&&48<=e.which&&e.which<=90&&t.open()}),t.on("focus",function(){n.focusOnSearch()})},r.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection");return this.options.get("escapeMarkup")(n(e,t))},r.prototype.selectionContainer=function(){return i('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">&times;</span></li>')},r.prototype.focusOnSearch=function(){var e=this;"undefined"!=typeof e.$search&&setTimeout(function(){e._keyUpPrevented=!0,e.$search.focus()},1)},r.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],n=0;n<e.length;n++){var i=e[n],r=this.selectionContainer(),o=this.display(i,r);"string"==typeof o&&(o=o.trim()),r.append(o),r.prop("title",i.title||i.text),r.data("data",i),t.push(r)}var s=this.$selection.find(".select2-selection__rendered");a.appendMany(s,t)}},r}),e.define("select2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id;if(1<t.length||n)return e.call(this,t);this.clear();var i=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(i)},t}),e.define("select2/selection/allowClear",["jquery","../keys"],function(i,r){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},e.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".select2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),r=0;r<i.length;r++){var o={data:i[r]};if(this.trigger("unselect",o),o.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},e.prototype._handleKeyboardClear=function(e,t,n){n.isOpen()||t.which!=r.DELETE&&t.which!=r.BACKSPACE||this._handleClear(t)},e.prototype.update=function(e,t){if(e.call(this,t),!(0<this.$selection.find(".select2-selection__placeholder").length||0===t.length)){var n=i('<span class="select2-selection__clear">&times;</span>');n.data("data",t),this.$selection.find(".select2-selection__rendered").prepend(n)}},e}),e.define("select2/selection/search",["jquery","../utils","../keys"],function(i,e,a){function t(e,t,n){e.call(this,t,n)}return t.prototype.render=function(e){var t=i('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=t,this.$search=t.find("input");var n=e.call(this);return this._transferTabIndex(),n},t.prototype.bind=function(e,i,t){var r=this,n=i.id+"-results";e.call(this,i,t),i.on("open",function(){r.$search.attr("aria-owns",n),r.$search.trigger("focus")}),i.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.removeAttr("aria-owns"),r.$search.trigger("focus")}),i.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),i.on("disable",function(){r.$search.prop("disabled",!0)}),i.on("focus",function(e){r.$search.trigger("focus")}),i.on("results:focus",function(e){r.$search.attr("aria-activedescendant",e.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".select2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".select2-search--inline",function(e){if(e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented(),e.which===a.BACKSPACE&&""===r.$search.val()){var t=r.$searchContainer.prev(".select2-selection__choice");if(0<t.length){var n=t.data("data");r.searchRemoveChoice(n),e.preventDefault()}}else e.which===a.ENTER&&(i.open(),e.preventDefault())});var o=document.documentMode,s=o&&o<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(e){s?r.$selection.off("input.search input.searchcheck"):r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(e){if(s&&"input"===e.type)r.$selection.off("input.search input.searchcheck");else{var t=e.which;t!=a.SHIFT&&t!=a.CTRL&&t!=a.ALT&&t!=a.TAB&&r.handleSearch(e)}})},t.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},t.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},t.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},t.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},t.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},t.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";""!==this.$search.attr("placeholder")?e=this.$selection.find(".select2-selection__rendered").innerWidth():e=.75*(this.$search.val().length+1)+"em";this.$search.css("width",e)},t}),e.define("select2/selection/eventRelay",["jquery"],function(s){function e(){}return e.prototype.bind=function(e,t,n){var i=this,r=["open","opening","close","closing","select","selecting","unselect","unselecting"],o=["opening","closing","selecting","unselecting"];e.call(this,t,n),t.on("*",function(e,t){if(-1!==s.inArray(e,r)){t=t||{};var n=s.Event("select2:"+e,{params:t});i.$element.trigger(n),-1!==s.inArray(e,o)&&(t.prevented=n.isDefaultPrevented())}})},e}),e.define("select2/translation",["jquery","require"],function(t,n){function i(e){this.dict=e||{}}return i.prototype.all=function(){return this.dict},i.prototype.get=function(e){return this.dict[e]},i.prototype.extend=function(e){this.dict=t.extend({},e.all(),this.dict)},i._cache={},i.loadPath=function(e){if(!(e in i._cache)){var t=n(e);i._cache[e]=t}return new i(i._cache[e])},i}),e.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),e.define("select2/data/base",["../utils"],function(i){function n(e,t){n.__super__.constructor.call(this)}return i.Extend(n,i.Observable),n.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},n.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},n.prototype.bind=function(e,t){},n.prototype.destroy=function(){},n.prototype.generateResultId=function(e,t){var n="";return n+=null!=e?e.id:i.generateChars(4),n+="-result-",n+=i.generateChars(4),null!=t.id?n+="-"+t.id.toString():n+="-"+i.generateChars(4),n},n}),e.define("select2/data/select",["./base","../utils","jquery"],function(e,t,a){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,e),n.prototype.current=function(e){var n=[],i=this;this.$element.find(":selected").each(function(){var e=a(this),t=i.item(e);n.push(t)}),e(n)},n.prototype.select=function(r){var o=this;if(r.selected=!0,a(r.element).is("option"))return r.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(e){var t=[];(r=[r]).push.apply(r,e);for(var n=0;n<r.length;n++){var i=r[n].id;-1===a.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("change")});else{var e=r.id;this.$element.val(e),this.$element.trigger("change")}},n.prototype.unselect=function(r){var o=this;if(this.$element.prop("multiple")){if(r.selected=!1,a(r.element).is("option"))return r.element.selected=!1,void this.$element.trigger("change");this.current(function(e){for(var t=[],n=0;n<e.length;n++){var i=e[n].id;i!==r.id&&-1===a.inArray(i,t)&&t.push(i)}o.$element.val(t),o.$element.trigger("change")})}},n.prototype.bind=function(e,t){var n=this;(this.container=e).on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},n.prototype.destroy=function(){this.$element.find("*").each(function(){a.removeData(this,"data")})},n.prototype.query=function(i,e){var r=[],o=this;this.$element.children().each(function(){var e=a(this);if(e.is("option")||e.is("optgroup")){var t=o.item(e),n=o.matches(i,t);null!==n&&r.push(n)}}),e({results:r})},n.prototype.addOptions=function(e){t.appendMany(this.$element,e)},n.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup")).label=e.text:(t=document.createElement("option")).textContent!==undefined?t.textContent=e.text:t.innerText=e.text,e.id!==undefined&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var n=a(t),i=this._normalizeItem(e);return i.element=t,a.data(t,"data",i),n},n.prototype.item=function(e){var t={};if(null!=(t=a.data(e[0],"data")))return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var n=e.children("option"),i=[],r=0;r<n.length;r++){var o=a(n[r]),s=this.item(o);i.push(s)}t.children=i}return(t=this._normalizeItem(t)).element=e[0],a.data(e[0],"data",t),t},n.prototype._normalizeItem=function(e){a.isPlainObject(e)||(e={id:e,text:e});return null!=(e=a.extend({},{text:""},e)).id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&(e._resultId=this.generateResultId(this.container,e)),a.extend({},{selected:!1,disabled:!1},e)},n.prototype.matches=function(e,t){return this.options.get("matcher")(e,t)},n}),e.define("select2/data/array",["./select","../utils","jquery"],function(e,f,g){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return f.Extend(i,e),i.prototype.select=function(n){var e=this.$element.find("option").filter(function(e,t){return t.value==n.id.toString()});0===e.length&&(e=this.option(n),this.addOptions(e)),i.__super__.select.call(this,n)},i.prototype.convertToOptions=function(e){var t=this,n=this.$element.find("option"),i=n.map(function(){return t.item(g(this)).id}).get(),r=[];function o(e){return function(){return g(this).val()==e.id}}for(var s=0;s<e.length;s++){var a=this._normalizeItem(e[s]);if(0<=g.inArray(a.id,i)){var l=n.filter(o(a)),c=this.item(l),u=g.extend(!0,{},a,c),d=this.option(u);l.replaceWith(d)}else{var p=this.option(a);if(a.children){var h=this.convertToOptions(a.children);f.appendMany(p,h)}r.push(p)}}return r},i}),e.define("select2/data/ajax",["./array","../utils","jquery"],function(e,t,o){function n(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),n.__super__.constructor.call(this,e,t)}return t.Extend(n,e),n.prototype._applyDefaults=function(e){var t={data:function(e){return o.extend({},e,{q:e.term})},transport:function(e,t,n){var i=o.ajax(e);return i.then(t),i.fail(n),i}};return o.extend({},t,e,!0)},n.prototype.processResults=function(e){return e},n.prototype.query=function(n,i){var r=this;null!=this._request&&(o.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var t=o.extend({type:"GET"},this.ajaxOptions);function e(){var e=t.transport(t,function(e){var t=r.processResults(e,n);r.options.get("debug")&&window.console&&console.error&&(t&&t.results&&o.isArray(t.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),i(t),r.container.focusOnActiveElement()},function(){e.status&&"0"===e.status||r.trigger("results:message",{message:"errorLoading"})});r._request=e}"function"==typeof t.url&&(t.url=t.url.call(this.$element,n)),"function"==typeof t.data&&(t.data=t.data.call(this.$element,n)),this.ajaxOptions.delay&&null!=n.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(e,this.ajaxOptions.delay)):e()},n}),e.define("select2/data/tags",["jquery"],function(u){function e(e,t,n){var i=n.get("tags"),r=n.get("createTag");r!==undefined&&(this.createTag=r);var o=n.get("insertTag");if(o!==undefined&&(this.insertTag=o),e.call(this,t,n),u.isArray(i))for(var s=0;s<i.length;s++){var a=i[s],l=this._normalizeItem(a),c=this.option(l);this.$element.append(c)}}return e.prototype.query=function(e,l,c){var u=this;this._removeOldTags(),null!=l.term&&null==l.page?e.call(this,l,function d(e,t){for(var n=e.results,i=0;i<n.length;i++){var r=n[i],o=null!=r.children&&!d({results:r.children},!0);if((r.text||"").toUpperCase()===(l.term||"").toUpperCase()||o)return!t&&(e.data=n,void c(e))}if(t)return!0;var s=u.createTag(l);if(null!=s){var a=u.option(s);a.attr("data-select2-tag",!0),u.addOptions([a]),u.insertTag(n,s)}e.results=n,c(e)}):e.call(this,l,c)},e.prototype.createTag=function(e,t){var n=u.trim(t.term);return""===n?null:{id:n,text:n}},e.prototype.insertTag=function(e,t,n){t.unshift(n)},e.prototype._removeOldTags=function(e){this._lastTag;this.$element.find("option[data-select2-tag]").each(function(){this.selected||u(this).remove()})},e}),e.define("select2/data/tokenizer",["jquery"],function(d){function e(e,t,n){var i=n.get("tokenizer");i!==undefined&&(this.tokenizer=i),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".select2-search__field")},e.prototype.query=function(e,t,n){var r=this;t.term=t.term||"";var i=this.tokenizer(t,this.options,function o(e){var t=r._normalizeItem(e);if(!r.$element.find("option").filter(function(){return d(this).val()===t.id}).length){var n=r.option(t);n.attr("data-select2-tag",!0),r._removeOldTags(),r.addOptions([n])}!function i(e){r.trigger("select",{data:e})}(t)});i.term!==t.term&&(this.$search.length&&(this.$search.val(i.term),this.$search.focus()),t.term=i.term),e.call(this,t,n)},e.prototype.tokenizer=function(e,t,n,i){for(var r=n.get("tokenSeparators")||[],o=t.term,s=0,a=this.createTag||function(e){return{id:e.term,text:e.term}};s<o.length;){var l=o[s];if(-1!==d.inArray(l,r)){var c=o.substr(0,s),u=a(d.extend({},t,{term:c}));null!=u?(i(u),o=o.substr(s+1)||"",s=0):s++}else s++}return{term:o}},e}),e.define("select2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",t.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.term=t.term||"",0<this.maximumInputLength&&t.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):e.call(this,t,n)},e}),e.define("select2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(n,i,r){var o=this;this.current(function(e){var t=null!=e?e.length:0;0<o.maximumSelectionLength&&t>=o.maximumSelectionLength?o.trigger("results:message",{message:"maximumSelected",args:{maximum:o.maximumSelectionLength}}):n.call(o,i,r)})},e}),e.define("select2/dropdown",["jquery","./utils"],function(t,e){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return e.Extend(n,e.Observable),n.prototype.render=function(){var e=t('<span class="select2-dropdown"><span class="select2-results"></span></span>');return e.attr("dir",this.options.get("dir")),this.$dropdown=e},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),e.define("select2/dropdown/search",["jquery","../utils"],function(o,e){function t(){}return t.prototype.render=function(e){var t=e.call(this),n=o('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=n,this.$search=n.find("input"),t.prepend(n),t},t.prototype.bind=function(e,t,n){var i=this,r=t.id+"-results";e.call(this,t,n),this.$search.on("keydown",function(e){i.trigger("keypress",e),i._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(e){o(this).off("keyup")}),this.$search.on("keyup input",function(e){i.handleSearch(e)}),t.on("open",function(){i.$search.attr("tabindex",0),i.$search.attr("aria-owns",r),i.$search.focus(),window.setTimeout(function(){i.$search.focus()},0)}),t.on("close",function(){i.$search.attr("tabindex",-1),i.$search.removeAttr("aria-activedescendant"),i.$search.removeAttr("aria-owns"),i.$search.val("")}),t.on("focus",function(){t.isOpen()||i.$search.focus()}),t.on("results:all",function(e){null!=e.query.term&&""!==e.query.term||(i.showSearch(e)?i.$searchContainer.removeClass("select2-search--hide"):i.$searchContainer.addClass("select2-search--hide"))}),t.on("results:focus",function(e){i.$search.attr("aria-activedescendant",e.data._resultId)})},t.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},t.prototype.showSearch=function(e,t){return!0},t}),e.define("select2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;0<=i;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),e.define("select2/dropdown/infiniteScroll",["jquery"],function(r){function e(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return e.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("query",function(e){i.lastParams=e,i.loading=!0}),t.on("query:append",function(e){i.lastParams=e,i.loading=!0}),this.$results.on("scroll",function(){var e=r.contains(document.documentElement,i.$loadingMore[0]);if(!i.loading&&e){var t=i.$results.offset().top+i.$results.outerHeight(!1);i.$loadingMore.offset().top+i.$loadingMore.outerHeight(!1)<=t+50&&i.loadMore()}})},e.prototype.loadMore=function(){this.loading=!0;var e=r.extend({},{page:1},this.lastParams);e.page++,this.trigger("query:append",e)},e.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},e.prototype.createLoadingMore=function(){var e=r('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),t=this.options.get("translations").get("loadingMore");return e.html(t(this.lastParams)),e},e}),e.define("select2/dropdown/attachBody",["jquery","../utils"],function(f,a){function e(e,t,n){this.$dropdownParent=n.get("dropdownParent")||f(document.body),e.call(this,t,n)}return e.prototype.bind=function(e,t,n){var i=this,r=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),r||(r=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},e.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},e.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("select2"),t.addClass("select2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},e.prototype.render=function(e){var t=f("<span></span>"),n=e.call(this);return t.append(n),this.$dropdownContainer=t},e.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},e.prototype._attachPositioningHandler=function(e,t){var n=this,i="scroll.select2."+t.id,r="resize.select2."+t.id,o="orientationchange.select2."+t.id,s=this.$container.parents().filter(a.hasScroll);s.each(function(){f(this).data("select2-scroll-position",{x:f(this).scrollLeft(),y:f(this).scrollTop()})}),s.on(i,function(e){var t=f(this).data("select2-scroll-position");f(this).scrollTop(t.y)}),f(window).on(i+" "+r+" "+o,function(e){n._positionDropdown(),n._resizeDropdown()})},e.prototype._detachPositioningHandler=function(e,t){var n="scroll.select2."+t.id,i="resize.select2."+t.id,r="orientationchange.select2."+t.id;this.$container.parents().filter(a.hasScroll).off(n),f(window).off(n+" "+i+" "+r)},e.prototype._positionDropdown=function(){var e=f(window),t=this.$dropdown.hasClass("select2-dropdown--above"),n=this.$dropdown.hasClass("select2-dropdown--below"),i=null,r=this.$container.offset();r.bottom=r.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=r.top,o.bottom=r.top+o.height;var s=this.$dropdown.outerHeight(!1),a=e.scrollTop(),l=e.scrollTop()+e.height(),c=a<r.top-s,u=l>r.bottom+s,d={left:r.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,t||n||(i="below"),u||!c||t?!c&&u&&t&&(i="below"):i="above",("above"==i||t&&"below"!==i)&&(d.top=o.top-h.top-s),null!=i&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+i),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+i)),this.$dropdownContainer.css(d)},e.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.position="relative",e.width="auto"),this.$dropdown.css(e)},e.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},e}),e.define("select2/dropdown/minimumResultsForSearch",[],function(){function e(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=Infinity),e.call(this,t,n,i)}return e.prototype.showSearch=function(e,t){return!(function r(e){for(var t=0,n=0;n<e.length;n++){var i=e[n];i.children?t+=r(i.children):t++}return t}(t.data.results)<this.minimumResultsForSearch)&&e.call(this,t)},e}),e.define("select2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(e){i._handleSelectOnClose(e)})},e.prototype._handleSelectOnClose=function(e,t){if(t&&null!=t.originalSelect2Event){var n=t.originalSelect2Event;if("select"===n._type||"unselect"===n._type)return}var i=this.getHighlightedResults();if(!(i.length<1)){var r=i.data("data");null!=r.element&&r.element.selected||null==r.element&&r.selected||this.trigger("select",{data:r})}},e}),e.define("select2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{originalEvent:n,originalSelect2Event:t})},e}),e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return 1!=t&&(n+="s"),n},inputTooShort:function(e){return"Please enter "+(e.minimum-e.input.length)+" or more characters"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),e.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(m,v,y,_,$,w,b,A,x,E,O,n,C,S,T,D,q,L,j,P,k,I,R,U,M,H,z,N,e){function t(){this.reset()}return t.prototype.apply=function(e){if(null==(e=m.extend(!0,{},this.defaults,e)).dataAdapter){if(null!=e.ajax?e.dataAdapter=T:null!=e.data?e.dataAdapter=S:e.dataAdapter=C,0<e.minimumInputLength&&(e.dataAdapter=E.Decorate(e.dataAdapter,L)),0<e.maximumInputLength&&(e.dataAdapter=E.Decorate(e.dataAdapter,j)),0<e.maximumSelectionLength&&(e.dataAdapter=E.Decorate(e.dataAdapter,P)),e.tags&&(e.dataAdapter=E.Decorate(e.dataAdapter,D)),null==e.tokenSeparators&&null==e.tokenizer||(e.dataAdapter=E.Decorate(e.dataAdapter,q)),null!=e.query){var t=v(e.amdBase+"compat/query");e.dataAdapter=E.Decorate(e.dataAdapter,t)}if(null!=e.initSelection){var n=v(e.amdBase+"compat/initSelection");e.dataAdapter=E.Decorate(e.dataAdapter,n)}}if(null==e.resultsAdapter&&(e.resultsAdapter=y,null!=e.ajax&&(e.resultsAdapter=E.Decorate(e.resultsAdapter,U)),null!=e.placeholder&&(e.resultsAdapter=E.Decorate(e.resultsAdapter,R)),e.selectOnClose&&(e.resultsAdapter=E.Decorate(e.resultsAdapter,z))),null==e.dropdownAdapter){if(e.multiple)e.dropdownAdapter=k;else{var i=E.Decorate(k,I);e.dropdownAdapter=i}if(0!==e.minimumResultsForSearch&&(e.dropdownAdapter=E.Decorate(e.dropdownAdapter,H)),e.closeOnSelect&&(e.dropdownAdapter=E.Decorate(e.dropdownAdapter,N)),null!=e.dropdownCssClass||null!=e.dropdownCss||null!=e.adaptDropdownCssClass){var r=v(e.amdBase+"compat/dropdownCss");e.dropdownAdapter=E.Decorate(e.dropdownAdapter,r)}e.dropdownAdapter=E.Decorate(e.dropdownAdapter,M)}if(null==e.selectionAdapter){if(e.multiple?e.selectionAdapter=$:e.selectionAdapter=_,null!=e.placeholder&&(e.selectionAdapter=E.Decorate(e.selectionAdapter,w)),e.allowClear&&(e.selectionAdapter=E.Decorate(e.selectionAdapter,b)),e.multiple&&(e.selectionAdapter=E.Decorate(e.selectionAdapter,A)),null!=e.containerCssClass||null!=e.containerCss||null!=e.adaptContainerCssClass){var o=v(e.amdBase+"compat/containerCss");e.selectionAdapter=E.Decorate(e.selectionAdapter,o)}e.selectionAdapter=E.Decorate(e.selectionAdapter,x)}if("string"==typeof e.language)if(0<e.language.indexOf("-")){var s=e.language.split("-")[0];e.language=[e.language,s]}else e.language=[e.language];if(m.isArray(e.language)){var a=new O;e.language.push("en");for(var l=e.language,c=0;c<l.length;c++){var u=l[c],d={};try{d=O.loadPath(u)}catch(f){try{u=this.defaults.amdLanguageBase+u,d=O.loadPath(u)}catch(g){e.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+u+'" could not be automatically loaded. A fallback will be used instead.');continue}}a.extend(d)}e.translations=a}else{var p=O.loadPath(this.defaults.amdLanguageBase+"en"),h=new O(e.language);h.extend(p),e.translations=h}return e},t.prototype.reset=function(){function s(e){return e.replace(/[^\u0000-\u007E]/g,function t(e){return n[e]||e})}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:E.escapeMarkup,language:e,matcher:function a(e,t){if(""===m.trim(e.term))return t;if(t.children&&0<t.children.length){for(var n=m.extend(!0,{},t),i=t.children.length-1;0<=i;i--)null==a(e,t.children[i])&&n.children.splice(i,1);return 0<n.children.length?n:a(e,n)}var r=s(t.text).toUpperCase(),o=s(e.term).toUpperCase();return-1<r.indexOf(o)?t:null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},t.prototype.set=function(e,t){var n={};n[m.camelCase(e)]=t;var i=E._convertData(n);m.extend(this.defaults,i)},new t}),e.define("select2/options",["require","jquery","./defaults","./utils"],function(i,o,r,s){function e(e,t){if(this.options=e,null!=t&&this.fromElement(t),this.options=r.apply(this.options),t&&t.is("input")){var n=i(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=s.Decorate(this.options.dataAdapter,n)}}return e.prototype.fromElement=function(e){var t=["select2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),e.data("data",e.data("select2Tags")),e.data("tags",!0)),e.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var n={};n=o.fn.jquery&&"1."==o.fn.jquery.substr(0,2)&&e[0].dataset?o.extend(!0,{},e[0].dataset,e.data()):e.data();var i=o.extend(!0,{},n);for(var r in i=s._convertData(i))-1<o.inArray(r,t)||(o.isPlainObject(this.options[r])?o.extend(this.options[r],i[r]):this.options[r]=i[r]);return this},e.prototype.get=function(e){return this.options[e]},e.prototype.set=function(e,t){this.options[e]=t},e}),e.define("select2/core",["jquery","./options","./utils","./keys"],function(r,c,n,o){var u=function(e,t){null!=e.data("select2")&&e.data("select2").destroy(),this.$element=e,this.id=this._generateId(e),t=t||{},this.options=new c(t,e),u.__super__.constructor.call(this);var n=e.attr("tabindex")||0;e.data("old-tabindex",n),e.attr("tabindex","-1");var i=this.options.get("dataAdapter");this.dataAdapter=new i(e,this.options);var r=this.render();this._placeContainer(r);var o=this.options.get("selectionAdapter");this.selection=new o(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,r);var s=this.options.get("dropdownAdapter");this.dropdown=new s(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,r);var a=this.options.get("resultsAdapter");this.results=new a(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var l=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){l.trigger("selection:update",{data:e})}),e.addClass("select2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("select2",this)};return n.Extend(u,n.Observable),u.prototype._generateId=function(e){return"select2-"+(null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},u.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},u.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"!=t)return t;var o=e.attr("style");if("string"!=typeof o)return null;for(var s=o.split(";"),a=0,l=s.length;a<l;a+=1){var c=s[a].replace(/\s/g,"").match(n);if(null!==c&&1<=c.length)return c[1]}return null},u.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},u.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.select2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this.$element.on("focus.select2",function(e){t.trigger("focus",e)}),this._syncA=n.bind(this._syncAttributes,this),this._syncS=n.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=e?(this._observer=new e(function(e){r.each(e,t._syncA),r.each(e,t._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",t._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",t._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",t._syncS,!1))},u.prototype._registerDataEvents=function(){var n=this;this.dataAdapter.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerSelectionEvents=function(){var n=this,i=["toggle","focus"];this.selection.on("toggle",function(){n.toggleDropdown()}),this.selection.on("focus",function(e){n.focus(e)}),this.selection.on("*",function(e,t){-1===r.inArray(e,i)&&n.trigger(e,t)})},u.prototype._registerDropdownEvents=function(){var n=this;this.dropdown.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerResultsEvents=function(){var n=this;this.results.on("*",function(e,t){n.trigger(e,t)})},u.prototype._registerEvents=function(){var i=this;this.on("open",function(){i.$container.addClass("select2-container--open")}),this.on("close",function(){i.$container.removeClass("select2-container--open")}),this.on("enable",function(){i.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){i.$container.addClass("select2-container--disabled")}),this.on("blur",function(){i.$container.removeClass("select2-container--focus")}),this.on("query",function(t){i.isOpen()||i.trigger("open",{}),this.dataAdapter.query(t,function(e){i.trigger("results:all",{data:e,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(e){i.trigger("results:append",{data:e,query:t})})}),this.on("open",function(){setTimeout(function(){i.focusOnActiveElement()},1)}),r(document).on("keydown",function(e){var t=e.which;if(i.isOpen()){t===o.ESC||t===o.UP&&e.altKey?(i.close(),e.preventDefault()):t===o.ENTER||t===o.TAB?(i.trigger("results:select",{}),e.preventDefault()):t===o.SPACE&&e.ctrlKey?(i.trigger("results:toggle",{}),e.preventDefault()):t===o.UP?(i.trigger("results:previous",{}),e.preventDefault()):t===o.DOWN&&(i.trigger("results:next",{}),e.preventDefault());var n=i.$dropdown.find(".select2-search__field");n.length||(n=i.$container.find(".select2-search__field")),t===o.DOWN||t===o.UP?i.focusOnActiveElement():(n.focus(),setTimeout(function(){i.focusOnActiveElement()},1e3))}else i.hasFocus()&&(t!==o.ENTER&&t!==o.SPACE&&t!==o.DOWN||(i.open(),e.preventDefault()))})},u.prototype.focusOnActiveElement=function(){this.isOpen()&&!n.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},u.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},u.prototype._syncSubtree=function(e,t){var n=!1,i=this;if(!e||!e.target||"OPTION"===e.target.nodeName||"OPTGROUP"===e.target.nodeName){if(t)if(t.addedNodes&&0<t.addedNodes.length)for(var r=0;r<t.addedNodes.length;r++){t.addedNodes[r].selected&&(n=!0)}else t.removedNodes&&0<t.removedNodes.length&&(n=!0);else n=!0;n&&this.dataAdapter.current(function(e){i.trigger("selection:update",{data:e})})}},u.prototype.trigger=function(e,t){var n=u.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(t===undefined&&(t={}),e in i){var r=i[e],o={prevented:!1,name:e,args:t};if(n.call(this,r,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},u.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},u.prototype.open=function(){this.isOpen()||this.trigger("query",{})},u.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},u.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},u.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},u.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},u.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},u.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var t=[];return this.dataAdapter.current(function(e){t=e}),t},u.prototype.val=function(e){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==e||0===e.length)return this.$element.val();var t=e[0];r.isArray(t)&&(t=r.map(t,function(e){return e.toString()})),this.$element.val(t).trigger("change")},u.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},u.prototype.render=function(){var e=r('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return e.attr("dir",this.options.get("dir")),this.$container=e,this.$container.addClass("select2-container--"+this.options.get("theme")),e.data("element",this.$element),e},u}),e.define("jquery-mousewheel",["jquery"],function(e){return e}),e.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(r,e,o,t){if(null==r.fn.selectWoo){var s=["open","close","destroy"];r.fn.selectWoo=function(t){if("object"==typeof(t=t||{}))return this.each(function(){var e=r.extend(!0,{},t);new o(r(this),e)}),this;if("string"!=typeof t)throw new Error("Invalid arguments for Select2: "+t);var n,i=Array.prototype.slice.call(arguments,1);return this.each(function(){var e=r(this).data("select2");null==e&&window.console&&console.error&&console.error("The select2('"+t+"') method was called on an element that is not using Select2."),n=e[t].apply(e,i)}),-1<r.inArray(t,s)?this:n}}return null!=r.fn.select2&&null!=r.fn.select2.defaults&&(r.fn.selectWoo.defaults=r.fn.select2.defaults),null==r.fn.selectWoo.defaults&&(r.fn.selectWoo.defaults=t),r.fn.select2=r.fn.select2||r.fn.selectWoo,o}),{define:e.define,require:e.require}}(),t=e.require("jquery.select2");return n.fn.select2.amd=e,n.fn.selectWoo.amd=e,t});
bin/post-merge.sh DELETED
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
-
3
- changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
4
-
5
- runOnChange() {
6
- echo "$changedFiles" | grep -q "$1" && eval "$2"
7
- }
8
-
9
- runOnChange "package-lock.json" "npm install"
10
- runOnChange "composer.lock" "composer install"
 
 
 
 
 
 
 
 
 
 
everest-forms.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Everest Forms
4
  * Plugin URI: https://wpeverest.com/wordpress-plugins/everest-forms/
5
  * Description: Drag and Drop contact form builder to easily create simple to complex forms for any purpose. Lightweight, Beautiful design, responsive and more.
6
- * Version: 1.6.6
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: everest-forms
3
  * Plugin Name: Everest Forms
4
  * Plugin URI: https://wpeverest.com/wordpress-plugins/everest-forms/
5
  * Description: Drag and Drop contact form builder to easily create simple to complex forms for any purpose. Lightweight, Beautiful design, responsive and more.
6
+ * Version: 1.6.6.1
7
  * Author: WPEverest
8
  * Author URI: https://wpeverest.com
9
  * Text Domain: everest-forms
includes/admin/class-evf-admin-assets.php CHANGED
@@ -82,10 +82,10 @@ class EVF_Admin_Assets {
82
  wp_register_script( 'tooltipster', evf()->plugin_url() . '/assets/js/tooltipster/tooltipster.bundle' . $suffix . '.js', array( 'jquery' ), '4.6.2', true );
83
  wp_register_script( 'perfect-scrollbar', evf()->plugin_url() . '/assets/js/perfect-scrollbar/perfect-scrollbar' . $suffix . '.js', array( 'jquery' ), '1.5.0', true );
84
  wp_register_script( 'evf-clipboard', evf()->plugin_url() . '/assets/js/admin/evf-clipboard' . $suffix . '.js', array( 'jquery' ), EVF_VERSION, true );
85
- wp_register_script( 'selectWoo', evf()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.4', true );
86
  wp_register_script( 'evf-enhanced-select', evf()->plugin_url() . '/assets/js/admin/evf-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), EVF_VERSION, true );
87
  wp_register_script( 'evf-template-controller', evf()->plugin_url() . '/assets/js/admin/form-template-controller' . $suffix . '.js', array( 'jquery' ), EVF_VERSION, true );
88
- wp_register_script( 'flatpickr', evf()->plugin_url() . '/assets/js/flatpickr/flatpickr' . $suffix . '.js', array( 'jquery' ), '4.5.1', true );
89
  wp_localize_script(
90
  'evf-template-controller',
91
  'evf_templates',
82
  wp_register_script( 'tooltipster', evf()->plugin_url() . '/assets/js/tooltipster/tooltipster.bundle' . $suffix . '.js', array( 'jquery' ), '4.6.2', true );
83
  wp_register_script( 'perfect-scrollbar', evf()->plugin_url() . '/assets/js/perfect-scrollbar/perfect-scrollbar' . $suffix . '.js', array( 'jquery' ), '1.5.0', true );
84
  wp_register_script( 'evf-clipboard', evf()->plugin_url() . '/assets/js/admin/evf-clipboard' . $suffix . '.js', array( 'jquery' ), EVF_VERSION, true );
85
+ wp_register_script( 'selectWoo', evf()->plugin_url() . '/assets/js/selectWoo/selectWoo.full' . $suffix . '.js', array( 'jquery' ), '1.0.6', true );
86
  wp_register_script( 'evf-enhanced-select', evf()->plugin_url() . '/assets/js/admin/evf-enhanced-select' . $suffix . '.js', array( 'jquery', 'selectWoo' ), EVF_VERSION, true );
87
  wp_register_script( 'evf-template-controller', evf()->plugin_url() . '/assets/js/admin/form-template-controller' . $suffix . '.js', array( 'jquery' ), EVF_VERSION, true );
88
+ wp_register_script( 'flatpickr', evf()->plugin_url() . '/assets/js/flatpickr/flatpickr' . $suffix . '.js', array( 'jquery' ), '4.6.3', true );
89
  wp_localize_script(
90
  'evf-template-controller',
91
  'evf_templates',
includes/class-everest-forms.php CHANGED
@@ -21,7 +21,7 @@ final class EverestForms {
21
  *
22
  * @var string
23
  */
24
- public $version = '1.6.6';
25
 
26
  /**
27
  * The single instance of the class.
21
  *
22
  * @var string
23
  */
24
+ public $version = '1.6.6.1';
25
 
26
  /**
27
  * The single instance of the class.
includes/class-evf-frontend-scripts.php CHANGED
@@ -159,7 +159,7 @@ class EVF_Frontend_Scripts {
159
  'flatpickr' => array(
160
  'src' => self::get_asset_url( 'assets/js/flatpickr/flatpickr' . $suffix . '.js' ),
161
  'deps' => array( 'jquery' ),
162
- 'version' => '4.5.1',
163
  ),
164
  'mailcheck' => array(
165
  'src' => self::get_asset_url( 'assets/js/mailcheck/mailcheck' . $suffix . '.js' ),
@@ -169,7 +169,7 @@ class EVF_Frontend_Scripts {
169
  'selectWoo' => array(
170
  'src' => self::get_asset_url( 'assets/js/selectWoo/selectWoo' . $suffix . '.js' ),
171
  'deps' => array( 'jquery' ),
172
- 'version' => '1.0.4',
173
  ),
174
  'jquery-validate' => array(
175
  'src' => self::get_asset_url( 'assets/js/jquery-validate/jquery.validate' . $suffix . '.js' ),
159
  'flatpickr' => array(
160
  'src' => self::get_asset_url( 'assets/js/flatpickr/flatpickr' . $suffix . '.js' ),
161
  'deps' => array( 'jquery' ),
162
+ 'version' => '4.6.3',
163
  ),
164
  'mailcheck' => array(
165
  'src' => self::get_asset_url( 'assets/js/mailcheck/mailcheck' . $suffix . '.js' ),
169
  'selectWoo' => array(
170
  'src' => self::get_asset_url( 'assets/js/selectWoo/selectWoo' . $suffix . '.js' ),
171
  'deps' => array( 'jquery' ),
172
+ 'version' => '1.0.6',
173
  ),
174
  'jquery-validate' => array(
175
  'src' => self::get_asset_url( 'assets/js/jquery-validate/jquery.validate' . $suffix . '.js' ),
includes/export/class-evf-entry-csv-exporter.php CHANGED
@@ -132,10 +132,12 @@ class EVF_Entry_CSV_Exporter extends EVF_CSV_Exporter {
132
  foreach ( $columns as $column_id => $column_name ) {
133
  $column_id = strstr( $column_id, ':' ) ? current( explode( ':', $column_id ) ) : $column_id;
134
  $value = '';
 
135
 
136
  if ( isset( $entry->meta[ $column_id ] ) ) {
137
  // Filter for entry meta data.
138
- $value = $entry->meta[ $column_id ];
 
139
 
140
  if ( is_serialized( $value ) ) {
141
  $value = $this->implode_values( maybe_unserialize( $value ) );
@@ -145,11 +147,11 @@ class EVF_Entry_CSV_Exporter extends EVF_CSV_Exporter {
145
 
146
  } elseif ( is_callable( array( $this, "get_column_value_{$column_id}" ) ) ) {
147
  // Handle special columns which don't map 1:1 to entry data.
148
- $value = $this->{"get_column_value_{$column_id}"}( $entry );
 
149
  }
150
 
151
- // Ref: https://stackoverflow.com/questions/20444042/wordpress-how-to-sanitize-multi-line-text-from-a-textarea-without-losing-line .
152
- $row[ $column_id ] = implode( "\n", array_map( 'sanitize_textarea_field', explode( "\n", $value ) ) );
153
  }
154
 
155
  return apply_filters( 'everest_forms_entry_export_row_data', $row, $entry );
132
  foreach ( $columns as $column_id => $column_name ) {
133
  $column_id = strstr( $column_id, ':' ) ? current( explode( ':', $column_id ) ) : $column_id;
134
  $value = '';
135
+ $raw_value = '';
136
 
137
  if ( isset( $entry->meta[ $column_id ] ) ) {
138
  // Filter for entry meta data.
139
+ $value = $entry->meta[ $column_id ];
140
+ $raw_value = $entry->meta[ $column_id ];
141
 
142
  if ( is_serialized( $value ) ) {
143
  $value = $this->implode_values( maybe_unserialize( $value ) );
147
 
148
  } elseif ( is_callable( array( $this, "get_column_value_{$column_id}" ) ) ) {
149
  // Handle special columns which don't map 1:1 to entry data.
150
+ $value = $this->{"get_column_value_{$column_id}"}( $entry );
151
+ $raw_value = $value;
152
  }
153
 
154
+ $row[ $column_id ] = apply_filters( 'everest_forms_format_csv_field_data', sanitize_text_field( $value ), $raw_value, $column_id, $column_name, $columns, $entry );
 
155
  }
156
 
157
  return apply_filters( 'everest_forms_entry_export_row_data', $row, $entry );
languages/everest-forms.pot DELETED
@@ -1,3918 +0,0 @@
1
- # Copyright (C) 2020 WPEverest
2
- # This file is distributed under the same license as the Everest Forms plugin.
3
- msgid ""
4
- msgstr ""
5
- "Project-Id-Version: Everest Forms 1.6.6\n"
6
- "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/everest-forms\n"
7
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
- "Language-Team: LANGUAGE <LL@li.org>\n"
9
- "MIME-Version: 1.0\n"
10
- "Content-Type: text/plain; charset=UTF-8\n"
11
- "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2020-05-01T09:06:16+00:00\n"
13
- "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
- "X-Generator: WP-CLI 2.4.0\n"
15
- "X-Domain: everest-forms\n"
16
-
17
- #. Plugin Name of the plugin
18
- #: includes/admin/class-evf-admin-menus.php:62
19
- #: includes/admin/class-evf-admin.php:189
20
- #: includes/admin/evf-admin-functions.php:17
21
- #: includes/class-evf-form-block.php:78
22
- #: includes/class-evf-post-types.php:112
23
- #: includes/class-evf-privacy.php:31
24
- msgid "Everest Forms"
25
- msgstr ""
26
-
27
- #. Plugin URI of the plugin
28
- msgid "https://wpeverest.com/wordpress-plugins/everest-forms/"
29
- msgstr ""
30
-
31
- #. Description of the plugin
32
- msgid "Drag and Drop contact form builder to easily create simple to complex forms for any purpose. Lightweight, Beautiful design, responsive and more."
33
- msgstr ""
34
-
35
- #. Author of the plugin
36
- msgid "WPEverest"
37
- msgstr ""
38
-
39
- #. Author URI of the plugin
40
- msgid "https://wpeverest.com"
41
- msgstr ""
42
-
43
- #. translators: %d: interval
44
- #: includes/abstracts/class-evf-background-process.php:172
45
- msgid "Every %d minutes"
46
- msgstr ""
47
-
48
- #: includes/abstracts/class-evf-form-fields.php:303
49
- msgid "On"
50
- msgstr ""
51
-
52
- #: includes/abstracts/class-evf-form-fields.php:303
53
- msgid "Off"
54
- msgstr ""
55
-
56
- #: includes/abstracts/class-evf-form-fields.php:388
57
- #: includes/evf-core-functions.php:1852
58
- msgid "Enter text for the form field label. This is recommended and can be hidden in the Advanced Settings."
59
- msgstr ""
60
-
61
- #: includes/abstracts/class-evf-form-fields.php:394
62
- #: includes/evf-core-functions.php:1851
63
- msgid "Label"
64
- msgstr ""
65
-
66
- #: includes/abstracts/class-evf-form-fields.php:424
67
- #: includes/evf-core-functions.php:1860
68
- msgid "Enter meta key to be stored in database."
69
- msgstr ""
70
-
71
- #: includes/abstracts/class-evf-form-fields.php:430
72
- #: includes/evf-core-functions.php:1859
73
- msgid "Meta Key"
74
- msgstr ""
75
-
76
- #: includes/abstracts/class-evf-form-fields.php:461
77
- #: includes/evf-core-functions.php:1869
78
- msgid "Enter text for the form field description."
79
- msgstr ""
80
-
81
- #: includes/abstracts/class-evf-form-fields.php:467
82
- #: includes/evf-core-functions.php:1867
83
- msgid "Description"
84
- msgstr ""
85
-
86
- #: includes/abstracts/class-evf-form-fields.php:498
87
- msgid "Check this option to mark the field required. A form will not submit unless all required fields are provided."
88
- msgstr ""
89
-
90
- #: includes/abstracts/class-evf-form-fields.php:505
91
- #: includes/admin/settings/class-evf-settings-validation.php:46
92
- #: includes/evf-core-functions.php:1875
93
- #: includes/shortcodes/class-evf-shortcode-form.php:187
94
- msgid "Required"
95
- msgstr ""
96
-
97
- #: includes/abstracts/class-evf-form-fields.php:541
98
- msgid "Enter a message to show for this row if it's required."
99
- msgstr ""
100
-
101
- #: includes/abstracts/class-evf-form-fields.php:553
102
- msgid "Address Line 1"
103
- msgstr ""
104
-
105
- #: includes/abstracts/class-evf-form-fields.php:554
106
- msgid "Enter a message to show for Address Line 1 if it's required."
107
- msgstr ""
108
-
109
- #: includes/abstracts/class-evf-form-fields.php:562
110
- msgid "City"
111
- msgstr ""
112
-
113
- #: includes/abstracts/class-evf-form-fields.php:563
114
- msgid "Enter a message to show for City if it's required."
115
- msgstr ""
116
-
117
- #: includes/abstracts/class-evf-form-fields.php:571
118
- msgid "State / Province / Region"
119
- msgstr ""
120
-
121
- #: includes/abstracts/class-evf-form-fields.php:572
122
- msgid "Enter a message to show for State/Province/Region if it's required."
123
- msgstr ""
124
-
125
- #: includes/abstracts/class-evf-form-fields.php:580
126
- msgid "Zip / Postal Code"
127
- msgstr ""
128
-
129
- #: includes/abstracts/class-evf-form-fields.php:581
130
- msgid "Enter a message to show for Zip/Postal Code if it's required."
131
- msgstr ""
132
-
133
- #: includes/abstracts/class-evf-form-fields.php:589
134
- #: includes/fields/class-evf-field-country.php:20
135
- msgid "Country"
136
- msgstr ""
137
-
138
- #: includes/abstracts/class-evf-form-fields.php:590
139
- msgid "Enter a message to show for Country if it's required."
140
- msgstr ""
141
-
142
- #: includes/abstracts/class-evf-form-fields.php:603
143
- #: includes/abstracts/class-evf-form-fields.php:648
144
- msgid "Enter a message to show for this field if it's required."
145
- msgstr ""
146
-
147
- #: includes/abstracts/class-evf-form-fields.php:654
148
- msgid "Required Field Message"
149
- msgstr ""
150
-
151
- #: includes/abstracts/class-evf-form-fields.php:686
152
- msgid "Enter code for the form field."
153
- msgstr ""
154
-
155
- #: includes/abstracts/class-evf-form-fields.php:692
156
- msgid "Code"
157
- msgstr ""
158
-
159
- #: includes/abstracts/class-evf-form-fields.php:722
160
- #: includes/evf-core-functions.php:1883
161
- msgid "Choices"
162
- msgstr ""
163
-
164
- #: includes/abstracts/class-evf-form-fields.php:740
165
- #: includes/evf-core-functions.php:1884
166
- msgid "Add choices for the form field."
167
- msgstr ""
168
-
169
- #: includes/abstracts/class-evf-form-fields.php:778
170
- msgid "Upload Image"
171
- msgstr ""
172
-
173
- #: includes/abstracts/class-evf-form-fields.php:785
174
- #: includes/admin/builder/class-evf-builder-settings.php:104
175
- msgid "Remove"
176
- msgstr ""
177
-
178
- #: includes/abstracts/class-evf-form-fields.php:786
179
- msgid "Change image"
180
- msgstr ""
181
-
182
- #: includes/abstracts/class-evf-form-fields.php:812
183
- msgid "For best results, images should be square and at least 200 × 160 pixels or smaller."
184
- msgstr ""
185
-
186
- #: includes/abstracts/class-evf-form-fields.php:821
187
- msgid "Use image choices"
188
- msgstr ""
189
-
190
- #: includes/abstracts/class-evf-form-fields.php:822
191
- msgid "Check this option to enable using images with the choices."
192
- msgstr ""
193
-
194
- #: includes/abstracts/class-evf-form-fields.php:848
195
- msgid "Enter text for the default form field value."
196
- msgstr ""
197
-
198
- #: includes/abstracts/class-evf-form-fields.php:855
199
- msgid "Default Value"
200
- msgstr ""
201
-
202
- #: includes/abstracts/class-evf-form-fields.php:901
203
- msgid "Advanced Options"
204
- msgstr ""
205
-
206
- #: includes/abstracts/class-evf-form-fields.php:913
207
- #: includes/evf-core-functions.php:1896
208
- msgid "Enter text for the form field placeholder."
209
- msgstr ""
210
-
211
- #: includes/abstracts/class-evf-form-fields.php:919
212
- #: includes/evf-core-functions.php:1895
213
- msgid "Placeholder Text"
214
- msgstr ""
215
-
216
- #: includes/abstracts/class-evf-form-fields.php:949
217
- msgid "Enter CSS class names for this field container. Multiple class names should be separated with spaces."
218
- msgstr ""
219
-
220
- #: includes/abstracts/class-evf-form-fields.php:958
221
- #: includes/evf-core-functions.php:1903
222
- msgid "CSS Classes"
223
- msgstr ""
224
-
225
- #: includes/abstracts/class-evf-form-fields.php:989
226
- #: includes/evf-core-functions.php:1913
227
- msgid "Check this option to hide the form field label."
228
- msgstr ""
229
-
230
- #: includes/abstracts/class-evf-form-fields.php:998
231
- #: includes/evf-core-functions.php:1911
232
- msgid "Hide Label"
233
- msgstr ""
234
-
235
- #: includes/abstracts/class-evf-form-fields.php:1019
236
- #: includes/evf-core-functions.php:1921
237
- msgid "Check this option to hide the form field sub-label."
238
- msgstr ""
239
-
240
- #: includes/abstracts/class-evf-form-fields.php:1028
241
- #: includes/evf-core-functions.php:1919
242
- msgid "Hide Sub-Labels"
243
- msgstr ""
244
-
245
- #: includes/abstracts/class-evf-form-fields.php:1049
246
- msgid "Select the column layout for displaying field choices."
247
- msgstr ""
248
-
249
- #: includes/abstracts/class-evf-form-fields.php:1051
250
- msgid "One Column"
251
- msgstr ""
252
-
253
- #: includes/abstracts/class-evf-form-fields.php:1052
254
- msgid "Two Columns"
255
- msgstr ""
256
-
257
- #: includes/abstracts/class-evf-form-fields.php:1053
258
- msgid "Three Columns"
259
- msgstr ""
260
-
261
- #: includes/abstracts/class-evf-form-fields.php:1054
262
- msgid "Inline"
263
- msgstr ""
264
-
265
- #: includes/abstracts/class-evf-form-fields.php:1063
266
- msgid "Layout"
267
- msgstr ""
268
-
269
- #: includes/abstracts/class-evf-form-fields.php:1164
270
- #: includes/class-evf-emails.php:434
271
- #: includes/class-evf-emails.php:539
272
- msgid "(empty)"
273
- msgstr ""
274
-
275
- #: includes/abstracts/class-evf-form-fields.php:1269
276
- msgid "You do no have permission."
277
- msgstr ""
278
-
279
- #: includes/abstracts/class-evf-form-fields.php:1274
280
- msgid "No form ID found"
281
- msgstr ""
282
-
283
- #: includes/abstracts/class-evf-form-fields.php:1279
284
- msgid "No field type found"
285
- msgstr ""
286
-
287
- #: includes/abstracts/class-evf-form-fields.php:1308
288
- #: includes/admin/builder/class-evf-builder-fields.php:317
289
- msgid "Duplicate Field"
290
- msgstr ""
291
-
292
- #: includes/abstracts/class-evf-form-fields.php:1309
293
- #: includes/admin/builder/class-evf-builder-fields.php:318
294
- msgid "Delete Field"
295
- msgstr ""
296
-
297
- #: includes/abstracts/class-evf-form-fields.php:1310
298
- #: includes/admin/builder/class-evf-builder-fields.php:319
299
- #: includes/admin/builder/class-evf-builder-settings.php:25
300
- #: includes/admin/class-evf-admin-menus.php:165
301
- #: includes/class-evf-install.php:637
302
- msgid "Settings"
303
- msgstr ""
304
-
305
- #: includes/abstracts/class-evf-form-fields.php:1426
306
- msgid "Please enter a valid url"
307
- msgstr ""
308
-
309
- #: includes/abstracts/class-evf-form-fields.php:1436
310
- msgid "Please enter a valid email address"
311
- msgstr ""
312
-
313
- #: includes/abstracts/class-evf-form-fields.php:1441
314
- msgid "Please enter a valid number"
315
- msgstr ""
316
-
317
- #: includes/abstracts/class-evf-settings-api.php:674
318
- msgid "Select all"
319
- msgstr ""
320
-
321
- #: includes/abstracts/class-evf-settings-api.php:674
322
- msgid "Select none"
323
- msgstr ""
324
-
325
- #: includes/admin/builder/class-evf-builder-fields.php:38
326
- msgid "Fields"
327
- msgstr ""
328
-
329
- #: includes/admin/builder/class-evf-builder-fields.php:61
330
- msgid "Add Fields"
331
- msgstr ""
332
-
333
- #: includes/admin/builder/class-evf-builder-fields.php:62
334
- msgid "Field Options"
335
- msgstr ""
336
-
337
- #: includes/admin/builder/class-evf-builder-fields.php:85
338
- msgid "Form not found."
339
- msgstr ""
340
-
341
- #: includes/admin/builder/class-evf-builder-fields.php:154
342
- msgid "You don't have any fields yet."
343
- msgstr ""
344
-
345
- #: includes/admin/builder/class-evf-builder-fields.php:237
346
- msgid "Row Settings"
347
- msgstr ""
348
-
349
- #: includes/admin/builder/class-evf-builder-fields.php:238
350
- msgid "Select the type of row"
351
- msgstr ""
352
-
353
- #: includes/admin/builder/class-evf-builder-fields.php:296
354
- msgid "Add Row"
355
- msgstr ""
356
-
357
- #: includes/admin/builder/class-evf-builder-settings.php:40
358
- #: includes/admin/builder/class-evf-builder-settings.php:128
359
- #: includes/admin/settings/class-evf-settings-general.php:25
360
- msgid "General"
361
- msgstr ""
362
-
363
- #: includes/admin/builder/class-evf-builder-settings.php:41
364
- #: includes/admin/builder/class-evf-builder-settings.php:379
365
- #: includes/admin/settings/class-evf-settings-email.php:25
366
- #: includes/admin/settings/class-evf-settings-validation.php:64
367
- #: includes/fields/class-evf-field-email.php:20
368
- #: includes/fields/class-evf-field-email.php:93
369
- #: includes/fields/class-evf-field-email.php:265
370
- msgid "Email"
371
- msgstr ""
372
-
373
- #: includes/admin/builder/class-evf-builder-settings.php:77
374
- #: includes/admin/builder/class-evf-builder-settings.php:349
375
- #: includes/admin/builder/class-evf-builder-settings.php:405
376
- #: includes/class-evf-form-task.php:557
377
- #: includes/evf-update-functions.php:140
378
- #: includes/templates/contact.php:71
379
- msgid "Admin Notification"
380
- msgstr ""
381
-
382
- #: includes/admin/builder/class-evf-builder-settings.php:85
383
- msgid "Add New Email"
384
- msgstr ""
385
-
386
- #: includes/admin/builder/class-evf-builder-settings.php:89
387
- msgid "Email Notifications"
388
- msgstr ""
389
-
390
- #: includes/admin/builder/class-evf-builder-settings.php:135
391
- #: includes/class-evf-smart-tags.php:37
392
- msgid "Form Name"
393
- msgstr ""
394
-
395
- #: includes/admin/builder/class-evf-builder-settings.php:138
396
- msgid "Give a name to this form"
397
- msgstr ""
398
-
399
- #: includes/admin/builder/class-evf-builder-settings.php:146
400
- msgid "Form description"
401
- msgstr ""
402
-
403
- #: includes/admin/builder/class-evf-builder-settings.php:150
404
- msgid "Give the description to this form"
405
- msgstr ""
406
-
407
- #: includes/admin/builder/class-evf-builder-settings.php:158
408
- msgid "Form disabled message"
409
- msgstr ""
410
-
411
- #: includes/admin/builder/class-evf-builder-settings.php:161
412
- #: includes/shortcodes/class-evf-shortcode-form.php:743
413
- msgid "This form is disabled."
414
- msgstr ""
415
-
416
- #: includes/admin/builder/class-evf-builder-settings.php:162
417
- msgid "Message that shows up if the form is disabled."
418
- msgstr ""
419
-
420
- #: includes/admin/builder/class-evf-builder-settings.php:170
421
- msgid "Successful form submission message"
422
- msgstr ""
423
-
424
- #: includes/admin/builder/class-evf-builder-settings.php:173
425
- msgid "Thanks for contacting us! We will be in touch with you shortly"
426
- msgstr ""
427
-
428
- #. translators: %1$s - general settings docs url
429
- #: includes/admin/builder/class-evf-builder-settings.php:175
430
- msgid "Success message that shows up after submitting form. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
431
- msgstr ""
432
-
433
- #: includes/admin/builder/class-evf-builder-settings.php:183
434
- msgid "Automatically scroll to the submission message"
435
- msgstr ""
436
-
437
- #: includes/admin/builder/class-evf-builder-settings.php:193
438
- msgid "Redirect To"
439
- msgstr ""
440
-
441
- #. translators: %1$s - general settings docs url
442
- #: includes/admin/builder/class-evf-builder-settings.php:197
443
- msgid "Choose where to redirect after form submission. <a href=\"%s\" target=\"_blank\">Learn More</a>"
444
- msgstr ""
445
-
446
- #: includes/admin/builder/class-evf-builder-settings.php:199
447
- msgid "Same Page"
448
- msgstr ""
449
-
450
- #: includes/admin/builder/class-evf-builder-settings.php:200
451
- #: includes/admin/builder/class-evf-builder-settings.php:210
452
- msgid "Custom Page"
453
- msgstr ""
454
-
455
- #: includes/admin/builder/class-evf-builder-settings.php:201
456
- #: includes/admin/builder/class-evf-builder-settings.php:221
457
- msgid "External URL"
458
- msgstr ""
459
-
460
- #: includes/admin/builder/class-evf-builder-settings.php:231
461
- msgid "Layout Design"
462
- msgstr ""
463
-
464
- #: includes/admin/builder/class-evf-builder-settings.php:234
465
- msgid "Choose design template for the Form"
466
- msgstr ""
467
-
468
- #: includes/admin/builder/class-evf-builder-settings.php:236
469
- msgid "Default"
470
- msgstr ""
471
-
472
- #: includes/admin/builder/class-evf-builder-settings.php:237
473
- msgid "Classic Layout"
474
- msgstr ""
475
-
476
- #: includes/admin/builder/class-evf-builder-settings.php:246
477
- msgid "Form Class"
478
- msgstr ""
479
-
480
- #. translators: %1$s - general settings docs url
481
- #: includes/admin/builder/class-evf-builder-settings.php:250
482
- msgid "Enter CSS class names for the form wrapper. Multiple class names should be separated with spaces. <a href=\"%s\" target=\"_blank\">Learn More</a>"
483
- msgstr ""
484
-
485
- #: includes/admin/builder/class-evf-builder-settings.php:253
486
- msgid "Submit Button"
487
- msgstr ""
488
-
489
- #: includes/admin/builder/class-evf-builder-settings.php:259
490
- msgid "Submit button text"
491
- msgstr ""
492
-
493
- #: includes/admin/builder/class-evf-builder-settings.php:261
494
- #: includes/class-evf-frontend-scripts.php:282
495
- #: includes/class-evf-frontend-scripts.php:309
496
- #: includes/shortcodes/class-evf-shortcode-form.php:60
497
- #: includes/templates/contact.php:67
498
- msgid "Submit"
499
- msgstr ""
500
-
501
- #: includes/admin/builder/class-evf-builder-settings.php:262
502
- msgid "Enter desired text for submit button."
503
- msgstr ""
504
-
505
- #: includes/admin/builder/class-evf-builder-settings.php:270
506
- msgid "Submit button processing text"
507
- msgstr ""
508
-
509
- #: includes/admin/builder/class-evf-builder-settings.php:272
510
- #: includes/shortcodes/class-evf-shortcode-form.php:72
511
- msgid "Processing&hellip;"
512
- msgstr ""
513
-
514
- #: includes/admin/builder/class-evf-builder-settings.php:273
515
- msgid "Enter the submit button text that you would like the button to display while the form submission is processing."
516
- msgstr ""
517
-
518
- #: includes/admin/builder/class-evf-builder-settings.php:281
519
- msgid "Submit button class"
520
- msgstr ""
521
-
522
- #: includes/admin/builder/class-evf-builder-settings.php:284
523
- msgid "Enter CSS class names for submit button. Multiple class names should be separated with spaces."
524
- msgstr ""
525
-
526
- #: includes/admin/builder/class-evf-builder-settings.php:294
527
- msgid "Enable anti-spam honeypot"
528
- msgstr ""
529
-
530
- #: includes/admin/builder/class-evf-builder-settings.php:308
531
- msgid "Enable Google reCAPTCHA v3"
532
- msgstr ""
533
-
534
- #: includes/admin/builder/class-evf-builder-settings.php:308
535
- msgid "Enable Google Invisible reCAPTCHA v2"
536
- msgstr ""
537
-
538
- #: includes/admin/builder/class-evf-builder-settings.php:308
539
- msgid "Enable Google Checkbox reCAPTCHA v2"
540
- msgstr ""
541
-
542
- #. translators: %1$s - general settings docs url
543
- #: includes/admin/builder/class-evf-builder-settings.php:312
544
- msgid "Enable Google reCaptcha. Make sure the site key and secret key is set in settings page. <a href=\"%s\" target=\"_blank\">Learn More</a>"
545
- msgstr ""
546
-
547
- #: includes/admin/builder/class-evf-builder-settings.php:321
548
- msgid "Enable Ajax Form Submission"
549
- msgstr ""
550
-
551
- #: includes/admin/builder/class-evf-builder-settings.php:324
552
- msgid "Enables form submission without reloading the page."
553
- msgstr ""
554
-
555
- #: includes/admin/builder/class-evf-builder-settings.php:332
556
- msgid "Disable storing entry information"
557
- msgstr ""
558
-
559
- #. translators: %1$s - general settings docs url
560
- #: includes/admin/builder/class-evf-builder-settings.php:336
561
- msgid "Disable storing form entries. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
562
- msgstr ""
563
-
564
- #. translators: %s: Form Name
565
- #: includes/admin/builder/class-evf-builder-settings.php:355
566
- #: includes/admin/builder/class-evf-builder-settings.php:528
567
- #: includes/templates/contact.php:77
568
- msgid "New Form Entry %s"
569
- msgstr ""
570
-
571
- #: includes/admin/builder/class-evf-builder-settings.php:366
572
- #: includes/evf-update-functions.php:156
573
- msgid "User Notification"
574
- msgstr ""
575
-
576
- #: includes/admin/builder/class-evf-builder-settings.php:391
577
- #: includes/admin/class-evf-admin-assets.php:148
578
- msgid "Turn on Email settings to manage your email notifications."
579
- msgstr ""
580
-
581
- #: includes/admin/builder/class-evf-builder-settings.php:417
582
- msgid "To Address"
583
- msgstr ""
584
-
585
- #. translators: %1$s - general settings docs url
586
- #: includes/admin/builder/class-evf-builder-settings.php:421
587
- msgid "Enter the recipient's email address (comma separated) to receive form entry notifications. <a href=\"%s\" target=\"_blank\">Learn More</a>"
588
- msgstr ""
589
-
590
- #: includes/admin/builder/class-evf-builder-settings.php:436
591
- msgid "Cc Address"
592
- msgstr ""
593
-
594
- #: includes/admin/builder/class-evf-builder-settings.php:439
595
- msgid "Enter Cc recipient's email address (comma separated) to receive form entry notifications."
596
- msgstr ""
597
-
598
- #: includes/admin/builder/class-evf-builder-settings.php:453
599
- msgid "Bcc Address"
600
- msgstr ""
601
-
602
- #: includes/admin/builder/class-evf-builder-settings.php:456
603
- msgid "Enter Bcc recipient's email address (comma separated) to receive form entry notifications."
604
- msgstr ""
605
-
606
- #: includes/admin/builder/class-evf-builder-settings.php:471
607
- msgid "From Name"
608
- msgstr ""
609
-
610
- #. translators: %1$s - general settings docs url
611
- #: includes/admin/builder/class-evf-builder-settings.php:475
612
- msgid "Enter the From Name to be displayed in Email. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
613
- msgstr ""
614
-
615
- #: includes/admin/builder/class-evf-builder-settings.php:489
616
- msgid "From Address"
617
- msgstr ""
618
-
619
- #. translators: %1$s - general settings docs url
620
- #: includes/admin/builder/class-evf-builder-settings.php:493
621
- msgid "Enter the Email address from which you want to send Email. <a href=\"%s\" target=\"_blank\">Learn More</a>"
622
- msgstr ""
623
-
624
- #: includes/admin/builder/class-evf-builder-settings.php:507
625
- msgid "Reply To"
626
- msgstr ""
627
-
628
- #. translators: %1$s - general settings docs url
629
- #: includes/admin/builder/class-evf-builder-settings.php:511
630
- msgid "Enter the reply to email address where you want the email to be received when this email is replied. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
631
- msgstr ""
632
-
633
- #: includes/admin/builder/class-evf-builder-settings.php:525
634
- msgid "Email Subject"
635
- msgstr ""
636
-
637
- #. translators: %1$s - General Settings docs url
638
- #: includes/admin/builder/class-evf-builder-settings.php:530
639
- msgid "Enter the subject of the email. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
640
- msgstr ""
641
-
642
- #: includes/admin/builder/class-evf-builder-settings.php:544
643
- msgid "Email Message"
644
- msgstr ""
645
-
646
- #: includes/admin/builder/class-evf-builder-settings.php:546
647
- msgid "{all_fields}"
648
- msgstr ""
649
-
650
- #. translators: %1$s - general settings docs url
651
- #: includes/admin/builder/class-evf-builder-settings.php:548
652
- msgid "Enter the message of the email. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
653
- msgstr ""
654
-
655
- #. translators: %s - all fields smart tag.
656
- #: includes/admin/builder/class-evf-builder-settings.php:556
657
- msgid "To display all form fields, use the %s Smart Tag."
658
- msgstr ""
659
-
660
- #: includes/admin/class-evf-admin-assets.php:94
661
- #: includes/admin/views/html-admin-page-builder-setup.php:80
662
- msgid "Get Started"
663
- msgstr ""
664
-
665
- #: includes/admin/class-evf-admin-assets.php:95
666
- #: includes/admin/class-evf-admin-forms-table-list.php:142
667
- #: includes/admin/views/html-admin-page-builder-setup.php:81
668
- #: includes/admin/views/html-admin-page-builder.php:55
669
- msgid "Preview"
670
- msgstr ""
671
-
672
- #: includes/admin/class-evf-admin-assets.php:96
673
- #: includes/admin/views/html-admin-page-builder-setup.php:57
674
- msgid "Pro"
675
- msgstr ""
676
-
677
- #: includes/admin/class-evf-admin-assets.php:97
678
- msgid "Updating Templates"
679
- msgstr ""
680
-
681
- #: includes/admin/class-evf-admin-assets.php:104
682
- #: includes/class-evf-frontend-scripts.php:293
683
- msgctxt "enhanced select"
684
- msgid "No matches found"
685
- msgstr ""
686
-
687
- #: includes/admin/class-evf-admin-assets.php:105
688
- msgctxt "enhanced select"
689
- msgid "Loading failed"
690
- msgstr ""
691
-
692
- #: includes/admin/class-evf-admin-assets.php:106
693
- msgctxt "enhanced select"
694
- msgid "Please enter 1 or more characters"
695
- msgstr ""
696
-
697
- #: includes/admin/class-evf-admin-assets.php:107
698
- msgctxt "enhanced select"
699
- msgid "Please enter %qty% or more characters"
700
- msgstr ""
701
-
702
- #: includes/admin/class-evf-admin-assets.php:108
703
- msgctxt "enhanced select"
704
- msgid "Please delete 1 character"
705
- msgstr ""
706
-
707
- #: includes/admin/class-evf-admin-assets.php:109
708
- msgctxt "enhanced select"
709
- msgid "Please delete %qty% characters"
710
- msgstr ""
711
-
712
- #: includes/admin/class-evf-admin-assets.php:110
713
- msgctxt "enhanced select"
714
- msgid "You can only select 1 item"
715
- msgstr ""
716
-
717
- #: includes/admin/class-evf-admin-assets.php:111
718
- msgctxt "enhanced select"
719
- msgid "You can only select %qty% items"
720
- msgstr ""
721
-
722
- #: includes/admin/class-evf-admin-assets.php:112
723
- msgctxt "enhanced select"
724
- msgid "Loading more results&hellip;"
725
- msgstr ""
726
-
727
- #: includes/admin/class-evf-admin-assets.php:113
728
- msgctxt "enhanced select"
729
- msgid "Searching&hellip;"
730
- msgstr ""
731
-
732
- #: includes/admin/class-evf-admin-assets.php:131
733
- msgid "field"
734
- msgstr ""
735
-
736
- #: includes/admin/class-evf-admin-assets.php:132
737
- #: includes/admin/class-evf-admin-assets.php:191
738
- msgid "OK"
739
- msgstr ""
740
-
741
- #: includes/admin/class-evf-admin-assets.php:133
742
- msgid "Installing"
743
- msgstr ""
744
-
745
- #: includes/admin/class-evf-admin-assets.php:134
746
- msgid "Activating"
747
- msgstr ""
748
-
749
- #: includes/admin/class-evf-admin-assets.php:135
750
- msgid "Install & Activate"
751
- msgstr ""
752
-
753
- #: includes/admin/class-evf-admin-assets.php:136
754
- msgid "Activate Plugins"
755
- msgstr ""
756
-
757
- #: includes/admin/class-evf-admin-assets.php:137
758
- msgid "(copy)"
759
- msgstr ""
760
-
761
- #: includes/admin/class-evf-admin-assets.php:138
762
- #: includes/admin/class-evf-admin-editor.php:63
763
- msgid "Close"
764
- msgstr ""
765
-
766
- #: includes/admin/class-evf-admin-assets.php:139
767
- #: includes/admin/class-evf-admin-assets.php:194
768
- #: includes/admin/class-evf-admin-editor.php:98
769
- msgid "Cancel"
770
- msgstr ""
771
-
772
- #: includes/admin/class-evf-admin-assets.php:140
773
- msgid "Row Locked"
774
- msgstr ""
775
-
776
- #: includes/admin/class-evf-admin-assets.php:141
777
- msgid "Single row cannot be deleted."
778
- msgstr ""
779
-
780
- #: includes/admin/class-evf-admin-assets.php:142
781
- msgid "Field Locked"
782
- msgstr ""
783
-
784
- #: includes/admin/class-evf-admin-assets.php:143
785
- msgid "This field cannot be deleted or duplicated."
786
- msgstr ""
787
-
788
- #: includes/admin/class-evf-admin-assets.php:144
789
- msgid "This item must contain at least one choice."
790
- msgstr ""
791
-
792
- #: includes/admin/class-evf-admin-assets.php:145
793
- msgid "Are you sure you want to delete this row?"
794
- msgstr ""
795
-
796
- #: includes/admin/class-evf-admin-assets.php:146
797
- msgid "Are you sure you want to delete this field?"
798
- msgstr ""
799
-
800
- #: includes/admin/class-evf-admin-assets.php:147
801
- msgid "Are you sure you want to duplicate this field?"
802
- msgstr ""
803
-
804
- #: includes/admin/class-evf-admin-assets.php:149
805
- msgid "Choose an image"
806
- msgstr ""
807
-
808
- #: includes/admin/class-evf-admin-assets.php:150
809
- msgid "Use Image"
810
- msgstr ""
811
-
812
- #: includes/admin/class-evf-admin-assets.php:151
813
- msgid "Remove Image"
814
- msgstr ""
815
-
816
- #: includes/admin/class-evf-admin-assets.php:152
817
- msgid "Empty Form Name"
818
- msgstr ""
819
-
820
- #: includes/admin/class-evf-admin-assets.php:153
821
- msgid "Form name can't be empty."
822
- msgstr ""
823
-
824
- #: includes/admin/class-evf-admin-assets.php:167
825
- msgid "is a PRO Feature"
826
- msgstr ""
827
-
828
- #: includes/admin/class-evf-admin-assets.php:168
829
- msgid "We're sorry, the %name% is not available on your plan.<br>Please upgrade to the PRO plan to unlock all these awesome features."
830
- msgstr ""
831
-
832
- #: includes/admin/class-evf-admin-assets.php:169
833
- msgid "Upgrade to PRO"
834
- msgstr ""
835
-
836
- #: includes/admin/class-evf-admin-assets.php:171
837
- msgid "Please enable Stripe"
838
- msgstr ""
839
-
840
- #: includes/admin/class-evf-admin-assets.php:172
841
- msgid "Enable Stripe Payment gateway in payments section to use this field."
842
- msgstr ""
843
-
844
- #: includes/admin/class-evf-admin-assets.php:188
845
- msgid "Enter a Email nickname"
846
- msgstr ""
847
-
848
- #: includes/admin/class-evf-admin-assets.php:189
849
- msgid "Eg: Support Email"
850
- msgstr ""
851
-
852
- #: includes/admin/class-evf-admin-assets.php:190
853
- msgid "You must provide a Email nickname"
854
- msgstr ""
855
-
856
- #: includes/admin/class-evf-admin-assets.php:197
857
- msgid "New Form Entry"
858
- msgstr ""
859
-
860
- #: includes/admin/class-evf-admin-assets.php:207
861
- msgid "Please enter in meta key with alphanumeric characters, dashes and underscores."
862
- msgstr ""
863
-
864
- #: includes/admin/class-evf-admin-assets.php:208
865
- msgid "Minimum value is greater than Maximum value."
866
- msgstr ""
867
-
868
- #: includes/admin/class-evf-admin-assets.php:209
869
- msgid "Maximum value is smaller than Minimum value."
870
- msgstr ""
871
-
872
- #: includes/admin/class-evf-admin-assets.php:210
873
- msgid "Please select a form which you want to export."
874
- msgstr ""
875
-
876
- #: includes/admin/class-evf-admin-assets.php:232
877
- msgid "Give it a name."
878
- msgstr ""
879
-
880
- #: includes/admin/class-evf-admin-assets.php:233
881
- msgid "You must provide a Form name"
882
- msgstr ""
883
-
884
- #: includes/admin/class-evf-admin-assets.php:235
885
- #: includes/admin/views/html-admin-page-addons.php:133
886
- msgid "Upgrade Plan"
887
- msgstr ""
888
-
889
- #: includes/admin/class-evf-admin-assets.php:236
890
- msgid "This template requires premium addons. Please upgrade to the Premium plan to unlock all these awesome Templates."
891
- msgstr ""
892
-
893
- #: includes/admin/class-evf-admin-assets.php:237
894
- msgid "is a Premium Template"
895
- msgstr ""
896
-
897
- #: includes/admin/class-evf-admin-assets.php:238
898
- msgid "Continue"
899
- msgstr ""
900
-
901
- #: includes/admin/class-evf-admin-assets.php:239
902
- msgid "Untitled Form"
903
- msgstr ""
904
-
905
- #: includes/admin/class-evf-admin-assets.php:240
906
- msgid "Uplift your form experience to the next level."
907
- msgstr ""
908
-
909
- #: includes/admin/class-evf-admin-assets.php:254
910
- msgid "Are you sure you want to delete this log?"
911
- msgstr ""
912
-
913
- #: includes/admin/class-evf-admin-editor.php:42
914
- msgid "Add Everest Form"
915
- msgstr ""
916
-
917
- #: includes/admin/class-evf-admin-editor.php:44
918
- #: includes/admin/class-evf-admin-editor.php:102
919
- msgid "Add Form"
920
- msgstr ""
921
-
922
- #: includes/admin/class-evf-admin-editor.php:62
923
- msgid "Insert Form"
924
- msgstr ""
925
-
926
- #: includes/admin/class-evf-admin-editor.php:71
927
- msgid "Select a form below to insert"
928
- msgstr ""
929
-
930
- #. translators: %s - Everest Builder page.
931
- #: includes/admin/class-evf-admin-editor.php:82
932
- msgid "Whoops, you haven't created a form yet. Want to <a href=\"%s\">give it a go</a>?"
933
- msgstr ""
934
-
935
- #: includes/admin/class-evf-admin-entries-table-list.php:94
936
- #: includes/admin/class-evf-admin-entries.php:83
937
- msgid "Whoops, it appears you do not have any form entries yet."
938
- msgstr ""
939
-
940
- #: includes/admin/class-evf-admin-entries-table-list.php:106
941
- #: includes/export/class-evf-entry-csv-exporter.php:80
942
- msgid "Date Created"
943
- msgstr ""
944
-
945
- #: includes/admin/class-evf-admin-entries-table-list.php:107
946
- msgid "Actions"
947
- msgstr ""
948
-
949
- #: includes/admin/class-evf-admin-entries-table-list.php:175
950
- #: includes/admin/class-evf-admin-entries-table-list.php:186
951
- msgid "Field"
952
- msgstr ""
953
-
954
- #: includes/admin/class-evf-admin-entries-table-list.php:297
955
- #: includes/admin/views/html-admin-page-entries-view.php:196
956
- #: includes/admin/views/html-admin-page-tools-logs.php:33
957
- msgid "View"
958
- msgstr ""
959
-
960
- #. translators: %s: entry name
961
- #: includes/admin/class-evf-admin-entries-table-list.php:299
962
- msgid "Trash form entry"
963
- msgstr ""
964
-
965
- #: includes/admin/class-evf-admin-entries-table-list.php:310
966
- #: includes/admin/class-evf-admin-forms-table-list.php:124
967
- #: includes/evf-entry-functions.php:81
968
- msgid "Trash"
969
- msgstr ""
970
-
971
- #: includes/admin/class-evf-admin-entries-table-list.php:314
972
- msgid "Restore form entry from trash"
973
- msgstr ""
974
-
975
- #: includes/admin/class-evf-admin-entries-table-list.php:325
976
- #: includes/admin/class-evf-admin-entries-table-list.php:413
977
- #: includes/admin/class-evf-admin-forms-table-list.php:122
978
- #: includes/admin/class-evf-admin-forms-table-list.php:363
979
- msgid "Restore"
980
- msgstr ""
981
-
982
- #: includes/admin/class-evf-admin-entries-table-list.php:326
983
- msgid "Delete form entry permanently"
984
- msgstr ""
985
-
986
- #: includes/admin/class-evf-admin-entries-table-list.php:337
987
- #: includes/admin/class-evf-admin-entries-table-list.php:414
988
- msgid "Delete Permanently"
989
- msgstr ""
990
-
991
- #. translators: %s: count
992
- #: includes/admin/class-evf-admin-entries-table-list.php:384
993
- msgctxt "entries"
994
- msgid "All <span class=\"count\">(%s)</span>"
995
- msgid_plural "All <span class=\"count\">(%s)</span>"
996
- msgstr[0] ""
997
- msgstr[1] ""
998
-
999
- #: includes/admin/class-evf-admin-entries-table-list.php:418
1000
- msgid "Move to Trash"
1001
- msgstr ""
1002
-
1003
- #. translators: %d: number of entries, %s: entries status
1004
- #: includes/admin/class-evf-admin-entries-table-list.php:463
1005
- msgid "%1$d entry successfully %2$s."
1006
- msgid_plural "%1$d entries successfully %2$s."
1007
- msgstr[0] ""
1008
- msgstr[1] ""
1009
-
1010
- #. translators: %d: number of entries, %s: entries status
1011
- #: includes/admin/class-evf-admin-entries-table-list.php:479
1012
- msgid "%1$d entry successfully marked as %2$s."
1013
- msgid_plural "%1$d entries successfully marked as %2$s."
1014
- msgstr[0] ""
1015
- msgstr[1] ""
1016
-
1017
- #. translators: %d: number of entries
1018
- #: includes/admin/class-evf-admin-entries-table-list.php:494
1019
- msgid "%d entry moved to the Trash."
1020
- msgid_plural "%d entries moved to the Trash."
1021
- msgstr[0] ""
1022
- msgstr[1] ""
1023
-
1024
- #. translators: %d: number of entries
1025
- #: includes/admin/class-evf-admin-entries-table-list.php:509
1026
- msgid "%d entry restored from the Trash."
1027
- msgid_plural "%d entries restored from the Trash."
1028
- msgstr[0] ""
1029
- msgstr[1] ""
1030
-
1031
- #. translators: %d: number of entries
1032
- #: includes/admin/class-evf-admin-entries-table-list.php:524
1033
- #: includes/admin/class-evf-admin-entries.php:257
1034
- msgid "%d entry permanently deleted."
1035
- msgid_plural "%d entries permanently deleted."
1036
- msgstr[0] ""
1037
- msgstr[1] ""
1038
-
1039
- #: includes/admin/class-evf-admin-entries-table-list.php:557
1040
- #: includes/admin/class-evf-admin-entries.php:94
1041
- msgid "Filter"
1042
- msgstr ""
1043
-
1044
- #: includes/admin/class-evf-admin-entries-table-list.php:561
1045
- msgid "Export CSV"
1046
- msgstr ""
1047
-
1048
- #: includes/admin/class-evf-admin-entries-table-list.php:567
1049
- #: includes/admin/class-evf-admin-forms-table-list.php:446
1050
- msgid "Empty Trash"
1051
- msgstr ""
1052
-
1053
- #: includes/admin/class-evf-admin-entries-table-list.php:581
1054
- msgid "Filter by form"
1055
- msgstr ""
1056
-
1057
- #: includes/admin/class-evf-admin-entries.php:59
1058
- #: includes/admin/class-evf-admin-forms-table-list.php:53
1059
- #: includes/admin/class-evf-admin-forms-table-list.php:117
1060
- #: includes/admin/class-evf-admin-menus.php:134
1061
- msgid "Entries"
1062
- msgstr ""
1063
-
1064
- #: includes/admin/class-evf-admin-entries.php:76
1065
- msgid "Search Entries"
1066
- msgstr ""
1067
-
1068
- #: includes/admin/class-evf-admin-entries.php:99
1069
- msgid "Learn more about entries"
1070
- msgstr ""
1071
-
1072
- #: includes/admin/class-evf-admin-entries.php:100
1073
- msgid "Create your first form!"
1074
- msgstr ""
1075
-
1076
- #. translators: %d - New form entries count.
1077
- #: includes/admin/class-evf-admin-entries.php:366
1078
- msgid "%d new entry since you last checked."
1079
- msgid_plural "%d new entries since you last checked."
1080
- msgstr[0] ""
1081
- msgstr[1] ""
1082
-
1083
- #: includes/admin/class-evf-admin-forms-table-list.php:37
1084
- msgid "No Forms found."
1085
- msgstr ""
1086
-
1087
- #: includes/admin/class-evf-admin-forms-table-list.php:49
1088
- msgid "Title"
1089
- msgstr ""
1090
-
1091
- #: includes/admin/class-evf-admin-forms-table-list.php:50
1092
- msgid "Shortcode"
1093
- msgstr ""
1094
-
1095
- #: includes/admin/class-evf-admin-forms-table-list.php:51
1096
- msgid "Author"
1097
- msgstr ""
1098
-
1099
- #: includes/admin/class-evf-admin-forms-table-list.php:52
1100
- #: includes/fields/class-evf-field-date-time.php:82
1101
- #: includes/fields/class-evf-field-date-time.php:121
1102
- msgid "Date"
1103
- msgstr ""
1104
-
1105
- #: includes/admin/class-evf-admin-forms-table-list.php:116
1106
- #: includes/class-evf-post-types.php:50
1107
- msgid "Edit"
1108
- msgstr ""
1109
-
1110
- #: includes/admin/class-evf-admin-forms-table-list.php:122
1111
- msgid "Restore this item from the Trash"
1112
- msgstr ""
1113
-
1114
- #: includes/admin/class-evf-admin-forms-table-list.php:124
1115
- msgid "Move this item to the Trash"
1116
- msgstr ""
1117
-
1118
- #: includes/admin/class-evf-admin-forms-table-list.php:127
1119
- msgid "Delete this item permanently"
1120
- msgstr ""
1121
-
1122
- #: includes/admin/class-evf-admin-forms-table-list.php:127
1123
- #: includes/admin/class-evf-admin-forms-table-list.php:364
1124
- msgid "Delete permanently"
1125
- msgstr ""
1126
-
1127
- #: includes/admin/class-evf-admin-forms-table-list.php:146
1128
- msgid "Duplicate"
1129
- msgstr ""
1130
-
1131
- #: includes/admin/class-evf-admin-forms-table-list.php:214
1132
- msgid "Y/m/d g:i:s A"
1133
- msgstr ""
1134
-
1135
- #. translators: %s: Time
1136
- #: includes/admin/class-evf-admin-forms-table-list.php:226
1137
- msgid "%s ago"
1138
- msgstr ""
1139
-
1140
- #: includes/admin/class-evf-admin-forms-table-list.php:230
1141
- msgid "Y/m/d"
1142
- msgstr ""
1143
-
1144
- #. translators: %s: count
1145
- #: includes/admin/class-evf-admin-forms-table-list.php:279
1146
- msgctxt "posts"
1147
- msgid "All <span class=\"count\">(%s)</span>"
1148
- msgid_plural "All <span class=\"count\">(%s)</span>"
1149
- msgstr[0] ""
1150
- msgstr[1] ""
1151
-
1152
- #: includes/admin/class-evf-admin-forms-table-list.php:369
1153
- #: includes/admin/views/html-admin-page-entries-view.php:213
1154
- msgid "Move to trash"
1155
- msgstr ""
1156
-
1157
- #. translators: %d: number of forms
1158
- #: includes/admin/class-evf-admin-forms-table-list.php:399
1159
- msgid "%d form moved to the Trash."
1160
- msgid_plural "%d forms moved to the Trash."
1161
- msgstr[0] ""
1162
- msgstr[1] ""
1163
-
1164
- #. translators: %d: number of forms
1165
- #: includes/admin/class-evf-admin-forms-table-list.php:414
1166
- msgid "%d form restored from the Trash."
1167
- msgid_plural "%d forms restored from the Trash."
1168
- msgstr[0] ""
1169
- msgstr[1] ""
1170
-
1171
- #. translators: %d: number of forms
1172
- #: includes/admin/class-evf-admin-forms-table-list.php:429
1173
- #: includes/admin/class-evf-admin-forms.php:221
1174
- msgid "%d form permanently deleted."
1175
- msgid_plural "%d forms permanently deleted."
1176
- msgstr[0] ""
1177
- msgstr[1] ""
1178
-
1179
- #: includes/admin/class-evf-admin-forms.php:157
1180
- #: includes/admin/class-evf-admin-menus.php:93
1181
- #: includes/class-evf-post-types.php:46
1182
- msgid "All Forms"
1183
- msgstr ""
1184
-
1185
- #: includes/admin/class-evf-admin-forms.php:158
1186
- #: includes/admin/class-evf-admin-menus.php:95
1187
- #: includes/class-evf-post-types.php:48
1188
- msgid "Add New"
1189
- msgstr ""
1190
-
1191
- #: includes/admin/class-evf-admin-forms.php:167
1192
- msgid "Search Forms"
1193
- msgstr ""
1194
-
1195
- #: includes/admin/class-evf-admin-forms.php:231
1196
- msgid "No form to duplicate has been supplied!"
1197
- msgstr ""
1198
-
1199
- #: includes/admin/class-evf-admin-import-export.php:34
1200
- #: includes/admin/class-evf-admin-notices.php:118
1201
- #: includes/admin/class-evf-admin-tools.php:165
1202
- msgid "Action failed. Please refresh the page and retry."
1203
- msgstr ""
1204
-
1205
- #: includes/admin/class-evf-admin-import-export.php:125
1206
- msgid "Imported Successfully."
1207
- msgstr ""
1208
-
1209
- #: includes/admin/class-evf-admin-import-export.php:132
1210
- #: includes/admin/class-evf-admin-import-export.php:139
1211
- msgid "Invalid file content. Please export file from Everest Forms plugin."
1212
- msgstr ""
1213
-
1214
- #: includes/admin/class-evf-admin-import-export.php:146
1215
- msgid "Invalid file format. Only JSON File Allowed."
1216
- msgstr ""
1217
-
1218
- #: includes/admin/class-evf-admin-import-export.php:153
1219
- msgid "Please select json file to import form data."
1220
- msgstr ""
1221
-
1222
- #: includes/admin/class-evf-admin-menus.php:93
1223
- msgid "Everest Forms Builder"
1224
- msgstr ""
1225
-
1226
- #: includes/admin/class-evf-admin-menus.php:95
1227
- msgid "Everest Forms Setup"
1228
- msgstr ""
1229
-
1230
- #: includes/admin/class-evf-admin-menus.php:134
1231
- msgid "Everest Forms Entries"
1232
- msgstr ""
1233
-
1234
- #: includes/admin/class-evf-admin-menus.php:165
1235
- msgid "Everest Forms settings"
1236
- msgstr ""
1237
-
1238
- #: includes/admin/class-evf-admin-menus.php:204
1239
- msgid "Everest Forms tools"
1240
- msgstr ""
1241
-
1242
- #: includes/admin/class-evf-admin-menus.php:204
1243
- msgid "Tools"
1244
- msgstr ""
1245
-
1246
- #: includes/admin/class-evf-admin-menus.php:211
1247
- #: includes/admin/views/html-admin-page-addons.php:15
1248
- msgid "Everest Forms Add-ons"
1249
- msgstr ""
1250
-
1251
- #: includes/admin/class-evf-admin-menus.php:211
1252
- msgid "Add-ons"
1253
- msgstr ""
1254
-
1255
- #: includes/admin/class-evf-admin-notices.php:122
1256
- msgid "You don&#8217;t have permission to do this."
1257
- msgstr ""
1258
-
1259
- #: includes/admin/class-evf-admin-settings.php:73
1260
- msgid "Your settings have been saved."
1261
- msgstr ""
1262
-
1263
- #: includes/admin/class-evf-admin-settings.php:132
1264
- msgid "The changes you made will be lost if you navigate away from this page."
1265
- msgstr ""
1266
-
1267
- #: includes/admin/class-evf-admin-settings.php:580
1268
- msgid "Select a page&hellip;"
1269
- msgstr ""
1270
-
1271
- #: includes/admin/class-evf-admin-settings.php:589
1272
- #: includes/evf-formatting-functions.php:604
1273
- msgid "Day(s)"
1274
- msgstr ""
1275
-
1276
- #: includes/admin/class-evf-admin-settings.php:590
1277
- #: includes/evf-formatting-functions.php:605
1278
- msgid "Week(s)"
1279
- msgstr ""
1280
-
1281
- #: includes/admin/class-evf-admin-settings.php:591
1282
- #: includes/evf-formatting-functions.php:606
1283
- msgid "Month(s)"
1284
- msgstr ""
1285
-
1286
- #: includes/admin/class-evf-admin-settings.php:592
1287
- #: includes/evf-formatting-functions.php:607
1288
- msgid "Year(s)"
1289
- msgstr ""
1290
-
1291
- #: includes/admin/class-evf-admin-welcome.php:33
1292
- #: includes/admin/class-evf-admin-welcome.php:34
1293
- #: includes/admin/class-evf-admin-welcome.php:80
1294
- msgid "Welcome to Everest Forms"
1295
- msgstr ""
1296
-
1297
- #: includes/admin/class-evf-admin-welcome.php:72
1298
- msgid "Getting Started"
1299
- msgstr ""
1300
-
1301
- #: includes/admin/class-evf-admin-welcome.php:81
1302
- msgid "Thank you for choosing Everest Forms, the most powerful and easy drag & drop WordPress form builder in the market."
1303
- msgstr ""
1304
-
1305
- #: includes/admin/class-evf-admin-welcome.php:84
1306
- msgid "Watch how to create your first form with Everest Forms"
1307
- msgstr ""
1308
-
1309
- #: includes/admin/class-evf-admin-welcome.php:93
1310
- msgid "Create Your First Form"
1311
- msgstr ""
1312
-
1313
- #: includes/admin/class-evf-admin-welcome.php:94
1314
- msgid "Let's get started with the first contact forms for your site."
1315
- msgstr ""
1316
-
1317
- #: includes/admin/class-evf-admin-welcome.php:102
1318
- msgid "Read The Full Guide"
1319
- msgstr ""
1320
-
1321
- #: includes/admin/class-evf-admin-welcome.php:103
1322
- msgid "Read our step by step guide on how to create your first form."
1323
- msgstr ""
1324
-
1325
- #: includes/admin/class-evf-admin.php:70
1326
- #: includes/admin/class-evf-admin.php:115
1327
- msgid "Could not verify nonce"
1328
- msgstr ""
1329
-
1330
- #: includes/admin/class-evf-admin.php:82
1331
- msgid "Sorry, you are not allowed to activate this plugin."
1332
- msgstr ""
1333
-
1334
- #: includes/admin/class-evf-admin.php:90
1335
- msgid "Sorry, you are not allowed to deactivate plugins for this site."
1336
- msgstr ""
1337
-
1338
- #. translators: 1: EverestForms 2:: five stars
1339
- #: includes/admin/class-evf-admin.php:188
1340
- msgid "If you like %1$s please leave us a %2$s rating. A huge thanks in advance!"
1341
- msgstr ""
1342
-
1343
- #: includes/admin/class-evf-admin.php:190
1344
- msgid "Thanks :)"
1345
- msgstr ""
1346
-
1347
- #: includes/admin/class-evf-admin.php:201
1348
- msgid "Thank you for creating with Everest Forms."
1349
- msgstr ""
1350
-
1351
- #: includes/admin/evf-admin-functions.php:354
1352
- msgid "Field #"
1353
- msgstr ""
1354
-
1355
- #: includes/admin/evf-admin-functions.php:422
1356
- msgid "Available Fields"
1357
- msgstr ""
1358
-
1359
- #: includes/admin/evf-admin-functions.php:426
1360
- msgid "Others"
1361
- msgstr ""
1362
-
1363
- #: includes/admin/settings/class-evf-settings-email.php:40
1364
- msgid "Template Settings"
1365
- msgstr ""
1366
-
1367
- #: includes/admin/settings/class-evf-settings-email.php:46
1368
- msgid "Template"
1369
- msgstr ""
1370
-
1371
- #: includes/admin/settings/class-evf-settings-email.php:49
1372
- msgid "Determine which format of email to send. HTML Template is default."
1373
- msgstr ""
1374
-
1375
- #: includes/admin/settings/class-evf-settings-email.php:53
1376
- msgid "HTML Template"
1377
- msgstr ""
1378
-
1379
- #: includes/admin/settings/class-evf-settings-email.php:57
1380
- msgid "Plain text"
1381
- msgstr ""
1382
-
1383
- #: includes/admin/settings/class-evf-settings-email.php:63
1384
- msgid "Enable copies"
1385
- msgstr ""
1386
-
1387
- #: includes/admin/settings/class-evf-settings-email.php:64
1388
- msgid "Enable the use of Cc and Bcc email addresses"
1389
- msgstr ""
1390
-
1391
- #: includes/admin/settings/class-evf-settings-email.php:65
1392
- msgid "Email addresses for Cc and Bcc can be applied from the form notification settings."
1393
- msgstr ""
1394
-
1395
- #: includes/admin/settings/class-evf-settings-general.php:40
1396
- msgid "General Options"
1397
- msgstr ""
1398
-
1399
- #: includes/admin/settings/class-evf-settings-general.php:46
1400
- msgid "Disable User Details"
1401
- msgstr ""
1402
-
1403
- #: includes/admin/settings/class-evf-settings-general.php:47
1404
- msgid "Disable storing the IP address and User Agent on all forms."
1405
- msgstr ""
1406
-
1407
- #: includes/admin/settings/class-evf-settings-integrations.php:25
1408
- msgid "Integration"
1409
- msgstr ""
1410
-
1411
- #: includes/admin/settings/class-evf-settings-integrations.php:59
1412
- msgid "Integrations"
1413
- msgstr ""
1414
-
1415
- #: includes/admin/settings/class-evf-settings-recaptcha.php:25
1416
- msgid "reCAPTCHA"
1417
- msgstr ""
1418
-
1419
- #: includes/admin/settings/class-evf-settings-recaptcha.php:42
1420
- msgid "Google reCAPTCHA Integration"
1421
- msgstr ""
1422
-
1423
- #. translators: %1$s - Google reCAPTCHA docs url
1424
- #: includes/admin/settings/class-evf-settings-recaptcha.php:45
1425
- msgid "<p>Google's reCAPTCHA is a free service that protects your website from spam and abuse while letting valid users pass through with ease.</p><p>reCAPTCHA uses an advanced risk analysis engine and adaptive challenges to keep automated software from engaging in abusive activities on your site.</p><p>Sites already using v2 reCAPTCHA will need to create new site keys before switching to the Invisible reCAPTCHA or v3 reCAPTCHA.</p><p><a href=\"%1$s\" target=\"_blank\">Read our documentation</a> for step-by-step instructions.</p>"
1426
- msgstr ""
1427
-
1428
- #: includes/admin/settings/class-evf-settings-recaptcha.php:49
1429
- msgid "reCAPTCHA type"
1430
- msgstr ""
1431
-
1432
- #: includes/admin/settings/class-evf-settings-recaptcha.php:50
1433
- msgid "Choose the type of reCAPTCHA for this site key."
1434
- msgstr ""
1435
-
1436
- #: includes/admin/settings/class-evf-settings-recaptcha.php:55
1437
- msgid "reCAPTCHA v2"
1438
- msgstr ""
1439
-
1440
- #: includes/admin/settings/class-evf-settings-recaptcha.php:56
1441
- msgid "reCAPTCHA v3"
1442
- msgstr ""
1443
-
1444
- #: includes/admin/settings/class-evf-settings-recaptcha.php:62
1445
- #: includes/admin/settings/class-evf-settings-recaptcha.php:82
1446
- #: includes/admin/settings/class-evf-settings-recaptcha.php:110
1447
- msgid "Site Key"
1448
- msgstr ""
1449
-
1450
- #. translators: %1$s - Google reCAPTCHA docs url
1451
- #: includes/admin/settings/class-evf-settings-recaptcha.php:65
1452
- #: includes/admin/settings/class-evf-settings-recaptcha.php:85
1453
- msgid "Please enter your site key for your reCAPTCHA v2. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
1454
- msgstr ""
1455
-
1456
- #: includes/admin/settings/class-evf-settings-recaptcha.php:72
1457
- #: includes/admin/settings/class-evf-settings-recaptcha.php:92
1458
- #: includes/admin/settings/class-evf-settings-recaptcha.php:120
1459
- msgid "Secret Key"
1460
- msgstr ""
1461
-
1462
- #. translators: %1$s - Google reCAPTCHA docs url
1463
- #: includes/admin/settings/class-evf-settings-recaptcha.php:75
1464
- #: includes/admin/settings/class-evf-settings-recaptcha.php:95
1465
- msgid "Please enter your secret key for your reCAPTCHA v2. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
1466
- msgstr ""
1467
-
1468
- #: includes/admin/settings/class-evf-settings-recaptcha.php:102
1469
- msgid "Invisible reCAPTCHA"
1470
- msgstr ""
1471
-
1472
- #: includes/admin/settings/class-evf-settings-recaptcha.php:104
1473
- msgid "Enable Invisible reCAPTCHA."
1474
- msgstr ""
1475
-
1476
- #. translators: %1$s - Google reCAPTCHA docs url
1477
- #: includes/admin/settings/class-evf-settings-recaptcha.php:113
1478
- msgid "Please enter your site key for your reCAPTCHA v3. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
1479
- msgstr ""
1480
-
1481
- #. translators: %1$s - Google reCAPTCHA docs url
1482
- #: includes/admin/settings/class-evf-settings-recaptcha.php:123
1483
- msgid "Please enter your secret key for your reCAPTCHA v3. <a href=\"%1$s\" target=\"_blank\">Learn More</a>"
1484
- msgstr ""
1485
-
1486
- #: includes/admin/settings/class-evf-settings-validation.php:25
1487
- msgid "Validations"
1488
- msgstr ""
1489
-
1490
- #: includes/admin/settings/class-evf-settings-validation.php:40
1491
- msgid "Validation Messages"
1492
- msgstr ""
1493
-
1494
- #: includes/admin/settings/class-evf-settings-validation.php:47
1495
- msgid "Enter the message for the required form field"
1496
- msgstr ""
1497
-
1498
- #: includes/admin/settings/class-evf-settings-validation.php:52
1499
- #: includes/class-evf-frontend-scripts.php:311
1500
- #: includes/evf-core-functions.php:1496
1501
- msgid "This field is required."
1502
- msgstr ""
1503
-
1504
- #: includes/admin/settings/class-evf-settings-validation.php:55
1505
- msgid "Website URL"
1506
- msgstr ""
1507
-
1508
- #: includes/admin/settings/class-evf-settings-validation.php:56
1509
- msgid "Enter the message for the valid website url"
1510
- msgstr ""
1511
-
1512
- #: includes/admin/settings/class-evf-settings-validation.php:61
1513
- msgid "Please enter a valid URL."
1514
- msgstr ""
1515
-
1516
- #: includes/admin/settings/class-evf-settings-validation.php:65
1517
- msgid "Enter the message for the valid email"
1518
- msgstr ""
1519
-
1520
- #: includes/admin/settings/class-evf-settings-validation.php:70
1521
- #: includes/fields/class-evf-field-email.php:378
1522
- msgid "Please enter a valid email address."
1523
- msgstr ""
1524
-
1525
- #: includes/admin/settings/class-evf-settings-validation.php:73
1526
- msgid "Email Suggestion"
1527
- msgstr ""
1528
-
1529
- #: includes/admin/settings/class-evf-settings-validation.php:74
1530
- msgid "Enter the message for the valid email suggestion"
1531
- msgstr ""
1532
-
1533
- #: includes/admin/settings/class-evf-settings-validation.php:79
1534
- #: includes/class-evf-frontend-scripts.php:288
1535
- msgid "Did you mean {suggestion}?"
1536
- msgstr ""
1537
-
1538
- #: includes/admin/settings/class-evf-settings-validation.php:82
1539
- msgid "Confirm Value"
1540
- msgstr ""
1541
-
1542
- #: includes/admin/settings/class-evf-settings-validation.php:83
1543
- msgid "Enter the message for confirm field value."
1544
- msgstr ""
1545
-
1546
- #: includes/admin/settings/class-evf-settings-validation.php:88
1547
- #: includes/class-evf-frontend-scripts.php:290
1548
- msgid "Field values do not match."
1549
- msgstr ""
1550
-
1551
- #: includes/admin/settings/class-evf-settings-validation.php:91
1552
- msgid "Checkbox Selection Limit"
1553
- msgstr ""
1554
-
1555
- #: includes/admin/settings/class-evf-settings-validation.php:92
1556
- msgid "Enter the message for the checkbox selection limit."
1557
- msgstr ""
1558
-
1559
- #: includes/admin/settings/class-evf-settings-validation.php:97
1560
- #: includes/class-evf-frontend-scripts.php:291
1561
- #: includes/fields/class-evf-field-checkbox.php:423
1562
- msgid "You have exceeded number of allowed selections: {#}."
1563
- msgstr ""
1564
-
1565
- #: includes/admin/settings/class-evf-settings-validation.php:100
1566
- #: includes/fields/class-evf-field-number.php:20
1567
- msgid "Number"
1568
- msgstr ""
1569
-
1570
- #: includes/admin/settings/class-evf-settings-validation.php:101
1571
- msgid "Enter the message for the valid number"
1572
- msgstr ""
1573
-
1574
- #: includes/admin/settings/class-evf-settings-validation.php:106
1575
- #: includes/fields/class-evf-field-number.php:289
1576
- msgid "Please enter a valid number."
1577
- msgstr ""
1578
-
1579
- #: includes/admin/views/html-admin-page-addons.php:18
1580
- msgid "Refresh Add-ons"
1581
- msgstr ""
1582
-
1583
- #: includes/admin/views/html-admin-page-addons.php:22
1584
- msgid "Filter add-ons list"
1585
- msgstr ""
1586
-
1587
- #: includes/admin/views/html-admin-page-addons.php:38
1588
- #: includes/admin/views/html-admin-page-addons.php:41
1589
- msgid "Search Add-ons"
1590
- msgstr ""
1591
-
1592
- #: includes/admin/views/html-admin-page-addons.php:39
1593
- msgid "Search Add-ons..."
1594
- msgstr ""
1595
-
1596
- #. translators: %s: Refresh URI
1597
- #: includes/admin/views/html-admin-page-addons.php:49
1598
- msgid "Make your forms even more robust with our premium addons. Missing any addons? Click the %1$sRefresh Add-ons%2$s button above."
1599
- msgstr ""
1600
-
1601
- #: includes/admin/views/html-admin-page-addons.php:56
1602
- msgid "Add-ons list"
1603
- msgstr ""
1604
-
1605
- #: includes/admin/views/html-admin-page-addons.php:77
1606
- #: includes/admin/views/html-admin-page-entries-view.php:203
1607
- msgid "Status:"
1608
- msgstr ""
1609
-
1610
- #: includes/admin/views/html-admin-page-addons.php:79
1611
- msgid "Activated"
1612
- msgstr ""
1613
-
1614
- #: includes/admin/views/html-admin-page-addons.php:81
1615
- msgid "Inactive"
1616
- msgstr ""
1617
-
1618
- #: includes/admin/views/html-admin-page-addons.php:83
1619
- msgid "Not Installed"
1620
- msgstr ""
1621
-
1622
- #. translators: %s: Add-on title
1623
- #: includes/admin/views/html-admin-page-addons.php:90
1624
- msgid "Deactivate %s now"
1625
- msgstr ""
1626
-
1627
- #: includes/admin/views/html-admin-page-addons.php:104
1628
- msgid "Deactivate"
1629
- msgstr ""
1630
-
1631
- #. translators: %s: Add-on title
1632
- #: includes/admin/views/html-admin-page-addons.php:108
1633
- msgid "Activate %s now"
1634
- msgstr ""
1635
-
1636
- #: includes/admin/views/html-admin-page-addons.php:122
1637
- msgid "Activate"
1638
- msgstr ""
1639
-
1640
- #. translators: %s: Add-on title
1641
- #: includes/admin/views/html-admin-page-addons.php:126
1642
- msgid "Install %s now"
1643
- msgstr ""
1644
-
1645
- #: includes/admin/views/html-admin-page-addons.php:128
1646
- msgid "Install Addon"
1647
- msgstr ""
1648
-
1649
- #. translators: %s: Add-ons Link
1650
- #: includes/admin/views/html-admin-page-addons.php:147
1651
- msgid "Our catalog of Everest Forms Add-ons/Extensions can be found on WPEverest.com here: <a href=\"%s\">Everest Forms Extensions Catalog</a>"
1652
- msgstr ""
1653
-
1654
- #: includes/admin/views/html-admin-page-builder-setup.php:23
1655
- msgid "Add New Form"
1656
- msgstr ""
1657
-
1658
- #: includes/admin/views/html-admin-page-builder-setup.php:25
1659
- msgid "Refresh Templates"
1660
- msgstr ""
1661
-
1662
- #: includes/admin/views/html-admin-page-builder-setup.php:30
1663
- msgid "All"
1664
- msgstr ""
1665
-
1666
- #: includes/admin/views/html-admin-page-builder-setup.php:33
1667
- msgid "Free"
1668
- msgstr ""
1669
-
1670
- #: includes/admin/views/html-admin-page-builder-setup.php:36
1671
- msgid "Premium"
1672
- msgstr ""
1673
-
1674
- #: includes/admin/views/html-admin-page-builder-setup.php:43
1675
- msgid "Couldn't connect to templates server. Please reload again."
1676
- msgstr ""
1677
-
1678
- #: includes/admin/views/html-admin-page-builder-setup.php:49
1679
- msgid "Something went wrong. Please refresh your templates."
1680
- msgstr ""
1681
-
1682
- #. translators: %s: Template title
1683
- #: includes/admin/views/html-admin-page-builder-setup.php:72
1684
- msgctxt "Template name"
1685
- msgid "%s template"
1686
- msgstr ""
1687
-
1688
- #. translators: %s: Number of plugins
1689
- #: includes/admin/views/html-admin-page-builder-setup.php:126
1690
- msgid "%s plugin successfully installed."
1691
- msgstr ""
1692
-
1693
- #. translators: %s: Number of plugins
1694
- #: includes/admin/views/html-admin-page-builder-setup.php:133
1695
- msgid "%s plugins successfully installed."
1696
- msgstr ""
1697
-
1698
- #. translators: %s: Number of failed installs
1699
- #: includes/admin/views/html-admin-page-builder-setup.php:143
1700
- msgid "%s install failed."
1701
- msgstr ""
1702
-
1703
- #. translators: %s: Number of failed installs
1704
- #: includes/admin/views/html-admin-page-builder-setup.php:148
1705
- msgid "%s installs failed."
1706
- msgstr ""
1707
-
1708
- #: includes/admin/views/html-admin-page-builder-setup.php:151
1709
- msgid "Show more details"
1710
- msgstr ""
1711
-
1712
- #: includes/admin/views/html-admin-page-builder.php:30
1713
- msgid "Loading&hellip;"
1714
- msgstr ""
1715
-
1716
- #: includes/admin/views/html-admin-page-builder.php:51
1717
- msgid "Copy Shortcode!"
1718
- msgstr ""
1719
-
1720
- #: includes/admin/views/html-admin-page-builder.php:51
1721
- msgid "Copied!"
1722
- msgstr ""
1723
-
1724
- #: includes/admin/views/html-admin-page-builder.php:52
1725
- msgid "Copy shortcode"
1726
- msgstr ""
1727
-
1728
- #: includes/admin/views/html-admin-page-builder.php:56
1729
- msgid "Save"
1730
- msgstr ""
1731
-
1732
- #: includes/admin/views/html-admin-page-entries-view.php:27
1733
- msgid "View Entry"
1734
- msgstr ""
1735
-
1736
- #: includes/admin/views/html-admin-page-entries-view.php:28
1737
- msgid "Back to All Entries"
1738
- msgstr ""
1739
-
1740
- #. translators: %s: Entry ID
1741
- #: includes/admin/views/html-admin-page-entries-view.php:42
1742
- msgid "%1$s: Entry #%2$s"
1743
- msgstr ""
1744
-
1745
- #: includes/admin/views/html-admin-page-entries-view.php:47
1746
- msgid "Show Empty Fields"
1747
- msgstr ""
1748
-
1749
- #: includes/admin/views/html-admin-page-entries-view.php:47
1750
- msgid "Hide Empty Fields"
1751
- msgstr ""
1752
-
1753
- #: includes/admin/views/html-admin-page-entries-view.php:58
1754
- msgid "This entry does not have any fields."
1755
- msgstr ""
1756
-
1757
- #: includes/admin/views/html-admin-page-entries-view.php:90
1758
- msgid "Field ID"
1759
- msgstr ""
1760
-
1761
- #: includes/admin/views/html-admin-page-entries-view.php:131
1762
- msgid "Empty"
1763
- msgstr ""
1764
-
1765
- #: includes/admin/views/html-admin-page-entries-view.php:149
1766
- msgid "Entry Details"
1767
- msgstr ""
1768
-
1769
- #: includes/admin/views/html-admin-page-entries-view.php:155
1770
- msgid "Entry ID:"
1771
- msgstr ""
1772
-
1773
- #: includes/admin/views/html-admin-page-entries-view.php:161
1774
- msgid "Submitted:"
1775
- msgstr ""
1776
-
1777
- #: includes/admin/views/html-admin-page-entries-view.php:162
1778
- msgid "M j, Y @ g:ia"
1779
- msgstr ""
1780
-
1781
- #: includes/admin/views/html-admin-page-entries-view.php:169
1782
- msgid "User:"
1783
- msgstr ""
1784
-
1785
- #: includes/admin/views/html-admin-page-entries-view.php:187
1786
- msgid "User IP:"
1787
- msgstr ""
1788
-
1789
- #: includes/admin/views/html-admin-page-entries-view.php:195
1790
- msgid "Referer Link:"
1791
- msgstr ""
1792
-
1793
- #: includes/admin/views/html-admin-page-entries-view.php:204
1794
- msgid "Completed"
1795
- msgstr ""
1796
-
1797
- #: includes/admin/views/html-admin-page-export.php:12
1798
- msgid "Export Everest Forms with Settings"
1799
- msgstr ""
1800
-
1801
- #: includes/admin/views/html-admin-page-export.php:13
1802
- msgid "Export your forms along with their settings as JSON file."
1803
- msgstr ""
1804
-
1805
- #: includes/admin/views/html-admin-page-export.php:18
1806
- msgid "Select form"
1807
- msgstr ""
1808
-
1809
- #: includes/admin/views/html-admin-page-export.php:18
1810
- msgid "Select a form"
1811
- msgstr ""
1812
-
1813
- #: includes/admin/views/html-admin-page-export.php:24
1814
- msgid "You need to create a form before you can use form export."
1815
- msgstr ""
1816
-
1817
- #: includes/admin/views/html-admin-page-export.php:29
1818
- #: includes/admin/views/html-admin-page-tools.php:15
1819
- msgid "Export"
1820
- msgstr ""
1821
-
1822
- #: includes/admin/views/html-admin-page-import.php:12
1823
- msgid "Import Everest Forms"
1824
- msgstr ""
1825
-
1826
- #: includes/admin/views/html-admin-page-import.php:13
1827
- msgid "Select JSON file to import the form."
1828
- msgstr ""
1829
-
1830
- #: includes/admin/views/html-admin-page-import.php:15
1831
- msgid "files selected"
1832
- msgstr ""
1833
-
1834
- #: includes/admin/views/html-admin-page-import.php:16
1835
- msgid "No file selected"
1836
- msgstr ""
1837
-
1838
- #. translators: %s: File format
1839
- #: includes/admin/views/html-admin-page-import.php:22
1840
- msgid "Only %s file is allowed."
1841
- msgstr ""
1842
-
1843
- #: includes/admin/views/html-admin-page-import.php:26
1844
- msgid "Import Form"
1845
- msgstr ""
1846
-
1847
- #: includes/admin/views/html-admin-page-tools-logs.php:17
1848
- msgid "Delete log"
1849
- msgstr ""
1850
-
1851
- #. translators: 1: last access date 2: last access time
1852
- #: includes/admin/views/html-admin-page-tools-logs.php:28
1853
- msgid "%1$s at %2$s"
1854
- msgstr ""
1855
-
1856
- #: includes/admin/views/html-admin-page-tools-logs.php:42
1857
- msgid "There are currently no logs to view."
1858
- msgstr ""
1859
-
1860
- #: includes/admin/views/html-admin-page-tools.php:14
1861
- msgid "Import"
1862
- msgstr ""
1863
-
1864
- #: includes/admin/views/html-admin-page-tools.php:16
1865
- msgid "Logs"
1866
- msgstr ""
1867
-
1868
- #: includes/admin/views/html-admin-settings.php:42
1869
- msgid "Save Changes"
1870
- msgstr ""
1871
-
1872
- #: includes/admin/views/html-notice-custom.php:12
1873
- #: includes/admin/views/html-notice-updated.php:12
1874
- msgid "Dismiss"
1875
- msgstr ""
1876
-
1877
- #: includes/admin/views/html-notice-review.php:16
1878
- msgid "Please help us spread the word"
1879
- msgstr ""
1880
-
1881
- #. translators: %1$s: Plugin Name, %2$s: Rating link
1882
- #: includes/admin/views/html-notice-review.php:20
1883
- msgid "Enjoying the experience with %1$s? Please take a moment to spread your love by rating us on %2$s"
1884
- msgstr ""
1885
-
1886
- #: includes/admin/views/html-notice-review.php:24
1887
- msgid "Sure, I'd love to!"
1888
- msgstr ""
1889
-
1890
- #: includes/admin/views/html-notice-review.php:25
1891
- msgid "Remind me later"
1892
- msgstr ""
1893
-
1894
- #: includes/admin/views/html-notice-review.php:26
1895
- msgid "I already did"
1896
- msgstr ""
1897
-
1898
- #: includes/admin/views/html-notice-update.php:18
1899
- msgid "Everest Forms database update required"
1900
- msgstr ""
1901
-
1902
- #: includes/admin/views/html-notice-update.php:21
1903
- msgid "Everest Forms has been updated! To keep things running smoothly, we have to update your database to the newest version. The database update process runs in the background and may take a little while, so please be patient."
1904
- msgstr ""
1905
-
1906
- #: includes/admin/views/html-notice-update.php:25
1907
- msgid "Update Everest Forms Database"
1908
- msgstr ""
1909
-
1910
- #: includes/admin/views/html-notice-update.php:31
1911
- msgid "It is strongly recommended that you backup your database before proceeding. Are you sure you wish to run the updater now?"
1912
- msgstr ""
1913
-
1914
- #: includes/admin/views/html-notice-updated.php:14
1915
- msgid "Everest Forms data update complete. Thank you for updating to the latest version!"
1916
- msgstr ""
1917
-
1918
- #: includes/admin/views/html-notice-updating.php:12
1919
- msgid "Everest Forms data update"
1920
- msgstr ""
1921
-
1922
- #: includes/admin/views/html-notice-updating.php:12
1923
- msgid "Your database is being updated in the background."
1924
- msgstr ""
1925
-
1926
- #: includes/admin/views/html-notice-updating.php:12
1927
- msgid "Taking a while? Click here to run it now."
1928
- msgstr ""
1929
-
1930
- #: includes/class-everest-forms.php:101
1931
- #: includes/class-everest-forms.php:110
1932
- msgid "Cheatin&#8217; huh?"
1933
- msgstr ""
1934
-
1935
- #: includes/class-evf-ajax.php:125
1936
- msgid "Invalid form"
1937
- msgstr ""
1938
-
1939
- #: includes/class-evf-ajax.php:155
1940
- msgid "Blank Form"
1941
- msgstr ""
1942
-
1943
- #: includes/class-evf-ajax.php:177
1944
- msgid "Something went wrong, please try again later"
1945
- msgstr ""
1946
-
1947
- #: includes/class-evf-ajax.php:190
1948
- msgid "You do not have permission."
1949
- msgstr ""
1950
-
1951
- #: includes/class-evf-ajax.php:195
1952
- msgid "No data provided"
1953
- msgstr ""
1954
-
1955
- #: includes/class-evf-ajax.php:265
1956
- msgid "Meta Key missing"
1957
- msgstr ""
1958
-
1959
- #. translators: %s: empty meta data
1960
- #: includes/class-evf-ajax.php:267
1961
- msgid "Please add Meta key for fields: %s"
1962
- msgstr ""
1963
-
1964
- #: includes/class-evf-ajax.php:286
1965
- msgid "Form not found"
1966
- msgstr ""
1967
-
1968
- #: includes/class-evf-ajax.php:287
1969
- msgid "An error occurred while saving the form."
1970
- msgstr ""
1971
-
1972
- #: includes/class-evf-ajax.php:326
1973
- msgid "No Addon specified."
1974
- msgstr ""
1975
-
1976
- #: includes/class-evf-ajax.php:337
1977
- msgid "Addon can not be activate. Please try again."
1978
- msgstr ""
1979
-
1980
- #: includes/class-evf-ajax.php:358
1981
- msgid "No Plan specified."
1982
- msgstr ""
1983
-
1984
- #: includes/class-evf-ajax.php:379
1985
- msgid "This form template requires the following addons."
1986
- msgstr ""
1987
-
1988
- #: includes/class-evf-ajax.php:430
1989
- msgid "No plugin specified."
1990
- msgstr ""
1991
-
1992
- #: includes/class-evf-ajax.php:443
1993
- msgid "Sorry, you are not allowed to install plugins on this site."
1994
- msgstr ""
1995
-
1996
- #: includes/class-evf-ajax.php:507
1997
- msgid "Unable to connect to the filesystem. Please confirm your credentials."
1998
- msgstr ""
1999
-
2000
- #: includes/class-evf-ajax.php:551
2001
- #: includes/class-evf-ajax.php:591
2002
- msgid "Missing data"
2003
- msgstr ""
2004
-
2005
- #: includes/class-evf-ajax.php:605
2006
- msgid "Connection missing"
2007
- msgstr ""
2008
-
2009
- #. translators: %1$s - deactivation reason page; %2$d - deactivation url.
2010
- #: includes/class-evf-ajax.php:634
2011
- msgid "Before we deactivate Everest Forms, would you care to <a href=\"%1$s\" target=\"_blank\">let us know why</a> so we can improve it for you? <a href=\"%2$s\">No, deactivate now</a>."
2012
- msgstr ""
2013
-
2014
- #. translators: 1: key 2: URL
2015
- #: includes/class-evf-cache-helper.php:81
2016
- msgid "In order for <strong>database caching</strong> to work with Everest Forms you must add %1$s to the \"Ignored Query Strings\" option in <a href=\"%2$s\">W3 Total Cache settings</a>."
2017
- msgstr ""
2018
-
2019
- #: includes/class-evf-emails.php:317
2020
- msgid "You cannot send emails with EVF_Emails until init/admin_init has been reached"
2021
- msgstr ""
2022
-
2023
- #. translators: %d - field ID.
2024
- #: includes/class-evf-emails.php:513
2025
- #: includes/class-evf-emails.php:555
2026
- msgid "Field ID #%d"
2027
- msgstr ""
2028
-
2029
- #: includes/class-evf-emails.php:567
2030
- msgid "An empty form was submitted."
2031
- msgstr ""
2032
-
2033
- #: includes/class-evf-fields.php:52
2034
- msgid "Cloning is forbidden."
2035
- msgstr ""
2036
-
2037
- #: includes/class-evf-fields.php:61
2038
- msgid "Unserializing instances of this class is forbidden."
2039
- msgstr ""
2040
-
2041
- #: includes/class-evf-form-block.php:79
2042
- msgid "Select and display one of your forms."
2043
- msgstr ""
2044
-
2045
- #: includes/class-evf-form-block.php:81
2046
- msgid "form"
2047
- msgstr ""
2048
-
2049
- #: includes/class-evf-form-block.php:82
2050
- msgid "contact"
2051
- msgstr ""
2052
-
2053
- #: includes/class-evf-form-block.php:83
2054
- msgid "survey"
2055
- msgstr ""
2056
-
2057
- #: includes/class-evf-form-block.php:85
2058
- msgid "Select a Form"
2059
- msgstr ""
2060
-
2061
- #: includes/class-evf-form-block.php:86
2062
- msgid "Form Settings"
2063
- msgstr ""
2064
-
2065
- #: includes/class-evf-form-block.php:87
2066
- #: includes/class-evf-post-types.php:45
2067
- msgid "Form"
2068
- msgstr ""
2069
-
2070
- #: includes/class-evf-form-block.php:88
2071
- msgid "Show Title"
2072
- msgstr ""
2073
-
2074
- #: includes/class-evf-form-block.php:89
2075
- msgid "Show Description"
2076
- msgstr ""
2077
-
2078
- #: includes/class-evf-form-task.php:92
2079
- msgid "We were unable to process your form, please try again."
2080
- msgstr ""
2081
-
2082
- #: includes/class-evf-form-task.php:98
2083
- msgid "Invalid form. Please check again."
2084
- msgstr ""
2085
-
2086
- #: includes/class-evf-form-task.php:166
2087
- #: includes/class-evf-form-task.php:217
2088
- #: includes/class-evf-form-task.php:266
2089
- msgid "Form has not been submitted, please see the errors below."
2090
- msgstr ""
2091
-
2092
- #: includes/class-evf-form-task.php:187
2093
- msgid "Google reCAPTCHA verification failed, please try again later."
2094
- msgstr ""
2095
-
2096
- #: includes/class-evf-form-task.php:225
2097
- msgid "Everest Forms honeypot field triggered."
2098
- msgstr ""
2099
-
2100
- #: includes/class-evf-form-task.php:299
2101
- #: includes/templates/contact.php:61
2102
- msgid "Thanks for contacting us! We will be in touch with you shortly."
2103
- msgstr ""
2104
-
2105
- #. translators: %s - form name.
2106
- #: includes/class-evf-form-task.php:579
2107
- msgid "New %s Entry"
2108
- msgstr ""
2109
-
2110
- #: includes/class-evf-form-task.php:674
2111
- msgid "No form ID was found."
2112
- msgstr ""
2113
-
2114
- #: includes/class-evf-form-task.php:681
2115
- msgid "Could not create an entry"
2116
- msgstr ""
2117
-
2118
- #: includes/class-evf-frontend-scripts.php:289
2119
- msgid "Click to accept this suggestion."
2120
- msgstr ""
2121
-
2122
- #: includes/class-evf-frontend-scripts.php:301
2123
- msgid "{count} of {limit} max characters."
2124
- msgstr ""
2125
-
2126
- #: includes/class-evf-frontend-scripts.php:302
2127
- msgid "{count} of {limit} max words."
2128
- msgstr ""
2129
-
2130
- #: includes/class-evf-frontend-scripts.php:310
2131
- msgid "Sorry, something went wrong. Please try again"
2132
- msgstr ""
2133
-
2134
- #: includes/class-evf-install.php:301
2135
- msgid "Monthly"
2136
- msgstr ""
2137
-
2138
- #: includes/class-evf-install.php:575
2139
- #: includes/templates/contact.php:12
2140
- msgid "Contact Form"
2141
- msgstr ""
2142
-
2143
- #: includes/class-evf-install.php:637
2144
- msgid "View Everest Forms Settings"
2145
- msgstr ""
2146
-
2147
- #: includes/class-evf-install.php:653
2148
- msgid "View Everest Forms documentation"
2149
- msgstr ""
2150
-
2151
- #: includes/class-evf-install.php:653
2152
- msgid "Docs"
2153
- msgstr ""
2154
-
2155
- #: includes/class-evf-install.php:654
2156
- msgid "Visit free customer support"
2157
- msgstr ""
2158
-
2159
- #: includes/class-evf-install.php:654
2160
- msgid "Free support"
2161
- msgstr ""
2162
-
2163
- #. translators: 1: class name 2: EVF_Log_Handler_Interface
2164
- #: includes/class-evf-logger.php:54
2165
- msgid "The provided handler %1$s does not implement %2$s."
2166
- msgstr ""
2167
-
2168
- #. translators: 1: EVF_Logger::log 2: level
2169
- #: includes/class-evf-logger.php:133
2170
- msgid "%1$s was called with an invalid level \"%2$s\"."
2171
- msgstr ""
2172
-
2173
- #: includes/class-evf-post-types.php:44
2174
- msgid "Forms"
2175
- msgstr ""
2176
-
2177
- #: includes/class-evf-post-types.php:47
2178
- msgctxt "Admin menu name"
2179
- msgid "Forms"
2180
- msgstr ""
2181
-
2182
- #: includes/class-evf-post-types.php:49
2183
- msgid "Add new form"
2184
- msgstr ""
2185
-
2186
- #: includes/class-evf-post-types.php:51
2187
- msgid "Edit form"
2188
- msgstr ""
2189
-
2190
- #: includes/class-evf-post-types.php:52
2191
- msgid "New form"
2192
- msgstr ""
2193
-
2194
- #: includes/class-evf-post-types.php:53
2195
- msgid "View form"
2196
- msgstr ""
2197
-
2198
- #: includes/class-evf-post-types.php:54
2199
- msgid "Search forms"
2200
- msgstr ""
2201
-
2202
- #: includes/class-evf-post-types.php:55
2203
- msgid "No forms found"
2204
- msgstr ""
2205
-
2206
- #: includes/class-evf-post-types.php:56
2207
- msgid "No forms found in trash"
2208
- msgstr ""
2209
-
2210
- #: includes/class-evf-post-types.php:57
2211
- msgid "Parent forms"
2212
- msgstr ""
2213
-
2214
- #: includes/class-evf-post-types.php:58
2215
- msgid "Form image"
2216
- msgstr ""
2217
-
2218
- #: includes/class-evf-post-types.php:59
2219
- msgid "Set form image"
2220
- msgstr ""
2221
-
2222
- #: includes/class-evf-post-types.php:60
2223
- msgid "Remove form image"
2224
- msgstr ""
2225
-
2226
- #: includes/class-evf-post-types.php:61
2227
- msgid "Use as form image"
2228
- msgstr ""
2229
-
2230
- #: includes/class-evf-post-types.php:62
2231
- msgid "Insert into form"
2232
- msgstr ""
2233
-
2234
- #: includes/class-evf-post-types.php:63
2235
- msgid "Uploaded to this form"
2236
- msgstr ""
2237
-
2238
- #: includes/class-evf-post-types.php:64
2239
- msgid "Filter forms"
2240
- msgstr ""
2241
-
2242
- #: includes/class-evf-post-types.php:65
2243
- msgid "Forms navigation"
2244
- msgstr ""
2245
-
2246
- #: includes/class-evf-post-types.php:66
2247
- msgid "Forms list"
2248
- msgstr ""
2249
-
2250
- #: includes/class-evf-post-types.php:70
2251
- msgid "This is where you can add new forms."
2252
- msgstr ""
2253
-
2254
- #: includes/class-evf-privacy.php:45
2255
- msgid "This sample policy includes the basics around what personal data you may be collecting, storing and sharing, as well as who may have access to that data. Depending on what settings are enabled and which additional plugins are used, the specific information shared by your form will vary. We recommend consulting with a lawyer when deciding what information to disclose on your privacy policy."
2256
- msgstr ""
2257
-
2258
- #: includes/class-evf-privacy.php:47
2259
- msgid "We collect information about you during the form submission process on our site."
2260
- msgstr ""
2261
-
2262
- #: includes/class-evf-privacy.php:48
2263
- msgid "What we collect and store"
2264
- msgstr ""
2265
-
2266
- #: includes/class-evf-privacy.php:49
2267
- msgid "While you visit our site, we’ll track:"
2268
- msgstr ""
2269
-
2270
- #: includes/class-evf-privacy.php:51
2271
- msgid "Form Fields Data: Forms Fields data includes the available field types when creating a form. We’ll use this to, for example, collect informations like Name, Email and other available fields."
2272
- msgstr ""
2273
-
2274
- #: includes/class-evf-privacy.php:52
2275
- msgid "Location, IP address and browser type: we’ll use this for purposes like geolocating users and reducing fraudulent activities."
2276
- msgstr ""
2277
-
2278
- #: includes/class-evf-privacy.php:53
2279
- msgid "Transaction Details: we’ll ask you to enter this so we can, for instance, provide subscription packs, and keep track of your payment details for subscription packs!"
2280
- msgstr ""
2281
-
2282
- #: includes/class-evf-privacy.php:55
2283
- msgid "We’ll also use cookies to keep track of form elements while you’re browsing our site."
2284
- msgstr ""
2285
-
2286
- #: includes/class-evf-privacy.php:56
2287
- msgid "Note: you may want to further detail your cookie policy, and link to that section from here."
2288
- msgstr ""
2289
-
2290
- #: includes/class-evf-privacy.php:57
2291
- msgid "When you fill up a form, we’ll ask you to provide information including your name, address, email, phone number, credit card/payment details and optional account information like username and password and any other form fields available in the form builder. We’ll use this information for purposes, such as, to:"
2292
- msgstr ""
2293
-
2294
- #: includes/class-evf-privacy.php:59
2295
- msgid "Send you information about your account and order"
2296
- msgstr ""
2297
-
2298
- #: includes/class-evf-privacy.php:60
2299
- msgid "Respond to your requests, including transaction details and complaints"
2300
- msgstr ""
2301
-
2302
- #: includes/class-evf-privacy.php:61
2303
- msgid "Process payments and prevent fraud"
2304
- msgstr ""
2305
-
2306
- #: includes/class-evf-privacy.php:62
2307
- msgid "Set up your account for our site"
2308
- msgstr ""
2309
-
2310
- #: includes/class-evf-privacy.php:63
2311
- msgid "Comply with any legal obligations we have, such as calculating taxes"
2312
- msgstr ""
2313
-
2314
- #: includes/class-evf-privacy.php:64
2315
- msgid "Improve our form offerings"
2316
- msgstr ""
2317
-
2318
- #: includes/class-evf-privacy.php:65
2319
- msgid "Send you marketing messages, if you choose to receive them"
2320
- msgstr ""
2321
-
2322
- #: includes/class-evf-privacy.php:66
2323
- msgid "Or any other service the built form was created to comply with and it’s necessary information"
2324
- msgstr ""
2325
-
2326
- #: includes/class-evf-privacy.php:68
2327
- msgid "If you create an account, we will store your name, address, email and phone number, which will be used to populate the form fields for future submissions."
2328
- msgstr ""
2329
-
2330
- #: includes/class-evf-privacy.php:69
2331
- msgid "We generally store information about you for as long as we need the information for the purposes for which we collect and use it, and we are not legally required to continue to keep it. For example, we will store form submission information for XXX years for geolocating and marketting purposes. This includes your name, address, email, phone number."
2332
- msgstr ""
2333
-
2334
- #: includes/class-evf-privacy.php:70
2335
- msgid "Who on our team has access"
2336
- msgstr ""
2337
-
2338
- #: includes/class-evf-privacy.php:71
2339
- msgid "Members of our team have access to the information you provide us. For example, both Administrators and Editors can access:"
2340
- msgstr ""
2341
-
2342
- #: includes/class-evf-privacy.php:73
2343
- msgid "Form submission information and other details related to it"
2344
- msgstr ""
2345
-
2346
- #: includes/class-evf-privacy.php:74
2347
- msgid "Customer information like your name, email and address information."
2348
- msgstr ""
2349
-
2350
- #: includes/class-evf-privacy.php:76
2351
- msgid "Our team members have access to this information to help fulfill entries and support you."
2352
- msgstr ""
2353
-
2354
- #: includes/class-evf-privacy.php:77
2355
- msgid "What we share with others"
2356
- msgstr ""
2357
-
2358
- #: includes/class-evf-privacy.php:78
2359
- msgid "In this section you should list who you’re sharing data with, and for what purpose. This could include, but may not be limited to, analytics, marketing, payment gateways, shipping providers, and third party embeds."
2360
- msgstr ""
2361
-
2362
- #: includes/class-evf-privacy.php:79
2363
- msgid "We share information with third parties who help us provide our orders and store services to you; for example --"
2364
- msgstr ""
2365
-
2366
- #: includes/class-evf-privacy.php:80
2367
- msgid "Payments"
2368
- msgstr ""
2369
-
2370
- #: includes/class-evf-privacy.php:81
2371
- msgid "In this subsection you should list which third party payment processors you’re using to take payments on your site since these may handle customer data. We’ve included PayPal as an example, but you should remove this if you’re not using PayPal."
2372
- msgstr ""
2373
-
2374
- #: includes/class-evf-privacy.php:82
2375
- msgid "We accept payments through PayPal. When processing payments, some of your data will be passed to PayPal, including information required to process or support the payment, such as the purchase total and billing information."
2376
- msgstr ""
2377
-
2378
- #: includes/class-evf-privacy.php:83
2379
- msgid "Please see the <a href=\"https://www.paypal.com/us/webapps/mpp/ua/privacy-full\">PayPal Privacy Policy</a> for more details."
2380
- msgstr ""
2381
-
2382
- #: includes/class-evf-privacy.php:84
2383
- msgid "Available Modules"
2384
- msgstr ""
2385
-
2386
- #: includes/class-evf-privacy.php:85
2387
- msgid "In this subsection you should list which third party modules you’re using to increase functionality on your site since these may handle customer data. We’ve included MailChimp as an example, but you should remove this if you’re not using MailChimp."
2388
- msgstr ""
2389
-
2390
- #: includes/class-evf-privacy.php:86
2391
- msgid "We send beautiful email through MailChimp. When processing emails, some of your data will be passed to MailChimp, including information required to process or support the email marketing services, such as the name, email address and any other information that you intend to pass or collect including all collected information through subscription."
2392
- msgstr ""
2393
-
2394
- #: includes/class-evf-privacy.php:87
2395
- msgid "Please see the <a href=\"https://mailchimp.com/legal/privacy/\">MailChimp Privacy Policy</a> for more details."
2396
- msgstr ""
2397
-
2398
- #: includes/class-evf-smart-tags.php:31
2399
- msgid "Site Admin Email"
2400
- msgstr ""
2401
-
2402
- #: includes/class-evf-smart-tags.php:32
2403
- msgid "Site Name"
2404
- msgstr ""
2405
-
2406
- #: includes/class-evf-smart-tags.php:33
2407
- msgid "Site URL"
2408
- msgstr ""
2409
-
2410
- #: includes/class-evf-smart-tags.php:34
2411
- msgid "Page Title"
2412
- msgstr ""
2413
-
2414
- #: includes/class-evf-smart-tags.php:35
2415
- msgid "Page URL"
2416
- msgstr ""
2417
-
2418
- #: includes/class-evf-smart-tags.php:36
2419
- msgid "Page ID"
2420
- msgstr ""
2421
-
2422
- #: includes/class-evf-smart-tags.php:38
2423
- #: includes/export/class-evf-entry-csv-exporter.php:86
2424
- msgid "User IP Address"
2425
- msgstr ""
2426
-
2427
- #: includes/class-evf-smart-tags.php:39
2428
- msgid "User ID"
2429
- msgstr ""
2430
-
2431
- #: includes/class-evf-smart-tags.php:40
2432
- msgid "User Name"
2433
- msgstr ""
2434
-
2435
- #: includes/class-evf-smart-tags.php:41
2436
- msgid "User Email"
2437
- msgstr ""
2438
-
2439
- #: includes/class-evf-smart-tags.php:42
2440
- msgid "Referrer URL"
2441
- msgstr ""
2442
-
2443
- #: includes/class-evf-template-loader.php:65
2444
- msgid "Edit Form"
2445
- msgstr ""
2446
-
2447
- #. translators: %s - Form name.
2448
- #: includes/class-evf-template-loader.php:193
2449
- msgid "%s &ndash; Preview"
2450
- msgstr ""
2451
-
2452
- #. translators: %s template
2453
- #: includes/evf-core-functions.php:103
2454
- msgid "%s does not exist."
2455
- msgstr ""
2456
-
2457
- #: includes/evf-core-functions.php:120
2458
- msgid "action_args should not be overwritten when calling evf_get_template."
2459
- msgstr ""
2460
-
2461
- #: includes/evf-core-functions.php:294
2462
- #: includes/log-handlers/class-evf-log-handler-file.php:343
2463
- #: includes/log-handlers/class-evf-log-handler-file.php:363
2464
- msgid "This method should not be called before plugins_loaded."
2465
- msgstr ""
2466
-
2467
- #. translators: 1: class name 2: everest_forms_logging_class 3: EVF_Logger_Interface
2468
- #: includes/evf-core-functions.php:555
2469
- msgid "The class %1$s provided by %2$s filter must implement %3$s."
2470
- msgstr ""
2471
-
2472
- #: includes/evf-core-functions.php:1561
2473
- msgid "Afghanistan"
2474
- msgstr ""
2475
-
2476
- #: includes/evf-core-functions.php:1562
2477
- msgid "Åland Islands"
2478
- msgstr ""
2479
-
2480
- #: includes/evf-core-functions.php:1563
2481
- msgid "Albania"
2482
- msgstr ""
2483
-
2484
- #: includes/evf-core-functions.php:1564
2485
- msgid "Algeria"
2486
- msgstr ""
2487
-
2488
- #: includes/evf-core-functions.php:1565
2489
- msgid "American Samoa"
2490
- msgstr ""
2491
-
2492
- #: includes/evf-core-functions.php:1566
2493
- msgid "Andorra"
2494
- msgstr ""
2495
-
2496
- #: includes/evf-core-functions.php:1567
2497
- msgid "Angola"
2498
- msgstr ""
2499
-
2500
- #: includes/evf-core-functions.php:1568
2501
- msgid "Anguilla"
2502
- msgstr ""
2503
-
2504
- #: includes/evf-core-functions.php:1569
2505
- msgid "Antarctica"
2506
- msgstr ""
2507
-
2508
- #: includes/evf-core-functions.php:1570
2509
- msgid "Antigua and Barbuda"
2510
- msgstr ""
2511
-
2512
- #: includes/evf-core-functions.php:1571
2513
- msgid "Argentina"
2514
- msgstr ""
2515
-
2516
- #: includes/evf-core-functions.php:1572
2517
- msgid "Armenia"
2518
- msgstr ""
2519
-
2520
- #: includes/evf-core-functions.php:1573
2521
- msgid "Aruba"
2522
- msgstr ""
2523
-
2524
- #: includes/evf-core-functions.php:1574
2525
- msgid "Australia"
2526
- msgstr ""
2527
-
2528
- #: includes/evf-core-functions.php:1575
2529
- msgid "Austria"
2530
- msgstr ""
2531
-
2532
- #: includes/evf-core-functions.php:1576
2533
- msgid "Azerbaijan"
2534
- msgstr ""
2535
-
2536
- #: includes/evf-core-functions.php:1577
2537
- msgid "Bahamas"
2538
- msgstr ""
2539
-
2540
- #: includes/evf-core-functions.php:1578
2541
- msgid "Bahrain"
2542
- msgstr ""
2543
-
2544
- #: includes/evf-core-functions.php:1579
2545
- msgid "Bangladesh"
2546
- msgstr ""
2547
-
2548
- #: includes/evf-core-functions.php:1580
2549
- msgid "Barbados"
2550
- msgstr ""
2551
-
2552
- #: includes/evf-core-functions.php:1581
2553
- msgid "Belarus"
2554
- msgstr ""
2555
-
2556
- #: includes/evf-core-functions.php:1582
2557
- msgid "Belgium"
2558
- msgstr ""
2559
-
2560
- #: includes/evf-core-functions.php:1583
2561
- msgid "Belize"
2562
- msgstr ""
2563
-
2564
- #: includes/evf-core-functions.php:1584
2565
- msgid "Benin"
2566
- msgstr ""
2567
-
2568
- #: includes/evf-core-functions.php:1585
2569
- msgid "Bermuda"
2570
- msgstr ""
2571
-
2572
- #: includes/evf-core-functions.php:1586
2573
- msgid "Bhutan"
2574
- msgstr ""
2575
-
2576
- #: includes/evf-core-functions.php:1587
2577
- msgid "Bolivia (Plurinational State of)"
2578
- msgstr ""
2579
-
2580
- #: includes/evf-core-functions.php:1588
2581
- msgid "Bosnia and Herzegovina"
2582
- msgstr ""
2583
-
2584
- #: includes/evf-core-functions.php:1589
2585
- msgid "Botswana"
2586
- msgstr ""
2587
-
2588
- #: includes/evf-core-functions.php:1590
2589
- msgid "Bouvet Island"
2590
- msgstr ""
2591
-
2592
- #: includes/evf-core-functions.php:1591
2593
- msgid "Brazil"
2594
- msgstr ""
2595
-
2596
- #: includes/evf-core-functions.php:1592
2597
- msgid "British Indian Ocean Territory"
2598
- msgstr ""
2599
-
2600
- #: includes/evf-core-functions.php:1593
2601
- msgid "Brunei Darussalam"
2602
- msgstr ""
2603
-
2604
- #: includes/evf-core-functions.php:1594
2605
- msgid "Bulgaria"
2606
- msgstr ""
2607
-
2608
- #: includes/evf-core-functions.php:1595
2609
- msgid "Burkina Faso"
2610
- msgstr ""
2611
-
2612
- #: includes/evf-core-functions.php:1596
2613
- msgid "Burundi"
2614
- msgstr ""
2615
-
2616
- #: includes/evf-core-functions.php:1597
2617
- msgid "Cabo Verde"
2618
- msgstr ""
2619
-
2620
- #: includes/evf-core-functions.php:1598
2621
- msgid "Cambodia"
2622
- msgstr ""
2623
-
2624
- #: includes/evf-core-functions.php:1599
2625
- msgid "Cameroon"
2626
- msgstr ""
2627
-
2628
- #: includes/evf-core-functions.php:1600
2629
- msgid "Canada"
2630
- msgstr ""
2631
-
2632
- #: includes/evf-core-functions.php:1601
2633
- msgid "Cayman Islands"
2634
- msgstr ""
2635
-
2636
- #: includes/evf-core-functions.php:1602
2637
- msgid "Central African Republic"
2638
- msgstr ""
2639
-
2640
- #: includes/evf-core-functions.php:1603
2641
- msgid "Chad"
2642
- msgstr ""
2643
-
2644
- #: includes/evf-core-functions.php:1604
2645
- msgid "Chile"
2646
- msgstr ""
2647
-
2648
- #: includes/evf-core-functions.php:1605
2649
- msgid "China"
2650
- msgstr ""
2651
-
2652
- #: includes/evf-core-functions.php:1606
2653
- msgid "Christmas Island"
2654
- msgstr ""
2655
-
2656
- #: includes/evf-core-functions.php:1607
2657
- msgid "Cocos (Keeling) Islands"
2658
- msgstr ""
2659
-
2660
- #: includes/evf-core-functions.php:1608
2661
- msgid "Colombia"
2662
- msgstr ""
2663
-
2664
- #: includes/evf-core-functions.php:1609
2665
- msgid "Comoros"
2666
- msgstr ""
2667
-
2668
- #: includes/evf-core-functions.php:1610
2669
- msgid "Congo"
2670
- msgstr ""
2671
-
2672
- #: includes/evf-core-functions.php:1611
2673
- msgid "Congo (Democratic Republic of the)"
2674
- msgstr ""
2675
-
2676
- #: includes/evf-core-functions.php:1612
2677
- msgid "Cook Islands"
2678
- msgstr ""
2679
-
2680
- #: includes/evf-core-functions.php:1613
2681
- msgid "Costa Rica"
2682
- msgstr ""
2683
-
2684
- #: includes/evf-core-functions.php:1614
2685
- msgid "Côte d'Ivoire"
2686
- msgstr ""
2687
-
2688
- #: includes/evf-core-functions.php:1615
2689
- msgid "Croatia"
2690
- msgstr ""
2691
-
2692
- #: includes/evf-core-functions.php:1616
2693
- msgid "Cuba"
2694
- msgstr ""
2695
-
2696
- #: includes/evf-core-functions.php:1617
2697
- msgid "Curaçao"
2698
- msgstr ""
2699
-
2700
- #: includes/evf-core-functions.php:1618
2701
- msgid "Cyprus"
2702
- msgstr ""
2703
-
2704
- #: includes/evf-core-functions.php:1619
2705
- msgid "Czech Republic"
2706
- msgstr ""
2707
-
2708
- #: includes/evf-core-functions.php:1620
2709
- msgid "Denmark"
2710
- msgstr ""
2711
-
2712
- #: includes/evf-core-functions.php:1621
2713
- msgid "Djibouti"
2714
- msgstr ""
2715
-
2716
- #: includes/evf-core-functions.php:1622
2717
- msgid "Dominica"
2718
- msgstr ""
2719
-
2720
- #: includes/evf-core-functions.php:1623
2721
- msgid "Dominican Republic"
2722
- msgstr ""
2723
-
2724
- #: includes/evf-core-functions.php:1624
2725
- msgid "Ecuador"
2726
- msgstr ""
2727
-
2728
- #: includes/evf-core-functions.php:1625
2729
- msgid "Egypt"
2730
- msgstr ""
2731
-
2732
- #: includes/evf-core-functions.php:1626
2733
- msgid "El Salvador"
2734
- msgstr ""
2735
-
2736
- #: includes/evf-core-functions.php:1627
2737
- msgid "Equatorial Guinea"
2738
- msgstr ""
2739
-
2740
- #: includes/evf-core-functions.php:1628
2741
- msgid "Eritrea"
2742
- msgstr ""
2743
-
2744
- #: includes/evf-core-functions.php:1629
2745
- msgid "Estonia"
2746
- msgstr ""
2747
-
2748
- #: includes/evf-core-functions.php:1630
2749
- msgid "Ethiopia"
2750
- msgstr ""
2751
-
2752
- #: includes/evf-core-functions.php:1631
2753
- msgid "Falkland Islands (Malvinas)"
2754
- msgstr ""
2755
-
2756
- #: includes/evf-core-functions.php:1632
2757
- msgid "Faroe Islands"
2758
- msgstr ""
2759
-
2760
- #: includes/evf-core-functions.php:1633
2761
- msgid "Fiji"
2762
- msgstr ""
2763
-
2764
- #: includes/evf-core-functions.php:1634
2765
- msgid "Finland"
2766
- msgstr ""
2767
-
2768
- #: includes/evf-core-functions.php:1635
2769
- msgid "France"
2770
- msgstr ""
2771
-
2772
- #: includes/evf-core-functions.php:1636
2773
- msgid "French Guiana"
2774
- msgstr ""
2775
-
2776
- #: includes/evf-core-functions.php:1637
2777
- msgid "French Polynesia"
2778
- msgstr ""
2779
-
2780
- #: includes/evf-core-functions.php:1638
2781
- msgid "French Southern Territories"
2782
- msgstr ""
2783
-
2784
- #: includes/evf-core-functions.php:1639
2785
- msgid "Gabon"
2786
- msgstr ""
2787
-
2788
- #: includes/evf-core-functions.php:1640
2789
- msgid "Gambia"
2790
- msgstr ""
2791
-
2792
- #: includes/evf-core-functions.php:1641
2793
- msgctxt "Country"
2794
- msgid "Georgia"
2795
- msgstr ""
2796
-
2797
- #: includes/evf-core-functions.php:1642
2798
- msgid "Germany"
2799
- msgstr ""
2800
-
2801
- #: includes/evf-core-functions.php:1643
2802
- msgid "Ghana"
2803
- msgstr ""
2804
-
2805
- #: includes/evf-core-functions.php:1644
2806
- msgid "Gibraltar"
2807
- msgstr ""
2808
-
2809
- #: includes/evf-core-functions.php:1645
2810
- msgid "Greece"
2811
- msgstr ""
2812
-
2813
- #: includes/evf-core-functions.php:1646
2814
- msgid "Greenland"
2815
- msgstr ""
2816
-
2817
- #: includes/evf-core-functions.php:1647
2818
- msgid "Grenada"
2819
- msgstr ""
2820
-
2821
- #: includes/evf-core-functions.php:1648
2822
- msgid "Guadeloupe"
2823
- msgstr ""
2824
-
2825
- #: includes/evf-core-functions.php:1649
2826
- msgid "Guam"
2827
- msgstr ""
2828
-
2829
- #: includes/evf-core-functions.php:1650
2830
- msgid "Guatemala"
2831
- msgstr ""
2832
-
2833
- #: includes/evf-core-functions.php:1651
2834
- msgid "Guernsey"
2835
- msgstr ""
2836
-
2837
- #: includes/evf-core-functions.php:1652
2838
- msgid "Guinea"
2839
- msgstr ""
2840
-
2841
- #: includes/evf-core-functions.php:1653
2842
- msgid "Guinea-Bissau"
2843
- msgstr ""
2844
-
2845
- #: includes/evf-core-functions.php:1654
2846
- msgid "Guyana"
2847
- msgstr ""
2848
-
2849
- #: includes/evf-core-functions.php:1655
2850
- msgid "Haiti"
2851
- msgstr ""
2852
-
2853
- #: includes/evf-core-functions.php:1656
2854
- msgid "Heard Island and McDonald Islands"
2855
- msgstr ""
2856
-
2857
- #: includes/evf-core-functions.php:1657
2858
- msgid "Honduras"
2859
- msgstr ""
2860
-
2861
- #: includes/evf-core-functions.php:1658
2862
- msgid "Hong Kong"
2863
- msgstr ""
2864
-
2865
- #: includes/evf-core-functions.php:1659
2866
- msgid "Hungary"
2867
- msgstr ""
2868
-
2869
- #: includes/evf-core-functions.php:1660
2870
- msgid "Iceland"
2871
- msgstr ""
2872
-
2873
- #: includes/evf-core-functions.php:1661
2874
- msgid "India"
2875
- msgstr ""
2876
-
2877
- #: includes/evf-core-functions.php:1662
2878
- msgid "Indonesia"
2879
- msgstr ""
2880
-
2881
- #: includes/evf-core-functions.php:1663
2882
- msgid "Iran (Islamic Republic of)"
2883
- msgstr ""
2884
-
2885
- #: includes/evf-core-functions.php:1664
2886
- msgid "Iraq"
2887
- msgstr ""
2888
-
2889
- #: includes/evf-core-functions.php:1665
2890
- msgid "Ireland (Republic of)"
2891
- msgstr ""
2892
-
2893
- #: includes/evf-core-functions.php:1666
2894
- msgid "Isle of Man"
2895
- msgstr ""
2896
-
2897
- #: includes/evf-core-functions.php:1667
2898
- msgid "Israel"
2899
- msgstr ""
2900
-
2901
- #: includes/evf-core-functions.php:1668
2902
- msgid "Italy"
2903
- msgstr ""
2904
-
2905
- #: includes/evf-core-functions.php:1669
2906
- msgid "Jamaica"
2907
- msgstr ""
2908
-
2909
- #: includes/evf-core-functions.php:1670
2910
- msgid "Japan"
2911
- msgstr ""
2912
-
2913
- #: includes/evf-core-functions.php:1671
2914
- msgid "Jersey"
2915
- msgstr ""
2916
-
2917
- #: includes/evf-core-functions.php:1672
2918
- msgid "Jordan"
2919
- msgstr ""
2920
-
2921
- #: includes/evf-core-functions.php:1673
2922
- msgid "Kazakhstan"
2923
- msgstr ""
2924
-
2925
- #: includes/evf-core-functions.php:1674
2926
- msgid "Kenya"
2927
- msgstr ""
2928
-
2929
- #: includes/evf-core-functions.php:1675
2930
- msgid "Kiribati"
2931
- msgstr ""
2932
-
2933
- #: includes/evf-core-functions.php:1676
2934
- msgid "Korea (Democratic People's Republic of)"
2935
- msgstr ""
2936
-
2937
- #: includes/evf-core-functions.php:1677
2938
- msgid "Korea (Republic of)"
2939
- msgstr ""
2940
-
2941
- #: includes/evf-core-functions.php:1678
2942
- msgid "Kuwait"
2943
- msgstr ""
2944
-
2945
- #: includes/evf-core-functions.php:1679
2946
- msgid "Kyrgyzstan"
2947
- msgstr ""
2948
-
2949
- #: includes/evf-core-functions.php:1680
2950
- msgid "Lao People's Democratic Republic"
2951
- msgstr ""
2952
-
2953
- #: includes/evf-core-functions.php:1681
2954
- msgid "Latvia"
2955
- msgstr ""
2956
-
2957
- #: includes/evf-core-functions.php:1682
2958
- msgid "Lebanon"
2959
- msgstr ""
2960
-
2961
- #: includes/evf-core-functions.php:1683
2962
- msgid "Lesotho"
2963
- msgstr ""
2964
-
2965
- #: includes/evf-core-functions.php:1684
2966
- msgid "Liberia"
2967
- msgstr ""
2968
-
2969
- #: includes/evf-core-functions.php:1685
2970
- msgid "Libya"
2971
- msgstr ""
2972
-
2973
- #: includes/evf-core-functions.php:1686
2974
- msgid "Liechtenstein"
2975
- msgstr ""
2976
-
2977
- #: includes/evf-core-functions.php:1687
2978
- msgid "Lithuania"
2979
- msgstr ""
2980
-
2981
- #: includes/evf-core-functions.php:1688
2982
- msgid "Luxembourg"
2983
- msgstr ""
2984
-
2985
- #: includes/evf-core-functions.php:1689
2986
- msgid "Macao"
2987
- msgstr ""
2988
-
2989
- #: includes/evf-core-functions.php:1690
2990
- msgid "Macedonia (Republic of)"
2991
- msgstr ""
2992
-
2993
- #: includes/evf-core-functions.php:1691
2994
- msgid "Madagascar"
2995
- msgstr ""
2996
-
2997
- #: includes/evf-core-functions.php:1692
2998
- msgid "Malawi"
2999
- msgstr ""
3000
-
3001
- #: includes/evf-core-functions.php:1693
3002
- msgid "Malaysia"
3003
- msgstr ""
3004
-
3005
- #: includes/evf-core-functions.php:1694
3006
- msgid "Maldives"
3007
- msgstr ""
3008
-
3009
- #: includes/evf-core-functions.php:1695
3010
- msgid "Mali"
3011
- msgstr ""
3012
-
3013
- #: includes/evf-core-functions.php:1696
3014
- msgid "Malta"
3015
- msgstr ""
3016
-
3017
- #: includes/evf-core-functions.php:1697
3018
- msgid "Marshall Islands"
3019
- msgstr ""
3020
-
3021
- #: includes/evf-core-functions.php:1698
3022
- msgid "Martinique"
3023
- msgstr ""
3024
-
3025
- #: includes/evf-core-functions.php:1699
3026
- msgid "Mauritania"
3027
- msgstr ""
3028
-
3029
- #: includes/evf-core-functions.php:1700
3030
- msgid "Mauritius"
3031
- msgstr ""
3032
-
3033
- #: includes/evf-core-functions.php:1701
3034
- msgid "Mayotte"
3035
- msgstr ""
3036
-
3037
- #: includes/evf-core-functions.php:1702
3038
- msgid "Mexico"
3039
- msgstr ""
3040
-
3041
- #: includes/evf-core-functions.php:1703
3042
- msgid "Micronesia (Federated States of)"
3043
- msgstr ""
3044
-
3045
- #: includes/evf-core-functions.php:1704
3046
- msgid "Moldova (Republic of)"
3047
- msgstr ""
3048
-
3049
- #: includes/evf-core-functions.php:1705
3050
- msgid "Monaco"
3051
- msgstr ""
3052
-
3053
- #: includes/evf-core-functions.php:1706
3054
- msgid "Mongolia"
3055
- msgstr ""
3056
-
3057
- #: includes/evf-core-functions.php:1707
3058
- msgid "Montenegro"
3059
- msgstr ""
3060
-
3061
- #: includes/evf-core-functions.php:1708
3062
- msgid "Montserrat"
3063
- msgstr ""
3064
-
3065
- #: includes/evf-core-functions.php:1709
3066
- msgid "Morocco"
3067
- msgstr ""
3068
-
3069
- #: includes/evf-core-functions.php:1710
3070
- msgid "Mozambique"
3071
- msgstr ""
3072
-
3073
- #: includes/evf-core-functions.php:1711
3074
- msgid "Myanmar"
3075
- msgstr ""
3076
-
3077
- #: includes/evf-core-functions.php:1712
3078
- msgid "Namibia"
3079
- msgstr ""
3080
-
3081
- #: includes/evf-core-functions.php:1713
3082
- msgid "Nauru"
3083
- msgstr ""
3084
-
3085
- #: includes/evf-core-functions.php:1714
3086
- msgid "Nepal"
3087
- msgstr ""
3088
-
3089
- #: includes/evf-core-functions.php:1715
3090
- msgid "Netherlands"
3091
- msgstr ""
3092
-
3093
- #: includes/evf-core-functions.php:1716
3094
- msgid "New Caledonia"
3095
- msgstr ""
3096
-
3097
- #: includes/evf-core-functions.php:1717
3098
- msgid "New Zealand"
3099
- msgstr ""
3100
-
3101
- #: includes/evf-core-functions.php:1718
3102
- msgid "Nicaragua"
3103
- msgstr ""
3104
-
3105
- #: includes/evf-core-functions.php:1719
3106
- msgid "Niger"
3107
- msgstr ""
3108
-
3109
- #: includes/evf-core-functions.php:1720
3110
- msgid "Nigeria"
3111
- msgstr ""
3112
-
3113
- #: includes/evf-core-functions.php:1721
3114
- msgid "Niue"
3115
- msgstr ""
3116
-
3117
- #: includes/evf-core-functions.php:1722
3118
- msgid "Norfolk Island"
3119
- msgstr ""
3120
-
3121
- #: includes/evf-core-functions.php:1723
3122
- msgid "Northern Mariana Islands"
3123
- msgstr ""
3124
-
3125
- #: includes/evf-core-functions.php:1724
3126
- msgid "Norway"
3127
- msgstr ""
3128
-
3129
- #: includes/evf-core-functions.php:1725
3130
- msgid "Oman"
3131
- msgstr ""
3132
-
3133
- #: includes/evf-core-functions.php:1726
3134
- msgid "Pakistan"
3135
- msgstr ""
3136
-
3137
- #: includes/evf-core-functions.php:1727
3138
- msgid "Palau"
3139
- msgstr ""
3140
-
3141
- #: includes/evf-core-functions.php:1728
3142
- msgid "Palestine (State of)"
3143
- msgstr ""
3144
-
3145
- #: includes/evf-core-functions.php:1729
3146
- msgid "Panama"
3147
- msgstr ""
3148
-
3149
- #: includes/evf-core-functions.php:1730
3150
- msgid "Papua New Guinea"
3151
- msgstr ""
3152
-
3153
- #: includes/evf-core-functions.php:1731
3154
- msgid "Paraguay"
3155
- msgstr ""
3156
-
3157
- #: includes/evf-core-functions.php:1732
3158
- msgid "Peru"
3159
- msgstr ""
3160
-
3161
- #: includes/evf-core-functions.php:1733
3162
- msgid "Philippines"
3163
- msgstr ""
3164
-
3165
- #: includes/evf-core-functions.php:1734
3166
- msgid "Pitcairn"
3167
- msgstr ""
3168
-
3169
- #: includes/evf-core-functions.php:1735
3170
- msgid "Poland"
3171
- msgstr ""
3172
-
3173
- #: includes/evf-core-functions.php:1736
3174
- msgid "Portugal"
3175
- msgstr ""
3176
-
3177
- #: includes/evf-core-functions.php:1737
3178
- msgid "Puerto Rico"
3179
- msgstr ""
3180
-
3181
- #: includes/evf-core-functions.php:1738
3182
- msgid "Qatar"
3183
- msgstr ""
3184
-
3185
- #: includes/evf-core-functions.php:1739
3186
- msgid "Réunion"
3187
- msgstr ""
3188
-
3189
- #: includes/evf-core-functions.php:1740
3190
- msgid "Romania"
3191
- msgstr ""
3192
-
3193
- #: includes/evf-core-functions.php:1741
3194
- msgid "Russian Federation"
3195
- msgstr ""
3196
-
3197
- #: includes/evf-core-functions.php:1742
3198
- msgid "Rwanda"
3199
- msgstr ""
3200
-
3201
- #: includes/evf-core-functions.php:1743
3202
- msgid "Saint Barthélemy"
3203
- msgstr ""
3204
-
3205
- #: includes/evf-core-functions.php:1744
3206
- msgid "Saint Helena, Ascension and Tristan da Cunha"
3207
- msgstr ""
3208
-
3209
- #: includes/evf-core-functions.php:1745
3210
- msgid "Saint Kitts and Nevis"
3211
- msgstr ""
3212
-
3213
- #: includes/evf-core-functions.php:1746
3214
- msgid "Saint Lucia"
3215
- msgstr ""
3216
-
3217
- #: includes/evf-core-functions.php:1747
3218
- msgid "Saint Martin (French part)"
3219
- msgstr ""
3220
-
3221
- #: includes/evf-core-functions.php:1748
3222
- msgid "Saint Pierre and Miquelon"
3223
- msgstr ""
3224
-
3225
- #: includes/evf-core-functions.php:1749
3226
- msgid "Saint Vincent and the Grenadines"
3227
- msgstr ""
3228
-
3229
- #: includes/evf-core-functions.php:1750
3230
- msgid "Samoa"
3231
- msgstr ""
3232
-
3233
- #: includes/evf-core-functions.php:1751
3234
- msgid "San Marino"
3235
- msgstr ""
3236
-
3237
- #: includes/evf-core-functions.php:1752
3238
- msgid "Sao Tome and Principe"
3239
- msgstr ""
3240
-
3241
- #: includes/evf-core-functions.php:1753
3242
- msgid "Saudi Arabia"
3243
- msgstr ""
3244
-
3245
- #: includes/evf-core-functions.php:1754
3246
- msgid "Senegal"
3247
- msgstr ""
3248
-
3249
- #: includes/evf-core-functions.php:1755
3250
- msgid "Serbia"
3251
- msgstr ""
3252
-
3253
- #: includes/evf-core-functions.php:1756
3254
- msgid "Seychelles"
3255
- msgstr ""
3256
-
3257
- #: includes/evf-core-functions.php:1757
3258
- msgid "Sierra Leone"
3259
- msgstr ""
3260
-
3261
- #: includes/evf-core-functions.php:1758
3262
- msgid "Singapore"
3263
- msgstr ""
3264
-
3265
- #: includes/evf-core-functions.php:1759
3266
- msgid "Sint Maarten (Dutch part)"
3267
- msgstr ""
3268
-
3269
- #: includes/evf-core-functions.php:1760
3270
- msgid "Slovakia"
3271
- msgstr ""
3272
-
3273
- #: includes/evf-core-functions.php:1761
3274
- msgid "Slovenia"
3275
- msgstr ""
3276
-
3277
- #: includes/evf-core-functions.php:1762
3278
- msgid "Solomon Islands"
3279
- msgstr ""
3280
-
3281
- #: includes/evf-core-functions.php:1763
3282
- msgid "Somalia"
3283
- msgstr ""
3284
-
3285
- #: includes/evf-core-functions.php:1764
3286
- msgid "South Africa"
3287
- msgstr ""
3288
-
3289
- #: includes/evf-core-functions.php:1765
3290
- msgid "South Georgia and the South Sandwich Islands"
3291
- msgstr ""
3292
-
3293
- #: includes/evf-core-functions.php:1766
3294
- msgid "South Sudan"
3295
- msgstr ""
3296
-
3297
- #: includes/evf-core-functions.php:1767
3298
- msgid "Spain"
3299
- msgstr ""
3300
-
3301
- #: includes/evf-core-functions.php:1768
3302
- msgid "Sri Lanka"
3303
- msgstr ""
3304
-
3305
- #: includes/evf-core-functions.php:1769
3306
- msgid "Sudan"
3307
- msgstr ""
3308
-
3309
- #: includes/evf-core-functions.php:1770
3310
- msgid "Suriname"
3311
- msgstr ""
3312
-
3313
- #: includes/evf-core-functions.php:1771
3314
- msgid "Svalbard and Jan Mayen"
3315
- msgstr ""
3316
-
3317
- #: includes/evf-core-functions.php:1772
3318
- msgid "Swaziland"
3319
- msgstr ""
3320
-
3321
- #: includes/evf-core-functions.php:1773
3322
- msgid "Sweden"
3323
- msgstr ""
3324
-
3325
- #: includes/evf-core-functions.php:1774
3326
- msgid "Switzerland"
3327
- msgstr ""
3328
-
3329
- #: includes/evf-core-functions.php:1775
3330
- msgid "Syrian Arab Republic"
3331
- msgstr ""
3332
-
3333
- #: includes/evf-core-functions.php:1776
3334
- msgid "Taiwan, Province of China"
3335
- msgstr ""
3336
-
3337
- #: includes/evf-core-functions.php:1777
3338
- msgid "Tajikistan"
3339
- msgstr ""
3340
-
3341
- #: includes/evf-core-functions.php:1778
3342
- msgid "Tanzania (United Republic of)"
3343
- msgstr ""
3344
-
3345
- #: includes/evf-core-functions.php:1779
3346
- msgid "Thailand"
3347
- msgstr ""
3348
-
3349
- #: includes/evf-core-functions.php:1780
3350
- msgid "Timor-Leste"
3351
- msgstr ""
3352
-
3353
- #: includes/evf-core-functions.php:1781
3354
- msgid "Togo"
3355
- msgstr ""
3356
-
3357
- #: includes/evf-core-functions.php:1782
3358
- msgid "Tokelau"
3359
- msgstr ""
3360
-
3361
- #: includes/evf-core-functions.php:1783
3362
- msgid "Tonga"
3363
- msgstr ""
3364
-
3365
- #: includes/evf-core-functions.php:1784
3366
- msgid "Trinidad and Tobago"
3367
- msgstr ""
3368
-
3369
- #: includes/evf-core-functions.php:1785
3370
- msgid "Tunisia"
3371
- msgstr ""
3372
-
3373
- #: includes/evf-core-functions.php:1786
3374
- msgid "Turkey"
3375
- msgstr ""
3376
-
3377
- #: includes/evf-core-functions.php:1787
3378
- msgid "Turkmenistan"
3379
- msgstr ""
3380
-
3381
- #: includes/evf-core-functions.php:1788
3382
- msgid "Turks and Caicos Islands"
3383
- msgstr ""
3384
-
3385
- #: includes/evf-core-functions.php:1789
3386
- msgid "Tuvalu"
3387
- msgstr ""
3388
-
3389
- #: includes/evf-core-functions.php:1790
3390
- msgid "Uganda"
3391
- msgstr ""
3392
-
3393
- #: includes/evf-core-functions.php:1791
3394
- msgid "Ukraine"
3395
- msgstr ""
3396
-
3397
- #: includes/evf-core-functions.php:1792
3398
- msgid "United Arab Emirates"
3399
- msgstr ""
3400
-
3401
- #: includes/evf-core-functions.php:1793
3402
- msgid "United Kingdom of Great Britain and Northern Ireland"
3403
- msgstr ""
3404
-
3405
- #: includes/evf-core-functions.php:1794
3406
- msgid "United States of America"
3407
- msgstr ""
3408
-
3409
- #: includes/evf-core-functions.php:1795
3410
- msgid "United States Minor Outlying Islands"
3411
- msgstr ""
3412
-
3413
- #: includes/evf-core-functions.php:1796
3414
- msgid "Uruguay"
3415
- msgstr ""
3416
-
3417
- #: includes/evf-core-functions.php:1797
3418
- msgid "Uzbekistan"
3419
- msgstr ""
3420
-
3421
- #: includes/evf-core-functions.php:1798
3422
- msgid "Vanuatu"
3423
- msgstr ""
3424
-
3425
- #: includes/evf-core-functions.php:1799
3426
- msgid "Vatican City State"
3427
- msgstr ""
3428
-
3429
- #: includes/evf-core-functions.php:1800
3430
- msgid "Venezuela (Bolivarian Republic of)"
3431
- msgstr ""
3432
-
3433
- #: includes/evf-core-functions.php:1801
3434
- msgid "Viet Nam"
3435
- msgstr ""
3436
-
3437
- #: includes/evf-core-functions.php:1802
3438
- msgid "Virgin Islands (British)"
3439
- msgstr ""
3440
-
3441
- #: includes/evf-core-functions.php:1803
3442
- msgid "Virgin Islands (U.S.)"
3443
- msgstr ""
3444
-
3445
- #: includes/evf-core-functions.php:1804
3446
- msgid "Wallis and Futuna"
3447
- msgstr ""
3448
-
3449
- #: includes/evf-core-functions.php:1805
3450
- msgid "Western Sahara"
3451
- msgstr ""
3452
-
3453
- #: includes/evf-core-functions.php:1806
3454
- msgid "Yemen"
3455
- msgstr ""
3456
-
3457
- #: includes/evf-core-functions.php:1807
3458
- msgid "Zambia"
3459
- msgstr ""
3460
-
3461
- #: includes/evf-core-functions.php:1808
3462
- msgid "Zimbabwe"
3463
- msgstr ""
3464
-
3465
- #: includes/evf-core-functions.php:1823
3466
- msgid "General Fields"
3467
- msgstr ""
3468
-
3469
- #: includes/evf-core-functions.php:1824
3470
- msgid "Advanced Fields"
3471
- msgstr ""
3472
-
3473
- #: includes/evf-core-functions.php:1825
3474
- msgid "Payment Fields"
3475
- msgstr ""
3476
-
3477
- #: includes/evf-core-functions.php:1826
3478
- msgid "Survey Fields"
3479
- msgstr ""
3480
-
3481
- #: includes/evf-core-functions.php:1877
3482
- msgid "Check this option to mark the field required."
3483
- msgstr ""
3484
-
3485
- #: includes/evf-core-functions.php:1888
3486
- #: includes/fields/class-evf-field-checkbox.php:27
3487
- #: includes/fields/class-evf-field-radio.php:27
3488
- msgid "First Choice"
3489
- msgstr ""
3490
-
3491
- #: includes/evf-core-functions.php:1889
3492
- #: includes/fields/class-evf-field-checkbox.php:33
3493
- #: includes/fields/class-evf-field-radio.php:33
3494
- msgid "Second Choice"
3495
- msgstr ""
3496
-
3497
- #: includes/evf-core-functions.php:1890
3498
- #: includes/fields/class-evf-field-checkbox.php:39
3499
- #: includes/fields/class-evf-field-radio.php:39
3500
- msgid "Third Choice"
3501
- msgstr ""
3502
-
3503
- #: includes/evf-core-functions.php:1904
3504
- msgid "Enter CSS class for this field container. Class names should be separated with spaces."
3505
- msgstr ""
3506
-
3507
- #: includes/evf-entry-functions.php:80
3508
- msgid "Published"
3509
- msgstr ""
3510
-
3511
- #: includes/evf-notice-functions.php:23
3512
- #: includes/evf-notice-functions.php:54
3513
- #: includes/evf-notice-functions.php:73
3514
- #: includes/evf-notice-functions.php:97
3515
- #: includes/evf-notice-functions.php:110
3516
- #: includes/evf-notice-functions.php:125
3517
- #: includes/evf-notice-functions.php:185
3518
- msgid "This function should not be called before everest_forms_init."
3519
- msgstr ""
3520
-
3521
- #: includes/export/class-evf-entry-csv-exporter.php:67
3522
- msgid "ID"
3523
- msgstr ""
3524
-
3525
- #: includes/export/class-evf-entry-csv-exporter.php:79
3526
- msgid "Status"
3527
- msgstr ""
3528
-
3529
- #: includes/export/class-evf-entry-csv-exporter.php:81
3530
- msgid "Date Created GMT"
3531
- msgstr ""
3532
-
3533
- #: includes/export/class-evf-entry-csv-exporter.php:85
3534
- msgid "User Device"
3535
- msgstr ""
3536
-
3537
- #. translators: 1: entry date 2: entry time
3538
- #: includes/export/class-evf-entry-csv-exporter.php:198
3539
- #: includes/export/class-evf-entry-csv-exporter.php:215
3540
- msgid "%1$s %2$s"
3541
- msgstr ""
3542
-
3543
- #: includes/fields/class-evf-field-address.php:20
3544
- msgid "Address"
3545
- msgstr ""
3546
-
3547
- #: includes/fields/class-evf-field-captcha.php:20
3548
- msgid "Captcha"
3549
- msgstr ""
3550
-
3551
- #: includes/fields/class-evf-field-checkbox.php:20
3552
- #: includes/fields/class-evf-field-payment-checkbox.php:20
3553
- msgid "Checkboxes"
3554
- msgstr ""
3555
-
3556
- #: includes/fields/class-evf-field-checkbox.php:170
3557
- msgid "Checked"
3558
- msgstr ""
3559
-
3560
- #. translators: %s - Choice Number.
3561
- #: includes/fields/class-evf-field-checkbox.php:173
3562
- msgid "Choice %s"
3563
- msgstr ""
3564
-
3565
- #: includes/fields/class-evf-field-checkbox.php:250
3566
- #: includes/fields/class-evf-field-radio.php:216
3567
- msgid "Randomize Choices"
3568
- msgstr ""
3569
-
3570
- #: includes/fields/class-evf-field-checkbox.php:251
3571
- #: includes/fields/class-evf-field-radio.php:217
3572
- msgid "Check this option to randomize the order of the choices."
3573
- msgstr ""
3574
-
3575
- #: includes/fields/class-evf-field-checkbox.php:271
3576
- msgid "Choice Limit"
3577
- msgstr ""
3578
-
3579
- #: includes/fields/class-evf-field-checkbox.php:272
3580
- msgid "Check this option to limit the number of checkboxes a user can select."
3581
- msgstr ""
3582
-
3583
- #: includes/fields/class-evf-field-checkbox.php:310
3584
- #: includes/fields/class-evf-field-radio.php:241
3585
- msgid "Show Values"
3586
- msgstr ""
3587
-
3588
- #: includes/fields/class-evf-field-checkbox.php:311
3589
- #: includes/fields/class-evf-field-radio.php:242
3590
- msgid "Check this to manually set form field values."
3591
- msgstr ""
3592
-
3593
- #: includes/fields/class-evf-field-credit-card.php:20
3594
- msgid "Credit Card"
3595
- msgstr ""
3596
-
3597
- #: includes/fields/class-evf-field-date-time.php:20
3598
- msgid "Date / Time"
3599
- msgstr ""
3600
-
3601
- #: includes/fields/class-evf-field-date-time.php:70
3602
- msgid "Format"
3603
- msgstr ""
3604
-
3605
- #: includes/fields/class-evf-field-date-time.php:71
3606
- msgid "Select a format for the date field."
3607
- msgstr ""
3608
-
3609
- #: includes/fields/class-evf-field-date-time.php:83
3610
- #: includes/fields/class-evf-field-date-time.php:354
3611
- msgid "Time"
3612
- msgstr ""
3613
-
3614
- #: includes/fields/class-evf-field-date-time.php:84
3615
- msgid "Both"
3616
- msgstr ""
3617
-
3618
- #: includes/fields/class-evf-field-date-time.php:113
3619
- msgid "Date & Time Format"
3620
- msgstr ""
3621
-
3622
- #: includes/fields/class-evf-field-date-time.php:114
3623
- msgid "Advanced date and time formatting options."
3624
- msgstr ""
3625
-
3626
- #: includes/fields/class-evf-field-date-time.php:128
3627
- msgid "Date Format"
3628
- msgstr ""
3629
-
3630
- #: includes/fields/class-evf-field-date-time.php:129
3631
- msgid "Choose a desire date format to display."
3632
- msgstr ""
3633
-
3634
- #: includes/fields/class-evf-field-date-time.php:152
3635
- msgid "Clear"
3636
- msgstr ""
3637
-
3638
- #: includes/fields/class-evf-field-date-time.php:158
3639
- msgid "Disable Dates"
3640
- msgstr ""
3641
-
3642
- #: includes/fields/class-evf-field-date-time.php:159
3643
- msgid "Select which dates you want to disable."
3644
- msgstr ""
3645
-
3646
- #: includes/fields/class-evf-field-date-time.php:184
3647
- msgid "Date Mode"
3648
- msgstr ""
3649
-
3650
- #: includes/fields/class-evf-field-date-time.php:185
3651
- msgid "Select your desire date mode."
3652
- msgstr ""
3653
-
3654
- #: includes/fields/class-evf-field-date-time.php:200
3655
- msgid "Date Localization"
3656
- msgstr ""
3657
-
3658
- #: includes/fields/class-evf-field-date-time.php:201
3659
- msgid "Choose a desire date localization to display."
3660
- msgstr ""
3661
-
3662
- #: includes/fields/class-evf-field-date-time.php:283
3663
- msgid "Default to current date."
3664
- msgstr ""
3665
-
3666
- #: includes/fields/class-evf-field-date-time.php:284
3667
- msgid "Check this option to set current date as default."
3668
- msgstr ""
3669
-
3670
- #: includes/fields/class-evf-field-date-time.php:295
3671
- msgid "Enable Min Max date."
3672
- msgstr ""
3673
-
3674
- #: includes/fields/class-evf-field-date-time.php:296
3675
- msgid "Check this option to set min max date."
3676
- msgstr ""
3677
-
3678
- #: includes/fields/class-evf-field-date-time.php:306
3679
- msgid "Minimum Date"
3680
- msgstr ""
3681
-
3682
- #: includes/fields/class-evf-field-date-time.php:307
3683
- msgid "Select minium date."
3684
- msgstr ""
3685
-
3686
- #: includes/fields/class-evf-field-date-time.php:328
3687
- msgid "Maximum Date"
3688
- msgstr ""
3689
-
3690
- #: includes/fields/class-evf-field-date-time.php:329
3691
- msgid "Select maximum date."
3692
- msgstr ""
3693
-
3694
- #: includes/fields/class-evf-field-date-time.php:361
3695
- msgid "Time interval and format"
3696
- msgstr ""
3697
-
3698
- #: includes/fields/class-evf-field-date-time.php:362
3699
- msgid "Choose time interval and format to display."
3700
- msgstr ""
3701
-
3702
- #: includes/fields/class-evf-field-date-time.php:376
3703
- msgid "15 minutes"
3704
- msgstr ""
3705
-
3706
- #: includes/fields/class-evf-field-date-time.php:377
3707
- msgid "30 minutes"
3708
- msgstr ""
3709
-
3710
- #: includes/fields/class-evf-field-date-time.php:390
3711
- msgid "12 H"
3712
- msgstr ""
3713
-
3714
- #: includes/fields/class-evf-field-date-time.php:391
3715
- msgid "24 H"
3716
- msgstr ""
3717
-
3718
- #: includes/fields/class-evf-field-email.php:117
3719
- #: includes/fields/class-evf-field-email.php:270
3720
- msgid "Confirm Email"
3721
- msgstr ""
3722
-
3723
- #: includes/fields/class-evf-field-email.php:203
3724
- msgid "Enable Email Confirmation"
3725
- msgstr ""
3726
-
3727
- #: includes/fields/class-evf-field-email.php:204
3728
- msgid "Check to enable email confirmation."
3729
- msgstr ""
3730
-
3731
- #: includes/fields/class-evf-field-email.php:226
3732
- msgid "Confirmation Placeholder Text"
3733
- msgstr ""
3734
-
3735
- #: includes/fields/class-evf-field-email.php:227
3736
- msgid "Enter text for the confirmation field placeholder."
3737
- msgstr ""
3738
-
3739
- #: includes/fields/class-evf-field-email.php:386
3740
- msgid "Confirmation Email do not match."
3741
- msgstr ""
3742
-
3743
- #: includes/fields/class-evf-field-file-upload.php:20
3744
- msgid "File Upload"
3745
- msgstr ""
3746
-
3747
- #: includes/fields/class-evf-field-first-name.php:20
3748
- msgid "First Name"
3749
- msgstr ""
3750
-
3751
- #: includes/fields/class-evf-field-hidden.php:20
3752
- msgid "Hidden Field"
3753
- msgstr ""
3754
-
3755
- #: includes/fields/class-evf-field-html.php:20
3756
- msgid "Custom HTML"
3757
- msgstr ""
3758
-
3759
- #: includes/fields/class-evf-field-image-upload.php:20
3760
- msgid "Image Upload"
3761
- msgstr ""
3762
-
3763
- #: includes/fields/class-evf-field-last-name.php:20
3764
- msgid "Last Name"
3765
- msgstr ""
3766
-
3767
- #: includes/fields/class-evf-field-likert.php:20
3768
- msgid "Likert"
3769
- msgstr ""
3770
-
3771
- #: includes/fields/class-evf-field-number.php:70
3772
- msgid "Step"
3773
- msgstr ""
3774
-
3775
- #: includes/fields/class-evf-field-number.php:71
3776
- msgid "Allows users to enter specific legal number intervals."
3777
- msgstr ""
3778
-
3779
- #: includes/fields/class-evf-field-number.php:108
3780
- msgid "Min Value"
3781
- msgstr ""
3782
-
3783
- #: includes/fields/class-evf-field-number.php:109
3784
- msgid "Minimum value user is allowed to enter."
3785
- msgstr ""
3786
-
3787
- #: includes/fields/class-evf-field-number.php:146
3788
- msgid "Max Value"
3789
- msgstr ""
3790
-
3791
- #: includes/fields/class-evf-field-number.php:147
3792
- msgid "Maximum value user is allowed to enter."
3793
- msgstr ""
3794
-
3795
- #. translators: %s - minimum value.
3796
- #: includes/fields/class-evf-field-number.php:296
3797
- msgid "Please enter a value greater than or equal to %s"
3798
- msgstr ""
3799
-
3800
- #. translators: %s - maximum value.
3801
- #: includes/fields/class-evf-field-number.php:300
3802
- msgid "Please enter a value less than or equal to %s"
3803
- msgstr ""
3804
-
3805
- #: includes/fields/class-evf-field-password.php:20
3806
- msgid "Password"
3807
- msgstr ""
3808
-
3809
- #: includes/fields/class-evf-field-payment-quantity.php:19
3810
- #: includes/fields/class-evf-field-payment-total.php:20
3811
- msgid "Total"
3812
- msgstr ""
3813
-
3814
- #: includes/fields/class-evf-field-payment-radio.php:20
3815
- #: includes/fields/class-evf-field-radio.php:20
3816
- msgid "Multiple Choice"
3817
- msgstr ""
3818
-
3819
- #: includes/fields/class-evf-field-payment-single.php:20
3820
- msgid "Single Item"
3821
- msgstr ""
3822
-
3823
- #: includes/fields/class-evf-field-phone.php:20
3824
- msgid "Phone"
3825
- msgstr ""
3826
-
3827
- #: includes/fields/class-evf-field-rating.php:20
3828
- msgid "Rating"
3829
- msgstr ""
3830
-
3831
- #: includes/fields/class-evf-field-scale-rating.php:20
3832
- msgid "Scale Rating"
3833
- msgstr ""
3834
-
3835
- #: includes/fields/class-evf-field-select.php:20
3836
- msgid "Dropdown"
3837
- msgstr ""
3838
-
3839
- #: includes/fields/class-evf-field-select.php:27
3840
- msgid "Option 1"
3841
- msgstr ""
3842
-
3843
- #: includes/fields/class-evf-field-select.php:32
3844
- msgid "Option 2"
3845
- msgstr ""
3846
-
3847
- #: includes/fields/class-evf-field-select.php:37
3848
- msgid "Option 3"
3849
- msgstr ""
3850
-
3851
- #: includes/fields/class-evf-field-select.php:106
3852
- msgid "Check this option to enable enhanced select. It enables you to search items in the dropdown field."
3853
- msgstr ""
3854
-
3855
- #: includes/fields/class-evf-field-select.php:116
3856
- msgid "Enable Enhanced Select"
3857
- msgstr ""
3858
-
3859
- #: includes/fields/class-evf-field-select.php:129
3860
- msgid "Enhanced select"
3861
- msgstr ""
3862
-
3863
- #: includes/fields/class-evf-field-signature.php:20
3864
- msgid "Signature"
3865
- msgstr ""
3866
-
3867
- #: includes/fields/class-evf-field-text.php:20
3868
- msgid "Single Line Text"
3869
- msgstr ""
3870
-
3871
- #: includes/fields/class-evf-field-text.php:73
3872
- #: includes/fields/class-evf-field-textarea.php:72
3873
- msgid "Limit Length"
3874
- msgstr ""
3875
-
3876
- #: includes/fields/class-evf-field-text.php:74
3877
- #: includes/fields/class-evf-field-textarea.php:73
3878
- msgid "Check this option to limit text length by characters or words count."
3879
- msgstr ""
3880
-
3881
- #: includes/fields/class-evf-field-text.php:107
3882
- #: includes/fields/class-evf-field-textarea.php:106
3883
- msgid "Characters"
3884
- msgstr ""
3885
-
3886
- #: includes/fields/class-evf-field-text.php:108
3887
- #: includes/fields/class-evf-field-textarea.php:107
3888
- msgid "Words Count"
3889
- msgstr ""
3890
-
3891
- #: includes/fields/class-evf-field-text.php:133
3892
- msgid "Input Mask"
3893
- msgstr ""
3894
-
3895
- #: includes/fields/class-evf-field-text.php:134
3896
- msgid "Enter your custom input mask."
3897
- msgstr ""
3898
-
3899
- #: includes/fields/class-evf-field-text.php:135
3900
- msgid "See Examples & Docs"
3901
- msgstr ""
3902
-
3903
- #: includes/fields/class-evf-field-textarea.php:20
3904
- msgid "Paragraph Text"
3905
- msgstr ""
3906
-
3907
- #: includes/fields/class-evf-field-title.php:20
3908
- msgid "Section Title"
3909
- msgstr ""
3910
-
3911
- #: includes/fields/class-evf-field-url.php:20
3912
- msgid "Website / URL"
3913
- msgstr ""
3914
-
3915
- #. translators: %s - link to a site.
3916
- #: templates/emails/footer-default.php:45
3917
- msgid "Sent from %s"
3918
- msgstr ""
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: contact form, forms, form builder, contact, custom form
4
  Requires at least: 5.0
5
  Tested up to: 5.4
6
  Requires PHP: 5.4
7
- Stable tag: 1.6.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -149,6 +149,13 @@ Yes you can! Join in on our [GitHub repository](https://github.com/wpeverest/eve
149
 
150
  == Changelog ==
151
 
 
 
 
 
 
 
 
152
  = 1.6.6 - 01-05-2020 =
153
  * Fix - Log file deletion.
154
  * Fix - Field Options getting freezed for the first field.
4
  Requires at least: 5.0
5
  Tested up to: 5.4
6
  Requires PHP: 5.4
7
+ Stable tag: 1.6.6.1
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
149
 
150
  == Changelog ==
151
 
152
+ = 1.6.6.1 - 10-05-2020 =
153
+ * Fix - Sanitization of CSV exported field values.
154
+ * Fix - Conflict within WooCommerce checkout page.
155
+ * Fix - Flatpickr Calendar does not open on Android Chrome.
156
+ * Tweak - Updated selectWoo JS library to v1.6.0.
157
+ * Tweak - Updated flatpickr JS library to v4.6.3.
158
+
159
  = 1.6.6 - 01-05-2020 =
160
  * Fix - Log file deletion.
161
  * Fix - Field Options getting freezed for the first field.