import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-e3f64949.js';

const i18nDate = {
  en: {
    months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'),
    monthsShort: 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'),
    weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
    weekdaysShort: 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'),
    weekdaysMin: 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'),
  },
  de: {
    months: 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'),
    monthsShort: 'Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.'.split('_'),
    weekdays: 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'),
    weekdaysShort: 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'),
    weekdaysMin: 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'),
  },
  fr: {
    months: 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'),
    monthsShort: 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'),
    weekdays: 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'),
    weekdaysShort: 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'),
    weekdaysMin: 'di_lu_ma_me_je_ve_sa'.split('_'),
  },
  it: {
    months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
    monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
    weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
    weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
    weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
  },
};

const now = () => new Date();
const isValidDate = (value) => value instanceof Date && value.getTime();
const year = (date) => date.getFullYear();
const month = (date) => date.getMonth();
const day = (date) => date.getDate();
const decreaseYear = (date, years) => year(date) - years;
const isInRange = (date, minDate, maxDate) => {
  if (date && minDate && maxDate) {
    return minDate <= date && date <= maxDate;
  }
  return true;
};
const format = (date) => {
  function pad(value) {
    var s = `0${value}`;
    return s.substr(s.length - 2);
  }
  return `${pad(day(date))}.${pad(month(date) + 1)}.${year(date)}`;
};
const getLastDayOfMonth = (year, month) => {
  const d = new Date(year, month + 1, 0);
  return d.getDate();
};
const getFirstDayOfTheWeek = (date) => {
  const weekdayDiff = [6, 0, 1, 2, 3, 4, 5];
  const d = new Date(date);
  d.setDate(d.getDate() - weekdayDiff[d.getDay()]);
  return d;
};
const isSameYear = (a, b) => {
  return a.getFullYear() === b.getFullYear();
};
const isSameMonth = (a, b) => {
  return isSameYear(a, b) && a.getMonth() === b.getMonth();
};
const isSameDay = (a, b) => {
  return isSameMonth(a, b) && a.getDate() === b.getDate();
};
const isSameWeek = (a, b) => {
  return isSameDay(getFirstDayOfTheWeek(a), getFirstDayOfTheWeek(b));
};

