@udixio/theme 1.0.0-beta.24 → 1.0.0-beta.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/theme.cjs.development.js +1 -1
- package/dist/theme.cjs.development.js.map +1 -1
- package/dist/theme.cjs.production.min.js +1 -1
- package/dist/theme.cjs.production.min.js.map +1 -1
- package/dist/theme.esm.js +1 -1
- package/dist/theme.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/plugins/tailwind/plugins-tailwind/themer.ts +4 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("awilix"),t=require("@material/material-color-utilities"),r=require("path"),n=require("node:fs"),o=require("tailwindcss/plugin"),i=function(){function e(e){var t=e.colorManagerService;this.colorManagerService=void 0,this.colorManagerService=t}var t=e.prototype;return t.getColors=function(){return this.colorManagerService.getAll()},t.addColor=function(e,t){return this.colorManagerService.createOrUpdate(e,t)},t.addColors=function(e){var t=this;Array.isArray(e)||(e=[e]),e.forEach((function(e){"function"==typeof e&&(e=e(t)),e.fromPalettes&&(Array.isArray(e.fromPalettes)||(e.fromPalettes=[e.fromPalettes]),e.fromPalettes.map((function(e){t.colorManagerService.addFromPalette(e)}))),e.colors&&Object.keys(e.colors).map((function(r){return t.addColor(r,e.colors[r])}))}))},t.getColor=function(e){return this.colorManagerService.get(e)},t.removeColor=function(e){return this.colorManagerService.remove(e)},t.updateColor=function(e,t){return this.colorManagerService.createOrUpdate(e,t)},e}();function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(null,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}var h,g=function(){function e(e,t,r,n){this.low=void 0,this.normal=void 0,this.medium=void 0,this.high=void 0,this.low=e,this.normal=t,this.medium=r,this.high=n}return e.prototype.get=function(e){return e<=-1?this.low:e<0?t.lerp(this.low,this.normal,(e- -1)/1):e<.5?t.lerp(this.normal,this.medium,(e-0)/.5):e<1?t.lerp(this.medium,this.high,(e-.5)/.5):this.high},e}(),d=function(){function e(e,t,r,n,o,i,a,s){if(this.name=void 0,this.palette=void 0,this.tone=void 0,this.isBackground=void 0,this.background=void 0,this.secondBackground=void 0,this.contrastCurve=void 0,this.toneDeltaPair=void 0,this.hctCache=new Map,this.name=e,this.palette=t,this.tone=r,this.isBackground=n,this.background=o,this.secondBackground=i,this.contrastCurve=a,this.toneDeltaPair=s,!o&&i)throw new Error("Color "+e+" has secondBackgrounddefined, but background is not defined.");if(!o&&a)throw new Error("Color "+e+" has contrastCurvedefined, but background is not defined.");if(o&&!a)throw new Error("Color "+e+" has backgrounddefined, but contrastCurve is not defined.")}e.fromPalette=function(t){var r,n;return new e(null!=(r=t.name)?r:"",t.palette,t.tone,null!=(n=t.isBackground)&&n,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)},e.foregroundTone=function(r,n){var o=t.Contrast.lighterUnsafe(r,n),i=t.Contrast.darkerUnsafe(r,n),a=t.Contrast.ratioOfTones(o,r),s=t.Contrast.ratioOfTones(i,r);if(e.tonePrefersLightForeground(r)){var u=Math.abs(a-s)<.1&&a<n&&s<n;return a>=n||a>=s||u?o:i}return s>=n||s>=a?i:o},e.tonePrefersLightForeground=function(e){return Math.round(e)<60},e.toneAllowsLightForeground=function(e){return Math.round(e)<=49},e.enableLightForeground=function(t){return e.tonePrefersLightForeground(t)&&!e.toneAllowsLightForeground(t)?49:t};var r=e.prototype;return r.getArgb=function(e){return this.getHct(e).toInt()},r.getHct=function(e){var t=this.hctCache.get(e);if(null!=t)return t;var r=this.getTone(e),n=this.palette(e).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n},r.getTone=function(r){var n=r.contrastLevel<0;if(this.toneDeltaPair){var o=this.toneDeltaPair(r),i=o.roleA,a=o.roleB,s=o.delta,u=o.polarity,c=o.stayTogether,l=this.background(r).getTone(r),f="nearer"===u||"lighter"===u&&!r.isDark||"darker"===u&&r.isDark,h=f?i:a,g=f?a:i,d=this.name===h.name,p=r.isDark?1:-1,v=h.contrastCurve.get(r.contrastLevel),m=g.contrastCurve.get(r.contrastLevel),y=h.tone(r),C=t.Contrast.ratioOfTones(l,y)>=v?y:e.foregroundTone(l,v),k=g.tone(r),S=t.Contrast.ratioOfTones(l,k)>=m?k:e.foregroundTone(l,m);return n&&(C=e.foregroundTone(l,v),S=e.foregroundTone(l,m)),(S-C)*p>=s||((S=t.clampDouble(0,100,C+s*p))-C)*p>=s||(C=t.clampDouble(0,100,S-s*p)),50<=C&&C<60?p>0?(C=60,S=Math.max(S,C+s*p)):(C=49,S=Math.min(S,C+s*p)):50<=S&&S<60&&(c?p>0?(C=60,S=Math.max(S,C+s*p)):(C=49,S=Math.min(S,C+s*p)):S=p>0?60:49),d?C:S}var b=this.tone(r);if(null==this.background)return b;var P=this.background(r).getTone(r),x=this.contrastCurve.get(r.contrastLevel);if(t.Contrast.ratioOfTones(P,b)>=x||(b=e.foregroundTone(P,x)),n&&(b=e.foregroundTone(P,x)),this.isBackground&&50<=b&&b<60&&(b=t.Contrast.ratioOfTones(49,P)>=x?49:60),this.secondBackground){var D=[this.background,this.secondBackground],w=D[1],F=[(0,D[0])(r).getTone(r),w(r).getTone(r)],H=F[0],T=F[1],O=[Math.max(H,T),Math.min(H,T)],M=O[0],E=O[1];if(t.Contrast.ratioOfTones(M,b)>=x&&t.Contrast.ratioOfTones(E,b)>=x)return b;var A=t.Contrast.lighter(M,x),B=t.Contrast.darker(E,x),j=[];return-1!==A&&j.push(A),-1!==B&&j.push(B),e.tonePrefersLightForeground(H)||e.tonePrefersLightForeground(T)?A<0?100:A:1===j.length?j[0]:B<0?0:B}return b},e}(),p=function(e,t,r,n,o){this.roleA=void 0,this.roleB=void 0,this.delta=void 0,this.polarity=void 0,this.stayTogether=void 0,this.roleA=e,this.roleB=t,this.delta=r,this.polarity=n,this.stayTogether=o},v=function(){function e(e,t,r){this.option=void 0,this.schemeService=void 0,this.colorService=void 0,this.dynamicColor=null,this.option=e,this.schemeService=t,this.colorService=r}var r=e.prototype;return r.update=function(e){this.dynamicColor=null,this.option=u({},this.option,e)},r.getHex=function(){return t.hexFromArgb(this.getArgb())},r.getArgb=function(){return this.getDynamicColor().getArgb(this.schemeService.get())},r.getRgb=function(){return{r:(e=this.getArgb())>>16&255,g:e>>8&255,b:255&e};var e},r.getName=function(){return this.option.name.replace(/([A-Z])/g,"_$1").toLowerCase()},r.getDynamicColor=function(){return this.dynamicColor||(this.dynamicColor=d.fromPalette(u({},this.option,{name:this.getName()}))),this.dynamicColor},e}(),m=function(e,t){return t instanceof i?e.isDark?t.getColor("surfaceBright").getDynamicColor():t.getColor("surfaceDim").getDynamicColor():e.isDark?t.get("surfaceBright").getDynamicColor():t.get("surfaceDim").getDynamicColor()},y=function(){function e(e){var t=e.schemeService;this.colorMap=new Map,this.schemeService=void 0,this.schemeService=t}var t=e.prototype;return t.createOrUpdate=function(e,t){var r=this.colorMap.get(e);if(r)r.update(u({},t,{name:e})),this.colorMap.set(e,r);else{var n=t.palette,o=t.tone;if(!n||!o)throw new Error("Palette "+e+" does not exist");r=new v(u({},t,{palette:n,tone:o,name:e}),this.schemeService,this),this.colorMap.set(e,r)}return r},t.remove=function(e){return this.colorMap.delete(e)},t.get=function(e){var t=this.colorMap.get(e);if(t)return t;throw new Error("Color "+e+" does not exist")},t.getAll=function(){return this.colorMap},t.addFromPalette=function(e){var t,r=this,n=e,o=(t=e).charAt(0).toUpperCase()+t.slice(1),i="on"+o,a=n+"Container",s="on"+o+"Container",u="inverse"+o,c=n+"Fixed",l=n+"FixedDim",f="on"+o+"Fixed",h="on"+o+"FixedVariant";this.createOrUpdate(n,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?80:40},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(3,4.5,7,11),toneDeltaPair:function(e){return new p(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(i,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?20:100},background:function(e){return r.get(n).getDynamicColor()},contrastCurve:new g(4.5,7,11,21)}),this.createOrUpdate(a,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?30:90},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(e){return new p(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(s,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?90:10},background:function(e){return r.get(a).getDynamicColor()},contrastCurve:new g(4.5,7,11,21)}),this.createOrUpdate(u,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?40:80},background:function(e){return r.get("inverseSurface").getDynamicColor()},contrastCurve:new g(3,4.5,7,11)}),this.createOrUpdate(c,{palette:function(t){return t.getPalette(e)},tone:function(e){return 90},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(e){return new p(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(l,{palette:function(t){return t.getPalette(e)},tone:function(e){return 80},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(e){return new p(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(f,{palette:function(t){return t.getPalette(e)},tone:function(e){return 10},background:function(e){return r.get(l).getDynamicColor()},secondBackground:function(e){return r.get(c).getDynamicColor()},contrastCurve:new g(4.5,7,11,21)}),this.createOrUpdate(h,{palette:function(t){return t.getPalette(e)},tone:function(e){return 30},background:function(e){return r.get(l).getDynamicColor()},secondBackground:function(e){return r.get(c).getDynamicColor()},contrastCurve:new g(3,4.5,7,11)})},e}(),C={colorManagerService:e.asClass(y).singleton(),colorService:e.asClass(i).singleton()},k=function(){function e(e){this.options=void 0,this.options=e}var r,n;return e.prototype.getPalette=function(e){if(!this.options)throw new Error("Scheme options is not set");var t=this.options.palettes.get(e);if(!t)throw new Error("Palette "+e+" not found");return t},r=e,(n=[{key:"contrastLevel",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.contrastLevel}},{key:"isDark",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.isDark}},{key:"sourceColorHct",get:function(){if(!this.options)throw new Error("Scheme options is not set");return t.Hct.fromInt(this.options.sourceColorArgb)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(),S=function(){function e(){this.schemeEntity=void 0,this.options=void 0}var r=e.prototype;return r.createOrUpdate=function(e){var r,n;this.options=u({},this.options,e,{sourcesColorHex:u({},null==(r=this.options)?void 0:r.sourcesColorHex,e.sourcesColorHex),palettes:u({},null==(n=this.options)?void 0:n.palettes,e.palettes)});var o=new Map;if(!this.options.sourcesColorHex.primary)throw new Error("Primary source color is not set");var i=t.argbFromHex(this.options.sourcesColorHex.primary),a=t.Hct.fromInt(i);if(this.options.palettes){for(var s=0,c=Object.entries(this.options.palettes);s<c.length;s++){var l=c[s],f=l[0],h=l[1],g=h.sourceColorkey,d=h.tonalPalette,p=void 0;if(g){var v=t.argbFromHex(this.options.sourcesColorHex[g]);p=d(t.Hct.fromInt(v))}else p=d(a);o.set(f,p)}this.schemeEntity=new k(u({},this.options,{palettes:o,sourceColorArgb:i}))}},r.get=function(){if(!this.schemeEntity)throw new Error("Scheme is not created");return this.schemeEntity},e}(),b=function(){function e(e){var t=e.schemeService,r=e.variantService;this.schemeService=void 0,this.variantService=void 0,this.schemeService=t,this.variantService=r}var t=e.prototype;return t.create=function(e){this.schemeService.createOrUpdate(u({},e,{sourcesColorHex:{primary:e.sourceColorHex}})),this.variantService.set(e.variant)},t.update=function(e){var t=u({},e);e.sourceColorHex&&(t.sourcesColorHex={primary:e.sourceColorHex}),this.schemeService.createOrUpdate(t),e.variant&&this.variantService.set(e.variant)},t.addCustomPalette=function(e,t){this.variantService.addCustomPalette(e,t)},e}(),P=function(){function e(e){var t=e.schemeService;this.customPalettes={},this.variantEntity=void 0,this.schemeService=void 0,this.schemeService=t}var r=e.prototype;return r.addCustomPalette=function(e,t){this.customPalettes[e]=t,this.update()},r.set=function(e){this.variantEntity=e,e.palettes.error||(e.palettes.error=function(){return t.TonalPalette.fromHueAndChroma(25,84)}),this.update()},r.update=function(){var e=this;if(this.variantEntity){var t={};Object.keys(this.variantEntity.palettes).forEach((function(r){t[r]={tonalPalette:e.variantEntity.palettes[r]}})),this.variantEntity.customPalettes&&Object.keys(this.customPalettes).forEach((function(r){t[r]={sourceColorkey:r,tonalPalette:e.variantEntity.customPalettes}})),this.schemeService.createOrUpdate({sourcesColorHex:this.customPalettes,palettes:t})}},e}(),x={schemeService:e.asClass(S).singleton(),variantService:e.asClass(P).singleton(),themeService:e.asClass(b).singleton()},D=function(e){var t=e.colorService,r=e.themeService,n=e.pluginService;this.colorService=void 0,this.themeService=void 0,this.pluginService=void 0,this.pluginService=n,this.colorService=t,this.themeService=r},w={appService:e.asClass(D).singleton()},F=function(e){return{fromPalettes:["primary","secondary","tertiary"],colors:{background:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?6:98},isBackground:!0},onBackground:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?90:10},background:function(t){return e.getColor("background").getDynamicColor()},contrastCurve:new g(3,3,4.5,7)},surface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?6:98},isBackground:!0},surfaceDim:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?6:87},isBackground:!0},surfaceBright:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?24:98},isBackground:!0},surfaceContainerLowest:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?4:100},isBackground:!0},surfaceContainerLow:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?10:96},isBackground:!0},surfaceContainer:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?12:94},isBackground:!0},surfaceContainerHigh:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?17:92},isBackground:!0},surfaceContainerHighest:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?22:90},isBackground:!0},onSurface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?90:10},background:function(t){return m(t,e)},contrastCurve:new g(4.5,7,11,21)},surfaceVariant:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?30:90},isBackground:!0},onSurfaceVariant:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?80:30},background:function(t){return m(t,e)},contrastCurve:new g(3,4.5,7,11)},inverseSurface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?90:20}},inverseOnSurface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?20:95},background:function(t){return e.getColor("inverseSurface").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},outline:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?60:50},background:function(t){return m(t,e)},contrastCurve:new g(1.5,3,4.5,7)},outlineVariant:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?30:80},background:function(t){return m(t,e)},contrastCurve:new g(1,1,3,7)},shadow:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return 0}},scrim:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return 0}},surfaceTint:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?80:40},isBackground:!0},secondaryContainer:{tone:function(e){var r=e.isDark?30:90;return function(e,r,n,o){var i=n,a=t.Hct.from(e,r,n);if(a.chroma<r)for(var s=a.chroma;a.chroma<r;){var u=t.Hct.from(e,r,i+=o?-1:1);if(s>u.chroma)break;if(Math.abs(u.chroma-r)<.4)break;Math.abs(u.chroma-r)<Math.abs(a.chroma-r)&&(a=u),s=Math.max(s,u.chroma)}return i}(e.getPalette("secondary").hue,e.getPalette("secondary").chroma,r,!e.isDark)}},onSecondaryContainer:{tone:function(t){return d.foregroundTone(e.getColor("secondaryContainer").getDynamicColor().tone(t),4.5)}},tertiaryContainer:{palette:function(e){return e.getPalette("tertiary")},tone:function(e){var r=e.getPalette("tertiary").getHct(e.sourceColorHct.tone);return t.DislikeAnalyzer.fixIfDisliked(r).tone}},onTertiaryContainer:{palette:function(e){return e.getPalette("tertiary")},tone:function(t){return d.foregroundTone(e.getColor("tertiaryContainer").getDynamicColor().tone(t),4.5)}},error:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?80:40},isBackground:!0,background:function(t){return m(t,e)},contrastCurve:new g(3,4.5,7,11),toneDeltaPair:function(t){return new p(e.getColor("errorContainer").getDynamicColor(),e.getColor("error").getDynamicColor(),15,"nearer",!1)}},onError:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?20:100},background:function(t){return e.getColor("error").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},errorContainer:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?30:90},isBackground:!0,background:function(t){return m(t,e)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(t){return new p(e.getColor("errorContainer").getDynamicColor(),e.getColor("error").getDynamicColor(),15,"nearer",!1)}},onErrorContainer:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?90:10},background:function(t){return e.getColor("errorContainer").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},onTertiaryFixed:{palette:function(e){return e.getPalette("tertiary")},tone:function(e){return 10},background:function(t){return e.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(t){return e.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},onTertiaryFixedVariant:{palette:function(e){return e.getPalette("tertiary")},tone:function(e){return 30},background:function(t){return e.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(t){return e.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new g(3,4.5,7,11)}}}},H=function(e,r,n){var o=e.hue;if(r.length!==n.length)throw new Error("mismatch between hue length "+r.length+" & rotations "+n.length);if(1===n.length)return t.sanitizeDegreesDouble(e.hue+n[0]);for(var i=r.length,a=0;a<=i-2;a++)if(r[a]<o&&o<r[a+1])return t.sanitizeDegreesDouble(o+n[a]);return o},T=function(){};h=T,T.tonalSpot={palettes:{primary:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,36)},secondary:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,16)},tertiary:function(e){return t.TonalPalette.fromHueAndChroma(t.sanitizeDegreesDouble(e.hue+60),24)},neutral:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,6)},neutralVariant:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,8)}},customPalettes:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,16)}},T.vibrant={palettes:{primary:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,200)},secondary:function(e){return t.TonalPalette.fromHueAndChroma(H(e,h.hues,h.secondaryRotations),24)},tertiary:function(e){return t.TonalPalette.fromHueAndChroma(H(e,h.hues,h.tertiaryRotations),32)},neutral:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,6)},neutralVariant:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,8)}},customPalettes:function(e){return t.TonalPalette.fromHueAndChroma(H(e,h.hues,h.secondaryRotations),24)}},T.hues=[0,41,61,101,131,181,251,301,360],T.secondaryRotations=[18,15,10,12,15,18,15,12,12],T.tertiaryRotations=[35,30,20,25,30,35,30,25,25];var O=function(){function e(e){var t=e.appService;this.configPath="./theme.config",this.appService=void 0,this.appService=t}var t=e.prototype;return t.loadConfig=function(e){var t=this.appService,r=t.themeService,n=t.colorService,o=t.pluginService,i=null!=e?e:this.getConfig(),a=i.contrastLevel,s=i.isDark,u=i.variant,c=i.palettes,l=i.colors,f=i.useDefaultColors,h=void 0===f||f,g=i.plugins;r.create({contrastLevel:void 0===a?0:a,isDark:void 0!==s&&s,sourceColorHex:i.sourceColor,variant:void 0===u?T.tonalSpot:u}),c&&Object.entries(c).forEach((function(e){return r.addCustomPalette(e[0],e[1])})),h&&n.addColors(F),l&&n.addColors(l),g&&(g.forEach((function(e){Array.isArray(e)?o.addPlugin(e[0],e[1]):o.addPlugin(e,{})})),o.loadPlugins(this.appService))},t.getConfig=function(){for(var e=r.resolve(this.configPath),t=null,o=0,i=[".js",".ts",".jms",".jcs"];o<i.length;o++){var a=e+i[o];if(n.existsSync(a)){t=require(a);break}}if(!t)throw new Error("Configuration file not found");return"default"in t?t.default:t},e}(),M={configService:e.asClass(O).singleton()},E=function(){function e(){this.pluginInstances=new Map,this.pluginConstructors=new Map}var t=e.prototype;return t.addPlugin=function(e,t){this.pluginConstructors.set(e.name,[e,t])},t.loadPlugins=function(e){var t=this,r=new Map(this.pluginConstructors),n=0;do{n=r.size,r.forEach((function(n,o){var i=n[0],a=n[1];0===i.dependencies.filter((function(e){return!t.pluginInstances.has(e.name)})).length&&(t.pluginInstances.set(i.name,new i(e,a)),r.delete(o))}))}while(0!=r.size&&r.size<n);r.size>0&&console.log("Some plugins couldn't be loaded due to missing dependencies: ",Array.from(r.keys()))},t.getPlugin=function(e){var t=this.pluginInstances.get(e.name);if(!t)throw new Error("Plugin "+e.name+" not found");return t},e}(),A={pluginService:e.asClass(E).singleton()};function B(e,t){return t.forEach((function(t){Object.entries(t).forEach((function(t){e.register(t[0],t[1])}))})),e}var j=e.createContainer({injectionMode:e.InjectionMode.PROXY});function z(e){var t=j.resolve("configService");return null!=e&&e.path&&(t.configPath=e.path),t.loadConfig(null==e?void 0:e.config),j.resolve("appService")}B(j,[M,w,A,C,x]);var L,U=function(){};U.dependencies=[],exports.FontFamily=void 0,(L=exports.FontFamily||(exports.FontFamily={})).Expressive="expressive",L.Neutral="neutral";var W=function(e){function t(t,r){var n,o,i,a,s;return(s=e.call(this)||this).appService=void 0,s.options=void 0,s.fontFamily=void 0,s.fontStyles=void 0,s.appService=t,s.options=r,s.fontFamily={expressive:null!=(n=null==r||null==(o=r.fontFamily)?void 0:o.expressive)?n:["Roboto","sans-serif"],neutral:null!=(i=null==r||null==(a=r.fontFamily)?void 0:a.neutral)?i:["Roboto","sans-serif"]},s.fontStyles={display:{large:{fontWeight:400,fontSize:3.5625,lineHeight:4,letterSpacing:-.015625,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:2.8125,lineHeight:3.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:2.25,lineHeight:2.75,fontFamily:exports.FontFamily.Expressive}},headline:{large:{fontWeight:400,fontSize:2,lineHeight:2.5,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:1.75,lineHeight:2.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:1.5,lineHeight:2,fontFamily:exports.FontFamily.Expressive}},title:{large:{fontWeight:400,fontSize:1.375,lineHeight:1.75,fontFamily:exports.FontFamily.Neutral},medium:{fontWeight:500,fontSize:1,lineHeight:1.5,fontFamily:exports.FontFamily.Neutral,letterSpacing:.009375},small:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625}},label:{large:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625},medium:{fontWeight:500,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},small:{fontWeight:500,fontSize:.6875,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125}},body:{large:{fontWeight:400,fontSize:1,lineHeight:1.5625,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},medium:{fontWeight:400,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.015625},small:{fontWeight:400,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.025}}},r&&r.fontStyles&&Object.entries(r.fontStyles).forEach((function(e){var t=e[0];Object.entries(e[1]).forEach((function(e){var r=e[0],n=e[1];n&&(s.fontStyles[t][r]=u({},s.fontStyles[t][r],n))}))})),s}return c(t,e),t.config=function(e){return e},t.prototype.getFonts=function(){return{fontStyles:this.fontStyles,fontFamily:this.fontFamily}},t}(U),I=function(e){return o((function(t){V(t,{statePrefix:"state",disabledStyles:{textOpacity:.38,backgroundOpacity:.12},transition:{duration:150}},e)}),{})},V=function(e,t,r){for(var n=e.addComponents,o=t.statePrefix,i=t.disabledStyles,a=t.transition,u={},c=0,l=[!1,!0];c<l.length;c++)for(var f,h=l[c]?"group-":"",g=s(r);!(f=g()).done;){var d,p=f.value,v="."+h+o+"-"+p;u[v]=((d={})["@apply "+h+"hover:bg-"+p+"/[0.08]"]={},d["@apply "+h+"active:bg-"+p+"/[0.12]"]={},d["@apply "+h+"focus-visible:bg-"+p+"/[0.12]"]={},d),a&&(u[v]["@apply transition-colors"]={},u[v]["@apply duration-"+a.duration]={}),i&&(u[v]["@apply "+h+"disabled:text-on-surface/["+i.textOpacity+"]"]={},u[v]["@apply "+h+"disabled:bg-on-surface/["+i.backgroundOpacity+"]"]={})}for(var m,y=s(r);!(m=y()).done;)for(var C=m.value,k=0,S=["hover","active","focus","disabled"];k<S.length;k++){var b,P=S[k],x="."+P+"-"+o+"-"+C;if("active"===P||"focus"===P)u[x]=((b={})["@apply bg-"+C+"/[0.12]"]={},b);else if("hover"===P){var D;u[x]=((D={})["@apply bg-"+C+"/[0.08]"]={},D)}else if("disabled"===P){var w,F;u[x]=((w={})["@apply text-on-surface/["+i.textOpacity+"]"]={},w),u[x]=((F={})["@apply bg-on-surface/["+i.backgroundOpacity+"]"]={},F)}}n(u)};function N(e){var t=e.name,r=e.isDarkTheme;return{name:r?t+"Dark":t,selectors:r&&"class"===e.darkMode?[".dark-mode .theme-"+t,".dark-mode.theme-"+t,'[data-theme="dark"] .theme-'+t,'[data-theme="dark"].theme-'+t]:[".theme-"+t],mediaQuery:"@media (prefers-color-scheme: dark)",extend:{colors:e.colors}}}var R=function(e){var t=e.appService,r=t.themeService,n=t.colorService,o={defaultTheme:{extend:{colors:{}}},themes:[{name:"darkTheme",extend:{colors:{}}}]};return Object.entries(e.colors).forEach((function(e){var t=e[0],r=e[1];o.defaultTheme.extend.colors[t]=r.light,o.themes[0].extend.colors[t]=r.dark})),o.themes[0].selectors="class"===e.darkMode?[".dark-mode",'[data-theme="dark"]']:void 0,o.themes[0].mediaQuery="media"===e.darkMode?"@media (prefers-color-scheme: dark)":void 0,e.subThemes&&Object.entries(e.subThemes).forEach((function(t){var i=t[0];r.update({sourceColorHex:t[1]});for(var a=0,u=[!0,!1];a<u.length;a++){var c=u[a],l={};r.update({isDark:c});for(var f,h=s(n.getColors().entries());!(f=h()).done;){var g=f.value,d=g[1];l[g[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()]=d.getHex()}o.themes.push(N({name:i,isDarkTheme:c,darkMode:e.darkMode,colors:l}))}})),require("tailwindcss-themer")(o)},q=function(e,t){return o((function(r){(0,r.addUtilities)(function(r){for(var n=r.theme,o="rem",i={},a=function(e){return{fontSize:e.fontSize+o,fontWeight:e.fontWeight,lineHeight:e.lineHeight+o,letterSpacing:e.letterSpacing?e.letterSpacing+o:null,fontFamily:n("fontFamily."+e.fontFamily)}},s=function(e,t,r){var i;return(i={})["@media (min-width: "+n("screens."+t,{})+")"]={fontSize:e.fontSize*r+o,lineHeight:e.lineHeight*r+o},i},c=0,l=Object.entries(e);c<l.length;c++)for(var f=l[c],h=f[0],g=function(){var e=p[d],r=e[1];i[".text-"+h+"-"+e[0]]=u({},a(r),Object.entries(t).reduce((function(e,t){return u({},e,s(r,t[0],t[1]))}),{}))},d=0,p=Object.entries(f[1]);d<p.length;d++)g();return i}({theme:r.theme}))}))},_=function(e){function t(t,r){var n;return null!=r.darkMode||(r.darkMode="class"),null!=r.responsiveBreakPoints||(r.responsiveBreakPoints={lg:1.125}),(n=e.call(this)||this).appService=void 0,n.options=void 0,n.appService=t,n.options=r,n}return c(t,e),t.config=function(e){return e},t.prototype.getTheme=function(){for(var e={},t=0,r=[!1,!0];t<r.length;t++){var n=r[t];this.appService.themeService.update({isDark:n});for(var o,i=s(this.appService.colorService.getColors().entries());!(o=i()).done;){var a=o.value,u=a[1],c=a[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();null!=e[c]||(e[c]={light:"",dark:""}),e[c][n?"dark":"light"]=u.getHex()}}var l=this.appService.pluginService.getPlugin(W).getFonts(),f=l.fontStyles;return{colors:{},fontFamily:l.fontFamily,plugins:[I(Object.keys(e)),q(f,this.options.responsiveBreakPoints),R({colors:e,darkMode:this.options.darkMode,subThemes:this.options.subThemes,appService:this.appService})]}},t}(U);_.dependencies=[W],exports.AppContainer=j,exports.AppModule=w,exports.AppService=D,exports.ColorEntity=v,exports.ColorManagerService=y,exports.ColorModule=C,exports.ColorService=i,exports.ConfigModule=M,exports.ConfigService=O,exports.ContrastCurve=g,exports.DynamicColor=d,exports.FontPlugin=W,exports.PluginAbstract=U,exports.PluginModule=A,exports.PluginService=E,exports.SchemeEntity=k,exports.SchemeService=S,exports.TailwindPlugin=_,exports.ThemeModule=x,exports.ThemeService=b,exports.ToneDeltaPair=p,exports.VariantEntity=function(e,t){void 0===e&&(e={}),this.palettes=void 0,this.customPalettes=void 0,this.palettes=e,this.customPalettes=t},exports.VariantModel=T,exports.VariantService=P,exports.bootstrap=function(){return j.resolve("appService")},exports.bootstrapFromConfig=z,exports.createTheme=function(){var e=z(),t=e.pluginService.getPlugin(_);if(!t)throw new Error("Tailwind plugin not found");return u({},t.getTheme(),{appService:e})},exports.defaultColors=F,exports.defineConfig=function(e){if(!e||"object"!=typeof e)throw new Error("The configuration is missing or not an object");if(!("sourceColor"in e))throw new Error("Invalid configuration");return e},exports.getRotatedHue=H,exports.highestSurface=m,exports.importContainer=B,exports.state=I,exports.themer=R;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("awilix"),t=require("@material/material-color-utilities"),r=require("path"),n=require("node:fs"),o=require("tailwindcss/plugin"),i=function(){function e(e){var t=e.colorManagerService;this.colorManagerService=void 0,this.colorManagerService=t}var t=e.prototype;return t.getColors=function(){return this.colorManagerService.getAll()},t.addColor=function(e,t){return this.colorManagerService.createOrUpdate(e,t)},t.addColors=function(e){var t=this;Array.isArray(e)||(e=[e]),e.forEach((function(e){"function"==typeof e&&(e=e(t)),e.fromPalettes&&(Array.isArray(e.fromPalettes)||(e.fromPalettes=[e.fromPalettes]),e.fromPalettes.map((function(e){t.colorManagerService.addFromPalette(e)}))),e.colors&&Object.keys(e.colors).map((function(r){return t.addColor(r,e.colors[r])}))}))},t.getColor=function(e){return this.colorManagerService.get(e)},t.removeColor=function(e){return this.colorManagerService.remove(e)},t.updateColor=function(e,t){return this.colorManagerService.createOrUpdate(e,t)},e}();function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(null,arguments)}function c(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,l(e,t)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function f(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}var h,g=function(){function e(e,t,r,n){this.low=void 0,this.normal=void 0,this.medium=void 0,this.high=void 0,this.low=e,this.normal=t,this.medium=r,this.high=n}return e.prototype.get=function(e){return e<=-1?this.low:e<0?t.lerp(this.low,this.normal,(e- -1)/1):e<.5?t.lerp(this.normal,this.medium,(e-0)/.5):e<1?t.lerp(this.medium,this.high,(e-.5)/.5):this.high},e}(),d=function(){function e(e,t,r,n,o,i,a,s){if(this.name=void 0,this.palette=void 0,this.tone=void 0,this.isBackground=void 0,this.background=void 0,this.secondBackground=void 0,this.contrastCurve=void 0,this.toneDeltaPair=void 0,this.hctCache=new Map,this.name=e,this.palette=t,this.tone=r,this.isBackground=n,this.background=o,this.secondBackground=i,this.contrastCurve=a,this.toneDeltaPair=s,!o&&i)throw new Error("Color "+e+" has secondBackgrounddefined, but background is not defined.");if(!o&&a)throw new Error("Color "+e+" has contrastCurvedefined, but background is not defined.");if(o&&!a)throw new Error("Color "+e+" has backgrounddefined, but contrastCurve is not defined.")}e.fromPalette=function(t){var r,n;return new e(null!=(r=t.name)?r:"",t.palette,t.tone,null!=(n=t.isBackground)&&n,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)},e.foregroundTone=function(r,n){var o=t.Contrast.lighterUnsafe(r,n),i=t.Contrast.darkerUnsafe(r,n),a=t.Contrast.ratioOfTones(o,r),s=t.Contrast.ratioOfTones(i,r);if(e.tonePrefersLightForeground(r)){var u=Math.abs(a-s)<.1&&a<n&&s<n;return a>=n||a>=s||u?o:i}return s>=n||s>=a?i:o},e.tonePrefersLightForeground=function(e){return Math.round(e)<60},e.toneAllowsLightForeground=function(e){return Math.round(e)<=49},e.enableLightForeground=function(t){return e.tonePrefersLightForeground(t)&&!e.toneAllowsLightForeground(t)?49:t};var r=e.prototype;return r.getArgb=function(e){return this.getHct(e).toInt()},r.getHct=function(e){var t=this.hctCache.get(e);if(null!=t)return t;var r=this.getTone(e),n=this.palette(e).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n},r.getTone=function(r){var n=r.contrastLevel<0;if(this.toneDeltaPair){var o=this.toneDeltaPair(r),i=o.roleA,a=o.roleB,s=o.delta,u=o.polarity,c=o.stayTogether,l=this.background(r).getTone(r),f="nearer"===u||"lighter"===u&&!r.isDark||"darker"===u&&r.isDark,h=f?i:a,g=f?a:i,d=this.name===h.name,p=r.isDark?1:-1,v=h.contrastCurve.get(r.contrastLevel),m=g.contrastCurve.get(r.contrastLevel),y=h.tone(r),C=t.Contrast.ratioOfTones(l,y)>=v?y:e.foregroundTone(l,v),k=g.tone(r),S=t.Contrast.ratioOfTones(l,k)>=m?k:e.foregroundTone(l,m);return n&&(C=e.foregroundTone(l,v),S=e.foregroundTone(l,m)),(S-C)*p>=s||((S=t.clampDouble(0,100,C+s*p))-C)*p>=s||(C=t.clampDouble(0,100,S-s*p)),50<=C&&C<60?p>0?(C=60,S=Math.max(S,C+s*p)):(C=49,S=Math.min(S,C+s*p)):50<=S&&S<60&&(c?p>0?(C=60,S=Math.max(S,C+s*p)):(C=49,S=Math.min(S,C+s*p)):S=p>0?60:49),d?C:S}var b=this.tone(r);if(null==this.background)return b;var P=this.background(r).getTone(r),x=this.contrastCurve.get(r.contrastLevel);if(t.Contrast.ratioOfTones(P,b)>=x||(b=e.foregroundTone(P,x)),n&&(b=e.foregroundTone(P,x)),this.isBackground&&50<=b&&b<60&&(b=t.Contrast.ratioOfTones(49,P)>=x?49:60),this.secondBackground){var D=[this.background,this.secondBackground],w=D[1],F=[(0,D[0])(r).getTone(r),w(r).getTone(r)],H=F[0],T=F[1],O=[Math.max(H,T),Math.min(H,T)],M=O[0],E=O[1];if(t.Contrast.ratioOfTones(M,b)>=x&&t.Contrast.ratioOfTones(E,b)>=x)return b;var A=t.Contrast.lighter(M,x),B=t.Contrast.darker(E,x),j=[];return-1!==A&&j.push(A),-1!==B&&j.push(B),e.tonePrefersLightForeground(H)||e.tonePrefersLightForeground(T)?A<0?100:A:1===j.length?j[0]:B<0?0:B}return b},e}(),p=function(e,t,r,n,o){this.roleA=void 0,this.roleB=void 0,this.delta=void 0,this.polarity=void 0,this.stayTogether=void 0,this.roleA=e,this.roleB=t,this.delta=r,this.polarity=n,this.stayTogether=o},v=function(){function e(e,t,r){this.option=void 0,this.schemeService=void 0,this.colorService=void 0,this.dynamicColor=null,this.option=e,this.schemeService=t,this.colorService=r}var r=e.prototype;return r.update=function(e){this.dynamicColor=null,this.option=u({},this.option,e)},r.getHex=function(){return t.hexFromArgb(this.getArgb())},r.getArgb=function(){return this.getDynamicColor().getArgb(this.schemeService.get())},r.getRgb=function(){return{r:(e=this.getArgb())>>16&255,g:e>>8&255,b:255&e};var e},r.getName=function(){return this.option.name.replace(/([A-Z])/g,"_$1").toLowerCase()},r.getDynamicColor=function(){return this.dynamicColor||(this.dynamicColor=d.fromPalette(u({},this.option,{name:this.getName()}))),this.dynamicColor},e}(),m=function(e,t){return t instanceof i?e.isDark?t.getColor("surfaceBright").getDynamicColor():t.getColor("surfaceDim").getDynamicColor():e.isDark?t.get("surfaceBright").getDynamicColor():t.get("surfaceDim").getDynamicColor()},y=function(){function e(e){var t=e.schemeService;this.colorMap=new Map,this.schemeService=void 0,this.schemeService=t}var t=e.prototype;return t.createOrUpdate=function(e,t){var r=this.colorMap.get(e);if(r)r.update(u({},t,{name:e})),this.colorMap.set(e,r);else{var n=t.palette,o=t.tone;if(!n||!o)throw new Error("Palette "+e+" does not exist");r=new v(u({},t,{palette:n,tone:o,name:e}),this.schemeService,this),this.colorMap.set(e,r)}return r},t.remove=function(e){return this.colorMap.delete(e)},t.get=function(e){var t=this.colorMap.get(e);if(t)return t;throw new Error("Color "+e+" does not exist")},t.getAll=function(){return this.colorMap},t.addFromPalette=function(e){var t,r=this,n=e,o=(t=e).charAt(0).toUpperCase()+t.slice(1),i="on"+o,a=n+"Container",s="on"+o+"Container",u="inverse"+o,c=n+"Fixed",l=n+"FixedDim",f="on"+o+"Fixed",h="on"+o+"FixedVariant";this.createOrUpdate(n,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?80:40},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(3,4.5,7,11),toneDeltaPair:function(e){return new p(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(i,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?20:100},background:function(e){return r.get(n).getDynamicColor()},contrastCurve:new g(4.5,7,11,21)}),this.createOrUpdate(a,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?30:90},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(e){return new p(r.get(a).getDynamicColor(),r.get(n).getDynamicColor(),10,"nearer",!1)}}),this.createOrUpdate(s,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?90:10},background:function(e){return r.get(a).getDynamicColor()},contrastCurve:new g(4.5,7,11,21)}),this.createOrUpdate(u,{palette:function(t){return t.getPalette(e)},tone:function(e){return e.isDark?40:80},background:function(e){return r.get("inverseSurface").getDynamicColor()},contrastCurve:new g(3,4.5,7,11)}),this.createOrUpdate(c,{palette:function(t){return t.getPalette(e)},tone:function(e){return 90},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(e){return new p(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(l,{palette:function(t){return t.getPalette(e)},tone:function(e){return 80},isBackground:!0,background:function(e){return m(e,r)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(e){return new p(r.get(c).getDynamicColor(),r.get(l).getDynamicColor(),10,"lighter",!0)}}),this.createOrUpdate(f,{palette:function(t){return t.getPalette(e)},tone:function(e){return 10},background:function(e){return r.get(l).getDynamicColor()},secondBackground:function(e){return r.get(c).getDynamicColor()},contrastCurve:new g(4.5,7,11,21)}),this.createOrUpdate(h,{palette:function(t){return t.getPalette(e)},tone:function(e){return 30},background:function(e){return r.get(l).getDynamicColor()},secondBackground:function(e){return r.get(c).getDynamicColor()},contrastCurve:new g(3,4.5,7,11)})},e}(),C={colorManagerService:e.asClass(y).singleton(),colorService:e.asClass(i).singleton()},k=function(){function e(e){this.options=void 0,this.options=e}var r,n;return e.prototype.getPalette=function(e){if(!this.options)throw new Error("Scheme options is not set");var t=this.options.palettes.get(e);if(!t)throw new Error("Palette "+e+" not found");return t},r=e,(n=[{key:"contrastLevel",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.contrastLevel}},{key:"isDark",get:function(){if(!this.options)throw new Error("Scheme options is not set");return this.options.isDark}},{key:"sourceColorHct",get:function(){if(!this.options)throw new Error("Scheme options is not set");return t.Hct.fromInt(this.options.sourceColorArgb)}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r}(),S=function(){function e(){this.schemeEntity=void 0,this.options=void 0}var r=e.prototype;return r.createOrUpdate=function(e){var r,n;this.options=u({},this.options,e,{sourcesColorHex:u({},null==(r=this.options)?void 0:r.sourcesColorHex,e.sourcesColorHex),palettes:u({},null==(n=this.options)?void 0:n.palettes,e.palettes)});var o=new Map;if(!this.options.sourcesColorHex.primary)throw new Error("Primary source color is not set");var i=t.argbFromHex(this.options.sourcesColorHex.primary),a=t.Hct.fromInt(i);if(this.options.palettes){for(var s=0,c=Object.entries(this.options.palettes);s<c.length;s++){var l=c[s],f=l[0],h=l[1],g=h.sourceColorkey,d=h.tonalPalette,p=void 0;if(g){var v=t.argbFromHex(this.options.sourcesColorHex[g]);p=d(t.Hct.fromInt(v))}else p=d(a);o.set(f,p)}this.schemeEntity=new k(u({},this.options,{palettes:o,sourceColorArgb:i}))}},r.get=function(){if(!this.schemeEntity)throw new Error("Scheme is not created");return this.schemeEntity},e}(),b=function(){function e(e){var t=e.schemeService,r=e.variantService;this.schemeService=void 0,this.variantService=void 0,this.schemeService=t,this.variantService=r}var t=e.prototype;return t.create=function(e){this.schemeService.createOrUpdate(u({},e,{sourcesColorHex:{primary:e.sourceColorHex}})),this.variantService.set(e.variant)},t.update=function(e){var t=u({},e);e.sourceColorHex&&(t.sourcesColorHex={primary:e.sourceColorHex}),this.schemeService.createOrUpdate(t),e.variant&&this.variantService.set(e.variant)},t.addCustomPalette=function(e,t){this.variantService.addCustomPalette(e,t)},e}(),P=function(){function e(e){var t=e.schemeService;this.customPalettes={},this.variantEntity=void 0,this.schemeService=void 0,this.schemeService=t}var r=e.prototype;return r.addCustomPalette=function(e,t){this.customPalettes[e]=t,this.update()},r.set=function(e){this.variantEntity=e,e.palettes.error||(e.palettes.error=function(){return t.TonalPalette.fromHueAndChroma(25,84)}),this.update()},r.update=function(){var e=this;if(this.variantEntity){var t={};Object.keys(this.variantEntity.palettes).forEach((function(r){t[r]={tonalPalette:e.variantEntity.palettes[r]}})),this.variantEntity.customPalettes&&Object.keys(this.customPalettes).forEach((function(r){t[r]={sourceColorkey:r,tonalPalette:e.variantEntity.customPalettes}})),this.schemeService.createOrUpdate({sourcesColorHex:this.customPalettes,palettes:t})}},e}(),x={schemeService:e.asClass(S).singleton(),variantService:e.asClass(P).singleton(),themeService:e.asClass(b).singleton()},D=function(e){var t=e.colorService,r=e.themeService,n=e.pluginService;this.colorService=void 0,this.themeService=void 0,this.pluginService=void 0,this.pluginService=n,this.colorService=t,this.themeService=r},w={appService:e.asClass(D).singleton()},F=function(e){return{fromPalettes:["primary","secondary","tertiary"],colors:{background:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?6:98},isBackground:!0},onBackground:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?90:10},background:function(t){return e.getColor("background").getDynamicColor()},contrastCurve:new g(3,3,4.5,7)},surface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?6:98},isBackground:!0},surfaceDim:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?6:87},isBackground:!0},surfaceBright:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?24:98},isBackground:!0},surfaceContainerLowest:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?4:100},isBackground:!0},surfaceContainerLow:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?10:96},isBackground:!0},surfaceContainer:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?12:94},isBackground:!0},surfaceContainerHigh:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?17:92},isBackground:!0},surfaceContainerHighest:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?22:90},isBackground:!0},onSurface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?90:10},background:function(t){return m(t,e)},contrastCurve:new g(4.5,7,11,21)},surfaceVariant:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?30:90},isBackground:!0},onSurfaceVariant:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?80:30},background:function(t){return m(t,e)},contrastCurve:new g(3,4.5,7,11)},inverseSurface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?90:20}},inverseOnSurface:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?20:95},background:function(t){return e.getColor("inverseSurface").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},outline:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?60:50},background:function(t){return m(t,e)},contrastCurve:new g(1.5,3,4.5,7)},outlineVariant:{palette:function(e){return e.getPalette("neutralVariant")},tone:function(e){return e.isDark?30:80},background:function(t){return m(t,e)},contrastCurve:new g(1,1,3,7)},shadow:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return 0}},scrim:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return 0}},surfaceTint:{palette:function(e){return e.getPalette("neutral")},tone:function(e){return e.isDark?80:40},isBackground:!0},secondaryContainer:{tone:function(e){var r=e.isDark?30:90;return function(e,r,n,o){var i=n,a=t.Hct.from(e,r,n);if(a.chroma<r)for(var s=a.chroma;a.chroma<r;){var u=t.Hct.from(e,r,i+=o?-1:1);if(s>u.chroma)break;if(Math.abs(u.chroma-r)<.4)break;Math.abs(u.chroma-r)<Math.abs(a.chroma-r)&&(a=u),s=Math.max(s,u.chroma)}return i}(e.getPalette("secondary").hue,e.getPalette("secondary").chroma,r,!e.isDark)}},onSecondaryContainer:{tone:function(t){return d.foregroundTone(e.getColor("secondaryContainer").getDynamicColor().tone(t),4.5)}},tertiaryContainer:{palette:function(e){return e.getPalette("tertiary")},tone:function(e){var r=e.getPalette("tertiary").getHct(e.sourceColorHct.tone);return t.DislikeAnalyzer.fixIfDisliked(r).tone}},onTertiaryContainer:{palette:function(e){return e.getPalette("tertiary")},tone:function(t){return d.foregroundTone(e.getColor("tertiaryContainer").getDynamicColor().tone(t),4.5)}},error:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?80:40},isBackground:!0,background:function(t){return m(t,e)},contrastCurve:new g(3,4.5,7,11),toneDeltaPair:function(t){return new p(e.getColor("errorContainer").getDynamicColor(),e.getColor("error").getDynamicColor(),15,"nearer",!1)}},onError:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?20:100},background:function(t){return e.getColor("error").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},errorContainer:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?30:90},isBackground:!0,background:function(t){return m(t,e)},contrastCurve:new g(1,1,3,7),toneDeltaPair:function(t){return new p(e.getColor("errorContainer").getDynamicColor(),e.getColor("error").getDynamicColor(),15,"nearer",!1)}},onErrorContainer:{palette:function(e){return e.getPalette("error")},tone:function(e){return e.isDark?90:10},background:function(t){return e.getColor("errorContainer").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},onTertiaryFixed:{palette:function(e){return e.getPalette("tertiary")},tone:function(e){return 10},background:function(t){return e.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(t){return e.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new g(4.5,7,11,21)},onTertiaryFixedVariant:{palette:function(e){return e.getPalette("tertiary")},tone:function(e){return 30},background:function(t){return e.getColor("tertiaryFixedDim").getDynamicColor()},secondBackground:function(t){return e.getColor("tertiaryFixed").getDynamicColor()},contrastCurve:new g(3,4.5,7,11)}}}},H=function(e,r,n){var o=e.hue;if(r.length!==n.length)throw new Error("mismatch between hue length "+r.length+" & rotations "+n.length);if(1===n.length)return t.sanitizeDegreesDouble(e.hue+n[0]);for(var i=r.length,a=0;a<=i-2;a++)if(r[a]<o&&o<r[a+1])return t.sanitizeDegreesDouble(o+n[a]);return o},T=function(){};h=T,T.tonalSpot={palettes:{primary:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,36)},secondary:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,16)},tertiary:function(e){return t.TonalPalette.fromHueAndChroma(t.sanitizeDegreesDouble(e.hue+60),24)},neutral:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,6)},neutralVariant:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,8)}},customPalettes:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,16)}},T.vibrant={palettes:{primary:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,200)},secondary:function(e){return t.TonalPalette.fromHueAndChroma(H(e,h.hues,h.secondaryRotations),24)},tertiary:function(e){return t.TonalPalette.fromHueAndChroma(H(e,h.hues,h.tertiaryRotations),32)},neutral:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,6)},neutralVariant:function(e){return t.TonalPalette.fromHueAndChroma(e.hue,8)}},customPalettes:function(e){return t.TonalPalette.fromHueAndChroma(H(e,h.hues,h.secondaryRotations),24)}},T.hues=[0,41,61,101,131,181,251,301,360],T.secondaryRotations=[18,15,10,12,15,18,15,12,12],T.tertiaryRotations=[35,30,20,25,30,35,30,25,25];var O=function(){function e(e){var t=e.appService;this.configPath="./theme.config",this.appService=void 0,this.appService=t}var t=e.prototype;return t.loadConfig=function(e){var t=this.appService,r=t.themeService,n=t.colorService,o=t.pluginService,i=null!=e?e:this.getConfig(),a=i.contrastLevel,s=i.isDark,u=i.variant,c=i.palettes,l=i.colors,f=i.useDefaultColors,h=void 0===f||f,g=i.plugins;r.create({contrastLevel:void 0===a?0:a,isDark:void 0!==s&&s,sourceColorHex:i.sourceColor,variant:void 0===u?T.tonalSpot:u}),c&&Object.entries(c).forEach((function(e){return r.addCustomPalette(e[0],e[1])})),h&&n.addColors(F),l&&n.addColors(l),g&&(g.forEach((function(e){Array.isArray(e)?o.addPlugin(e[0],e[1]):o.addPlugin(e,{})})),o.loadPlugins(this.appService))},t.getConfig=function(){for(var e=r.resolve(this.configPath),t=null,o=0,i=[".js",".ts",".jms",".jcs"];o<i.length;o++){var a=e+i[o];if(n.existsSync(a)){t=require(a);break}}if(!t)throw new Error("Configuration file not found");return"default"in t?t.default:t},e}(),M={configService:e.asClass(O).singleton()},E=function(){function e(){this.pluginInstances=new Map,this.pluginConstructors=new Map}var t=e.prototype;return t.addPlugin=function(e,t){this.pluginConstructors.set(e.name,[e,t])},t.loadPlugins=function(e){var t=this,r=new Map(this.pluginConstructors),n=0;do{n=r.size,r.forEach((function(n,o){var i=n[0],a=n[1];0===i.dependencies.filter((function(e){return!t.pluginInstances.has(e.name)})).length&&(t.pluginInstances.set(i.name,new i(e,a)),r.delete(o))}))}while(0!=r.size&&r.size<n);r.size>0&&console.log("Some plugins couldn't be loaded due to missing dependencies: ",Array.from(r.keys()))},t.getPlugin=function(e){var t=this.pluginInstances.get(e.name);if(!t)throw new Error("Plugin "+e.name+" not found");return t},e}(),A={pluginService:e.asClass(E).singleton()};function B(e,t){return t.forEach((function(t){Object.entries(t).forEach((function(t){e.register(t[0],t[1])}))})),e}var j=e.createContainer({injectionMode:e.InjectionMode.PROXY});function z(e){var t=j.resolve("configService");return null!=e&&e.path&&(t.configPath=e.path),t.loadConfig(null==e?void 0:e.config),j.resolve("appService")}B(j,[M,w,A,C,x]);var L,U=function(){};U.dependencies=[],exports.FontFamily=void 0,(L=exports.FontFamily||(exports.FontFamily={})).Expressive="expressive",L.Neutral="neutral";var W=function(e){function t(t,r){var n,o,i,a,s;return(s=e.call(this)||this).appService=void 0,s.options=void 0,s.fontFamily=void 0,s.fontStyles=void 0,s.appService=t,s.options=r,s.fontFamily={expressive:null!=(n=null==r||null==(o=r.fontFamily)?void 0:o.expressive)?n:["Roboto","sans-serif"],neutral:null!=(i=null==r||null==(a=r.fontFamily)?void 0:a.neutral)?i:["Roboto","sans-serif"]},s.fontStyles={display:{large:{fontWeight:400,fontSize:3.5625,lineHeight:4,letterSpacing:-.015625,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:2.8125,lineHeight:3.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:2.25,lineHeight:2.75,fontFamily:exports.FontFamily.Expressive}},headline:{large:{fontWeight:400,fontSize:2,lineHeight:2.5,fontFamily:exports.FontFamily.Expressive},medium:{fontWeight:400,fontSize:1.75,lineHeight:2.25,fontFamily:exports.FontFamily.Expressive},small:{fontWeight:400,fontSize:1.5,lineHeight:2,fontFamily:exports.FontFamily.Expressive}},title:{large:{fontWeight:400,fontSize:1.375,lineHeight:1.75,fontFamily:exports.FontFamily.Neutral},medium:{fontWeight:500,fontSize:1,lineHeight:1.5,fontFamily:exports.FontFamily.Neutral,letterSpacing:.009375},small:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625}},label:{large:{fontWeight:500,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.00625},medium:{fontWeight:500,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},small:{fontWeight:500,fontSize:.6875,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125}},body:{large:{fontWeight:400,fontSize:1,lineHeight:1.5625,fontFamily:exports.FontFamily.Neutral,letterSpacing:.03125},medium:{fontWeight:400,fontSize:.875,lineHeight:1.25,fontFamily:exports.FontFamily.Neutral,letterSpacing:.015625},small:{fontWeight:400,fontSize:.75,lineHeight:1,fontFamily:exports.FontFamily.Neutral,letterSpacing:.025}}},r&&r.fontStyles&&Object.entries(r.fontStyles).forEach((function(e){var t=e[0];Object.entries(e[1]).forEach((function(e){var r=e[0],n=e[1];n&&(s.fontStyles[t][r]=u({},s.fontStyles[t][r],n))}))})),s}return c(t,e),t.config=function(e){return e},t.prototype.getFonts=function(){return{fontStyles:this.fontStyles,fontFamily:this.fontFamily}},t}(U),I=function(e){return o((function(t){V(t,{statePrefix:"state",disabledStyles:{textOpacity:.38,backgroundOpacity:.12},transition:{duration:150}},e)}),{})},V=function(e,t,r){for(var n=e.addComponents,o=t.statePrefix,i=t.disabledStyles,a=t.transition,u={},c=0,l=[!1,!0];c<l.length;c++)for(var f,h=l[c]?"group-":"",g=s(r);!(f=g()).done;){var d,p=f.value,v="."+h+o+"-"+p;u[v]=((d={})["@apply "+h+"hover:bg-"+p+"/[0.08]"]={},d["@apply "+h+"active:bg-"+p+"/[0.12]"]={},d["@apply "+h+"focus-visible:bg-"+p+"/[0.12]"]={},d),a&&(u[v]["@apply transition-colors"]={},u[v]["@apply duration-"+a.duration]={}),i&&(u[v]["@apply "+h+"disabled:text-on-surface/["+i.textOpacity+"]"]={},u[v]["@apply "+h+"disabled:bg-on-surface/["+i.backgroundOpacity+"]"]={})}for(var m,y=s(r);!(m=y()).done;)for(var C=m.value,k=0,S=["hover","active","focus","disabled"];k<S.length;k++){var b,P=S[k],x="."+P+"-"+o+"-"+C;if("active"===P||"focus"===P)u[x]=((b={})["@apply bg-"+C+"/[0.12]"]={},b);else if("hover"===P){var D;u[x]=((D={})["@apply bg-"+C+"/[0.08]"]={},D)}else if("disabled"===P){var w,F;u[x]=((w={})["@apply text-on-surface/["+i.textOpacity+"]"]={},w),u[x]=((F={})["@apply bg-on-surface/["+i.backgroundOpacity+"]"]={},F)}}n(u)};function N(e){var t=e.name,r=e.darkMode,n=e.isDarkTheme;return{name:n?t+"Dark":t,selectors:n&&"class"===r?[".dark-mode .theme-"+t,".dark-mode.theme-"+t,'[data-theme="dark"] .theme-'+t,'[data-theme="dark"].theme-'+t]:[".theme-"+t],mediaQuery:n&&"media"===r?"@media (prefers-color-scheme: dark)":void 0,extend:{colors:e.colors}}}var R=function(e){var t=e.appService,r=t.themeService,n=t.colorService,o={defaultTheme:{extend:{colors:{}}},themes:[{name:"darkTheme",extend:{colors:{}}}]};return Object.entries(e.colors).forEach((function(e){var t=e[0],r=e[1];o.defaultTheme.extend.colors[t]=r.light,o.themes[0].extend.colors[t]=r.dark})),o.themes[0].selectors="class"===e.darkMode?[".dark-mode",'[data-theme="dark"]']:void 0,o.themes[0].mediaQuery="media"===e.darkMode?"@media (prefers-color-scheme: dark)":void 0,e.subThemes&&Object.entries(e.subThemes).forEach((function(t){var i=t[0];r.update({sourceColorHex:t[1]});for(var a=0,u=[!0,!1];a<u.length;a++){var c=u[a],l={};r.update({isDark:c});for(var f,h=s(n.getColors().entries());!(f=h()).done;){var g=f.value,d=g[1];l[g[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase()]=d.getHex()}o.themes.push(N({name:i,isDarkTheme:c,darkMode:e.darkMode,colors:l}))}})),require("tailwindcss-themer")(o)},q=function(e,t){return o((function(r){(0,r.addUtilities)(function(r){for(var n=r.theme,o="rem",i={},a=function(e){return{fontSize:e.fontSize+o,fontWeight:e.fontWeight,lineHeight:e.lineHeight+o,letterSpacing:e.letterSpacing?e.letterSpacing+o:null,fontFamily:n("fontFamily."+e.fontFamily)}},s=function(e,t,r){var i;return(i={})["@media (min-width: "+n("screens."+t,{})+")"]={fontSize:e.fontSize*r+o,lineHeight:e.lineHeight*r+o},i},c=0,l=Object.entries(e);c<l.length;c++)for(var f=l[c],h=f[0],g=function(){var e=p[d],r=e[1];i[".text-"+h+"-"+e[0]]=u({},a(r),Object.entries(t).reduce((function(e,t){return u({},e,s(r,t[0],t[1]))}),{}))},d=0,p=Object.entries(f[1]);d<p.length;d++)g();return i}({theme:r.theme}))}))},_=function(e){function t(t,r){var n;return null!=r.darkMode||(r.darkMode="class"),null!=r.responsiveBreakPoints||(r.responsiveBreakPoints={lg:1.125}),(n=e.call(this)||this).appService=void 0,n.options=void 0,n.appService=t,n.options=r,n}return c(t,e),t.config=function(e){return e},t.prototype.getTheme=function(){for(var e={},t=0,r=[!1,!0];t<r.length;t++){var n=r[t];this.appService.themeService.update({isDark:n});for(var o,i=s(this.appService.colorService.getColors().entries());!(o=i()).done;){var a=o.value,u=a[1],c=a[0].replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase();null!=e[c]||(e[c]={light:"",dark:""}),e[c][n?"dark":"light"]=u.getHex()}}var l=this.appService.pluginService.getPlugin(W).getFonts(),f=l.fontStyles;return{colors:{},fontFamily:l.fontFamily,plugins:[I(Object.keys(e)),q(f,this.options.responsiveBreakPoints),R({colors:e,darkMode:this.options.darkMode,subThemes:this.options.subThemes,appService:this.appService})]}},t}(U);_.dependencies=[W],exports.AppContainer=j,exports.AppModule=w,exports.AppService=D,exports.ColorEntity=v,exports.ColorManagerService=y,exports.ColorModule=C,exports.ColorService=i,exports.ConfigModule=M,exports.ConfigService=O,exports.ContrastCurve=g,exports.DynamicColor=d,exports.FontPlugin=W,exports.PluginAbstract=U,exports.PluginModule=A,exports.PluginService=E,exports.SchemeEntity=k,exports.SchemeService=S,exports.TailwindPlugin=_,exports.ThemeModule=x,exports.ThemeService=b,exports.ToneDeltaPair=p,exports.VariantEntity=function(e,t){void 0===e&&(e={}),this.palettes=void 0,this.customPalettes=void 0,this.palettes=e,this.customPalettes=t},exports.VariantModel=T,exports.VariantService=P,exports.bootstrap=function(){return j.resolve("appService")},exports.bootstrapFromConfig=z,exports.createTheme=function(){var e=z(),t=e.pluginService.getPlugin(_);if(!t)throw new Error("Tailwind plugin not found");return u({},t.getTheme(),{appService:e})},exports.defaultColors=F,exports.defineConfig=function(e){if(!e||"object"!=typeof e)throw new Error("The configuration is missing or not an object");if(!("sourceColor"in e))throw new Error("Invalid configuration");return e},exports.getRotatedHue=H,exports.highestSurface=m,exports.importContainer=B,exports.state=I,exports.themer=R;
|
|
2
2
|
//# sourceMappingURL=theme.cjs.production.min.js.map
|