{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-refresher_2-ios.entry.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/index-3476b023.js"],"names":["Refresher","class_1","prototype","disabledChanged","this","gesture","setDisabled","disabled","connectedCallback","contentEl","_a","_b","_this","_c","label","el","getAttribute","console","error","closest","getScrollElement","scrollEl","sent","createGesture","gestureName","gesturePriority","direction","threshold","passive","canStart","onStart","onMove","ev","onEnd","disconnectedCallback","undefined","destroy","complete","close","cancel","getProgress","Promise","resolve","progress","state","scrollTop","detail","event","touches","length","pullFactor","Number","isNaN","deltaY","appliedStyles","setCss","cancelable","preventDefault","pullMin","didStart","ionStart","emit","ionPull","pullMax","beginRefresh","snapbackDuration","ionRefresh","bind","delay","setTimeout","closeDuration","y","duration","overflowVisible","style","transform","transitionDuration","transitionDelay","overflow","render","mode","slot","class","Object","defineProperty","get","enumerable","configurable","hostRef","RefresherContent","componentWillLoad","pullingIcon","refreshingSpinner","icon","lazy","pullingText","innerHTML","name","refreshingText","sanitizeDOMString","untrustedString","documentFragment_1","document","createDocumentFragment","workingDiv","createElement","dfChildren","appendChild","blockedTags","forEach","blockedTag","getElementsToRemove","querySelectorAll","elementIndex","element","childElements","parentNode","removeChild","getElementChildren","childIndex","sanitizeElement","fragmentDiv","getInnerDiv","querySelector","err","nodeType","i","attributes","attribute","item","attributeName","allowedAttributes","includes","toLowerCase","attributeValue","value","removeAttribute","children","childNodes"],"mappings":"+FAAA,2JAIIA,GAwDAC,EAAQC,UAAUC,gBAAkB,WAC5BC,KAAKC,SACLD,KAAKC,QAAQC,YAAYF,KAAKG,QAAQ,CAE9C,EACAN,EAAQC,UAAUM,kBAAoB,WAClC,OAAO,YAAUJ,KAAM,OAAQ,OAAQ,WACnC,IAAIK,EAAWC,EAAIC,EACfC,EAAQR,KACZ,OAAO,YAAYA,KAAM,SAAUS,GAC/B,OAAQA,EAAGC,OACP,KAAK,EACD,MAAqC,UAAjCV,KAAKW,GAAGC,aA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AU,QAAS,SAAU,OAAQ,OAAQ,SAAU,Q","file":"js/chunk-af59c236.1e4f0704.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, w as writeTask, c as getIonMode, h, e as getElement, H as Host } from './core-feeeff0d.js';\nimport { b as config } from './config-3c7f3790.js';\nimport { s as sanitizeDOMString } from './index-3476b023.js';\nvar Refresher = /** @class */ (function () {\n function class_1(hostRef) {\n registerInstance(this, hostRef);\n this.appliedStyles = false;\n this.didStart = false;\n this.progress = 0;\n /**\n * The current state which the refresher is in. The refresher's states include:\n *\n * - `inactive` - The refresher is not being pulled down or refreshing and is currently hidden.\n * - `pulling` - The user is actively pulling down the refresher, but has not reached the point yet that if the user lets go, it'll refresh.\n * - `cancelling` - The user pulled down the refresher and let go, but did not pull down far enough to kick off the `refreshing` state. After letting go, the refresher is in the `cancelling` state while it is closing, and will go back to the `inactive` state once closed.\n * - `ready` - The user has pulled down the refresher far enough that if they let go, it'll begin the `refreshing` state.\n * - `refreshing` - The refresher is actively waiting on the async operation to end. Once the refresh handler calls `complete()` it will begin the `completing` state.\n * - `completing` - The `refreshing` state has finished and the refresher is in the way of closing itself. Once closed, the refresher will go back to the `inactive` state.\n */\n this.state = 1 /* Inactive */;\n /**\n * The minimum distance the user must pull down until the\n * refresher will go into the `refreshing` state.\n */\n this.pullMin = 60;\n /**\n * The maximum distance of the pull until the refresher\n * will automatically go into the `refreshing` state.\n * Defaults to the result of `pullMin + 60`.\n */\n this.pullMax = this.pullMin + 60;\n /**\n * Time it takes to close the refresher.\n */\n this.closeDuration = '280ms';\n /**\n * Time it takes the refresher to to snap back to the `refreshing` state.\n */\n this.snapbackDuration = '280ms';\n /**\n * How much to multiply the pull speed by. To slow the pull animation down,\n * pass a number less than `1`. To speed up the pull, pass a number greater\n * than `1`. The default value is `1` which is equal to the speed of the cursor.\n * If a negative value is passed in, the factor will be `1` instead.\n *\n * For example: If the value passed is `1.2` and the content is dragged by\n * `10` pixels, instead of `10` pixels the content will be pulled by `12` pixels\n * (an increase of 20 percent). If the value passed is `0.8`, the dragged amount\n * will be `8` pixels, less than the amount the cursor has moved.\n */\n this.pullFactor = 1;\n /**\n * If `true`, the refresher will be hidden.\n */\n this.disabled = false;\n this.ionRefresh = createEvent(this, \"ionRefresh\", 7);\n this.ionPull = createEvent(this, \"ionPull\", 7);\n this.ionStart = createEvent(this, \"ionStart\", 7);\n }\n class_1.prototype.disabledChanged = function () {\n if (this.gesture) {\n this.gesture.setDisabled(this.disabled);\n }\n };\n class_1.prototype.connectedCallback = function () {\n return __awaiter(this, void 0, void 0, function () {\n var contentEl, _a, _b;\n var _this = this;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n if (this.el.getAttribute('slot') !== 'fixed') {\n console.error('Make sure you use: ');\n return [2 /*return*/];\n }\n contentEl = this.el.closest('ion-content');\n if (!contentEl) {\n console.error(' must be used inside an ');\n return [2 /*return*/];\n }\n _a = this;\n return [4 /*yield*/, contentEl.getScrollElement()];\n case 1:\n _a.scrollEl = _c.sent();\n _b = this;\n return [4 /*yield*/, import('./index-624eea58.js')];\n case 2:\n _b.gesture = (_c.sent()).createGesture({\n el: contentEl,\n gestureName: 'refresher',\n gesturePriority: 10,\n direction: 'y',\n threshold: 20,\n passive: false,\n canStart: function () { return _this.canStart(); },\n onStart: function () { return _this.onStart(); },\n onMove: function (ev) { return _this.onMove(ev); },\n onEnd: function () { return _this.onEnd(); },\n });\n this.disabledChanged();\n return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.disconnectedCallback = function () {\n this.scrollEl = undefined;\n if (this.gesture) {\n this.gesture.destroy();\n this.gesture = undefined;\n }\n };\n /**\n * Call `complete()` when your async operation has completed.\n * For example, the `refreshing` state is while the app is performing\n * an asynchronous operation, such as receiving more data from an\n * AJAX request. Once the data has been received, you then call this\n * method to signify that the refreshing has completed and to close\n * the refresher. This method also changes the refresher's state from\n * `refreshing` to `completing`.\n */\n class_1.prototype.complete = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.close(32 /* Completing */, '120ms');\n return [2 /*return*/];\n });\n });\n };\n /**\n * Changes the refresher's state from `refreshing` to `cancelling`.\n */\n class_1.prototype.cancel = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.close(16 /* Cancelling */, '');\n return [2 /*return*/];\n });\n });\n };\n /**\n * A number representing how far down the user has pulled.\n * The number `0` represents the user hasn't pulled down at all. The\n * number `1`, and anything greater than `1`, represents that the user\n * has pulled far enough down that when they let go then the refresh will\n * happen. If they let go and the number is less than `1`, then the\n * refresh will not happen, and the content will return to it's original\n * position.\n */\n class_1.prototype.getProgress = function () {\n return Promise.resolve(this.progress);\n };\n class_1.prototype.canStart = function () {\n if (!this.scrollEl) {\n return false;\n }\n if (this.state !== 1 /* Inactive */) {\n return false;\n }\n // if the scrollTop is greater than zero then it's\n // not possible to pull the content down yet\n if (this.scrollEl.scrollTop > 0) {\n return false;\n }\n return true;\n };\n class_1.prototype.onStart = function () {\n this.progress = 0;\n this.state = 1 /* Inactive */;\n };\n class_1.prototype.onMove = function (detail) {\n if (!this.scrollEl) {\n return;\n }\n // this method can get called like a bazillion times per second,\n // so it's built to be as efficient as possible, and does its\n // best to do any DOM read/writes only when absolutely necessary\n // if multi-touch then get out immediately\n var ev = detail.event;\n if (ev.touches && ev.touches.length > 1) {\n return;\n }\n // do nothing if it's actively refreshing\n // or it's in the way of closing\n // or this was never a startY\n if ((this.state & 56 /* _BUSY_ */) !== 0) {\n return;\n }\n var pullFactor = (Number.isNaN(this.pullFactor) || this.pullFactor < 0) ? 1 : this.pullFactor;\n var deltaY = detail.deltaY * pullFactor;\n // don't bother if they're scrolling up\n // and have not already started dragging\n if (deltaY <= 0) {\n // the current Y is higher than the starting Y\n // so they scrolled up enough to be ignored\n this.progress = 0;\n this.state = 1 /* Inactive */;\n if (this.appliedStyles) {\n // reset the styles only if they were applied\n this.setCss(0, '', false, '');\n return;\n }\n return;\n }\n if (this.state === 1 /* Inactive */) {\n // this refresh is not already actively pulling down\n // get the content's scrollTop\n var scrollHostScrollTop = this.scrollEl.scrollTop;\n // if the scrollTop is greater than zero then it's\n // not possible to pull the content down yet\n if (scrollHostScrollTop > 0) {\n this.progress = 0;\n return;\n }\n // content scrolled all the way to the top, and dragging down\n this.state = 2 /* Pulling */;\n }\n // prevent native scroll events\n if (ev.cancelable) {\n ev.preventDefault();\n }\n // the refresher is actively pulling at this point\n // move the scroll element within the content element\n this.setCss(deltaY, '0ms', true, '');\n if (deltaY === 0) {\n // don't continue if there's no delta yet\n this.progress = 0;\n return;\n }\n var pullMin = this.pullMin;\n // set pull progress\n this.progress = deltaY / pullMin;\n // emit \"start\" if it hasn't started yet\n if (!this.didStart) {\n this.didStart = true;\n this.ionStart.emit();\n }\n // emit \"pulling\" on every move\n this.ionPull.emit();\n // do nothing if the delta is less than the pull threshold\n if (deltaY < pullMin) {\n // ensure it stays in the pulling state, cuz its not ready yet\n this.state = 2 /* Pulling */;\n return;\n }\n if (deltaY > this.pullMax) {\n // they pulled farther than the max, so kick off the refresh\n this.beginRefresh();\n return;\n }\n // pulled farther than the pull min!!\n // it is now in the `ready` state!!\n // if they let go then it'll refresh, kerpow!!\n this.state = 4 /* Ready */;\n return;\n };\n class_1.prototype.onEnd = function () {\n // only run in a zone when absolutely necessary\n if (this.state === 4 /* Ready */) {\n // they pulled down far enough, so it's ready to refresh\n this.beginRefresh();\n }\n else if (this.state === 2 /* Pulling */) {\n // they were pulling down, but didn't pull down far enough\n // set the content back to it's original location\n // and close the refresher\n // set that the refresh is actively cancelling\n this.cancel();\n }\n };\n class_1.prototype.beginRefresh = function () {\n // assumes we're already back in a zone\n // they pulled down far enough, so it's ready to refresh\n this.state = 8 /* Refreshing */;\n // place the content in a hangout position while it thinks\n this.setCss(this.pullMin, this.snapbackDuration, true, '');\n // emit \"refresh\" because it was pulled down far enough\n // and they let go to begin refreshing\n this.ionRefresh.emit({\n complete: this.complete.bind(this)\n });\n };\n class_1.prototype.close = function (state, delay) {\n var _this = this;\n // create fallback timer incase something goes wrong with transitionEnd event\n setTimeout(function () {\n _this.state = 1 /* Inactive */;\n _this.progress = 0;\n _this.didStart = false;\n _this.setCss(0, '0ms', false, '');\n }, 600);\n // reset set the styles on the scroll element\n // set that the refresh is actively cancelling/completing\n this.state = state;\n this.setCss(0, this.closeDuration, true, delay);\n // TODO: stop gesture\n };\n class_1.prototype.setCss = function (y, duration, overflowVisible, delay) {\n var _this = this;\n this.appliedStyles = (y > 0);\n writeTask(function () {\n if (_this.scrollEl) {\n var style = _this.scrollEl.style;\n style.transform = ((y > 0) ? \"translateY(\" + y + \"px) translateZ(0px)\" : 'translateZ(0px)');\n style.transitionDuration = duration;\n style.transitionDelay = delay;\n style.overflow = (overflowVisible ? 'hidden' : '');\n }\n });\n };\n class_1.prototype.render = function () {\n var _a;\n var mode = getIonMode(this);\n return (h(Host, { slot: \"fixed\", class: (_a = {},\n _a[mode] = true,\n // Used internally for styling\n _a[\"refresher-\" + mode] = true,\n _a['refresher-active'] = this.state !== 1 /* Inactive */,\n _a['refresher-pulling'] = this.state === 2 /* Pulling */,\n _a['refresher-ready'] = this.state === 4 /* Ready */,\n _a['refresher-refreshing'] = this.state === 8 /* Refreshing */,\n _a['refresher-cancelling'] = this.state === 16 /* Cancelling */,\n _a['refresher-completing'] = this.state === 32 /* Completing */,\n _a) }));\n };\n Object.defineProperty(class_1.prototype, \"el\", {\n get: function () { return getElement(this); },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"watchers\", {\n get: function () {\n return {\n \"disabled\": [\"disabledChanged\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { return \"ion-refresher{left:0;top:0;display:none;position:absolute;width:100%;height:60px;z-index:-1}:host-context([dir=rtl]) ion-refresher,[dir=rtl] ion-refresher{left:unset;right:unset;right:0}ion-refresher.refresher-active{display:block}ion-refresher-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;height:100%}.refresher-pulling,.refresher-refreshing{display:none;width:100%}.refresher-pulling-icon,.refresher-refreshing-icon{-webkit-transform-origin:center;transform-origin:center;-webkit-transition:.2s;transition:.2s;font-size:30px;text-align:center}:host-context([dir=rtl]) .refresher-pulling-icon,:host-context([dir=rtl]) .refresher-refreshing-icon,[dir=rtl] .refresher-pulling-icon,[dir=rtl] .refresher-refreshing-icon{-webkit-transform-origin:calc(100% - center);transform-origin:calc(100% - center)}.refresher-pulling-text,.refresher-refreshing-text{font-size:16px;text-align:center}.refresher-pulling ion-refresher-content .refresher-pulling,.refresher-ready ion-refresher-content .refresher-pulling{display:block}.refresher-ready ion-refresher-content .refresher-pulling-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.refresher-cancelling ion-refresher-content .refresher-pulling,.refresher-refreshing ion-refresher-content .refresher-refreshing{display:block}.refresher-cancelling ion-refresher-content .refresher-pulling-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-completing ion-refresher-content .refresher-refreshing{display:block}.refresher-completing ion-refresher-content .refresher-refreshing-icon{-webkit-transform:scale(0);transform:scale(0)}.refresher-ios .refresher-pulling-icon,.refresher-ios .refresher-pulling-text,.refresher-ios .refresher-refreshing-icon,.refresher-ios .refresher-refreshing-text{color:var(--ion-text-color,#000)}.refresher-ios .refresher-refreshing .spinner-crescent circle,.refresher-ios .refresher-refreshing .spinner-lines-ios line,.refresher-ios .refresher-refreshing .spinner-lines-small-ios line{stroke:var(--ion-text-color,#000)}.refresher-ios .refresher-refreshing .spinner-bubbles circle,.refresher-ios .refresher-refreshing .spinner-circles circle,.refresher-ios .refresher-refreshing .spinner-dots circle{fill:var(--ion-text-color,#000)}\"; },\n enumerable: true,\n configurable: true\n });\n return class_1;\n}());\nvar RefresherContent = /** @class */ (function () {\n function RefresherContent(hostRef) {\n registerInstance(this, hostRef);\n }\n RefresherContent.prototype.componentWillLoad = function () {\n if (this.pullingIcon === undefined) {\n this.pullingIcon = config.get('refreshingIcon', 'arrow-down');\n }\n if (this.refreshingSpinner === undefined) {\n var mode = getIonMode(this);\n this.refreshingSpinner = config.get('refreshingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));\n }\n };\n RefresherContent.prototype.render = function () {\n return (h(Host, { class: getIonMode(this) }, h(\"div\", { class: \"refresher-pulling\" }, this.pullingIcon &&\n h(\"div\", { class: \"refresher-pulling-icon\" }, h(\"ion-icon\", { icon: this.pullingIcon, lazy: false })), this.pullingText &&\n h(\"div\", { class: \"refresher-pulling-text\", innerHTML: sanitizeDOMString(this.pullingText) })), h(\"div\", { class: \"refresher-refreshing\" }, this.refreshingSpinner &&\n h(\"div\", { class: \"refresher-refreshing-icon\" }, h(\"ion-spinner\", { name: this.refreshingSpinner })), this.refreshingText &&\n h(\"div\", { class: \"refresher-refreshing-text\", innerHTML: sanitizeDOMString(this.refreshingText) }))));\n };\n return RefresherContent;\n}());\nexport { Refresher as ion_refresher, RefresherContent as ion_refresher_content };\n","/**\n * Does a simple sanitization of all elements\n * in an untrusted string\n */\nvar sanitizeDOMString = function (untrustedString) {\n try {\n if (typeof untrustedString !== 'string' || untrustedString === '') {\n return untrustedString;\n }\n /**\n * Create a document fragment\n * separate from the main DOM,\n * create a div to do our work in\n */\n var documentFragment_1 = document.createDocumentFragment();\n var workingDiv = document.createElement('div');\n documentFragment_1.appendChild(workingDiv);\n workingDiv.innerHTML = untrustedString;\n /**\n * Remove any elements\n * that are blocked\n */\n blockedTags.forEach(function (blockedTag) {\n var getElementsToRemove = documentFragment_1.querySelectorAll(blockedTag);\n for (var elementIndex = getElementsToRemove.length - 1; elementIndex >= 0; elementIndex--) {\n var element = getElementsToRemove[elementIndex];\n if (element.parentNode) {\n element.parentNode.removeChild(element);\n }\n else {\n documentFragment_1.removeChild(element);\n }\n /**\n * We still need to sanitize\n * the children of this element\n * as they are left behind\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < childElements.length; childIndex++) {\n sanitizeElement(childElements[childIndex]);\n }\n }\n });\n /**\n * Go through remaining elements and remove\n * non-allowed attribs\n */\n // IE does not support .children on document fragments, only .childNodes\n var dfChildren = getElementChildren(documentFragment_1);\n /* tslint:disable-next-line */\n for (var childIndex = 0; childIndex < dfChildren.length; childIndex++) {\n sanitizeElement(dfChildren[childIndex]);\n }\n // Append document fragment to div\n var fragmentDiv = document.createElement('div');\n fragmentDiv.appendChild(documentFragment_1);\n // First child is always the div we did our work in\n var getInnerDiv = fragmentDiv.querySelector('div');\n return (getInnerDiv !== null) ? getInnerDiv.innerHTML : fragmentDiv.innerHTML;\n }\n catch (err) {\n console.error(err);\n return '';\n }\n};\n/**\n * Clean up current element based on allowed attributes\n * and then recursively dig down into any child elements to\n * clean those up as well\n */\nvar sanitizeElement = function (element) {\n // IE uses childNodes, so ignore nodes that are not elements\n if (element.nodeType && element.nodeType !== 1) {\n return;\n }\n for (var i = element.attributes.length - 1; i >= 0; i--) {\n var attribute = element.attributes.item(i);\n var attributeName = attribute.name;\n // remove non-allowed attribs\n if (!allowedAttributes.includes(attributeName.toLowerCase())) {\n element.removeAttribute(attributeName);\n continue;\n }\n // clean up any allowed attribs\n // that attempt to do any JS funny-business\n var attributeValue = attribute.value;\n /* tslint:disable-next-line */\n if (attributeValue != null && attributeValue.toLowerCase().includes('javascript:')) {\n element.removeAttribute(attributeName);\n }\n }\n /**\n * Sanitize any nested children\n */\n var childElements = getElementChildren(element);\n /* tslint:disable-next-line */\n for (var i = 0; i < childElements.length; i++) {\n sanitizeElement(childElements[i]);\n }\n};\n/**\n * IE doesn't always support .children\n * so we revert to .childNodes instead\n */\nvar getElementChildren = function (el) {\n return (el.children != null) ? el.children : el.childNodes;\n};\nvar allowedAttributes = ['class', 'id', 'href', 'src', 'name', 'slot'];\nvar blockedTags = ['script', 'style', 'iframe', 'meta', 'link', 'object', 'embed'];\nexport { sanitizeDOMString as s };\n"],"sourceRoot":""}