{"version":3,"sources":["src/utils/utils.ts"],"names":["inheritAttributes","el","attributes","attributeObject","boolAttr","forEach","attr","hasAttribute","indexOf","value","getAttribute"],"mappings":"MAYaA,EAAoB,CAACC,EAAiBC,EAAuB,MACxE,MAAMC,EAAwC,GAE9C,MAAMC,EAAW,CACf,kBACA,sBACA,QACA,YACA,WACA,UACA,WACA,UACA,QACA,WACA,iBACA,SACA,QACA,YACA,OACA,WACA,QACA,WACA,aACA,OACA,cACA,WACA,WACA,WACA,WACA,aAGFF,EAAWG,SAASC,IAClB,GAAIL,EAAGM,aAAaD,GAAO,CACzB,GAAIF,EAASI,QAAQF,MAAW,EAAG,CACjC,MAAMG,EAAQR,EAAGS,aAAaJ,GAC9B,GAAIG,IAAU,KAAM,CAClBN,EAAgBG,GAAQL,EAAGS,aAAaJ,QAErC,CACLH,EAAgBG,GAAQ,UAK9B,OAAOH","sourcesContent":["// TODO copied from ionic-framework core/src/utils/helpers.ts\n/**\n * Elements inside of web components sometimes need to inherit global attributes\n * set on the host. For example, the inner input in `ion-input` should inherit\n * the `title` attribute that developers set directly on `ion-input`. This\n * helper function should be called in componentWillLoad and assigned to a variable\n * that is later used in the render function.\n *\n * This does not need to be reactive as changing attributes on the host element\n * does not trigger a re-render.\n */\n\nexport const inheritAttributes = (el: HTMLElement, attributes: string[] = []): { [k: string]: any } => {\n const attributeObject: { [k: string]: any } = {};\n\n const boolAttr = [\n 'allowfullscreen',\n 'allowpaymentrequest',\n 'async',\n 'autofocus',\n 'autoplay',\n 'checked',\n 'controls',\n 'default',\n 'defer',\n 'disabled',\n 'formnovalidate',\n 'hidden',\n 'ismap',\n 'itemscope',\n 'loop',\n 'multiple',\n 'muted',\n 'nomodule',\n 'novalidate',\n 'open',\n 'playsinline',\n 'readonly',\n 'required',\n 'reversed',\n 'selected',\n 'truespeed',\n ];\n\n attributes.forEach((attr) => {\n if (el.hasAttribute(attr)) {\n if (boolAttr.indexOf(attr) === -1) {\n const value = el.getAttribute(attr);\n if (value !== null) {\n attributeObject[attr] = el.getAttribute(attr);\n }\n } else {\n attributeObject[attr] = true;\n }\n }\n });\n\n return attributeObject;\n};\n"]}