const balDatepickerCss = "@-webkit-keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,.pagination-link.sc-bal-datepicker,.pagination-ellipsis.sc-bal-datepicker{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select.sc-bal-datepicker:not(.is-multiple):not(.is-loading)::after{border:3px solid transparent;border-radius:2px;border-right:0;border-top:0;content:\" \";display:block;height:0.625em;margin-top:-0.4375em;pointer-events:none;position:absolute;top:50%;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:center;transform-origin:center;width:0.625em}.pagination.sc-bal-datepicker:not(:last-child){margin-bottom:1.5rem}.select.is-loading.sc-bal-datepicker::after,.control.is-loading.sc-bal-datepicker::after{-webkit-animation:spinAround 500ms infinite linear;animation:spinAround 500ms infinite linear;border:2px solid #ebecec;border-radius:100%;border-right-color:transparent;border-top-color:transparent;content:\"\";display:block;height:1em;position:relative;width:1em}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,.pagination-link.sc-bal-datepicker,.pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select.sc-bal-datepicker{-moz-appearance:none;-webkit-appearance:none;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;display:-ms-inline-flexbox;display:inline-flex;font-size:0.9375rem;height:2.5em;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}.pagination-previous.sc-bal-datepicker:focus,.pagination-next.sc-bal-datepicker:focus,.pagination-link.sc-bal-datepicker:focus,.pagination-ellipsis.sc-bal-datepicker:focus,.select.sc-bal-datepicker select.sc-bal-datepicker:focus,.is-focused.pagination-previous.sc-bal-datepicker,.is-focused.pagination-next.sc-bal-datepicker,.is-focused.pagination-link.sc-bal-datepicker,.is-focused.pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.pagination-previous.sc-bal-datepicker:active,.pagination-next.sc-bal-datepicker:active,.pagination-link.sc-bal-datepicker:active,.pagination-ellipsis.sc-bal-datepicker:active,.select.sc-bal-datepicker select.sc-bal-datepicker:active,.is-active.pagination-previous.sc-bal-datepicker,.is-active.pagination-next.sc-bal-datepicker,.is-active.pagination-link.sc-bal-datepicker,.is-active.pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select.is-active.sc-bal-datepicker{outline:none}[disabled].pagination-previous.sc-bal-datepicker,[disabled].pagination-next.sc-bal-datepicker,[disabled].pagination-link.sc-bal-datepicker,[disabled].pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select[disabled].sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-previous.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-next.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-link.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-ellipsis.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker{cursor:not-allowed}.select.sc-bal-datepicker select.sc-bal-datepicker{background-color:transparent;border-color:#d3dbeb;border-radius:0;color:#222222}.select.sc-bal-datepicker select.sc-bal-datepicker::-moz-placeholder{color:#7e7e7e}.select.sc-bal-datepicker select.sc-bal-datepicker::-webkit-input-placeholder{color:#7e7e7e}.select.sc-bal-datepicker select.sc-bal-datepicker:-moz-placeholder{color:#7e7e7e}.select.sc-bal-datepicker select.sc-bal-datepicker:-ms-input-placeholder{color:#7e7e7e}.select.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#d3dbeb}.select.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.sc-bal-datepicker select.sc-bal-datepicker:active,.select.sc-bal-datepicker select.is-active.sc-bal-datepicker{border-color:#003399;-webkit-box-shadow:0 none;box-shadow:0 none}.select.sc-bal-datepicker select[disabled].sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker{background-color:#f0fbff;border-color:#d3dbeb;-webkit-box-shadow:none;box-shadow:none;color:#7188b8}.select.sc-bal-datepicker select[disabled].sc-bal-datepicker::-moz-placeholder,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker::-moz-placeholder,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker::-moz-placeholder{color:#7188b8}.select.sc-bal-datepicker select[disabled].sc-bal-datepicker::-webkit-input-placeholder,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker::-webkit-input-placeholder,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker::-webkit-input-placeholder{color:#7188b8}.select.sc-bal-datepicker select[disabled].sc-bal-datepicker:-moz-placeholder,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:-moz-placeholder,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker:-moz-placeholder{color:#7188b8}.select.sc-bal-datepicker select[disabled].sc-bal-datepicker:-ms-input-placeholder,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:-ms-input-placeholder,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker:-ms-input-placeholder{color:#7188b8}.label.sc-bal-datepicker{color:#003399;display:block;font-size:0.9375rem;font-weight:700}.label.sc-bal-datepicker:not(:last-child){margin-bottom:0.5em}.label.is-small.sc-bal-datepicker{font-size:0.8125rem}.label.is-medium.sc-bal-datepicker{font-size:1.125rem}.label.is-large.sc-bal-datepicker{font-size:1.375rem}.help.sc-bal-datepicker{display:block;font-size:0.8125rem;margin-top:0.25rem}.help.is-white.sc-bal-datepicker{color:#ffffff}.help.is-black.sc-bal-datepicker{color:#222222}.help.is-light.sc-bal-datepicker{color:#fafafa}.help.is-dark.sc-bal-datepicker{color:#003399}.help.is-primary.sc-bal-datepicker{color:#009ee7}.help.is-link.sc-bal-datepicker{color:#009ee7}.help.is-info.sc-bal-datepicker{color:#003399}.help.is-success.sc-bal-datepicker{color:#3fc889}.help.is-warning.sc-bal-datepicker{color:#ff9900}.help.is-danger.sc-bal-datepicker{color:#ff3366}.field.sc-bal-datepicker:not(:last-child){margin-bottom:0.75rem}.field.has-addons.sc-bal-datepicker{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:not(:last-child){margin-right:-1px}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:not(:first-child):not(:last-child) .button.sc-bal-datepicker,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:not(:first-child):not(:last-child) .input.sc-bal-datepicker,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:not(:first-child):not(:last-child) .select.sc-bal-datepicker select.sc-bal-datepicker{border-radius:0}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:first-child:not(:only-child) .button.sc-bal-datepicker,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:first-child:not(:only-child) .input.sc-bal-datepicker,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:first-child:not(:only-child) .select.sc-bal-datepicker select.sc-bal-datepicker{border-bottom-right-radius:0;border-top-right-radius:0}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:last-child:not(:only-child) .button.sc-bal-datepicker,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:last-child:not(:only-child) .input.sc-bal-datepicker,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker:last-child:not(:only-child) .select.sc-bal-datepicker select.sc-bal-datepicker{border-bottom-left-radius:0;border-top-left-radius:0}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]):hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]).is-hovered,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]):hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]).is-hovered,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]):hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]).is-hovered{z-index:2}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]):focus,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]).is-focused,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]):active,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]).is-active,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]):focus,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]).is-focused,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]):active,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]).is-active,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]):focus,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]).is-focused,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]):active,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]).is-active{z-index:3}.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]):focus:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]).is-focused:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]):active:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .button.sc-bal-datepicker:not([disabled]).is-active:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]):focus:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]).is-focused:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]):active:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .input.sc-bal-datepicker:not([disabled]).is-active:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]):focus:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]).is-focused:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]):active:hover,.field.has-addons.sc-bal-datepicker .control.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:not([disabled]).is-active:hover{z-index:4}.field.has-addons.sc-bal-datepicker .control.is-expanded.sc-bal-datepicker{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.field.has-addons.has-addons-centered.sc-bal-datepicker{-ms-flex-pack:center;justify-content:center}.field.has-addons.has-addons-right.sc-bal-datepicker{-ms-flex-pack:end;justify-content:flex-end}.field.has-addons.has-addons-fullwidth.sc-bal-datepicker .control.sc-bal-datepicker{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.field.is-grouped.sc-bal-datepicker{display:-ms-flexbox;display:flex;-ms-flex-pack:start;justify-content:flex-start}.field.is-grouped.sc-bal-datepicker>.control.sc-bal-datepicker{-ms-flex-negative:0;flex-shrink:0}.field.is-grouped.sc-bal-datepicker>.control.sc-bal-datepicker:not(:last-child){margin-bottom:0;margin-right:0.75rem}.field.is-grouped.sc-bal-datepicker>.control.is-expanded.sc-bal-datepicker{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.field.is-grouped.is-grouped-centered.sc-bal-datepicker{-ms-flex-pack:center;justify-content:center}.field.is-grouped.is-grouped-right.sc-bal-datepicker{-ms-flex-pack:end;justify-content:flex-end}.field.is-grouped.is-grouped-multiline.sc-bal-datepicker{-ms-flex-wrap:wrap;flex-wrap:wrap}.field.is-grouped.is-grouped-multiline.sc-bal-datepicker>.control.sc-bal-datepicker:last-child,.field.is-grouped.is-grouped-multiline.sc-bal-datepicker>.control.sc-bal-datepicker:not(:last-child){margin-bottom:0.75rem}.field.is-grouped.is-grouped-multiline.sc-bal-datepicker:last-child{margin-bottom:-0.75rem}.field.is-grouped.is-grouped-multiline.sc-bal-datepicker:not(:last-child){margin-bottom:0}@media screen and (min-width: 720px), print{.field.is-horizontal.sc-bal-datepicker{display:-ms-flexbox;display:flex}}.field-label.sc-bal-datepicker .label.sc-bal-datepicker{font-size:inherit}@media screen and (max-width: 719px){.field-label.sc-bal-datepicker{margin-bottom:0.5rem}}@media screen and (min-width: 720px), print{.field-label.sc-bal-datepicker{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;margin-right:1.5rem;text-align:right}.field-label.is-small.sc-bal-datepicker{font-size:0.8125rem;padding-top:0.375em}.field-label.is-normal.sc-bal-datepicker{padding-top:0.375em}.field-label.is-medium.sc-bal-datepicker{font-size:1.125rem;padding-top:0.375em}.field-label.is-large.sc-bal-datepicker{font-size:1.375rem;padding-top:0.375em}}.field-body.sc-bal-datepicker .field.sc-bal-datepicker .field.sc-bal-datepicker{margin-bottom:0}@media screen and (min-width: 720px), print{.field-body.sc-bal-datepicker{display:-ms-flexbox;display:flex;-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:5;flex-grow:5;-ms-flex-negative:1;flex-shrink:1}.field-body.sc-bal-datepicker .field.sc-bal-datepicker{margin-bottom:0}.field-body.sc-bal-datepicker>.field.sc-bal-datepicker{-ms-flex-negative:1;flex-shrink:1}.field-body.sc-bal-datepicker>.field.sc-bal-datepicker:not(.is-narrow){-ms-flex-positive:1;flex-grow:1}.field-body.sc-bal-datepicker>.field.sc-bal-datepicker:not(:last-child){margin-right:0.75rem}}.control.sc-bal-datepicker{-webkit-box-sizing:border-box;box-sizing:border-box;clear:both;font-size:0.9375rem;position:relative;text-align:inherit}.control.has-icons-left.sc-bal-datepicker .input.sc-bal-datepicker:focus~.icon.sc-bal-datepicker,.control.has-icons-left.sc-bal-datepicker .select.sc-bal-datepicker:focus~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .input.sc-bal-datepicker:focus~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .select.sc-bal-datepicker:focus~.icon.sc-bal-datepicker{color:#222222}.control.has-icons-left.sc-bal-datepicker .input.is-small.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-left.sc-bal-datepicker .select.is-small.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .input.is-small.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .select.is-small.sc-bal-datepicker~.icon.sc-bal-datepicker{font-size:0.8125rem}.control.has-icons-left.sc-bal-datepicker .input.is-medium.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-left.sc-bal-datepicker .select.is-medium.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .input.is-medium.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .select.is-medium.sc-bal-datepicker~.icon.sc-bal-datepicker{font-size:1.125rem}.control.has-icons-left.sc-bal-datepicker .input.is-large.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-left.sc-bal-datepicker .select.is-large.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .input.is-large.sc-bal-datepicker~.icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .select.is-large.sc-bal-datepicker~.icon.sc-bal-datepicker{font-size:1.375rem}.control.has-icons-left.sc-bal-datepicker .icon.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .icon.sc-bal-datepicker{color:#d3dbeb;height:38px;pointer-events:none;position:absolute;top:0;width:38px;z-index:4}.control.has-icons-left.sc-bal-datepicker .input.sc-bal-datepicker,.control.has-icons-left.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker{padding-left:38px}.control.has-icons-left.sc-bal-datepicker .icon.is-left.sc-bal-datepicker{left:0}.control.has-icons-right.sc-bal-datepicker .input.sc-bal-datepicker,.control.has-icons-right.sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker{padding-right:38px}.control.has-icons-right.sc-bal-datepicker .icon.is-right.sc-bal-datepicker{right:0}.control.is-loading.sc-bal-datepicker::after{position:absolute !important;right:0.625em;top:0.625em;z-index:4}.control.is-loading.is-small.sc-bal-datepicker:after{font-size:0.8125rem}.control.is-loading.is-medium.sc-bal-datepicker:after{font-size:1.125rem}.control.is-loading.is-large.sc-bal-datepicker:after{font-size:1.375rem}.select.sc-bal-datepicker{display:inline-block;max-width:100%;position:relative;vertical-align:top}.select.sc-bal-datepicker:not(.is-multiple){height:38px}.select.sc-bal-datepicker:not(.is-multiple):not(.is-loading)::after{border-color:#009ee7;right:1.125em;z-index:4}.select.is-rounded.sc-bal-datepicker select.sc-bal-datepicker{border-radius:100%;padding-left:1em}.select.sc-bal-datepicker select.sc-bal-datepicker{cursor:pointer;display:block;font-size:1em;max-width:100%;outline:none}.select.sc-bal-datepicker select.sc-bal-datepicker::-ms-expand{display:none}.select.sc-bal-datepicker select[disabled].sc-bal-datepicker:hover,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker:hover{border-color:#d3dbeb}.select.sc-bal-datepicker select.sc-bal-datepicker:not([multiple]){padding-right:2.5em}.select.sc-bal-datepicker select[multiple].sc-bal-datepicker{height:auto;padding:0}.select.sc-bal-datepicker select[multiple].sc-bal-datepicker option.sc-bal-datepicker{padding:0.5em 1em}.select.sc-bal-datepicker:not(.is-multiple):not(.is-loading):hover::after{border-color:transparent}.select.is-white.sc-bal-datepicker:not(:hover)::after{border-color:#ffffff}.select.is-white.sc-bal-datepicker select.sc-bal-datepicker{border-color:#ffffff}.select.is-white.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-white.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#f2f2f2}.select.is-white.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-white.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-white.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-white.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(255, 255, 255, 0.25);box-shadow:0 rgba(255, 255, 255, 0.25)}.select.is-black.sc-bal-datepicker:not(:hover)::after{border-color:#222222}.select.is-black.sc-bal-datepicker select.sc-bal-datepicker{border-color:#222222}.select.is-black.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-black.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#151515}.select.is-black.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-black.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-black.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-black.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(34, 34, 34, 0.25);box-shadow:0 rgba(34, 34, 34, 0.25)}.select.is-light.sc-bal-datepicker:not(:hover)::after{border-color:#fafafa}.select.is-light.sc-bal-datepicker select.sc-bal-datepicker{border-color:#fafafa}.select.is-light.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-light.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#ededed}.select.is-light.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-light.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-light.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-light.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(250, 250, 250, 0.25);box-shadow:0 rgba(250, 250, 250, 0.25)}.select.is-dark.sc-bal-datepicker:not(:hover)::after{border-color:#003399}.select.is-dark.sc-bal-datepicker select.sc-bal-datepicker{border-color:#003399}.select.is-dark.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-dark.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#002b80}.select.is-dark.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-dark.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-dark.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-dark.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(0, 51, 153, 0.25);box-shadow:0 rgba(0, 51, 153, 0.25)}.select.is-primary.sc-bal-datepicker:not(:hover)::after{border-color:#009ee7}.select.is-primary.sc-bal-datepicker select.sc-bal-datepicker{border-color:#009ee7}.select.is-primary.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-primary.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#008dce}.select.is-primary.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-primary.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-primary.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-primary.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(0, 158, 231, 0.25);box-shadow:0 rgba(0, 158, 231, 0.25)}.select.is-link.sc-bal-datepicker:not(:hover)::after{border-color:#009ee7}.select.is-link.sc-bal-datepicker select.sc-bal-datepicker{border-color:#009ee7}.select.is-link.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-link.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#008dce}.select.is-link.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-link.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-link.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-link.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(0, 158, 231, 0.25);box-shadow:0 rgba(0, 158, 231, 0.25)}.select.is-info.sc-bal-datepicker:not(:hover)::after{border-color:#003399}.select.is-info.sc-bal-datepicker select.sc-bal-datepicker{border-color:#003399}.select.is-info.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-info.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#002b80}.select.is-info.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-info.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-info.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-info.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(0, 51, 153, 0.25);box-shadow:0 rgba(0, 51, 153, 0.25)}.select.is-success.sc-bal-datepicker:not(:hover)::after{border-color:#3fc889}.select.is-success.sc-bal-datepicker select.sc-bal-datepicker{border-color:#3fc889}.select.is-success.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-success.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#35b97c}.select.is-success.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-success.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-success.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-success.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(63, 200, 137, 0.25);box-shadow:0 rgba(63, 200, 137, 0.25)}.select.is-warning.sc-bal-datepicker:not(:hover)::after{border-color:#ff9900}.select.is-warning.sc-bal-datepicker select.sc-bal-datepicker{border-color:#ff9900}.select.is-warning.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-warning.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#e68a00}.select.is-warning.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-warning.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-warning.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-warning.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(255, 153, 0, 0.25);box-shadow:0 rgba(255, 153, 0, 0.25)}.select.is-danger.sc-bal-datepicker:not(:hover)::after{border-color:#ff3366}.select.is-danger.sc-bal-datepicker select.sc-bal-datepicker{border-color:#ff3366}.select.is-danger.sc-bal-datepicker select.sc-bal-datepicker:hover,.select.is-danger.sc-bal-datepicker select.is-hovered.sc-bal-datepicker{border-color:#ff1a53}.select.is-danger.sc-bal-datepicker select.sc-bal-datepicker:focus,.select.is-danger.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.select.is-danger.sc-bal-datepicker select.sc-bal-datepicker:active,.select.is-danger.sc-bal-datepicker select.is-active.sc-bal-datepicker{-webkit-box-shadow:0 rgba(255, 51, 102, 0.25);box-shadow:0 rgba(255, 51, 102, 0.25)}.select.is-small.sc-bal-datepicker{border-radius:4px;font-size:0.8125rem}.select.is-medium.sc-bal-datepicker{font-size:1.125rem}.select.is-large.sc-bal-datepicker{font-size:1.375rem}.select.is-disabled.sc-bal-datepicker::after{border-color:#7188b8}.select.is-fullwidth.sc-bal-datepicker{width:100%}.select.is-fullwidth.sc-bal-datepicker select.sc-bal-datepicker{width:100%}.select.is-loading.sc-bal-datepicker::after{margin-top:0;position:absolute;right:0.625em;top:0.625em;-webkit-transform:none;transform:none}.select.is-loading.is-small.sc-bal-datepicker:after{font-size:0.8125rem}.select.is-loading.is-medium.sc-bal-datepicker:after{font-size:1.125rem}.select.is-loading.is-large.sc-bal-datepicker:after{font-size:1.375rem}@keyframes spinAround{from{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,.pagination-link.sc-bal-datepicker,.pagination-ellipsis.sc-bal-datepicker{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.select.sc-bal-datepicker:not(.is-multiple):not(.is-loading)::after{border:3px solid transparent;border-radius:2px;border-right:0;border-top:0;content:\" \";display:block;height:0.625em;margin-top:-0.4375em;pointer-events:none;position:absolute;top:50%;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:center;transform-origin:center;width:0.625em}.pagination.sc-bal-datepicker:not(:last-child){margin-bottom:1.5rem}.control.is-loading.sc-bal-datepicker::after,.select.is-loading.sc-bal-datepicker::after{-webkit-animation:spinAround 500ms infinite linear;animation:spinAround 500ms infinite linear;border:2px solid #ebecec;border-radius:100%;border-right-color:transparent;border-top-color:transparent;content:\"\";display:block;height:1em;position:relative;width:1em}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,.pagination-link.sc-bal-datepicker,.pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select.sc-bal-datepicker{-moz-appearance:none;-webkit-appearance:none;-ms-flex-align:center;align-items:center;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:none;box-shadow:none;display:-ms-inline-flexbox;display:inline-flex;font-size:0.9375rem;height:2.5em;-ms-flex-pack:start;justify-content:flex-start;line-height:1.5;padding-bottom:calc(0.5em - 1px);padding-left:calc(0.75em - 1px);padding-right:calc(0.75em - 1px);padding-top:calc(0.5em - 1px);position:relative;vertical-align:top}.pagination-previous.sc-bal-datepicker:focus,.pagination-next.sc-bal-datepicker:focus,.pagination-link.sc-bal-datepicker:focus,.pagination-ellipsis.sc-bal-datepicker:focus,.select.sc-bal-datepicker select.sc-bal-datepicker:focus,.is-focused.pagination-previous.sc-bal-datepicker,.is-focused.pagination-next.sc-bal-datepicker,.is-focused.pagination-link.sc-bal-datepicker,.is-focused.pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select.is-focused.sc-bal-datepicker,.pagination-previous.sc-bal-datepicker:active,.pagination-next.sc-bal-datepicker:active,.pagination-link.sc-bal-datepicker:active,.pagination-ellipsis.sc-bal-datepicker:active,.select.sc-bal-datepicker select.sc-bal-datepicker:active,.is-active.pagination-previous.sc-bal-datepicker,.is-active.pagination-next.sc-bal-datepicker,.is-active.pagination-link.sc-bal-datepicker,.is-active.pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select.is-active.sc-bal-datepicker{outline:none}[disabled].pagination-previous.sc-bal-datepicker,[disabled].pagination-next.sc-bal-datepicker,[disabled].pagination-link.sc-bal-datepicker,[disabled].pagination-ellipsis.sc-bal-datepicker,.select.sc-bal-datepicker select[disabled].sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-previous.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-next.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-link.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .pagination-ellipsis.sc-bal-datepicker,fieldset[disabled].sc-bal-datepicker .select.sc-bal-datepicker select.sc-bal-datepicker,.select.sc-bal-datepicker fieldset[disabled].sc-bal-datepicker select.sc-bal-datepicker{cursor:not-allowed}.pagination.sc-bal-datepicker{font-size:0.9375rem;margin:-0.25rem}.pagination.is-small.sc-bal-datepicker{font-size:0.8125rem}.pagination.is-medium.sc-bal-datepicker{font-size:1.125rem}.pagination.is-large.sc-bal-datepicker{font-size:1.375rem}.pagination.is-rounded.sc-bal-datepicker .pagination-previous.sc-bal-datepicker,.pagination.is-rounded.sc-bal-datepicker .pagination-next.sc-bal-datepicker{padding-left:1em;padding-right:1em;border-radius:100%}.pagination.is-rounded.sc-bal-datepicker .pagination-link.sc-bal-datepicker{border-radius:100%}.pagination.sc-bal-datepicker,.pagination-list.sc-bal-datepicker{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;text-align:center}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,.pagination-link.sc-bal-datepicker,.pagination-ellipsis.sc-bal-datepicker{font-size:1em;-ms-flex-pack:center;justify-content:center;margin:0.25rem;padding-left:0.5em;padding-right:0.5em;text-align:center}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,.pagination-link.sc-bal-datepicker{border-color:#d3dbeb;color:#003399;min-width:2.5em}.pagination-previous.sc-bal-datepicker:hover,.pagination-next.sc-bal-datepicker:hover,.pagination-link.sc-bal-datepicker:hover{border-color:#003399;color:#003399}.pagination-previous.sc-bal-datepicker:focus,.pagination-next.sc-bal-datepicker:focus,.pagination-link.sc-bal-datepicker:focus{border-color:#003399}.pagination-previous.sc-bal-datepicker:active,.pagination-next.sc-bal-datepicker:active,.pagination-link.sc-bal-datepicker:active{-webkit-box-shadow:inset 0 1px 2px rgba(34, 34, 34, 0.2);box-shadow:inset 0 1px 2px rgba(34, 34, 34, 0.2)}.pagination-previous[disabled].sc-bal-datepicker,.pagination-next[disabled].sc-bal-datepicker,.pagination-link[disabled].sc-bal-datepicker{background-color:#d3dbeb;border-color:#d3dbeb;-webkit-box-shadow:none;box-shadow:none;color:#d8d9d9;opacity:0.5}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker{padding-left:0.75em;padding-right:0.75em;white-space:nowrap}.pagination-link.is-current.sc-bal-datepicker{background-color:#003399;border-color:#003399;color:#fff}.pagination-ellipsis.sc-bal-datepicker{color:#e2e3e3;pointer-events:none}.pagination-list.sc-bal-datepicker{-ms-flex-wrap:wrap;flex-wrap:wrap}@media screen and (max-width: 719px){.pagination.sc-bal-datepicker{-ms-flex-wrap:wrap;flex-wrap:wrap}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}.pagination-list.sc-bal-datepicker li.sc-bal-datepicker{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1}}@media screen and (min-width: 720px), print{.pagination-list.sc-bal-datepicker{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:1;flex-shrink:1;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-order:1;order:1}.pagination-previous.sc-bal-datepicker{-ms-flex-order:2;order:2}.pagination-next.sc-bal-datepicker{-ms-flex-order:3;order:3}.pagination.sc-bal-datepicker{-ms-flex-pack:justify;justify-content:space-between}.pagination.is-centered.sc-bal-datepicker .pagination-previous.sc-bal-datepicker{-ms-flex-order:1;order:1}.pagination.is-centered.sc-bal-datepicker .pagination-list.sc-bal-datepicker{-ms-flex-pack:center;justify-content:center;-ms-flex-order:2;order:2}.pagination.is-centered.sc-bal-datepicker .pagination-next.sc-bal-datepicker{-ms-flex-order:3;order:3}.pagination.is-right.sc-bal-datepicker .pagination-previous.sc-bal-datepicker{-ms-flex-order:1;order:1}.pagination.is-right.sc-bal-datepicker .pagination-next.sc-bal-datepicker{-ms-flex-order:2;order:2}.pagination.is-right.sc-bal-datepicker .pagination-list.sc-bal-datepicker{-ms-flex-pack:end;justify-content:flex-end;-ms-flex-order:3;order:3}}.sc-bal-datepicker-h{display:block}nav.pagination.sc-bal-datepicker>button.sc-bal-datepicker{-webkit-box-shadow:none !important;box-shadow:none !important;-ms-flex-align:center;align-items:center;background:#ffffff}nav.pagination.sc-bal-datepicker>button.sc-bal-datepicker:disabled{background:#f0fbff;border-color:#d3dbeb;color:#7188b8}nav.pagination.sc-bal-datepicker bal-icon.sc-bal-datepicker{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}nav.pagination.sc-bal-datepicker ul.sc-bal-datepicker{padding:0;margin:0;list-style:none}nav.pagination.sc-bal-datepicker button.sc-bal-datepicker,nav.pagination.sc-bal-datepicker a.sc-bal-datepicker{cursor:pointer}.sc-bal-datepicker-h{display:block;position:relative}.datepicker-trigger-icon.sc-bal-datepicker{position:absolute;top:0;right:0;bottom:0;width:38px}.datepicker-footer.sc-bal-datepicker{margin-top:15px}.pagination.sc-bal-datepicker{-ms-flex-wrap:nowrap;flex-wrap:nowrap}.pagination-list.sc-bal-datepicker,.pagination-list.sc-bal-datepicker .field.sc-bal-datepicker{width:100%}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker,select.sc-bal-datepicker{border:none !important}.pagination-previous.sc-bal-datepicker,.pagination-next.sc-bal-datepicker{padding-left:0.25em;padding-right:0.25em}.pagination-previous.sc-bal-datepicker:active,.pagination-next.sc-bal-datepicker:active{-webkit-box-shadow:none;box-shadow:none}.pagination-next.sc-bal-datepicker{-ms-flex-order:3;order:3}.month-select.sc-bal-datepicker,.year-select.sc-bal-datepicker{width:50%}.month-select.sc-bal-datepicker,.month-select.sc-bal-datepicker select.sc-bal-datepicker{text-align:right;-moz-text-align-last:right;text-align-last:right}.year-select.sc-bal-datepicker,.year-select.sc-bal-datepicker select.sc-bal-datepicker{text-align:left;-moz-text-align-last:left;text-align-last:left}.select.sc-bal-datepicker::after{display:none !important}.select.sc-bal-datepicker select.sc-bal-datepicker{padding:6px 5px 13px 5px !important;color:#003399 !important;font-size:1.125rem !important;font-weight:700;font-family:MetaPro, Arial, sans-serif !important}.select.sc-bal-datepicker select.sc-bal-datepicker option.sc-bal-datepicker{color:#222222 !important;font-size:0.9375rem !important;font-weight:400 !important}.datepicker-popup.sc-bal-datepicker{padding:26px 20px;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.datepicker-table.sc-bal-datepicker{display:table;border-collapse:collapse;width:100%;margin:15px auto 0 auto}.datepicker-table.sc-bal-datepicker .datepicker-body.sc-bal-datepicker{display:table-row-group}.datepicker-table.sc-bal-datepicker .datepicker-body.sc-bal-datepicker .datepicker-row.sc-bal-datepicker{display:table-row}.datepicker-table.sc-bal-datepicker .datepicker-cell.sc-bal-datepicker{position:relative;text-align:center;vertical-align:middle;display:table-cell;max-width:0;padding:12px 5px;border:1px solid #d3dbeb;color:#003399;cursor:pointer;font-size:0.9375rem;font-family:MetaPro, Arial, sans-serif}.datepicker-table.sc-bal-datepicker .datepicker-cell.is-selected.sc-bal-datepicker{background:#003399;color:#ffffff}.datepicker-table.sc-bal-datepicker .datepicker-cell.is-outdated.sc-bal-datepicker,.datepicker-table.sc-bal-datepicker .datepicker-cell.is-disabled.sc-bal-datepicker{background:#f0fbff;background-clip:padding-box;color:#7188b8;cursor:default}.datepicker-table.sc-bal-datepicker .datepicker-cell.is-disabled.sc-bal-datepicker{cursor:not-allowed}.datepicker-table.sc-bal-datepicker .datepicker-cell.is-selectable.sc-bal-datepicker:hover{outline:1px solid #003399;outline-offset:-1px;z-index:3000}.datepicker-table.sc-bal-datepicker .datepicker-cell.is-today.sc-bal-datepicker:after{content:\"\";position:absolute;display:block;width:3px;height:3px;background:#003399;border-radius:100%;margin-top:2px;margin-left:-1.5px;left:50%}.datepicker-table.sc-bal-datepicker header.datepicker-header.sc-bal-datepicker{display:table-header-group}.datepicker-table.sc-bal-datepicker header.datepicker-header.sc-bal-datepicker .datepicker-cell.sc-bal-datepicker{color:#7188b8;font-weight:400;border:none;cursor:default}@media screen and (min-width: 720px), print{.datepicker-popup.sc-bal-datepicker{padding:26px 40px;width:433px}}.month-select.sc-bal-datepicker select.sc-bal-datepicker{padding:6px 10px 13px 10px !important}.year-select.sc-bal-datepicker select.sc-bal-datepicker{padding:6px 10px 13px 10px !important}";

