PageSourceSearch

https://e-menessaptieka.lv/_nuxt/378c3ad.modern.js

js e-menessaptieka.lv collected 2026-10-04 13:24:22 UTC 17,878 bytes, 1 lines download raw bytes

1(window.webpackJsonp=window.webpackJsonp||[]).push([[38],{131:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ErrorHandling=void 0;const o=t(311);class s{static generateErrorResult(e){return{color:null,error:{message:e}}}static generateInputErrorMessage(e,r,t){const o=[`Input ${e} color string could not be parsed.`,`String received: ${r}.`];if(t){const e=`Expected format: ${t}.`;o.splice(1,0,e)}return o.join(" ")}static generateUnexpectedError(e){const r=`${o.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION}: \n${e.message}`;return s.generateErrorResult(r)}static hasError(e){return!!e.errorMessage}}r.ErrorHandling=s},219:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ColorTypes=void 0,function(e){e.HEX="hex",e.RGB="rgb",e.HSL="hsl",e.KEYWORD="keyword",e.FILTER="filter"}(r.ColorTypes||(r.ColorTypes={}))},311:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.MUST_INSTALL_PUPPETEER=r.DEFAULT_CONVERSION_ERROR_MESSAGE=r.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=r.UNEXPECTED_ERROR_MESSAGE_LINK=r.UNEXPECTED_ERROR_MESSAGE_PREFIX=void 0,r.UNEXPECTED_ERROR_MESSAGE_PREFIX="Unexpected error has occurred, please report this by using the following link: ",r.UNEXPECTED_ERROR_MESSAGE_LINK="https://github.com/OvidijusParsiunas/css-filter-converter/issues/new",r.UNEXPECTED_ERROR_MESSAGE_INTRODUCTION=r.UNEXPECTED_ERROR_MESSAGE_PREFIX+r.UNEXPECTED_ERROR_MESSAGE_LINK,r.DEFAULT_CONVERSION_ERROR_MESSAGE="Input value is invalid",r.MUST_INSTALL_PUPPETEER="To convert filter values to color in Node - you will first need to install 'puppeteer' by running: \n npm install puppeteer"},312:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ColorFormats=void 0,function(e){e.HEX="#ffffff or #fff",e.RGB="rgb([0-255], [0-255], [0-255]) or rgb([0-255], [0-255], [0-255], [0-1]) or rgb([0-100%], [0-100%], [0-100%]) or rgb([0-100%], [0-100%], [0-100%], [0-100%]) or [0-255], [0-255], [0-255] or [0-255] [0-255] [0-255]",e.HSL="hsl([0-360], [0-100], [0-100]) or hsl([0-360], [0-100%], [0-100%]) or [0-360], [0-100], [0-100] or [0-360] [0-100] [0-100]",e.FILTER="blur(), brightness(), contrast(), drop-shadow(), grayscale(), hue-rotate(), invert(), saturate(), sepia() with each parameter populated with %, px or deg where approriate e.g. contrast(101%)",e.KEYWORD="Generic color string. See the following link for all available colors: https://github.com/colorjs/color-name/blob/master/index.js"}(r.ColorFormats||(r.ColorFormats={}))},473:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0});const o=t(737),s=t(744);class n{static rgbToFilter(e,r){return o.ColorToFilter.rgbToFilter(e,r)}static hexToFilter(e,r){return o.ColorToFilter.hexToFilter(e,r)}static hslToFilter(e,r){return o.ColorToFilter.hslToFilter(e,r)}static keywordToFilter(e,r){return o.ColorToFilter.keywordToFilter(e,r)}static async filterToHex(e){return s.FilterToColor.filterToHex(e)}static async filterToRgb(e,r){return s.FilterToColor.filterToRgb(e,r)}static async filterToHsl(e,r){return s.FilterToColor.filterToHsl(e,r)}}r.default=n,e.exports=n},474:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.SheenUtil=void 0;class o{static parseSheenFromOptions(e){return!e||"boolean"!=typeof e.sheen||e.sheen}}r.SheenUtil=o,o.SHEEN_FILTER_PREFIX="brightness(0) saturate(100%)"},475:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RgbColor=void 0;r.RgbColor=class{constructor(e=[0,0,0]){this.r=this.clamp(e[0]),this.g=this.clamp(e[1]),this.b=this.clamp(e[2])}clamp(e){return e>255?e=255:e<0&&(e=0),e}setRgb(e,r,t){this.r=this.clamp(e),this.g=this.clamp(r),this.b=this.clamp(t)}multiply(e){const r=this.clamp(this.r*e[0]+this.g*e[1]+this.b*e[2]),t=this.clamp(this.r*e[3]+this.g*e[4]+this.b*e[5]),o=this.clamp(this.r*e[6]+this.g*e[7]+this.b*e[8]);this.r=r,this.g=t,this.b=o}hueRotate(e=0){e=e/180*Math.PI;const r=Math.sin(e),t=Math.cos(e);this.multiply([.213+.787*t-.213*r,.715-.715*t-.715*r,.072-.072*t+.928*r,.213-.213*t+.143*r,.715+.285*t+.14*r,.072-.072*t-.283*r,.213-.213*t-.787*r,.715-.715*t+.715*r,.072+.928*t+.072*r])}sepia(e=1){this.multiply([.393+.607*(1-e),.769-.769*(1-e),.189-.189*(1-e),.349-.349*(1-e),.686+.314*(1-e),.168-.168*(1-e),.272-.272*(1-e),.534-.534*(1-e),.131+.869*(1-e)])}saturate(e=1){this.multiply([.213+.787*e,.715-.715*e,.072-.072*e,.213-.213*e,.715+.285*e,.072-.072*e,.213-.213*e,.715-.715*e,.072+.928*e])}linear(e=1,r=0){this.r=this.clamp(this.r*e+255*r),this.g=this.clamp(this.g*e+255*r),this.b=this.clamp(this.b*e+255*r)}
1brightness(e=1){this.linear(e)}contrast(e=1){this.linear(e,-.5*e+.5)}invert(e=1){this.r=this.clamp(255*(e+this.r/255*(1-2*e))),this.g=this.clamp(255*(e+this.g/255*(1-2*e))),this.b=this.clamp(255*(e+this.b/255*(1-2*e)))}}},479:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FilterToHexShared=void 0;const o=t(131),s=t(312),n=t(219);r.FilterToHexShared=class{static generateInputErrorMessage(e){return o.ErrorHandling.generateInputErrorMessage(n.ColorTypes.FILTER,e,s.ColorFormats.FILTER)}static addSVGElementsToDOMAndValidateFilter(e,r=1){const t=function(){const e=document.createElement("div");return e.style.height=`${r}px`,e.style.width=`${r}px`,e.style.position="absolute",e.style.top="0px",e.style.left="0px",e}(),o=function(){const t="http://www.w3.org/2000/svg",o=document.createElementNS(t,"svg");o.style.height="inherit",o.style.width="inherit",o.style.float="left",o.style.filter=e;const s=document.createElementNS(t,"rect");return s.setAttributeNS(null,"width",r.toString()),s.setAttributeNS(null,"height",r.toString()),o.appendChild(s),o}();return""===o.style.filter?{errorMessage:"error indicator",svgContainerElement:t}:(t.appendChild(o),document.body.appendChild(t),{svgContainerElement:t})}static async getColorViaImageDataURL(e){const r=function(e){const r=document.createElement("canvas");return r.width=e.width,r.height=e.height,r.getContext("2d").drawImage(e,0,0,e.width,e.height),r}(await async function(){const r=new Image;return r.src=e,new Promise(e=>{setTimeout(()=>e(r))})}());return function(e){const r=function(e){const r=e.width;return e.getContext("2d").getImageData(0,0,r,r).data}(e);return`#${`000000${function(e,r,t){if(e>255||r>255||t>255)throw new Error("Invalid color component");return(e<<16|r<<8|t).toString(16)}(r[0],r[1],r[2])}`.slice(-6)}`}(r)}}},737:function(e,r,t){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ColorToFilter=void 0;const s=t(131),n=t(474),i=t(219),a=t(738),l=t(740),c=o(t(477));r.ColorToFilter=class{static rgbToFilter(e,r){return a.RgbToFilter.convert({colorString:e,validateAndParse:l.ColorParser.validateAndParseRgb,addSheen:n.SheenUtil.parseSheenFromOptions(r)})}static hexToFilter(e,r){return a.RgbToFilter.convert({colorString:e,validateAndParse:l.ColorParser.validateAndParseHex,convertToRgb:c.default.hex.rgb,addSheen:n.SheenUtil.parseSheenFromOptions(r)})}static hslToFilter(e,r){return a.RgbToFilter.convert({colorString:e,validateAndParse:l.ColorParser.validateAndParseHsl,convertToRgb:c.default.hsl.rgb,addSheen:n.SheenUtil.parseSheenFromOptions(r)})}static keywordToFilter(e,r){return a.RgbToFilter.convert({colorString:e,validateAndParse:l.ColorParser.validateAndParseKeyword,convertToRgb:c.default.keyword.rgb,conversionErrorMessage:s.ErrorHandling.generateInputErrorMessage(i.ColorTypes.KEYWORD,e),addSheen:n.SheenUtil.parseSheenFromOptions(r)})}}},738:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RgbToFilter=void 0;const o=t(131),s=t(311),n=t(739),i=t(475);class a{static generateConversionError(e){const r=e||s.DEFAULT_CONVERSION_ERROR_MESSAGE;return o.ErrorHandling.generateErrorResult(r)}static generateValidateAndParseError(e){return o.ErrorHandling.generateErrorResult(e)}static execute(e,r){const t=new i.RgbColor(e);return new n.RgbToFilterWorker(t,r).convert()}static convertToRGB(e,r){return e&&r?r(e):null}static convert(e){try{const{colorString:r,validateAndParse:t,convertToRgb:s,conversionErrorMessage:n,addSheen:i}=e,l=r.trim().toLocaleLowerCase(),c=(null==t?void 0:t(l))||{color:l};if(o.ErrorHandling.hasError(c))return a.generateValidateAndParseError(c.errorMessage);const u=a.convertToRGB(c.color,s)||c.color;return u?a.execute(u,i):a.generateConversionError(n)}catch(e){return o.ErrorHandling.generateUnexpectedError(e)}}}r.RgbToFilter=a},739:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.RgbToFilterWorker=void 0;const o=t(474),s=t(475);class n{constructor(e,r){this.targetRgbColor=e,this.reusedRgbColor=new s.RgbColor,this.addSheen=r}static fmt(e,r,t=1){return Math.round(e[r]*t)}generateCss(e){return`${this.addSheen?`${o.SheenUtil.SHEEN_FILTER_PREFIX} `:""}invert(${n.fmt(e,0)}%) sepia(${n.fmt(e,1)}%) saturate(${n.fmt(e,2)}%) hue-rotate(${n.fmt(e,3,3.6)}deg) brightness(${n.fmt(e,4)}%) contrast(${n.fmt(e,5)}%)`}loss(e){return this.reusedRgbColor.setRgb(0,0,0),this.reusedRgbColor.invert(e[0]/100),this.reusedRgbColor.sepia(e[1]/100),this.reusedRgbColor.saturate(e[2]/100),this.reusedRgbColor.hueRotate(3.6*e[3]),this.reusedRgbColor.brightness(e[4]/100),this.reusedRgbColor.contrast(e[5]/100),Math.abs(this.reusedRgbColor.r-this.targetRgbColor.r)+Math.abs(this.reusedRgbColor.g-this.targetRgbColor.g)+Math.abs(this.reusedRgbColor.b-this.targetRgbColor.b)}static fixSpsa(e,r){let t=100;return 2===r?t=7500:4!==r&&5!==r||(t=200),3===r?e>t?e%=t:e<0&&(e=t+e%t):e<0?e=0:e>t&&(e=t),e}spsa(e,r,t,o,s){let i=[],a=1/0;const l=new Array(6),c=new Array(6),u=new Array(6);for(let d=0;d<s;d+=1){const s=t/Math.pow(d+1,.16666666666666666);for(let e=0;e<6;e+=1)l[e]=Math.random()>.5?1:-1,c[e]=o[e]+s*l[e],u[e]=o[e]-s*l[e];const g=this.loss(c)-this.loss(u);for(let t=0;t<6;t+=1){const i=g/(2*s)*l[t],a=r[t]/Math.pow(e+d+1,1);o[t]=n.fixSpsa(o[t]-a*i,t)}const h=this.loss(o);h<a&&(i=o.slice(0),a=h)}return{values:i,loss:a}}solveNarrow(e){const r=e.loss,t=r+1,o=[.25*t,.25*t,t,.25*t,.2*t,.2*t];return this.spsa(r,o,2,e.values,500)}solveWide(){const e=[60,180,18e3,600,1.2,1.2];let r={values:[],loss:1/0};for(let t=0;r.loss>25&&t<3;t+=1){const t=[50,20,3750,50,100,100],o=this.spsa(5,e,15,t,1e3);
1o.loss<r.loss&&(r=o)}return r}convert(){const e=this.solveNarrow(this.solveWide());return{loss:e.loss,color:this.generateCss(e.values)}}}r.RgbToFilterWorker=n},740:function(e,r,t){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.ColorParser=void 0;const s=t(741),n=t(131),i=t(742),a=t(312),l=t(219),c=o(t(476));class u{static validateAndParseHex(e){if(e.length<i.MAX_COLOR_INPUT_STRING_LENGTH){if(e.match(s.MATCH_HEXADECIMAL))return{color:e}}return{errorMessage:n.ErrorHandling.generateInputErrorMessage(l.ColorTypes.HEX,e,a.ColorFormats.HEX)}}static parseFirstThreeIntegersFromString(e){if(e.length<i.MAX_COLOR_INPUT_STRING_LENGTH){const r=e.match(s.MATCH_INTEGER_AND_FLOAT_NUMBERS);if(s.MATCH_INTEGER_AND_FLOAT_NUMBERS.lastIndex=0,r&&r.length>=3)return r.slice(0,3).map(e=>Number.parseInt(e))}return null}static validateAndParseRgb(e){const r=u.parseFirstThreeIntegersFromString(e);return r&&r[0]>=0&&r[0]<=255&&r[1]>=0&&r[1]<=255&&r[2]>=0&&r[2]<=255?{color:r}:{errorMessage:n.ErrorHandling.generateInputErrorMessage(l.ColorTypes.RGB,e,a.ColorFormats.RGB)}}static validateAndParseHsl(e){const r=u.parseFirstThreeIntegersFromString(e);return r&&r[0]>=0&&r[0]<=360&&r[1]>=0&&r[1]<=100&&r[2]>=0&&r[2]<=100?{color:r}:{errorMessage:n.ErrorHandling.generateInputErrorMessage(l.ColorTypes.HSL,e,a.ColorFormats.HSL)}}static validateAndParseKeyword(e){if(e.length<i.MAX_COLOR_INPUT_STRING_LENGTH){if(c.default[e])return{color:e}}return{errorMessage:n.ErrorHandling.generateInputErrorMessage(l.ColorTypes.KEYWORD,e,a.ColorFormats.KEYWORD)}}}r.ColorParser=u},741:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.MATCH_HEXADECIMAL=r.MATCH_INTEGER_AND_FLOAT_NUMBERS=void 0,r.MATCH_INTEGER_AND_FLOAT_NUMBERS=/(-?\d+(?:\.\d+)?)/g,r.MATCH_HEXADECIMAL=/^#[0-9a-f]{3}([0-9a-f]{3})?$/i},742:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.MAX_COLOR_INPUT_STRING_LENGTH=void 0,r.MAX_COLOR_INPUT_STRING_LENGTH=25},744:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FilterToColor=void 0;const o=t(745),s=t(750);r.FilterToColor=class{static async filterToHex(e){const r=await o.FilterToHex.convert(e);return r.color&&(r.color=r.color.toUpperCase()),r}static async filterToRgb(e,r){return o.FilterToHex.convert(e,s.HexToColor.convertToRgb,r)}static async filterToHsl(e,r){return o.FilterToHex.convert(e,s.HexToColor.convertToHsl,r)}}},745:function(e,r,t){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var s=Object.getOwnPropertyDescriptor(r,t);s&&!("get"in s?!r.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,s)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),s=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&o(r,e,t);return s(r,e),r};Object.defineProperty(r,"__esModule",{value:!0}),r.FilterToHex=void 0;const i=t(131),a=t(746);r.FilterToHex=class{static async convert(e,r,o){try{let s;if("undefined"==typeof window){const{FilterToHexNode:r}=await Promise.resolve().then(()=>n(t(748)));s=await r.convert(e)}else s=await a.FilterToHexBrowser.convert(e);return s.color&&r&&"string"==typeof s.color&&(s.color=r(s.color,o)),s}catch(e){return i.ErrorHandling.generateUnexpectedError(e)}}}},746:function(e,r,t){"use strict";var o=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var s=Object.getOwnPropertyDescriptor(r,t);s&&!("get"in s?!r.__esModule:s.writable||s.configurable)||(s={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,s)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),s=this&&this.__setModuleDefault||(Object.create?function(e,r){Object.defineProperty(e,"default",{enumerable:!0,value:r})}:function(e,r){e.default=r}
1),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var t in e)"default"!==t&&Object.prototype.hasOwnProperty.call(e,t)&&o(r,e,t);return s(r,e),r};Object.defineProperty(r,"__esModule",{value:!0}),r.FilterToHexBrowser=void 0;const i=t(131),a=t(479);class l extends a.FilterToHexShared{static cleanup(e){e.remove()}static returnInputError(e,r){const t=a.FilterToHexShared.generateInputErrorMessage(e),o=i.ErrorHandling.generateErrorResult(t);return l.cleanup(r),o}static async getImageBase64ViaSVG(e){return(await Promise.resolve().then(()=>n(t(747)))).toPng(e)}static async convert(e){const{errorMessage:r,svgContainerElement:t}=a.FilterToHexShared.addSVGElementsToDOMAndValidateFilter(e);if(r)return l.returnInputError(e,t);const o=await l.getImageBase64ViaSVG(t),s=await a.FilterToHexShared.getColorViaImageDataURL(o);return l.cleanup(t),{color:s}}}r.FilterToHexBrowser=l},748:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.FilterToHexNode=void 0;const o=t(131),s=t(311),n=t(312),i=t(219),a=t(479);class l extends a.FilterToHexShared{static cleanup(e){l.IS_HEADLESS&&(null==e||e.close())}static returnError(e,r){const t=o.ErrorHandling.generateErrorResult(e);return l.cleanup(r),t}static async getImageBase64ViaSVG(e){const r=await e.screenshot({encoding:l.BASE_64_ENCODING});return`${l.ENCODED_DATA_URL_PREFIX}${r}`}static async openBrowserPage(e){const r=await e.newPage();return await r.setViewport({width:l.SVG_SIDE_LENGTH_PX,height:l.SVG_SIDE_LENGTH_PX}),r}static async addSVGAndValidateFilter(e,r){const t=await e.evaluate(a.FilterToHexShared.addSVGElementsToDOMAndValidateFilter,r,l.SVG_SIDE_LENGTH_PX);return t.errorMessage?{errorMessage:o.ErrorHandling.generateInputErrorMessage(i.ColorTypes.FILTER,r,n.ColorFormats.FILTER)}:t}static async getPuppeteerDependency(){try{const e="";return t(749)("puppeteer"+e)}catch(e){return{errorMessage:s.MUST_INSTALL_PUPPETEER}}}static async preparePuppeteerBrowser(){const e=await l.getPuppeteerDependency();return o.ErrorHandling.hasError(e)?e:e.launch({headless:l.IS_HEADLESS})}static async convert(e){const r=await l.preparePuppeteerBrowser();if(o.ErrorHandling.hasError(r))return l.returnError(r.errorMessage);const t=await l.openBrowserPage(r),s=await l.addSVGAndValidateFilter(t,e);if(o.ErrorHandling.hasError(s))return l.returnError(s.errorMessage,r);const n=await l.getImageBase64ViaSVG(t),i=await t.evaluate(a.FilterToHexShared.getColorViaImageDataURL,n);return l.cleanup(r),{color:i}}}r.FilterToHexNode=l,l.BASE_64_ENCODING="base64",l.ENCODED_DATA_URL_PREFIX=`data:image/png;${l.BASE_64_ENCODING},`,l.IS_HEADLESS=!0,l.SVG_SIDE_LENGTH_PX=2},750:function(e,r,t){"use strict";var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.HexToColor=void 0;const s=t(751),n=o(t(477));r.HexToColor=class{static convertToRgb(e,r){const t=n.default.hex.rgb(e);return"string"===(null==r?void 0:r.resultType)?s.ColorFormatter.arrayToRgbString(t):t}static convertToHsl(e,r){const t=n.default.hex.hsl(e);return"string"===(null==r?void 0:r.resultType)?s.ColorFormatter.arrayToHslString(t):t}}},751:function(e,r,t){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.ColorFormatter=void 0;r.ColorFormatter=class{static arrayToRgbString(e){return`rgb(${e[0]}, ${e[1]}, ${e[2]})`}static arrayToHslString(e){return`hsl(${e[0]}deg, ${e[1]}%, ${e[2]}%)`}}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.