{"version":3,"sources":["jsdelivr-header.js","/npm/gl-react-color-blending@2.0.5/src/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,y6BCNA,OAAA,QAAA,S,uCACA,WAAA,QAAA,c,+CACA,SAAA,QAAA,YACA,SAAA,QAAA,a,y9BAEO,IAAM,8BAAa,OAAO,KAAP,UAAA,SACb,4DAEP,cAAgB,WAAW,QAAO,SAAC,EAAW,GAClD,IAAM,qBACH,EAAO,CACN,uCAOJ,UAAA,QAAY,GAIM,KAKlB,OAAO,OAAO,OAAO,GAAI,EAAW,EACrC,GAAE,IAEG,QAAU,SAAA,QAAQ,OAAO,eAEzB,c,yKAAsB,QAAA,QAAM,W,+CAMvB,IAAA,EACkD,KAAK,MAA5C,EADX,EACC,SAAe,EADhB,EACgB,MADhB,EAAA,EACuB,iBADvB,IAAA,EACmC,WADnC,EAEP,OACE,QAAA,QAAA,cAAA,SAAA,KAAA,CACE,OAAQ,QAAQ,GAChB,SAAU,CAAE,MAAK,UAGtB,K,KAdG,cACG,UAAY,CACjB,SAAU,YAAA,QAAU,IAAI,WACxB,MAAO,YAAA,QAAU,MACjB,UAAW,YAAA,QAAU,Q,gBAaV","file":"/npm/gl-react-color-blending@2.0.5/lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/gl-react-color-blending@2.0.5/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Shaders, Node, GLSL } from 'gl-react';\nimport shaderCodes from './shaders'\n\nexport const blendNames = Object.keys(shaderCodes);\nexport const blendShaderCodes = shaderCodes;\n\nconst shaderObjects = blendNames.reduce((processed, name) => {\n  const formatted = {\n    [name]: {\n      frag: GLSL`\nprecision highp float;\nvarying vec2 uv;\n\nuniform sampler2D tex;\nuniform vec4 color;\n\n${shaderCodes[name]}\n\nvoid main () {\n  vec4 baseColor = texture2D(tex, uv);\n  vec3 newColor = ${name}(baseColor.rgb, color.rgb, color.a);\n  gl_FragColor = vec4(newColor, 1.);\n}`\n    }\n  };\n  return Object.assign({}, processed, formatted);\n}, {});\n\nconst shaders = Shaders.create(shaderObjects);\n\nclass ColorBlending extends React.Component {\n  static propTypes = {\n    children: PropTypes.any.isRequired,\n    color: PropTypes.array,\n    blendMode: PropTypes.string,\n  };\n  render() {\n    const { children: tex, color, blendMode = 'blendAdd' } = this.props;\n    return (\n      <Node\n        shader={shaders[blendMode] }\n        uniforms={{ tex, color }}\n      />\n    );\n  }\n}\n\nexport default ColorBlending;"]}