1 line
11 KiB
JSON
1 line
11 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"value\", \"size\", \"level\", \"bgColor\", \"fgColor\", \"includeMargin\", \"minVersion\", \"title\", \"marginSize\", \"imageSettings\"];\nimport React from 'react';\nimport { DEFAULT_BACKGROUND_COLOR, DEFAULT_FRONT_COLOR, DEFAULT_NEED_MARGIN, DEFAULT_LEVEL, DEFAULT_MINVERSION, DEFAULT_SIZE, excavateModules, generatePath } from \"./utils\";\nimport { useQRCode } from \"./hooks/useQRCode\";\nvar QRCodeSVG = /*#__PURE__*/React.forwardRef(function QRCodeSVG(props, forwardedRef) {\n var value = props.value,\n _props$size = props.size,\n size = _props$size === void 0 ? DEFAULT_SIZE : _props$size,\n _props$level = props.level,\n level = _props$level === void 0 ? DEFAULT_LEVEL : _props$level,\n _props$bgColor = props.bgColor,\n bgColor = _props$bgColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _props$bgColor,\n _props$fgColor = props.fgColor,\n fgColor = _props$fgColor === void 0 ? DEFAULT_FRONT_COLOR : _props$fgColor,\n _props$includeMargin = props.includeMargin,\n includeMargin = _props$includeMargin === void 0 ? DEFAULT_NEED_MARGIN : _props$includeMargin,\n _props$minVersion = props.minVersion,\n minVersion = _props$minVersion === void 0 ? DEFAULT_MINVERSION : _props$minVersion,\n title = props.title,\n marginSize = props.marginSize,\n imageSettings = props.imageSettings,\n otherProps = _objectWithoutProperties(props, _excluded);\n var _useQRCode = useQRCode({\n value: value,\n level: level,\n minVersion: minVersion,\n includeMargin: includeMargin,\n marginSize: marginSize,\n imageSettings: imageSettings,\n size: size\n }),\n margin = _useQRCode.margin,\n cells = _useQRCode.cells,\n numCells = _useQRCode.numCells,\n calculatedImageSettings = _useQRCode.calculatedImageSettings;\n var cellsToDraw = cells;\n var image = null;\n if (imageSettings != null && calculatedImageSettings != null) {\n if (calculatedImageSettings.excavation != null) {\n cellsToDraw = excavateModules(cells, calculatedImageSettings.excavation);\n }\n image = /*#__PURE__*/React.createElement(\"image\", {\n href: imageSettings.src,\n height: calculatedImageSettings.h,\n width: calculatedImageSettings.w,\n x: calculatedImageSettings.x + margin,\n y: calculatedImageSettings.y + margin,\n preserveAspectRatio: \"none\",\n opacity: calculatedImageSettings.opacity\n // when crossOrigin is not set, the image will be tainted\n // and the canvas cannot be exported to an image\n ,\n\n crossOrigin: calculatedImageSettings.crossOrigin\n });\n }\n var fgPath = generatePath(cellsToDraw, margin);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n height: size,\n width: size,\n viewBox: \"0 0 \".concat(numCells, \" \").concat(numCells),\n ref: forwardedRef,\n role: \"img\"\n }, otherProps), !!title && /*#__PURE__*/React.createElement(\"title\", null, title), /*#__PURE__*/React.createElement(\"path\", {\n fill: bgColor,\n d: \"M0,0 h\".concat(numCells, \"v\").concat(numCells, \"H0z\"),\n shapeRendering: \"crispEdges\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n fill: fgColor,\n d: fgPath,\n shapeRendering: \"crispEdges\"\n }), image);\n});\nQRCodeSVG.displayName = 'QRCodeSVG';\nexport { QRCodeSVG };","map":{"version":3,"names":["_extends","_objectWithoutProperties","_excluded","React","DEFAULT_BACKGROUND_COLOR","DEFAULT_FRONT_COLOR","DEFAULT_NEED_MARGIN","DEFAULT_LEVEL","DEFAULT_MINVERSION","DEFAULT_SIZE","excavateModules","generatePath","useQRCode","QRCodeSVG","forwardRef","props","forwardedRef","value","_props$size","size","_props$level","level","_props$bgColor","bgColor","_props$fgColor","fgColor","_props$includeMargin","includeMargin","_props$minVersion","minVersion","title","marginSize","imageSettings","otherProps","_useQRCode","margin","cells","numCells","calculatedImageSettings","cellsToDraw","image","excavation","createElement","href","src","height","h","width","w","x","y","preserveAspectRatio","opacity","crossOrigin","fgPath","viewBox","concat","ref","role","fill","d","shapeRendering","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/@rc-component/qrcode/es/QRCodeSVG.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"value\", \"size\", \"level\", \"bgColor\", \"fgColor\", \"includeMargin\", \"minVersion\", \"title\", \"marginSize\", \"imageSettings\"];\nimport React from 'react';\nimport { DEFAULT_BACKGROUND_COLOR, DEFAULT_FRONT_COLOR, DEFAULT_NEED_MARGIN, DEFAULT_LEVEL, DEFAULT_MINVERSION, DEFAULT_SIZE, excavateModules, generatePath } from \"./utils\";\nimport { useQRCode } from \"./hooks/useQRCode\";\nvar QRCodeSVG = /*#__PURE__*/React.forwardRef(function QRCodeSVG(props, forwardedRef) {\n var value = props.value,\n _props$size = props.size,\n size = _props$size === void 0 ? DEFAULT_SIZE : _props$size,\n _props$level = props.level,\n level = _props$level === void 0 ? DEFAULT_LEVEL : _props$level,\n _props$bgColor = props.bgColor,\n bgColor = _props$bgColor === void 0 ? DEFAULT_BACKGROUND_COLOR : _props$bgColor,\n _props$fgColor = props.fgColor,\n fgColor = _props$fgColor === void 0 ? DEFAULT_FRONT_COLOR : _props$fgColor,\n _props$includeMargin = props.includeMargin,\n includeMargin = _props$includeMargin === void 0 ? DEFAULT_NEED_MARGIN : _props$includeMargin,\n _props$minVersion = props.minVersion,\n minVersion = _props$minVersion === void 0 ? DEFAULT_MINVERSION : _props$minVersion,\n title = props.title,\n marginSize = props.marginSize,\n imageSettings = props.imageSettings,\n otherProps = _objectWithoutProperties(props, _excluded);\n var _useQRCode = useQRCode({\n value: value,\n level: level,\n minVersion: minVersion,\n includeMargin: includeMargin,\n marginSize: marginSize,\n imageSettings: imageSettings,\n size: size\n }),\n margin = _useQRCode.margin,\n cells = _useQRCode.cells,\n numCells = _useQRCode.numCells,\n calculatedImageSettings = _useQRCode.calculatedImageSettings;\n var cellsToDraw = cells;\n var image = null;\n if (imageSettings != null && calculatedImageSettings != null) {\n if (calculatedImageSettings.excavation != null) {\n cellsToDraw = excavateModules(cells, calculatedImageSettings.excavation);\n }\n image = /*#__PURE__*/React.createElement(\"image\", {\n href: imageSettings.src,\n height: calculatedImageSettings.h,\n width: calculatedImageSettings.w,\n x: calculatedImageSettings.x + margin,\n y: calculatedImageSettings.y + margin,\n preserveAspectRatio: \"none\",\n opacity: calculatedImageSettings.opacity\n // when crossOrigin is not set, the image will be tainted\n // and the canvas cannot be exported to an image\n ,\n crossOrigin: calculatedImageSettings.crossOrigin\n });\n }\n var fgPath = generatePath(cellsToDraw, margin);\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n height: size,\n width: size,\n viewBox: \"0 0 \".concat(numCells, \" \").concat(numCells),\n ref: forwardedRef,\n role: \"img\"\n }, otherProps), !!title && /*#__PURE__*/React.createElement(\"title\", null, title), /*#__PURE__*/React.createElement(\"path\", {\n fill: bgColor,\n d: \"M0,0 h\".concat(numCells, \"v\").concat(numCells, \"H0z\"),\n shapeRendering: \"crispEdges\"\n }), /*#__PURE__*/React.createElement(\"path\", {\n fill: fgColor,\n d: fgPath,\n shapeRendering: \"crispEdges\"\n }), image);\n});\nQRCodeSVG.displayName = 'QRCodeSVG';\nexport { QRCodeSVG };"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC;AACvI,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,wBAAwB,EAAEC,mBAAmB,EAAEC,mBAAmB,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,eAAe,EAAEC,YAAY,QAAQ,SAAS;AAC5K,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,IAAIC,SAAS,GAAG,aAAaV,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