const Datepicker = class {
  constructor(hostRef) {
    registerInstance(this, hostRef);
    this.balChange = createEvent(this, "balChange", 7);
    this.balInput = createEvent(this, "balInput", 7);
    this.balBlur = createEvent(this, "balBlur", 7);
    this.balFocus = createEvent(this, "balFocus", 7);
    this.isDropdownOpen = false;
    this.pointerMonth = 10;
    this.pointerYear = 2020;
    this.pointerDay = 1;
    /**
     * If `true` the component uses the whole width.
     */
    this.locale = 'en';
    /**
     * The tabindex of the control.
     */
    this.balTabindex = 0;
    /**
     * If `true` the component uses the whole width.
     */
    this.expanded = false;
    /**
     * Set this to `true` when the component is placed on a dark background.
     */
    this.inverted = false;
    /**
     * If `true` the use can only select a date.
     */
    this.readonly = false;
    /**
     * If `true` the component is diabled.
     */
    this.disabled = false;
    /**
     * Defines the placeholder of the input element.
     */
    this.placeholder = '';
    /**
     * Closes the datepicker dropdown after selection
     */
    this.closeOnSelect = true;
    /**
     * If `true` the datepicker only open on click of the icon
     */
    this.triggerIcon = false;
    /**
     * Earliest year available for selection
     */
    this.minYearProp = undefined;
    /**
     * Latest year available for selection
     */
    this.maxYearProp = undefined;
    /**
     * Callback to determine which date in the datepicker should be selectable.
     */
    this.filter = _ => true;
  }
  /**
   * Selects an option
   */
  async select(date) {
    var _a;
    this.value = new Date(date);
    this.updateFromValue();
    this.balChange.emit(this.value);
    if (this.closeOnSelect) {
      await ((_a = this.dropdownElement) === null || _a === void 0 ? void 0 : _a.toggle());
    }
  }
  valueWatcher(newDate, oldDate) {
    if (oldDate === undefined || !isSameDay(newDate, oldDate)) {
      this.updateFromValue();
    }
  }
  componentWillLoad() {
    if (this.value) {
      setTimeout(() => this.updateFromValue(), 0);
    }
  }
  get pointerDate() {
    return new Date(this.pointerYear, this.pointerMonth, this.pointerDay);
  }
  get minYear() {
    return this.minYearProp ? this.minYearProp : decreaseYear(now(), 100);
  }
  get maxYear() {
    return this.maxYearProp ? this.maxYearProp : year(now());
  }
  get years() {
    return Array.from({ length: this.maxYear - this.minYear + 1 }, (_, index) => this.minYear + index);
  }
  get weekDays() {
    const translations = [...i18nDate[this.locale].weekdaysMin];
    translations.push(translations.shift());
    return translations;
  }
  get firstDateOfBox() {
    const date = new Date(this.pointerYear, this.pointerMonth, 1);
    return getFirstDayOfTheWeek(date);
  }
  get calendarGrid() {
    let weekDatePointer = this.firstDateOfBox;
    let dayDatePointer = this.firstDateOfBox;
    let calendar = [];
    do {
      let row = [];
      do {
        row = [
          ...row,
          {
            date: new Date(dayDatePointer),
            dateString: format(dayDatePointer),
            label: day(dayDatePointer).toString(),
            isToday: isSameDay(dayDatePointer, now()),
            isSelected: this.value && isSameDay(dayDatePointer, this.value),
            isDisabled: !this.filter(dayDatePointer),
            isOutdated: this.pointerMonth !== dayDatePointer.getMonth() || !isInRange(dayDatePointer, this.minDate, this.maxDate),
          },
        ];
        dayDatePointer.setDate(dayDatePointer.getDate() + 1);
      } while (isSameWeek(dayDatePointer, weekDatePointer));
      calendar = [...calendar, row];
      weekDatePointer.setDate(weekDatePointer.getDate() + 7);
    } while (isSameMonth(this.pointerDate, dayDatePointer));
    return calendar;
  }
  async onIconClick(event) {
    this.dropdownElement.toggle();
    event.stopPropagation();
  }
  async onInputClick(event) {
    if (!this.triggerIcon) {
      this.dropdownElement.toggle();
    }
    event.stopPropagation();
  }
  onDropdownChange(event) {
    this.isDropdownOpen = event.detail;
    event.stopPropagation();
  }
  onInput(event) {
    const inputValue = event.target.value;
    this.parseAndSetDate(inputValue);
    this.balInput.emit(inputValue);
    event.stopPropagation();
  }
  updateFromValue() {
    if (this.value && isValidDate(this.value)) {
      this.inputElement.value = format(this.value);
      this.pointerYear = year(this.value);
      this.pointerMonth = month(this.value);
      this.pointerDay = day(this.value);
    }
  }
  parseAndSetDate(inputValue, shouldFormat = false) {
    if (inputValue.length >= 8) {
      const parts = inputValue.split('.');
      if (parts.length === 3) {
        const year = parseInt(parts[2], 10);
        const month = parseInt(parts[1], 10) - 1;
        if (parts[2].length === 4 && year >= 1900 && month < 12 && month >= 0) {
          const day = parseInt(parts[0], 10);
          const lastDayOfMonth = getLastDayOfMonth(year, month);
          if (0 < day && day <= lastDayOfMonth) {
            const d = new Date(year, month, day);
            this.value = d;
            this.pointerMonth = month;
            this.pointerYear = year;
            if (shouldFormat) {
              this.inputElement.value = format(d);
            }
          }
        }
      }
    }
  }
  previousMonth() {
    if (this.pointerYear === this.minYear && this.pointerMonth === 0) {
      return;
    }
    if (this.pointerMonth === 0) {
      this.pointerYear = this.pointerYear - 1;
      this.pointerMonth = 11;
    }
    else {
      this.pointerMonth = this.pointerMonth - 1;
    }
  }
  nextMonth() {
    if (this.pointerYear === this.maxYear && this.pointerMonth === 11) {
      return;
    }
    if (this.pointerMonth === 11) {
      this.pointerYear = this.pointerYear + 1;
      this.pointerMonth = 0;
    }
    else {
      this.pointerMonth = this.pointerMonth + 1;
    }
  }
  handleMonthSelect(event) {
    const inputValue = event.target.value;
    this.pointerMonth = parseInt(inputValue, 10);
  }
  handleYearSelect(event) {
    const inputValue = event.target.value;
    this.pointerYear = parseInt(inputValue, 10);
  }
  onClickDateCell(cell) {
    if (!cell.isDisabled) {
      this.select(cell.date);
    }
  }
  onInputKeyDown(event) {
    const allowedKeys = [
      '0',
      '1',
      '2',
      '3',
      '4',
      '5',
      '6',
      '7',
      '8',
      '9',
      '.',
      'Backspace',
      'Enter',
      'ArrowLeft',
      'Left',
      'ArrowRight',
      'Right',
      'Tab',
      'Esc',
      'Escape',
    ];
    if (allowedKeys.indexOf(event.key) < 0) {
      event.preventDefault();
      event.stopPropagation();
    }
  }
  onInputBlur(event) {
    this.balBlur.emit(event);
    this.parseAndSetDate(this.inputElement.value, true);
  }
  render() {
    return (h(Host, { role: "datepicker" }, h("bal-dropdown", { expanded: this.expanded, onBalCollapse: e => this.onDropdownChange(e), ref: el => (this.dropdownElement = el) }, this.renderInput(), h("div", { class: "datepicker-popup" }, this.renderHeader(), this.renderBody(), h("div", { class: "datepicker-footer" }, h("slot", null))))));
  }
  renderInput() {
    return (h("div", { class: "control has-icons-right", slot: "trigger" }, h("input", { class: {
        'input': true,
        'clickable': !this.disabled && !this.triggerIcon,
        'is-inverted': this.inverted,
        'is-disabled': this.disabled,
      }, maxlength: "10", autoComplete: "off", disabled: this.disabled, readonly: this.readonly, placeholder: this.placeholder, tabindex: this.balTabindex, onKeyDown: e => this.onInputKeyDown(e), onInput: e => this.onInput(e), onClick: e => this.onInputClick(e), onBlur: e => this.onInputBlur(e), onFocus: e => this.balFocus.emit(e), ref: el => (this.inputElement = el) }), h("bal-icon", { class: "datepicker-trigger-icon clickable", size: "medium", "is-right": true, color: this.inverted ? 'white' : 'blue', name: "date", onClick: e => this.onIconClick(e) })));
  }
  renderBody() {
    return (h("section", { class: "datepicker-table" }, this.renderWeekDayHeader(), h("div", { class: "datepicker-body" }, this.calendarGrid.map(row => (h("div", { class: "datepicker-row" }, row.map(cell => (h("div", { "data-date": cell.dateString, onClick: () => this.onClickDateCell(cell), class: [
        'datepicker-cell',
        cell.isToday ? 'is-today' : '',
        cell.isSelected ? 'is-selected' : '',
        cell.isOutdated ? 'is-outdated' : '',
        cell.isDisabled ? 'is-disabled' : '',
        !cell.isOutdated && !cell.isDisabled ? 'is-selectable' : '',
      ].join(' ') }, cell.label)))))))));
  }
  renderWeekDayHeader() {
    return (h("header", { class: "datepicker-header" }, this.weekDays.map(weekday => (h("div", { class: "datepicker-cell" }, weekday)))));
  }
  renderHeader() {
    return (h("header", { class: "datepicker-header" }, h("div", { class: "pagination field is-centered" }, h("a", { role: "button", onClick: () => this.previousMonth(), class: "pagination-previous" }, h("bal-icon", { name: "nav-go-left", size: "large" })), h("a", { role: "button", onClick: () => this.nextMonth(), class: "pagination-next" }, h("bal-icon", { name: "nav-go-right", size: "large" })), h("div", { class: "pagination-list" }, h("div", { class: "field has-addons" }, h("div", { class: "control month-select" }, h("span", { class: "select" }, h("select", { onInput: e => this.handleMonthSelect(e) }, i18nDate[this.locale].months.map((month, index) => (h("option", { value: index, selected: this.pointerMonth === index }, month)))))), h("div", { class: "control year-select" }, h("span", { class: "select" }, h("select", { onInput: e => this.handleYearSelect(e) }, this.years.map(year => (h("option", { value: year, selected: this.pointerYear === year }, year)))))))))));
  }
  get element() { return getElement(this); }
  static get watchers() { return {
    "value": ["valueWatcher"]
  }; }
};
Datepicker.style = balDatepickerCss;

export { Datepicker as bal_datepicker };
