{"ast":null,"code":"/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { r as registerInstance, d as createEvent, h, f as Host, i as getElement } from './index-28849c61.js';\nimport { h as inheritAttributes } from './helpers-da915de8.js';\nimport { b as getIonMode } from './ionic-global-c81d82ab.js';\nconst imgCss = \":host{display:block;-o-object-fit:contain;object-fit:contain}img{display:block;width:100%;height:100%;-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit}\";\nconst IonImgStyle0 = imgCss;\nconst Img = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionImgWillLoad = createEvent(this, \"ionImgWillLoad\", 7);\n this.ionImgDidLoad = createEvent(this, \"ionImgDidLoad\", 7);\n this.ionError = createEvent(this, \"ionError\", 7);\n this.inheritedAttributes = {};\n this.onLoad = () => {\n this.ionImgDidLoad.emit();\n };\n this.onError = () => {\n this.ionError.emit();\n };\n this.loadSrc = undefined;\n this.loadError = undefined;\n this.alt = undefined;\n this.src = undefined;\n }\n srcChanged() {\n this.addIO();\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['draggable']);\n }\n componentDidLoad() {\n this.addIO();\n }\n addIO() {\n if (this.src === undefined) {\n return;\n }\n if (typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'isIntersecting' in window.IntersectionObserverEntry.prototype) {\n this.removeIO();\n this.io = new IntersectionObserver(data => {\n /**\n * On slower devices, it is possible for an intersection observer entry to contain multiple\n * objects in the array. This happens when quickly scrolling an image into view and then out of\n * view. In this case, the last object represents the current state of the component.\n */\n if (data[data.length - 1].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n this.io.observe(this.el);\n } else {\n // fall back to setTimeout for Safari and IE\n setTimeout(() => this.load(), 200);\n }\n }\n load() {\n this.loadError = this.onError;\n this.loadSrc = this.src;\n this.ionImgWillLoad.emit();\n }\n removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n render() {\n const {\n loadSrc,\n alt,\n onLoad,\n loadError,\n inheritedAttributes\n } = this;\n const {\n draggable\n } = inheritedAttributes;\n return h(Host, {\n key: 'da600442894427dee1974a28e545613afac69fca',\n class: getIonMode(this)\n }, h(\"img\", {\n key: '16df0c7069af86c0fa7ce5af598bc0f63b4eb71a',\n decoding: \"async\",\n src: loadSrc,\n alt: alt,\n onLoad: onLoad,\n onError: loadError,\n part: \"image\",\n draggable: isDraggable(draggable)\n }));\n }\n get el() {\n return getElement(this);\n }\n static get watchers() {\n return {\n \"src\": [\"srcChanged\"]\n };\n }\n};\n/**\n * Enumerated strings must be set as booleans\n * as Stencil will not render 'false' in the DOM.\n * The need to explicitly render draggable=\"true\"\n * as only certain elements are draggable by default.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable.\n */\nconst isDraggable = draggable => {\n switch (draggable) {\n case 'true':\n return true;\n case 'false':\n return false;\n default:\n return undefined;\n }\n};\nImg.style = IonImgStyle0;\nexport { Img as ion_img };","map":{"version":3,"names":["r","registerInstance","d","createEvent","h","f","Host","i","getElement","inheritAttributes","b","getIonMode","imgCss","IonImgStyle0","Img","constructor","hostRef","ionImgWillLoad","ionImgDidLoad","ionError","inheritedAttributes","onLoad","emit","onError","loadSrc","undefined","loadError","alt","src","srcChanged","addIO","componentWillLoad","el","componentDidLoad","window","IntersectionObserverEntry","prototype","removeIO","io","IntersectionObserver","data","length","isIntersecting","load","observe","setTimeout","disconnect","render","draggable","key","class","decoding","part","isDraggable","watchers","style","ion_img"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@ionic/core/dist/esm/ion-img.entry.js"],"sourcesContent":["/*!\n * (C) Ionic http://ionicframework.com - MIT License\n */\nimport { r as registerInstance, d as createEvent, h, f as Host, i as getElement } from './index-28849c61.js';\nimport { h as inheritAttributes } from './helpers-da915de8.js';\nimport { b as getIonMode } from './ionic-global-c81d82ab.js';\n\nconst imgCss = \":host{display:block;-o-object-fit:contain;object-fit:contain}img{display:block;width:100%;height:100%;-o-object-fit:inherit;object-fit:inherit;-o-object-position:inherit;object-position:inherit}\";\nconst IonImgStyle0 = imgCss;\n\nconst Img = class {\n constructor(hostRef) {\n registerInstance(this, hostRef);\n this.ionImgWillLoad = createEvent(this, \"ionImgWillLoad\", 7);\n this.ionImgDidLoad = createEvent(this, \"ionImgDidLoad\", 7);\n this.ionError = createEvent(this, \"ionError\", 7);\n this.inheritedAttributes = {};\n this.onLoad = () => {\n this.ionImgDidLoad.emit();\n };\n this.onError = () => {\n this.ionError.emit();\n };\n this.loadSrc = undefined;\n this.loadError = undefined;\n this.alt = undefined;\n this.src = undefined;\n }\n srcChanged() {\n this.addIO();\n }\n componentWillLoad() {\n this.inheritedAttributes = inheritAttributes(this.el, ['draggable']);\n }\n componentDidLoad() {\n this.addIO();\n }\n addIO() {\n if (this.src === undefined) {\n return;\n }\n if (typeof window !== 'undefined' &&\n 'IntersectionObserver' in window &&\n 'IntersectionObserverEntry' in window &&\n 'isIntersecting' in window.IntersectionObserverEntry.prototype) {\n this.removeIO();\n this.io = new IntersectionObserver((data) => {\n /**\n * On slower devices, it is possible for an intersection observer entry to contain multiple\n * objects in the array. This happens when quickly scrolling an image into view and then out of\n * view. In this case, the last object represents the current state of the component.\n */\n if (data[data.length - 1].isIntersecting) {\n this.load();\n this.removeIO();\n }\n });\n this.io.observe(this.el);\n }\n else {\n // fall back to setTimeout for Safari and IE\n setTimeout(() => this.load(), 200);\n }\n }\n load() {\n this.loadError = this.onError;\n this.loadSrc = this.src;\n this.ionImgWillLoad.emit();\n }\n removeIO() {\n if (this.io) {\n this.io.disconnect();\n this.io = undefined;\n }\n }\n render() {\n const { loadSrc, alt, onLoad, loadError, inheritedAttributes } = this;\n const { draggable } = inheritedAttributes;\n return (h(Host, { key: 'da600442894427dee1974a28e545613afac69fca', class: getIonMode(this) }, h(\"img\", { key: '16df0c7069af86c0fa7ce5af598bc0f63b4eb71a', decoding: \"async\", src: loadSrc, alt: alt, onLoad: onLoad, onError: loadError, part: \"image\", draggable: isDraggable(draggable) })));\n }\n get el() { return getElement(this); }\n static get watchers() { return {\n \"src\": [\"srcChanged\"]\n }; }\n};\n/**\n * Enumerated strings must be set as booleans\n * as Stencil will not render 'false' in the DOM.\n * The need to explicitly render draggable=\"true\"\n * as only certain elements are draggable by default.\n * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/draggable.\n */\nconst isDraggable = (draggable) => {\n switch (draggable) {\n case 'true':\n return true;\n case 'false':\n return false;\n default:\n return undefined;\n }\n};\nImg.style = IonImgStyle0;\n\nexport { Img as ion_img };\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,CAAC,IAAIC,gBAAgB,EAAEC,CAAC,IAAIC,WAAW,EAAEC,CAAC,EAAEC,CAAC,IAAIC,IAAI,EAAEC,CAAC,IAAIC,UAAU,QAAQ,qBAAqB;AAC5G,SAASJ,CAAC,IAAIK,iBAAiB,QAAQ,uBAAuB;AAC9D,SAASC,CAAC,IAAIC,UAAU,QAAQ,4BAA4B;AAE5D,MAAMC,MAAM,GAAG,oMAAoM;AACnN,MAAMC,YAAY,GAAGD,MAAM;AAE3B,MAAME,GAAG,GAAG,MAAM;EACdC,WAAWA,CAACC,OAAO,EAAE;IACjBf,gBAAgB,CAAC,IAAI,EAAEe,OAAO,CAAC;IAC/B,IAAI,CAACC,cAAc,GAAGd,WAAW,CAAC,IAAI,EAAE,gBAAgB,EAAE,CAAC,CAAC;IAC5D,IAAI,CAACe,aAAa,GAAGf,WAAW,CAAC,IAAI,EAAE,eAAe,EAAE,CAAC,CAAC;IAC1D,IAAI,CAACgB,QAAQ,GAAGhB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;IAChD,IAAI,CAACiB,mBAAmB,GAAG,CAAC,CAAC;IAC7B,IAAI,CAACC,MAAM,GAAG,MAAM;MAChB,IAAI,CAACH,aAAa,CAACI,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,CAACC,OAAO,GAAG,MAAM;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