var __values=this&&this.__values||function(t){var e="function"==typeof Symbol&&t[Symbol.iterator],i=0;return e?e.call(t):{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}}},__read=this&&this.__read||function(t,e){var i="function"==typeof Symbol&&t[Symbol.iterator];if(!i)return t;var n,s,o=i.call(t),r=[];try{for(;(void 0===e||0r[0]&&e[1]>>0;if(0==n)return!1;var s,o,r=0|e,a=Math.max(0<=r?r:n-Math.abs(r),0);for(;ai.length)&&(e=i.length),e-=t.length;var n=i.indexOf(t,e);return-1!==n&&n===e}),String.prototype.padStart||(String.prototype.padStart=function(t,e){return t>>=0,e=String(e||" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),e.slice(0,t)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(t,e){return t>>=0,e=String(e||" "),this.length>t?String(this):((t-=this.length)>e.length&&(e+=e.repeat(t/e.length)),String(this)+e.slice(0,t))}),String.prototype.repeat||(String.prototype.repeat=function(t){var e=""+this;if((t=+t)<0)throw new RangeError("Repeat count must be non-negative.");if(t===1/0)throw new RangeError("Repeat count must be less than infinity.");if(t=Math.floor(t),0===e.length||0===t)return"";if(e.length*t>=1<<28)throw new RangeError("Repeat count must not overflow maximum string size.");for(var i="";1==(1&t)&&(i+=e),0!==(t>>>=1);)e+=e;return i}),function(t){var e,i;e=t.BusinessPack||(t.BusinessPack={}),(i=e.RgbaChannel||(e.RgbaChannel={}))[i.Red=0]="Red",i[i.Green=1]="Green",i[i.Blue=2]="Blue",i[i.Alpha=3]="Alpha"}(DotVVM=DotVVM||{}),function(t){!function(t){"use strict";var e=(i.control="dotvvm-bp-control",i.alert="dotvvm-bp-alert",i.autoComplete="dotvvm-bp-auto-complete",i.button="dotvvm-bp-button",i.calendar="dotvvm-bp-calendar",i.carousel="dotvvm-bp-carousel",i.checkBox="dotvvm-bp-check-box",i.checkBoxList="dotvvm-bp-check-box-list",i.colorPicker="dotvvm-bp-color-picker",i.comboBox="dotvvm-bp-combo-box",i.copyButton="dotvvm-bp-copy-button",i.dataPager="dotvvm-bp-data-pager",i.datePicker="dotvvm-bp-date-picker",i.dateRangePicker="dotvvm-bp-date-range-picker",i.dateTimePicker="dotvvm-bp-date-time-picker",i.dateTimeRangePicker="dotvvm-bp-date-time-range-picker",i.dialog="dotvvm-bp-dialog",i.draggableList="dotvvm-bp-draggable-list",i.dropDownButton="dotvvm-bp-drop-down-button",i.dropDownList="dotvvm-bp-drop-down-list",i.editableLiteral="dotvvm-bp-editable-literal",i.fileUpload="dotvvm-bp-file-upload",i.filterBuilder="dotvvm-bp-filter-builder",i.filterEditor="dotvvm-bp-filter-editor",i.formItem="dotvvm-bp-form-item",i.gridView="dotvvm-bp-grid-view",i.gridViewRowSelectColumn="dotvvm-bp-grid-view-row-select-column",i.gridViewUserSettingsEditor="dotvvm-bp-grid-view-user-settings-editor",i.icon="dotvvm-bp-icon",i.imageCrop="dotvvm-bp-image-crop",i.listView="dotvvm-bp-list-view",i.maskedTextBox="dotvvm-bp-masked-text-box",i.modalDialog="dotvvm-bp-modal-dialog",i.multiSelect="dotvvm-bp-multi-select",i.numericUpDown="dotvvm-bp-numeric-up-down",i.panel="dotvvm-bp-panel",i.radioButton="dotvvm-bp-radio-button",i.radioButtonList="dotvvm-bp-radio-button-list",i.rangeCalendar="dotvvm-bp-range-calendar",i.rangeSlider="dotvvm-bp-range-slider",i.rating="dotvvm-bp-rating",i.richTextBox="dotvvm-bp-rich-text-box",i.slider="dotvvm-bp-slider",i.switchButton="dotvvm-bp-switch-button",i.tabControl="dotvvm-bp-tab-control",i.text="dotvvm-bp-text",i.textBox="dotvvm-bp-text-box",i.timePicker="dotvvm-bp-time-picker",i.timeRangePicker="dotvvm-bp-time-range-picker",i.toggleButton="dotvvm-bp-toggle-button",i.toolbar="dotvvm-bp-toolbar",i.toolbarButton="dotvvm-bp-toolbar-button",i.tooltip="dotvvm-bp-tooltip",i.treeView="dotvvm-bp-tree-view",i.textView="dotvvm-bp-text-view",i.window="dotvvm-bp-window",i.flagAnimated="dotvvm-bp-flag_animated",i.flagAutoFocusable="dotvvm-bp-flag_auto-focusable",i.flagCustomAllowed="dotvvm-bp-flag_custom-allowed",i.flagDismissible="dotvvm-bp-flag_dismissible",i.flagExpandable="dotvvm-bp-flag_expandable",i.flagFocusPrevented="dotvvm-bp-flag_focus-prevented",i.flagInline="dotvvm-bp-flag_inline",i.flagMultiline="dotvvm-bp-flag_multiline",i.flagOverflowHidden="dotvvm-bp-flag_overflow-hidden",i.flagUnselectAllowed="dotvvm-bp-flag_unselect-allowed",i.flagRounded="dotvvm-bp-flag_rounded",i.flagWithList="dotvvm-bp-flag_with-list",i.flagIe="dotvvm-bp-flag_ie",i.flagDefaultTemplate="dotvvm-bp-flag_default-template",i.stateActive="dotvvm-bp-state_active",i.stateBusy="dotvvm-bp-state_busy",i.stateChecked="dotvvm-bp-state_checked",i.stateDataEmpty="dotvvm-bp-state_data-empty",i.stateDisabled="dotvvm-bp-state_disabled",i.stateDragover="dotvvm-bp-state_dragover",i.stateError="dotvvm-bp-state_error",i.stateExpanded="dotvvm-bp-state_expanded",i.stateFocused="dotvvm-bp-state_focused",i.stateHalfSelected="dotvvm-bp-state_half-selected",i.stateHidden="dotvvm-bp-state_hidden",i.stateHiding="dotvvm-bp-state_hiding",i.stateIndeterminate="dotvvm-bp-state_indeterminate",i.stateLoading="dotvvm-bp-state_loading",i.stateMoving="dotvvm-bp-state_moving",i.stateOpened="dotvvm-bp-state_opened",i.stateResizing="dotvvm-bp-state_resizing",i.stateSelected="dotvvm-bp-state_selected",i.stateSemiDisabled="dotvvm-bp-state_semi-disabled",i.stateShowing="dotvvm-bp-state_showing",i.stateSortedAsc="dotvvm-bp-state_sorted-asc",i.stateSortedDesc="dotvvm-bp-state_sorted-desc",i.stateValueEmpty="dotvvm-bp-state_value-empty",i.primitiveBody="dotvvm-bp-primitive_body",i.primitiveButton="dotvvm-bp-primitive_button",i.primitiveButtonGroup="dotvvm-bp-primitive_button-group",i.primitiveButtonIcon="dotvvm-bp-primitive_button-icon",i.primitiveButtonNav="dotvvm-bp-primitive_button-nav",i.primitiveCheckBox="dotvvm-bp-primitive_check-box",i.primitiveCheckerboard="dotvvm-bp-primitive_checkerboard",i.primitiveContainer="dotvvm-bp-primitive_container",i.primitiveContents="dotvvm-bp-primitive_contents",i.primitiveDropDown="dotvvm-bp-primitive_drop-down",i.primitiveDropZone="dotvvm-bp-primitive_drop-zone",i.primitiveEditor="dotvvm-bp-primitive_editor",i.primitiveErrorMessage="dotvvm-bp-primitive_error-message",i.primitiveFooter="dotvvm-bp-primitive_footer",i.primitiveGrip="dotvvm-bp-primitive_grip",i.primitiveGripE="dotvvm-bp-primitive_grip-e",i.primitiveGripN="dotvvm-bp-primitive_grip-n",i.primitiveGripNE="dotvvm-bp-primitive_grip-ne",i.primitiveGripNW="dotvvm-bp-primitive_grip-nw",i.primitiveGripS="dotvvm-bp-primitive_grip-s",i.primitiveGripSE="dotvvm-bp-primitive_grip-se",i.primitiveGripSW="dotvvm-bp-primitive_grip-sw",i.primitiveGripW="dotvvm-bp-primitive_grip-w",i.primitiveGroup="dotvvm-bp-primitive_group",i.primitiveHeader="dotvvm-bp-primitive_header",i.primitiveInput="dotvvm-bp-primitive_input",i.primitiveInputGroup="dotvvm-bp-primitive_input-group",i.primitiveItem="dotvvm-bp-primitive_item",i.primitiveLabel="dotvvm-bp-primitive_label",i.primitiveLine="dotvvm-bp-primitive_line",i.primitiveList="dotvvm-bp-primitive_list",i.primitiveNav="dotvvm-bp-primitive_nav",i.primitiveOverlay="dotvvm-bp-primitive_overlay",i.primitivePicker="dotvvm-bp-primitive_picker",i.primitivePlaceholder="dotvvm-bp-primitive_placeholder",i.primitivePoint="dotvvm-bp-primitive_point",i.primitivePopup="dotvvm-bp-primitive_popup",i.primitiveProgressBar="dotvvm-bp-primitive_progress-bar",i.primitiveRadioButton="dotvvm-bp-primitive_radio-button",i.primitiveRows="dotvvm-bp-primitive_rows",i.primitiveSelectionBox="dotvvm-bp-primitive_selection-box",i.primitiveSeparator="dotvvm-bp-primitive_separator",i.primitiveSide="dotvvm-bp-primitive_side",i.primitiveSlider="dotvvm-bp-primitive_slider",i.primitiveSwitchButton="dotvvm-bp-primitive_switch-button",i.primitiveTable="dotvvm-bp-primitive_table",i.primitiveTemplate="dotvvm-bp-primitive_template",i.primitiveText="dotvvm-bp-primitive_text",i.primitiveTextArea="dotvvm-bp-primitive_text-area",i.primitiveTextBox="dotvvm-bp-primitive_text-box",i.primitiveTitlebar="dotvvm-bp-primitive_titlebar",i.primitiveToolbar="dotvvm-bp-primitive_toolbar",i.primitiveValue="dotvvm-bp-primitive_value",i.positionEnd="dotvvm-bp-position_end",i.positionStart="dotvvm-bp-position_start",i.displayFlex1="dotvvm-bp-display_flex-1",i.displayFlex0="dotvvm-bp-display_flex-0",i.alignCenter="dotvvm-bp-align_center",i.alignLeft="dotvvm-bp-align_left",i.alignRight="dotvvm-bp-align_right",i.commandAdd="dotvvm-bp-command_add",i.commandAddFilter="dotvvm-bp-command_add-filter",i.commandAddGroup="dotvvm-bp-command_add-group",i.commandClose="dotvvm-bp-command_close",i.commandCancel="dotvvm-bp-command_cancel",i.commandCollapse="dotvvm-bp-command_collapse",i.commandConfirm="dotvvm-bp-command_confirm",i.commandDecrease="dotvvm-bp-command_decrease",i.commandDelete="dotvvm-bp-command_delete",i.commandExpand="dotvvm-bp-command_expand",i.commandIncrease="dotvvm-bp-command_increase",i.commandMaximize="dotvvm-bp-command_maximize",i.commandNext="dotvvm-bp-command_next",i.commandOpen="dotvvm-bp-command_open",i.commandPrev="dotvvm-bp-command_prev",i.commandReset="dotvvm-bp-command_reset",i.commandRestore="dotvvm-bp-command_restore",i.commandRotateLeft="dotvvm-bp-command_rotate-left",i.commandRotateRight="dotvvm-bp-command_rotate-right",i.commandSwitch="dotvvm-bp-command_switch",i.commandSelectFiles="dotvvm-bp-command_select-files",i.commandToggle="dotvvm-bp-command_toggle",i.commandUnselect="dotvvm-bp-command_unselect",i.commandZoomIn="dotvvm-bp-command_zoom-in",i.commandZoomOut="dotvvm-bp-command_zoom-out",i.postbackPending="dotvvm-bp-postback_pending",i.postbackSuccess="dotvvm-bp-position_success",i.postbackFail="dotvvm-bp-position_fail",i.alertTypeIcon="dotvvm-bp-alert_type-icon",i.alertTypePrefix="dotvvm-bp-alert_",i.buttonTypePrefix="dotvvm-bp-button_",i.buttonOutline="dotvvm-bp-button_outline",i.calendarDay="dotvvm-bp-calendar_day",i.calendarDayHeader="dotvvm-bp-calendar_day-header",i.calendarDecadeView="dotvvm-bp-calendar_decade-view",i.calendarLeap="dotvvm-bp-calendar_leap",i.calendarMonth="dotvvm-bp-calendar_month",i.calendarMonthView="dotvvm-bp-calendar_month-view",i.calendarOther="dotvvm-bp-calendar_other",i.calendarToday="dotvvm-bp-calendar_today",i.calendarWeek="dotvvm-bp-calendar_week",i.calendarWeekHeader="dotvvm-bp-calendar_week-header",i.calendarWeekNumber="dotvvm-bp-calendar_week-number",i.calendarYear="dotvvm-bp-calendar_year",i.calendarYearView="dotvvm-bp-calendar_year-view",i.calendarDateSelector="dotvvm-bp-calendar_date-selector",i.calendarHourSelector="dotvvm-bp-calendar_hour-selector",i.calendarMain="dotvvm-bp-calendar_main",i.calendarMinuteSelector="dotvvm-bp-calendar_minute-selector",i.calendarMonthSelector="dotvvm-bp-calendar_month-selector",i.calendarOtherMonth="dotvvm-bp-calendar_other-month",i.calendarSelector="dotvvm-bp-calendar_selector",i.calendarSelectorEnd="dotvvm-bp-calendar_selector-end",i.calendarSelectorStart="dotvvm-bp-calendar_selector-start",i.calendarSelectionEnd="dotvvm-bp-calendar_selection-end",i.calendarSelectionStart="dotvvm-bp-calendar_selection-start",i.calendarTable="dotvvm-bp-calendar_table",i.calendarUpperRow="dotvvm-bp-calendar_upper-row",i.calendarWeekend="dotvvm-bp-calendar_weekend",i.calendarYearSelector="dotvvm-bp-calendar_year-selector",i.colorPickerAlphaEditor="dotvvm-bp-color-picker_alpha-editor",i.colorPickerAlphaSlider="dotvvm-bp-color-picker_alpha-slider",i.colorPickerAlphaWrapper="dotvvm-bp-color-picker_alpha-wrapper",i.colorPickerBlueEditor="dotvvm-bp-color-picker_blue-editor",i.colorPickerEditor="dotvvm-bp-color-picker_editor",i.colorPickerGreenEditor="dotvvm-bp-color-picker_green-editor",i.colorPickerHexEditor="dotvvm-bp-color-picker_hex-editor",i.colorPickerHueSlider="dotvvm-bp-color-picker_hue-slider",i.colorPickerPalette="dotvvm-bp-color-picker_palette",i.colorPickerPredefinedColors="dotvvm-bp-color-picker_predefined-colors",i.colorPickerPreview="dotvvm-bp-color-picker_preview",i.colorPickerRedEditor="dotvvm-bp-color-picker_red-editor",i.colorPickerRgbaEditor="dotvvm-bp-color-picker_rgba-editor",i.colorPickerRgbEditor="dotvvm-bp-color-picker_rgb-editor",i.colorPickerSliders="dotvvm-bp-color-picker_sliders",i.colorPickerSpectrum="dotvvm-bp-color-picker_spectrum",i.dateTimeToolbar="dotvvm-bp-date-time_toolbar",i.dialogBase="dotvvm-bp-dialog_base",i.dialogGrip="dotvvm-bp-dialog_grip",i.windowMovable="dotvvm-bp-window-movable",i.dialogHorizontalAlignCenter="dotvvm-bp-dialog-horizontal-align_center",i.dialogHorizontalAlignLeft="dotvvm-bp-dialog-horizontal-align_left",i.dialogHorizontalAlignRight="dotvvm-bp-dialog-horizontal-align_right",i.dialogVerticalAlignCenter="dotvvm-bp-dialog-vertical-align_center",i.dialogVerticalAlignTop="dotvvm-bp-dialog-vertical-align_top",i.dialogVerticalAlignBottom="dotvvm-bp-dialog-vertical-align_bottom",i.dialogCloseButton="dotvvm-bp-dialog_close-button",i.fileUploadFiles="dotvvm-bp-file-upload_files",i.fileUploadPanel="dotvvm-bp-file-upload_panel",i.filterEditorOperatorEditor="dotvvm-bp-filter-editor_operator-editor",i.filterEditorValueEditor="dotvvm-bp-filter-editor_value-editor",i.formItemAfterControlTemplateWrapper="dotvvm-bp-form-item_after-control-template-wrapper",i.formItemBeforeControlTemplateWrapper="dotvvm-bp-form-item_before-control-template-wrapper",i.formItemControl="dotvvm-bp-form-item_control",i.formItemLabel="dotvvm-bp-form-item_label",i.formItemHint="dotvvm-bp-form-item_hint",i.formItemValidatorPositionAfter="dotvvm-bp-form-item-validator-position-after",i.formItemValidatorPositionBefore="dotvvm-bp-form-item-validator-position-before",i.formItemValidation="dotvvm-bp-form-item_validation",i.formItemValidationIcon="dotvvm-bp-form-item_validation_icon",i.gridViewColumnFooterRow="dotvvm-bp-grid-view_footer-row",i.gridViewColumnHeaderRow="dotvvm-bp-grid-view_column-header-row",i.gridViewEmptyRow="dotvvm-bp-grid-view_empty-row",i.gridViewFilterRow="dotvvm-bp-grid-view_filter-row",i.gridViewFooterRow="dotvvm-bp-grid-view_column-footer-row",i.gridViewHeaderRow="dotvvm-bp-grid-view_header-row",i.gridViewHeaderItem="dotvvm-bp-grid-view_header-item",i.gridViewFixedHeaderRow="dotvvm-bp-grid-view_fixed-header-row",i.gridViewSortButton="dotvvm-bp-grid-view_sort-button",i.gridViewHeaderValue="dotvvm-bp-grid-view_header-value",i.gridViewPlaceholder="dotvvm-bp-grid-view_placeholder",i.gridViewSelectedRow="dotvvm-bp-state_selected",i.gridViewStateDragged="dotvvm-bp_state-dragged",i.imageCropCropCanvas="dotvvm-bp-image-crop_crop-canvas",i.imageCropImageCanvas="dotvvm-bp-image-crop_image-canvas",i.listViewDisplayModeList="dotvvm-bp-list-view_display-mode-list",i.listViewDisplayModeTiles="dotvvm-bp-list-view_display-mode-tiles",i.ratingHalfFill="dotvvm-bp-rating_half-fill",i.richTextBoxParagraphStyleList="dotvvm-bp-rich-text-box_paragraph-style-list",i.sliderMaxGrip="dotvvm-bp-slider_max-grip",i.sliderMinGrip="dotvvm-bp-slider_min-grip",i.switchButtonToggle="dotvvm-bp-switch-button_toggle",i.tabControlNav="dotvvm-bp-tab-control_nav",i.tabControlItem="dotvvm-bp-tab-control_item",i.tabControlContent="dotvvm-bp-tab-control_content",i.tabControlNavItem="dotvvm-bp-tab_nav-item",i.timePickerHour="dotvvm-bp-time-picker_hour",i.timePickerHourDial="dotvvm-bp-time-picker_hour-dial",i.timePickerMinute="dotvvm-bp-time-picker_minute",i.timePickerMinuteDial="dotvvm-bp-time-picker_minute-dial",i.timePickerSecond="dotvvm-bp-time-picker_second",i.timePickerSecondDial="dotvvm-bp-time-picker_second-dial",i.timePickerDesignator="dotvvm-bp-time-picker_designator",i.timePickerDesignatorDial="dotvvm-bp-time-picker_designator-dial",i.timePickerTimeDial="dotvvm-bp-time-picker_time-dial",i.timePickerNow="dotvvm-bp-time-picker_now",i.timePickerSeparator="dotvvm-bp-time-picker_separator",i.toggleButtonPrefix="dotvvm-bp-toggle-button_",i.toggleButtonTypeToggle="dotvvm-bp-toggle-button_toggle",i.toggleButtonTypeSwitch="dotvvm-bp-toggle-button_switch",i.treeViewList="dotvvm-bp-treeview_list",i.treeViewListItem="dotvvm-bp-treeview_list-item",i.treeViewListButtons="dotvvm-bp-treeview_list-buttons",i.treeViewLabel="dotvvm-bp-treeview_label",i);function i(){}t.BusinessPackCss=e}(t.BusinessPack||(t.BusinessPack={}))}(DotVVM=DotVVM||{}),function(t){!function(t){"use strict";var e=(i.left=1,i.middle=2,i.right=3,i);function i(){}t.MouseButtons=e}(t.BusinessPack||(t.BusinessPack={}))}(DotVVM=DotVVM||{}),function(t){!function(t){"use strict";var e=(i.isWhiteSpace=function(t){return t===i.spacebar||i.isEnter(t)},i.isUpOrDown=function(t){return t===i.up||t===i.down},i.isLeftOrRight=function(t){return t===i.left||t===i.right},i.isArrow=function(t){return this.isUpOrDown(t)||this.isLeftOrRight(t)},i.isEnter=function(t){return t===i.enter||t===i.numpadEnter},i.isDeleteOrBackspace=function(t){return this.isBackspace(t)||this.isDelete(t)},i.isBackspace=function(t){return t===i.backspace},i.isDelete=function(t){return t===i.delete},i.isEscape=function(t){return t===i.esc},i.a=65,i.b=66,i.c=67,i.d=68,i.e=69,i.f=70,i.g=71,i.h=72,i.i=73,i.j=74,i.k=75,i.l=76,i.m=77,i.n=78,i.o=79,i.p=80,i.q=81,i.r=82,i.s=83,i.t=84,i.u=85,i.v=86,i.w=87,i.x=88,i.y=89,i.z=90,i.num0=48,i.num1=49,i.num2=50,i.num3=51,i.num4=52,i.num5=53,i.num6=54,i.num7=55,i.num8=56,i.num9=57,i.numpadZero=96,i.numpadOne=97,i.numpadTwo=98,i.numpadThree=99,i.numpadFour=100,i.numpadFive=101,i.numpadSix=102,i.numpadSeven=103,i.numpadEight=104,i.numpadNine=105,i.numpadMultiply=106,i.numpadAdd=107,i.numpadEnter=108,i.numpadSubtract=109,i.numpadDecimal=110,i.numpadDivide=111,i.f1=112,i.f2=113,i.f3=114,i.f4=115,i.f5=116,i.f6=117,i.f7=118,i.f8=119,i.f9=120,i.f10=121,i.f11=122,i.f12=123,i.f13=124,i.f14=125,i.f15=126,i.colon=186,i.equals=187,i.underscore=189,i.questionMark=191,i.tilde=192,i.openBracket=219,i.backwardSlash=220,i.closeBracket=221,i.quotes=222,i.lessThan=188,i.greaterThan=190,i.backspace=8,i.tab=9,i.clear=12,i.enter=13,i.shift=16,i.control=17,i.alt=18,i.capsLock=20,i.esc=27,i.spacebar=32,i.pageUp=33,i.pageDown=34,i.end=35,i.home=36,i.left=37,i.up=38,i.right=39,i.down=40,i.insert=45,i.delete=46,i.help=47,i.numLock=144,i);function i(){}t.KeyboardKeys=e}(t.BusinessPack||(t.BusinessPack={}))}(DotVVM=DotVVM||{}),function(t){!function(t){"use strict";var e=(Object.defineProperty(i,"isIe",{get:function(){return"Microsoft Internet Explorer"===navigator.appName||!!/\bTrident\b/.test(this.userAgent)},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isEdge",{get:function(){return/webkit\W.*(edge)\W/i.test(this.userAgent)},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isChrome",{get:function(){return/webkit\W.*(chrome|chromium)\W/i.test(this.userAgent)},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isGecko",{get:function(){return/mozilla(?!.*webkit).*\Wgecko\W/i.test(this.userAgent)},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isFirefox",{get:function(){return/mozilla.*\Wfirefox\W/i.test(this.userAgent)},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isSafari",{get:function(){return/webkit\W(?!.*chrome).*safari\W/i.test(this.userAgent)},enumerable:!0,configurable:!0}),Object.defineProperty(i,"isMobileOrTablet",{get:function(){return/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile/i.test(this.userAgent)},enumerable:!0,configurable:!0}),i.userAgent=window.navigator&&navigator.userAgent||"",i);function i(){}t.Browser=e}(t.BusinessPack||(t.BusinessPack={}))}(DotVVM=DotVVM||{}),function(t){var e,i;function p(t){void 0===t&&(t=[]),this.a=t,Object.defineProperty(this,"a",{value:t,writable:!1})}e=t.BusinessPack||(t.BusinessPack={}),p.prototype.aggregate=function(t){var e,i;if(0===(e=this.a).length)throw"Aggregate of empty array";i=e[0];for(var n=1,s=e.length;n=this.a.length)throw"Index was out of range. Must be non-negative and less than the size of the collection.";return this.a[t]},p.prototype.elementAtOrDefault=function(t,e){return void 0===e&&(e=null),t>=this.a.length||t<0?e:this.a[t]},p.prototype.except=function(t,e){for(var i,n=this.a,s=[],o={},r=e?e.getHashCode:function(t){return Object.getHashCode(t)},a=0,l=t.length;a(n=e.length)?n:t,s=0;st.length?t.length:i.length;s").text(t).html()},d.normalizeSpaces=function(t){return t?t.replace(new RegExp(this.nonBreakingSpace,"g")," ").replace(new RegExp(d.zeroWidthSpace,"g"),""):t},d.createGuid=function(t){void 0===t&&(t=!0);for(var e="",i=0;i<32;i++){var n=16*Math.random()|0;!t||8!==i&&12!==i&&16!==i&&20!==i||(e+="-"),e+=(12===i?4:16===i?3&n|8:n).toString(16)}return e},d.convertTouchToMouseEvent=function(t){var e=t.type;switch(e){case"touchstart":e="mousedown";break;case"touchmove":e="mousemove";break;case"touchend":e="mouseup";break;case"mousedown":case"mousemove":case"mouseup":return t;default:return this.warnInDebugMode("The '"+e+"' event is not a supported touch event."),null}var i=t.originalEvent;if(1").val(t.toString()).css({position:"fixed",top:0,left:0,clip:"rect(0 0 0 0)",border:0,width:"1px",height:"1px",overflow:"hidden",padding:0});e.appendTo(document.body).select();try{return document.execCommand("copy")}catch(t){return!1}finally{e.remove()}},i);function i(){}t.Clipboard=e}(t.BusinessPack||(t.BusinessPack={}))}(DotVVM=DotVVM||{}),function(t){!function(t){"use strict";var e=(i.compare=function(t,e){var i;if(0===t.length)return e.length;if(0===e.length)return t.length;t.length>e.length&&(t=(i=__read([e,t],2))[0],e=i[1]);for(var n=new Array(t.length+1),s=0;s<=t.length;s++)n[s]=s;for(s=1;s<=e.length;s++){for(var o=s,r=void 0,a=1;a<=t.length;a++)r=e[s-1]===t[a-1]?n[a-1]:Math.min(n[a-1]+1,Math.min(o+1,n[a]+1)),n[a-1]=o,o=r;n[t.length]=o}return n[t.length]},i);function i(){}t.Levenshtein=e}(t.BusinessPack||(t.BusinessPack={}))}(DotVVM=DotVVM||{}),function(t){!function(t){"use strict";var e=(i.urlOrEmail=function(t){return new RegExp("(\\b(?:(?:https?://|www\\.)[^/ -\\.]{1}[^\\s\\(\\)\\<\\>]+)\\b(?:[^\\.\\,)]??[/]*))(?=[\\s]*)|(@??\\b[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\b)",t)},i.twoLineBreaks=function(t){return new RegExp("(?:\\r\\n){2}|\\n\\n",t)},i.lineBreak=function(t){return new RegExp("(\\n|\\r\\n)",t)},i.hex8Color=function(t){return new RegExp("^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{4}|[A-Fa-f0-9]{6}|[A-Fa-f0-9]{8})$",t)},i.hex6Color=function(t){return new RegExp("^#?([A-Fa-f0-9]{3}|[A-Fa-f0-9]{6})$",t)},i.mimeTypeSecondPart=function(t){return new RegExp("/.*$",t)},i.wildcardMimeType=function(t){return new RegExp("/*$",t)},i.getLastMatch=function(t,e,i){for(var n,s=[];n=t.exec(e);)s.push(n);if(s.length){if(0<=i)for(;n=s.pop();)if(n.index>>0))},t.formatSize=function(t){for(var e=0,i=t;1024<=i&&e thead > tr, > tbody > tr, > tr").length},o.hasOnlyOneColumn=function(t){return 1===t.find("> thead > tr, > tbody > tr, > tr").first().children().length},o.reverse=function(t){for(var e=$([]),i=t.length;i--;)e=e.add(t[i]);return e},o.clone=function(t,e){var i,n,s=$([]);try{for(var o=__values(t.get()),r=o.next();!r.done;r=o.next())var a=r.value,s=s.add($(a.cloneNode(e)))}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},o.cloneAs=function(t,e,i){var n,s,o=$([]);try{for(var r=__values(t.get()),a=r.next();!a.done;a=r.next()){for(var l=a.value.cloneNode(i),u=document.createElement(e),c=0,h=l.attributes.length;cwindow.innerHeight&&0<=(h=i.top-s-a-2*o)&&(u=h),c+n>window.innerWidth&&0e.left+i&&(n=e.left+i)),n},i.prototype.calculatePageY=function(t){var e,i,n=t.pageY;return this.restrictToParent&&(e=this.$parent.offset(),i=this.$parent.outerHeight(),ne.top+i&&(n=e.top+i)),n},i.prototype.calculateLeft=function(t){var e,i,n=this.$element.position().left+(t-this.initialX);return this.restrictToParent&&(e=this.$element.outerWidth(),i=this.$parent.outerWidth(),n<0?n=0:i=this.initialY||!(t>=this.initialX&&e<=this.initialY)&&t=this.initialY||!(t>=this.initialX&&e<=this.initialY||tn+t.height()||i+this.$element.width()s+t.width())},i.prototype.refreshContents=function(){},i);function i(t,e){var i=n.call(this,t)||this;return i.isActive=!1,i.hasUpdated=!1,i.options=__assign({},i.getDefaultOptions(),e),i.$parent=t.parent(),i.$trigger=i.options.$trigger||i.$parent,i.onDocumentMousemoveHandler=i.onDocumentMousemove.bind(i),i.onDocumentMouseupHandler=i.onDocumentMouseup.bind(i),i.$trigger.mousedown(i.onTriggerMousedown.bind(i)),i.update(function(){return i.refreshContents()}),i.reset(),i}t.SelectionBox=e})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var i;(function(t){"use strict";var e=(u.watch=function(t,e){var i=!1;return ko.isObservable(t)?new u(t,function(){ko.delaySync.isPaused?i||(i=!0,ko.delaySync.run(function(){e(t.peek()),i=!1})):e(t.peek())}):null},u.prototype.onArrayChange=function(t){var e,i;try{for(var n=__values(t),s=n.next();!s.done;s=n.next()){var o,r=s.value,a=r.status,l=r.value;ko.isObservable(l)&&("added"===a?this.watchers.push(new u(l,this.runCallback)):"deleted"!==a||(o=this.findWatcher(l))&&(o.dispose(),this.watchers.splice(this.watchers.indexOf(o),1)))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.runCallback()},u.prototype.watchArray=function(t){var e,i;if(t)try{for(var n=__values(t),s=n.next();!s.done;s=n.next()){var o=s.value;ko.isObservable(o)&&this.watchers.push(new u(o,this.runCallback))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}},u.prototype.onObjectChange=function(t){for(;this.watchers.length;)this.watchers.pop().dispose();this.watchObject(t),this.runCallback()},u.prototype.watchObject=function(t){for(var e in t){var i;!t.hasOwnProperty(e)||e.startsWith("$")||e.endsWith("$options")||(i=t[e],ko.isObservable(i)&&this.watchers.push(new u(i,this.runCallback)))}},u.prototype.findWatcher=function(t){var e,i;try{for(var n=__values(this.watchers),s=n.next();!s.done;s=n.next()){var o=s.value;if(o.observable===t)return o}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}return null},u.prototype.dispose=function(){for(this.subscription&&(this.subscription.dispose(),this.subscription=null);this.watchers.length;)this.watchers.pop().dispose()},u);function u(t,e){this.observable=t,this.runCallback=e,this.watchers=[],i.Utils.isObservableArray(t)?(this.subscription=t.subscribe(this.onArrayChange,this,"arrayChange"),this.watchArray(t.peek())):(this.subscription=t.subscribe(this.onObjectChange,this),this.watchObject(t.peek()))}t.ObservableWatcher=e})((i=t.BusinessPack||(t.BusinessPack={})).Controls||(i.Controls={}))}(DotVVM=DotVVM||{}),function(t){var i;(function(s){"use strict";var t=(e.prototype.on=function(t,e){return t&&e&&(this.events[t]=this.events[t]||[],this.events[t].push(e)),this},e.prototype.off=function(t,e){if(t){if(this.events.hasOwnProperty(t))if(e)for(var i=this.events[t],n=i.length;n--;)i[n][0]===e&&i.splice(n,1);else delete this.events[t]}else this.events={}},e.prototype.trigger=function(t){for(var e,i,n,s,o=[],r=1;r").append(i.text())),i.text(n.html()),s.valueHasMutated())},i.prototype.getTemplateId=function(t){if(this._templateIds.hasOwnProperty(t))return this._templateIds[t];var e=this.$element.children("script[id$='."+t+"'][type='text/html']");return e.length?this._templateIds[t]=ko.observable(e.attr("id")):null},i.prototype.onVisibleChange=function(t,e){void 0!==t&&this.toggle(!!t,e)},i.prototype.onEnabledChange=function(){this.$element.toggleClass(r.BusinessPackCss.stateDisabled,!this.isEnabled),null!=this.binding.tabIndex&&this.toggleTabIndex()},i.prototype.toggleTabIndex=function(){this.isEnabled?this.$element.attr("tabindex",this.binding.tabIndex):this.$element.removeAttr("tabindex")},i.prototype.isOutsideOfTree=function(t){return!t||!this.$element.is(t)&&0===this.$element.find($(t)).length},i.prototype.postback=function(t){return t?t():void 0},i.prototype.emptyPostback=function(){dotvvm.postbackScript("null")("root",this.$element[0],[],"",!0,"$root",null,null)},i);function i(t,e,i,n){var s=o.call(this)||this;return s.$element=t,s.binding=e,s.allBindings=i,s.bindingContext=n,s._templateIds={},s.getAnimationDuration=function(){return Math.max(s.getTimeInMiliseconds(s.$element.css("transition-duration")),s.getTimeInMiliseconds(s.$element.css("animation-duration")),0)},s.getTimeInMiliseconds=function(t){var e=parseFloat(t);return isNaN(e)?0:t.endsWith("s")?1e3*e:e},s.getInlineStyleHeight=function(){return s.$element[0].style.height},s}t.ControlBase=e})((r=t.BusinessPack||(t.BusinessPack={})).Controls||(r.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e,i,n,s;function o(){return null!==n&&n.apply(this,arguments)||this}e=t.BusinessPack||(t.BusinessPack={}),i=e.Controls||(e.Controls={}),n=i.ControlBase,__extends(o,n),o.prototype.isFilterCondition=function(t){return"FilterCondition"===ko.unwrap(t).Type()},o.prototype.isFilterGroup=function(t){return"FilterGroup"===ko.unwrap(t).Type()},s=o,i.FilterControlBase=s}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e,i=(e=t.ControlBase,__extends(n,e),n);function n(){return null!==e&&e.apply(this,arguments)||this}t.EditorBase=i})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var o;(function(t){"use strict";var e,i=(e=t.ControlBase,__extends(n,e),Object.defineProperty(n.prototype,"items",{get:function(){return o.Utils.getDataSourceItems(this.binding.dataSource)},enumerable:!0,configurable:!0}),n.prototype.getItemKey=function(t){var e=ko.unwrap(t),i=this.getItemKeyBinding();if(null==e)throw Error("The unique key can't be resolved for null or undefined.");if(i&&(e=ko.unwrap(i(t))),"object"==typeof e)throw Error("The unique key can't be resolved. Is KeyBinding property missing?");return e},n.prototype.findItemByKey=function(e){var i=this;return e=ko.unwrap(e),this.findItem(function(t){return i.getItemKey(t)===e})},n.prototype.getItemValueCopy=function(t){return o.Utils.deepClone(this.getItemValue(t))},n.prototype.getItemValue=function(t){var e=ko.unwrap(t),i=this.getItemValueBinding();if(null==e)throw Error("The value can't be resolved for null or undefined.");return i&&(e=ko.unwrap(i(t))),e},n.prototype.isValueOfItem=function(t,e){t=ko.unwrap(t);var i=this.getItemValueBinding();return o.Utils.isDataAccessor(i)?this.getItemKey(t)===this.getItemKey(e):t===this.getItemValue(e)},n.prototype.findItemByValue=function(e){var i=this;e=ko.unwrap(e);var t=this.getItemValueBinding();if(null!=e&&o.Utils.isDataAccessor(t)){var n=this.getItemKey(e);return this.findItem(function(t){return i.getItemKey(t)===n})}return this.findItem(function(t){return i.getItemValue(t)===e})},n.prototype.getItemText=function(t){var e=ko.unwrap(t),i=this.getItemTextBinding();if(null==e)throw Error("The text can't be resolved for null or undefined.");if(i&&null==(e=ko.unwrap(i(t)))&&(e=""),"object"==typeof e)throw Error("The text can't be resolved. Is ItemTextBinding property missing?");return e},n.prototype.createItemFromText=function(t){var e=this.getItemTextBinding();if(!o.Utils.isDataAccessor(e))throw Error("The item can't be created. The ItemTextBinding must not be set.");return t},n.prototype.findItemByText=function(e){var i=this;return this.findItem(function(t){return i.getItemText(t)===e})},n.prototype.findItemInDataSourceOrAdd=function(t){var e=this,i=this.items(),n=this.getItemKey(t),s=i.asLinq().firstOrDefault(function(t){return e.getItemKey(t)===n});return s||(s=o.Utils.ensureObservable(t),this.items.push(s)),s},n.prototype.findItem=function(t){return this.getAllItems().asLinq().firstOrDefault(t)},n.prototype.removeAllItemsExcept=function(e){var i=this;this.items.remove(function(t){return e.indexOf(i.getItemKey(t))<0})},n.prototype.warnThatKeyWasNotFound=function(t){console.warn("An item with key equal to '"+t+"' couldn't be found in the DataSource.")},n.prototype.warnThatValueWasNotFound=function(t){t=ko.unwrap(t),console.warn("object"==typeof t?"An item with key equal to '"+this.getItemKey(t)+"' couldn't be found in the DataSource. This issue can be also caused by a known bug and it's required that the name of the DataSource property has to come first in alphabetical order with the name of the SelectedValue / SelectedValues property.":"An item with value equal to '"+t+"' couldn't be found in the DataSource. This issue can be also caused by a known bug and it's required that the name of the DataSource property has to come first in alphabetical order with the name of the SelectedValue / SelectedValues property.")},n.prototype.getAllItems=function(){return this.items()},n.prototype.getItemKeyBinding=function(){return null},n.prototype.getItemValueBinding=function(){return null},n.prototype.getItemTextBinding=function(){return null},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.ItemsControlBase=i})((o=t.BusinessPack||(t.BusinessPack={})).Controls||(o.Controls={}))}(DotVVM=DotVVM||{}),function(t){var u;(function(t){"use strict";var e,i=(e=t.ItemsControlBase,__extends(n,e),n.prototype.initialize=function(){e.prototype.initialize.call(this),this.watch(this.binding.dataSource,this.onDataSourceChange)},n.prototype.isRootItem=function(t){var e=this,i=this.items(),n=this.getItemKey(t);return i.asLinq().any(function(t){return e.getItemKey(t)===n})},n.prototype.hasChildren=function(t){var e=this.binding.itemChildrenBinding;if(e){var i=ko.unwrap(e(t));return i&&!!i.length}return!1},n.prototype.getChildren=function(t){var e=this.binding.itemChildrenBinding;return e&&ko.unwrap(e(t))||[]},n.prototype.getParent=function(t){var e=this,i=this.getAllItems(),n=this.getItemKey(t);return i.asLinq().where(function(t){return e.getItemKey(t)===n}).select(function(t){return t.$parent}).singleOrDefault()},n.prototype.getAllItems=function(){return ko.unwrap(this.allItems)},n.prototype.onDataSourceChange=function(){this.allItems(this.getItemsRecursively(null,this.items()))},n.prototype.getItemsRecursively=function(t,e){var i,n,s=[];try{for(var o=__values(e),r=o.next();!r.done;r=o.next()){var a=r.value;a.$parent=t,s.push(a);var l=this.getChildren(a);l.length&&u.Utils.pushAll(s,this.getItemsRecursively(a,l))}}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s},n);function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.allItems=ko.observableArray(),t}t.HierarchyItemsControlBase=i})((u=t.BusinessPack||(t.BusinessPack={})).Controls||(u.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.ItemsControlBase,__extends(n,e),n.prototype.canBeChecked=function(t){var e=this.binding.itemEnabledBinding;return!!this.isEnabled&&(!e||ko.unwrap(e(t)))},n.prototype.getItemKeyBinding=function(){return this.binding.itemKeyBinding||this.getItemValueBinding()},n.prototype.getItemValueBinding=function(){return this.binding.itemValueBinding},n.prototype.getItemStyle=function(t){t=ko.unwrap(t);var e={};return e[s.BusinessPackCss.stateChecked]=this.isSelected(t),e},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.CheckableControlListBase=i})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(e){"use strict";var i,t=(i=e.ItemsControlBase,__extends(n,i),n.prototype.initialize=function(){i.prototype.initialize.call(this),this.searchEngine=this.createSearchEngine(),this.watch(this.binding.dataSource,this.onDataSourceChange)},n.prototype.hasBeenFound=function(t){var e=this;if(null==(t=ko.unwrap(t)))return!1;var i=this.getItemKey(t);return this.searchResults().asLinq().any(function(t){return e.getItemKey(t)===i})},n.prototype.search=function(t){var r=this;this.searchEngine.search(t).then(function(t){var e,i;try{for(var n=__values(t),s=n.next();!s.done;s=n.next()){var o=s.value;r.findItemInDataSourceOrAdd(o)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}r.searchResults(t)})},n.prototype.onDataSourceChange=function(){this.searchEngine.clear(),this.searchEngine.preload(this.items())},n.prototype.createSearchEngine=function(){var t=this.binding.loadItems;return new e.SearchEngine({getItemKey:this.getItemKey.bind(this),getItemText:this.getItemText.bind(this),loadItems:t})},n.prototype.getItemKeyBinding=function(){return this.binding.itemTextBinding},n.prototype.getItemValueBinding=function(){return this.binding.itemTextBinding},n.prototype.getItemTextBinding=function(){return this.binding.itemTextBinding},n);function n(){var t=null!==i&&i.apply(this,arguments)||this;return t.searchResults=ko.observableArray(),t.selectedValues=ko.observableArray(),t}e.ItemsEditorBase=t})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e,i=(e=t.ItemsEditorBase,__extends(n,e),n.prototype.isItemEnabled=function(t){var e=this.binding.itemEnabledBinding;return!!this.isEnabled&&(!e||ko.unwrap(e(t)))},n.prototype.search=function(t){null==t?(this.searchResults(this.items()),this.searchEngine.cancel()):e.prototype.search.call(this,t)},n.prototype.onDataSourceChange=function(){e.prototype.onDataSourceChange.call(this),this.searchResults(this.items())},n.prototype.getItemKeyBinding=function(){return this.binding.itemKeyBinding||this.getItemValueBinding()},n.prototype.getItemValueBinding=function(){return this.binding.itemValueBinding},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.SelectorBase=i})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var i,e=(i=t.ControlBase,__extends(n,i),n.prototype.initialize=function(){var e=this;i.prototype.initialize.call(this),this.$element.focusin(function(t){return e.onElementFocusin(t)}),this.$element.focusout(function(t){return e.onElementFocusout(t)}),this.setDisabledAttribute()},n.prototype.onEnabledChange=function(){i.prototype.onEnabledChange.call(this),this.setDisabledAttribute()},n.prototype.onElementFocusin=function(t){this.isEnabled&&this.$element.addClass(s.BusinessPackCss.stateFocused)},n.prototype.onElementFocusout=function(t){this.$element.removeClass(s.BusinessPackCss.stateFocused)},n.prototype.setDisabledAttribute=function(){0==this.isEnabled?this.$element.attr("disabled","true"):this.$element.removeAttr("disabled")},n);function n(){return null!==i&&i.apply(this,arguments)||this}t.ButtonBase=e})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e,i=(e=t.ReactiveBase,__extends(n,e),Object.defineProperty(n.prototype,"isEmpty",{get:function(){return!this.stack.length},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"canRedo",{get:function(){return this.stack.length-1>this.stackOffset},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"canUndo",{get:function(){return 0this.stackOffset&&(this.stack=this.stack.slice(0,this.stackOffset)),this.stack.push(t)},n.prototype.rewind=function(){this.stack.length&&this.trigger("apply",this.stack[0])},n.prototype.redo=function(){this.canRedo&&this.trigger("apply",this.stack[++this.stackOffset])},n.prototype.undo=function(){this.canUndo&&this.trigger("apply",this.stack[--this.stackOffset])},n.prototype.reset=function(){this.stack=[],this.stackOffset=-1},n);function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.stack=[],t.stackOffset=-1,t}t.UndoManager=i})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var h;(function(t){"use strict";var e=(Object.defineProperty(i.prototype,"isRunning",{get:function(){return null!=this.timeout},enumerable:!0,configurable:!0}),i.prototype.search=function(o){var r=this;this.cancel(),o=o?o.trim():"";var t=this.options,a=t.getItemText,l=t.loadItems;return new Promise(function(s,i){r.timeout=setTimeout(function(){var n,t,e=r.getFromCache(o);e?s(e):(n=r.options.discardLocalItemsBeforeSearch?[]:r.items.filter(function(t){return r.match(a(t),o)}),l?l(o).then(function(t){var e=t.commandResult,i=r.sort(r.union(n,e),o);r.preload(e,!1),r.pushToCache(o,i),s(i)}).catch(i):(t=r.sort(n,o),r.pushToCache(o,t),s(t))),r.timeout=null},100)})},i.prototype.preload=function(t,e){void 0===e&&(e=!0),this.items=this.sort(this.union(this.items,t)),e&&(this.cache={})},i.prototype.cancel=function(){this.timeout&&(clearTimeout(this.timeout),this.timeout=null)},i.prototype.clear=function(){this.items.length=0,this.cache={}},i.prototype.getFromCache=function(t){if(t in this.cache){var e=this.cache[t];if(!(4e3 ."+a.BusinessPackCss.colorPickerHueSlider),this.$hueSliderGrip=this.$hueSlider.find("."+a.BusinessPackCss.primitiveGrip),this.$alphaSlider=t.find("."+a.BusinessPackCss.colorPickerSliders+" ."+a.BusinessPackCss.colorPickerAlphaSlider),this.$alphaSliderGrip=this.$alphaSlider.find("."+a.BusinessPackCss.primitiveGrip),this.$colorEditorSwitch=t.find("."+a.BusinessPackCss.colorPickerEditor+" > ."+a.BusinessPackCss.primitiveSwitchButton),this.$hexColorInput=t.find("."+a.BusinessPackCss.colorPickerEditor+" ."+a.BusinessPackCss.colorPickerHexEditor+" > input"),this.$redChannelInput=t.find("."+a.BusinessPackCss.colorPickerEditor+" ."+a.BusinessPackCss.colorPickerRedEditor+" > input"),this.$greenChannelInput=t.find("."+a.BusinessPackCss.colorPickerEditor+" ."+a.BusinessPackCss.colorPickerGreenEditor+" > input"),this.$blueChannelInput=t.find("."+a.BusinessPackCss.colorPickerEditor+" ."+a.BusinessPackCss.colorPickerBlueEditor+" > input"),this.$alphaChannelInput=t.find("."+a.BusinessPackCss.colorPickerEditor+" ."+a.BusinessPackCss.colorPickerAlphaEditor+" > input"),this.$predefinedColors=t.children("."+a.BusinessPackCss.colorPickerPredefinedColors),this.$popup.length&&(this.popupPanel=new i.PopupPanel(this.$popup,!0)),this.$element.focusin(this.onElementFocusin.bind(this)),this.$element.focusout(this.onElementFocusout.bind(this)),this.$element.keydown(this.onElementKeydown.bind(this)),this.$value.click(this.onToggleButtonClick.bind(this)),this.$value.keydown(function(t){return e.onValueKeydown(t)}),this.$value.keyup(function(t){return e.onValueKeyup(t)}),this.$value.focusin(function(t){return e.onValueFocusin(t)}),this.$value.focusout(function(t){return e.onValueFocusout(t)}),this.$unselectButton.click(this.onUnselectButtonClick.bind(this)),this.$toggleButton.click(this.onToggleButtonClick.bind(this)),this.$popup.mousedown(function(t){return e.onPopupMousedown(t)}),this.$colorSpectrum.mousedown(this.onColorSpectrumMousedown.bind(this)),this.$colorEditorSwitch.click(this.onColorEditorSwitchClick.bind(this)),this.$hexColorInput.keydown(this.onHexColorInputKeydown.bind(this)),this.$hexColorInput.on("input change",this.onHexColorInputChange.bind(this)),this.$redChannelInput.on("input change",function(t){return e.onChannelInputChange(a.RgbaChannel.Red,t)}),this.$greenChannelInput.on("input change",function(t){return e.onChannelInputChange(a.RgbaChannel.Green,t)}),this.$blueChannelInput.on("input change",function(t){return e.onChannelInputChange(a.RgbaChannel.Blue,t)}),this.$alphaChannelInput.on("input change",function(t){return e.onChannelInputChange(a.RgbaChannel.Alpha,t)}),this.$predefinedColors.on("click","."+a.BusinessPackCss.primitiveItem,this.onPredefinedColorClick.bind(this)),this.outside("mousedown",function(){return e.togglePopup(!1)}),this.watch(this.binding.selectedColor,this.onSelectedColorChange),this.watch(this.binding.selectedRgbaColor,this.onSelectedRgbaColorChange),this.subscribe(this.previewColor,this.onPreviewColorChange),this.subscribe(this.hue,this.onHueChange),this.subscribe(this.alpha,this.onAlphaChange)},e.prototype.togglePopup=function(t){var e;void 0===t&&(t=!this.isOpened),this.popupPanel&&((e=t&&this.isEnabled)&&this.setColorEditorValues(this.previewColor()),this.popupPanel.toggle(e))},e.prototype.selectColor=function(t){var e,i,n;this.isSelected(t)||(i=(e=this.binding).selectedColor,n=e.selectedRgbaColor,ko.isWriteableObservable(i)?i(a.ColorUtils.rgbaToHexColor(t)):ko.isWriteableObservable(n)&&n(a.Utils.deepClone(t)),this.postback(this.binding.changed))},e.prototype.isSelected=function(t){return a.ColorUtils.areRgbaColorsEqual(t,this.getSelectedColor())},e.prototype.getSelectedColor=function(){var t=this.binding,e=t.selectedColor,i=t.selectedRgbaColor,n=t.allowAlphaChannel;return null!=e?a.ColorUtils.tryParseHexColor(ko.unwrap(e),n)[1]:i()},e.prototype.unselectColor=function(){var t,e,i;this.hasValue&&(e=(t=this.binding).selectedColor,i=t.selectedRgbaColor,ko.isWriteableObservable(e)?e(null):ko.isWriteableObservable(i)&&i(null),this.postback(this.binding.changed))},e.prototype.onElementFocusin=function(t){this.isEnabled&&this.$element.addClass(a.BusinessPackCss.stateFocused)},e.prototype.onElementFocusout=function(t){this.$element.removeClass(a.BusinessPackCss.stateFocused),null!=t.relatedTarget&&this.isOutsideOfTree(t.relatedTarget)&&this.togglePopup(!1)},e.prototype.onValueFocusin=function(t){this.$colorGrip.addClass(a.BusinessPackCss.stateFocused)},e.prototype.onValueFocusout=function(t){this.$colorGrip.removeClass(a.BusinessPackCss.stateFocused)},e.prototype.onElementKeydown=function(t){this.isEnabled&&(this.isOpened?t.which===a.KeyboardKeys.esc?(t.stopPropagation(),this.togglePopup(!1),this.$element.focus()):a.KeyboardKeys.isEnter(t.which)&&t.preventDefault():t.altKey&&t.which===a.KeyboardKeys.down&&(t.stopPropagation(),this.togglePopup(!0)))},e.prototype.onValueKeydown=function(t){if(this.isEnabled&&this.isOpened&&a.KeyboardKeys.isArrow(t.which)){this.isChangingColor=!0;var e=this.$colorGrip.offset();switch(e.left+=this.$colorGrip.outerWidth()/2,e.top+=this.$colorGrip.outerHeight()/2,t.which){case a.KeyboardKeys.left:this.moveColorGripToPosition(e.left-5,e.top);break;case a.KeyboardKeys.right:this.moveColorGripToPosition(e.left+5,e.top);break;case a.KeyboardKeys.up:this.moveColorGripToPosition(e.left,e.top-5);break;case a.KeyboardKeys.down:this.moveColorGripToPosition(e.left,e.top+5)}t.stopPropagation()}},e.prototype.onValueKeyup=function(t){this.isChangingColor=!1},e.prototype.onUnselectButtonClick=function(t){this.isEnabled&&(t.stopPropagation(),this.unselectColor())},e.prototype.onToggleButtonClick=function(t){this.isEnabled&&(t.stopPropagation(),this.togglePopup())},e.prototype.onPopupMousedown=function(t){var e,i;t.stopPropagation(),a.Browser.isGecko&&(e=$(t.target),i=!!a.DomUtils.closestUntil(e,this.$popup,":input,[tabindex]").length,!e.is(this.$popup)&&i||(t.preventDefault(),this.$element.focus()))},e.prototype.onColorSpectrumMousedown=function(t){this.isEnabled&&(t.stopPropagationAndPreventDefault(),this.isChangingColor=!0,this.$document.on("mousemove"+this.eventNs,this.onColorSpectrumMousemove.bind(this)),this.$document.on("mouseup"+this.eventNs,this.onColorSpectrumMouseup.bind(this)),this.moveColorGripToPosition(t.pageX,t.pageY))},e.prototype.onColorSpectrumMousemove=function(t){this.isEnabled&&this.moveColorGripToPosition(t.pageX,t.pageY)},e.prototype.onColorSpectrumMouseup=function(t){this.isEnabled&&(this.$document.off("mousemove"+this.eventNs+" mouseup"+this.eventNs),this.selectPreviewColor(),this.isChangingColor=!1)},e.prototype.onAlphaHueSliderChange=function(){this.selectPreviewColor()},e.prototype.onColorEditorSwitchClick=function(t){this.isEnabled&&(t.stopPropagation(),this.isHexEditorActive(!this.isHexEditorActive()))},e.prototype.onHexColorInputKeydown=function(t){var e,i,n,s,o=this.$hexColorInput.val().trim();4!==o.length&&5!==o.length||!a.KeyboardKeys.isEnter(t.which)||(e=this.binding.allowAlphaChannel,n=(i=__read(a.ColorUtils.tryParseHexColor(o,e),2))[0],s=i[1],n&&(t.stopPropagation(),this.selectColor(s)))},e.prototype.onHexColorInputChange=function(t){var e,i,n,s,o=this.$hexColorInput.val().trim();7!==o.length&&9!==o.length||(e=this.binding.allowAlphaChannel,n=(i=__read(a.ColorUtils.tryParseHexColor(o,e),2))[0],s=i[1],n&&(t.stopPropagation(),"change"===t.type?this.selectColor(s):this.previewColor(s)))},e.prototype.onChannelInputChange=function(t,e){var i,n=$(e.target),s=parseInt(n.val().trim());t===a.RgbaChannel.Alpha?0<=s&&s<=100&&(i=a.ColorUtils.updateChannelOfRgba(this.previewColor(),t,s/100)):0<=s&&s<=255&&(i=a.ColorUtils.updateChannelOfRgba(this.previewColor(),t,s)),i&&(e.stopPropagation(),"change"===e.type?this.selectColor(i):this.previewColor(i))},e.prototype.onPredefinedColorClick=function(t){var e;this.isEnabled&&(e=this.binding.allowAlphaChannel,t.stopPropagation(),this.selectColor(a.ColorUtils.parseHexColor(ko.dataFor(t.currentTarget),e)))},e.prototype.onSelectedColorChange=function(t){var e=this.binding.allowAlphaChannel;this.onSelectedRgbaColorChange(a.ColorUtils.tryParseHexColor(t,e)[1])},e.prototype.onSelectedRgbaColorChange=function(t){if(!this.binding.allowAlphaChannel&&t&&t.Alpha()<1)throw Error("The SelectedRgbaColor.Alpha channel must be equal to 1 when Alpha channel is not allowed. The current value is '"+t.Alpha()+"'.");this.$element.toggleClass(a.BusinessPackCss.stateValueEmpty,!t),this.previewColor(t||this.nullColor)},e.prototype.onPreviewColorChange=function(t){this.$colorPreview.css("background",a.ColorUtils.rgbaToCssColor(t)),this.$alphaSlider.css("background-image",this.getAlphaGradient(t));var e,i=a.ColorUtils.rgbaToCssColor(a.ColorUtils.updateChannelOfRgba(t,a.RgbaChannel.Alpha,1));this.$hueSliderGrip.css("color",i),this.$alphaSliderGrip.css("color",i),this.isChangingColor||(e=a.ColorUtils.rgbaToHsvaColor(t),this.isLoadingColor=!0,this.setColorGripPosition(e),this.alpha(e.Alpha()),this.hue(e.Hue()),this.isLoadingColor=!1),this.setColorEditorValues(t)},e.prototype.onHueChange=function(t,e){var i=a.ColorUtils.hueToCssColor(t);this.$colorSpectrum.css("background",this.getColorSpectrumGradient(i)),this.isLoadingColor||e||(this.isChangingColor=!0,this.previewColor(a.ColorUtils.updateHueOfRgba(this.previewColor(),t)),this.isChangingColor=!1)},e.prototype.onAlphaChange=function(t,e){this.isLoadingColor||e||(this.isChangingColor=!0,this.previewColor(a.ColorUtils.updateChannelOfRgba(this.previewColor(),a.RgbaChannel.Alpha,t)),this.isChangingColor=!1)},e.prototype.moveColorGripToPosition=function(t,e){var i=this.$colorSpectrum.offset(),n=this.$colorSpectrum.width(),s=this.$colorSpectrum.height(),o=t-i.left,r=e-i.top;o<0?o=0:ni(n)},i.prototype.isDateTimeRestricted=function(t,e,i){var n,s;if(void 0===i&&(i=this.floorDate),!e)return!1;var o=!1,r=i(t);try{for(var a=__values(e),l=a.next();!l.done;l=a.next()){var u=l.value;if(f.Calendar.isDateRangeRestriction(u)){var c=g.DateUtils.unwrapDate(u.StartDate),h=g.DateUtils.unwrapDate(u.EndDate);c&&(o=r>=i(c)),h&&(o=o&&r=this.floorDate(d)),p&&(o=o&&rt.getTime()?new Date(i):t,o=n&&n").text(s),c=l.children("a");return 0==c.length&&(c=l.children("span")),c.append(u),null!=o&&(n=$("").text(o),c.append(n),l.addClass("double-line")),l},e.prototype.createMinuteCell=function(t,e){var i=this;void 0===e&&(e=!1);var n,s=p.DateHelper.buildShortTimeText(t.getHours(),t.getMinutes()),o=p.DateHelper.buildAmPmString(t.getHours(),t.getMinutes()),r=this.dateValidator.isMinuteInValidRange(t),a=r&&!this.dateValidator.doesDatePassAllRestrictions(t,p.DateRangeType.Minute).doesDatePassRestrictions,l=this.createLinkCell("",function(){i.currentlyDisplayedDate=t,i.selectMinute(t)},e,!r,a),u=$("").text(s),c=l.children("a");return 0==c.length&&(c=l.children("span")),c.append(u),null!=o&&(n=$("").text(o),c.append(n),l.addClass("double-line")),l},e.prototype.createCell=function(t){return $("").append($("").text(t))},e.prototype.createHeaderCell=function(t){return $("").append($("").text(t))},e.prototype.createLinkCell=function(t,e,i,n,s,o){var r,a;return void 0===i&&(i=!1),void 0===n&&(n=!1),void 0===s&&(s=!1),void 0===o&&(o=!1),r=n||!this.enabled?$("").text(t):this.createLink(t,e),a=o?$(""):$(""),!n&&this.enabled||a.addClass(f.BusinessPackCss.stateDisabled),s&&a.addClass(f.BusinessPackCss.stateSemiDisabled),i&&a.addClass(f.BusinessPackCss.stateActive),a.append(r),a},e.prototype.createPrevLinkCell=function(t){return $("").append(this.createEmptyLink(t).append($("").addClass("fa fa-arrow-left"))).addClass(""+f.BusinessPackCss.commandPrev)},e.prototype.createNextLinkCell=function(t){return $("").append(this.createEmptyLink(t).append($("").addClass("fa fa-arrow-right"))).addClass(""+f.BusinessPackCss.commandNext)},e.prototype.createLink=function(t,e){return this.createEmptyLink(e).text(t)},e.prototype.createEmptyLink=function(e){var t=$("");return this.enabled&&t.attr({href:"javascript:;",tabindex:-1}).on("click",function(t){e(),t.stopPropagation()}),t},e.prototype.createRow=function(){return $("")},e.prototype.createTable=function(){return $("
").addClass(f.BusinessPackCss.calendarTable)},e.prototype.createTableThead=function(){return $("")},e.prototype.createTableTbody=function(){return $("")},e);function e(t,e){this.enabled=!0,this.dateValidator=t,this.observers=new Array,this.calendarType=e,this.setCurrentViewType(null)}p.CalendarBase=t})((f=t.BusinessPack||(t.BusinessPack={})).Controls||(f.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(n){"use strict";var e,t=(e=n.CalendarBase,__extends(i,e),Object.defineProperty(i.prototype,"selectedDate",{get:function(){return this._selectedDate},set:function(t){this.setSelectedDate(t),this.notifyObservers(n.ChangeType.Complete,this._selectedDate)},enumerable:!0,configurable:!0}),i.prototype.getSelectedDate=function(){return n.DateHelper.createCopy(this.selectedDate)},i.prototype.setSelectedDate=function(t){if(t=n.DateHelper.createCopy(t),this._selectedDate=this.moveDateToValidRangeIfNessesary(t),null==this._selectedDate&&this.calendarType===n.CalendarMode.Date&&this.currentViewType===n.DateRangeType.Date)return this.dateValidator.findFirstDateThatPassesRestrictions(t,n.DateRangeType.Date,t).date;n.DateHelper.areDatesEqual(t,this._selectedDate)||(s.Utils.warnInDebugMode("Changed selected date to be valid."),this.notifyObservers(n.ChangeType.Complete,this.selectedDate))},i.prototype.checkSelectedValue=function(){this.setSelectedDate(this.selectedDate)},i.prototype.moveDateToValidRangeIfNessesary=function(t){return null==t?t:this.dateValidator.minDate>t?this.dateValidator.minDate:this.dateValidator.maxDate"),o=n?$("").text(t):$(""+t+"").attr({href:"javascript:;"}).on("click",e);return s.append(o),i&&s.addClass(""+r.BusinessPackCss.stateActive),s},i);function i(t){this.dateValidator=t,this.observers=new Array,this.$main=$("
").addClass(r.BusinessPackCss.calendarMain),this.$side=$("
").addClass(r.BusinessPackCss.primitiveSide)}t.CalendarExtendedModeBase=e})((r=t.BusinessPack||(t.BusinessPack={})).Controls||(r.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(i){"use strict";var n,t=(n=i.CalendarExtendedModeBase,__extends(e,n),e.prototype.setSelectedDate=function(t){this.mainCalendar.setSelectedDate(t),this.sideCalendar.setSelectedDate(t),this.mainCalendar.setCurrentlyDisplayedDate(t),this.sideCalendar.setCurrentlyDisplayedDate(t),this.update()},e.prototype.getSelectedDate=function(){return this.mainCalendar.getSelectedDate()},e.prototype.notify=function(t){for(var e=[],i=1;i").text(i.DateHelper.buildFullTimeText(t.getHours(),t.getMinutes()))),this.sideCalendar.setSelectedDate(t),this.sideCalendar.setCurrentViewType(null),this.sideCalendar.setCurrentlyDisplayedDate(t),this.sideCalendar.update()):this.$side.hide()},Object.defineProperty(e.prototype,"currentlyDisplayedDate",{get:function(){return this.mainCalendar.getCurrentlyDisplayedDate()},set:function(t){this.mainCalendar.setCurrentlyDisplayedDate(t),this.sideCalendar.setCurrentlyDisplayedDate(t)},enumerable:!0,configurable:!0}),e);function e(t){var e=n.call(this,t)||this;return e.mainCalendar=new i.CalendarN(t,i.CalendarMode.Date),e.mainCalendar.subscribe(e),e.sideCalendar=new i.CalendarN(t,i.CalendarMode.Time),e.sideCalendar.subscribe(e),e.setCurrentViewType(i.DateRangeType.Date),e.$sideUpperRow=$("
").addClass(s.BusinessPackCss.calendarUpperRow),e.$side.append(e.$sideUpperRow),e.$sideCalendar=$("
"),e.$side.append(e.$sideCalendar),e}i.CalendarExtended=t})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var h;(function(s){"use strict";var i,t=(i=s.CalendarExtendedModeBase,__extends(e,i),e.prototype.notify=function(t){for(var e=[],i=1;i").addClass(h.BusinessPackCss.calendarUpperRow).addClass(h.BusinessPackCss.calendarSelector)),this.$sideCalendarSelector.empty();var i,n,s=this.isSideCalendarInStartMode?function(){}:function(){e.putSideCalendarInStartMode(),e.buildSideCalendarSelector(!0),e.sideCalendar.update()},o=this.isSideCalendarInEndMode?function(){}:function(){e.putSideCalendarInEndMode(),e.buildSideCalendarSelector(!0),e.sideCalendar.update()};t&&(i=null!=this.getSelectedStartDate()?dotvvm.globalize.formatString("g",this.getSelectedStartDate()):"",n=null!=this.getSelectedEndDate()?dotvvm.globalize.formatString("g",this.getSelectedEndDate()):"");var r=this.createButton(t?""+i:"",s,this.isSideCalendarInStartMode,null==this.getSelectedStartDate()),a=this.createButton(t?""+n:"",o,this.isSideCalendarInEndMode,null==this.getSelectedEndDate());r.addClass(h.BusinessPackCss.calendarSelectorStart),a.addClass(h.BusinessPackCss.calendarSelectorEnd);var l=r.find("a"),u=a.find("a");this.$sideCalendarSelector.append(r),this.$sideCalendarSelector.append(a);var c=0!==l.length&&l[0].scrollWidth>r.innerWidth()||0!==u.length&&a[0].scrollWidth>a.innerWidth();t&&c&&this.buildSideCalendarSelector(!1)},e.prototype.putSideCalendarInStartMode=function(){this.isSideCalendarInStartMode=!0,this.isSideCalendarInEndMode=!1;var t=this.getSelectedStartDate();this.sideCalendar.setCurrentlyDisplayedDate(t),this.sideCalendar.setSelectedDate(t),this.sideCalendar.setCurrentViewType(s.DateRangeType.Hour),this.setCurrentViewType(s.DateRangeType.Hour)},e.prototype.putSideCalendarInEndMode=function(){this.isSideCalendarInStartMode=!1,this.isSideCalendarInEndMode=!0;var t=this.getSelectedEndDate();this.sideCalendar.setCurrentlyDisplayedDate(t),this.sideCalendar.setSelectedDate(t),this.sideCalendar.setCurrentViewType(s.DateRangeType.Hour),this.setCurrentViewType(s.DateRangeType.Hour)},e);function e(t){var e=i.call(this,t)||this;return e.isSideCalendarInStartMode=!1,e.isSideCalendarInEndMode=!1,e.mainCalendar=new s.RangeSelection(t,s.CalendarMode.Date),e.mainCalendar.subscribe(e),e.sideCalendar=new s.CalendarN(t,s.CalendarMode.Time),e.sideCalendar.subscribe(e),e.buildSideCalendarSelector(),e.$sideCalendar=$("
"),e.$side.append(e.$sideCalendarSelector),e.$side.append(e.$sideCalendar),e}s.RangeCalendarExtended=t})((h=t.BusinessPack||(t.BusinessPack={})).Controls||(h.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(i){"use strict";var n,t=(n=i.CalendarBase,__extends(e,n),Object.defineProperty(e.prototype,"selectedStartDate",{get:function(){return this._selectedStartDate},set:function(t){t=new Date(t.getTime());var e=!i.DateHelper.areDatesEqual(t,this.selectedStartDate);this._selectedStartDate=t,e&&this.notifyObservers(i.ChangeType.Partial,this._selectedStartDate)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedEndDate",{get:function(){return this._selectedEndDate},set:function(t){t=i.DateHelper.createCopy(t);var e=!i.DateHelper.areDatesEqual(t,this.selectedEndDate);null!=t&&!this.dateValidator.isRangeValid(this.selectedStartDate,t)||(this._selectedEndDate=t,e&&this.notifyObservers(i.ChangeType.Complete,this._selectedStartDate,this._selectedEndDate))},enumerable:!0,configurable:!0}),e.prototype.setSelectedRange=function(t,e){t=i.DateHelper.createCopy(t),e=i.DateHelper.createCopy(e),this._selectedStartDate=t,this._selectedEndDate=e,this.checkSelectedValue()},e.prototype.setSelectedStartDate=function(t){this.setSelectedRange(t,this._selectedEndDate)},e.prototype.setSelectedEndDate=function(t){this.setSelectedRange(this._selectedStartDate,t)},e.prototype.getSelectedStartDate=function(){return null==this._selectedStartDate?null:i.DateHelper.createCopy(this._selectedStartDate)},e.prototype.getSelectedEndDate=function(){return null==this._selectedEndDate?null:i.DateHelper.createCopy(this._selectedEndDate)},e.prototype.changeRangeToBeValidIfNessesary=function(t,e){return null==t&&null==e?[t,e]:null==t&&null!=e?[null,null]:(this.dateValidator.minDate>t&&(t=i.DateHelper.createCopy(this.dateValidator.minDate)),this.dateValidator.maxDatet?this.selectedStartDate=t:null==this.selectedEndDate&&this.selectedStartDate<=t?this.selectedEndDate=t:(this.setSelectedEndDate(null),this.selectedStartDate=t),this.setCurrentViewType(null),this.update()},e.prototype.createYearCell=function(t){var e=n.prototype.createYearCell.call(this,t);return this.addCssClasses(e,t),e},e.prototype.createMonthCell=function(t){var e=n.prototype.createMonthCell.call(this,t);return this.addCssClasses(e,t),e},e.prototype.createDateCell=function(t){var e=n.prototype.createDateCell.call(this,t);return this.addCssClasses(e,t),e},e.prototype.createHourCell=function(t){var e=n.prototype.createHourCell.call(this,t);return this.addCssClasses(e,t),e},e.prototype.createMinuteCell=function(t){var e=n.prototype.createMinuteCell.call(this,t);return this.addCssClasses(e,t),e},e.prototype.addCssClasses=function(t,e){i.DateHelper.isDateInDateRangeOfCell(this.selectedStartDate,e,this.currentViewType)&&t.addClass(""+s.BusinessPackCss.calendarSelectionStart),i.DateHelper.isDateInDateRangeOfCell(this.selectedEndDate,e,this.currentViewType)?t.addClass(""+s.BusinessPackCss.calendarSelectionEnd):this.selectedEndDate&&this.selectedStartDatee&&t.addClass(""+s.BusinessPackCss.stateSelected),this.selectedStartDate&&!this.selectedEndDate&&e>this.selectedStartDate&&t.attr("data-possible-end-date",this.dateValidator.isRangeValid(this.selectedStartDate,e))},e.prototype.calendarRendered=function(){var e=this;n.prototype.calendarRendered.call(this);var i=this.$element.find("td[data-possible-end-date]");i.mouseover(function(t){return e.changeClasesOnHover(t.target)}),i.mouseleave(function(){i.removeClass(""+s.BusinessPackCss.stateSelected),i.removeClass(""+s.BusinessPackCss.calendarSelectionEnd)}),null!=this.selectedStartDate&&null==this.selectedEndDate&&setTimeout(function(){var t=i.find(":hover");null!=t[0]&&e.changeClasesOnHover(t[0])},25)},e.prototype.changeClasesOnHover=function(t){"a"!==t.tagName.toLowerCase()&&"span"!==t.tagName.toLowerCase()||(t=$(t).closest("td")[0]);for(var e=this.$element.find("td[data-possible-end-date]"),i=0;i").addClass(""+o.BusinessPackCss.primitivePopup),this.popupElement.attr("tabindex",-1),this.outside("click",function(t){null!=e.popupElement&&s.destroyActivePopup()}),s.registerGlobalEvent(),this.calendar.setCurrentlyDisplayedDate(t),this.calendar.render(this.popupElement[0]),this.$element.append(this.popupElement),this.popupElement.keydown(function(t){return e.hideCalendarOnTab(t)}),s.updatePopupPosition()}},s.updatePopupPosition=function(){var t,e,i;s.activePopup&&s.activePopup.popupElement&&(t=s.activePopup.$element.find("."+o.BusinessPackCss.primitiveInputGroup),(e=s.activePopup.$element.offset()).top+300>$(document).height()&&300e.getTime())return!1;if(null!=ko.unwrap(this.restrictions)&&0!==this.restrictions().length)try{for(var s=__values(this.restrictions()),o=s.next();!o.done;o=s.next()){var r=o.value;if(!this.doesRangePassRestriction(t,e,r()))return!1}}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return!0},o.prototype.doesRangePassRestriction=function(t,e,i){return this.isDayOfWeekRestriction(i)?this.doesRangePassDayRestriction(t,e,i):this.isDateRangeRestriction(i)?this.doesRangePassRangeRestriction(t,e,i):(n.Utils.warnInDebugMode("Restriction type "+typeof i+" is not supported."),!1)},o.prototype.doesRangePassRangeRestriction=function(t,e,i){return!0},o.prototype.doesRangePassDayRestriction=function(t,e,i){return!0},s=o,e.DateRangeValidator=s}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e,i=(e=t.DateOrTimePickerBase,__extends(n,e),n.prototype.initialize=function(){e.prototype.initialize.call(this)},n.prototype.floorDate=function(t){return t.getTime()},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.DateTimePickerBase=i})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var u;(function(l){"use strict";var i,t=(i=l.DateTimePickerBase,__extends(e,i),e.prototype.initialize=function(){var e=this;i.prototype.initialize.call(this),this.$textBox=this.$element.children("."+u.BusinessPackCss.primitiveTextBox),this.hasPopup?(this.$datePicker=this.$popup.find("."+u.BusinessPackCss.datePicker),this.$timePicker=this.$popup.find("."+u.BusinessPackCss.timePicker)):(this.$datePicker=this.$element.children("."+u.BusinessPackCss.datePicker),this.$timePicker=this.$element.children("."+u.BusinessPackCss.timePicker)),this.$textBox.keydown(function(t){return e.onTextBoxKeydown(t)}),this.$textBox.change(function(t){return e.onTextBoxChange(t)}),this.$textBox.focus(function(t){return e.$datePicker.addClass(u.BusinessPackCss.stateFocused)}),this.$datePicker.mouseover(function(t){return e.focusDatePicker()}),this.$timePicker.mouseover(function(t){return e.focusTimePicker()}),this.$timePicker.focus(function(t){return e.$datePicker.removeClass(u.BusinessPackCss.stateFocused)}),this.watch(this.binding.selectedDateTime,this.onSelectedDateTimeChange),this.subscribe(this.binding.restrictions,this.filterRestrictions),u.DeviceUtils.addMobileOrTabletProp(this.$textBox,"readonly",!0)},Object.defineProperty(e.prototype,"selectedDateTime",{get:function(){var t=ko.unwrap(this.binding.selectedDateTime);return u.DateUtils.unwrapDate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"date",{get:function(){var t=ko.unwrap(this.selectedDate);return u.DateUtils.unwrapDate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){var t=ko.unwrap(this.selectedTime);return u.DateUtils.unwrapDate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"minDateTime",{get:function(){var t=ko.unwrap(this.binding.minDateTime);return u.DateUtils.unwrapDate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"maxDateTime",{get:function(){var t=ko.unwrap(this.binding.maxDateTime);return u.DateUtils.unwrapDate(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"canUnselectDateOrTime",{get:function(){return ko.unwrap(this.binding.allowUnselect)&&!!this.selectedDateTime},enumerable:!0,configurable:!0}),e.prototype.unselectDateOrTime=function(){this.selectedDate(null),this.selectedTime(null),this.selectDateTime(null),this.$textBox.focus()},e.prototype.onElementKeydown=function(t){if(i.prototype.onElementKeydown.call(this,t),this.isOpened)if(u.KeyboardKeys.isEnter(t.which))this.$timePicker.hasClass(u.BusinessPackCss.stateFocused)?(this.togglePopup(!1),this.$textBox.focus()):this.focusTimePicker();else if(t.which===u.KeyboardKeys.tab)t.shiftKey&&this.$datePicker.hasClass(u.BusinessPackCss.stateFocused)&&(t.stopPropagation(),this.$datePicker.removeClass(u.BusinessPackCss.stateFocused),this.$textBox.focus(),this.$textBox.trigger(t));else{if(t.shiftKey||t.ctrlKey)return;u.KeyboardKeys.isArrow(t.which)||(this.$textBox.focus(),this.$textBox.trigger(t))}},e.prototype.onTextBoxKeydown=function(t){if(this.isOpened)if(u.KeyboardKeys.isEnter(t.which))this.focusDatePicker(),this.$datePicker.trigger(t),t.stopPropagation(),this.focusTimePicker();else if(t.which===u.KeyboardKeys.tab){if(t.shiftKey)return void t.stopPropagation();t.preventDefault(),this.focusDatePicker(),this.$datePicker.trigger(t),this.focusTimePicker()}else u.KeyboardKeys.isArrow(t.which)?(t.preventDefault(),this.focusDatePicker(),this.$datePicker.trigger(t)):(t.stopPropagation(),u.KeyboardKeys.isEscape(t.which)&&this.togglePopup(!1))},e.prototype.onToggleButtonClick=function(t){i.prototype.onToggleButtonClick.call(this,t),this.$textBox.focus()},e.prototype.focusDatePicker=function(){this.hasFocus&&!this.$datePicker.hasClass(u.BusinessPackCss.stateFocused)&&this.$datePicker.focus()},e.prototype.focusTimePicker=function(){this.hasFocus&&!this.$timePicker.hasClass(u.BusinessPackCss.stateFocused)&&this.$timePicker.focus()},e.prototype.onSelectedDateTimeChange=function(t){var e=u.DateUtils.unwrapDate(t);this.selectedDate(e),this.selectedTime(e)},e.prototype.selectDateTime=function(t){this.binding.selectedDateTime(dotvvm.serialization.serializeDate(t,!1)),this.selectionChanged()},e.prototype.dateChanged=function(){this.onDateOrTimeChange(),this.filterTimeRestrictions()},e.prototype.timeChanged=function(){this.onDateOrTimeChange()},e.prototype.onDateOrTimeChange=function(){var t,e=this.date,i=this.time;e&&i?((t=e).setHours(i.getHours(),i.getMinutes(),i.getSeconds(),i.getMilliseconds()),this.selectDateTime(t)):this.selectedDateTime||this.selectDateTime(null)},e.prototype.filterRestrictions=function(){this.filterDateRestrictions(),this.filterTimeRestrictions()},e.prototype.filterDateRestrictions=function(){var e,t;if(this.dateRestrictions.removeAll(),this.binding.restrictions)try{for(var i=__values(ko.unwrap(this.binding.restrictions)),n=i.next();!n.done;n=i.next()){var s=n.value,o=ko.unwrap(s);l.Calendar.isDateRangeRestriction(o)?this.dateRestrictions.push(ko.observable(this.trimRestrictionStartDate(o))):l.Calendar.isDayOfWeekRestriction(o)&&this.dateRestrictions.push(s)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}},e.prototype.trimRestrictionStartDate=function(t){var e=u.DateUtils.unwrapDate(t.StartDate),i=u.DateUtils.getStartOfDay(e).getTime();if(e.getTime()>i){var n=this.getNewDateRangeRestriction();return e.setDate(e.getDate()+1),n.StartDate=ko.observable(e),n.EndDate=t.EndDate,n}return t},e.prototype.filterTimeRestrictions=function(){var e,t;if(this.timeRestrictions.removeAll(),this.binding.restrictions){try{for(var i=__values(ko.unwrap(this.binding.restrictions)),n=i.next();!n.done;n=i.next()){var s,o=n.value,r=ko.unwrap(o);l.Calendar.isDateRangeRestriction(r)?(s=this.trimRestrictionTimeRange(r))&&this.timeRestrictions.push(ko.observable(s)):l.Calendar.isTimeRangeRestriction(r)&&this.timeRestrictions.push(o)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}var a=u.DateUtils.getStartOfDay(this.selectedDateTime).getTime();this.minDateTime&&a===u.DateUtils.getStartOfDay(this.minDateTime).getTime()?this.minTime(this.minDateTime):this.minTime(null),this.maxDateTime&&a===u.DateUtils.getStartOfDay(this.maxDateTime).getTime()?this.maxTime(this.maxDateTime):this.maxTime(null)}},e.prototype.trimRestrictionTimeRange=function(t){if(!this.selectedDateTime)return null;var e=u.DateUtils.getStartOfDay(u.DateUtils.unwrapDate(t.StartDate)).getTime(),i=u.DateUtils.getStartOfDay(u.DateUtils.unwrapDate(t.EndDate)).getTime(),n=u.DateUtils.getStartOfDay(this.selectedDateTime).getTime(),s=this.getNewTimeRangeRestriction();if(s.Type=ko.observable("TimeRangeRestriction"),e===n&&(s.StartTime=t.StartDate),i===n&&(s.EndTime=t.EndDate),s.StartTime&&s.EndTime)return s;if(!s.StartTime&&s.EndTime)s.StartTime=ko.observable(new Date(n));else{if(!s.StartTime||s.EndTime)return null;s.EndTime=ko.observable(u.DateUtils.getEndOfDay(new Date(n)))}return s},e.prototype.getNewDateRangeRestriction=function(){var t={};return t.Type=ko.observable("DateRangeRestriction"),t},e.prototype.getNewTimeRangeRestriction=function(){var t={};return t.Type=ko.observable("TimeRangeRestriction"),t},e);function e(){var t=null!==i&&i.apply(this,arguments)||this;return t.selectedDate=ko.observable(),t.selectedTime=ko.observable(),t.minTime=ko.observable(),t.maxTime=ko.observable(),t.dateRestrictions=ko.observableArray(),t.timeRestrictions=ko.observableArray(),t}l.DateTimePicker=t,u.Utils.installBindingHandler("DateTimePicker",t)})((u=t.BusinessPack||(t.BusinessPack={})).Controls||(u.Controls={}))}(DotVVM=DotVVM||{}),function(DotVVM){var BusinessPack;!function(BusinessPack){var Controls;!function(Controls){"use strict";var DraggableList=function(_super){function DraggableList(){return null!==_super&&_super.apply(this,arguments)||this}return __extends(DraggableList,_super),DraggableList.prototype.initialize=function(){var e=this;_super.prototype.initialize.call(this),this.$element.on("dragover",function(t){return e.onDragOver(t)}),this.$element.on("drop",function(t){return e.onDrop(t)}),document.addEventListener("DOMNodeInserted",function(t){1===t.target.nodeType&&t.target.parentElement===e.$element[0]&&e.initChildEvents(t.target)})},DraggableList.prototype.initChildEvents=function(t){var e=this;$(t).attr("draggable","true").off("drag").on("drag",function(t){return e.onDrag(t)})},DraggableList.prototype.onDragOver=function(t){var e;0=ko.unwrap(this.binding.maxItemsCount)||DraggableList.draggedItemGroupName===ko.unwrap(this.binding.groupName)&&(t.preventDefault(),DraggableList.dragLeaving=!1,e=this.findChildByY(t.originalEvent.pageY),this.createDragPositionIndicator(e))},DraggableList.prototype.onDrop=function(e){DraggableList.dragConfirmed=!0,e.preventDefault();var data=this.findChildByY(e.originalEvent.pageY),draggedItem=ko.unwrap(DraggableList.draggedItemSourceCollection)[DraggableList.draggedItemIndex];DraggableList.draggedItemSourceCollection.splice(DraggableList.draggedItemIndex,1),data.index<=DraggableList.draggedItemIndex?this.getDataSource().splice(data.index,0,draggedItem):data.index>DraggableList.draggedItemIndex&&(DraggableList.draggedItemSourceCollection===this.getDataSource()&&data.index--,this.getDataSource().splice(data.index,0,draggedItem)),ko.unwrap(this.binding.itemDragged)&&eval(ko.unwrap(this.binding.itemDragged)),DraggableList.onDragLeave(e)},DraggableList.removeDragPositionIndicator=function(){DraggableList.dragPositionIndicator&&(DraggableList.dragPositionIndicator.remove(),DraggableList.dragPositionIndicator=null)},DraggableList.prototype.createDragPositionIndicator=function(t){var e=this,i=!1;DraggableList.dragPositionIndicator||(DraggableList.dragPositionIndicator=$(""),i=!0),null==t.child?this.$element.append(DraggableList.dragPositionIndicator):t.append?DraggableList.dragPositionIndicator.insertAfter(t.child):DraggableList.dragPositionIndicator.insertBefore(t.child),i&&DraggableList.dragPositionIndicator.on("dragover",function(t){return e.onDragOver(t)})},DraggableList.prototype.getDataSource=function(){return this.allBindings.get("foreach")},DraggableList.prototype.getChildren=function(){return $("")},DraggableList.prototype.findChildByY=function(t){for(var e=this.getChildren(),i={left:0,top:0},n=100,s=0,o=0;o");e.html(this.binding.text()),e.addClass(o.BusinessPackCss.primitivePicker),e.addClass(o.BusinessPackCss.primitiveTextBox),e.css("min-height",this.$spanElement.height()),e.keydown(this.onKeyDown.bind(this)),e.keyup(this.keyAction.bind(this)),$(this.$element).append(e),e.focusin(function(t){e.addClass(o.BusinessPackCss.stateFocused)}),e.focusout(function(t){e.removeClass(o.BusinessPackCss.stateFocused)}),e.each(function(){s(this)}).on("input",function(){s(this)}),e.focus()},n);function n(){return null!==e&&e.apply(this,arguments)||this}function s(t){$(t).css({"overflow-y":"hidden"})}t.EditableLiteral=i,o.Utils.installBindingHandler("EditableLiteral",i)})((o=t.BusinessPack||(t.BusinessPack={})).Controls||(o.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var i,e=(i=t.ReactiveBase,__extends(n,i),n.prototype.start=function(t){return this.on("start",t)},n.prototype.progress=function(t){return this.on("progress",t)},n.prototype.complete=function(t){return this.on("complete",t)},n.prototype.error=function(t){return this.on("error",t)},n.prototype.processResponse=function(t){try{return JSON.parse(t)}catch(t){return null}},n);function n(t){var e=i.call(this)||this;return e.uploadUrl=t,e}t.UploaderBase=e})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e,i=(e=t.UploaderBase,__extends(n,e),n.prototype.upload=function(t){var e,i,n=new FormData;if(t&&t.length){try{for(var s=__values(t),o=s.next();!o.done;o=s.next()){var r=o.value;n.append("upload",r)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}this.trigger("start",t),this.sendForm(n)}},n.prototype.sendForm=function(t){var i=this,n=dotvvm.getXHR();n.open("POST",this.uploadUrl,!0),n.setRequestHeader("X-DotVVM-AsyncUpload","true"),n.upload.onprogress=function(t){t.lengthComputable&&i.trigger("progress",100*t.loaded/t.total)},n.onload=function(t){var e=i.processResponse(n.responseText);200!==n.status?i.trigger("error","string"==typeof e?e:null):i.trigger("complete",e)},n.send(t)},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.FormDataUploader=i})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var u;(function(t){"use strict";var i,e=(i=t.ControlBase,__extends(n,i),Object.defineProperty(n.prototype,"uploadData",{get:function(){return this.binding.data()},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"uploadUrl",{get:function(){return this.binding.uploadUrl},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"areMultipleFilesAllowed",{get:function(){var t=this.binding.allowMultipleFiles;return void 0===t||t},enumerable:!0,configurable:!0}),n.prototype.initialize=function(){var e=this;i.prototype.initialize.call(this),this.$input=this.$element.children("input[type='file']"),this.uploader=new t.FormDataUploader(this.uploadUrl),u.Utils.bindDragEvents(this.$element,function(){return e.onElementDragenter()},function(){return e.onElementDragleave()}),this.$element.on("click","."+u.BusinessPackCss.commandSelectFiles,function(t){return e.onSelectFilesClick(t)}).on("click","."+u.BusinessPackCss.commandDelete,function(t){return e.onDeleteFileClick(t)}).on("dragenter drop",function(t){return t.stopPropagationAndPreventDefault()}).on("dragover",function(t){return t.preventDefault()}).on("drop",function(t){return e.onElementDrop(t)}),this.uploader.start(function(t){return e.onUploadStart(t)}).progress(function(t){return e.onUploadProgress(t)}).complete(function(t){return e.onUploadComplete(t)}).error(function(t){return e.onUploadError(t)}),this.$input.change(function(t){return e.onInputChange(t)}),this.disposing(function(){return e.uploader.dispose()})},n.prototype.onSelectFilesClick=function(t){this.isEnabled&&!this.uploadData.IsBusy()&&(t.stopPropagation(),this.$input.click())},n.prototype.onDeleteFileClick=function(t){var e,i,n=ko.dataFor(t.target).FileId;this.isEnabled&&n&&(t.stopPropagation(),(i=(e=this.uploadData.Files().asLinq().single(function(t){return t().FileId()===n()}))().PreviewUrl())&&this.revokePreviewUrl(i),this.uploadData.Files.remove(e))},n.prototype.onInputChange=function(t){var e=this.$input[0];this.isEnabled&&!this.uploadData.IsBusy()&&(t.stopPropagation(),this.uploadFiles(e.files))},n.prototype.onElementDragenter=function(){this.isEnabled&&this.$element.addClass(u.BusinessPackCss.stateDragover)},n.prototype.onElementDragleave=function(){this.$element.removeClass(u.BusinessPackCss.stateDragover)},n.prototype.onElementDrop=function(t){var e=this,i=t.originalEvent.dataTransfer;this.isEnabled&&!this.uploadData.IsBusy()&&u.FileUtils.getFiles(i).done(function(t){return e.uploadFiles(t)})},n.prototype.onEnabledChange=function(){i.prototype.onEnabledChange.call(this),this.$element.find("."+u.BusinessPackCss.commandSelectFiles).toggleClass(u.BusinessPackCss.stateDisabled,!this.isEnabled)},n.prototype.onUploadStart=function(t){var e,i;try{for(var n=__values(t),s=n.next();!s.done;s=n.next()){var o=s.value,r=this.createUploadFile(o);this.uploadData.Files.push(ko.observable(r))}}catch(t){e={error:t}}finally{try{s&&!s.done&&(i=n.return)&&i.call(n)}finally{if(e)throw e.error}}this.$element.addClass(u.BusinessPackCss.stateBusy),this.$element.removeClass(u.BusinessPackCss.stateError),this.uploadData.Progress(0),this.uploadData.IsBusy(!0),this.uploadData.ErrorMessage(null)},n.prototype.onUploadProgress=function(t){this.uploadData.Progress(t)},n.prototype.onUploadComplete=function(t){var e,i,n=this.uploadData.Files().asLinq();try{for(var s=__values(t),o=s.next();!o.done;o=s.next())!function(t){var e=u.FileUtils.getFileName(t.FileName),i=n.firstOrDefault(function(t){return t().FileName()===e});i?(i().FileId(t.FileId),i().FileSize({Bytes:ko.observable(t.FileSize.Bytes),FormattedText:ko.observable(t.FileSize.FormattedText)}),i().IsFileTypeAllowed(t.IsFileTypeAllowed),i().IsMaxSizeExceeded(t.IsMaxSizeExceeded),i().IsAllowed(t.IsAllowed),i().IsUploaded(!0)):u.Utils.warnInDebugMode("Matching file was not found.")}(o.value)}catch(t){e={error:t}}finally{try{o&&!o.done&&(i=s.return)&&i.call(s)}finally{if(e)throw e.error}}this.isEnabled&&this.postback(this.binding.uploadCompleted),this.$element.removeClass(u.BusinessPackCss.stateBusy),this.$element.removeClass(u.BusinessPackCss.stateError),this.uploadData.Progress(0),this.uploadData.IsBusy(!1),this.uploadData.ErrorMessage(null),this.$input.val("")},n.prototype.onUploadError=function(t){this.$element.removeClass(u.BusinessPackCss.stateBusy),this.$element.addClass(u.BusinessPackCss.stateError),this.uploadData.Progress(0),this.uploadData.IsBusy(!1),this.uploadData.ErrorMessage(t||this.binding.genericErrorText),this.$input.val("")},n.prototype.uploadFiles=function(t){var e,i;if(t.length){Array.isArray(t)||(t=u.FileUtils.filesToArray(t)),this.areMultipleFilesAllowed||(t=t.slice(0,1));var n=__read(this.validateFiles(t),2),s=n[0],o=n[1];!this.areMultipleFilesAllowed&&this.uploadData.Files().length&&this.clearFiles();try{for(var r=__values(o),a=r.next();!a.done;a=r.next()){var l=a.value;this.uploadData.Files.push(ko.observable(l))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}this.uploader.upload(s)}},n.prototype.validateFiles=function(t){var e,i,n=[],s=[];try{for(var o=__values(t),r=o.next();!r.done;r=o.next()){var a=r.value,l=this.isFileTypeAllowed(a),u=this.isMaxSizeExceeded(a);u||!l?s.push(this.createUploadFile(a,l,u)):n.push(a)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}return[n,s]},n.prototype.isFileTypeAllowed=function(t){var e,i,n=this.binding.allowedFileTypes,s=t.type.replace(u.RegexUtils.mimeTypeSecondPart(),""),o=u.FileUtils.getExtension(t.name);if(!n||!t.type)return!0;try{for(var r=__values(n.split(",")),a=r.next();!a.done;a=r.next()){var l=a.value;if((l=l.trim()).startsWith(".")){if(l.toUpperCase()===o.toUpperCase())return!0}else{if(!t.type)return!0;if(u.RegexUtils.wildcardMimeType().exec(l)&&s===l.replace(u.RegexUtils.mimeTypeSecondPart(),""))return!0;if(t.type===l)return!0}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(i=r.return)&&i.call(r)}finally{if(e)throw e.error}}return!1},n.prototype.isMaxSizeExceeded=function(t){var e=this.binding.maxFileSize;if(e){var i=1024*e*1024;return t.size>i}return!1},n.prototype.createUploadFile=function(t,e,i){void 0===e&&(e=!0),void 0===i&&(i=!1);var n=e&&!i;return{FileId:ko.observable(u.Utils.createGuid(!0)),FileName:ko.observable(t.name),FileSize:ko.observable({Bytes:ko.observable(t.size),FormattedText:ko.observable(u.FileUtils.formatSize(t.size))}),PreviewUrl:ko.observable(this.createPreviewUrl(t)),IsUploaded:ko.observable(!1),IsFileTypeAllowed:ko.observable(e),IsMaxSizeExceeded:ko.observable(i),IsAllowed:ko.observable(n)}},n.prototype.createPreviewUrl=function(t){if(!u.FileUtils.isImageFile(t))return null;var e=URL.createObjectURL(t);return this.previewUrls.push(e),e},n.prototype.revokePreviewUrl=function(t){var e=this.previewUrls.indexOf(t);0<=e&&(this.previewUrls.splice(e,1),URL.revokeObjectURL(t))},n.prototype.clearFiles=function(){var e,t;try{for(var i=__values(this.previewUrls),n=i.next();!n.done;n=i.next()){var s=n.value;URL.revokeObjectURL(s)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(e)throw e.error}}this.previewUrls=[],this.uploadData.Files([])},n.prototype.getFileStyle=function(t){var e={};return e[u.BusinessPackCss.stateError]=!t.IsAllowed(),e},n);function n(){var t=null!==i&&i.apply(this,arguments)||this;return t.previewUrls=[],t}t.FileUpload=e,u.Utils.installBindingHandler("FileUpload",e)})((u=t.BusinessPack||(t.BusinessPack={})).Controls||(u.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.ButtonBase,__extends(n,e),n);function n(){return null!==e&&e.apply(this,arguments)||this}t.SelectFilesButton=i,s.Utils.installBindingHandler("SelectFilesButton",i)})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.ControlBase,__extends(n,e),n.prototype.initialize=function(){e.prototype.initialize.call(this),this.$element.on("click","."+s.BusinessPackCss.commandAddGroup,this.onAddGroupClick.bind(this)),this.$element.on("click","."+s.BusinessPackCss.commandAddFilter,this.onAddFilterClick.bind(this)),this.$element.on("click","."+s.BusinessPackCss.commandDelete,this.onDeleteFilterClick.bind(this))},n.prototype.getFieldsSource=function(){return s.Utils.deepObservable(this.binding.fields)},n.prototype.getLogicsSource=function(){var t=[{Type:"And",DisplayName:this.binding.andLogicText},{Type:"NotAnd",DisplayName:this.binding.notAndLogicText},{Type:"Or",DisplayName:this.binding.orLogicText},{Type:"NotOr",DisplayName:this.binding.notOrLogicText}];return s.Utils.deepObservable(t)},n.prototype.findFieldByName=function(e){return this.binding.fields.asLinq().singleOrDefault(function(t){return t.Name===e})},n.prototype.onAddGroupClick=function(t){var e=ko.dataFor(t.target).group,i={Type:ko.observable("FilterGroup"),Logic:ko.observable(e.Logic()),Filters:ko.observableArray()};e.Filters.push(ko.observable(i))},n.prototype.onAddFilterClick=function(t){var e=this.binding.fields[0],i=ko.dataFor(t.target).group,n={Type:ko.observable("FilterCondition"),FieldName:ko.observable(e.Name),FieldDisplayName:ko.observable(e.DisplayName),Operator:ko.observable(null),FormatString:ko.observable(null),Value:ko.observable(null)};i.Filters.push(ko.observable(n))},n.prototype.onDeleteFilterClick=function(t){var e=ko.dataFor(t.target);ko.contextFor(t.target).$parent.group.Filters.remove(function(t){return t()===e})},n.prototype.onFieldNameChange=function(t){var e=this.findFieldByName(t.FieldName());t.FieldDisplayName(e.DisplayName),t.FormatString(e.FormatString),t.Value(null),this.postback(this.binding.changed)},n.prototype.onFilterChange=function(){this.postback(this.binding.changed)},n.prototype.canAddNestedGroup=function(t){var e=this.binding.maxOperatorDepth;return 0===e||t+1',vertical:!1,onDragStart:function(t,e,i){o=t.index(),t.appendTo(t.parent()),i(t,e)},onDrag:function(t,e,i,n){e&&(e.left=Math.max(e.left,0),e.top=Math.max(e.top,0),e.left=Math.min(e.left,r.$table.width()-t.width()-r.ColumnReorderingFixingOffset),e.top=Math.min(e.top,r.$table.height()-t.height()),i(t,e,i,n))},onDrop:function(t,e,i){var n=t.index(),s=!1;n!==o&&(r.moveColumnInRows(o,n,!0),s=!0),i(t,e),r.updateSettingsFromColumns(),s&&r.onUserSettingsChanged()}})},n.prototype.disableColumnReordering=function(){ko.unwrap(this.binding.allowReorderColumns)&&this.$columnHeaderRow.sortable("destroy")},n.prototype.sortColumnsSettings=function(){var t=ko.unwrap(this.binding.userSettings);t&&t.ColumnsSettings.sort(function(t,e){return t().DisplayOrder()>e().DisplayOrder()?1:-1})},n.prototype.sortColumnsByDisplayOrder=function(){var e,t,i=ko.unwrap(this.binding.userSettings);if(i)try{for(var n=__values(i.ColumnsSettings()),s=n.next();!s.done;s=n.next()){var o,r,a=s.value,l=a().ColumnName(),u=this.$columnHeaderRow.children("th[data-column='"+l+"']");u.length&&(o=u.index())!==(r=a().DisplayOrder())&&this.moveColumnInRows(o,r)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}},n.prototype.updateSettingsFromColumns=function(){var o,r=this,t=ko.unwrap(this.binding.userSettings);t&&(o=[],this.$columnHeaderRow.children().each(function(t,e){var i=$(e),n=i.attr("data-column"),s=a.Utils.deepClone(r.getColumnSettingsByName(n));s.DisplayOrder(i.index()),o.push(ko.observable(s))}),t.ColumnsSettings(o),this.sortColumnsSettings())},n.prototype.moveColumnInRows=function(i,n,s){var o=this;void 0===s&&(s=!1),this.moveColumnInColgroup(i,n),this.$table.find("tr").each(function(t,e){if(!s||!o.$columnHeaderRow.is(e))return o.moveColumnInRow($(e),i,n)}),this.updateTemplate("InsertRowTemplate",function(t){return o.moveColumnInRow(t,i,n)}),this.updateTemplate("RowTemplate",function(t){return o.moveColumnInRow(t,i,n)}),this.updateTemplate("EditRowTemplate",function(t){return o.moveColumnInRow(t,i,n)})},n.prototype.moveColumnInRow=function(t,e,i){i').add('
').add('
').add('
').add('
').add('
').add('
').add('
'),n.hasForcedSize?n.$element.mousedown(function(t){return t.stopPropagationAndPreventDefault()}):(i=n.options.restrictToParent,n.elementMovable=new s.Movable(n.$element,i),n.$parent.css("cursor","crosshair"),n.$resizeGrips.mousedown(n.onResizeGripMousedown.bind(n)),n.$element.append(n.$resizeGrips)),n}s.CropBox=t})((r=t.BusinessPack||(t.BusinessPack={})).Controls||(r.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var i,e=(i=t.ControlBase,__extends(n,i),n.prototype.initialize=function(){var e=this;i.prototype.initialize.call(this),this.$imageCanvas=this.$element.find("."+s.BusinessPackCss.imageCropImageCanvas),this.$image=this.$imageCanvas.children("img"),this.$cropCanvas=this.$element.find("."+s.BusinessPackCss.imageCropCropCanvas),this.$cropOverlay=this.$cropCanvas.children("."+s.BusinessPackCss.primitiveOverlay),this.$cropBox=this.$cropCanvas.find("."+s.BusinessPackCss.primitiveSelectionBox),this.$toolbar=this.$element.children("."+s.BusinessPackCss.primitiveToolbar),this.$toggle=this.$toolbar.children("."+s.BusinessPackCss.commandToggle),this.$rotateLeft=this.$toolbar.children("."+s.BusinessPackCss.commandRotateLeft),this.$rotateRight=this.$toolbar.children("."+s.BusinessPackCss.commandRotateRight),this.$zoomIn=this.$toolbar.children("."+s.BusinessPackCss.commandZoomIn),this.$zoomOut=this.$toolbar.children("."+s.BusinessPackCss.commandZoomOut),this.$reset=this.$toolbar.children("."+s.BusinessPackCss.commandReset),this.imageCanvasMovable=new t.Movable(this.$imageCanvas),this.crop=new t.CropBox(this.$cropBox,{$imageCanvas:this.$imageCanvas,forcedWidth:this.binding.forcedCropWidth,forcedHeight:this.binding.forcedCropHeight,forcedRadius:this.binding.forcedCropRadius,aspectRatio:this.getAspectRatio()}),this.$window.on("resize"+this.eventNs,this.onWindowResize.bind(this)),this.$element.on("mousewheel",this.onElementMousewheel.bind(this)),this.imageCanvasMovable.update(function(){return e.crop.update()}),this.imageCanvasMovable.change(function(){return e.postback(e.binding.changed)}),this.$image.on("load",this.onImageLoad.bind(this)),this.$cropOverlay.mousedown(function(t){return t.preventDefault()}),this.$toggle.click(this.onToggleButtonClick.bind(this)),this.$rotateLeft.click(function(t){return e.onRotateButtonClick(-45,t)}),this.$rotateRight.click(function(t){return e.onRotateButtonClick(45,t)}),this.$zoomIn.click(function(t){return e.onZoomButtonClick(1.4,t)}),this.$zoomOut.click(function(t){return e.onZoomButtonClick(-1.4,t)}),this.$reset.click(this.onResetClick.bind(this)),this.crop.update(this.onCropUpdate.bind(this)),this.crop.change(this.onCropChange.bind(this))},n.prototype.rotate=function(t){var e=this.binding.changed,i=ko.unwrap(this.binding.operations),n=(360+(i.Rotate()+t))%360;i.Rotate(n||null),this.postback(e),this.$image.css("transform",n?"rotate("+n+"deg)":"none"),this.crop.update()},n.prototype.zoom=function(t,e){var i=this.binding.operations(),n=i.Resize();this.applyZoom(t,e),n!==i.Resize()&&this.postback(this.binding.changed)},n.prototype.onWindowResize=function(t){this.isSafeToFitAndCenterImage()&&this.fitAndCenterImage(!0)},n.prototype.onElementMousewheel=function(t){var e,i=this;t.ctrlKey&&(e=t.originalEvent,t.preventDefault(),clearTimeout(this.zoomTimeoutId),this.applyZoom(0this.$element.width()&&this.$image.width(e=Math.round(this.$element.width())),this.$image.height()>this.$element.height()&&(i=this.$element.height()/this.$image.height(),this.$image.width(e=Math.round(this.$image.width()*i))),e!==s()&&(s(e),t&&this.postback(n))},n.prototype.doesImageFit=function(){return this.$image.width()<=this.$element.width()&&this.$image.height()<=this.$element.height()},n.prototype.applyZoom=function(t,e){var i,n=this.$image.width(),s=this.$image.height(),o=this.$imageCanvas.position(),r=this.$imageCanvas.offset(),a=ko.unwrap(this.binding.operations),l=Math.round(n+t*this.zoomStep);50=n},n.prototype.getItemKeyBinding=function(){return this.binding.itemKeyBinding||this.getItemValueBinding()},n.prototype.getItemValueBinding=function(){return this.binding.itemValueBinding},n.prototype.getItemStyle=function(t){var e;return t=ko.unwrap(t),(e={})[l.BusinessPackCss.stateSelected]=this.isSelected(t),e[l.BusinessPackCss.stateDisabled]=!this.isItemEnabled(t),e[l.BusinessPackCss.stateFocused]=this.hasFocus()&&this.isFocused(t),e},n);function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.focusedItemsKeys=ko.observableArray(),t.selectedItemsKeys=ko.observableArray(),t.arrowHits=3,t.hasFocus=ko.observable(!1),t}t.ListView=i,l.Utils.installBindingHandler("ListView",i)})((l=t.BusinessPack||(t.BusinessPack={})).Controls||(l.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e=(i.prototype.insert=function(t,e){if(!t||e<0||e>=this.mask.length)return!1;if(!this.patterns[this.mask[e]])return t===this.mask[e];if(!this.patterns[this.mask[e]].test(t))return!1;if(!this.buffer[e])return this.buffer[e]=t,!0;var i=this.getEmptyRight(e);if(i<0||i>=this.buffer.length)return!1;for(var n=i-1;e<=n;n--)if(this.patterns[this.mask[n]]&&!this.patterns[this.mask[this.getEmptyRight(n)]].test(this.buffer[n]))return!1;for(n=i-1;e<=n;n--)this.patterns[this.mask[n]]&&(this.buffer[this.getEmptyRight(n)]=this.buffer[n],this.buffer[n]=null);return this.buffer[e]=t,!0},i.prototype.remove=function(t){if(t<0||t>=this.mask.length||!this.buffer[t]||!this.patterns[this.mask[t]])return!1;this.buffer[t]=null;for(var e=t+1;eNumber(e.$element.css("z-index")))||+(Number(t.$element.css("z-index"))===Number(e.$element.css("z-index"))-1)});var h=d.openedDialogs[d.openedDialogs.length-1];h.$element.addClass(p.BusinessPackCss.stateActive),h.focusInside||h.$element.focus()},d.prototype.changeVisibility=function(t){null!=t&&(t?(this.bringToFront(),this.dialog.style.display="flex",this.dialog.classList.add(p.BusinessPackCss.stateOpened),this.element.classList.add(p.BusinessPackCss.stateOpened)):(this.dialog.style.display="none",this.dialog.classList.remove(p.BusinessPackCss.stateOpened),this.element.classList.remove(p.BusinessPackCss.stateOpened)))},d.prototype.checkIfDialogIsNotOutsideOfViewport=function(){var t=this.getOnScreenPosition(this.$dialog);return t.left>this.$window.innerWidth()||t.top>this.$window.innerHeight()},d.prototype.getOnScreenPosition=function(t){var e=t.offset();return{top:e.top-$(window).scrollTop(),left:e.left-$(window).scrollLeft()}},d.prototype.pauseEvent=function(t){return t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),t.cancelBubble=!0,t.returnValue=!1},d.prototype.isInlineHeightSet=function(){return null!=this.dialog.style.height},d.prototype.isInlineWidthSet=function(){return null!=this.dialog.style.width},d.prototype.setInlineHeight=function(t){this.dialog.style.height=t},d.prototype.setInlineWidth=function(t){this.dialog.style.width=t},d.openedDialogs=new Array,d.escapeEventRegistered=!1,d);function d(){var t=null!==e&&e.apply(this,arguments)||this;return t.focusInside=!1,t}t.DialogBase=i})((p=t.BusinessPack||(t.BusinessPack={})).Controls||(p.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={})}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e;(e=t.HorizontalAlignment||(t.HorizontalAlignment={})).Left="Left",e.Center="Center",e.Right="Right"})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.DialogButtonBase,__extends(n,e),n.prototype.onClickAction=function(){this.dialog.windowState=t.WindowState.Maximized},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.MaximizeDialogButton=i,s.Utils.installBindingHandler("MaximizeDialogButton",i)})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.DialogBase,__extends(n,e),n.prototype.initialize=function(){e.prototype.initialize.call(this),this.initSize(),this.updatePositioning(),this.subscribe(this.binding.horizontalAlignment,this.updateHorizontalPositioning.bind(this)),this.subscribe(this.binding.verticalAlignment,this.updateVerticalPositioning.bind(this)),this.subscribe(this.binding.widthRequest,this.updateWidth.bind(this)),this.subscribe(this.binding.heightRequest,this.updateHeight.bind(this))},n.prototype.initSize=function(){this.updateWidth(),this.updateHeight(),window.addEventListener("resize",this.onWindowResize.bind(this))},n.prototype.dispose=function(){e.prototype.dispose.call(this),window.removeEventListener("resize",this.onWindowResize.bind(this))},Object.defineProperty(n.prototype,"$dialog",{get:function(){return this.$element.children("."+s.BusinessPackCss.dialog)},enumerable:!0,configurable:!0}),n.prototype.onWindowResize=function(t){this.updateWidth(),this.updateHeight()},n.prototype.getHorizontalMargin=function(){if(window.getComputedStyle){var t=window.getComputedStyle(this.dialog),e=t.getPropertyValue("margin-left"),i=t.getPropertyValue("margin-right");return parseInt(e,10)+parseInt(i,10)}return this.dialog.currentStyle?(e=this.dialog.currentStyle.marginLeft,i=this.dialog.currentStyle.marginRight,parseInt(e,10)+parseInt(i,10)):0},n.prototype.updateWidth=function(){var t,e,i,n=ko.unwrap(this.binding.widthRequest);n?(t=window.innerWidth-this.getHorizontalMargin(),e=Math.min(t,Number(n)),i=this.addUnitOfMeasurement(e),this.setInlineWidth(i)):this.isInlineWidthSet()&&this.setInlineWidth(null)},n.prototype.getVerticalMargin=function(){if(window.getComputedStyle){var t=window.getComputedStyle(this.dialog),e=t.getPropertyValue("margin-top"),i=t.getPropertyValue("margin-bottom");return parseInt(e,10)+parseInt(i,10)}return this.dialog.currentStyle?(e=this.dialog.currentStyle.marginTop,i=this.dialog.currentStyle.marginBottom,parseInt(e,10)+parseInt(i,10)):0},n.prototype.updateHeight=function(){var t,e,i,n=ko.unwrap(this.binding.heightRequest);n?(t=window.innerHeight-this.getVerticalMargin(),e=Math.min(t,Number(n)),i=this.addUnitOfMeasurement(e),this.setInlineHeight(i)):this.isInlineHeightSet()&&this.setInlineHeight(null)},n.prototype.addUnitOfMeasurement=function(t){return t+"px"},n.prototype.updatePositioning=function(){this.updateVerticalPositioning(),this.updateHorizontalPositioning()},n.prototype.updateVerticalPositioning=function(){switch(this.removeVerticalPositioning(),ko.unwrap(this.binding.verticalAlignment)){case t.VerticalAlignment.Top:this.element.classList.add(s.BusinessPackCss.dialogVerticalAlignTop);break;case t.VerticalAlignment.Center:this.element.classList.add(s.BusinessPackCss.dialogVerticalAlignCenter);break;case t.VerticalAlignment.Bottom:this.element.classList.add(s.BusinessPackCss.dialogVerticalAlignBottom)}},n.prototype.removeVerticalPositioning=function(){this.element.classList.remove(s.BusinessPackCss.dialogVerticalAlignTop),this.element.classList.remove(s.BusinessPackCss.dialogVerticalAlignCenter),this.element.classList.remove(s.BusinessPackCss.dialogVerticalAlignBottom)},n.prototype.updateHorizontalPositioning=function(){switch(this.removeHorizontalPositioning(),ko.unwrap(this.binding.horizontalAlignment)){case t.HorizontalAlignment.Left:this.element.classList.add(s.BusinessPackCss.dialogHorizontalAlignLeft);break;case t.HorizontalAlignment.Center:this.element.classList.add(s.BusinessPackCss.dialogHorizontalAlignCenter);break;case t.HorizontalAlignment.Right:this.element.classList.add(s.BusinessPackCss.dialogHorizontalAlignRight)}},n.prototype.removeHorizontalPositioning=function(){this.element.classList.remove(s.BusinessPackCss.dialogHorizontalAlignLeft),this.element.classList.remove(s.BusinessPackCss.dialogHorizontalAlignCenter),this.element.classList.remove(s.BusinessPackCss.dialogHorizontalAlignRight)},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.ModalDialog=i,s.Utils.installBindingHandler("ModalDialog",i)})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={})}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.DialogButtonBase,__extends(n,e),n.prototype.onClickAction=function(){this.dialog.windowState=t.WindowState.Normal},n);function n(){return null!==e&&e.apply(this,arguments)||this}t.RestoreDialogButton=i,s.Utils.installBindingHandler("RestoreDialogButton",i)})((s=t.BusinessPack||(t.BusinessPack={})).Controls||(s.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e;(e=t.VerticalAlignment||(t.VerticalAlignment={})).Top="Top",e.Center="Center",e.Bottom="Bottom"})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(n){var m;(function(g){"use strict";var i,t=(i=g.DialogBase,__extends(e,i),Object.defineProperty(e.prototype,"width",{get:function(){return ko.unwrap(this.binding.width)},set:function(t){var e=this.binding.width;ko.isWriteableObservable(e)&&e(t||null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return ko.unwrap(this.binding.height)},set:function(t){var e=this.binding.height;ko.isWriteableObservable(e)&&e(t||null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowResize",{get:function(){return null!=this.binding.allowResize&&ko.unwrap(this.binding.allowResize)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"deathZoneSize",{get:function(){return null==this.binding.deathZoneSize?0:ko.unwrap(this.binding.deathZoneSize)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialPositionLeft",{get:function(){var t=this.binding.initialPositionLeft;return null==t?null:isNaN(Number(t))?t:t+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialPositionTop",{get:function(){var t=this.binding.initialPositionTop;return null==t?null:isNaN(Number(t))?t:t+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialPositionBottom",{get:function(){var t=this.binding.initialPositionBottom;return null==t?null:isNaN(Number(t))?t:t+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"initialPositionRight",{get:function(){var t=this.binding.initialPositionRight;return null==t?null:isNaN(Number(t))?t:t+"px"},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"allowMove",{get:function(){return ko.unwrap(this.binding.allowMove)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"windowState",{get:function(){return g.WindowState[ko.unwrap(this.binding.windowState)]},set:function(t){var e=t!==this.windowState;switch(t){case g.WindowState.Maximized:!e&&null!=this.sizeBeforeMaximize&&null!=this.possitionBeforeMaximize||(this.sizeBeforeMaximize={height:this.$element.css("height"),width:this.$element.css("width")},this.possitionBeforeMaximize={x:this.$element.css("left"),y:this.$element.css("top")}),this.applyDialogTransformations(this.deathZoneSize,this.deathZoneSize,$(window).width()-2*this.deathZoneSize,$(window).height()-2*this.deathZoneSize);break;case g.WindowState.Normal:e&&(this.applyDialogTransformations(this.possitionBeforeMaximize.x,this.possitionBeforeMaximize.y,this.sizeBeforeMaximize.width,this.sizeBeforeMaximize.height),this.possitionBeforeMaximize=null,this.sizeBeforeMaximize=null)}this.toogleResizeHandles(t!==g.WindowState.Maximized),e&&(0,this.binding.windowState)(t?g.WindowState[t]:null)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isMaximized",{get:function(){return this.windowState===g.WindowState.Maximized},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isMooving",{get:function(){return this.$element.hasClass(m.BusinessPackCss.stateMoving)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isResizing",{get:function(){return this.$element.hasClass(m.BusinessPackCss.stateResizing)},enumerable:!0,configurable:!0}),e.prototype.initialize=function(){var e=this;function t(){e.isDisplayed&&e.windowState===g.WindowState.Maximized&&(e.windowState=g.WindowState.Maximized)}i.prototype.initialize.call(this),this.$header.on("touchstart mousedown",function(t){return e.allowMove&&e.startMoveDrag(n.BusinessPack.Utils.convertTouchToMouseEvent(t))}),this.allowResize&&this.initResizing(),$(window).on("orientationchange",function(){e.$element.is(":hidden")||e.checkIfDialogIsNotOutsideOfViewport()&&e.moveToInitialPosition(!0)}),this.applyDialogTransformations(void 0,void 0,this.width,this.height),$(window).resize(function(){return e.initSizeLimits()}),this.initSizeLimits(),this.initSize(),ko.isObservable(this.binding.windowState)||(this.binding.windowState=ko.observable(this.binding.windowState)),this.subscribe(this.binding.width,function(){return e.setElementWidth()}),this.subscribe(this.binding.height,function(){return e.setElementHeight()}),this.subscribe(this.binding.windowState,function(){return e.windowState=e.windowState}),this.subscribe(this.binding.allowMove,function(t){return t?e.$header.addClass(m.BusinessPackCss.windowMovable):e.$header.removeClass(m.BusinessPackCss.windowMovable)}),$(document).on("scroll",t),$(window).on("resize",t)},e.prototype.initSize=function(){this.setElementWidth(),this.setElementHeight()},e.prototype.setElementWidth=function(){if(null!=this.width){var t=ko.unwrap(this.width),e="";switch(typeof t){case"number":e=t+"px";break;case"string":e=t}this.setInlineWidth(e)}},e.prototype.setElementHeight=function(){if(null!=this.height){var t=ko.unwrap(this.height),e="";switch(typeof t){case"number":e=t+"px";break;case"string":e=t}this.setInlineHeight(e)}},e.prototype.moveToInitialPosition=function(t){var e,i,n,s,o;void 0===t&&(t=!1),!t&&this.wasMoved||(e=this.initialPositionLeft,i=this.initialPositionTop,n=this.initialPositionBottom,s=this.initialPositionRight,o=this.calculateInitialPosition(),null!=e?(this.$element.css("right",""),this.$element.css("left",e)):null!=s?(this.$element.css("left",""),this.$element.css("right",s)):(this.$element.css("right",""),this.$element.css("left",o.x)),null!=i?(this.$element.css("bottom",""),this.$element.css("top",i)):null!=n?(this.$element.css("top",""),this.$element.css("bottom",n)):(this.$element.css("bottom",""),this.$element.css("top",o.y)))},e.prototype.changeVisibility=function(t){i.prototype.changeVisibility.call(this,t),t&&(this.windowState=this.windowState,this.wasEverDisplayed||this.moveToInitialPosition(),this.wasEverDisplayed=!0)},e.prototype.outsideClickDetected=function(t){this.isMooving||this.isResizing||i.prototype.outsideClickDetected.call(this,t)},e.prototype.calculateInitialPosition=function(){for(var n=this,s=$(window).width()/2-this.$element.width()/2,o=$(window).height()/20,t=$("."+m.BusinessPackCss.window+":visible"),e=function(t,e){var i=n.getOnScreenPosition($(e));return s===i.left&&o===i.top};t.is(e);)s+=20,o+=20;return{x:s,y:o}},e.prototype.startMoveDrag=function(t){var e=this;this.bringToFront();var i=this.$element[0].getBoundingClientRect(),n=this.getOffsetTop(this.$element.get(0));this.mousePositionOnMoveStarted={x:t.clientX-i.left,y:t.clientY-i.top};var s=Math.max($(window).width(),$(document).width())-this.$element.width()-this.deathZoneSize-n.left,o=Math.max($(window).height(),$(document).height())-this.$element.height()-this.deathZoneSize-n.top;function r(t){return e.moveDrag(m.Utils.convertTouchToMouseEvent(t))}this.maxCoordinatesOnMoveStarted={x:s,y:o},this.mousePositionOnLastDragUpdate={x:t.clientX,y:t.clientY},this.$element.addClass(m.BusinessPackCss.stateMoving),this.pauseEvent(t),$(document).on("mouseup touchend",function(t){$(document).off("mousemove touchmove",r),setTimeout(function(){return e.$element.removeClass(m.BusinessPackCss.stateMoving)},1)}),$(document).on("mousemove touchmove",r)},e.prototype.moveDrag=function(t){var e,i,n,s,o,r,a;this.windowState!==g.WindowState.Maximized&&(this.wasMoved=!0,e=this.getOffsetTop(this.$element.get(0)),i=t.clientX+$(window).scrollLeft()-e.left-this.mousePositionOnMoveStarted.x,n=t.clientY+$(window).scrollTop()-e.top-this.mousePositionOnMoveStarted.y,s=this.maxCoordinatesOnMoveStarted.x,o=this.maxCoordinatesOnMoveStarted.y,i!==(r=this.constrain(i,this.deathZoneSize-e.left,s-this.deathZoneSize))&&(i=r),n!==(a=this.constrain(n,this.deathZoneSize-e.top,o-this.deathZoneSize))&&(n=a),this.applyDialogTransformations(i,n,void 0,void 0))},e.prototype.initSizeLimits=function(){var t=parseInt(this.$element.css("min-width").replace("px","")),e=parseInt(this.$element.css("min-height").replace("px",""));this.sizeLimits={minWidth:this.binding.minWidth>t?this.binding.minWidth:t,maxWidth:$(window).width()-this.deathZoneSize,minHeight:this.binding.minHeight>e?this.binding.minHeight:e,maxHeight:$(window).height()-this.deathZoneSize},this.sizeLimits.maxHeight$(window).width()-this.deathZoneSize,d=t.clientY$(window).height()-this.deathZoneSize,p=this.constrain(l,this.sizeLimits.minHeight,this.sizeLimits.maxHeight),f=this.constrain(a,this.sizeLimits.minWidth,this.sizeLimits.maxWidth)===a&&!h,null==l||p!==l||d?null!=l&&(c=l=void 0,m.Utils.warnInDebugMode("MAX / MIN height exceeded")):this.mousePositionOnLastDragUpdate.y=t.clientY,null!=a&&f?this.mousePositionOnLastDragUpdate.x=t.clientX:null!=a&&(u=a=void 0,m.Utils.warnInDebugMode("MAX / MIN width exceeded")),this.applyDialogTransformations(u,c,a,l)))},e.prototype.getOffsetTop=function(t){if(!t)return{left:0,top:0};for(var e={left:0,top:0},i=t;i.offsetParent;)"relative"===window.getComputedStyle(i.offsetParent).position&&(e.top+=i.offsetParent.offsetTop,e.left+=i.offsetParent.offsetLeft),i=i.offsetParent;return e},e.prototype.applyDialogTransformations=function(t,e,i,n){if(null!=t){var s=void 0;switch(typeof t){case"number":s=t+"px";break;case"string":s=t}this.$element.css("left",s)}if(null!=e){var o=void 0;switch(typeof e){case"number":o=e+"px";break;case"string":o=e}this.$element.css("top",o)}if(null!=i)if("auto"!=i){var r="";switch(typeof i){case"number":r=i+"px";break;case"string":r=i}this.setInlineWidth(r),this.width=r}else this.$element.css("width",null),this.width=null;if(null!=n)if("auto"!=n){var a="";switch(typeof n){case"number":a=n+"px";break;case"string":a=n}this.setInlineHeight(a),this.height=a}else this.$element.css("height",null),this.height=null},e.prototype.toogleResizeHandles=function(t){var e=this.$element.find("."+m.BusinessPackCss.primitiveGrip);null==t&&(t=e.is(":visible")),t?e.show():e.hide()},e);function e(){var t=null!==i&&i.apply(this,arguments)||this;return t.$header=t.$element.children("."+m.BusinessPackCss.primitiveContainer).children("."+m.BusinessPackCss.primitiveHeader),t.wasEverDisplayed=!1,t}g.Window=t,m.Utils.installBindingHandler("Window",t)})((m=n.BusinessPack||(n.BusinessPack={})).Controls||(m.Controls={}))}(DotVVM=DotVVM||{}),function(t){var e;(e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={})}(DotVVM=DotVVM||{}),function(t){var e;(function(t){"use strict";var e;(e=t.WindowState||(t.WindowState={}))[e.Normal=0]="Normal",e[e.Maximized=1]="Maximized"})((e=t.BusinessPack||(t.BusinessPack={})).Controls||(e.Controls={}))}(DotVVM=DotVVM||{}),function(t){var u;(function(e){"use strict";var i,t=(i=e.SelectorBase,__extends(n,i),n.prototype.initialize=function(){var t=this;i.prototype.initialize.call(this),this.$textBox=this.$element.children("."+u.BusinessPackCss.primitiveTextBox),this.$popup=this.$element.children("."+u.BusinessPackCss.primitivePopup),this.$resultsView=this.$popup.children("."+u.BusinessPackCss.listView),this.popupPanel=new e.PopupPanel(this.$popup),this.$element.mousedown(this.onElementMousedown.bind(this)),this.$element.keydown(this.onElementKeydown.bind(this)),this.$element.keyup(this.onElementKeyup.bind(this)),this.$element.on("mousedown","."+u.BusinessPackCss.primitiveValue,function(t){return t.preventDefault()}),this.$element.on("click","."+u.BusinessPackCss.primitiveValue+" ."+u.BusinessPackCss.commandUnselect,this.onUnselectButtonClick.bind(this)),this.$textBox.focus(this.onTextBoxFocus.bind(this)),this.$textBox.blur(this.onTextBoxBlur.bind(this)),this.$textBox.mousedown(function(t){return t.stopPropagation()}),this.$textBox.keydown(this.onTextBoxKeydown.bind(this)),this.$textBox.input(this.onTextBoxInput.bind(this)),this.$popup.mousedown(function(t){return t.preventDefault()}),this.outside("mousedown",function(){return t.togglePopup(!1)}),this.watch(this.binding.selectedValues,this.onSelectedValuesChange),this.subscribe(this.searchResults,this.onSearchResultsChange),this.binding.allowNewItems||u.DeviceUtils.addMobileOrTabletProp(this.$textBox,"readonly",!0)},Object.defineProperty(n.prototype,"isOpened",{get:function(){return this.popupPanel.isOpened},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasValue",{get:function(){return!!this.binding.selectedValues().length},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"resultsView",{get:function(){return this.$resultsView.data("ListView")},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"allowNewItems",{get:function(){return ko.unwrap(this.binding.allowNewItems)},enumerable:!0,configurable:!0}),n.prototype.togglePopup=function(t){void 0===t&&(t=!this.isOpened);var e=t&&this.isEnabled;e&&!this.isOpened&&this.search(null),this.popupPanel.toggle(e),e||this.allowNewItems||this.resetText()},n.prototype.toggleFocusedItemOrCurrentText=function(){var t=this.resultsView.getFocusedItems();this.isOpened&&t.length?(this.resultsView.toggleFocusedItem(),this.resetText()):this.selectCurrentText()},n.prototype.selectCurrentText=function(){var t=this.$textBox.val(),e=this.findItemByText(t);if(null==e){if(t.trim().length&&this.allowNewItems){var i=this.binding,n=i.itemValueBinding,s=i.itemTextBinding;if(!u.Utils.isDataAccessor(n)||!u.Utils.isDataAccessor(s))throw Error("New items can't be created when the ItemValueBinding or ItemTextBinding property is set.");var o=this.findItemInDataSourceOrAdd(this.createItemFromText(t));this.resultsView.selectItem(o,!1)}}else this.resultsView.selectItem(e,!1);this.resetText()},n.prototype.unselectLastItem=function(){this.isEnabled&&this.binding.selectedValues().length&&(this.binding.selectedValues.pop(),this.postback(this.binding.changed))},n.prototype.onElementMousedown=function(t){this.$textBox.focus(),t.preventDefault()},n.prototype.onElementKeydown=function(t){this.isEnabled&&(this.isOpened?t.which===u.KeyboardKeys.esc?(t.stopPropagation(),this.togglePopup(!1)):u.KeyboardKeys.isEnter(t.which)?t.stopPropagationAndPreventDefault():t.which===u.KeyboardKeys.tab?t.stopPropagation():t.which===u.KeyboardKeys.down?(t.stopPropagation(),this.resultsView.focusNextItem()):t.which===u.KeyboardKeys.up&&(t.stopPropagation(),this.resultsView.focusPrevItem()):t.altKey&&t.which===u.KeyboardKeys.down&&(t.stopPropagation(),this.togglePopup(!0)),t.which!==u.KeyboardKeys.backspace||this.$textBox.val()||(t.stopPropagationAndPreventDefault(),this.backspaceHits<3?this.backspaceHits++:(this.backspaceHits=0,this.unselectLastItem())),this.searchEngine.isRunning||u.KeyboardKeys.isEnter(t.which)&&this.toggleFocusedItemOrCurrentText())},n.prototype.onElementKeyup=function(t){this.backspaceHits=3},n.prototype.onUnselectButtonClick=function(t){this.isEnabled&&(t.stopPropagation(),this.resultsView.unselectItem(ko.dataFor(t.target)),this.resetText())},n.prototype.onTextBoxFocus=function(){this.$element.addClass(u.BusinessPackCss.stateFocused),this.resultsView.hasFocus(!0),this.togglePopup(!0)},n.prototype.onTextBoxBlur=function(){this.$element.removeClass(u.BusinessPackCss.stateFocused),this.resultsView.hasFocus(!1),this.togglePopup(!1)},n.prototype.onTextBoxKeydown=function(t){this.isOpened&&u.KeyboardKeys.isUpOrDown(t.which)&&t.preventDefault()},n.prototype.onTextBoxInput=function(t){var e=this.$textBox.val();(e||this.isOpened)&&(t.stopPropagation(),this.togglePopup(!0),this.$textBox.attr("size",e.length||0),this.search(e),this.autoFocusItem())},n.prototype.onDataSourceChange=function(){i.prototype.onDataSourceChange.call(this)},n.prototype.onSelectedValuesChange=function(t){var e,i,n=[],s=[];t.length?(this.$textBox.removeAttr("placeholder"),this.$element.removeClass(u.BusinessPackCss.stateValueEmpty)):(this.$textBox.attr("placeholder",this.binding.placeholder),this.$element.addClass(u.BusinessPackCss.stateValueEmpty));try{for(var o=__values(t),r=o.next();!r.done;r=o.next()){var a=r.value,l=this.findItemByValue(a);l?(n.push(l),s.push(a)):this.warnThatValueWasNotFound(a)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(i=o.return)&&i.call(o)}finally{if(e)throw e.error}}this.selectedItems(n),this.selectedValues(s),this.popupPanel.update(),this.resetText()},n.prototype.onSearchResultsChange=function(t){var e,i=this,n=ko.unwrap(this.binding.loadItemsMode);this.$textBox.val(),"Replace"===n&&this.resultsView&&(e=t.map(function(t){return i.getItemKey(t)}),this.removeAllItemsExcept(e.concat(this.resultsView.selectedItemsKeys()))),this.autoFocusItem()},n.prototype.autoFocusItem=function(){var t=ko.unwrap(this.searchResults),e=this.$textBox.val();this.resultsView&&t.length&&(this.allowNewItems?t[0]().toString().toLowerCase()!==e.toLowerCase()?this.resultsView.unfocusAllItems():this.resultsView.focusItem(t[0]):this.resultsView.focusFirstItem())},n.prototype.getSelectedItemStyle=function(t){t=ko.unwrap(t);var e={};return e[u.BusinessPackCss.stateDisabled]=!this.isItemEnabled(t),e},n.prototype.onSearchResultSelected=function(){var t=this.binding.changed;return this.binding.selectedValues(this.selectedValues().slice()),t?t():Promise.resolve()},n.prototype.resetText=function(){this.$textBox.val(""),this.$textBox.attr("size",0),this.search(null),this.autoFocusItem()},n);function n(){var t=null!==i&&i.apply(this,arguments)||this;return t.selectedItems=ko.observableArray(),t.backspaceHits=3,t}e.MultiSelect=t,u.Utils.installBindingHandler("MultiSelect",t)})((u=t.BusinessPack||(t.BusinessPack={})).Controls||(u.Controls={}))}(DotVVM=DotVVM||{}),function(t){var s;(function(t){"use strict";var e,i=(e=t.ControlBase,__extends(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return ko.unwrap(this.binding.value)},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"hasValue",{get:function(){return null!=this.value},enumerable:!0,configurable:!0}),n.prototype.initialize=function(){var t=this;e.prototype.initialize.call(this),this.$textBox=this.$element.children("."+s.BusinessPackCss.primitiveTextBox),this.$increaseButton=this.$element.find("."+s.BusinessPackCss.commandIncrease),this.$decreaseButton=this.$element.find("."+s.BusinessPackCss.commandDecrease),this.$element.mousedown(this.onElementMousedown.bind(this)),this.$element.keydown(this.onElementKeydown.bind(this)),this.$textBox.focus(this.onTextBoxFocus.bind(this)),this.$textBox.blur(this.onTextBoxBlur.bind(this)),this.$textBox.keydown(this.onTextBoxKeydown.bind(this)),this.$textBox.change(this.onTextBoxChange.bind(this)),this.$increaseButton.mousedown(this.onIncreaseButtonMousedown.bind(this)),this.$decreaseButton.mousedown(this.onDecreaseButtonMousedown.bind(this)),this.subscribe(this.binding.value,this.onValueChange.bind(this)),this.subscribe(this.binding.maxValue,function(){return t.validateValue()}),this.subscribe(this.binding.minValue,function(){return t.validateValue()})},n.prototype.increase=function(){this.applyIncrease(1),this.postbackChangesIfPending()},n.prototype.decrease=function(){this.applyDecrease(1),this.postbackChangesIfPending()},n.prototype.onElementMousedown=function(){this.$textBox.focus()},n.prototype.onElementKeydown=function(t){this.isEnabled&&s.KeyboardKeys.isUpOrDown(t.which)&&(t.stopPropagation(),this.setKeydownTimeout(t.which===s.KeyboardKeys.up,t.ctrlKey))},n.prototype.onTextBoxFocus=function(){this.$element.addClass(s.BusinessPackCss.stateFocused)},n.prototype.onTextBoxBlur=function(){this.$element.removeClass(s.BusinessPackCss.stateFocused)},n.prototype.onTextBoxKeydown=function(t){s.KeyboardKeys.isUpOrDown(t.which)&&t.preventDefault()},n.prototype.onTextBoxChange=function(t){t.stopPropagation(),this.updateValueFromTextBox(),this.postbackChangesIfPending()},n.prototype.onIncreaseButtonMousedown=function(t){this.isEnabled&&(t.stopPropagationAndPreventDefault(),this.setMousedownTimeout(this.applyIncrease.bind(this)),this.$textBox.focus())},n.prototype.onDecreaseButtonMousedown=function(t){this.isEnabled&&(t.stopPropagationAndPreventDefault(),this.setMousedownTimeout(this.applyDecrease.bind(this)),this.$textBox.focus())},n.prototype.onValueChange=function(t){this.validateValue(),this.$element.toggleClass(s.BusinessPackCss.stateValueEmpty,null==t),this.textBoxValue(t)},n.prototype.setKeydownTimeout=function(t,e){var i=this,n=e?10:1,s=null==this.holdTimeoutId?600:200;clearTimeout(this.holdTimeoutId),t?this.applyIncrease(n):this.applyDecrease(n),this.holdTimeoutId=setTimeout(function(){i.clearTimeoutsAndIntervals(),i.postbackChangesIfPending()},s)},n.prototype.setMousedownTimeout=function(t){var e=this;clearTimeout(this.holdTimeoutId),t(1),this.holdTimeoutId=setTimeout(function(){e.changeIntervalId=setInterval(t,50,1)},600),this.$document.one("mouseup",function(){e.clearTimeoutsAndIntervals(),e.postbackChangesIfPending()})},n.prototype.applyIncrease=function(t){this.updateValueFromTextBox();var e=this.computeValue(t);this.changeValue(e)},n.prototype.applyDecrease=function(t){this.updateValueFromTextBox();var e=this.computeValue(-t);this.changeValue(e)},n.prototype.updateValueFromTextBox=function(){var t=this.$textBox.val().trim(),e=dotvvm.globalize.parseNumber(t);this.textBoxValue.valueHasMutated(),this.changeValue(isNaN(e)?null:e)},n.prototype.computeValue=function(t){var e=ko.unwrap(this.binding.value),i=ko.unwrap(this.binding.step)*t,n=this.getNumberOfDecimals();return Number((null==e?0:e+i).toFixed(n))},n.prototype.changeValue=function(t){var e=ko.unwrap(this.binding.value),i=ko.unwrap(this.binding.maxValue),n=ko.unwrap(this.binding.minValue);null==t&&(t=0),null!=n&&t")},s);function s(t,e){void 0===e&&(e=[]);var i=n.call(this,e)||this;return i.tagName=t,i}l.TagInlineFormat=i;var o,r=(__extends(a,o=t),a.prototype.getWrapperSelector=function(){return this.tagName+"."+this.className},a.prototype.createWrapper=function(){return $("<"+this.tagName+">").addClass(this.className)},a);function a(t,e,i){void 0===i&&(i=[]);var n=o.call(this,i)||this;return n.tagName=t,n.className=e,n}l.ClassInlineFormat=r;var u,c=(__extends(h,u=t),h.prototype.getNodeState=function(t){var e=this.tagName+"[style*='"+this.styleName+":']",i=g.DomUtils.closestUntil(t,"[contenteditable=true]",e);return!!i.length&&i.css(this.styleName)},h.prototype.getWrapperSelector=function(t){return this.tagName+"[style*='"+this.styleName+":"+t+";'],"+this.tagName+"[style$='"+this.styleName+":"+t+"'],"+this.tagName+"[style*='"+this.styleName+": "+t+";'],"+this.tagName+"[style$='"+this.styleName+": "+t+"']"},h.prototype.createWrapper=function(t){return $("<"+this.tagName+">").css(this.styleName,t)},h);function h(t,e,i){void 0===i&&(i=[]);var n=u.call(this,i)||this;return n.tagName=t,n.styleName=e,n}l.StyleInlineFormat=c;var d,p=(__extends(f,d=c),f.prototype.getNodeState=function(t){return this.isFormatted(t)},f.prototype.getWrapperSelector=function(){return d.prototype.getWrapperSelector.call(this,this.styleValue)},f.prototype.createWrapper=function(){return d.prototype.createWrapper.call(this,this.styleValue)},f);function f(t,e,i,n){void 0===n&&(n=[]);var s=d.call(this,t,e,n)||this;return s.styleValue=i,s}l.StyleValueInlineFormat=p})((g=t.BusinessPack||(t.BusinessPack={})).Controls||(g.Controls={}))}(DotVVM=DotVVM||{}),function(t){var P;(function(D){"use strict";var i,t=(i=D.ReactiveBase,__extends(e,i),Object.defineProperty(e.prototype,"html",{get:function(){return t=this.$input.clone(),P.DomUtils.removeEmptyText(t),function(t){for(var e,i,n,s,o,r,a=[],l=1;l"),f.append(C.text()),m=!1}}catch(t){n={error:t}}finally{try{v&&!v.done&&(s=y.return)&&s.call(y)}finally{if(n)throw n.error}}}else f.append(p.contents());p.replaceWith(f)}}catch(t){e={error:t}}finally{try{h&&!h.done&&(i=c.return)&&i.call(c)}finally{if(e)throw e.error}}D.TextRange.restore(r),this.update()}},e.prototype.align=function(t){t&&(this.$input.focus(),w(this,!0),k(this),n("justify"+t),this.update())},e.prototype.alignLeft=function(){this.align("Left")},e.prototype.alignCenter=function(){this.align("Center")},e.prototype.alignRight=function(){this.align("Right")},e.prototype.alignJustify=function(){this.align("Full")},e.prototype.indent=function(){var t,e,i,n,s,o,r,a;this.$input.focus(),D.TextRange.isInList()?(t=(o=D.TextRange.get()).save(),i=(e=o.singleAncestor("li")).parent(),(n=e.prev()).length&&((s=n.children("ol,ul").last()).length||(s=P.DomUtils.clone(i).appendTo(n)),s.append(e),D.TextRange.restore(t),this.update())):(w(this,!0),(r=(o=D.TextRange.get()).singleAncestor(P.DomUtils.blockSelector)).length&&(a=parseInt(r.css("margin-left"))+25,r.css("margin-left",a+"px"),this.update()))},e.prototype.outdent=function(){var t,e,i,n,s,o,r,a;this.$input.focus(),D.TextRange.isInList()?(t=(o=D.TextRange.get()).save(),i=(e=o.singleAncestor("li")).parent(),n=e.parents("li").first(),s=e.nextAll(),n.length&&(s.length&&P.DomUtils.clone(i).append(s).appendTo(e),n.after(e),i.children().length||i.remove(),D.TextRange.restore(t),this.update())):(w(this,!0),(r=(o=D.TextRange.get()).singleAncestor(P.DomUtils.blockSelector)).length&&(a=parseInt(r.css("margin-left"))-25,r.css("margin-left",0");e.length?e.detach():P.DomUtils.isLastOrFalsy(t.endNode)&&(e=$("
")),t.insert(i).after(e),t.startAfter(i).collapseToStart().apply(),this.update()},e.prototype.insertBlock=function(){D.TextRange.isInList()?this.insertListItem():this.insertParagraph()},e.prototype.toggleList=function(t){if(t){this.$input.focus(),w(this,!0),k(this);var e,i,n=D.TextRange.get(),s=n.save();if(D.TextRange.isInList()){var o,r,a,l,u,c,h=n.singleAncestor("li"),d=h.parent();if(!h.length)return;d.is(t)?(o=h.children("ol,ul").last(),r=P.DomUtils.reverse(h.prevAll().detach()),a=h.nextAll().detach(),l=$("


"),u=$([]),h.is(":empty")||l.empty().append(h.contents()),P.DomUtils.isLast(o)&&(a=o.children().add(a),o.remove()),r.length&&(f=P.DomUtils.clone(d).append(r),u=u.add(f)),u=u.add(l),a.length&&(g=P.DomUtils.clone(d).append(a),u=u.add(g)),d.replaceWith(u),(i=(e=l).children(P.DomUtils.blockSelector).first()).length&&(y(P.DomUtils.getNextAllInlineContents(i).filter(function(t,e){return!P.DomUtils.isWhitespace(e)}).first()),e.after(i.nextAll().addBack())),D.TextRange.restore(s)||n.startOn(l,0).collapseToStart().apply()):(c=d.children(),d.replaceWith($("<"+t+">").append(c)),D.TextRange.restore(s))}else{var p=n.singleAncestor(P.DomUtils.blockSelector),f=p.prev("ol,ul"),g=p.next("ol,ul"),m=$("
  • ");f.length||p.before(f=$("<"+t+">")),m.append(p.contents()).appendTo(f),p.remove(),g.length&&(f.append(g.children()),g.remove()),D.TextRange.restore(s)||n.startOn(m,0).collapseToStart().apply()}this.update()}},e.prototype.toggleOrderedList=function(){this.toggleList("ol")},e.prototype.toggleUnorderedList=function(){this.toggleList("ul")},e.prototype.autoInsertList=function(){if(this.$input.focus(),D.TextRange.isInList())return!1;k(this);var t=D.TextRange.get(),e=t.singleAncestor(P.DomUtils.blockSelector),i=this.$input[0].childNodes;if(e.length&&(i=e[0].childNodes),1===i.length){var n=i[0],s=n.nodeValue;if(P.DomUtils.isText(n)){var o=void 0;if(s.match(/^\s*-$/g)?o=$("