{"version":3,"file":"Checkbox-DqD615aq.js","sources":["../../../node_modules/@material/checkbox/constants.js","../../../node_modules/@material/checkbox/foundation.js","../../../node_modules/@smui/checkbox/dist/Checkbox.svelte"],"sourcesContent":["/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nexport var cssClasses = {\n ANIM_CHECKED_INDETERMINATE: 'mdc-checkbox--anim-checked-indeterminate',\n ANIM_CHECKED_UNCHECKED: 'mdc-checkbox--anim-checked-unchecked',\n ANIM_INDETERMINATE_CHECKED: 'mdc-checkbox--anim-indeterminate-checked',\n ANIM_INDETERMINATE_UNCHECKED: 'mdc-checkbox--anim-indeterminate-unchecked',\n ANIM_UNCHECKED_CHECKED: 'mdc-checkbox--anim-unchecked-checked',\n ANIM_UNCHECKED_INDETERMINATE: 'mdc-checkbox--anim-unchecked-indeterminate',\n BACKGROUND: 'mdc-checkbox__background',\n CHECKED: 'mdc-checkbox--checked',\n CHECKMARK: 'mdc-checkbox__checkmark',\n CHECKMARK_PATH: 'mdc-checkbox__checkmark-path',\n DISABLED: 'mdc-checkbox--disabled',\n INDETERMINATE: 'mdc-checkbox--indeterminate',\n MIXEDMARK: 'mdc-checkbox__mixedmark',\n NATIVE_CONTROL: 'mdc-checkbox__native-control',\n ROOT: 'mdc-checkbox',\n SELECTED: 'mdc-checkbox--selected',\n UPGRADED: 'mdc-checkbox--upgraded',\n};\nexport var strings = {\n ARIA_CHECKED_ATTR: 'aria-checked',\n ARIA_CHECKED_INDETERMINATE_VALUE: 'mixed',\n DATA_INDETERMINATE_ATTR: 'data-indeterminate',\n NATIVE_CONTROL_SELECTOR: '.mdc-checkbox__native-control',\n TRANSITION_STATE_CHECKED: 'checked',\n TRANSITION_STATE_INDETERMINATE: 'indeterminate',\n TRANSITION_STATE_INIT: 'init',\n TRANSITION_STATE_UNCHECKED: 'unchecked',\n};\nexport var numbers = {\n ANIM_END_LATCH_MS: 250,\n};\n//# sourceMappingURL=constants.js.map","/**\n * @license\n * Copyright 2016 Google Inc.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\nimport { __assign, __extends } from \"tslib\";\nimport { MDCFoundation } from '@material/base/foundation';\nimport { cssClasses, numbers, strings } from './constants';\nvar MDCCheckboxFoundation = /** @class */ (function (_super) {\n __extends(MDCCheckboxFoundation, _super);\n function MDCCheckboxFoundation(adapter) {\n var _this = _super.call(this, __assign(__assign({}, MDCCheckboxFoundation.defaultAdapter), adapter)) || this;\n _this.currentCheckState = strings.TRANSITION_STATE_INIT;\n _this.currentAnimationClass = '';\n _this.animEndLatchTimer = 0;\n _this.enableAnimationEndHandler = false;\n return _this;\n }\n Object.defineProperty(MDCCheckboxFoundation, \"cssClasses\", {\n get: function () {\n return cssClasses;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCCheckboxFoundation, \"strings\", {\n get: function () {\n return strings;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCCheckboxFoundation, \"numbers\", {\n get: function () {\n return numbers;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(MDCCheckboxFoundation, \"defaultAdapter\", {\n get: function () {\n return {\n addClass: function () { return undefined; },\n forceLayout: function () { return undefined; },\n hasNativeControl: function () { return false; },\n isAttachedToDOM: function () { return false; },\n isChecked: function () { return false; },\n isIndeterminate: function () { return false; },\n removeClass: function () { return undefined; },\n removeNativeControlAttr: function () { return undefined; },\n setNativeControlAttr: function () { return undefined; },\n setNativeControlDisabled: function () { return undefined; },\n };\n },\n enumerable: false,\n configurable: true\n });\n MDCCheckboxFoundation.prototype.init = function () {\n this.currentCheckState = this.determineCheckState();\n this.updateAriaChecked();\n this.adapter.addClass(cssClasses.UPGRADED);\n };\n MDCCheckboxFoundation.prototype.destroy = function () {\n clearTimeout(this.animEndLatchTimer);\n };\n MDCCheckboxFoundation.prototype.setDisabled = function (disabled) {\n this.adapter.setNativeControlDisabled(disabled);\n if (disabled) {\n this.adapter.addClass(cssClasses.DISABLED);\n }\n else {\n this.adapter.removeClass(cssClasses.DISABLED);\n }\n };\n /**\n * Handles the animationend event for the checkbox\n */\n MDCCheckboxFoundation.prototype.handleAnimationEnd = function () {\n var _this = this;\n if (!this.enableAnimationEndHandler) {\n return;\n }\n clearTimeout(this.animEndLatchTimer);\n this.animEndLatchTimer = setTimeout(function () {\n _this.adapter.removeClass(_this.currentAnimationClass);\n _this.enableAnimationEndHandler = false;\n }, numbers.ANIM_END_LATCH_MS);\n };\n /**\n * Handles the change event for the checkbox\n */\n MDCCheckboxFoundation.prototype.handleChange = function () {\n this.transitionCheckState();\n };\n MDCCheckboxFoundation.prototype.transitionCheckState = function () {\n if (!this.adapter.hasNativeControl()) {\n return;\n }\n var oldState = this.currentCheckState;\n var newState = this.determineCheckState();\n if (oldState === newState) {\n return;\n }\n this.updateAriaChecked();\n var TRANSITION_STATE_UNCHECKED = strings.TRANSITION_STATE_UNCHECKED;\n var SELECTED = cssClasses.SELECTED;\n if (newState === TRANSITION_STATE_UNCHECKED) {\n this.adapter.removeClass(SELECTED);\n }\n else {\n this.adapter.addClass(SELECTED);\n }\n // Check to ensure that there isn't a previously existing animation class, in case for example\n // the user interacted with the checkbox before the animation was finished.\n if (this.currentAnimationClass.length > 0) {\n clearTimeout(this.animEndLatchTimer);\n this.adapter.forceLayout();\n this.adapter.removeClass(this.currentAnimationClass);\n }\n this.currentAnimationClass =\n this.getTransitionAnimationClass(oldState, newState);\n this.currentCheckState = newState;\n // Check for parentNode so that animations are only run when the element is attached\n // to the DOM.\n if (this.adapter.isAttachedToDOM() &&\n this.currentAnimationClass.length > 0) {\n this.adapter.addClass(this.currentAnimationClass);\n this.enableAnimationEndHandler = true;\n }\n };\n MDCCheckboxFoundation.prototype.determineCheckState = function () {\n var TRANSITION_STATE_INDETERMINATE = strings.TRANSITION_STATE_INDETERMINATE, TRANSITION_STATE_CHECKED = strings.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = strings.TRANSITION_STATE_UNCHECKED;\n if (this.adapter.isIndeterminate()) {\n return TRANSITION_STATE_INDETERMINATE;\n }\n return this.adapter.isChecked() ? TRANSITION_STATE_CHECKED :\n TRANSITION_STATE_UNCHECKED;\n };\n MDCCheckboxFoundation.prototype.getTransitionAnimationClass = function (oldState, newState) {\n var TRANSITION_STATE_INIT = strings.TRANSITION_STATE_INIT, TRANSITION_STATE_CHECKED = strings.TRANSITION_STATE_CHECKED, TRANSITION_STATE_UNCHECKED = strings.TRANSITION_STATE_UNCHECKED;\n var _a = MDCCheckboxFoundation.cssClasses, ANIM_UNCHECKED_CHECKED = _a.ANIM_UNCHECKED_CHECKED, ANIM_UNCHECKED_INDETERMINATE = _a.ANIM_UNCHECKED_INDETERMINATE, ANIM_CHECKED_UNCHECKED = _a.ANIM_CHECKED_UNCHECKED, ANIM_CHECKED_INDETERMINATE = _a.ANIM_CHECKED_INDETERMINATE, ANIM_INDETERMINATE_CHECKED = _a.ANIM_INDETERMINATE_CHECKED, ANIM_INDETERMINATE_UNCHECKED = _a.ANIM_INDETERMINATE_UNCHECKED;\n switch (oldState) {\n case TRANSITION_STATE_INIT:\n if (newState === TRANSITION_STATE_UNCHECKED) {\n return '';\n }\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n case TRANSITION_STATE_UNCHECKED:\n return newState === TRANSITION_STATE_CHECKED ? ANIM_UNCHECKED_CHECKED : ANIM_UNCHECKED_INDETERMINATE;\n case TRANSITION_STATE_CHECKED:\n return newState === TRANSITION_STATE_UNCHECKED ? ANIM_CHECKED_UNCHECKED : ANIM_CHECKED_INDETERMINATE;\n default: // TRANSITION_STATE_INDETERMINATE\n return newState === TRANSITION_STATE_CHECKED ? ANIM_INDETERMINATE_CHECKED : ANIM_INDETERMINATE_UNCHECKED;\n }\n };\n MDCCheckboxFoundation.prototype.updateAriaChecked = function () {\n // Ensure aria-checked is set to mixed if checkbox is in indeterminate state.\n if (this.adapter.isIndeterminate()) {\n this.adapter.setNativeControlAttr(strings.ARIA_CHECKED_ATTR, strings.ARIA_CHECKED_INDETERMINATE_VALUE);\n }\n else {\n // The on/off state does not need to keep track of aria-checked, since\n // the screenreader uses the checked property on the checkbox element.\n this.adapter.removeNativeControlAttr(strings.ARIA_CHECKED_ATTR);\n }\n };\n return MDCCheckboxFoundation;\n}(MDCFoundation));\nexport { MDCCheckboxFoundation };\n// tslint:disable-next-line:no-default-export Needed for backward compatibility with MDC Web v0.44.0 and earlier.\nexport default MDCCheckboxFoundation;\n//# sourceMappingURL=foundation.js.map","