{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm-es5/ion-infinite-scroll_2-md.entry.js","webpack:///./node_modules/@ionic/core/dist/esm-es5/index-3476b023.js"],"names":["InfiniteScroll","class_1","hostRef","_this","this","thrPx","thrPc","didFire","isBusy","isLoading","threshold","disabled","position","onScroll","scrollEl","canStart","infiniteHeight","el","offsetHeight","scrollTop","scrollHeight","height","distanceFromInfinite","ionInfinite","emit","prototype","thresholdChanged","val","lastIndexOf","parseFloat","disabledChanged","enableScrollEvents","connectedCallback","contentEl","_a","_b","label","closest","getScrollElement","console","error","sent","clientHeight","disconnectedCallback","undefined","complete","prev_1","requestAnimationFrame","newScrollTop","shouldListen","addEventListener","removeEventListener","render","mode","class","Object","defineProperty","get","enumerable","configurable","InfiniteScrollContent","componentDidLoad","loadingSpinner","name","loadingText","innerHTML","sanitizeDOMString","untrustedString","documentFragment_1","document","createDocumentFragment","workingDiv","createElement","appendChild","blockedTags","forEach","blockedTag","getElementsToRemove","querySelectorAll","elementIndex","length","element","parentNode","removeChild","childElements","getElementChildren","childIndex","sanitizeElement","dfChildren","fragmentDiv","getInnerDiv","querySelector","err","nodeType","i","attributes","attribute","item","attributeName","allowedAttributes","includes","toLowerCase","attributeValue","value","removeAttribute","children","childNodes"],"mappings":"kHAAA,2KAIIA,EAAgC,WAChC,SAASC,EAAQC,GACb,IAAIC,EAAQC,KACZ,eAAiBA,KAAMF,GACvBE,KAAKC,MAAQ,EACbD,KAAKE,MAAQ,EACbF,KAAKG,SAAU,EACfH,KAAKI,QAAS,EACdJ,KAAKK,WAAY,EAUjBL,KAAKM,UAAY,MAUjBN,KAAKO,UAAW,EAKhBP,KAAKQ,SAAW,SAChBR,KAAKS,SAAW,WACZ,IAAIC,EAAWX,EAAMW,SACrB,IAAKA,IAAaX,EAAMY,WACpB,OAAO,EAEX,IAAIC,EAAiBb,EAAMc,GAAGC,aAC9B,GAAuB,IAAnBF,EAEA,OAAO,EAEX,IAAIG,EAAYL,EAASK,UACr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"js/chunk-af55936a.105c5fe0.js","sourcesContent":["import { __awaiter, __generator } from \"tslib\";\nimport { r as registerInstance, d as createEvent, w as writeTask, f as readTask, 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 InfiniteScroll = /** @class */ (function () {\n function class_1(hostRef) {\n var _this = this;\n registerInstance(this, hostRef);\n this.thrPx = 0;\n this.thrPc = 0;\n this.didFire = false;\n this.isBusy = false;\n this.isLoading = false;\n /**\n * The threshold distance from the bottom\n * of the content to call the `infinite` output event when scrolled.\n * The threshold value can be either a percent, or\n * in pixels. For example, use the value of `10%` for the `infinite`\n * output event to get called when the user has scrolled 10%\n * from the bottom of the page. Use the value `100px` when the\n * scroll is within 100 pixels from the bottom of the page.\n */\n this.threshold = '15%';\n /**\n * If `true`, the infinite scroll will be hidden and scroll event listeners\n * will be removed.\n *\n * Set this to true to disable the infinite scroll from actively\n * trying to receive new data while scrolling. This is useful\n * when it is known that there is no more data that can be added, and\n * the infinite scroll is no longer needed.\n */\n this.disabled = false;\n /**\n * The position of the infinite scroll element.\n * The value can be either `top` or `bottom`.\n */\n this.position = 'bottom';\n this.onScroll = function () {\n var scrollEl = _this.scrollEl;\n if (!scrollEl || !_this.canStart()) {\n return 1;\n }\n var infiniteHeight = _this.el.offsetHeight;\n if (infiniteHeight === 0) {\n // if there is no height of this element then do nothing\n return 2;\n }\n var scrollTop = scrollEl.scrollTop;\n var scrollHeight = scrollEl.scrollHeight;\n var height = scrollEl.offsetHeight;\n var threshold = _this.thrPc !== 0 ? (height * _this.thrPc) : _this.thrPx;\n var distanceFromInfinite = (_this.position === 'bottom')\n ? scrollHeight - infiniteHeight - scrollTop - threshold - height\n : scrollTop - infiniteHeight - threshold;\n if (distanceFromInfinite < 0) {\n if (!_this.didFire) {\n _this.isLoading = true;\n _this.didFire = true;\n _this.ionInfinite.emit();\n return 3;\n }\n }\n else {\n _this.didFire = false;\n }\n return 4;\n };\n this.ionInfinite = createEvent(this, \"ionInfinite\", 7);\n }\n class_1.prototype.thresholdChanged = function () {\n var val = this.threshold;\n if (val.lastIndexOf('%') > -1) {\n this.thrPx = 0;\n this.thrPc = (parseFloat(val) / 100);\n }\n else {\n this.thrPx = parseFloat(val);\n this.thrPc = 0;\n }\n };\n class_1.prototype.disabledChanged = function () {\n var disabled = this.disabled;\n if (disabled) {\n this.isLoading = false;\n this.isBusy = false;\n }\n this.enableScrollEvents(!disabled);\n };\n class_1.prototype.connectedCallback = function () {\n return __awaiter(this, void 0, void 0, function () {\n var contentEl, _a;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\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 = _b.sent();\n this.thresholdChanged();\n this.disabledChanged();\n if (this.position === 'top') {\n writeTask(function () {\n if (_this.scrollEl) {\n _this.scrollEl.scrollTop = _this.scrollEl.scrollHeight - _this.scrollEl.clientHeight;\n }\n });\n }\n return [2 /*return*/];\n }\n });\n });\n };\n class_1.prototype.disconnectedCallback = function () {\n this.enableScrollEvents(false);\n this.scrollEl = undefined;\n };\n /**\n * Call `complete()` within the `ionInfinite` output event handler when\n * your async operation has completed. For example, the `loading`\n * state is while the app is performing an asynchronous operation,\n * such as receiving more data from an AJAX request to add more items\n * to a data list. Once the data has been received and UI updated, you\n * then call this method to signify that the loading has completed.\n * This method will change the infinite scroll's state from `loading`\n * to `enabled`.\n */\n class_1.prototype.complete = function () {\n return __awaiter(this, void 0, void 0, function () {\n var scrollEl, prev_1;\n var _this = this;\n return __generator(this, function (_a) {\n scrollEl = this.scrollEl;\n if (!this.isLoading || !scrollEl) {\n return [2 /*return*/];\n }\n this.isLoading = false;\n if (this.position === 'top') {\n /**\n * New content is being added at the top, but the scrollTop position stays the same,\n * which causes a scroll jump visually. This algorithm makes sure to prevent this.\n * (Frame 1)\n * - complete() is called, but the UI hasn't had time to update yet.\n * - Save the current content dimensions.\n * - Wait for the next frame using _dom.read, so the UI will be updated.\n * (Frame 2)\n * - Read the new content dimensions.\n * - Calculate the height difference and the new scroll position.\n * - Delay the scroll position change until other possible dom reads are done using _dom.write to be performant.\n * (Still frame 2, if I'm correct)\n * - Change the scroll position (= visually maintain the scroll position).\n * - Change the state to re-enable the InfiniteScroll.\n * - This should be after changing the scroll position, or it could\n * cause the InfiniteScroll to be triggered again immediately.\n * (Frame 3)\n * Done.\n */\n this.isBusy = true;\n prev_1 = scrollEl.scrollHeight - scrollEl.scrollTop;\n // ******** DOM READ ****************\n requestAnimationFrame(function () {\n readTask(function () {\n // UI has updated, save the new content dimensions\n var scrollHeight = scrollEl.scrollHeight;\n // New content was added on top, so the scroll position should be changed immediately to prevent it from jumping around\n var newScrollTop = scrollHeight - prev_1;\n // ******** DOM WRITE ****************\n requestAnimationFrame(function () {\n writeTask(function () {\n scrollEl.scrollTop = newScrollTop;\n _this.isBusy = false;\n });\n });\n });\n });\n }\n return [2 /*return*/];\n });\n });\n };\n class_1.prototype.canStart = function () {\n return (!this.disabled &&\n !this.isBusy &&\n !!this.scrollEl &&\n !this.isLoading);\n };\n class_1.prototype.enableScrollEvents = function (shouldListen) {\n if (this.scrollEl) {\n if (shouldListen) {\n this.scrollEl.addEventListener('scroll', this.onScroll);\n }\n else {\n this.scrollEl.removeEventListener('scroll', this.onScroll);\n }\n }\n };\n class_1.prototype.render = function () {\n var _a;\n var mode = getIonMode(this);\n var disabled = this.disabled;\n return (h(Host, { class: (_a = {},\n _a[mode] = true,\n _a['infinite-scroll-loading'] = this.isLoading,\n _a['infinite-scroll-enabled'] = !disabled,\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 \"threshold\": [\"thresholdChanged\"],\n \"disabled\": [\"disabledChanged\"]\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(class_1, \"style\", {\n get: function () { return \"ion-infinite-scroll{display:none;width:100%}.infinite-scroll-enabled{display:block}\"; },\n enumerable: true,\n configurable: true\n });\n return class_1;\n}());\nvar InfiniteScrollContent = /** @class */ (function () {\n function InfiniteScrollContent(hostRef) {\n registerInstance(this, hostRef);\n }\n InfiniteScrollContent.prototype.componentDidLoad = function () {\n if (this.loadingSpinner === undefined) {\n var mode = getIonMode(this);\n this.loadingSpinner = config.get('infiniteLoadingSpinner', config.get('spinner', mode === 'ios' ? 'lines' : 'crescent'));\n }\n };\n InfiniteScrollContent.prototype.render = function () {\n var _a;\n var mode = getIonMode(this);\n return (h(Host, { class: (_a = {},\n _a[mode] = true,\n // Used internally for styling\n _a[\"infinite-scroll-content-\" + mode] = true,\n _a) }, h(\"div\", { class: \"infinite-loading\" }, this.loadingSpinner && (h(\"div\", { class: \"infinite-loading-spinner\" }, h(\"ion-spinner\", { name: this.loadingSpinner }))), this.loadingText && (h(\"div\", { class: \"infinite-loading-text\", innerHTML: sanitizeDOMString(this.loadingText) })))));\n };\n Object.defineProperty(InfiniteScrollContent, \"style\", {\n get: function () { return \"ion-infinite-scroll-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;min-height:84px;text-align:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.infinite-loading{margin-left:0;margin-right:0;margin-top:0;margin-bottom:32px;display:none;width:100%}.infinite-loading-text{margin-left:32px;margin-right:32px;margin-top:4px;margin-bottom:0}\\@supports ((-webkit-margin-start:0) or (margin-inline-start:0)) or (-webkit-margin-start:0){.infinite-loading-text{margin-left:unset;margin-right:unset;-webkit-margin-start:32px;margin-inline-start:32px;-webkit-margin-end:32px;margin-inline-end:32px}}.infinite-scroll-loading ion-infinite-scroll-content>.infinite-loading{display:block}.infinite-scroll-content-md .infinite-loading-text{color:var(--ion-color-step-600,#666)}.infinite-scroll-content-md .infinite-loading-spinner .spinner-crescent circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-lines-md line,.infinite-scroll-content-md .infinite-loading-spinner .spinner-lines-small-md line{stroke:var(--ion-color-step-600,#666)}.infinite-scroll-content-md .infinite-loading-spinner .spinner-bubbles circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-circles circle,.infinite-scroll-content-md .infinite-loading-spinner .spinner-dots circle{fill:var(--ion-color-step-600,#666)}\"; },\n enumerable: true,\n configurable: true\n });\n return InfiniteScrollContent;\n}());\nexport { InfiniteScroll as ion_infinite_scroll, InfiniteScrollContent as ion_infinite_scroll_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":""}