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,MAArB,GAA+B,UAAQ,QAAR,GAAiB,GAAhD,GAAuD,KAArF;AACA,EA5BD;;AA8BA,SAAQ,iBAAR;AACA","file":"debug.js","sourcesContent":["/* eslint-disable no-console */\n\nif (process.env.NODE_ENV === 'development') {\n\tconst { options } = require('preact');\n\tconst oldVnodeOption = options.vnode;\n\n\toptions.vnode = function(vnode) {\n\t\tconst { nodeName, attributes, children } = vnode;\n\n\t\tif (nodeName === void 0) {\n\t\t\tconsole.error('Undefined component passed to preact.h()\\n'+serializeVNode(vnode));\n\t\t}\n\n\t\tif (\n\t\t\tattributes && attributes.ref !== void 0 &&\n\t\t\ttypeof attributes.ref !== 'function' &&\n\t\t\t!('$$typeof' in vnode) // allow string refs when preact-compat is installed\n\t\t) {\n\t\t\tthrow new Error(\n\t\t\t\t`Component's \"ref\" property should be a function,` +\n\t\t\t\t` but [${typeof attributes.ref}] passed\\n` + serializeVNode(vnode)\n\t\t\t);\n\t\t}\n\n\t\t{\n\t\t\tconst keys = {};\n\n\t\t\tinspectChildren(children, (deepChild) => {\n\t\t\t\tif (!deepChild || deepChild.key==null) return;\n\n\t\t\t\t// In Preact, all keys are stored as object values, i.e. being strings\n\t\t\t\tconst key = deepChild.key + '';\n\n\t\t\t\tif (keys.hasOwnProperty(key)) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t'Following component has two or more children with the ' +\n\t\t\t\t\t\t'same \"key\" attribute. This may cause glitches and misbehavior ' +\n\t\t\t\t\t\t'in rendering process. Component: \\n\\n' +\n\t\t\t\t\t\tserializeVNode(vnode)\n\t\t\t\t\t);\n\n\t\t\t\t\t// Return early to not spam the console\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tkeys[key] = true;\n\t\t\t});\n\t\t}\n\n\t\tif (oldVnodeOption) oldVnodeOption.call(this, vnode);\n\t};\n\n\tconst inspectChildren = (children, inspect) => {\n\t\tif (!Array.isArray(children)) {\n\t\t\tchildren = [children];\n\t\t}\n\t\treturn children.some((child, i) => {\n\t\t\tif (Array.isArray(child)) {\n\t\t\t\treturn inspectChildren(child, inspect);\n\t\t\t}\n\n\t\t\treturn inspect(child, i);\n\t\t});\n\t};\n\n\tconst serializeVNode = ({ nodeName, attributes, children }) => {\n\t\tif (typeof nodeName==='function') {\n\t\t\tnodeName = nodeName.name || nodeName.displayName;\n\t\t}\n\n\t\tlet props = '';\n\t\tif (attributes) {\n\t\t\tfor (let attr in attributes) {\n\t\t\t\tif (attributes.hasOwnProperty(attr) && attr!=='children') {\n\t\t\t\t\tlet value = attributes[attr];\n\n\t\t\t\t\t// If it is an object but doesn't have toString(), use Object.toString\n\t\t\t\t\tif (typeof value==='function') {\n\t\t\t\t\t\tvalue = `function ${value.displayName || value.name}() {}`;\n\t\t\t\t\t}\n\t\t\t\t\tif (Object(value) === value && !value.toString) {\n\t\t\t\t\t\tvalue = Object.prototype.toString.call(value);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tvalue = value + '';\n\t\t\t\t\t}\n\n\t\t\t\t\tprops += ` ${attr}=${JSON.stringify(value)}`;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn `<${nodeName}${props}${children && children.length ? ('>..</'+nodeName+'>') : ' />'}`;\n\t};\n\n\trequire('preact/devtools');\n}\n"]}
\No newline at end of file