diff --git a/dist/systemtags-init.js b/dist/systemtags-init.js index 7132c20a43ce6..3cab0d617ce44 100644 --- a/dist/systemtags-init.js +++ b/dist/systemtags-init.js @@ -1,2 +1,2 @@ -(()=>{var t,e,n,r={8828:(t,e,n)=>{"use strict";n.d(e,{R:()=>i});var r=n(45505),o=n(63814),a=n(21777);const s=(0,o.dC)("dav"),i=(0,r.UU)(s),l=t=>{i.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})};(0,a.zo)(l),l((0,a.do)())},12686:(t,e,n)=>{"use strict";n.d(e,{GX:()=>s,Pq:()=>c,_3:()=>i,rA:()=>l,rL:()=>a});var r=n(71654),o=n(85471);const a=t=>t.map(({props:t})=>Object.fromEntries(Object.entries(t).map(([t,e])=>[(0,r.A)(t),"displayName"===(0,r.A)(t)?String(e):e]))),s=t=>{const e=t.indexOf("?");e>0&&(t=t.substring(0,e));const n=t.split("/");let r;do{r=n[n.length-1],n.pop()}while(!r&&n.length>0);return Number(r)},i=t=>{if("name"in t&&!("displayName"in t))return{...t};const e={...t};return e.name=e.displayName,delete e.displayName,e},l=function(t){const e=t.attributes?.["system-tags"]?.["system-tag"];return void 0===e?[]:[e].flat().map(t=>"string"==typeof t?t:t.text)},c=function(t,e){o.Ay.set(t.attributes,"system-tags",{"system-tag":e})}},25631:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r=(0,n(35947).YK)().setApp("systemtags").detectUser().build()},42634:()=>{},45218:(t,e,n)=>{"use strict";var r=n(35810),o=n(94205),a=n(85471),s=n(32505),i=n(85168),l=n(53334);const c='';async function u(t){const e=await new Promise(e=>{(0,i.Ss)((0,a.$V)(()=>Promise.all([n.e(4208),n.e(9167)]).then(n.bind(n,99167))),{nodes:t},t=>{e(t)})});return Array(t.length).fill(e)}const d=new r.hY({id:"systemtags:bulk",displayName:()=>(0,l.t)("systemtags","Manage tags"),iconSvgInline:()=>c,enabled:t=>!(0,s.f)()&&0!==t.length&&!t.some(t=>!t.isDavResource)&&!t.some(t=>0===(t.permissions&r.aX.UPDATE)),exec:async t=>u([t])[0],execBatch:u});var h=n(65899),g=n(61338);const m=(0,n(35947).YK)().setApp("files").detectUser().build(),p=(0,h.nY)("active",()=>{const t=(0,a.KR)(),e=(0,a.KR)(),n=(0,a.KR)(),o=(0,a.KR)();function s(t){n.value&&n.value.source===t.source&&(n.value=void 0)}function i(t=null){m.debug("Setting active view",{view:t}),o.value=t??void 0,n.value=void 0}return function(){const t=(0,r.bh)();(0,g.B1)("files:node:deleted",s),i(t.active),t.addEventListener("updateActive",t=>{i(t.detail)})}(),{activeAction:t,activeFolder:e,activeNode:n,activeView:o}});var b=n(25631),f=n(21777),y=n(82528);const v="/systemtags",w=(0,r.H4)(),A=t=>(0,r.Al)(t),k=t=>`\n\n\t\n\t\t${(0,r.VX)()}\n\t\n\t\n\t\t${t}\n\t\n`,x=function(t){return new r.vd({id:t.id,source:`${r.PY}${v}/${t.id}`,owner:String((0,f.HW)()?.uid??"anonymous"),root:v,displayname:t.displayName,permissions:r.aX.READ,attributes:{...t,"is-tag":!0}})},C="tags";var M=n(85072),N=n.n(M),j=n(97825),O=n.n(j),_=n(77659),E=n.n(_),P=n(55056),S=n.n(P),I=n(10540),$=n.n(I),L=n(41113),T=n.n(L),F=n(73911),q={};q.styleTagTransform=T(),q.setAttributes=S(),q.insert=E().bind(null,"head"),q.domAPI=O(),q.insertStyleElement=$(),N()(F.A,q),F.A&&F.A.locals&&F.A.locals;var B=n(57599),z=n(12686);const R=[],D=function(t,e=!1){const n=document.createElement("li");n.classList.add("files-list__system-tag"),n.setAttribute("data-systemtag-name",t),n.textContent=t;const r=R.find(e=>e.displayName===t);if(r?.color){const t=getComputedStyle(document.body).getPropertyValue("--color-main-background").replace("#","")||((0,B.j2)()?"000000":"ffffff"),e=(0,B.W7)(`#${r.color}`,`#${t}`);n.style.setProperty("--systemtag-color",e),n.setAttribute("data-systemtag-color","true")}return e&&n.classList.add("files-list__system-tag--more"),n},V=async function(t){const e=(0,z.rA)(t),n=document.createElement("ul");if(n.classList.add("files-list__system-tags"),n.setAttribute("aria-label",(0,l.t)("files","Assigned collaborative tags")),n.setAttribute("data-systemtags-fileid",t.fileid?.toString()||""),0===e.length)return n;if(0===R.length)try{R.push(...await(0,y.un)())}catch(t){b.A.error("Failed to fetch tags",{error:t})}if(n.append(D(e[0])),2===e.length)n.append(D(e[1]));else if(e.length>1){const t=D("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),t.setAttribute("aria-hidden","true"),t.setAttribute("role","presentation"),n.append(t);for(const t of e.slice(1)){const e=D(t);e.classList.add("hidden-visually"),n.append(e)}}return n},U=new r.hY({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled:t=>1===t.length,exec:async()=>null,renderInline:V,order:0,hotkey:{description:(0,l.t)("files","Manage tags"),key:"T"}});(0,g.B1)("systemtags:node:updated",function(t){V(t).then(e=>{document.querySelectorAll(`[data-systemtags-fileid="${t.fileid}"]`).forEach(t=>{t.replaceWith(e)})})}),(0,g.B1)("systemtags:tag:created",function(t){R.push(t)}),(0,g.B1)("systemtags:tag:deleted",function(t){R.splice(R.findIndex(e=>e.id===t.id),1)}),(0,g.B1)("systemtags:tag:updated",function(t){const e=R.findIndex(e=>e.id===t.id);-1!==e&&(R[e]=t),function(t){document.querySelectorAll(`[data-systemtag-name="${t.displayName}"]`).forEach(e=>{e.style.setProperty("--systemtag-color",`#${t.color}`)})}(t)});const H=new r.hY({id:"systemtags:open-in-files",displayName:()=>(0,l.t)("systemtags","Open in Files"),iconSvgInline:()=>"",enabled:(t,e)=>e.id===C&&1===t.length&&!0!==t[0].attributes["is-tag"]&&t[0].type===r.pt.Folder,async exec(t){let e=t.dirname;return t.type===r.pt.Folder&&(e=t.path),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(t.fileid)},{dir:e,openfile:"true"}),null},order:-1e3,default:r.m9.HIDDEN});(0,r.Yc)("nc:system-tags"),(0,r.Gg)(d),(0,r.Gg)(U),(0,r.Gg)(H),(0,r.bh)().register(new r.Ss({id:C,name:(0,l.Tl)("systemtags","Tags"),caption:(0,l.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,l.Tl)("systemtags","No tags found"),emptyCaption:(0,l.Tl)("systemtags","Tags you have created will show up here."),icon:c,order:25,getContents:async(t="/")=>{const e=(await(0,y.un)()).filter(t=>t.userVisible);if("/"===t)return{folder:new r.vd({id:0,source:`${r.PY}${v}`,owner:(0,f.HW)()?.uid,root:v,permissions:r.aX.NONE}),contents:e.map(x)};const n=parseInt(t.split("/",2)[1]),o=e.find(t=>t.id===n);if(!o)throw new Error("Tag not found");return{folder:x(o),contents:(await w.getDirectoryContents(r.lJ,{details:!0,data:k(n),headers:{method:"REPORT"}})).data.map(A)}}})),document.addEventListener("DOMContentLoaded",()=>{(0,o.C)("t",()=>(async t=>{const e=p((window._nc_files_pinia||(window._nc_files_pinia=(0,h.Ey)()),window._nc_files_pinia)),n=window?.OCP?.Files?.Router?.query?.dir||"/",o=e.activeNode,s=e.activeView;if(!o||!s)return void m.error("No active node or view",{node:o,view:s});if(o.status===r.zI.LOADING)return void m.debug("Node is already loading",{node:o});if(!t.enabled([o],s))return void m.debug("Action is not not available for the current context",{action:t,node:o,view:s});let c=t.id;try{c=t.displayName([o],s)}catch(e){m.error("Error while getting action display name",{action:t,error:e})}try{a.Ay.set(o,"status",r.zI.LOADING),e.activeAction=t;const u=await t.exec(o,s,n);if(null==u)return;if(u)return void(0,i.Te)((0,l.t)("files","{displayName}: done",{displayName:c}));(0,i.Qg)((0,l.t)("files","{displayName}: failed",{displayName:c}))}catch(e){m.error("Error while executing action",{action:t,error:e}),(0,i.Qg)((0,l.t)("files","{displayName}: failed",{displayName:c}))}finally{a.Ay.set(o,"status",void 0),e.activeAction=void 0}})(d),{stop:!0,prevent:!0}),b.A.debug("Hotkeys registered")})},57599:(t,e,n)=>{"use strict";n.d(e,{W7:()=>T,Pj:()=>L,j2:()=>$});const r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},o=Object.create(null);for(const t in r)Object.hasOwn(r,t)&&(o[r[t]]=t);const a={to:{},get:{}};function s(t,e,n){return Math.min(Math.max(e,t),n)}function i(t){const e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}a.get=function(t){let e,n;switch(t.slice(0,3).toLowerCase()){case"hsl":e=a.get.hsl(t),n="hsl";break;case"hwb":e=a.get.hwb(t),n="hwb";break;default:e=a.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},a.get.rgb=function(t){if(!t)return null;let e,n,o,a=[0,0,0,1];if(e=t.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){const t=2*n;a[n]=Number.parseInt(e.slice(t,t+2),16)}o&&(a[3]=Number.parseInt(o,16)/255)}else if(e=t.match(/^#([a-f\d]{3,4})$/i)){for(e=e[1],o=e[3],n=0;n<3;n++)a[n]=Number.parseInt(e[n]+e[n],16);o&&(a[3]=Number.parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)a[n]=Number.parseInt(e[n+1],10);e[4]&&(a[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Object.hasOwn(r,e[1])?(a=r[e[1]],a[3]=1,a):null:null;for(n=0;n<3;n++)a[n]=Math.round(2.55*Number.parseFloat(e[n+1]));e[4]&&(a[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}for(n=0;n<3;n++)a[n]=s(a[n],0,255);return a[3]=s(a[3],0,1),a},a.get.hsl=function(t){if(!t)return null;const e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){const t=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,s(Number.parseFloat(e[2]),0,100),s(Number.parseFloat(e[3]),0,100),s(Number.isNaN(t)?1:t,0,1)]}return null},a.get.hwb=function(t){if(!t)return null;const e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){const t=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,s(Number.parseFloat(e[2]),0,100),s(Number.parseFloat(e[3]),0,100),s(Number.isNaN(t)?1:t,0,1)]}return null},a.to.hex=function(...t){return"#"+i(t[0])+i(t[1])+i(t[2])+(t[3]<1?i(Math.round(255*t[3])):"")},a.to.rgb=function(...t){return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},a.to.rgb.percent=function(...t){const e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},a.to.hsl=function(...t){return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},a.to.hwb=function(...t){let e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},a.to.keyword=function(...t){return o[t.slice(0,3)]};const l=a,c={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},u={};for(const t of Object.keys(c))u[c[t]]=t;const d={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},h=d,g=(6/29)**3;function m(t){const e=t>.0031308?1.055*t**(1/2.4)-.055:12.92*t;return Math.min(Math.max(0,e),1)}function p(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(const t of Object.keys(d)){if(!("channels"in d[t]))throw new Error("missing channels property: "+t);if(!("labels"in d[t]))throw new Error("missing channel labels property: "+t);if(d[t].labels.length!==d[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=d[t];delete d[t].channels,delete d[t].labels,Object.defineProperty(d[t],"channels",{value:e}),Object.defineProperty(d[t],"labels",{value:n})}function b(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}function f(t,e){return function(n){return e(t(n))}}function y(t,e){const n=[e[t].parent,t];let r=h[e[t].parent][t],o=e[t].parent;for(;e[o].parent;)n.unshift(e[o].parent),r=f(h[e[o].parent][o],r),o=e[o].parent;return r.conversion=n,r}d.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.min(e,n,r),a=Math.max(e,n,r),s=a-o;let i,l;switch(a){case o:i=0;break;case e:i=(n-r)/s;break;case n:i=2+(r-e)/s;break;case r:i=4+(e-n)/s}i=Math.min(60*i,360),i<0&&(i+=360);const c=(o+a)/2;return l=a===o?0:c<=.5?s/(a+o):s/(2-a-o),[i,100*l,100*c]},d.rgb.hsv=function(t){let e,n,r,o,a;const s=t[0]/255,i=t[1]/255,l=t[2]/255,c=Math.max(s,i,l),u=c-Math.min(s,i,l),d=function(t){return(c-t)/6/u+.5};if(0===u)o=0,a=0;else{switch(a=u/c,e=d(s),n=d(i),r=d(l),c){case s:o=r-n;break;case i:o=1/3+e-r;break;case l:o=2/3+n-e}o<0?o+=1:o>1&&(o-=1)}return[360*o,100*a,100*c]},d.rgb.hwb=function(t){const e=t[0],n=t[1];let r=t[2];const o=d.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[o,100*a,100*r]},d.rgb.oklab=function(t){const e=p(t[0]/255),n=p(t[1]/255),r=p(t[2]/255),o=Math.cbrt(.4122214708*e+.5363325363*n+.0514459929*r),a=Math.cbrt(.2119034982*e+.6806995451*n+.1073969566*r),s=Math.cbrt(.0883024619*e+.2817188376*n+.6299787005*r);return[100*(.2104542553*o+.793617785*a-.0040720468*s),100*(1.9779984951*o-2.428592205*a+.4505937099*s),100*(.0259040371*o+.7827717662*a-.808675766*s)]},d.rgb.cmyk=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.min(1-e,1-n,1-r);return[100*((1-e-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*o]},d.rgb.keyword=function(t){const e=u[t];if(e)return e;let n,r=Number.POSITIVE_INFINITY;for(const e of Object.keys(c)){const o=b(t,c[e]);og?n**(1/3):7.787*n+16/116,r=r>g?r**(1/3):7.787*r+16/116,o=o>g?o**(1/3):7.787*o+16/116,[116*r-16,500*(n-r),200*(r-o)]},d.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100;let o,a;if(0===n)return a=255*r,[a,a,a];const s=r<.5?r*(1+n):r+n-r*n,i=2*r-s,l=[0,0,0];for(let t=0;t<3;t++)o=e+1/3*-(t-1),o<0&&o++,o>1&&o--,a=6*o<1?i+6*(s-i)*o:2*o<1?s:3*o<2?i+(s-i)*(2/3-o)*6:i,l[t]=255*a;return l},d.hsl.hsv=function(t){const e=t[0];let n=t[1]/100,r=t[2]/100,o=n;const a=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,o*=a<=1?a:2-a,[e,100*(0===r?2*o/(a+o):2*n/(r+n)),(r+n)/2*100]},d.hsv.rgb=function(t){const e=t[0]/60,n=t[1]/100;let r=t[2]/100;const o=Math.floor(e)%6,a=e-Math.floor(e),s=255*r*(1-n),i=255*r*(1-n*a),l=255*r*(1-n*(1-a));switch(r*=255,o){case 0:return[r,l,s];case 1:return[i,r,s];case 2:return[s,r,l];case 3:return[s,i,r];case 4:return[l,s,r];case 5:return[r,s,i]}},d.hsv.hsl=function(t){const e=t[0],n=t[1]/100,r=t[2]/100,o=Math.max(r,.01);let a,s;s=(2-n)*r;const i=(2-n)*o;return a=n*o,a/=i<=1?i:2-i,a=a||0,s/=2,[e,100*a,100*s]},d.hwb.rgb=function(t){const e=t[0]/360;let n=t[1]/100,r=t[2]/100;const o=n+r;let a;o>1&&(n/=o,r/=o);const s=Math.floor(6*e),i=1-r;a=6*e-s,1&s&&(a=1-a);const l=n+a*(i-n);let c,u,d;switch(s){default:case 6:case 0:c=i,u=l,d=n;break;case 1:c=l,u=i,d=n;break;case 2:c=n,u=i,d=l;break;case 3:c=n,u=l,d=i;break;case 4:c=l,u=n,d=i;break;case 5:c=i,u=n,d=l}return[255*c,255*u,255*d]},d.cmyk.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},d.xyz.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100;let o,a,s;return o=3.2404542*e+-1.5371385*n+-.4985314*r,a=-.969266*e+1.8760108*n+.041556*r,s=.0556434*e+-.2040259*n+1.0572252*r,o=m(o),a=m(a),s=m(s),[255*o,255*a,255*s]},d.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];return e/=95.047,n/=100,r/=108.883,e=e>g?e**(1/3):7.787*e+16/116,n=n>g?n**(1/3):7.787*n+16/116,r=r>g?r**(1/3):7.787*r+16/116,[116*n-16,500*(e-n),200*(n-r)]},d.xyz.oklab=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=Math.cbrt(.8189330101*e+.3618667424*n-.1288597137*r),a=Math.cbrt(.0329845436*e+.9293118715*n+.0361456387*r),s=Math.cbrt(.0482003018*e+.2643662691*n+.633851707*r);return[100*(.2104542553*o+.793617785*a-.0040720468*s),100*(1.9779984951*o-2.428592205*a+.4505937099*s),100*(.0259040371*o+.7827717662*a-.808675766*s)]},d.oklab.oklch=function(t){return d.lab.lch(t)},d.oklab.xyz=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=(.999999998*e+.396337792*n+.215803758*r)**3,a=(1.000000008*e-.105561342*n-.063854175*r)**3,s=(1.000000055*e-.089484182*n-1.291485538*r)**3;return[100*(1.227013851*o-.55779998*a+.281256149*s),100*(-.040580178*o+1.11225687*a-.071676679*s),100*(-.076381285*o-.421481978*a+1.58616322*s)]},d.oklab.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=(e+.3963377774*n+.2158037573*r)**3,a=(e-.1055613458*n-.0638541728*r)**3,s=(e-.0894841775*n-1.291485548*r)**3;return[255*m(4.0767416621*o-3.3077115913*a+.2309699292*s),255*m(-1.2684380046*o+2.6097574011*a-.3413193965*s),255*m(-.0041960863*o-.7034186147*a+1.707614701*s)]},d.oklch.oklab=function(t){return d.lch.lab(t)},d.lab.xyz=function(t){let e,n,r;n=(t[0]+16)/116,e=t[1]/500+n,r=n-t[2]/200;const o=n**3,a=e**3,s=r**3;return n=o>g?o:(n-16/116)/7.787,e=a>g?a:(e-16/116)/7.787,r=s>g?s:(r-16/116)/7.787,e*=95.047,n*=100,r*=108.883,[e,n,r]},d.lab.lch=function(t){const e=t[0],n=t[1],r=t[2];let o;return o=360*Math.atan2(r,n)/2/Math.PI,o<0&&(o+=360),[e,Math.sqrt(n*n+r*r),o]},d.lch.lab=function(t){const e=t[0],n=t[1],r=t[2]/360*2*Math.PI;return[e,n*Math.cos(r),n*Math.sin(r)]},d.rgb.ansi16=function(t,e=null){const[n,r,o]=t;let a=null===e?d.rgb.hsv(t)[2]:e;if(a=Math.round(a/50),0===a)return 30;let s=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===a&&(s+=60),s},d.hsv.ansi16=function(t){return d.rgb.ansi16(d.hsv.rgb(t),t[2])},d.rgb.ansi256=function(t){const e=t[0],n=t[1],r=t[2];return e>>4==n>>4&&n>>4==r>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},d.ansi16.rgb=function(t){let e=(t=t[0])%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const n=.5*(Math.trunc(t>50)+1);return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},d.ansi256.rgb=function(t){if((t=t[0])>=232){const e=10*(t-232)+8;return[e,e,e]}let e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},d.rgb.hex=function(t){const e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".slice(e.length)+e},d.hex.rgb=function(t){const e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let n=e[0];3===e[0].length&&(n=[...n].map(t=>t+t).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},d.rgb.hcg=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.max(Math.max(e,n),r),a=Math.min(Math.min(e,n),r),s=o-a;let i;return i=s<=0?0:o===e?(n-r)/s%6:o===n?2+(r-e)/s:4+(e-n)/s,i/=6,i%=1,[360*i,100*s,100*(s<1?a/(1-s):0)]},d.hsl.hcg=function(t){const e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[t[0],100*r,100*o]},d.hsv.hcg=function(t){const e=t[1]/100,n=t[2]/100,r=e*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},d.hcg.rgb=function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];const o=[0,0,0],a=e%1*6,s=a%1,i=1-s;let l=0;switch(Math.floor(a)){case 0:o[0]=1,o[1]=s,o[2]=0;break;case 1:o[0]=i,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=s;break;case 3:o[0]=0,o[1]=i,o[2]=1;break;case 4:o[0]=s,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=i}return l=(1-n)*r,[255*(n*o[0]+l),255*(n*o[1]+l),255*(n*o[2]+l)]},d.hcg.hsv=function(t){const e=t[1]/100,n=e+t[2]/100*(1-e);let r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},d.hcg.hsl=function(t){const e=t[1]/100,n=t[2]/100*(1-e)+.5*e;let r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},d.hcg.hwb=function(t){const e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},d.hwb.hcg=function(t){const e=t[1]/100,n=1-t[2]/100,r=n-e;let o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},d.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},d.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},d.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},d.gray.hsl=function(t){return[0,0,t[0]]},d.gray.hsv=d.gray.hsl,d.gray.hwb=function(t){return[0,100,t[0]]},d.gray.cmyk=function(t){return[0,0,0,t[0]]},d.gray.lab=function(t){return[t[0],0,0]},d.gray.hex=function(t){const e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(n.length)+n},d.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const v=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(h);for(let{length:n}=e,r=0;r0;){const t=n.pop(),r=Object.keys(h[t]);for(let{length:o}=r,a=0;a1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function x(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const r=t(e);if("object"==typeof r)for(let{length:t}=r,e=0;e0){this.model=e||"rgb",r=C[this.model].channels;const n=Array.prototype.slice.call(t,0,r);this.color=S(n,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const r=e.sort().join("");if(!(r in N))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=N[r];const{labels:o}=C[this.model],a=[];for(n=0;n(t%360+360)%360),saturationl:E("hsl",1,P(100)),lightness:E("hsl",2,P(100)),saturationv:E("hsv",1,P(100)),value:E("hsv",2,P(100)),chroma:E("hcg",1,P(100)),gray:E("hcg",2,P(100)),white:E("hwb",1,P(100)),wblack:E("hwb",2,P(100)),cyan:E("cmyk",0,P(100)),magenta:E("cmyk",1,P(100)),yellow:E("cmyk",2,P(100)),black:E("cmyk",3,P(100)),x:E("xyz",0,P(95.047)),y:E("xyz",1,P(100)),z:E("xyz",2,P(108.833)),l:E("lab",0,P(100)),a:E("lab",1),b:E("lab",2),keyword(t){return void 0!==t?new O(t):C[this.model].keyword(this.color)},hex(t){return void 0!==t?new O(t):l.to.hex(...this.rgb().round().color)},hexa(t){if(void 0!==t)return new O(t);const e=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),l.to.hex(...e)+n},rgbNumber(){const t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity(){const t=this.rgb().color,e=[];for(const[n,r]of t.entries()){const t=r/255;e[n]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(t){const e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level(t){const e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){const t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight(){return!this.isDark()},negate(){const t=this.rgb();for(let e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate(t){const e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate(t){const e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten(t){const e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken(t){const e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale(){const t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return O.rgb(e,e,e)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){const e=this.hsl();let n=e.color[0];return n=(n+t)%360,n=n<0?360+n:n,e.color[0]=n,e},mix(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);const n=t.rgb(),r=this.rgb(),o=void 0===e?.5:e,a=2*o-1,s=n.alpha()-r.alpha(),i=((a*s===-1?a:(a+s)/(1+a*s))+1)/2,l=1-i;return O.rgb(i*n.red()+l*r.red(),i*n.green()+l*r.green(),i*n.blue()+l*r.blue(),n.alpha()*o+r.alpha()*(1-o))}};for(const t of Object.keys(C)){if(M.includes(t))continue;const{channels:e}=C[t];O.prototype[t]=function(...e){return this.model===t?new O(this):e.length>0?new O(e,t):new O([...(n=C[this.model][t].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],t);var n},O[t]=function(...n){let r=n[0];return"number"==typeof r&&(r=S(n,e)),new O(r,t)}}function _(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function E(t,e,n){t=Array.isArray(t)?t:[t];for(const r of t)(j[r]||=[])[e]=n;return t=t[0],function(r){let o;return void 0!==r?(n&&(r=n(r)),o=this[t](),o.color[e]=r,o):(o=this[t]().color[e],n&&(o=n(o)),o)}}function P(t){return function(e){return Math.max(0,Math.min(t,e))}}function S(t,e){for(let n=0;n.6}(e),r=(o=e,new I(n?t:"#ffffff").mix(new I(o),.83).hex());var o;let a=q(t,r);const s=function(){const t=window?.matchMedia?.("(forced-colors: active)")?.matches,e=document.body.getAttribute("data-themes")?.includes("highcontrast");return e||t||!1}()?5.6:3.2;let i=0,l=t;const c=(n?-100:100)/255;for(;a(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)),[n,r,o]=e;return.2126*n+.7152*r+.0722*o}function q(t,e){const n=F(t)+.05,r=F(e)+.05;return Math.max(n,r)/Math.min(n,r)}function B(t){const e=new I(t).hsl();return{h:e.color[0],s:e.color[1],l:e.color[2]}}function z(t){return new I(t).hex()}},59169:()=>{},63779:()=>{},73911:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(71354),o=n.n(r),a=n(76314),s=n.n(a)()(o());s.push([t.id,".files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-inline-start:5px}.files-list__system-tag[data-systemtag-color]{border-color:var(--systemtag-color);color:var(--systemtag-color);border-width:2px;line-height:18px}@media(min-width: 512px){.files-list__system-tags{display:flex}}","",{version:3,sources:["webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss"],names:[],mappings:"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,uBAAA,CAID,8CACC,mCAAA,CACA,4BAAA,CACA,gBAAA,CACA,gBAAA,CAIF,yBACC,yBACC,YAAA,CAAA",sourcesContent:["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n.files-list__system-tags {\n\t--min-size: 32px;\n\tdisplay: none;\n\tjustify-content: center;\n\talign-items: center;\n\tmin-width: calc(var(--min-size) * 2);\n\tmax-width: 300px;\n}\n\n.files-list__system-tag {\n\tpadding: 5px 10px;\n\tborder: 1px solid;\n\tborder-radius: var(--border-radius-pill);\n\tborder-color: var(--color-border);\n\tcolor: var(--color-text-maxcontrast);\n\theight: var(--min-size);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tline-height: 20px; // min-size - 2 * 5px padding - 2 * 1px border\n\ttext-align: center;\n\n\t&--more {\n\t\toverflow: visible;\n\t\ttext-overflow: initial;\n\t}\n\n\t// Proper spacing if multiple shown\n\t& + .files-list__system-tag {\n\t\tmargin-inline-start: 5px;\n\t}\n\n\t// With color\n\t&[data-systemtag-color] {\n\t\tborder-color: var(--systemtag-color);\n\t\tcolor: var(--systemtag-color);\n\t\tborder-width: 2px;\n\t\tline-height: 18px; // min-size - 2 * 5px padding - 2 * 2px border\n\t}\n}\n\n@media (min-width: 512px) {\n\t.files-list__system-tags {\n\t\tdisplay: flex;\n\t}\n}\n"],sourceRoot:""}]);const i=s},77199:()=>{},82528:(t,e,n)=>{"use strict";n.d(e,{Gw:()=>h,T0:()=>m,VZ:()=>d,b0:()=>g,un:()=>c,xI:()=>u}),n(19051);var r=n(53334),o=n(8828),a=n(12686),s=n(25631),i=n(61338);n(56760);const l='\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n',c=async()=>{try{const{data:t}=await o.R.getDirectoryContents("/systemtags",{data:l,details:!0,glob:"/systemtags/*"});return(0,a.rL)(t)}catch(t){throw s.A.error((0,r.t)("systemtags","Failed to load tags"),{error:t}),new Error((0,r.t)("systemtags","Failed to load tags"))}},u=async t=>{const e="/systemtags/"+t;try{const{data:t}=await o.R.stat(e,{data:l,details:!0});return(0,a.rL)([t])[0]}catch(t){throw s.A.error((0,r.t)("systemtags","Failed to load tag"),{error:t}),new Error((0,r.t)("systemtags","Failed to load tag"))}},d=async t=>{const e=(0,a._3)(t);try{const{headers:n}=await o.R.customRequest("/systemtags",{method:"POST",data:e}),l=n.get("content-location");if(l)return(0,i.Ic)("systemtags:tag:created",t),(0,a.GX)(l);throw s.A.error((0,r.t)("systemtags",'Missing "Content-Location" header')),new Error((0,r.t)("systemtags",'Missing "Content-Location" header'))}catch(t){if(409===t?.response?.status)throw s.A.error((0,r.t)("systemtags","A tag with the same name already exists"),{error:t}),new Error((0,r.t)("systemtags","A tag with the same name already exists"));throw s.A.error((0,r.t)("systemtags","Failed to create tag"),{error:t}),new Error((0,r.t)("systemtags","Failed to create tag"))}},h=async t=>{const e="/systemtags/"+t.id,n=`\n\t\n\t\t\n\t\t\t\n\t\t\t\t${t.displayName}\n\t\t\t\t${t.userVisible}\n\t\t\t\t${t.userAssignable}\n\t\t\t\t${t?.color||null}\n\t\t\t\n\t\t\n\t`;try{await o.R.customRequest(e,{method:"PROPPATCH",data:n}),(0,i.Ic)("systemtags:tag:updated",t)}catch(t){throw s.A.error((0,r.t)("systemtags","Failed to update tag"),{error:t}),new Error((0,r.t)("systemtags","Failed to update tag"))}},g=async function(t,e){const n=`/systemtags/${t.id}/${e}`,r=await o.R.stat(n,{data:'\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t',details:!0});return{etag:r?.data?.props?.getetag||'""',objects:Object.values(r?.data?.props?.["object-ids"]||[]).flat()}},m=async function(t,e,n,r=""){const a=`/systemtags/${t.id}/${e}`;let s=`\n\t\n\t\t\n\t\t\t\n\t\t\t\t${n.map(({id:t,type:e})=>`${t}${e}`).join("")}\n\t\t\t\n\t\t\n\t`;0===n.length&&(s='\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'),await o.R.customRequest(a,{method:"PROPPATCH",data:s,headers:{"if-match":r}})}},86833:()=>{}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,t=[],a.O=(e,n,r,o)=>{if(!n){var s=1/0;for(u=0;u=o)&&Object.keys(a.O).every(t=>a.O[t](n[l]))?n.splice(l--,1):(i=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,r,o]},a.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return a.d(e,{a:e}),e},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce((e,n)=>(a.f[n](t,e),e),[])),a.u=t=>t+"-"+t+".js?v="+{3278:"c97a360506d6ebb6afd2",3564:"1f97cb34040f17de0c20",7471:"428f6893ae52e7aca00b",8790:"9fd8f6ad2d5d29ec25ad",9167:"c89e50ac8548b6b57d92"}[t],a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),e={},n="nextcloud:",a.l=(t,r,o,s)=>{if(e[t])e[t].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(t=>t(r)),n)return n(r)},g=setTimeout(h.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=h.bind(null,i.onerror),i.onload=h.bind(null,i.onload),l&&document.head.appendChild(i)}},a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),a.j=2766,(()=>{var t;a.g.importScripts&&(t=a.g.location+"");var e=a.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=n[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),a.p=t})(),(()=>{a.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={2766:0};a.f.j=(e,n)=>{var r=a.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=t[e]=[n,o]);n.push(r[2]=o);var s=a.p+a.u(e),i=new Error;a.l(s,n=>{if(a.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),s=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+s+")",i.name="ChunkLoadError",i.type=o,i.request=s,r[1](i)}},"chunk-"+e,e)}},a.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[s,i,l]=n,c=0;if(s.some(e=>0!==t[e])){for(r in i)a.o(i,r)&&(a.m[r]=i[r]);if(l)var u=l(a)}for(e&&e(n);ca(45218));s=a.O(s)})(); -//# sourceMappingURL=systemtags-init.js.map?v=28581893784df438450d \ No newline at end of file +(()=>{var t,e,n,r={8828:(t,e,n)=>{"use strict";n.d(e,{R:()=>i});var r=n(45505),o=n(63814),s=n(21777);const a=(0,o.dC)("dav"),i=(0,r.UU)(a),l=t=>{i.setHeaders({"X-Requested-With":"XMLHttpRequest",requesttoken:t??""})};(0,s.zo)(l),l((0,s.do)())},12686:(t,e,n)=>{"use strict";n.d(e,{GX:()=>a,Pq:()=>c,_3:()=>i,rA:()=>l,rL:()=>s});var r=n(71654),o=n(85471);const s=t=>t.map(({props:t})=>Object.fromEntries(Object.entries(t).map(([t,e])=>[(0,r.A)(t),"displayName"===(0,r.A)(t)?String(e):e]))),a=t=>{const e=t.indexOf("?");e>0&&(t=t.substring(0,e));const n=t.split("/");let r;do{r=n[n.length-1],n.pop()}while(!r&&n.length>0);return Number(r)},i=t=>{if("name"in t&&!("displayName"in t))return{...t};const e={...t};return e.name=e.displayName,delete e.displayName,e},l=function(t){const e=t.attributes?.["system-tags"]?.["system-tag"];return void 0===e?[]:[e].flat().map(t=>"string"==typeof t?t:t.text)},c=function(t,e){o.Ay.set(t.attributes,"system-tags",{"system-tag":e})}},25631:(t,e,n)=>{"use strict";n.d(e,{A:()=>r});const r=(0,n(35947).YK)().setApp("systemtags").detectUser().build()},42634:()=>{},45218:(t,e,n)=>{"use strict";var r=n(35810),o=n(94205),s=n(85471),a=n(32505),i=n(85168),l=n(53334);const c='';async function u(t){const e=await new Promise(e=>{(0,i.Ss)((0,s.$V)(()=>Promise.all([n.e(4208),n.e(9167)]).then(n.bind(n,99167))),{nodes:t},t=>{e(t)})});return Array(t.length).fill(e)}const d=new r.hY({id:"systemtags:bulk",displayName:()=>(0,l.t)("systemtags","Manage tags"),iconSvgInline:()=>c,enabled:t=>!(0,a.f)()&&0!==t.length&&!t.some(t=>!t.isDavResource)&&!t.some(t=>0===(t.permissions&r.aX.UPDATE)),exec:async t=>u([t])[0],execBatch:u});var h=n(65899),g=n(61338);const m=(0,n(35947).YK)().setApp("files").detectUser().build(),p=(0,h.nY)("active",()=>{const t=(0,s.KR)(),e=(0,s.KR)(),n=(0,s.KR)(),o=(0,s.KR)();function a(t){n.value&&n.value.source===t.source&&(n.value=void 0)}function i(t=null){m.debug("Setting active view",{view:t}),o.value=t??void 0,n.value=void 0}return function(){const t=(0,r.bh)();(0,g.B1)("files:node:deleted",a),i(t.active),t.addEventListener("updateActive",t=>{i(t.detail)})}(),{activeAction:t,activeFolder:e,activeNode:n,activeView:o}});var b=n(25631),f=n(21777),y=n(82528);const v="/systemtags",w=(0,r.H4)(),A=t=>(0,r.Al)(t),k=t=>`\n\n\t\n\t\t${(0,r.VX)()}\n\t\n\t\n\t\t${t}\n\t\n`,x=function(t){return new r.vd({id:t.id,source:`${r.PY}${v}/${t.id}`,owner:String((0,f.HW)()?.uid??"anonymous"),root:v,displayname:t.displayName,permissions:r.aX.READ,attributes:{...t,"is-tag":!0}})},C="tags";var M=n(85072),N=n.n(M),j=n(97825),O=n.n(j),_=n(77659),E=n.n(_),P=n(55056),S=n.n(P),I=n(10540),$=n.n(I),F=n(41113),L=n.n(F),T=n(73911),q={};q.styleTagTransform=L(),q.setAttributes=S(),q.insert=E().bind(null,"head"),q.domAPI=O(),q.insertStyleElement=$(),N()(T.A,q),T.A&&T.A.locals&&T.A.locals;var z=n(57599),B=n(12686);const R=[],D=function(t,e=!1){const n=document.createElement("li");n.classList.add("files-list__system-tag"),n.setAttribute("data-systemtag-name",t),n.textContent=t;const r=R.find(e=>e.displayName===t);if(r?.color){const t=getComputedStyle(document.body).getPropertyValue("--color-main-background").replace("#","")||((0,z.j2)()?"000000":"ffffff"),e=(0,z.W7)(`#${r.color}`,`#${t}`);n.style.setProperty("--systemtag-color",e),n.setAttribute("data-systemtag-color","true")}return e&&n.classList.add("files-list__system-tag--more"),n},V=async function(t){const e=(0,B.rA)(t),n=document.createElement("ul");if(n.classList.add("files-list__system-tags"),n.setAttribute("aria-label",(0,l.t)("files","Assigned collaborative tags")),n.setAttribute("data-systemtags-fileid",t.fileid?.toString()||""),0===e.length)return n;if(0===R.length)try{R.push(...await(0,y.un)())}catch(t){b.A.error("Failed to fetch tags",{error:t})}if(n.append(D(e[0])),2===e.length)n.append(D(e[1]));else if(e.length>1){const t=D("+"+(e.length-1),!0);t.setAttribute("title",e.slice(1).join(", ")),t.setAttribute("aria-hidden","true"),t.setAttribute("role","presentation"),n.append(t);for(const t of e.slice(1)){const e=D(t);e.classList.add("hidden-visually"),n.append(e)}}return n},U=new r.hY({id:"system-tags",displayName:()=>"",iconSvgInline:()=>"",enabled:t=>1===t.length,exec:async()=>null,renderInline:V,order:0,hotkey:{description:(0,l.t)("files","Manage tags"),key:"T"}});(0,g.B1)("systemtags:node:updated",function(t){V(t).then(e=>{document.querySelectorAll(`[data-systemtags-fileid="${t.fileid}"]`).forEach(t=>{t.replaceWith(e)})})}),(0,g.B1)("systemtags:tag:created",function(t){R.push(t)}),(0,g.B1)("systemtags:tag:deleted",function(t){R.splice(R.findIndex(e=>e.id===t.id),1)}),(0,g.B1)("systemtags:tag:updated",function(t){const e=R.findIndex(e=>e.id===t.id);-1!==e&&(R[e]=t),function(t){document.querySelectorAll(`[data-systemtag-name="${t.displayName}"]`).forEach(e=>{e.style.setProperty("--systemtag-color",`#${t.color}`)})}(t)});const H=new r.hY({id:"systemtags:open-in-files",displayName:()=>(0,l.t)("systemtags","Open in Files"),iconSvgInline:()=>"",enabled:(t,e)=>e.id===C&&1===t.length&&!0!==t[0].attributes["is-tag"]&&t[0].type===r.pt.Folder,async exec(t){let e=t.dirname;return t.type===r.pt.Folder&&(e=t.path),window.OCP.Files.Router.goToRoute(null,{view:"files",fileid:String(t.fileid)},{dir:e,openfile:"true"}),null},order:-1e3,default:r.m9.HIDDEN});(0,r.Yc)("nc:system-tags"),(0,r.Gg)(d),(0,r.Gg)(U),(0,r.Gg)(H),(0,r.bh)().register(new r.Ss({id:C,name:(0,l.Tl)("systemtags","Tags"),caption:(0,l.Tl)("systemtags","List of tags and their associated files and folders."),emptyTitle:(0,l.Tl)("systemtags","No tags found"),emptyCaption:(0,l.Tl)("systemtags","Tags you have created will show up here."),icon:c,order:25,getContents:async(t="/")=>{const e=(await(0,y.un)()).filter(t=>t.userVisible);if("/"===t)return{folder:new r.vd({id:0,source:`${r.PY}${v}`,owner:(0,f.HW)()?.uid,root:v,permissions:r.aX.NONE}),contents:e.map(x)};const n=parseInt(t.split("/",2)[1]),o=e.find(t=>t.id===n);if(!o)throw new Error("Tag not found");return{folder:x(o),contents:(await w.getDirectoryContents(r.lJ,{details:!0,data:k(n),headers:{method:"REPORT"}})).data.map(A)}}})),document.addEventListener("DOMContentLoaded",()=>{(0,o.C)("t",()=>(async t=>{const e=p((window._nc_files_pinia||(window._nc_files_pinia=(0,h.Ey)()),window._nc_files_pinia)),n=window?.OCP?.Files?.Router?.query?.dir||"/",o=e.activeNode,a=e.activeView;if(!o||!a)return void m.error("No active node or view",{node:o,view:a});if(o.status===r.zI.LOADING)return void m.debug("Node is already loading",{node:o});if(!t.enabled([o],a))return void m.debug("Action is not not available for the current context",{action:t,node:o,view:a});let c=t.id;try{c=t.displayName([o],a)}catch(e){m.error("Error while getting action display name",{action:t,error:e})}try{s.Ay.set(o,"status",r.zI.LOADING),e.activeAction=t;const u=await t.exec(o,a,n);if(null==u)return;if(u)return void(0,i.Te)((0,l.t)("files","{displayName}: done",{displayName:c}));(0,i.Qg)((0,l.t)("files","{displayName}: failed",{displayName:c}))}catch(e){m.error("Error while executing action",{action:t,error:e}),(0,i.Qg)((0,l.t)("files","{displayName}: failed",{displayName:c}))}finally{s.Ay.set(o,"status",void 0),e.activeAction=void 0}})(d),{stop:!0,prevent:!0}),b.A.debug("Hotkeys registered")})},57599:(t,e,n)=>{"use strict";n.d(e,{W7:()=>q,Pj:()=>T,j2:()=>L});const r={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const t in r)Object.freeze(r[t]);const o=Object.freeze(r),s=Object.create(null);for(const t in o)Object.hasOwn(o,t)&&(s[o[t]]=t);const a={to:{},get:{}};function i(t,e,n){return Math.min(Math.max(e,t),n)}function l(t){const e=Math.round(t).toString(16).toUpperCase();return e.length<2?"0"+e:e}a.get=function(t){let e,n;switch(t.slice(0,3).toLowerCase()){case"hsl":e=a.get.hsl(t),n="hsl";break;case"hwb":e=a.get.hwb(t),n="hwb";break;default:e=a.get.rgb(t),n="rgb"}return e?{model:n,value:e}:null},a.get.rgb=function(t){if(!t)return null;let e,n,r,s=[0,0,0,1];if(e=t.match(/^#([a-f\d]{6})([a-f\d]{2})?$/i)){for(r=e[2],e=e[1],n=0;n<3;n++){const t=2*n;s[n]=Number.parseInt(e.slice(t,t+2),16)}r&&(s[3]=Number.parseInt(r,16)/255)}else if(e=t.match(/^#([a-f\d]{3,4})$/i)){for(e=e[1],r=e[3],n=0;n<3;n++)s[n]=Number.parseInt(e[n]+e[n],16);r&&(s[3]=Number.parseInt(r+r,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)(?=[\s,])\s*(?:,\s*)?([+-]?(?:\d*\.)?\d+(?:e\d+)?)\s*(?:[\s,|/]\s*([+-]?(?:\d*\.)?\d+(?:e\d+)?)(%?)\s*)?\)$/i)){for(n=0;n<3;n++)s[n]=Number.parseFloat(e[n+1]);e[4]&&(s[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[\s,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Object.hasOwn(o,e[1])?(s=o[e[1]].slice(),s[3]=1,s):null:null;for(n=0;n<3;n++)s[n]=Math.round(2.55*Number.parseFloat(e[n+1]));e[4]&&(s[3]=e[5]?.01*Number.parseFloat(e[4]):Number.parseFloat(e[4]))}for(n=0;n<3;n++)s[n]=i(s[n],0,255);return s[3]=i(s[3],0,1),s},a.get.hsl=function(t){if(!t)return null;const e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){const t=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,i(Number.parseFloat(e[2]),0,100),i(Number.parseFloat(e[3]),0,100),i(Number.isNaN(t)?1:t,0,1)]}return null},a.get.hwb=function(t){if(!t)return null;const e=t.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*[\s,]\s*([+-]?[\d.]+)%\s*[\s,]\s*([+-]?[\d.]+)%\s*(?:[\s,]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){const t=Number.parseFloat(e[4]);return[(Number.parseFloat(e[1])%360+360)%360,i(Number.parseFloat(e[2]),0,100),i(Number.parseFloat(e[3]),0,100),i(Number.isNaN(t)?1:t,0,1)]}return null},a.to.hex=function(...t){return"#"+l(t[0])+l(t[1])+l(t[2])+(t[3]<1?l(Math.round(255*t[3])):"")},a.to.rgb=function(...t){return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},a.to.rgb.percent=function(...t){const e=Math.round(t[0]/255*100),n=Math.round(t[1]/255*100),r=Math.round(t[2]/255*100);return t.length<4||1===t[3]?"rgb("+e+"%, "+n+"%, "+r+"%)":"rgba("+e+"%, "+n+"%, "+r+"%, "+t[3]+")"},a.to.hsl=function(...t){return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"},a.to.hwb=function(...t){let e="";return t.length>=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},a.to.keyword=function(...t){return s[t.slice(0,3)]};const c=a,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};for(const t in u)Object.freeze(u[t]);const d=Object.freeze(u),h={};for(const t of Object.keys(d))h[d[t]]=t;const g={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},oklab:{channels:3,labels:["okl","oka","okb"]},lch:{channels:3,labels:"lch"},oklch:{channels:3,labels:["okl","okc","okh"]},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},m=g,p=(6/29)**3;function b(t){const e=t>.0031308?1.055*t**(1/2.4)-.055:12.92*t;return Math.min(Math.max(0,e),1)}function f(t){return t>.04045?((t+.055)/1.055)**2.4:t/12.92}for(const t of Object.keys(g)){if(!("channels"in g[t]))throw new Error("missing channels property: "+t);if(!("labels"in g[t]))throw new Error("missing channel labels property: "+t);if(g[t].labels.length!==g[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=g[t];delete g[t].channels,delete g[t].labels,Object.defineProperty(g[t],"channels",{value:e}),Object.defineProperty(g[t],"labels",{value:n})}function y(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}function v(t,e){return function(n){return e(t(n))}}function w(t,e){const n=[e[t].parent,t];let r=m[e[t].parent][t],o=e[t].parent;for(;e[o].parent;)n.unshift(e[o].parent),r=v(m[e[o].parent][o],r),o=e[o].parent;return r.conversion=n,r}g.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.min(e,n,r),s=Math.max(e,n,r),a=s-o;let i,l;switch(s){case o:i=0;break;case e:i=(n-r)/a;break;case n:i=2+(r-e)/a;break;case r:i=4+(e-n)/a}i=Math.min(60*i,360),i<0&&(i+=360);const c=(o+s)/2;return l=s===o?0:c<=.5?a/(s+o):a/(2-s-o),[i,100*l,100*c]},g.rgb.hsv=function(t){let e,n,r,o,s;const a=t[0]/255,i=t[1]/255,l=t[2]/255,c=Math.max(a,i,l),u=c-Math.min(a,i,l),d=function(t){return(c-t)/6/u+.5};if(0===u)o=0,s=0;else{switch(s=u/c,e=d(a),n=d(i),r=d(l),c){case a:o=r-n;break;case i:o=1/3+e-r;break;case l:o=2/3+n-e}o<0?o+=1:o>1&&(o-=1)}return[360*o,100*s,100*c]},g.rgb.hwb=function(t){const e=t[0],n=t[1];let r=t[2];const o=g.rgb.hsl(t)[0],s=1/255*Math.min(e,Math.min(n,r));return r=1-1/255*Math.max(e,Math.max(n,r)),[o,100*s,100*r]},g.rgb.oklab=function(t){const e=f(t[0]/255),n=f(t[1]/255),r=f(t[2]/255),o=Math.cbrt(.4122214708*e+.5363325363*n+.0514459929*r),s=Math.cbrt(.2119034982*e+.6806995451*n+.1073969566*r),a=Math.cbrt(.0883024619*e+.2817188376*n+.6299787005*r);return[100*(.2104542553*o+.793617785*s-.0040720468*a),100*(1.9779984951*o-2.428592205*s+.4505937099*a),100*(.0259040371*o+.7827717662*s-.808675766*a)]},g.rgb.cmyk=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.min(1-e,1-n,1-r);return[100*((1-e-o)/(1-o)||0),100*((1-n-o)/(1-o)||0),100*((1-r-o)/(1-o)||0),100*o]},g.rgb.keyword=function(t){const e=h[t];if(e)return e;let n,r=Number.POSITIVE_INFINITY;for(const e of Object.keys(d)){const o=y(t,d[e]);op?n**(1/3):7.787*n+16/116,r=r>p?r**(1/3):7.787*r+16/116,o=o>p?o**(1/3):7.787*o+16/116,[116*r-16,500*(n-r),200*(r-o)]},g.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100;let o,s;if(0===n)return s=255*r,[s,s,s];const a=r<.5?r*(1+n):r+n-r*n,i=2*r-a,l=[0,0,0];for(let t=0;t<3;t++)o=e+1/3*-(t-1),o<0&&o++,o>1&&o--,s=6*o<1?i+6*(a-i)*o:2*o<1?a:3*o<2?i+(a-i)*(2/3-o)*6:i,l[t]=255*s;return l},g.hsl.hsv=function(t){const e=t[0];let n=t[1]/100,r=t[2]/100,o=n;const s=Math.max(r,.01);return r*=2,n*=r<=1?r:2-r,o*=s<=1?s:2-s,[e,100*(0===r?2*o/(s+o):2*n/(r+n)),(r+n)/2*100]},g.hsv.rgb=function(t){const e=t[0]/60,n=t[1]/100;let r=t[2]/100;const o=Math.floor(e)%6,s=e-Math.floor(e),a=255*r*(1-n),i=255*r*(1-n*s),l=255*r*(1-n*(1-s));switch(r*=255,o){case 0:return[r,l,a];case 1:return[i,r,a];case 2:return[a,r,l];case 3:return[a,i,r];case 4:return[l,a,r];case 5:return[r,a,i]}},g.hsv.hsl=function(t){const e=t[0],n=t[1]/100,r=t[2]/100,o=Math.max(r,.01);let s,a;a=(2-n)*r;const i=(2-n)*o;return s=n*o,s/=i<=1?i:2-i,s=s||0,a/=2,[e,100*s,100*a]},g.hwb.rgb=function(t){const e=t[0]/360;let n=t[1]/100,r=t[2]/100;const o=n+r;let s;o>1&&(n/=o,r/=o);const a=Math.floor(6*e),i=1-r;s=6*e-a,1&a&&(s=1-s);const l=n+s*(i-n);let c,u,d;switch(a){default:case 6:case 0:c=i,u=l,d=n;break;case 1:c=l,u=i,d=n;break;case 2:c=n,u=i,d=l;break;case 3:c=n,u=l,d=i;break;case 4:c=l,u=n,d=i;break;case 5:c=i,u=n,d=l}return[255*c,255*u,255*d]},g.cmyk.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=t[3]/100;return[255*(1-Math.min(1,e*(1-o)+o)),255*(1-Math.min(1,n*(1-o)+o)),255*(1-Math.min(1,r*(1-o)+o))]},g.xyz.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100;let o,s,a;return o=3.2404542*e+-1.5371385*n+-.4985314*r,s=-.969266*e+1.8760108*n+.041556*r,a=.0556434*e+-.2040259*n+1.0572252*r,o=b(o),s=b(s),a=b(a),[255*o,255*s,255*a]},g.xyz.lab=function(t){let e=t[0],n=t[1],r=t[2];return e/=95.047,n/=100,r/=108.883,e=e>p?e**(1/3):7.787*e+16/116,n=n>p?n**(1/3):7.787*n+16/116,r=r>p?r**(1/3):7.787*r+16/116,[116*n-16,500*(e-n),200*(n-r)]},g.xyz.oklab=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=Math.cbrt(.8189330101*e+.3618667424*n-.1288597137*r),s=Math.cbrt(.0329845436*e+.9293118715*n+.0361456387*r),a=Math.cbrt(.0482003018*e+.2643662691*n+.633851707*r);return[100*(.2104542553*o+.793617785*s-.0040720468*a),100*(1.9779984951*o-2.428592205*s+.4505937099*a),100*(.0259040371*o+.7827717662*s-.808675766*a)]},g.oklab.oklch=function(t){return g.lab.lch(t)},g.oklab.xyz=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=(.999999998*e+.396337792*n+.215803758*r)**3,s=(1.000000008*e-.105561342*n-.063854175*r)**3,a=(1.000000055*e-.089484182*n-1.291485538*r)**3;return[100*(1.227013851*o-.55779998*s+.281256149*a),100*(-.040580178*o+1.11225687*s-.071676679*a),100*(-.076381285*o-.421481978*s+1.58616322*a)]},g.oklab.rgb=function(t){const e=t[0]/100,n=t[1]/100,r=t[2]/100,o=(e+.3963377774*n+.2158037573*r)**3,s=(e-.1055613458*n-.0638541728*r)**3,a=(e-.0894841775*n-1.291485548*r)**3;return[255*b(4.0767416621*o-3.3077115913*s+.2309699292*a),255*b(-1.2684380046*o+2.6097574011*s-.3413193965*a),255*b(-.0041960863*o-.7034186147*s+1.707614701*a)]},g.oklch.oklab=function(t){return g.lch.lab(t)},g.lab.xyz=function(t){let e,n,r;n=(t[0]+16)/116,e=t[1]/500+n,r=n-t[2]/200;const o=n**3,s=e**3,a=r**3;return n=o>p?o:(n-16/116)/7.787,e=s>p?s:(e-16/116)/7.787,r=a>p?a:(r-16/116)/7.787,e*=95.047,n*=100,r*=108.883,[e,n,r]},g.lab.lch=function(t){const e=t[0],n=t[1],r=t[2];let o;return o=360*Math.atan2(r,n)/2/Math.PI,o<0&&(o+=360),[e,Math.sqrt(n*n+r*r),o]},g.lch.lab=function(t){const e=t[0],n=t[1],r=t[2]/360*2*Math.PI;return[e,n*Math.cos(r),n*Math.sin(r)]},g.rgb.ansi16=function(t,e=null){const[n,r,o]=t;let s=null===e?g.rgb.hsv(t)[2]:e;if(s=Math.round(s/50),0===s)return 30;let a=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return 2===s&&(a+=60),a},g.hsv.ansi16=function(t){return g.rgb.ansi16(g.hsv.rgb(t),t[2])},g.rgb.ansi256=function(t){const e=t[0],n=t[1],r=t[2];return e>>4==n>>4&&n>>4==r>>4?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)},g.ansi16.rgb=function(t){let e=(t=t[0])%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];const n=.5*(Math.trunc(t>50)+1);return[(1&e)*n*255,(e>>1&1)*n*255,(e>>2&1)*n*255]},g.ansi256.rgb=function(t){if((t=t[0])>=232){const e=10*(t-232)+8;return[e,e,e]}let e;return t-=16,[Math.floor(t/36)/5*255,Math.floor((e=t%36)/6)/5*255,e%6/5*255]},g.rgb.hex=function(t){const e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".slice(e.length)+e},g.hex.rgb=function(t){const e=t.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!e)return[0,0,0];let n=e[0];3===e[0].length&&(n=[...n].map(t=>t+t).join(""));const r=Number.parseInt(n,16);return[r>>16&255,r>>8&255,255&r]},g.rgb.hcg=function(t){const e=t[0]/255,n=t[1]/255,r=t[2]/255,o=Math.max(Math.max(e,n),r),s=Math.min(Math.min(e,n),r),a=o-s;let i;return i=a<=0?0:o===e?(n-r)/a%6:o===n?2+(r-e)/a:4+(e-n)/a,i/=6,i%=1,[360*i,100*a,100*(a<1?s/(1-a):0)]},g.hsl.hcg=function(t){const e=t[1]/100,n=t[2]/100,r=n<.5?2*e*n:2*e*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[t[0],100*r,100*o]},g.hsv.hcg=function(t){const e=t[1]/100,n=t[2]/100,r=e*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},g.hcg.rgb=function(t){const e=t[0]/360,n=t[1]/100,r=t[2]/100;if(0===n)return[255*r,255*r,255*r];const o=[0,0,0],s=e%1*6,a=s%1,i=1-a;let l=0;switch(Math.floor(s)){case 0:o[0]=1,o[1]=a,o[2]=0;break;case 1:o[0]=i,o[1]=1,o[2]=0;break;case 2:o[0]=0,o[1]=1,o[2]=a;break;case 3:o[0]=0,o[1]=i,o[2]=1;break;case 4:o[0]=a,o[1]=0,o[2]=1;break;default:o[0]=1,o[1]=0,o[2]=i}return l=(1-n)*r,[255*(n*o[0]+l),255*(n*o[1]+l),255*(n*o[2]+l)]},g.hcg.hsv=function(t){const e=t[1]/100,n=e+t[2]/100*(1-e);let r=0;return n>0&&(r=e/n),[t[0],100*r,100*n]},g.hcg.hsl=function(t){const e=t[1]/100,n=t[2]/100*(1-e)+.5*e;let r=0;return n>0&&n<.5?r=e/(2*n):n>=.5&&n<1&&(r=e/(2*(1-n))),[t[0],100*r,100*n]},g.hcg.hwb=function(t){const e=t[1]/100,n=e+t[2]/100*(1-e);return[t[0],100*(n-e),100*(1-n)]},g.hwb.hcg=function(t){const e=t[1]/100,n=1-t[2]/100,r=n-e;let o=0;return r<1&&(o=(n-r)/(1-r)),[t[0],100*r,100*o]},g.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},g.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},g.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},g.gray.hsl=function(t){return[0,0,t[0]]},g.gray.hsv=g.gray.hsl,g.gray.hwb=function(t){return[0,100,t[0]]},g.gray.cmyk=function(t){return[0,0,0,t[0]]},g.gray.lab=function(t){return[t[0],0,0]},g.gray.hex=function(t){const e=255&Math.round(t[0]/100*255),n=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".slice(n.length)+n},g.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]};const A=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(m);for(let{length:n}=e,r=0;r0;){const t=n.pop(),r=Object.keys(m[t]);for(let{length:o}=r,s=0;s1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function M(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const r=t(e);if("object"==typeof r)for(let{length:t}=r,e=0;e0){this.model=e||"rgb",r=N[this.model].channels;const n=Array.prototype.slice.call(t,0,r);this.color=$(n,r),this.valpha="number"==typeof t[r]?t[r]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const r=e.sort().join("");if(!(r in O))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=O[r];const{labels:o}=N[this.model],s=[];for(n=0;n(t%360+360)%360),saturationl:S("hsl",1,I(100)),lightness:S("hsl",2,I(100)),saturationv:S("hsv",1,I(100)),value:S("hsv",2,I(100)),chroma:S("hcg",1,I(100)),gray:S("hcg",2,I(100)),white:S("hwb",1,I(100)),wblack:S("hwb",2,I(100)),cyan:S("cmyk",0,I(100)),magenta:S("cmyk",1,I(100)),yellow:S("cmyk",2,I(100)),black:S("cmyk",3,I(100)),x:S("xyz",0,I(95.047)),y:S("xyz",1,I(100)),z:S("xyz",2,I(108.833)),l:S("lab",0,I(100)),a:S("lab",1),b:S("lab",2),keyword(t){return void 0!==t?new E(t):N[this.model].keyword(this.color)},hex(t){return void 0!==t?new E(t):c.to.hex(...this.rgb().round().color)},hexa(t){if(void 0!==t)return new E(t);const e=this.rgb().round().color;let n=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===n.length&&(n="0"+n),c.to.hex(...e)+n},rgbNumber(){const t=this.rgb().color;return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},luminosity(){const t=this.rgb().color,e=[];for(const[n,r]of t.entries()){const t=r/255;e[n]=t<=.04045?t/12.92:((t+.055)/1.055)**2.4}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast(t){const e=this.luminosity(),n=t.luminosity();return e>n?(e+.05)/(n+.05):(n+.05)/(e+.05)},level(t){const e=this.contrast(t);return e>=7?"AAA":e>=4.5?"AA":""},isDark(){const t=this.rgb().color;return(2126*t[0]+7152*t[1]+722*t[2])/1e4<128},isLight(){return!this.isDark()},negate(){const t=this.rgb();for(let e=0;e<3;e++)t.color[e]=255-t.color[e];return t},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e},saturate(t){const e=this.hsl();return e.color[1]+=e.color[1]*t,e},desaturate(t){const e=this.hsl();return e.color[1]-=e.color[1]*t,e},whiten(t){const e=this.hwb();return e.color[1]+=e.color[1]*t,e},blacken(t){const e=this.hwb();return e.color[2]+=e.color[2]*t,e},grayscale(){const t=this.rgb().color,e=.3*t[0]+.59*t[1]+.11*t[2];return E.rgb(e,e,e)},fade(t){return this.alpha(this.valpha-this.valpha*t)},opaquer(t){return this.alpha(this.valpha+this.valpha*t)},rotate(t){const e=this.hsl();let n=e.color[0];return n=(n+t)%360,n=n<0?360+n:n,e.color[0]=n,e},mix(t,e){if(!t||!t.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof t);const n=t.rgb(),r=this.rgb(),o=void 0===e?.5:e,s=2*o-1,a=n.alpha()-r.alpha(),i=((s*a===-1?s:(s+a)/(1+s*a))+1)/2,l=1-i;return E.rgb(i*n.red()+l*r.red(),i*n.green()+l*r.green(),i*n.blue()+l*r.blue(),n.alpha()*o+r.alpha()*(1-o))}};for(const t of Object.keys(N)){if(j.includes(t))continue;const{channels:e}=N[t];E.prototype[t]=function(...e){return this.model===t?new E(this):e.length>0?new E(e,t):new E([...(n=N[this.model][t].raw(this.color),Array.isArray(n)?n:[n]),this.valpha],t);var n},E[t]=function(...n){let r=n[0];return"number"==typeof r&&(r=$(n,e)),new E(r,t)}}function P(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function S(t,e,n){t=Array.isArray(t)?t:[t];for(const r of t)(_[r]||=[])[e]=n;return t=t[0],function(r){let o;return void 0!==r?(n&&(r=n(r)),o=this[t](),o.color[e]=r,o):(o=this[t]().color[e],n&&(o=n(o)),o)}}function I(t){return function(e){return Math.max(0,Math.min(t,e))}}function $(t,e){for(let n=0;n.6}(e),r=(o=e,new F(n?t:"#ffffff").mix(new F(o),.83).hex());var o;let s=B(t,r);const a=function(){const t=window?.matchMedia?.("(forced-colors: active)")?.matches,e=document.body.getAttribute("data-themes")?.includes("highcontrast");return e||t||!1}()?5.6:3.2;let i=0,l=t;const c=(n?-100:100)/255;for(;s(t/=255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)),[n,r,o]=e;return.2126*n+.7152*r+.0722*o}function B(t,e){const n=z(t)+.05,r=z(e)+.05;return Math.max(n,r)/Math.min(n,r)}function R(t){const e=new F(t).hsl();return{h:e.color[0],s:e.color[1],l:e.color[2]}}function D(t){return new F(t).hex()}},59169:()=>{},63779:()=>{},73911:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(71354),o=n.n(r),s=n(76314),a=n.n(s)()(o());a.push([t.id,".files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-inline-start:5px}.files-list__system-tag[data-systemtag-color]{border-color:var(--systemtag-color);color:var(--systemtag-color);border-width:2px;line-height:18px}@media(min-width: 512px){.files-list__system-tags{display:flex}}","",{version:3,sources:["webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss"],names:[],mappings:"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,uBAAA,CAID,8CACC,mCAAA,CACA,4BAAA,CACA,gBAAA,CACA,gBAAA,CAIF,yBACC,yBACC,YAAA,CAAA",sourcesContent:["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n.files-list__system-tags {\n\t--min-size: 32px;\n\tdisplay: none;\n\tjustify-content: center;\n\talign-items: center;\n\tmin-width: calc(var(--min-size) * 2);\n\tmax-width: 300px;\n}\n\n.files-list__system-tag {\n\tpadding: 5px 10px;\n\tborder: 1px solid;\n\tborder-radius: var(--border-radius-pill);\n\tborder-color: var(--color-border);\n\tcolor: var(--color-text-maxcontrast);\n\theight: var(--min-size);\n\twhite-space: nowrap;\n\toverflow: hidden;\n\ttext-overflow: ellipsis;\n\tline-height: 20px; // min-size - 2 * 5px padding - 2 * 1px border\n\ttext-align: center;\n\n\t&--more {\n\t\toverflow: visible;\n\t\ttext-overflow: initial;\n\t}\n\n\t// Proper spacing if multiple shown\n\t& + .files-list__system-tag {\n\t\tmargin-inline-start: 5px;\n\t}\n\n\t// With color\n\t&[data-systemtag-color] {\n\t\tborder-color: var(--systemtag-color);\n\t\tcolor: var(--systemtag-color);\n\t\tborder-width: 2px;\n\t\tline-height: 18px; // min-size - 2 * 5px padding - 2 * 2px border\n\t}\n}\n\n@media (min-width: 512px) {\n\t.files-list__system-tags {\n\t\tdisplay: flex;\n\t}\n}\n"],sourceRoot:""}]);const i=a},77199:()=>{},82528:(t,e,n)=>{"use strict";n.d(e,{Gw:()=>h,T0:()=>m,VZ:()=>d,b0:()=>g,un:()=>c,xI:()=>u}),n(19051);var r=n(53334),o=n(8828),s=n(12686),a=n(25631),i=n(61338);n(56760);const l='\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n',c=async()=>{try{const{data:t}=await o.R.getDirectoryContents("/systemtags",{data:l,details:!0,glob:"/systemtags/*"});return(0,s.rL)(t)}catch(t){throw a.A.error((0,r.t)("systemtags","Failed to load tags"),{error:t}),new Error((0,r.t)("systemtags","Failed to load tags"))}},u=async t=>{const e="/systemtags/"+t;try{const{data:t}=await o.R.stat(e,{data:l,details:!0});return(0,s.rL)([t])[0]}catch(t){throw a.A.error((0,r.t)("systemtags","Failed to load tag"),{error:t}),new Error((0,r.t)("systemtags","Failed to load tag"))}},d=async t=>{const e=(0,s._3)(t);try{const{headers:n}=await o.R.customRequest("/systemtags",{method:"POST",data:e}),l=n.get("content-location");if(l)return(0,i.Ic)("systemtags:tag:created",t),(0,s.GX)(l);throw a.A.error((0,r.t)("systemtags",'Missing "Content-Location" header')),new Error((0,r.t)("systemtags",'Missing "Content-Location" header'))}catch(t){if(409===t?.response?.status)throw a.A.error((0,r.t)("systemtags","A tag with the same name already exists"),{error:t}),new Error((0,r.t)("systemtags","A tag with the same name already exists"));throw a.A.error((0,r.t)("systemtags","Failed to create tag"),{error:t}),new Error((0,r.t)("systemtags","Failed to create tag"))}},h=async t=>{const e="/systemtags/"+t.id,n=`\n\t\n\t\t\n\t\t\t\n\t\t\t\t${t.displayName}\n\t\t\t\t${t.userVisible}\n\t\t\t\t${t.userAssignable}\n\t\t\t\t${t?.color||null}\n\t\t\t\n\t\t\n\t`;try{await o.R.customRequest(e,{method:"PROPPATCH",data:n}),(0,i.Ic)("systemtags:tag:updated",t)}catch(t){throw a.A.error((0,r.t)("systemtags","Failed to update tag"),{error:t}),new Error((0,r.t)("systemtags","Failed to update tag"))}},g=async function(t,e){const n=`/systemtags/${t.id}/${e}`,r=await o.R.stat(n,{data:'\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t',details:!0});return{etag:r?.data?.props?.getetag||'""',objects:Object.values(r?.data?.props?.["object-ids"]||[]).flat()}},m=async function(t,e,n,r=""){const s=`/systemtags/${t.id}/${e}`;let a=`\n\t\n\t\t\n\t\t\t\n\t\t\t\t${n.map(({id:t,type:e})=>`${t}${e}`).join("")}\n\t\t\t\n\t\t\n\t`;0===n.length&&(a='\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t'),await o.R.customRequest(s,{method:"PROPPATCH",data:a,headers:{"if-match":r}})}},86833:()=>{}},o={};function s(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=r,t=[],s.O=(e,n,r,o)=>{if(!n){var a=1/0;for(u=0;u=o)&&Object.keys(s.O).every(t=>s.O[t](n[l]))?n.splice(l--,1):(i=!1,o0&&t[u-1][2]>o;u--)t[u]=t[u-1];t[u]=[n,r,o]},s.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return s.d(e,{a:e}),e},s.d=(t,e)=>{for(var n in e)s.o(e,n)&&!s.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},s.f={},s.e=t=>Promise.all(Object.keys(s.f).reduce((e,n)=>(s.f[n](t,e),e),[])),s.u=t=>t+"-"+t+".js?v="+{3278:"c97a360506d6ebb6afd2",3564:"1f97cb34040f17de0c20",7471:"428f6893ae52e7aca00b",8790:"9fd8f6ad2d5d29ec25ad",9167:"c89e50ac8548b6b57d92"}[t],s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),e={},n="nextcloud:",s.l=(t,r,o,a)=>{if(e[t])e[t].push(r);else{var i,l;if(void 0!==o)for(var c=document.getElementsByTagName("script"),u=0;u{i.onerror=i.onload=null,clearTimeout(g);var o=e[t];if(delete e[t],i.parentNode&&i.parentNode.removeChild(i),o&&o.forEach(t=>t(r)),n)return n(r)},g=setTimeout(h.bind(null,void 0,{type:"timeout",target:i}),12e4);i.onerror=h.bind(null,i.onerror),i.onload=h.bind(null,i.onload),l&&document.head.appendChild(i)}},s.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},s.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s.j=2766,(()=>{var t;s.g.importScripts&&(t=s.g.location+"");var e=s.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!t||!/^http(s?):/.test(t));)t=n[r--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=t})(),(()=>{s.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={2766:0};s.f.j=(e,n)=>{var r=s.o(t,e)?t[e]:void 0;if(0!==r)if(r)n.push(r[2]);else{var o=new Promise((n,o)=>r=t[e]=[n,o]);n.push(r[2]=o);var a=s.p+s.u(e),i=new Error;s.l(a,n=>{if(s.o(t,e)&&(0!==(r=t[e])&&(t[e]=void 0),r)){var o=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;i.message="Loading chunk "+e+" failed.\n("+o+": "+a+")",i.name="ChunkLoadError",i.type=o,i.request=a,r[1](i)}},"chunk-"+e,e)}},s.O.j=e=>0===t[e];var e=(e,n)=>{var r,o,[a,i,l]=n,c=0;if(a.some(e=>0!==t[e])){for(r in i)s.o(i,r)&&(s.m[r]=i[r]);if(l)var u=l(s)}for(e&&e(n);cs(45218));a=s.O(a)})(); +//# sourceMappingURL=systemtags-init.js.map?v=6dfa01411e2f0b060831 \ No newline at end of file diff --git a/dist/systemtags-init.js.map b/dist/systemtags-init.js.map index bafc84eccd791..7cb822c3aa76d 100644 --- a/dist/systemtags-init.js.map +++ b/dist/systemtags-init.js.map @@ -1 +1 @@ -{"version":3,"file":"systemtags-init.js?v=28581893784df438450d","mappings":"UAAIA,ECAAC,EACAC,E,qFCOJ,MAAMC,GAAUC,EAAAA,EAAAA,IAAkB,OACrBC,GAAYC,EAAAA,EAAAA,IAAaH,GAEhCI,EAAcC,IAChBH,EAAUE,WAAW,CAEjB,mBAAoB,iBAEpBE,aAAcD,GAAS,OAI/BE,EAAAA,EAAAA,IAAqBH,GACrBA,GAAWI,EAAAA,EAAAA,M,+GCfJ,MAKMC,EAAaC,GACfA,EAAKC,IAAI,EAAGC,WAAYC,OAAOC,YAAYD,OAAOE,QAAQH,GAC5DD,IAAI,EAAEK,EAAKC,KAAW,EAACC,EAAAA,EAAAA,GAAUF,GAAyB,iBAAnBE,EAAAA,EAAAA,GAAUF,GAAyBG,OAAOF,GAASA,MAMtFG,EAAuBC,IAChC,MAAMC,EAAWD,EAAIE,QAAQ,KACzBD,EAAW,IACXD,EAAMA,EAAIG,UAAU,EAAGF,IAE3B,MAAMG,EAAQJ,EAAIK,MAAM,KACxB,IAAIC,EACJ,GACIA,EAASF,EAAMA,EAAMG,OAAS,GAC9BH,EAAMI,aAGAF,GAAUF,EAAMG,OAAS,GACnC,OAAOE,OAAOH,IAELI,EAAaC,IACtB,GAAI,SAAUA,KAAgB,gBAAiBA,GAC3C,MAAO,IAAKA,GAEhB,MAAMC,EAAM,IAAKD,GAGjB,OAFAC,EAAIC,KAAOD,EAAIE,mBACRF,EAAIE,YACJF,GAEEG,EAAoB,SAAUC,GACvC,MAAMC,EAAYD,EAAKE,aAAa,iBAAiB,cACrD,YA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jB,QAAQ4iB,EAAqBzB,KAAK,KAAM,IAC3D6B,EAAmB7jB,KAAOyjB,EAAqBzB,KAAK,KAAM6B,EAAmB7jB,KAAKgiB,KAAK6B,G,KCrFvF9E,EAAoBqC,QAAKhoB,ECGzB,IAAI0qB,EAAsB/E,EAAoBM,OAAEjmB,EAAW,CAAC,MAAO,IAAO2lB,EAAoB,QAC9F+E,EAAsB/E,EAAoBM,EAAEyE,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/load script","webpack:///nextcloud/apps/systemtags/src/services/davClient.ts","webpack:///nextcloud/apps/systemtags/src/utils.ts","webpack:///nextcloud/apps/systemtags/src/logger.ts","webpack:///nextcloud/apps/systemtags/src/files_actions/bulkSystemTagsAction.ts","webpack:///nextcloud/apps/files/src/logger.ts","webpack:///nextcloud/apps/files/src/store/active.ts","webpack:///nextcloud/apps/systemtags/src/services/systemtags.ts","webpack:///nextcloud/apps/systemtags/src/files_views/systemtagsView.ts","webpack://nextcloud/./apps/systemtags/src/css/fileEntryInlineSystemTags.scss?0a01","webpack:///nextcloud/apps/systemtags/src/files_actions/inlineSystemTagsAction.ts","webpack:///nextcloud/apps/systemtags/src/files_actions/openInFilesAction.ts","webpack:///nextcloud/apps/systemtags/src/init.ts","webpack:///nextcloud/apps/systemtags/src/services/HotKeysService.ts","webpack:///nextcloud/apps/files/src/utils/actionUtils.ts","webpack:///nextcloud/apps/files/src/store/index.ts","webpack:///nextcloud/node_modules/color-string/node_modules/color-name/index.js","webpack:///nextcloud/node_modules/color-string/index.js","webpack:///nextcloud/node_modules/color/node_modules/color-name/index.js","webpack:///nextcloud/node_modules/color/node_modules/color-convert/conversions.js","webpack:///nextcloud/node_modules/color/node_modules/color-convert/route.js","webpack:///nextcloud/node_modules/color/node_modules/color-convert/index.js","webpack:///nextcloud/node_modules/color/index.js","webpack:///nextcloud/apps/systemtags/src/utils/colorUtils.ts","webpack:///nextcloud/apps/systemtags/src/css/fileEntryInlineSystemTags.scss","webpack:///nextcloud/apps/systemtags/src/services/api.ts","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/get javascript chunk filename","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/publicPath","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"nextcloud:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createClient } from 'webdav';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth';\n// init webdav client\nconst rootUrl = generateRemoteUrl('dav');\nexport const davClient = createClient(rootUrl);\n// set CSRF token header\nconst setHeaders = (token) => {\n davClient.setHeaders({\n // Add this so the server knows it is an request from the browser\n 'X-Requested-With': 'XMLHttpRequest',\n // Inject user auth\n requesttoken: token ?? '',\n });\n};\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders);\nsetHeaders(getRequestToken());\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport camelCase from 'camelcase';\nimport Vue from 'vue';\nexport const defaultBaseTag = {\n userVisible: true,\n userAssignable: true,\n canAssign: true,\n};\nexport const parseTags = (tags) => {\n return tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n .map(([key, value]) => [camelCase(key), camelCase(key) === 'displayName' ? String(value) : value])));\n};\n/**\n * Parse id from `Content-Location` header\n * @param url URL to parse\n */\nexport const parseIdFromLocation = (url) => {\n const queryPos = url.indexOf('?');\n if (queryPos > 0) {\n url = url.substring(0, queryPos);\n }\n const parts = url.split('/');\n let result;\n do {\n result = parts[parts.length - 1];\n parts.pop();\n // note: first result can be empty when there is a trailing slash,\n // so we take the part before that\n } while (!result && parts.length > 0);\n return Number(result);\n};\nexport const formatTag = (initialTag) => {\n if ('name' in initialTag && !('displayName' in initialTag)) {\n return { ...initialTag };\n }\n const tag = { ...initialTag };\n tag.name = tag.displayName;\n delete tag.displayName;\n return tag;\n};\nexport const getNodeSystemTags = function (node) {\n const attribute = node.attributes?.['system-tags']?.['system-tag'];\n if (attribute === undefined) {\n return [];\n }\n // if there is only one tag it is a single string or prop object\n // if there are multiple then its an array - so we flatten it to be always an array of string or prop objects\n return [attribute]\n .flat()\n .map((tag) => (typeof tag === 'string'\n // its a plain text prop (the tag name) without prop attributes\n ? tag\n // its a prop object with attributes, the tag name is in the 'text' attribute\n : tag.text));\n};\nexport const setNodeSystemTags = function (node, tags) {\n Vue.set(node.attributes, 'system-tags', {\n 'system-tag': tags,\n });\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport default getLoggerBuilder()\n .setApp('systemtags')\n .detectUser()\n .build();\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { Permission } from '@nextcloud/files';\nimport { defineAsyncComponent } from 'vue';\nimport { FileAction } from '@nextcloud/files';\nimport { isPublicShare } from '@nextcloud/sharing/public';\nimport { spawnDialog } from '@nextcloud/dialogs';\nimport { t } from '@nextcloud/l10n';\nimport TagMultipleSvg from '@mdi/svg/svg/tag-multiple-outline.svg?raw';\n/**\n * Spawn a dialog to add or remove tags from multiple nodes.\n * @param nodes Nodes to modify tags for\n */\nasync function execBatch(nodes) {\n const response = await new Promise((resolve) => {\n spawnDialog(defineAsyncComponent(() => import('../components/SystemTagPicker.vue')), {\n nodes,\n }, (status) => {\n resolve(status);\n });\n });\n return Array(nodes.length).fill(response);\n}\nexport const action = new FileAction({\n id: 'systemtags:bulk',\n displayName: () => t('systemtags', 'Manage tags'),\n iconSvgInline: () => TagMultipleSvg,\n // If the app is disabled, the action is not available anyway\n enabled(nodes) {\n if (isPublicShare()) {\n return false;\n }\n if (nodes.length === 0) {\n return false;\n }\n // Disabled for non dav resources\n if (nodes.some((node) => !node.isDavResource)) {\n return false;\n }\n // We need to have the update permission on all nodes\n return !nodes.some((node) => (node.permissions & Permission.UPDATE) === 0);\n },\n async exec(node) {\n return execBatch([node])[0];\n },\n execBatch,\n});\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport default getLoggerBuilder()\n .setApp('files')\n .detectUser()\n .build();\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { subscribe } from '@nextcloud/event-bus';\nimport { getNavigation } from '@nextcloud/files';\nimport { defineStore } from 'pinia';\nimport { ref } from 'vue';\nimport logger from '../logger.ts';\nexport const useActiveStore = defineStore('active', () => {\n /**\n * The currently active action\n */\n const activeAction = ref();\n /**\n * The currently active folder\n */\n const activeFolder = ref();\n /**\n * The current active node within the folder\n */\n const activeNode = ref();\n /**\n * The current active view\n */\n const activeView = ref();\n initialize();\n /**\n * Unset the active node if deleted\n *\n * @param node - The node thats deleted\n * @private\n */\n function onDeletedNode(node) {\n if (activeNode.value && activeNode.value.source === node.source) {\n activeNode.value = undefined;\n }\n }\n /**\n * Callback to update the current active view\n *\n * @param view - The new active view\n * @private\n */\n function onChangedView(view = null) {\n logger.debug('Setting active view', { view });\n activeView.value = view ?? undefined;\n activeNode.value = undefined;\n }\n /**\n * Initalize the store - connect all event listeners.\n * @private\n */\n function initialize() {\n const navigation = getNavigation();\n // Make sure we only register the listeners once\n subscribe('files:node:deleted', onDeletedNode);\n onChangedView(navigation.active);\n // Or you can react to changes of the current active view\n navigation.addEventListener('updateActive', (event) => {\n onChangedView(event.detail);\n });\n }\n return {\n activeAction,\n activeFolder,\n activeNode,\n activeView,\n };\n});\n","import { getCurrentUser } from '@nextcloud/auth';\nimport { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode, davRemoteURL, davRootPath } from '@nextcloud/files';\nimport { fetchTags } from './api';\nconst rootPath = '/systemtags';\nconst client = davGetClient();\nconst resultToNode = (node) => davResultToNode(node);\nconst formatReportPayload = (tagId) => `\n\n\t\n\t\t${getDavProperties()}\n\t\n\t\n\t\t${tagId}\n\t\n`;\nconst tagToNode = function (tag) {\n return new Folder({\n id: tag.id,\n source: `${davRemoteURL}${rootPath}/${tag.id}`,\n owner: String(getCurrentUser()?.uid ?? 'anonymous'),\n root: rootPath,\n displayname: tag.displayName,\n permissions: Permission.READ,\n attributes: {\n ...tag,\n 'is-tag': true,\n },\n });\n};\nexport const getContents = async (path = '/') => {\n // List tags in the root\n const tagsCache = (await fetchTags()).filter(tag => tag.userVisible);\n if (path === '/') {\n return {\n folder: new Folder({\n id: 0,\n source: `${davRemoteURL}${rootPath}`,\n owner: getCurrentUser()?.uid,\n root: rootPath,\n permissions: Permission.NONE,\n }),\n contents: tagsCache.map(tagToNode),\n };\n }\n const tagId = parseInt(path.split('/', 2)[1]);\n const tag = tagsCache.find(tag => tag.id === tagId);\n if (!tag) {\n throw new Error('Tag not found');\n }\n const folder = tagToNode(tag);\n const contentsResponse = await client.getDirectoryContents(davRootPath, {\n details: true,\n // Only filter favorites if we're at the root\n data: formatReportPayload(tagId),\n headers: {\n // Patched in WebdavClient.ts\n method: 'REPORT',\n },\n });\n return {\n folder,\n contents: contentsResponse.data.map(resultToNode),\n };\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { translate as t } from '@nextcloud/l10n';\nimport { View, getNavigation } from '@nextcloud/files';\nimport { getContents } from '../services/systemtags.js';\nimport svgTagMultiple from '@mdi/svg/svg/tag-multiple-outline.svg?raw';\nexport const systemTagsViewId = 'tags';\n/**\n * Register the system tags files view\n */\nexport function registerSystemTagsView() {\n const Navigation = getNavigation();\n Navigation.register(new View({\n id: systemTagsViewId,\n name: t('systemtags', 'Tags'),\n caption: t('systemtags', 'List of tags and their associated files and folders.'),\n emptyTitle: t('systemtags', 'No tags found'),\n emptyCaption: t('systemtags', 'Tags you have created will show up here.'),\n icon: svgTagMultiple,\n order: 25,\n getContents,\n }));\n}\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import { FileAction } from '@nextcloud/files';\nimport { subscribe } from '@nextcloud/event-bus';\nimport { t } from '@nextcloud/l10n';\nimport '../css/fileEntryInlineSystemTags.scss';\nimport { elementColor, isDarkModeEnabled } from '../utils/colorUtils';\nimport { fetchTags } from '../services/api';\nimport { getNodeSystemTags } from '../utils';\nimport logger from '../logger.ts';\n// Init tag cache\nconst cache = [];\nconst renderTag = function (tag, isMore = false) {\n const tagElement = document.createElement('li');\n tagElement.classList.add('files-list__system-tag');\n tagElement.setAttribute('data-systemtag-name', tag);\n tagElement.textContent = tag;\n // Set the color if it exists\n const cachedTag = cache.find((t) => t.displayName === tag);\n if (cachedTag?.color) {\n // Make sure contrast is good and follow WCAG guidelines\n const mainBackgroundColor = getComputedStyle(document.body)\n .getPropertyValue('--color-main-background')\n .replace('#', '') || (isDarkModeEnabled() ? '000000' : 'ffffff');\n const primaryElement = elementColor(`#${cachedTag.color}`, `#${mainBackgroundColor}`);\n tagElement.style.setProperty('--systemtag-color', primaryElement);\n tagElement.setAttribute('data-systemtag-color', 'true');\n }\n if (isMore) {\n tagElement.classList.add('files-list__system-tag--more');\n }\n return tagElement;\n};\nconst renderInline = async function (node) {\n // Ensure we have the system tags as an array\n const tags = getNodeSystemTags(node);\n const systemTagsElement = document.createElement('ul');\n systemTagsElement.classList.add('files-list__system-tags');\n systemTagsElement.setAttribute('aria-label', t('files', 'Assigned collaborative tags'));\n systemTagsElement.setAttribute('data-systemtags-fileid', node.fileid?.toString() || '');\n if (tags.length === 0) {\n return systemTagsElement;\n }\n // Fetch the tags if the cache is empty\n if (cache.length === 0) {\n try {\n // Best would be to support attributes from webdav,\n // but currently the library does not support it\n cache.push(...await fetchTags());\n }\n catch (error) {\n logger.error('Failed to fetch tags', { error });\n }\n }\n systemTagsElement.append(renderTag(tags[0]));\n if (tags.length === 2) {\n // Special case only two tags:\n // the overflow fake tag would take the same space as this, so render it\n systemTagsElement.append(renderTag(tags[1]));\n }\n else if (tags.length > 1) {\n // More tags than the one we're showing\n // So we add a overflow element indicating there are more tags\n const moreTagElement = renderTag('+' + (tags.length - 1), true);\n moreTagElement.setAttribute('title', tags.slice(1).join(', '));\n // because the title is not accessible we hide this element for screen readers (see alternative below)\n moreTagElement.setAttribute('aria-hidden', 'true');\n moreTagElement.setAttribute('role', 'presentation');\n systemTagsElement.append(moreTagElement);\n // For accessibility the tags are listed, as the title is not accessible\n // but those tags are visually hidden\n for (const tag of tags.slice(1)) {\n const tagElement = renderTag(tag);\n tagElement.classList.add('hidden-visually');\n systemTagsElement.append(tagElement);\n }\n }\n return systemTagsElement;\n};\nexport const action = new FileAction({\n id: 'system-tags',\n displayName: () => '',\n iconSvgInline: () => '',\n enabled(nodes) {\n // Only show the action on single nodes\n if (nodes.length !== 1) {\n return false;\n }\n // Always show the action, even if there are no tags\n // This will render an empty tag list and allow events to update it\n return true;\n },\n exec: async () => null,\n renderInline,\n order: 0,\n hotkey: {\n description: t('files', 'Manage tags'),\n key: 'T',\n },\n});\n// Update the system tags html when the node is updated\nconst updateSystemTagsHtml = function (node) {\n renderInline(node).then((systemTagsHtml) => {\n document.querySelectorAll(`[data-systemtags-fileid=\"${node.fileid}\"]`).forEach((element) => {\n element.replaceWith(systemTagsHtml);\n });\n });\n};\n// Add and remove tags from the cache\nconst addTag = function (tag) {\n cache.push(tag);\n};\nconst removeTag = function (tag) {\n cache.splice(cache.findIndex((t) => t.id === tag.id), 1);\n};\nconst updateTag = function (tag) {\n const index = cache.findIndex((t) => t.id === tag.id);\n if (index !== -1) {\n cache[index] = tag;\n }\n updateSystemTagsColorAttribute(tag);\n};\n// Update the color attribute of the system tags\nconst updateSystemTagsColorAttribute = function (tag) {\n document.querySelectorAll(`[data-systemtag-name=\"${tag.displayName}\"]`).forEach((element) => {\n element.style.setProperty('--systemtag-color', `#${tag.color}`);\n });\n};\n// Subscribe to the events\nsubscribe('systemtags:node:updated', updateSystemTagsHtml);\nsubscribe('systemtags:tag:created', addTag);\nsubscribe('systemtags:tag:deleted', removeTag);\nsubscribe('systemtags:tag:updated', updateTag);\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport {} from '@nextcloud/files';\nimport { FileType, FileAction, DefaultType } from '@nextcloud/files';\nimport { t } from '@nextcloud/l10n';\nimport { systemTagsViewId } from '../files_views/systemtagsView';\nexport const action = new FileAction({\n id: 'systemtags:open-in-files',\n displayName: () => t('systemtags', 'Open in Files'),\n iconSvgInline: () => '',\n enabled(nodes, view) {\n // Only for the system tags view\n if (view.id !== systemTagsViewId) {\n return false;\n }\n // Only for single nodes\n if (nodes.length !== 1) {\n return false;\n }\n // Do not open tags (keep the default action) and only open folders\n return nodes[0].attributes['is-tag'] !== true\n && nodes[0].type === FileType.Folder;\n },\n async exec(node) {\n let dir = node.dirname;\n if (node.type === FileType.Folder) {\n dir = node.path;\n }\n window.OCP.Files.Router.goToRoute(null, // use default route\n { view: 'files', fileid: String(node.fileid) }, { dir, openfile: 'true' });\n return null;\n },\n // Before openFolderAction\n order: -1000,\n default: DefaultType.HIDDEN,\n});\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { registerDavProperty, registerFileAction } from '@nextcloud/files';\nimport { registerHotkeys } from './services/HotKeysService';\nimport { registerSystemTagsView } from './files_views/systemtagsView';\nimport { action as bulkSystemTagsAction } from './files_actions/bulkSystemTagsAction';\nimport { action as inlineSystemTagsAction } from './files_actions/inlineSystemTagsAction';\nimport { action as openInFilesAction } from './files_actions/openInFilesAction';\nregisterDavProperty('nc:system-tags');\nregisterFileAction(bulkSystemTagsAction);\nregisterFileAction(inlineSystemTagsAction);\nregisterFileAction(openInFilesAction);\nregisterSystemTagsView();\ndocument.addEventListener('DOMContentLoaded', () => {\n registerHotkeys();\n});\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { useHotKey } from '@nextcloud/vue/composables/useHotKey';\nimport { action as manageTagAction } from '../files_actions/bulkSystemTagsAction.ts';\nimport { executeAction } from '../../../files/src/utils/actionUtils.ts';\nimport logger from '../logger.ts';\n/**\n * This register the hotkeys for the Files app.\n * As much as possible, we try to have all the hotkeys in one place.\n * Please make sure to add tests for the hotkeys after adding a new one.\n */\nexport const registerHotkeys = function () {\n // t opens the tag management dialog\n useHotKey('t', () => executeAction(manageTagAction), {\n stop: true,\n prevent: true,\n });\n logger.debug('Hotkeys registered');\n};\n","import { NodeStatus } from '@nextcloud/files';\nimport { showError, showSuccess } from '@nextcloud/dialogs';\nimport { t } from '@nextcloud/l10n';\nimport Vue from 'vue';\nimport { getPinia } from '../store';\nimport { useActiveStore } from '../store/active';\nimport logger from '../logger';\n/**\n * Execute an action on the current active node\n *\n * @param action The action to execute\n */\nexport const executeAction = async (action) => {\n const activeStore = useActiveStore(getPinia());\n const currentDir = (window?.OCP?.Files?.Router?.query?.dir || '/');\n const currentNode = activeStore.activeNode;\n const currentView = activeStore.activeView;\n if (!currentNode || !currentView) {\n logger.error('No active node or view', { node: currentNode, view: currentView });\n return;\n }\n if (currentNode.status === NodeStatus.LOADING) {\n logger.debug('Node is already loading', { node: currentNode });\n return;\n }\n if (!action.enabled([currentNode], currentView)) {\n logger.debug('Action is not not available for the current context', { action, node: currentNode, view: currentView });\n return;\n }\n let displayName = action.id;\n try {\n displayName = action.displayName([currentNode], currentView);\n }\n catch (error) {\n logger.error('Error while getting action display name', { action, error });\n }\n try {\n // Set the loading marker\n Vue.set(currentNode, 'status', NodeStatus.LOADING);\n activeStore.activeAction = action;\n const success = await action.exec(currentNode, currentView, currentDir);\n // If the action returns null, we stay silent\n if (success === null || success === undefined) {\n return;\n }\n if (success) {\n showSuccess(t('files', '{displayName}: done', { displayName }));\n return;\n }\n showError(t('files', '{displayName}: failed', { displayName }));\n }\n catch (error) {\n logger.error('Error while executing action', { action, error });\n showError(t('files', '{displayName}: failed', { displayName }));\n }\n finally {\n // Reset the loading marker\n Vue.set(currentNode, 'status', undefined);\n activeStore.activeAction = undefined;\n }\n};\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createPinia } from 'pinia';\nexport const getPinia = () => {\n if (window._nc_files_pinia) {\n return window._nc_files_pinia;\n }\n window._nc_files_pinia = createPinia();\n return window._nc_files_pinia;\n};\n","export default {\n\taliceblue: [240, 248, 255],\n\tantiquewhite: [250, 235, 215],\n\taqua: [0, 255, 255],\n\taquamarine: [127, 255, 212],\n\tazure: [240, 255, 255],\n\tbeige: [245, 245, 220],\n\tbisque: [255, 228, 196],\n\tblack: [0, 0, 0],\n\tblanchedalmond: [255, 235, 205],\n\tblue: [0, 0, 255],\n\tblueviolet: [138, 43, 226],\n\tbrown: [165, 42, 42],\n\tburlywood: [222, 184, 135],\n\tcadetblue: [95, 158, 160],\n\tchartreuse: [127, 255, 0],\n\tchocolate: [210, 105, 30],\n\tcoral: [255, 127, 80],\n\tcornflowerblue: [100, 149, 237],\n\tcornsilk: [255, 248, 220],\n\tcrimson: [220, 20, 60],\n\tcyan: [0, 255, 255],\n\tdarkblue: [0, 0, 139],\n\tdarkcyan: [0, 139, 139],\n\tdarkgoldenrod: [184, 134, 11],\n\tdarkgray: [169, 169, 169],\n\tdarkgreen: [0, 100, 0],\n\tdarkgrey: [169, 169, 169],\n\tdarkkhaki: [189, 183, 107],\n\tdarkmagenta: [139, 0, 139],\n\tdarkolivegreen: [85, 107, 47],\n\tdarkorange: [255, 140, 0],\n\tdarkorchid: [153, 50, 204],\n\tdarkred: [139, 0, 0],\n\tdarksalmon: [233, 150, 122],\n\tdarkseagreen: [143, 188, 143],\n\tdarkslateblue: [72, 61, 139],\n\tdarkslategray: [47, 79, 79],\n\tdarkslategrey: [47, 79, 79],\n\tdarkturquoise: [0, 206, 209],\n\tdarkviolet: [148, 0, 211],\n\tdeeppink: [255, 20, 147],\n\tdeepskyblue: [0, 191, 255],\n\tdimgray: [105, 105, 105],\n\tdimgrey: [105, 105, 105],\n\tdodgerblue: [30, 144, 255],\n\tfirebrick: [178, 34, 34],\n\tfloralwhite: [255, 250, 240],\n\tforestgreen: [34, 139, 34],\n\tfuchsia: [255, 0, 255],\n\tgainsboro: [220, 220, 220],\n\tghostwhite: [248, 248, 255],\n\tgold: [255, 215, 0],\n\tgoldenrod: [218, 165, 32],\n\tgray: [128, 128, 128],\n\tgreen: [0, 128, 0],\n\tgreenyellow: [173, 255, 47],\n\tgrey: [128, 128, 128],\n\thoneydew: [240, 255, 240],\n\thotpink: [255, 105, 180],\n\tindianred: [205, 92, 92],\n\tindigo: [75, 0, 130],\n\tivory: [255, 255, 240],\n\tkhaki: [240, 230, 140],\n\tlavender: [230, 230, 250],\n\tlavenderblush: [255, 240, 245],\n\tlawngreen: [124, 252, 0],\n\tlemonchiffon: [255, 250, 205],\n\tlightblue: [173, 216, 230],\n\tlightcoral: [240, 128, 128],\n\tlightcyan: [224, 255, 255],\n\tlightgoldenrodyellow: [250, 250, 210],\n\tlightgray: [211, 211, 211],\n\tlightgreen: [144, 238, 144],\n\tlightgrey: [211, 211, 211],\n\tlightpink: [255, 182, 193],\n\tlightsalmon: [255, 160, 122],\n\tlightseagreen: [32, 178, 170],\n\tlightskyblue: [135, 206, 250],\n\tlightslategray: [119, 136, 153],\n\tlightslategrey: [119, 136, 153],\n\tlightsteelblue: [176, 196, 222],\n\tlightyellow: [255, 255, 224],\n\tlime: [0, 255, 0],\n\tlimegreen: [50, 205, 50],\n\tlinen: [250, 240, 230],\n\tmagenta: [255, 0, 255],\n\tmaroon: [128, 0, 0],\n\tmediumaquamarine: [102, 205, 170],\n\tmediumblue: [0, 0, 205],\n\tmediumorchid: [186, 85, 211],\n\tmediumpurple: [147, 112, 219],\n\tmediumseagreen: [60, 179, 113],\n\tmediumslateblue: [123, 104, 238],\n\tmediumspringgreen: [0, 250, 154],\n\tmediumturquoise: [72, 209, 204],\n\tmediumvioletred: [199, 21, 133],\n\tmidnightblue: [25, 25, 112],\n\tmintcream: [245, 255, 250],\n\tmistyrose: [255, 228, 225],\n\tmoccasin: [255, 228, 181],\n\tnavajowhite: [255, 222, 173],\n\tnavy: [0, 0, 128],\n\toldlace: [253, 245, 230],\n\tolive: [128, 128, 0],\n\tolivedrab: [107, 142, 35],\n\torange: [255, 165, 0],\n\torangered: [255, 69, 0],\n\torchid: [218, 112, 214],\n\tpalegoldenrod: [238, 232, 170],\n\tpalegreen: [152, 251, 152],\n\tpaleturquoise: [175, 238, 238],\n\tpalevioletred: [219, 112, 147],\n\tpapayawhip: [255, 239, 213],\n\tpeachpuff: [255, 218, 185],\n\tperu: [205, 133, 63],\n\tpink: [255, 192, 203],\n\tplum: [221, 160, 221],\n\tpowderblue: [176, 224, 230],\n\tpurple: [128, 0, 128],\n\trebeccapurple: [102, 51, 153],\n\tred: [255, 0, 0],\n\trosybrown: [188, 143, 143],\n\troyalblue: [65, 105, 225],\n\tsaddlebrown: [139, 69, 19],\n\tsalmon: [250, 128, 114],\n\tsandybrown: [244, 164, 96],\n\tseagreen: [46, 139, 87],\n\tseashell: [255, 245, 238],\n\tsienna: [160, 82, 45],\n\tsilver: [192, 192, 192],\n\tskyblue: [135, 206, 235],\n\tslateblue: [106, 90, 205],\n\tslategray: [112, 128, 144],\n\tslategrey: [112, 128, 144],\n\tsnow: [255, 250, 250],\n\tspringgreen: [0, 255, 127],\n\tsteelblue: [70, 130, 180],\n\ttan: [210, 180, 140],\n\tteal: [0, 128, 128],\n\tthistle: [216, 191, 216],\n\ttomato: [255, 99, 71],\n\tturquoise: [64, 224, 208],\n\tviolet: [238, 130, 238],\n\twheat: [245, 222, 179],\n\twhite: [255, 255, 255],\n\twhitesmoke: [245, 245, 245],\n\tyellow: [255, 255, 0],\n\tyellowgreen: [154, 205, 50]\n}\n","import colorNames from 'color-name';\n\nconst reverseNames = Object.create(null);\n\n// Create a list of reverse color names\nfor (const name in colorNames) {\n\tif (Object.hasOwn(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nconst cs = {\n\tto: {},\n\tget: {},\n};\n\ncs.get = function (string) {\n\tconst prefix = string.slice(0, 3).toLowerCase();\n\tlet value;\n\tlet model;\n\tswitch (prefix) {\n\t\tcase 'hsl': {\n\t\t\tvalue = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'hwb': {\n\t\t\tvalue = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault: {\n\t\t\tvalue = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!value) {\n\t\treturn null;\n\t}\n\n\treturn {model, value};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tconst abbr = /^#([a-f\\d]{3,4})$/i;\n\tconst hex = /^#([a-f\\d]{6})([a-f\\d]{2})?$/i;\n\tconst rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|/]\\s*([+-]?[\\d.]+)(%?)\\s*)?\\)$/;\n\tconst per = /^rgba?\\(\\s*([+-]?[\\d.]+)%\\s*,?\\s*([+-]?[\\d.]+)%\\s*,?\\s*([+-]?[\\d.]+)%\\s*(?:[,|/]\\s*([+-]?[\\d.]+)(%?)\\s*)?\\)$/;\n\tconst keyword = /^(\\w+)$/;\n\n\tlet rgb = [0, 0, 0, 1];\n\tlet match;\n\tlet i;\n\tlet hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tconst i2 = i * 2;\n\t\t\trgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = Number.parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Number.parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Number.parseInt(match[i + 1], 10);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\trgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\trgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!Object.hasOwn(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tconst hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d.]+)%\\s*,?\\s*([+-]?[\\d.]+)%\\s*(?:[,|/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tconst match = string.match(hsl);\n\n\tif (match) {\n\t\tconst alpha = Number.parseFloat(match[4]);\n\t\tconst h = ((Number.parseFloat(match[1]) % 360) + 360) % 360;\n\t\tconst s = clamp(Number.parseFloat(match[2]), 0, 100);\n\t\tconst l = clamp(Number.parseFloat(match[3]), 0, 100);\n\t\tconst a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tconst hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*,\\s*([+-]?[\\d.]+)%\\s*,\\s*([+-]?[\\d.]+)%\\s*(?:,\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tconst match = string.match(hwb);\n\n\tif (match) {\n\t\tconst alpha = Number.parseFloat(match[4]);\n\t\tconst h = ((Number.parseFloat(match[1]) % 360) + 360) % 360;\n\t\tconst w = clamp(Number.parseFloat(match[2]), 0, 100);\n\t\tconst b = clamp(Number.parseFloat(match[3]), 0, 100);\n\t\tconst a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function (...rgba) {\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function (...rgba) {\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function (...rgba) {\n\tconst r = Math.round(rgba[0] / 255 * 100);\n\tconst g = Math.round(rgba[1] / 255 * 100);\n\tconst b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function (...hsla) {\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// Hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function (...hwba) {\n\tlet a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (...rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// Helpers\nfunction clamp(number_, min, max) {\n\treturn Math.min(Math.max(min, number_), max);\n}\n\nfunction hexDouble(number_) {\n\tconst string_ = Math.round(number_).toString(16).toUpperCase();\n\treturn (string_.length < 2) ? '0' + string_ : string_;\n}\n\nexport default cs;\n","export default {\n\taliceblue: [240, 248, 255],\n\tantiquewhite: [250, 235, 215],\n\taqua: [0, 255, 255],\n\taquamarine: [127, 255, 212],\n\tazure: [240, 255, 255],\n\tbeige: [245, 245, 220],\n\tbisque: [255, 228, 196],\n\tblack: [0, 0, 0],\n\tblanchedalmond: [255, 235, 205],\n\tblue: [0, 0, 255],\n\tblueviolet: [138, 43, 226],\n\tbrown: [165, 42, 42],\n\tburlywood: [222, 184, 135],\n\tcadetblue: [95, 158, 160],\n\tchartreuse: [127, 255, 0],\n\tchocolate: [210, 105, 30],\n\tcoral: [255, 127, 80],\n\tcornflowerblue: [100, 149, 237],\n\tcornsilk: [255, 248, 220],\n\tcrimson: [220, 20, 60],\n\tcyan: [0, 255, 255],\n\tdarkblue: [0, 0, 139],\n\tdarkcyan: [0, 139, 139],\n\tdarkgoldenrod: [184, 134, 11],\n\tdarkgray: [169, 169, 169],\n\tdarkgreen: [0, 100, 0],\n\tdarkgrey: [169, 169, 169],\n\tdarkkhaki: [189, 183, 107],\n\tdarkmagenta: [139, 0, 139],\n\tdarkolivegreen: [85, 107, 47],\n\tdarkorange: [255, 140, 0],\n\tdarkorchid: [153, 50, 204],\n\tdarkred: [139, 0, 0],\n\tdarksalmon: [233, 150, 122],\n\tdarkseagreen: [143, 188, 143],\n\tdarkslateblue: [72, 61, 139],\n\tdarkslategray: [47, 79, 79],\n\tdarkslategrey: [47, 79, 79],\n\tdarkturquoise: [0, 206, 209],\n\tdarkviolet: [148, 0, 211],\n\tdeeppink: [255, 20, 147],\n\tdeepskyblue: [0, 191, 255],\n\tdimgray: [105, 105, 105],\n\tdimgrey: [105, 105, 105],\n\tdodgerblue: [30, 144, 255],\n\tfirebrick: [178, 34, 34],\n\tfloralwhite: [255, 250, 240],\n\tforestgreen: [34, 139, 34],\n\tfuchsia: [255, 0, 255],\n\tgainsboro: [220, 220, 220],\n\tghostwhite: [248, 248, 255],\n\tgold: [255, 215, 0],\n\tgoldenrod: [218, 165, 32],\n\tgray: [128, 128, 128],\n\tgreen: [0, 128, 0],\n\tgreenyellow: [173, 255, 47],\n\tgrey: [128, 128, 128],\n\thoneydew: [240, 255, 240],\n\thotpink: [255, 105, 180],\n\tindianred: [205, 92, 92],\n\tindigo: [75, 0, 130],\n\tivory: [255, 255, 240],\n\tkhaki: [240, 230, 140],\n\tlavender: [230, 230, 250],\n\tlavenderblush: [255, 240, 245],\n\tlawngreen: [124, 252, 0],\n\tlemonchiffon: [255, 250, 205],\n\tlightblue: [173, 216, 230],\n\tlightcoral: [240, 128, 128],\n\tlightcyan: [224, 255, 255],\n\tlightgoldenrodyellow: [250, 250, 210],\n\tlightgray: [211, 211, 211],\n\tlightgreen: [144, 238, 144],\n\tlightgrey: [211, 211, 211],\n\tlightpink: [255, 182, 193],\n\tlightsalmon: [255, 160, 122],\n\tlightseagreen: [32, 178, 170],\n\tlightskyblue: [135, 206, 250],\n\tlightslategray: [119, 136, 153],\n\tlightslategrey: [119, 136, 153],\n\tlightsteelblue: [176, 196, 222],\n\tlightyellow: [255, 255, 224],\n\tlime: [0, 255, 0],\n\tlimegreen: [50, 205, 50],\n\tlinen: [250, 240, 230],\n\tmagenta: [255, 0, 255],\n\tmaroon: [128, 0, 0],\n\tmediumaquamarine: [102, 205, 170],\n\tmediumblue: [0, 0, 205],\n\tmediumorchid: [186, 85, 211],\n\tmediumpurple: [147, 112, 219],\n\tmediumseagreen: [60, 179, 113],\n\tmediumslateblue: [123, 104, 238],\n\tmediumspringgreen: [0, 250, 154],\n\tmediumturquoise: [72, 209, 204],\n\tmediumvioletred: [199, 21, 133],\n\tmidnightblue: [25, 25, 112],\n\tmintcream: [245, 255, 250],\n\tmistyrose: [255, 228, 225],\n\tmoccasin: [255, 228, 181],\n\tnavajowhite: [255, 222, 173],\n\tnavy: [0, 0, 128],\n\toldlace: [253, 245, 230],\n\tolive: [128, 128, 0],\n\tolivedrab: [107, 142, 35],\n\torange: [255, 165, 0],\n\torangered: [255, 69, 0],\n\torchid: [218, 112, 214],\n\tpalegoldenrod: [238, 232, 170],\n\tpalegreen: [152, 251, 152],\n\tpaleturquoise: [175, 238, 238],\n\tpalevioletred: [219, 112, 147],\n\tpapayawhip: [255, 239, 213],\n\tpeachpuff: [255, 218, 185],\n\tperu: [205, 133, 63],\n\tpink: [255, 192, 203],\n\tplum: [221, 160, 221],\n\tpowderblue: [176, 224, 230],\n\tpurple: [128, 0, 128],\n\trebeccapurple: [102, 51, 153],\n\tred: [255, 0, 0],\n\trosybrown: [188, 143, 143],\n\troyalblue: [65, 105, 225],\n\tsaddlebrown: [139, 69, 19],\n\tsalmon: [250, 128, 114],\n\tsandybrown: [244, 164, 96],\n\tseagreen: [46, 139, 87],\n\tseashell: [255, 245, 238],\n\tsienna: [160, 82, 45],\n\tsilver: [192, 192, 192],\n\tskyblue: [135, 206, 235],\n\tslateblue: [106, 90, 205],\n\tslategray: [112, 128, 144],\n\tslategrey: [112, 128, 144],\n\tsnow: [255, 250, 250],\n\tspringgreen: [0, 255, 127],\n\tsteelblue: [70, 130, 180],\n\ttan: [210, 180, 140],\n\tteal: [0, 128, 128],\n\tthistle: [216, 191, 216],\n\ttomato: [255, 99, 71],\n\tturquoise: [64, 224, 208],\n\tviolet: [238, 130, 238],\n\twheat: [245, 222, 179],\n\twhite: [255, 255, 255],\n\twhitesmoke: [245, 245, 245],\n\tyellow: [255, 255, 0],\n\tyellowgreen: [154, 205, 50]\n}\n","/* MIT license */\n/* eslint-disable no-mixed-operators */\nimport cssKeywords from 'color-name';\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\toklab: {channels: 3, labels: ['okl', 'oka', 'okb']},\n\tlch: {channels: 3, labels: 'lch'},\n\toklch: {channels: 3, labels: ['okl', 'okc', 'okh']},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']},\n};\n\nexport default convert;\n\n// LAB f(t) constant\nconst LAB_FT = (6 / 29) ** 3;\n\n// SRGB non-linear transform functions\nfunction srgbNonlinearTransform(c) {\n\tconst cc = c > 0.003_130_8\n\t\t? ((1.055 * (c ** (1 / 2.4))) - 0.055)\n\t\t: c * 12.92;\n\treturn Math.min(Math.max(0, cc), 1);\n}\n\nfunction srgbNonlinearTransformInv(c) {\n\treturn c > 0.040_45 ? (((c + 0.055) / 1.055) ** 2.4) : (c / 12.92);\n}\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tswitch (max) {\n\t\tcase min: {\n\t\t\th = 0;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase r: {\n\t\t\th = (g - b) / delta;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase g: {\n\t\t\th = 2 + (b - r) / delta;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase b: {\n\t\t\th = 4 + (r - g) / delta;\n\n\t\t\tbreak;\n\t\t}\n\t// No default\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tswitch (v) {\n\t\t\tcase r: {\n\t\t\t\th = bdif - gdif;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase g: {\n\t\t\t\th = (1 / 3) + rdif - bdif;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase b: {\n\t\t\t\th = (2 / 3) + gdif - rdif;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t// No default\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100,\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.oklab = function (rgb) {\n\t// Assume sRGB\n\tconst r = srgbNonlinearTransformInv(rgb[0] / 255);\n\tconst g = srgbNonlinearTransformInv(rgb[1] / 255);\n\tconst b = srgbNonlinearTransformInv(rgb[2] / 255);\n\n\tconst lp = Math.cbrt(0.412_221_470_8 * r + 0.536_332_536_3 * g + 0.051_445_992_9 * b);\n\tconst mp = Math.cbrt(0.211_903_498_2 * r + 0.680_699_545_1 * g + 0.107_396_956_6 * b);\n\tconst sp = Math.cbrt(0.088_302_461_9 * r + 0.281_718_837_6 * g + 0.629_978_700_5 * b);\n\n\tconst l = 0.210_454_255_3 * lp + 0.793_617_785 * mp - 0.004_072_046_8 * sp;\n\tconst aa = 1.977_998_495_1 * lp - 2.428_592_205 * mp + 0.450_593_709_9 * sp;\n\tconst bb = 0.025_904_037_1 * lp + 0.782_771_766_2 * mp - 0.808_675_766 * sp;\n\n\treturn [l * 100, aa * 100, bb * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Number.POSITIVE_INFINITY;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\t// Assume sRGB\n\tconst r = srgbNonlinearTransformInv(rgb[0] / 255);\n\tconst g = srgbNonlinearTransformInv(rgb[1] / 255);\n\tconst b = srgbNonlinearTransformInv(rgb[2] / 255);\n\n\tconst x = (r * 0.412_456_4) + (g * 0.357_576_1) + (b * 0.180_437_5);\n\tconst y = (r * 0.212_672_9) + (g * 0.715_152_2) + (b * 0.072_175);\n\tconst z = (r * 0.019_333_9) + (g * 0.119_192) + (b * 0.950_304_1);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > LAB_FT ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > LAB_FT ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > LAB_FT ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t3;\n\tlet value;\n\n\tif (s === 0) {\n\t\tvalue = l * 255;\n\t\treturn [value, value, value];\n\t}\n\n\tconst t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tvalue = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tvalue = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tvalue = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tvalue = t1;\n\t\t}\n\n\t\trgb[i] = value * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0: {\n\t\t\treturn [v, t, p];\n\t\t}\n\n\t\tcase 1: {\n\t\t\treturn [q, v, p];\n\t\t}\n\n\t\tcase 2: {\n\t\t\treturn [p, v, t];\n\t\t}\n\n\t\tcase 3: {\n\t\t\treturn [p, q, v];\n\t\t}\n\n\t\tcase 4: {\n\t\t\treturn [t, p, v];\n\t\t}\n\n\t\tcase 5: {\n\t\t\treturn [v, p, q];\n\t\t}\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\t// eslint-disable-next-line no-bitwise\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces, default-case-last */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: { r = v; g = n; b = wh; break;\n\t\t}\n\n\t\tcase 1: { r = n; g = v; b = wh; break;\n\t\t}\n\n\t\tcase 2: { r = wh; g = v; b = n; break;\n\t\t}\n\n\t\tcase 3: { r = wh; g = n; b = v; break;\n\t\t}\n\n\t\tcase 4: { r = n; g = wh; b = v; break;\n\t\t}\n\n\t\tcase 5: { r = v; g = wh; b = n; break;\n\t\t}\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces, default-case-last */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.240_454_2) + (y * -1.537_138_5) + (z * -0.498_531_4);\n\tg = (x * -0.969_266) + (y * 1.876_010_8) + (z * 0.041_556);\n\tb = (x * 0.055_643_4) + (y * -0.204_025_9) + (z * 1.057_225_2);\n\n\t// Assume sRGB\n\tr = srgbNonlinearTransform(r);\n\tg = srgbNonlinearTransform(g);\n\tb = srgbNonlinearTransform(b);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > LAB_FT ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > LAB_FT ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > LAB_FT ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.xyz.oklab = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\n\tconst lp = Math.cbrt(0.818_933_010_1 * x + 0.361_866_742_4 * y - 0.128_859_713_7 * z);\n\tconst mp = Math.cbrt(0.032_984_543_6 * x + 0.929_311_871_5 * y + 0.036_145_638_7 * z);\n\tconst sp = Math.cbrt(0.048_200_301_8 * x + 0.264_366_269_1 * y + 0.633_851_707 * z);\n\n\tconst l = 0.210_454_255_3 * lp + 0.793_617_785 * mp - 0.004_072_046_8 * sp;\n\tconst a = 1.977_998_495_1 * lp - 2.428_592_205 * mp + 0.450_593_709_9 * sp;\n\tconst b = 0.025_904_037_1 * lp + 0.782_771_766_2 * mp - 0.808_675_766 * sp;\n\n\treturn [l * 100, a * 100, b * 100];\n};\n\nconvert.oklab.oklch = function (oklab) {\n\treturn convert.lab.lch(oklab);\n};\n\nconvert.oklab.xyz = function (oklab) {\n\tconst ll = oklab[0] / 100;\n\tconst a = oklab[1] / 100;\n\tconst b = oklab[2] / 100;\n\n\tconst l = (0.999_999_998 * ll + 0.396_337_792 * a + 0.215_803_758 * b) ** 3;\n\tconst m = (1.000_000_008 * ll - 0.105_561_342 * a - 0.063_854_175 * b) ** 3;\n\tconst s = (1.000_000_055 * ll - 0.089_484_182 * a - 1.291_485_538 * b) ** 3;\n\n\tconst x = 1.227_013_851 * l - 0.557_799_98 * m + 0.281_256_149 * s;\n\tconst y = -0.040_580_178 * l + 1.112_256_87 * m - 0.071_676_679 * s;\n\tconst z = -0.076_381_285 * l - 0.421_481_978 * m + 1.586_163_22 * s;\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.oklab.rgb = function (oklab) {\n\tconst ll = oklab[0] / 100;\n\tconst aa = oklab[1] / 100;\n\tconst bb = oklab[2] / 100;\n\n\tconst l = (ll + 0.396_337_777_4 * aa + 0.215_803_757_3 * bb) ** 3;\n\tconst m = (ll - 0.105_561_345_8 * aa - 0.063_854_172_8 * bb) ** 3;\n\tconst s = (ll - 0.089_484_177_5 * aa - 1.291_485_548 * bb) ** 3;\n\n\t// Assume sRGB\n\tconst r = srgbNonlinearTransform(4.076_741_662_1 * l - 3.307_711_591_3 * m + 0.230_969_929_2 * s);\n\tconst g = srgbNonlinearTransform(-1.268_438_004_6 * l + 2.609_757_401_1 * m - 0.341_319_396_5 * s);\n\tconst b = srgbNonlinearTransform(-0.004_196_086_3 * l - 0.703_418_614_7 * m + 1.707_614_701 * s);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.oklch.oklab = function (oklch) {\n\treturn convert.lch.lab(oklch);\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > LAB_FT ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > LAB_FT ? z2 : (z - 16 / 116) / 7.787;\n\n\t// Illuminant D65 XYZ Tristrimulus Values\n\t// https://en.wikipedia.org/wiki/CIE_1931_color_space\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t/* eslint-disable no-bitwise */\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\t\t/* eslint-enable no-bitwise */\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\t// eslint-disable-next-line no-bitwise\n\tif (r >> 4 === g >> 4 && g >> 4 === b >> 4) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\targs = args[0];\n\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (Math.trunc(args > 50) + 1) * 0.5;\n\t/* eslint-disable no-bitwise */\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\t/* eslint-enable no-bitwise */\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\targs = args[0];\n\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\t/* eslint-disable no-bitwise */\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\t/* eslint-enable no-bitwise */\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.slice(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f\\d]{6}|[a-f\\d]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = [...colorString].map(char => char + char).join('');\n\t}\n\n\tconst integer = Number.parseInt(colorString, 16);\n\t/* eslint-disable no-bitwise */\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\t/* eslint-enable no-bitwise */\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet hue;\n\n\tconst grayscale = chroma < 1 ? min / (1 - chroma) : 0;\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else if (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else if (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2 * s * l) : (2 * s * (1 - l));\n\n\tlet f = 0;\n\tif (c < 1) {\n\t\tf = (l - 0.5 * c) / (1 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0: {\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\t}\n\n\t\tcase 1: {\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\t}\n\n\t\tcase 2: {\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\t}\n\n\t\tcase 3: {\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\t}\n\n\t\tcase 4: {\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\t}\n\n\t\tdefault: {\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t\t}\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255,\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1 - c);\n\tlet f = 0;\n\n\tif (v > 0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else if (l >= 0.5 && l < 1) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65_535) * 255, (apple[1] / 65_535) * 255, (apple[2] / 65_535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65_535, (rgb[1] / 255) * 65_535, (rgb[2] / 255) * 65_535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\t/* eslint-disable no-bitwise */\n\tconst value = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (value << 16) + (value << 8) + value;\n\t/* eslint-enable no-bitwise */\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.slice(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst value = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [value / 255 * 100];\n};\n","import conversions from './conversions.js';\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let {length} = models, i = 0; i < length; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null,\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length > 0) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let {length} = adjacents, i = 0; i < length; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nfunction route(fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let {length} = models, i = 0; i < length; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n}\n\nexport default route;\n","import conversions from './conversions.js';\nimport route from './route.js';\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let {length} = result, i = 0; i < length; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfor (const fromModel of models) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\tfor (const toModel of routeModels) {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t}\n}\n\nexport default convert;\n","import colorString from 'color-string';\nimport convert from 'color-convert';\n\nconst skippedModels = [\n\t// To be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// Gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// Shouldn't really be in color-convert either...\n\t'hex',\n];\n\nconst hashedModelKeys = {};\nfor (const model of Object.keys(convert)) {\n\thashedModelKeys[[...convert[model].labels].sort().join('')] = model;\n}\n\nconst limiters = {};\n\nfunction Color(object, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(object, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tlet i;\n\tlet channels;\n\n\tif (object == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (object instanceof Color) {\n\t\tthis.model = object.model;\n\t\tthis.color = [...object.color];\n\t\tthis.valpha = object.valpha;\n\t} else if (typeof object === 'string') {\n\t\tconst result = colorString.get(object);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + object);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (object.length > 0) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tconst newArray = Array.prototype.slice.call(object, 0, channels);\n\t\tthis.color = zeroArray(newArray, channels);\n\t\tthis.valpha = typeof object[channels] === 'number' ? object[channels] : 1;\n\t} else if (typeof object === 'number') {\n\t\t// This is always RGB - can be converted later on.\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(object >> 16) & 0xFF,\n\t\t\t(object >> 8) & 0xFF,\n\t\t\tobject & 0xFF,\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tconst keys = Object.keys(object);\n\t\tif ('alpha' in object) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof object.alpha === 'number' ? object.alpha : 0;\n\t\t}\n\n\t\tconst hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(object));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tconst {labels} = convert[this.model];\n\t\tconst color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(object[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// Perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tconst limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString() {\n\t\treturn this.string();\n\t},\n\n\ttoJSON() {\n\t\treturn this[this.model]();\n\t},\n\n\tstring(places) {\n\t\tlet self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tconst arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];\n\t\treturn colorString.to[self.model](...arguments_);\n\t},\n\n\tpercentString(places) {\n\t\tconst self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tconst arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];\n\t\treturn colorString.to.rgb.percent(...arguments_);\n\t},\n\n\tarray() {\n\t\treturn this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];\n\t},\n\n\tobject() {\n\t\tconst result = {};\n\t\tconst {channels} = convert[this.model];\n\t\tconst {labels} = convert[this.model];\n\n\t\tfor (let i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray() {\n\t\tconst rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject() {\n\t\tconst rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround(places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);\n\t},\n\n\talpha(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// Rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(95.047)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(108.833)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color(value);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color(value);\n\t\t}\n\n\t\treturn colorString.to.hex(...this.rgb().round().color);\n\t},\n\n\thexa(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color(value);\n\t\t}\n\n\t\tconst rgbArray = this.rgb().round().color;\n\n\t\tlet alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();\n\t\tif (alphaHex.length === 1) {\n\t\t\talphaHex = '0' + alphaHex;\n\t\t}\n\n\t\treturn colorString.to.hex(...rgbArray) + alphaHex;\n\t},\n\n\trgbNumber() {\n\t\tconst rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity() {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tconst rgb = this.rgb().color;\n\n\t\tconst lum = [];\n\t\tfor (const [i, element] of rgb.entries()) {\n\t\t\tconst chan = element / 255;\n\t\t\tlum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast(color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tconst lum1 = this.luminosity();\n\t\tconst lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel(color2) {\n\t\t// https://www.w3.org/TR/WCAG/#contrast-enhanced\n\t\tconst contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark() {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tconst rgb = this.rgb().color;\n\t\tconst yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight() {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate() {\n\t\tconst rgb = this.rgb();\n\t\tfor (let i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tlighten(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten(ratio) {\n\t\tconst hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken(ratio) {\n\t\tconst hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale() {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_colour_to_grayscale\n\t\tconst rgb = this.rgb().color;\n\t\tconst value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(value, value, value);\n\t},\n\n\tfade(ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer(ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate(degrees) {\n\t\tconst hsl = this.hsl();\n\t\tlet hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix(mixinColor, weight) {\n\t\t// Ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\n\t\tconst color1 = mixinColor.rgb();\n\t\tconst color2 = this.rgb();\n\t\tconst p = weight === undefined ? 0.5 : weight;\n\n\t\tconst w = 2 * p - 1;\n\t\tconst a = color1.alpha() - color2.alpha();\n\n\t\tconst w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;\n\t\tconst w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t},\n};\n\n// Model conversion methods and static constructors\nfor (const model of Object.keys(convert)) {\n\tif (skippedModels.includes(model)) {\n\t\tcontinue;\n\t}\n\n\tconst {channels} = convert[model];\n\n\t// Conversion methods\n\tColor.prototype[model] = function (...arguments_) {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments_.length > 0) {\n\t\t\treturn new Color(arguments_, model);\n\t\t}\n\n\t\treturn new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (...arguments_) {\n\t\tlet color = arguments_[0];\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(arguments_, channels);\n\t\t}\n\n\t\treturn new Color(color, model);\n\t};\n}\n\nfunction roundTo(number, places) {\n\treturn Number(number.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (number) {\n\t\treturn roundTo(number, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tfor (const m of model) {\n\t\t(limiters[m] ||= [])[channel] = modifier;\n\t}\n\n\tmodel = model[0];\n\n\treturn function (value) {\n\t\tlet result;\n\n\t\tif (value !== undefined) {\n\t\t\tif (modifier) {\n\t\t\t\tvalue = modifier(value);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = value;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n\nfunction zeroArray(array, length) {\n\tfor (let i = 0; i < length; i++) {\n\t\tif (typeof array[i] !== 'number') {\n\t\t\tarray[i] = 0;\n\t\t}\n\t}\n\n\treturn array;\n}\n\nexport default Color;\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport Color from 'color';\n/**\n * Is the current theme dark?\n */\nexport function isDarkModeEnabled() {\n const darkModePreference = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches;\n const darkModeSetting = document.body.getAttribute('data-themes')?.includes('dark');\n return darkModeSetting || darkModePreference || false;\n}\n/**\n * Is the current theme high contrast?\n */\nexport function isHighContrastModeEnabled() {\n const highContrastPreference = window?.matchMedia?.('(forced-colors: active)')?.matches;\n const highContrastSetting = document.body.getAttribute('data-themes')?.includes('highcontrast');\n return highContrastSetting || highContrastPreference || false;\n}\n/**\n * Should we invert the text on this background color?\n * @param color RGB color value as a hex string\n * @return boolean\n */\nexport function invertTextColor(color) {\n return colorContrast(color, '#ffffff') < 4.5;\n}\n/**\n * Is this color too bright?\n * @param color RGB color value as a hex string\n * @return boolean\n */\nexport function isBrightColor(color) {\n return calculateLuma(color) > 0.6;\n}\n/**\n * Get color for on-page elements\n * theme color by default, grey if theme color is too bright.\n * @param color the color to contrast against, e.g. #ffffff\n * @param backgroundColor the background color to contrast against, e.g. #000000\n */\nexport function elementColor(color, backgroundColor) {\n const brightBackground = isBrightColor(backgroundColor);\n const blurredBackground = mix(backgroundColor, brightBackground ? color : '#ffffff', 66);\n let contrast = colorContrast(color, blurredBackground);\n const minContrast = isHighContrastModeEnabled() ? 5.6 : 3.2;\n let iteration = 0;\n let result = color;\n const epsilon = (brightBackground ? -100 : 100) / 255;\n while (contrast < minContrast && iteration++ < 100) {\n const hsl = hexToHSL(result);\n const l = Math.max(0, Math.min(255, hsl.l + epsilon));\n result = hslToHex({ h: hsl.h, s: hsl.s, l });\n contrast = colorContrast(result, blurredBackground);\n }\n return result;\n}\n/**\n * Get color for on-page text:\n * black if background is bright, white if background is dark.\n * @param color1 the color to contrast against, e.g. #ffffff\n * @param color2 the background color to contrast against, e.g. #000000\n * @param factor the factor to mix the colors between -100 and 100, e.g. 66\n */\nexport function mix(color1, color2, factor) {\n if (factor < -100 || factor > 100) {\n throw new RangeError('Factor must be between -100 and 100');\n }\n return new Color(color2).mix(new Color(color1), (factor + 100) / 200).hex();\n}\n/**\n * Lighten a color by a factor\n * @param color the color to lighten, e.g. #000000\n * @param factor the factor to lighten the color by between -100 and 100, e.g. -41\n */\nexport function lighten(color, factor) {\n if (factor < -100 || factor > 100) {\n throw new RangeError('Factor must be between -100 and 100');\n }\n return new Color(color).lighten((factor + 100) / 200).hex();\n}\n/**\n * Darken a color by a factor\n * @param color the color to darken, e.g. #ffffff\n * @param factor the factor to darken the color by between -100 and 100, e.g. 32\n */\nexport function darken(color, factor) {\n if (factor < -100 || factor > 100) {\n throw new RangeError('Factor must be between -100 and 100');\n }\n return new Color(color).darken((factor + 100) / 200).hex();\n}\n/**\n * Calculate the luminance of a color\n * @param color the color to calculate the luminance of, e.g. #ffffff\n */\nexport function calculateLuminance(color) {\n return hexToHSL(color).l;\n}\n/**\n * Calculate the luma of a color\n * @param color the color to calculate the luma of, e.g. #ffffff\n */\nexport function calculateLuma(color) {\n const rgb = hexToRGB(color).map((value) => {\n value /= 255;\n return value <= 0.03928\n ? value / 12.92\n : Math.pow((value + 0.055) / 1.055, 2.4);\n });\n const [red, green, blue] = rgb;\n return 0.2126 * red + 0.7152 * green + 0.0722 * blue;\n}\n/**\n * Calculate the contrast between two colors\n * @param color1 the first color to calculate the contrast of, e.g. #ffffff\n * @param color2 the second color to calculate the contrast of, e.g. #000000\n */\nexport function colorContrast(color1, color2) {\n const luminance1 = calculateLuma(color1) + 0.05;\n const luminance2 = calculateLuma(color2) + 0.05;\n return Math.max(luminance1, luminance2) / Math.min(luminance1, luminance2);\n}\n/**\n * Convert hex color to RGB\n * @param color RGB color value as a hex string\n */\nexport function hexToRGB(color) {\n return new Color(color).rgb().array();\n}\n/**\n * Convert RGB color to hex\n * @param color RGB color value as a hex string\n */\nexport function hexToHSL(color) {\n const hsl = new Color(color).hsl();\n return { h: hsl.color[0], s: hsl.color[1], l: hsl.color[2] };\n}\n/**\n * Convert HSL color to hex\n * @param hsl HSL color value as an object\n * @param hsl.h hue\n * @param hsl.s saturation\n * @param hsl.l lightness\n */\nexport function hslToHex(hsl) {\n return new Color(hsl).hex();\n}\n/**\n * Convert RGB color to hex\n * @param r red\n * @param g green\n * @param b blue\n */\nexport function rgbToHex(r, g, b) {\n const hex = ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);\n return `#${hex}`;\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-inline-start:5px}.files-list__system-tag[data-systemtag-color]{border-color:var(--systemtag-color);color:var(--systemtag-color);border-width:2px;line-height:18px}@media(min-width: 512px){.files-list__system-tags{display:flex}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss\"],\"names\":[],\"mappings\":\"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,uBAAA,CAID,8CACC,mCAAA,CACA,4BAAA,CACA,gBAAA,CACA,gBAAA,CAIF,yBACC,yBACC,YAAA,CAAA\",\"sourcesContent\":[\"/**\\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n * SPDX-License-Identifier: AGPL-3.0-or-later\\n */\\n\\n.files-list__system-tags {\\n\\t--min-size: 32px;\\n\\tdisplay: none;\\n\\tjustify-content: center;\\n\\talign-items: center;\\n\\tmin-width: calc(var(--min-size) * 2);\\n\\tmax-width: 300px;\\n}\\n\\n.files-list__system-tag {\\n\\tpadding: 5px 10px;\\n\\tborder: 1px solid;\\n\\tborder-radius: var(--border-radius-pill);\\n\\tborder-color: var(--color-border);\\n\\tcolor: var(--color-text-maxcontrast);\\n\\theight: var(--min-size);\\n\\twhite-space: nowrap;\\n\\toverflow: hidden;\\n\\ttext-overflow: ellipsis;\\n\\tline-height: 20px; // min-size - 2 * 5px padding - 2 * 1px border\\n\\ttext-align: center;\\n\\n\\t&--more {\\n\\t\\toverflow: visible;\\n\\t\\ttext-overflow: initial;\\n\\t}\\n\\n\\t// Proper spacing if multiple shown\\n\\t& + .files-list__system-tag {\\n\\t\\tmargin-inline-start: 5px;\\n\\t}\\n\\n\\t// With color\\n\\t&[data-systemtag-color] {\\n\\t\\tborder-color: var(--systemtag-color);\\n\\t\\tcolor: var(--systemtag-color);\\n\\t\\tborder-width: 2px;\\n\\t\\tline-height: 18px; // min-size - 2 * 5px padding - 2 * 2px border\\n\\t}\\n}\\n\\n@media (min-width: 512px) {\\n\\t.files-list__system-tags {\\n\\t\\tdisplay: flex;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport axios from '@nextcloud/axios';\nimport { generateUrl, generateOcsUrl } from '@nextcloud/router';\nimport { t } from '@nextcloud/l10n';\nimport { davClient } from './davClient.js';\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils';\nimport logger from '../logger.ts';\nimport { emit } from '@nextcloud/event-bus';\nimport { confirmPassword } from '@nextcloud/password-confirmation';\nexport const fetchTagsPayload = `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`;\nexport const fetchTags = async () => {\n const path = '/systemtags';\n try {\n const { data: tags } = await davClient.getDirectoryContents(path, {\n data: fetchTagsPayload,\n details: true,\n glob: '/systemtags/*', // Filter out first empty tag\n });\n return parseTags(tags);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load tags'), { error });\n throw new Error(t('systemtags', 'Failed to load tags'));\n }\n};\nexport const fetchTag = async (tagId) => {\n const path = '/systemtags/' + tagId;\n try {\n const { data: tag } = await davClient.stat(path, {\n data: fetchTagsPayload,\n details: true,\n });\n return parseTags([tag])[0];\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load tag'), { error });\n throw new Error(t('systemtags', 'Failed to load tag'));\n }\n};\nexport const fetchLastUsedTagIds = async () => {\n const url = generateUrl('/apps/systemtags/lastused');\n try {\n const { data: lastUsedTagIds } = await axios.get(url);\n return lastUsedTagIds.map(Number);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load last used tags'), { error });\n throw new Error(t('systemtags', 'Failed to load last used tags'));\n }\n};\n/**\n * Create a tag and return the Id of the newly created tag.\n *\n * @param tag The tag to create\n */\nexport const createTag = async (tag) => {\n const path = '/systemtags';\n const tagToPost = formatTag(tag);\n try {\n const { headers } = await davClient.customRequest(path, {\n method: 'POST',\n data: tagToPost,\n });\n const contentLocation = headers.get('content-location');\n if (contentLocation) {\n emit('systemtags:tag:created', tag);\n return parseIdFromLocation(contentLocation);\n }\n logger.error(t('systemtags', 'Missing \"Content-Location\" header'));\n throw new Error(t('systemtags', 'Missing \"Content-Location\" header'));\n }\n catch (error) {\n if (error?.response?.status === 409) {\n logger.error(t('systemtags', 'A tag with the same name already exists'), { error });\n throw new Error(t('systemtags', 'A tag with the same name already exists'));\n }\n logger.error(t('systemtags', 'Failed to create tag'), { error });\n throw new Error(t('systemtags', 'Failed to create tag'));\n }\n};\nexport const updateTag = async (tag) => {\n const path = '/systemtags/' + tag.id;\n const data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${tag.displayName}\n\t\t\t\t${tag.userVisible}\n\t\t\t\t${tag.userAssignable}\n\t\t\t\t${tag?.color || null}\n\t\t\t\n\t\t\n\t`;\n try {\n await davClient.customRequest(path, {\n method: 'PROPPATCH',\n data,\n });\n emit('systemtags:tag:updated', tag);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to update tag'), { error });\n throw new Error(t('systemtags', 'Failed to update tag'));\n }\n};\nexport const deleteTag = async (tag) => {\n const path = '/systemtags/' + tag.id;\n try {\n await davClient.deleteFile(path);\n emit('systemtags:tag:deleted', tag);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to delete tag'), { error });\n throw new Error(t('systemtags', 'Failed to delete tag'));\n }\n};\nexport const getTagObjects = async function (tag, type) {\n const path = `/systemtags/${tag.id}/${type}`;\n const data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t`;\n const response = await davClient.stat(path, { data, details: true });\n const etag = response?.data?.props?.getetag || '\"\"';\n const objects = Object.values(response?.data?.props?.['object-ids'] || []).flat();\n return {\n etag,\n objects,\n };\n};\n/**\n * Set the objects for a tag.\n * Warning: This will overwrite the existing objects.\n * @param tag The tag to set the objects for\n * @param type The type of the objects\n * @param objectIds The objects to set\n * @param etag Strongly recommended to avoid conflict and data loss.\n */\nexport const setTagObjects = async function (tag, type, objectIds, etag = '') {\n const path = `/systemtags/${tag.id}/${type}`;\n let data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${objectIds.map(({ id, type }) => `${id}${type}`).join('')}\n\t\t\t\n\t\t\n\t`;\n if (objectIds.length === 0) {\n data = `\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n await davClient.customRequest(path, {\n method: 'PROPPATCH',\n data,\n headers: {\n 'if-match': etag,\n },\n });\n};\nexport const updateSystemTagsAdminRestriction = async (isAllowed) => {\n // Convert to string for compatibility\n const isAllowedString = isAllowed ? '1' : '0';\n const url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', {\n appId: 'systemtags',\n key: 'restrict_creation_to_admin',\n });\n await confirmPassword();\n const res = await axios.post(url, {\n value: isAllowedString,\n });\n return res.data;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \"-\" + chunkId + \".js?v=\" + {\"3278\":\"c97a360506d6ebb6afd2\",\"3564\":\"1f97cb34040f17de0c20\",\"7471\":\"428f6893ae52e7aca00b\",\"8790\":\"9fd8f6ad2d5d29ec25ad\",\"9167\":\"c89e50ac8548b6b57d92\"}[chunkId] + \"\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2766;","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2766: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunknextcloud\"] = globalThis[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(45218)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","parseTags","tags","map","props","Object","fromEntries","entries","key","value","camelCase","String","parseIdFromLocation","url","queryPos","indexOf","substring","parts","split","result","length","pop","Number","formatTag","initialTag","tag","name","displayName","getNodeSystemTags","node","attribute","attributes","undefined","flat","text","setNodeSystemTags","Vue","getLoggerBuilder","setApp","detectUser","build","async","execBatch","nodes","response","Promise","resolve","spawnDialog","defineAsyncComponent","status","Array","fill","action","FileAction","id","t","iconSvgInline","TagMultipleSvg","enabled","isPublicShare","some","isDavResource","permissions","Permission","UPDATE","exec","useActiveStore","defineStore","activeAction","ref","activeFolder","activeNode","activeView","onDeletedNode","source","onChangedView","view","logger","debug","navigation","getNavigation","subscribe","active","addEventListener","event","detail","initialize","rootPath","client","davGetClient","resultToNode","davResultToNode","formatReportPayload","tagId","getDavNameSpaces","getDavProperties","tagToNode","Folder","davRemoteURL","owner","getCurrentUser","uid","root","displayname","READ","systemTagsViewId","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","cache","renderTag","isMore","tagElement","document","createElement","classList","add","setAttribute","textContent","cachedTag","find","color","mainBackgroundColor","getComputedStyle","body","getPropertyValue","replace","isDarkModeEnabled","primaryElement","elementColor","style","setProperty","renderInline","systemTagsElement","fileid","toString","push","fetchTags","error","append","moreTagElement","slice","join","order","hotkey","description","then","systemTagsHtml","querySelectorAll","forEach","element","replaceWith","splice","findIndex","index","updateSystemTagsColorAttribute","type","FileType","dir","dirname","path","window","OCP","Files","Router","goToRoute","openfile","default","DefaultType","HIDDEN","registerDavProperty","registerFileAction","bulkSystemTagsAction","inlineSystemTagsAction","openInFilesAction","register","View","caption","emptyTitle","emptyCaption","icon","svgTagMultiple","getContents","tagsCache","filter","userVisible","folder","NONE","contents","parseInt","Error","getDirectoryContents","davRootPath","details","data","headers","method","useHotKey","activeStore","_nc_files_pinia","createPinia","currentDir","query","currentNode","currentView","NodeStatus","LOADING","success","showSuccess","showError","executeAction","manageTagAction","stop","prevent","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","reverseNames","create","hasOwn","cs","to","get","clamp","number_","min","max","Math","hexDouble","string_","round","toUpperCase","string","model","toLowerCase","hsl","hwb","rgb","match","i","hexAlpha","i2","parseFloat","alpha","isNaN","hex","rgba","percent","r","g","b","hsla","hwba","a","keyword","reverseKeywords","keys","convert","channels","labels","hsv","cmyk","xyz","lab","oklab","lch","oklch","ansi16","ansi256","hcg","apple","LAB_FT","srgbNonlinearTransform","c","cc","srgbNonlinearTransformInv","defineProperty","comparativeDistance","x","y","from","args","wrapConversion","toModel","graph","parent","fn","conversions","cur","unshift","conversion","delta","h","s","l","rdif","gdif","bdif","v","diff","diffc","w","lp","cbrt","mp","sp","k","reversed","currentClosestKeyword","currentClosestDistance","POSITIVE_INFINITY","distance","z","t3","t2","t1","smin","lmin","hi","floor","f","p","q","vmin","sl","wh","bl","ratio","n","m","ll","aa","bb","y2","x2","z2","atan2","PI","sqrt","hr","cos","sin","saturation","ansi","mult","trunc","rem","colorString","char","integer","chroma","hue","pure","mg","fromModel","models","buildGraph","queue","current","adjacents","adjacent","deriveBFS","wrapRaw","wrappedFn","arg0","wrapRounded","routes","routeModels","raw","skippedModels","hashedModelKeys","sort","limiters","object","this","valpha","newArray","prototype","call","zeroArray","hashedKeys","JSON","stringify","limit","freeze","toJSON","places","self","arguments_","percentString","array","unitArray","unitObject","roundToPlace","getset","maxfn","saturationl","lightness","saturationv","wblack","hexa","rgbArray","alphaHex","rgbNumber","luminosity","lum","chan","contrast","color2","lum1","lum2","level","contrastRatio","isDark","isLight","negate","lighten","darken","saturate","desaturate","whiten","blacken","grayscale","fade","opaquer","rotate","degrees","mix","mixinColor","weight","color1","w1","w2","includes","isArray","number","toFixed","roundTo","channel","modifier","darkModePreference","matchMedia","matches","darkModeSetting","getAttribute","invertTextColor","colorContrast","backgroundColor","brightBackground","calculateLuma","isBrightColor","blurredBackground","Color","minContrast","highContrastPreference","highContrastSetting","isHighContrastModeEnabled","iteration","epsilon","hexToHSL","hslToHex","hexToRGB","pow","luminance1","luminance2","___CSS_LOADER_EXPORT___","module","fetchTagsPayload","glob","fetchTag","stat","createTag","tagToPost","customRequest","contentLocation","emit","updateTag","userAssignable","getTagObjects","etag","getetag","objects","values","setTagObjects","objectIds","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","loaded","__webpack_modules__","O","chunkIds","priority","notFulfilled","Infinity","fulfilled","j","every","getter","__esModule","d","definition","o","enumerable","e","chunkId","all","reduce","promises","u","globalThis","Function","obj","prop","hasOwnProperty","done","script","needAttach","scripts","getElementsByTagName","charset","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","timeout","doneFns","parentNode","removeChild","setTimeout","bind","target","head","appendChild","Symbol","toStringTag","nmd","paths","children","scriptUrl","importScripts","location","currentScript","tagName","test","baseURI","href","installedChunks","installedChunkData","promise","reject","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"systemtags-init.js?v=6dfa01411e2f0b060831","mappings":"UAAIA,ECAAC,EACAC,E,qFCOJ,MAAMC,GAAUC,EAAAA,EAAAA,IAAkB,OACrBC,GAAYC,EAAAA,EAAAA,IAAaH,GAEhCI,EAAcC,IAChBH,EAAUE,WAAW,CAEjB,mBAAoB,iBAEpBE,aAAcD,GAAS,OAI/BE,EAAAA,EAAAA,IAAqBH,GACrBA,GAAWI,EAAAA,EAAAA,M,+GCfJ,MAKMC,EAAaC,GACfA,EAAKC,IAAI,EAAGC,WAAYC,OAAOC,YAAYD,OAAOE,QAAQH,GAC5DD,IAAI,EAAEK,EAAKC,KAAW,EAACC,EAAAA,EAAAA,GAAUF,GAAyB,iBAAnBE,EAAAA,EAAAA,GAAUF,GAAyBG,OAAOF,GAASA,MAMtFG,EAAuBC,IAChC,MAAMC,EAAWD,EAAIE,QAAQ,KACzBD,EAAW,IACXD,EAAMA,EAAIG,UAAU,EAAGF,IAE3B,MAAMG,EAAQJ,EAAIK,MAAM,KACxB,IAAIC,EACJ,GACIA,EAASF,EAAMA,EAAMG,OAAS,GAC9BH,EAAMI,aAGAF,GAAUF,EAAMG,OAAS,GACnC,OAAOE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AAIukB,KAAY2E,EACZ5E,EAAoBkB,EAAE0D,EAAa3E,KACrCD,EAAoB5J,EAAE6J,GAAY2E,EAAY3E,IAGhD,GAAG4E,EAAS,IAAItrB,EAASsrB,EAAQ7E,EAClC,CAEA,IADG2E,GAA4BA,EAA2BjgB,GACrDgM,EAAI6P,EAAS/mB,OAAQkX,IACzB2Q,EAAUd,EAAS7P,GAChBsP,EAAoBkB,EAAEgD,EAAiB7C,IAAY6C,EAAgB7C,IACrE6C,EAAgB7C,GAAS,KAE1B6C,EAAgB7C,GAAW,EAE5B,OAAOrB,EAAoBM,EAAE/mB,IAG1BurB,EAAqBpD,WAAkC,sBAAIA,WAAkC,uBAAK,GACtGoD,EAAmBjjB,QAAQ6iB,EAAqBzB,KAAK,KAAM,IAC3D6B,EAAmB9jB,KAAO0jB,EAAqBzB,KAAK,KAAM6B,EAAmB9jB,KAAKiiB,KAAK6B,G,KCrFvF9E,EAAoBqC,QAAKjoB,ECGzB,IAAI2qB,EAAsB/E,EAAoBM,OAAElmB,EAAW,CAAC,MAAO,IAAO4lB,EAAoB,QAC9F+E,EAAsB/E,EAAoBM,EAAEyE,E","sources":["webpack:///nextcloud/webpack/runtime/chunk loaded","webpack:///nextcloud/webpack/runtime/load script","webpack:///nextcloud/apps/systemtags/src/services/davClient.ts","webpack:///nextcloud/apps/systemtags/src/utils.ts","webpack:///nextcloud/apps/systemtags/src/logger.ts","webpack:///nextcloud/apps/systemtags/src/files_actions/bulkSystemTagsAction.ts","webpack:///nextcloud/apps/files/src/logger.ts","webpack:///nextcloud/apps/files/src/store/active.ts","webpack:///nextcloud/apps/systemtags/src/services/systemtags.ts","webpack:///nextcloud/apps/systemtags/src/files_views/systemtagsView.ts","webpack://nextcloud/./apps/systemtags/src/css/fileEntryInlineSystemTags.scss?0a01","webpack:///nextcloud/apps/systemtags/src/files_actions/inlineSystemTagsAction.ts","webpack:///nextcloud/apps/systemtags/src/files_actions/openInFilesAction.ts","webpack:///nextcloud/apps/systemtags/src/init.ts","webpack:///nextcloud/apps/systemtags/src/services/HotKeysService.ts","webpack:///nextcloud/apps/files/src/utils/actionUtils.ts","webpack:///nextcloud/apps/files/src/store/index.ts","webpack:///nextcloud/node_modules/color-string/node_modules/color-name/index.js","webpack:///nextcloud/node_modules/color-string/index.js","webpack:///nextcloud/node_modules/color/node_modules/color-name/index.js","webpack:///nextcloud/node_modules/color/node_modules/color-convert/conversions.js","webpack:///nextcloud/node_modules/color/node_modules/color-convert/route.js","webpack:///nextcloud/node_modules/color/node_modules/color-convert/index.js","webpack:///nextcloud/node_modules/color/index.js","webpack:///nextcloud/apps/systemtags/src/utils/colorUtils.ts","webpack:///nextcloud/apps/systemtags/src/css/fileEntryInlineSystemTags.scss","webpack:///nextcloud/apps/systemtags/src/services/api.ts","webpack:///nextcloud/webpack/bootstrap","webpack:///nextcloud/webpack/runtime/compat get default export","webpack:///nextcloud/webpack/runtime/define property getters","webpack:///nextcloud/webpack/runtime/ensure chunk","webpack:///nextcloud/webpack/runtime/get javascript chunk filename","webpack:///nextcloud/webpack/runtime/global","webpack:///nextcloud/webpack/runtime/hasOwnProperty shorthand","webpack:///nextcloud/webpack/runtime/make namespace object","webpack:///nextcloud/webpack/runtime/node module decorator","webpack:///nextcloud/webpack/runtime/runtimeId","webpack:///nextcloud/webpack/runtime/publicPath","webpack:///nextcloud/webpack/runtime/jsonp chunk loading","webpack:///nextcloud/webpack/runtime/nonce","webpack:///nextcloud/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = (result, chunkIds, fn, priority) => {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar [chunkIds, fn, priority] = deferred[i];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every((key) => (__webpack_require__.O[key](chunkIds[j])))) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","var inProgress = {};\nvar dataWebpackPrefix = \"nextcloud:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = (url, done, key, chunkId) => {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = (prev, event) => {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach((fn) => (fn(event)));\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createClient } from 'webdav';\nimport { generateRemoteUrl } from '@nextcloud/router';\nimport { getRequestToken, onRequestTokenUpdate } from '@nextcloud/auth';\n// init webdav client\nconst rootUrl = generateRemoteUrl('dav');\nexport const davClient = createClient(rootUrl);\n// set CSRF token header\nconst setHeaders = (token) => {\n davClient.setHeaders({\n // Add this so the server knows it is an request from the browser\n 'X-Requested-With': 'XMLHttpRequest',\n // Inject user auth\n requesttoken: token ?? '',\n });\n};\n// refresh headers when request token changes\nonRequestTokenUpdate(setHeaders);\nsetHeaders(getRequestToken());\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport camelCase from 'camelcase';\nimport Vue from 'vue';\nexport const defaultBaseTag = {\n userVisible: true,\n userAssignable: true,\n canAssign: true,\n};\nexport const parseTags = (tags) => {\n return tags.map(({ props }) => Object.fromEntries(Object.entries(props)\n .map(([key, value]) => [camelCase(key), camelCase(key) === 'displayName' ? String(value) : value])));\n};\n/**\n * Parse id from `Content-Location` header\n * @param url URL to parse\n */\nexport const parseIdFromLocation = (url) => {\n const queryPos = url.indexOf('?');\n if (queryPos > 0) {\n url = url.substring(0, queryPos);\n }\n const parts = url.split('/');\n let result;\n do {\n result = parts[parts.length - 1];\n parts.pop();\n // note: first result can be empty when there is a trailing slash,\n // so we take the part before that\n } while (!result && parts.length > 0);\n return Number(result);\n};\nexport const formatTag = (initialTag) => {\n if ('name' in initialTag && !('displayName' in initialTag)) {\n return { ...initialTag };\n }\n const tag = { ...initialTag };\n tag.name = tag.displayName;\n delete tag.displayName;\n return tag;\n};\nexport const getNodeSystemTags = function (node) {\n const attribute = node.attributes?.['system-tags']?.['system-tag'];\n if (attribute === undefined) {\n return [];\n }\n // if there is only one tag it is a single string or prop object\n // if there are multiple then its an array - so we flatten it to be always an array of string or prop objects\n return [attribute]\n .flat()\n .map((tag) => (typeof tag === 'string'\n // its a plain text prop (the tag name) without prop attributes\n ? tag\n // its a prop object with attributes, the tag name is in the 'text' attribute\n : tag.text));\n};\nexport const setNodeSystemTags = function (node, tags) {\n Vue.set(node.attributes, 'system-tags', {\n 'system-tag': tags,\n });\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport default getLoggerBuilder()\n .setApp('systemtags')\n .detectUser()\n .build();\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { Permission } from '@nextcloud/files';\nimport { defineAsyncComponent } from 'vue';\nimport { FileAction } from '@nextcloud/files';\nimport { isPublicShare } from '@nextcloud/sharing/public';\nimport { spawnDialog } from '@nextcloud/dialogs';\nimport { t } from '@nextcloud/l10n';\nimport TagMultipleSvg from '@mdi/svg/svg/tag-multiple-outline.svg?raw';\n/**\n * Spawn a dialog to add or remove tags from multiple nodes.\n * @param nodes Nodes to modify tags for\n */\nasync function execBatch(nodes) {\n const response = await new Promise((resolve) => {\n spawnDialog(defineAsyncComponent(() => import('../components/SystemTagPicker.vue')), {\n nodes,\n }, (status) => {\n resolve(status);\n });\n });\n return Array(nodes.length).fill(response);\n}\nexport const action = new FileAction({\n id: 'systemtags:bulk',\n displayName: () => t('systemtags', 'Manage tags'),\n iconSvgInline: () => TagMultipleSvg,\n // If the app is disabled, the action is not available anyway\n enabled(nodes) {\n if (isPublicShare()) {\n return false;\n }\n if (nodes.length === 0) {\n return false;\n }\n // Disabled for non dav resources\n if (nodes.some((node) => !node.isDavResource)) {\n return false;\n }\n // We need to have the update permission on all nodes\n return !nodes.some((node) => (node.permissions & Permission.UPDATE) === 0);\n },\n async exec(node) {\n return execBatch([node])[0];\n },\n execBatch,\n});\n","/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { getLoggerBuilder } from '@nextcloud/logger';\nexport default getLoggerBuilder()\n .setApp('files')\n .detectUser()\n .build();\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { subscribe } from '@nextcloud/event-bus';\nimport { getNavigation } from '@nextcloud/files';\nimport { defineStore } from 'pinia';\nimport { ref } from 'vue';\nimport logger from '../logger.ts';\nexport const useActiveStore = defineStore('active', () => {\n /**\n * The currently active action\n */\n const activeAction = ref();\n /**\n * The currently active folder\n */\n const activeFolder = ref();\n /**\n * The current active node within the folder\n */\n const activeNode = ref();\n /**\n * The current active view\n */\n const activeView = ref();\n initialize();\n /**\n * Unset the active node if deleted\n *\n * @param node - The node thats deleted\n * @private\n */\n function onDeletedNode(node) {\n if (activeNode.value && activeNode.value.source === node.source) {\n activeNode.value = undefined;\n }\n }\n /**\n * Callback to update the current active view\n *\n * @param view - The new active view\n * @private\n */\n function onChangedView(view = null) {\n logger.debug('Setting active view', { view });\n activeView.value = view ?? undefined;\n activeNode.value = undefined;\n }\n /**\n * Initalize the store - connect all event listeners.\n * @private\n */\n function initialize() {\n const navigation = getNavigation();\n // Make sure we only register the listeners once\n subscribe('files:node:deleted', onDeletedNode);\n onChangedView(navigation.active);\n // Or you can react to changes of the current active view\n navigation.addEventListener('updateActive', (event) => {\n onChangedView(event.detail);\n });\n }\n return {\n activeAction,\n activeFolder,\n activeNode,\n activeView,\n };\n});\n","import { getCurrentUser } from '@nextcloud/auth';\nimport { Folder, Permission, getDavNameSpaces, getDavProperties, davGetClient, davResultToNode, davRemoteURL, davRootPath } from '@nextcloud/files';\nimport { fetchTags } from './api';\nconst rootPath = '/systemtags';\nconst client = davGetClient();\nconst resultToNode = (node) => davResultToNode(node);\nconst formatReportPayload = (tagId) => `\n\n\t\n\t\t${getDavProperties()}\n\t\n\t\n\t\t${tagId}\n\t\n`;\nconst tagToNode = function (tag) {\n return new Folder({\n id: tag.id,\n source: `${davRemoteURL}${rootPath}/${tag.id}`,\n owner: String(getCurrentUser()?.uid ?? 'anonymous'),\n root: rootPath,\n displayname: tag.displayName,\n permissions: Permission.READ,\n attributes: {\n ...tag,\n 'is-tag': true,\n },\n });\n};\nexport const getContents = async (path = '/') => {\n // List tags in the root\n const tagsCache = (await fetchTags()).filter(tag => tag.userVisible);\n if (path === '/') {\n return {\n folder: new Folder({\n id: 0,\n source: `${davRemoteURL}${rootPath}`,\n owner: getCurrentUser()?.uid,\n root: rootPath,\n permissions: Permission.NONE,\n }),\n contents: tagsCache.map(tagToNode),\n };\n }\n const tagId = parseInt(path.split('/', 2)[1]);\n const tag = tagsCache.find(tag => tag.id === tagId);\n if (!tag) {\n throw new Error('Tag not found');\n }\n const folder = tagToNode(tag);\n const contentsResponse = await client.getDirectoryContents(davRootPath, {\n details: true,\n // Only filter favorites if we're at the root\n data: formatReportPayload(tagId),\n headers: {\n // Patched in WebdavClient.ts\n method: 'REPORT',\n },\n });\n return {\n folder,\n contents: contentsResponse.data.map(resultToNode),\n };\n};\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { translate as t } from '@nextcloud/l10n';\nimport { View, getNavigation } from '@nextcloud/files';\nimport { getContents } from '../services/systemtags.js';\nimport svgTagMultiple from '@mdi/svg/svg/tag-multiple-outline.svg?raw';\nexport const systemTagsViewId = 'tags';\n/**\n * Register the system tags files view\n */\nexport function registerSystemTagsView() {\n const Navigation = getNavigation();\n Navigation.register(new View({\n id: systemTagsViewId,\n name: t('systemtags', 'Tags'),\n caption: t('systemtags', 'List of tags and their associated files and folders.'),\n emptyTitle: t('systemtags', 'No tags found'),\n emptyCaption: t('systemtags', 'Tags you have created will show up here.'),\n icon: svgTagMultiple,\n order: 25,\n getContents,\n }));\n}\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/sass-loader/dist/cjs.js!./fileEntryInlineSystemTags.scss\";\n export default content && content.locals ? content.locals : undefined;\n","import { FileAction } from '@nextcloud/files';\nimport { subscribe } from '@nextcloud/event-bus';\nimport { t } from '@nextcloud/l10n';\nimport '../css/fileEntryInlineSystemTags.scss';\nimport { elementColor, isDarkModeEnabled } from '../utils/colorUtils';\nimport { fetchTags } from '../services/api';\nimport { getNodeSystemTags } from '../utils';\nimport logger from '../logger.ts';\n// Init tag cache\nconst cache = [];\nconst renderTag = function (tag, isMore = false) {\n const tagElement = document.createElement('li');\n tagElement.classList.add('files-list__system-tag');\n tagElement.setAttribute('data-systemtag-name', tag);\n tagElement.textContent = tag;\n // Set the color if it exists\n const cachedTag = cache.find((t) => t.displayName === tag);\n if (cachedTag?.color) {\n // Make sure contrast is good and follow WCAG guidelines\n const mainBackgroundColor = getComputedStyle(document.body)\n .getPropertyValue('--color-main-background')\n .replace('#', '') || (isDarkModeEnabled() ? '000000' : 'ffffff');\n const primaryElement = elementColor(`#${cachedTag.color}`, `#${mainBackgroundColor}`);\n tagElement.style.setProperty('--systemtag-color', primaryElement);\n tagElement.setAttribute('data-systemtag-color', 'true');\n }\n if (isMore) {\n tagElement.classList.add('files-list__system-tag--more');\n }\n return tagElement;\n};\nconst renderInline = async function (node) {\n // Ensure we have the system tags as an array\n const tags = getNodeSystemTags(node);\n const systemTagsElement = document.createElement('ul');\n systemTagsElement.classList.add('files-list__system-tags');\n systemTagsElement.setAttribute('aria-label', t('files', 'Assigned collaborative tags'));\n systemTagsElement.setAttribute('data-systemtags-fileid', node.fileid?.toString() || '');\n if (tags.length === 0) {\n return systemTagsElement;\n }\n // Fetch the tags if the cache is empty\n if (cache.length === 0) {\n try {\n // Best would be to support attributes from webdav,\n // but currently the library does not support it\n cache.push(...await fetchTags());\n }\n catch (error) {\n logger.error('Failed to fetch tags', { error });\n }\n }\n systemTagsElement.append(renderTag(tags[0]));\n if (tags.length === 2) {\n // Special case only two tags:\n // the overflow fake tag would take the same space as this, so render it\n systemTagsElement.append(renderTag(tags[1]));\n }\n else if (tags.length > 1) {\n // More tags than the one we're showing\n // So we add a overflow element indicating there are more tags\n const moreTagElement = renderTag('+' + (tags.length - 1), true);\n moreTagElement.setAttribute('title', tags.slice(1).join(', '));\n // because the title is not accessible we hide this element for screen readers (see alternative below)\n moreTagElement.setAttribute('aria-hidden', 'true');\n moreTagElement.setAttribute('role', 'presentation');\n systemTagsElement.append(moreTagElement);\n // For accessibility the tags are listed, as the title is not accessible\n // but those tags are visually hidden\n for (const tag of tags.slice(1)) {\n const tagElement = renderTag(tag);\n tagElement.classList.add('hidden-visually');\n systemTagsElement.append(tagElement);\n }\n }\n return systemTagsElement;\n};\nexport const action = new FileAction({\n id: 'system-tags',\n displayName: () => '',\n iconSvgInline: () => '',\n enabled(nodes) {\n // Only show the action on single nodes\n if (nodes.length !== 1) {\n return false;\n }\n // Always show the action, even if there are no tags\n // This will render an empty tag list and allow events to update it\n return true;\n },\n exec: async () => null,\n renderInline,\n order: 0,\n hotkey: {\n description: t('files', 'Manage tags'),\n key: 'T',\n },\n});\n// Update the system tags html when the node is updated\nconst updateSystemTagsHtml = function (node) {\n renderInline(node).then((systemTagsHtml) => {\n document.querySelectorAll(`[data-systemtags-fileid=\"${node.fileid}\"]`).forEach((element) => {\n element.replaceWith(systemTagsHtml);\n });\n });\n};\n// Add and remove tags from the cache\nconst addTag = function (tag) {\n cache.push(tag);\n};\nconst removeTag = function (tag) {\n cache.splice(cache.findIndex((t) => t.id === tag.id), 1);\n};\nconst updateTag = function (tag) {\n const index = cache.findIndex((t) => t.id === tag.id);\n if (index !== -1) {\n cache[index] = tag;\n }\n updateSystemTagsColorAttribute(tag);\n};\n// Update the color attribute of the system tags\nconst updateSystemTagsColorAttribute = function (tag) {\n document.querySelectorAll(`[data-systemtag-name=\"${tag.displayName}\"]`).forEach((element) => {\n element.style.setProperty('--systemtag-color', `#${tag.color}`);\n });\n};\n// Subscribe to the events\nsubscribe('systemtags:node:updated', updateSystemTagsHtml);\nsubscribe('systemtags:tag:created', addTag);\nsubscribe('systemtags:tag:deleted', removeTag);\nsubscribe('systemtags:tag:updated', updateTag);\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport {} from '@nextcloud/files';\nimport { FileType, FileAction, DefaultType } from '@nextcloud/files';\nimport { t } from '@nextcloud/l10n';\nimport { systemTagsViewId } from '../files_views/systemtagsView';\nexport const action = new FileAction({\n id: 'systemtags:open-in-files',\n displayName: () => t('systemtags', 'Open in Files'),\n iconSvgInline: () => '',\n enabled(nodes, view) {\n // Only for the system tags view\n if (view.id !== systemTagsViewId) {\n return false;\n }\n // Only for single nodes\n if (nodes.length !== 1) {\n return false;\n }\n // Do not open tags (keep the default action) and only open folders\n return nodes[0].attributes['is-tag'] !== true\n && nodes[0].type === FileType.Folder;\n },\n async exec(node) {\n let dir = node.dirname;\n if (node.type === FileType.Folder) {\n dir = node.path;\n }\n window.OCP.Files.Router.goToRoute(null, // use default route\n { view: 'files', fileid: String(node.fileid) }, { dir, openfile: 'true' });\n return null;\n },\n // Before openFolderAction\n order: -1000,\n default: DefaultType.HIDDEN,\n});\n","/**\n * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { registerDavProperty, registerFileAction } from '@nextcloud/files';\nimport { registerHotkeys } from './services/HotKeysService';\nimport { registerSystemTagsView } from './files_views/systemtagsView';\nimport { action as bulkSystemTagsAction } from './files_actions/bulkSystemTagsAction';\nimport { action as inlineSystemTagsAction } from './files_actions/inlineSystemTagsAction';\nimport { action as openInFilesAction } from './files_actions/openInFilesAction';\nregisterDavProperty('nc:system-tags');\nregisterFileAction(bulkSystemTagsAction);\nregisterFileAction(inlineSystemTagsAction);\nregisterFileAction(openInFilesAction);\nregisterSystemTagsView();\ndocument.addEventListener('DOMContentLoaded', () => {\n registerHotkeys();\n});\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { useHotKey } from '@nextcloud/vue/composables/useHotKey';\nimport { action as manageTagAction } from '../files_actions/bulkSystemTagsAction.ts';\nimport { executeAction } from '../../../files/src/utils/actionUtils.ts';\nimport logger from '../logger.ts';\n/**\n * This register the hotkeys for the Files app.\n * As much as possible, we try to have all the hotkeys in one place.\n * Please make sure to add tests for the hotkeys after adding a new one.\n */\nexport const registerHotkeys = function () {\n // t opens the tag management dialog\n useHotKey('t', () => executeAction(manageTagAction), {\n stop: true,\n prevent: true,\n });\n logger.debug('Hotkeys registered');\n};\n","import { NodeStatus } from '@nextcloud/files';\nimport { showError, showSuccess } from '@nextcloud/dialogs';\nimport { t } from '@nextcloud/l10n';\nimport Vue from 'vue';\nimport { getPinia } from '../store';\nimport { useActiveStore } from '../store/active';\nimport logger from '../logger';\n/**\n * Execute an action on the current active node\n *\n * @param action The action to execute\n */\nexport const executeAction = async (action) => {\n const activeStore = useActiveStore(getPinia());\n const currentDir = (window?.OCP?.Files?.Router?.query?.dir || '/');\n const currentNode = activeStore.activeNode;\n const currentView = activeStore.activeView;\n if (!currentNode || !currentView) {\n logger.error('No active node or view', { node: currentNode, view: currentView });\n return;\n }\n if (currentNode.status === NodeStatus.LOADING) {\n logger.debug('Node is already loading', { node: currentNode });\n return;\n }\n if (!action.enabled([currentNode], currentView)) {\n logger.debug('Action is not not available for the current context', { action, node: currentNode, view: currentView });\n return;\n }\n let displayName = action.id;\n try {\n displayName = action.displayName([currentNode], currentView);\n }\n catch (error) {\n logger.error('Error while getting action display name', { action, error });\n }\n try {\n // Set the loading marker\n Vue.set(currentNode, 'status', NodeStatus.LOADING);\n activeStore.activeAction = action;\n const success = await action.exec(currentNode, currentView, currentDir);\n // If the action returns null, we stay silent\n if (success === null || success === undefined) {\n return;\n }\n if (success) {\n showSuccess(t('files', '{displayName}: done', { displayName }));\n return;\n }\n showError(t('files', '{displayName}: failed', { displayName }));\n }\n catch (error) {\n logger.error('Error while executing action', { action, error });\n showError(t('files', '{displayName}: failed', { displayName }));\n }\n finally {\n // Reset the loading marker\n Vue.set(currentNode, 'status', undefined);\n activeStore.activeAction = undefined;\n }\n};\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { createPinia } from 'pinia';\nexport const getPinia = () => {\n if (window._nc_files_pinia) {\n return window._nc_files_pinia;\n }\n window._nc_files_pinia = createPinia();\n return window._nc_files_pinia;\n};\n","const colors = {\n\taliceblue: [240, 248, 255],\n\tantiquewhite: [250, 235, 215],\n\taqua: [0, 255, 255],\n\taquamarine: [127, 255, 212],\n\tazure: [240, 255, 255],\n\tbeige: [245, 245, 220],\n\tbisque: [255, 228, 196],\n\tblack: [0, 0, 0],\n\tblanchedalmond: [255, 235, 205],\n\tblue: [0, 0, 255],\n\tblueviolet: [138, 43, 226],\n\tbrown: [165, 42, 42],\n\tburlywood: [222, 184, 135],\n\tcadetblue: [95, 158, 160],\n\tchartreuse: [127, 255, 0],\n\tchocolate: [210, 105, 30],\n\tcoral: [255, 127, 80],\n\tcornflowerblue: [100, 149, 237],\n\tcornsilk: [255, 248, 220],\n\tcrimson: [220, 20, 60],\n\tcyan: [0, 255, 255],\n\tdarkblue: [0, 0, 139],\n\tdarkcyan: [0, 139, 139],\n\tdarkgoldenrod: [184, 134, 11],\n\tdarkgray: [169, 169, 169],\n\tdarkgreen: [0, 100, 0],\n\tdarkgrey: [169, 169, 169],\n\tdarkkhaki: [189, 183, 107],\n\tdarkmagenta: [139, 0, 139],\n\tdarkolivegreen: [85, 107, 47],\n\tdarkorange: [255, 140, 0],\n\tdarkorchid: [153, 50, 204],\n\tdarkred: [139, 0, 0],\n\tdarksalmon: [233, 150, 122],\n\tdarkseagreen: [143, 188, 143],\n\tdarkslateblue: [72, 61, 139],\n\tdarkslategray: [47, 79, 79],\n\tdarkslategrey: [47, 79, 79],\n\tdarkturquoise: [0, 206, 209],\n\tdarkviolet: [148, 0, 211],\n\tdeeppink: [255, 20, 147],\n\tdeepskyblue: [0, 191, 255],\n\tdimgray: [105, 105, 105],\n\tdimgrey: [105, 105, 105],\n\tdodgerblue: [30, 144, 255],\n\tfirebrick: [178, 34, 34],\n\tfloralwhite: [255, 250, 240],\n\tforestgreen: [34, 139, 34],\n\tfuchsia: [255, 0, 255],\n\tgainsboro: [220, 220, 220],\n\tghostwhite: [248, 248, 255],\n\tgold: [255, 215, 0],\n\tgoldenrod: [218, 165, 32],\n\tgray: [128, 128, 128],\n\tgreen: [0, 128, 0],\n\tgreenyellow: [173, 255, 47],\n\tgrey: [128, 128, 128],\n\thoneydew: [240, 255, 240],\n\thotpink: [255, 105, 180],\n\tindianred: [205, 92, 92],\n\tindigo: [75, 0, 130],\n\tivory: [255, 255, 240],\n\tkhaki: [240, 230, 140],\n\tlavender: [230, 230, 250],\n\tlavenderblush: [255, 240, 245],\n\tlawngreen: [124, 252, 0],\n\tlemonchiffon: [255, 250, 205],\n\tlightblue: [173, 216, 230],\n\tlightcoral: [240, 128, 128],\n\tlightcyan: [224, 255, 255],\n\tlightgoldenrodyellow: [250, 250, 210],\n\tlightgray: [211, 211, 211],\n\tlightgreen: [144, 238, 144],\n\tlightgrey: [211, 211, 211],\n\tlightpink: [255, 182, 193],\n\tlightsalmon: [255, 160, 122],\n\tlightseagreen: [32, 178, 170],\n\tlightskyblue: [135, 206, 250],\n\tlightslategray: [119, 136, 153],\n\tlightslategrey: [119, 136, 153],\n\tlightsteelblue: [176, 196, 222],\n\tlightyellow: [255, 255, 224],\n\tlime: [0, 255, 0],\n\tlimegreen: [50, 205, 50],\n\tlinen: [250, 240, 230],\n\tmagenta: [255, 0, 255],\n\tmaroon: [128, 0, 0],\n\tmediumaquamarine: [102, 205, 170],\n\tmediumblue: [0, 0, 205],\n\tmediumorchid: [186, 85, 211],\n\tmediumpurple: [147, 112, 219],\n\tmediumseagreen: [60, 179, 113],\n\tmediumslateblue: [123, 104, 238],\n\tmediumspringgreen: [0, 250, 154],\n\tmediumturquoise: [72, 209, 204],\n\tmediumvioletred: [199, 21, 133],\n\tmidnightblue: [25, 25, 112],\n\tmintcream: [245, 255, 250],\n\tmistyrose: [255, 228, 225],\n\tmoccasin: [255, 228, 181],\n\tnavajowhite: [255, 222, 173],\n\tnavy: [0, 0, 128],\n\toldlace: [253, 245, 230],\n\tolive: [128, 128, 0],\n\tolivedrab: [107, 142, 35],\n\torange: [255, 165, 0],\n\torangered: [255, 69, 0],\n\torchid: [218, 112, 214],\n\tpalegoldenrod: [238, 232, 170],\n\tpalegreen: [152, 251, 152],\n\tpaleturquoise: [175, 238, 238],\n\tpalevioletred: [219, 112, 147],\n\tpapayawhip: [255, 239, 213],\n\tpeachpuff: [255, 218, 185],\n\tperu: [205, 133, 63],\n\tpink: [255, 192, 203],\n\tplum: [221, 160, 221],\n\tpowderblue: [176, 224, 230],\n\tpurple: [128, 0, 128],\n\trebeccapurple: [102, 51, 153],\n\tred: [255, 0, 0],\n\trosybrown: [188, 143, 143],\n\troyalblue: [65, 105, 225],\n\tsaddlebrown: [139, 69, 19],\n\tsalmon: [250, 128, 114],\n\tsandybrown: [244, 164, 96],\n\tseagreen: [46, 139, 87],\n\tseashell: [255, 245, 238],\n\tsienna: [160, 82, 45],\n\tsilver: [192, 192, 192],\n\tskyblue: [135, 206, 235],\n\tslateblue: [106, 90, 205],\n\tslategray: [112, 128, 144],\n\tslategrey: [112, 128, 144],\n\tsnow: [255, 250, 250],\n\tspringgreen: [0, 255, 127],\n\tsteelblue: [70, 130, 180],\n\ttan: [210, 180, 140],\n\tteal: [0, 128, 128],\n\tthistle: [216, 191, 216],\n\ttomato: [255, 99, 71],\n\tturquoise: [64, 224, 208],\n\tviolet: [238, 130, 238],\n\twheat: [245, 222, 179],\n\twhite: [255, 255, 255],\n\twhitesmoke: [245, 245, 245],\n\tyellow: [255, 255, 0],\n\tyellowgreen: [154, 205, 50],\n}\n\nfor (const key in colors) Object.freeze(colors[key]);\nexport default Object.freeze(colors);","import colorNames from 'color-name';\n\nconst reverseNames = Object.create(null);\n\n// Create a list of reverse color names\nfor (const name in colorNames) {\n\tif (Object.hasOwn(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nconst cs = {\n\tto: {},\n\tget: {},\n};\n\ncs.get = function (string) {\n\tconst prefix = string.slice(0, 3).toLowerCase();\n\tlet value;\n\tlet model;\n\tswitch (prefix) {\n\t\tcase 'hsl': {\n\t\t\tvalue = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\t}\n\n\t\tcase 'hwb': {\n\t\t\tvalue = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\t}\n\n\t\tdefault: {\n\t\t\tvalue = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t\t}\n\t}\n\n\tif (!value) {\n\t\treturn null;\n\t}\n\n\treturn {model, value};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tconst abbr = /^#([a-f\\d]{3,4})$/i;\n\tconst hex = /^#([a-f\\d]{6})([a-f\\d]{2})?$/i;\n\tconst rgba = /^rgba?\\(\\s*([+-]?(?:\\d*\\.)?\\d+(?:e\\d+)?)(?=[\\s,])\\s*(?:,\\s*)?([+-]?(?:\\d*\\.)?\\d+(?:e\\d+)?)(?=[\\s,])\\s*(?:,\\s*)?([+-]?(?:\\d*\\.)?\\d+(?:e\\d+)?)\\s*(?:[\\s,|/]\\s*([+-]?(?:\\d*\\.)?\\d+(?:e\\d+)?)(%?)\\s*)?\\)$/i;\n\tconst per = /^rgba?\\(\\s*([+-]?[\\d.]+)%\\s*,?\\s*([+-]?[\\d.]+)%\\s*,?\\s*([+-]?[\\d.]+)%\\s*(?:[\\s,|/]\\s*([+-]?[\\d.]+)(%?)\\s*)?\\)$/;\n\tconst keyword = /^(\\w+)$/;\n\n\tlet rgb = [0, 0, 0, 1];\n\tlet match;\n\tlet i;\n\tlet hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tconst i2 = i * 2;\n\t\t\trgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = Number.parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Number.parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Number.parseFloat(match[i + 1]);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\trgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\trgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!Object.hasOwn(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// eslint-disable-next-line unicorn/prefer-spread\n\t\trgb = colorNames[match[1]].slice();\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tconst hsl = /^hsla?\\(\\s*([+-]?(?:\\d{0,3}\\.)?\\d+)(?:deg)?\\s*,?\\s*([+-]?[\\d.]+)%\\s*,?\\s*([+-]?[\\d.]+)%\\s*(?:[,|/]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tconst match = string.match(hsl);\n\n\tif (match) {\n\t\tconst alpha = Number.parseFloat(match[4]);\n\t\tconst h = ((Number.parseFloat(match[1]) % 360) + 360) % 360;\n\t\tconst s = clamp(Number.parseFloat(match[2]), 0, 100);\n\t\tconst l = clamp(Number.parseFloat(match[3]), 0, 100);\n\t\tconst a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tconst hwb = /^hwb\\(\\s*([+-]?\\d{0,3}(?:\\.\\d+)?)(?:deg)?\\s*[\\s,]\\s*([+-]?[\\d.]+)%\\s*[\\s,]\\s*([+-]?[\\d.]+)%\\s*(?:[\\s,]\\s*([+-]?(?=\\.\\d|\\d)(?:0|[1-9]\\d*)?(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)\\s*)?\\)$/;\n\tconst match = string.match(hwb);\n\n\tif (match) {\n\t\tconst alpha = Number.parseFloat(match[4]);\n\t\tconst h = ((Number.parseFloat(match[1]) % 360) + 360) % 360;\n\t\tconst w = clamp(Number.parseFloat(match[2]), 0, 100);\n\t\tconst b = clamp(Number.parseFloat(match[3]), 0, 100);\n\t\tconst a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function (...rgba) {\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function (...rgba) {\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function (...rgba) {\n\tconst r = Math.round(rgba[0] / 255 * 100);\n\tconst g = Math.round(rgba[1] / 255 * 100);\n\tconst b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function (...hsla) {\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// Hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function (...hwba) {\n\tlet a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (...rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// Helpers\nfunction clamp(number_, min, max) {\n\treturn Math.min(Math.max(min, number_), max);\n}\n\nfunction hexDouble(number_) {\n\tconst string_ = Math.round(number_).toString(16).toUpperCase();\n\treturn (string_.length < 2) ? '0' + string_ : string_;\n}\n\nexport default cs;\n","const colors = {\n\taliceblue: [240, 248, 255],\n\tantiquewhite: [250, 235, 215],\n\taqua: [0, 255, 255],\n\taquamarine: [127, 255, 212],\n\tazure: [240, 255, 255],\n\tbeige: [245, 245, 220],\n\tbisque: [255, 228, 196],\n\tblack: [0, 0, 0],\n\tblanchedalmond: [255, 235, 205],\n\tblue: [0, 0, 255],\n\tblueviolet: [138, 43, 226],\n\tbrown: [165, 42, 42],\n\tburlywood: [222, 184, 135],\n\tcadetblue: [95, 158, 160],\n\tchartreuse: [127, 255, 0],\n\tchocolate: [210, 105, 30],\n\tcoral: [255, 127, 80],\n\tcornflowerblue: [100, 149, 237],\n\tcornsilk: [255, 248, 220],\n\tcrimson: [220, 20, 60],\n\tcyan: [0, 255, 255],\n\tdarkblue: [0, 0, 139],\n\tdarkcyan: [0, 139, 139],\n\tdarkgoldenrod: [184, 134, 11],\n\tdarkgray: [169, 169, 169],\n\tdarkgreen: [0, 100, 0],\n\tdarkgrey: [169, 169, 169],\n\tdarkkhaki: [189, 183, 107],\n\tdarkmagenta: [139, 0, 139],\n\tdarkolivegreen: [85, 107, 47],\n\tdarkorange: [255, 140, 0],\n\tdarkorchid: [153, 50, 204],\n\tdarkred: [139, 0, 0],\n\tdarksalmon: [233, 150, 122],\n\tdarkseagreen: [143, 188, 143],\n\tdarkslateblue: [72, 61, 139],\n\tdarkslategray: [47, 79, 79],\n\tdarkslategrey: [47, 79, 79],\n\tdarkturquoise: [0, 206, 209],\n\tdarkviolet: [148, 0, 211],\n\tdeeppink: [255, 20, 147],\n\tdeepskyblue: [0, 191, 255],\n\tdimgray: [105, 105, 105],\n\tdimgrey: [105, 105, 105],\n\tdodgerblue: [30, 144, 255],\n\tfirebrick: [178, 34, 34],\n\tfloralwhite: [255, 250, 240],\n\tforestgreen: [34, 139, 34],\n\tfuchsia: [255, 0, 255],\n\tgainsboro: [220, 220, 220],\n\tghostwhite: [248, 248, 255],\n\tgold: [255, 215, 0],\n\tgoldenrod: [218, 165, 32],\n\tgray: [128, 128, 128],\n\tgreen: [0, 128, 0],\n\tgreenyellow: [173, 255, 47],\n\tgrey: [128, 128, 128],\n\thoneydew: [240, 255, 240],\n\thotpink: [255, 105, 180],\n\tindianred: [205, 92, 92],\n\tindigo: [75, 0, 130],\n\tivory: [255, 255, 240],\n\tkhaki: [240, 230, 140],\n\tlavender: [230, 230, 250],\n\tlavenderblush: [255, 240, 245],\n\tlawngreen: [124, 252, 0],\n\tlemonchiffon: [255, 250, 205],\n\tlightblue: [173, 216, 230],\n\tlightcoral: [240, 128, 128],\n\tlightcyan: [224, 255, 255],\n\tlightgoldenrodyellow: [250, 250, 210],\n\tlightgray: [211, 211, 211],\n\tlightgreen: [144, 238, 144],\n\tlightgrey: [211, 211, 211],\n\tlightpink: [255, 182, 193],\n\tlightsalmon: [255, 160, 122],\n\tlightseagreen: [32, 178, 170],\n\tlightskyblue: [135, 206, 250],\n\tlightslategray: [119, 136, 153],\n\tlightslategrey: [119, 136, 153],\n\tlightsteelblue: [176, 196, 222],\n\tlightyellow: [255, 255, 224],\n\tlime: [0, 255, 0],\n\tlimegreen: [50, 205, 50],\n\tlinen: [250, 240, 230],\n\tmagenta: [255, 0, 255],\n\tmaroon: [128, 0, 0],\n\tmediumaquamarine: [102, 205, 170],\n\tmediumblue: [0, 0, 205],\n\tmediumorchid: [186, 85, 211],\n\tmediumpurple: [147, 112, 219],\n\tmediumseagreen: [60, 179, 113],\n\tmediumslateblue: [123, 104, 238],\n\tmediumspringgreen: [0, 250, 154],\n\tmediumturquoise: [72, 209, 204],\n\tmediumvioletred: [199, 21, 133],\n\tmidnightblue: [25, 25, 112],\n\tmintcream: [245, 255, 250],\n\tmistyrose: [255, 228, 225],\n\tmoccasin: [255, 228, 181],\n\tnavajowhite: [255, 222, 173],\n\tnavy: [0, 0, 128],\n\toldlace: [253, 245, 230],\n\tolive: [128, 128, 0],\n\tolivedrab: [107, 142, 35],\n\torange: [255, 165, 0],\n\torangered: [255, 69, 0],\n\torchid: [218, 112, 214],\n\tpalegoldenrod: [238, 232, 170],\n\tpalegreen: [152, 251, 152],\n\tpaleturquoise: [175, 238, 238],\n\tpalevioletred: [219, 112, 147],\n\tpapayawhip: [255, 239, 213],\n\tpeachpuff: [255, 218, 185],\n\tperu: [205, 133, 63],\n\tpink: [255, 192, 203],\n\tplum: [221, 160, 221],\n\tpowderblue: [176, 224, 230],\n\tpurple: [128, 0, 128],\n\trebeccapurple: [102, 51, 153],\n\tred: [255, 0, 0],\n\trosybrown: [188, 143, 143],\n\troyalblue: [65, 105, 225],\n\tsaddlebrown: [139, 69, 19],\n\tsalmon: [250, 128, 114],\n\tsandybrown: [244, 164, 96],\n\tseagreen: [46, 139, 87],\n\tseashell: [255, 245, 238],\n\tsienna: [160, 82, 45],\n\tsilver: [192, 192, 192],\n\tskyblue: [135, 206, 235],\n\tslateblue: [106, 90, 205],\n\tslategray: [112, 128, 144],\n\tslategrey: [112, 128, 144],\n\tsnow: [255, 250, 250],\n\tspringgreen: [0, 255, 127],\n\tsteelblue: [70, 130, 180],\n\ttan: [210, 180, 140],\n\tteal: [0, 128, 128],\n\tthistle: [216, 191, 216],\n\ttomato: [255, 99, 71],\n\tturquoise: [64, 224, 208],\n\tviolet: [238, 130, 238],\n\twheat: [245, 222, 179],\n\twhite: [255, 255, 255],\n\twhitesmoke: [245, 245, 245],\n\tyellow: [255, 255, 0],\n\tyellowgreen: [154, 205, 50],\n}\n\nfor (const key in colors) Object.freeze(colors[key]);\nexport default Object.freeze(colors);","/* MIT license */\n/* eslint-disable no-mixed-operators */\nimport cssKeywords from 'color-name';\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nconst reverseKeywords = {};\nfor (const key of Object.keys(cssKeywords)) {\n\treverseKeywords[cssKeywords[key]] = key;\n}\n\nconst convert = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\toklab: {channels: 3, labels: ['okl', 'oka', 'okb']},\n\tlch: {channels: 3, labels: 'lch'},\n\toklch: {channels: 3, labels: ['okl', 'okc', 'okh']},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']},\n};\n\nexport default convert;\n\n// LAB f(t) constant\nconst LAB_FT = (6 / 29) ** 3;\n\n// SRGB non-linear transform functions\nfunction srgbNonlinearTransform(c) {\n\tconst cc = c > 0.003_130_8\n\t\t? ((1.055 * (c ** (1 / 2.4))) - 0.055)\n\t\t: c * 12.92;\n\treturn Math.min(Math.max(0, cc), 1);\n}\n\nfunction srgbNonlinearTransformInv(c) {\n\treturn c > 0.040_45 ? (((c + 0.055) / 1.055) ** 2.4) : (c / 12.92);\n}\n\n// Hide .channels and .labels properties\nfor (const model of Object.keys(convert)) {\n\tif (!('channels' in convert[model])) {\n\t\tthrow new Error('missing channels property: ' + model);\n\t}\n\n\tif (!('labels' in convert[model])) {\n\t\tthrow new Error('missing channel labels property: ' + model);\n\t}\n\n\tif (convert[model].labels.length !== convert[model].channels) {\n\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t}\n\n\tconst {channels, labels} = convert[model];\n\tdelete convert[model].channels;\n\tdelete convert[model].labels;\n\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\tObject.defineProperty(convert[model], 'labels', {value: labels});\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst min = Math.min(r, g, b);\n\tconst max = Math.max(r, g, b);\n\tconst delta = max - min;\n\tlet h;\n\tlet s;\n\n\tswitch (max) {\n\t\tcase min: {\n\t\t\th = 0;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase r: {\n\t\t\th = (g - b) / delta;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase g: {\n\t\t\th = 2 + (b - r) / delta;\n\n\t\t\tbreak;\n\t\t}\n\n\t\tcase b: {\n\t\t\th = 4 + (r - g) / delta;\n\n\t\t\tbreak;\n\t\t}\n\t// No default\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst l = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tlet rdif;\n\tlet gdif;\n\tlet bdif;\n\tlet h;\n\tlet s;\n\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst v = Math.max(r, g, b);\n\tconst diff = v - Math.min(r, g, b);\n\tconst diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tswitch (v) {\n\t\t\tcase r: {\n\t\t\t\th = bdif - gdif;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase g: {\n\t\t\t\th = (1 / 3) + rdif - bdif;\n\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tcase b: {\n\t\t\t\th = (2 / 3) + gdif - rdif;\n\n\t\t\t\tbreak;\n\t\t\t}\n\t\t// No default\n\t\t}\n\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100,\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tconst r = rgb[0];\n\tconst g = rgb[1];\n\tlet b = rgb[2];\n\tconst h = convert.rgb.hsl(rgb)[0];\n\tconst w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.oklab = function (rgb) {\n\t// Assume sRGB\n\tconst r = srgbNonlinearTransformInv(rgb[0] / 255);\n\tconst g = srgbNonlinearTransformInv(rgb[1] / 255);\n\tconst b = srgbNonlinearTransformInv(rgb[2] / 255);\n\n\tconst lp = Math.cbrt(0.412_221_470_8 * r + 0.536_332_536_3 * g + 0.051_445_992_9 * b);\n\tconst mp = Math.cbrt(0.211_903_498_2 * r + 0.680_699_545_1 * g + 0.107_396_956_6 * b);\n\tconst sp = Math.cbrt(0.088_302_461_9 * r + 0.281_718_837_6 * g + 0.629_978_700_5 * b);\n\n\tconst l = 0.210_454_255_3 * lp + 0.793_617_785 * mp - 0.004_072_046_8 * sp;\n\tconst aa = 1.977_998_495_1 * lp - 2.428_592_205 * mp + 0.450_593_709_9 * sp;\n\tconst bb = 0.025_904_037_1 * lp + 0.782_771_766_2 * mp - 0.808_675_766 * sp;\n\n\treturn [l * 100, aa * 100, bb * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\n\tconst k = Math.min(1 - r, 1 - g, 1 - b);\n\tconst c = (1 - r - k) / (1 - k) || 0;\n\tconst m = (1 - g - k) / (1 - k) || 0;\n\tconst y = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\nfunction comparativeDistance(x, y) {\n\t/*\n\t\tSee https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n\t*/\n\treturn (\n\t\t((x[0] - y[0]) ** 2) +\n\t\t((x[1] - y[1]) ** 2) +\n\t\t((x[2] - y[2]) ** 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tconst reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tlet currentClosestDistance = Number.POSITIVE_INFINITY;\n\tlet currentClosestKeyword;\n\n\tfor (const keyword of Object.keys(cssKeywords)) {\n\t\tconst value = cssKeywords[keyword];\n\n\t\t// Compute comparative distance\n\t\tconst distance = comparativeDistance(rgb, value);\n\n\t\t// Check if its less, if so set as closest\n\t\tif (distance < currentClosestDistance) {\n\t\t\tcurrentClosestDistance = distance;\n\t\t\tcurrentClosestKeyword = keyword;\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn [...cssKeywords[keyword]];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\t// Assume sRGB\n\tconst r = srgbNonlinearTransformInv(rgb[0] / 255);\n\tconst g = srgbNonlinearTransformInv(rgb[1] / 255);\n\tconst b = srgbNonlinearTransformInv(rgb[2] / 255);\n\n\tconst x = (r * 0.412_456_4) + (g * 0.357_576_1) + (b * 0.180_437_5);\n\tconst y = (r * 0.212_672_9) + (g * 0.715_152_2) + (b * 0.072_175);\n\tconst z = (r * 0.019_333_9) + (g * 0.119_192) + (b * 0.950_304_1);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tconst xyz = convert.rgb.xyz(rgb);\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > LAB_FT ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > LAB_FT ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > LAB_FT ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tconst h = hsl[0] / 360;\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\tlet t3;\n\tlet value;\n\n\tif (s === 0) {\n\t\tvalue = l * 255;\n\t\treturn [value, value, value];\n\t}\n\n\tconst t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;\n\n\tconst t1 = 2 * l - t2;\n\n\tconst rgb = [0, 0, 0];\n\tfor (let i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tvalue = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tvalue = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tvalue = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tvalue = t1;\n\t\t}\n\n\t\trgb[i] = value * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tconst h = hsl[0];\n\tlet s = hsl[1] / 100;\n\tlet l = hsl[2] / 100;\n\tlet smin = s;\n\tconst lmin = Math.max(l, 0.01);\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tconst v = (l + s) / 2;\n\tconst sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tconst h = hsv[0] / 60;\n\tconst s = hsv[1] / 100;\n\tlet v = hsv[2] / 100;\n\tconst hi = Math.floor(h) % 6;\n\n\tconst f = h - Math.floor(h);\n\tconst p = 255 * v * (1 - s);\n\tconst q = 255 * v * (1 - (s * f));\n\tconst t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0: {\n\t\t\treturn [v, t, p];\n\t\t}\n\n\t\tcase 1: {\n\t\t\treturn [q, v, p];\n\t\t}\n\n\t\tcase 2: {\n\t\t\treturn [p, v, t];\n\t\t}\n\n\t\tcase 3: {\n\t\t\treturn [p, q, v];\n\t\t}\n\n\t\tcase 4: {\n\t\t\treturn [t, p, v];\n\t\t}\n\n\t\tcase 5: {\n\t\t\treturn [v, p, q];\n\t\t}\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tconst h = hsv[0];\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\tconst vmin = Math.max(v, 0.01);\n\tlet sl;\n\tlet l;\n\n\tl = (2 - s) * v;\n\tconst lmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tconst h = hwb[0] / 360;\n\tlet wh = hwb[1] / 100;\n\tlet bl = hwb[2] / 100;\n\tconst ratio = wh + bl;\n\tlet f;\n\n\t// Wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\tconst i = Math.floor(6 * h);\n\tconst v = 1 - bl;\n\tf = 6 * h - i;\n\n\t// eslint-disable-next-line no-bitwise\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tconst n = wh + f * (v - wh); // Linear interpolation\n\n\tlet r;\n\tlet g;\n\tlet b;\n\t/* eslint-disable max-statements-per-line,no-multi-spaces, default-case-last */\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: { r = v; g = n; b = wh; break;\n\t\t}\n\n\t\tcase 1: { r = n; g = v; b = wh; break;\n\t\t}\n\n\t\tcase 2: { r = wh; g = v; b = n; break;\n\t\t}\n\n\t\tcase 3: { r = wh; g = n; b = v; break;\n\t\t}\n\n\t\tcase 4: { r = n; g = wh; b = v; break;\n\t\t}\n\n\t\tcase 5: { r = v; g = wh; b = n; break;\n\t\t}\n\t}\n\t/* eslint-enable max-statements-per-line,no-multi-spaces, default-case-last */\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tconst c = cmyk[0] / 100;\n\tconst m = cmyk[1] / 100;\n\tconst y = cmyk[2] / 100;\n\tconst k = cmyk[3] / 100;\n\n\tconst r = 1 - Math.min(1, c * (1 - k) + k);\n\tconst g = 1 - Math.min(1, m * (1 - k) + k);\n\tconst b = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\tlet r;\n\tlet g;\n\tlet b;\n\n\tr = (x * 3.240_454_2) + (y * -1.537_138_5) + (z * -0.498_531_4);\n\tg = (x * -0.969_266) + (y * 1.876_010_8) + (z * 0.041_556);\n\tb = (x * 0.055_643_4) + (y * -0.204_025_9) + (z * 1.057_225_2);\n\n\t// Assume sRGB\n\tr = srgbNonlinearTransform(r);\n\tg = srgbNonlinearTransform(g);\n\tb = srgbNonlinearTransform(b);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tlet x = xyz[0];\n\tlet y = xyz[1];\n\tlet z = xyz[2];\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > LAB_FT ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);\n\ty = y > LAB_FT ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);\n\tz = z > LAB_FT ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);\n\n\tconst l = (116 * y) - 16;\n\tconst a = 500 * (x - y);\n\tconst b = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.xyz.oklab = function (xyz) {\n\tconst x = xyz[0] / 100;\n\tconst y = xyz[1] / 100;\n\tconst z = xyz[2] / 100;\n\n\tconst lp = Math.cbrt(0.818_933_010_1 * x + 0.361_866_742_4 * y - 0.128_859_713_7 * z);\n\tconst mp = Math.cbrt(0.032_984_543_6 * x + 0.929_311_871_5 * y + 0.036_145_638_7 * z);\n\tconst sp = Math.cbrt(0.048_200_301_8 * x + 0.264_366_269_1 * y + 0.633_851_707 * z);\n\n\tconst l = 0.210_454_255_3 * lp + 0.793_617_785 * mp - 0.004_072_046_8 * sp;\n\tconst a = 1.977_998_495_1 * lp - 2.428_592_205 * mp + 0.450_593_709_9 * sp;\n\tconst b = 0.025_904_037_1 * lp + 0.782_771_766_2 * mp - 0.808_675_766 * sp;\n\n\treturn [l * 100, a * 100, b * 100];\n};\n\nconvert.oklab.oklch = function (oklab) {\n\treturn convert.lab.lch(oklab);\n};\n\nconvert.oklab.xyz = function (oklab) {\n\tconst ll = oklab[0] / 100;\n\tconst a = oklab[1] / 100;\n\tconst b = oklab[2] / 100;\n\n\tconst l = (0.999_999_998 * ll + 0.396_337_792 * a + 0.215_803_758 * b) ** 3;\n\tconst m = (1.000_000_008 * ll - 0.105_561_342 * a - 0.063_854_175 * b) ** 3;\n\tconst s = (1.000_000_055 * ll - 0.089_484_182 * a - 1.291_485_538 * b) ** 3;\n\n\tconst x = 1.227_013_851 * l - 0.557_799_98 * m + 0.281_256_149 * s;\n\tconst y = -0.040_580_178 * l + 1.112_256_87 * m - 0.071_676_679 * s;\n\tconst z = -0.076_381_285 * l - 0.421_481_978 * m + 1.586_163_22 * s;\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.oklab.rgb = function (oklab) {\n\tconst ll = oklab[0] / 100;\n\tconst aa = oklab[1] / 100;\n\tconst bb = oklab[2] / 100;\n\n\tconst l = (ll + 0.396_337_777_4 * aa + 0.215_803_757_3 * bb) ** 3;\n\tconst m = (ll - 0.105_561_345_8 * aa - 0.063_854_172_8 * bb) ** 3;\n\tconst s = (ll - 0.089_484_177_5 * aa - 1.291_485_548 * bb) ** 3;\n\n\t// Assume sRGB\n\tconst r = srgbNonlinearTransform(4.076_741_662_1 * l - 3.307_711_591_3 * m + 0.230_969_929_2 * s);\n\tconst g = srgbNonlinearTransform(-1.268_438_004_6 * l + 2.609_757_401_1 * m - 0.341_319_396_5 * s);\n\tconst b = srgbNonlinearTransform(-0.004_196_086_3 * l - 0.703_418_614_7 * m + 1.707_614_701 * s);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.oklch.oklab = function (oklch) {\n\treturn convert.lch.lab(oklch);\n};\n\nconvert.lab.xyz = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet x;\n\tlet y;\n\tlet z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tconst y2 = y ** 3;\n\tconst x2 = x ** 3;\n\tconst z2 = z ** 3;\n\ty = y2 > LAB_FT ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > LAB_FT ? z2 : (z - 16 / 116) / 7.787;\n\n\t// Illuminant D65 XYZ Tristrimulus Values\n\t// https://en.wikipedia.org/wiki/CIE_1931_color_space\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tconst l = lab[0];\n\tconst a = lab[1];\n\tconst b = lab[2];\n\tlet h;\n\n\tconst hr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tconst c = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tconst l = lch[0];\n\tconst c = lch[1];\n\tconst h = lch[2];\n\n\tconst hr = h / 360 * 2 * Math.PI;\n\tconst a = c * Math.cos(hr);\n\tconst b = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args, saturation = null) {\n\tconst [r, g, b] = args;\n\tlet value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tlet ansi = 30\n\t\t/* eslint-disable no-bitwise */\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\t\t/* eslint-enable no-bitwise */\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// Optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tconst r = args[0];\n\tconst g = args[1];\n\tconst b = args[2];\n\n\t// We use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\t// eslint-disable-next-line no-bitwise\n\tif (r >> 4 === g >> 4 && g >> 4 === b >> 4) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tconst ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\targs = args[0];\n\n\tlet color = args % 10;\n\n\t// Handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tconst mult = (Math.trunc(args > 50) + 1) * 0.5;\n\t/* eslint-disable no-bitwise */\n\tconst r = ((color & 1) * mult) * 255;\n\tconst g = (((color >> 1) & 1) * mult) * 255;\n\tconst b = (((color >> 2) & 1) * mult) * 255;\n\t/* eslint-enable no-bitwise */\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\targs = args[0];\n\n\t// Handle greyscale\n\tif (args >= 232) {\n\t\tconst c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tlet rem;\n\tconst r = Math.floor(args / 36) / 5 * 255;\n\tconst g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tconst b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\t/* eslint-disable no-bitwise */\n\tconst integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\t/* eslint-enable no-bitwise */\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.slice(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tconst match = args.toString(16).match(/[a-f\\d]{6}|[a-f\\d]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tlet colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = [...colorString].map(char => char + char).join('');\n\t}\n\n\tconst integer = Number.parseInt(colorString, 16);\n\t/* eslint-disable no-bitwise */\n\tconst r = (integer >> 16) & 0xFF;\n\tconst g = (integer >> 8) & 0xFF;\n\tconst b = integer & 0xFF;\n\t/* eslint-enable no-bitwise */\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tconst r = rgb[0] / 255;\n\tconst g = rgb[1] / 255;\n\tconst b = rgb[2] / 255;\n\tconst max = Math.max(Math.max(r, g), b);\n\tconst min = Math.min(Math.min(r, g), b);\n\tconst chroma = (max - min);\n\tlet hue;\n\n\tconst grayscale = chroma < 1 ? min / (1 - chroma) : 0;\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else if (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else if (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tconst s = hsl[1] / 100;\n\tconst l = hsl[2] / 100;\n\n\tconst c = l < 0.5 ? (2 * s * l) : (2 * s * (1 - l));\n\n\tlet f = 0;\n\tif (c < 1) {\n\t\tf = (l - 0.5 * c) / (1 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tconst s = hsv[1] / 100;\n\tconst v = hsv[2] / 100;\n\n\tconst c = s * v;\n\tlet f = 0;\n\n\tif (c < 1) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tconst h = hcg[0] / 360;\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tif (c === 0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tconst pure = [0, 0, 0];\n\tconst hi = (h % 1) * 6;\n\tconst v = hi % 1;\n\tconst w = 1 - v;\n\tlet mg = 0;\n\n\t/* eslint-disable max-statements-per-line */\n\tswitch (Math.floor(hi)) {\n\t\tcase 0: {\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\t}\n\n\t\tcase 1: {\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\t}\n\n\t\tcase 2: {\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\t}\n\n\t\tcase 3: {\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\t}\n\n\t\tcase 4: {\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\t}\n\n\t\tdefault: {\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t\t}\n\t}\n\t/* eslint-enable max-statements-per-line */\n\n\tmg = (1 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255,\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst v = c + g * (1 - c);\n\tlet f = 0;\n\n\tif (v > 0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\n\tconst l = g * (1 - c) + 0.5 * c;\n\tlet s = 0;\n\n\tif (l > 0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else if (l >= 0.5 && l < 1) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tconst c = hcg[1] / 100;\n\tconst g = hcg[2] / 100;\n\tconst v = c + g * (1 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tconst w = hwb[1] / 100;\n\tconst b = hwb[2] / 100;\n\tconst v = 1 - b;\n\tconst c = v - w;\n\tlet g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65_535) * 255, (apple[1] / 65_535) * 255, (apple[2] / 65_535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65_535, (rgb[1] / 255) * 65_535, (rgb[2] / 255) * 65_535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hsv = convert.gray.hsl;\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\t/* eslint-disable no-bitwise */\n\tconst value = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tconst integer = (value << 16) + (value << 8) + value;\n\t/* eslint-enable no-bitwise */\n\n\tconst string = integer.toString(16).toUpperCase();\n\treturn '000000'.slice(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tconst value = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [value / 255 * 100];\n};\n","import conversions from './conversions.js';\n\n/*\n\tThis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tconst graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tconst models = Object.keys(conversions);\n\n\tfor (let {length} = models, i = 0; i < length; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null,\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tconst graph = buildGraph();\n\tconst queue = [fromModel]; // Unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length > 0) {\n\t\tconst current = queue.pop();\n\t\tconst adjacents = Object.keys(conversions[current]);\n\n\t\tfor (let {length} = adjacents, i = 0; i < length; i++) {\n\t\t\tconst adjacent = adjacents[i];\n\t\t\tconst node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tconst path = [graph[toModel].parent, toModel];\n\tlet fn = conversions[graph[toModel].parent][toModel];\n\n\tlet cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nfunction route(fromModel) {\n\tconst graph = deriveBFS(fromModel);\n\tconst conversion = {};\n\n\tconst models = Object.keys(graph);\n\tfor (let {length} = models, i = 0; i < length; i++) {\n\t\tconst toModel = models[i];\n\t\tconst node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// No possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n}\n\nexport default route;\n","import conversions from './conversions.js';\nimport route from './route.js';\n\nconst convert = {};\n\nconst models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tconst wrappedFn = function (...args) {\n\t\tconst arg0 = args[0];\n\n\t\tif (arg0 === undefined || arg0 === null) {\n\t\t\treturn arg0;\n\t\t}\n\n\t\tif (arg0.length > 1) {\n\t\t\targs = arg0;\n\t\t}\n\n\t\tconst result = fn(args);\n\n\t\t// We're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (let {length} = result, i = 0; i < length; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// Preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfor (const fromModel of models) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tconst routes = route(fromModel);\n\tconst routeModels = Object.keys(routes);\n\n\tfor (const toModel of routeModels) {\n\t\tconst fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t}\n}\n\nexport default convert;\n","import colorString from 'color-string';\nimport convert from 'color-convert';\n\nconst skippedModels = [\n\t// To be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// Gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// Shouldn't really be in color-convert either...\n\t'hex',\n];\n\nconst hashedModelKeys = {};\nfor (const model of Object.keys(convert)) {\n\thashedModelKeys[[...convert[model].labels].sort().join('')] = model;\n}\n\nconst limiters = {};\n\nfunction Color(object, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(object, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tlet i;\n\tlet channels;\n\n\tif (object == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (object instanceof Color) {\n\t\tthis.model = object.model;\n\t\tthis.color = [...object.color];\n\t\tthis.valpha = object.valpha;\n\t} else if (typeof object === 'string') {\n\t\tconst result = colorString.get(object);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + object);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (object.length > 0) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tconst newArray = Array.prototype.slice.call(object, 0, channels);\n\t\tthis.color = zeroArray(newArray, channels);\n\t\tthis.valpha = typeof object[channels] === 'number' ? object[channels] : 1;\n\t} else if (typeof object === 'number') {\n\t\t// This is always RGB - can be converted later on.\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(object >> 16) & 0xFF,\n\t\t\t(object >> 8) & 0xFF,\n\t\t\tobject & 0xFF,\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tconst keys = Object.keys(object);\n\t\tif ('alpha' in object) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof object.alpha === 'number' ? object.alpha : 0;\n\t\t}\n\n\t\tconst hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(object));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tconst {labels} = convert[this.model];\n\t\tconst color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(object[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// Perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tconst limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString() {\n\t\treturn this.string();\n\t},\n\n\ttoJSON() {\n\t\treturn this[this.model]();\n\t},\n\n\tstring(places) {\n\t\tlet self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tconst arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];\n\t\treturn colorString.to[self.model](...arguments_);\n\t},\n\n\tpercentString(places) {\n\t\tconst self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tconst arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];\n\t\treturn colorString.to.rgb.percent(...arguments_);\n\t},\n\n\tarray() {\n\t\treturn this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];\n\t},\n\n\tobject() {\n\t\tconst result = {};\n\t\tconst {channels} = convert[this.model];\n\t\tconst {labels} = convert[this.model];\n\n\t\tfor (let i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray() {\n\t\tconst rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject() {\n\t\tconst rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround(places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);\n\t},\n\n\talpha(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// Rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(95.047)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(108.833)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color(value);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color(value);\n\t\t}\n\n\t\treturn colorString.to.hex(...this.rgb().round().color);\n\t},\n\n\thexa(value) {\n\t\tif (value !== undefined) {\n\t\t\treturn new Color(value);\n\t\t}\n\n\t\tconst rgbArray = this.rgb().round().color;\n\n\t\tlet alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();\n\t\tif (alphaHex.length === 1) {\n\t\t\talphaHex = '0' + alphaHex;\n\t\t}\n\n\t\treturn colorString.to.hex(...rgbArray) + alphaHex;\n\t},\n\n\trgbNumber() {\n\t\tconst rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity() {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tconst rgb = this.rgb().color;\n\n\t\tconst lum = [];\n\t\tfor (const [i, element] of rgb.entries()) {\n\t\t\tconst chan = element / 255;\n\t\t\tlum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast(color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tconst lum1 = this.luminosity();\n\t\tconst lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel(color2) {\n\t\t// https://www.w3.org/TR/WCAG/#contrast-enhanced\n\t\tconst contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark() {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tconst rgb = this.rgb().color;\n\t\tconst yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight() {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate() {\n\t\tconst rgb = this.rgb();\n\t\tfor (let i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tlighten(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate(ratio) {\n\t\tconst hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten(ratio) {\n\t\tconst hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken(ratio) {\n\t\tconst hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale() {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_colour_to_grayscale\n\t\tconst rgb = this.rgb().color;\n\t\tconst value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(value, value, value);\n\t},\n\n\tfade(ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer(ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate(degrees) {\n\t\tconst hsl = this.hsl();\n\t\tlet hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix(mixinColor, weight) {\n\t\t// Ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\n\t\tconst color1 = mixinColor.rgb();\n\t\tconst color2 = this.rgb();\n\t\tconst p = weight === undefined ? 0.5 : weight;\n\n\t\tconst w = 2 * p - 1;\n\t\tconst a = color1.alpha() - color2.alpha();\n\n\t\tconst w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;\n\t\tconst w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t},\n};\n\n// Model conversion methods and static constructors\nfor (const model of Object.keys(convert)) {\n\tif (skippedModels.includes(model)) {\n\t\tcontinue;\n\t}\n\n\tconst {channels} = convert[model];\n\n\t// Conversion methods\n\tColor.prototype[model] = function (...arguments_) {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments_.length > 0) {\n\t\t\treturn new Color(arguments_, model);\n\t\t}\n\n\t\treturn new Color([...assertArray(convert[this.model][model].raw(this.color)), this.valpha], model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (...arguments_) {\n\t\tlet color = arguments_[0];\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(arguments_, channels);\n\t\t}\n\n\t\treturn new Color(color, model);\n\t};\n}\n\nfunction roundTo(number, places) {\n\treturn Number(number.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (number) {\n\t\treturn roundTo(number, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tfor (const m of model) {\n\t\t(limiters[m] ||= [])[channel] = modifier;\n\t}\n\n\tmodel = model[0];\n\n\treturn function (value) {\n\t\tlet result;\n\n\t\tif (value !== undefined) {\n\t\t\tif (modifier) {\n\t\t\t\tvalue = modifier(value);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = value;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(value) {\n\treturn Array.isArray(value) ? value : [value];\n}\n\nfunction zeroArray(array, length) {\n\tfor (let i = 0; i < length; i++) {\n\t\tif (typeof array[i] !== 'number') {\n\t\t\tarray[i] = 0;\n\t\t}\n\t}\n\n\treturn array;\n}\n\nexport default Color;\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport Color from 'color';\n/**\n * Is the current theme dark?\n */\nexport function isDarkModeEnabled() {\n const darkModePreference = window?.matchMedia?.('(prefers-color-scheme: dark)')?.matches;\n const darkModeSetting = document.body.getAttribute('data-themes')?.includes('dark');\n return darkModeSetting || darkModePreference || false;\n}\n/**\n * Is the current theme high contrast?\n */\nexport function isHighContrastModeEnabled() {\n const highContrastPreference = window?.matchMedia?.('(forced-colors: active)')?.matches;\n const highContrastSetting = document.body.getAttribute('data-themes')?.includes('highcontrast');\n return highContrastSetting || highContrastPreference || false;\n}\n/**\n * Should we invert the text on this background color?\n * @param color RGB color value as a hex string\n * @return boolean\n */\nexport function invertTextColor(color) {\n return colorContrast(color, '#ffffff') < 4.5;\n}\n/**\n * Is this color too bright?\n * @param color RGB color value as a hex string\n * @return boolean\n */\nexport function isBrightColor(color) {\n return calculateLuma(color) > 0.6;\n}\n/**\n * Get color for on-page elements\n * theme color by default, grey if theme color is too bright.\n * @param color the color to contrast against, e.g. #ffffff\n * @param backgroundColor the background color to contrast against, e.g. #000000\n */\nexport function elementColor(color, backgroundColor) {\n const brightBackground = isBrightColor(backgroundColor);\n const blurredBackground = mix(backgroundColor, brightBackground ? color : '#ffffff', 66);\n let contrast = colorContrast(color, blurredBackground);\n const minContrast = isHighContrastModeEnabled() ? 5.6 : 3.2;\n let iteration = 0;\n let result = color;\n const epsilon = (brightBackground ? -100 : 100) / 255;\n while (contrast < minContrast && iteration++ < 100) {\n const hsl = hexToHSL(result);\n const l = Math.max(0, Math.min(255, hsl.l + epsilon));\n result = hslToHex({ h: hsl.h, s: hsl.s, l });\n contrast = colorContrast(result, blurredBackground);\n }\n return result;\n}\n/**\n * Get color for on-page text:\n * black if background is bright, white if background is dark.\n * @param color1 the color to contrast against, e.g. #ffffff\n * @param color2 the background color to contrast against, e.g. #000000\n * @param factor the factor to mix the colors between -100 and 100, e.g. 66\n */\nexport function mix(color1, color2, factor) {\n if (factor < -100 || factor > 100) {\n throw new RangeError('Factor must be between -100 and 100');\n }\n return new Color(color2).mix(new Color(color1), (factor + 100) / 200).hex();\n}\n/**\n * Lighten a color by a factor\n * @param color the color to lighten, e.g. #000000\n * @param factor the factor to lighten the color by between -100 and 100, e.g. -41\n */\nexport function lighten(color, factor) {\n if (factor < -100 || factor > 100) {\n throw new RangeError('Factor must be between -100 and 100');\n }\n return new Color(color).lighten((factor + 100) / 200).hex();\n}\n/**\n * Darken a color by a factor\n * @param color the color to darken, e.g. #ffffff\n * @param factor the factor to darken the color by between -100 and 100, e.g. 32\n */\nexport function darken(color, factor) {\n if (factor < -100 || factor > 100) {\n throw new RangeError('Factor must be between -100 and 100');\n }\n return new Color(color).darken((factor + 100) / 200).hex();\n}\n/**\n * Calculate the luminance of a color\n * @param color the color to calculate the luminance of, e.g. #ffffff\n */\nexport function calculateLuminance(color) {\n return hexToHSL(color).l;\n}\n/**\n * Calculate the luma of a color\n * @param color the color to calculate the luma of, e.g. #ffffff\n */\nexport function calculateLuma(color) {\n const rgb = hexToRGB(color).map((value) => {\n value /= 255;\n return value <= 0.03928\n ? value / 12.92\n : Math.pow((value + 0.055) / 1.055, 2.4);\n });\n const [red, green, blue] = rgb;\n return 0.2126 * red + 0.7152 * green + 0.0722 * blue;\n}\n/**\n * Calculate the contrast between two colors\n * @param color1 the first color to calculate the contrast of, e.g. #ffffff\n * @param color2 the second color to calculate the contrast of, e.g. #000000\n */\nexport function colorContrast(color1, color2) {\n const luminance1 = calculateLuma(color1) + 0.05;\n const luminance2 = calculateLuma(color2) + 0.05;\n return Math.max(luminance1, luminance2) / Math.min(luminance1, luminance2);\n}\n/**\n * Convert hex color to RGB\n * @param color RGB color value as a hex string\n */\nexport function hexToRGB(color) {\n return new Color(color).rgb().array();\n}\n/**\n * Convert RGB color to hex\n * @param color RGB color value as a hex string\n */\nexport function hexToHSL(color) {\n const hsl = new Color(color).hsl();\n return { h: hsl.color[0], s: hsl.color[1], l: hsl.color[2] };\n}\n/**\n * Convert HSL color to hex\n * @param hsl HSL color value as an object\n * @param hsl.h hue\n * @param hsl.s saturation\n * @param hsl.l lightness\n */\nexport function hslToHex(hsl) {\n return new Color(hsl).hex();\n}\n/**\n * Convert RGB color to hex\n * @param r red\n * @param g green\n * @param b blue\n */\nexport function rgbToHex(r, g, b) {\n const hex = ((1 << 24) | (r << 16) | (g << 8) | b).toString(16).slice(1);\n return `#${hex}`;\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.files-list__system-tags{--min-size: 32px;display:none;justify-content:center;align-items:center;min-width:calc(var(--min-size)*2);max-width:300px}.files-list__system-tag{padding:5px 10px;border:1px solid;border-radius:var(--border-radius-pill);border-color:var(--color-border);color:var(--color-text-maxcontrast);height:var(--min-size);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:20px;text-align:center}.files-list__system-tag--more{overflow:visible;text-overflow:initial}.files-list__system-tag+.files-list__system-tag{margin-inline-start:5px}.files-list__system-tag[data-systemtag-color]{border-color:var(--systemtag-color);color:var(--systemtag-color);border-width:2px;line-height:18px}@media(min-width: 512px){.files-list__system-tags{display:flex}}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/systemtags/src/css/fileEntryInlineSystemTags.scss\"],\"names\":[],\"mappings\":\"AAKA,yBACC,gBAAA,CACA,YAAA,CACA,sBAAA,CACA,kBAAA,CACA,iCAAA,CACA,eAAA,CAGD,wBACC,gBAAA,CACA,gBAAA,CACA,uCAAA,CACA,gCAAA,CACA,mCAAA,CACA,sBAAA,CACA,kBAAA,CACA,eAAA,CACA,sBAAA,CACA,gBAAA,CACA,iBAAA,CAEA,8BACC,gBAAA,CACA,qBAAA,CAID,gDACC,uBAAA,CAID,8CACC,mCAAA,CACA,4BAAA,CACA,gBAAA,CACA,gBAAA,CAIF,yBACC,yBACC,YAAA,CAAA\",\"sourcesContent\":[\"/**\\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\\n * SPDX-License-Identifier: AGPL-3.0-or-later\\n */\\n\\n.files-list__system-tags {\\n\\t--min-size: 32px;\\n\\tdisplay: none;\\n\\tjustify-content: center;\\n\\talign-items: center;\\n\\tmin-width: calc(var(--min-size) * 2);\\n\\tmax-width: 300px;\\n}\\n\\n.files-list__system-tag {\\n\\tpadding: 5px 10px;\\n\\tborder: 1px solid;\\n\\tborder-radius: var(--border-radius-pill);\\n\\tborder-color: var(--color-border);\\n\\tcolor: var(--color-text-maxcontrast);\\n\\theight: var(--min-size);\\n\\twhite-space: nowrap;\\n\\toverflow: hidden;\\n\\ttext-overflow: ellipsis;\\n\\tline-height: 20px; // min-size - 2 * 5px padding - 2 * 1px border\\n\\ttext-align: center;\\n\\n\\t&--more {\\n\\t\\toverflow: visible;\\n\\t\\ttext-overflow: initial;\\n\\t}\\n\\n\\t// Proper spacing if multiple shown\\n\\t& + .files-list__system-tag {\\n\\t\\tmargin-inline-start: 5px;\\n\\t}\\n\\n\\t// With color\\n\\t&[data-systemtag-color] {\\n\\t\\tborder-color: var(--systemtag-color);\\n\\t\\tcolor: var(--systemtag-color);\\n\\t\\tborder-width: 2px;\\n\\t\\tline-height: 18px; // min-size - 2 * 5px padding - 2 * 2px border\\n\\t}\\n}\\n\\n@media (min-width: 512px) {\\n\\t.files-list__system-tags {\\n\\t\\tdisplay: flex;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport axios from '@nextcloud/axios';\nimport { generateUrl, generateOcsUrl } from '@nextcloud/router';\nimport { t } from '@nextcloud/l10n';\nimport { davClient } from './davClient.js';\nimport { formatTag, parseIdFromLocation, parseTags } from '../utils';\nimport logger from '../logger.ts';\nimport { emit } from '@nextcloud/event-bus';\nimport { confirmPassword } from '@nextcloud/password-confirmation';\nexport const fetchTagsPayload = `\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n`;\nexport const fetchTags = async () => {\n const path = '/systemtags';\n try {\n const { data: tags } = await davClient.getDirectoryContents(path, {\n data: fetchTagsPayload,\n details: true,\n glob: '/systemtags/*', // Filter out first empty tag\n });\n return parseTags(tags);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load tags'), { error });\n throw new Error(t('systemtags', 'Failed to load tags'));\n }\n};\nexport const fetchTag = async (tagId) => {\n const path = '/systemtags/' + tagId;\n try {\n const { data: tag } = await davClient.stat(path, {\n data: fetchTagsPayload,\n details: true,\n });\n return parseTags([tag])[0];\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load tag'), { error });\n throw new Error(t('systemtags', 'Failed to load tag'));\n }\n};\nexport const fetchLastUsedTagIds = async () => {\n const url = generateUrl('/apps/systemtags/lastused');\n try {\n const { data: lastUsedTagIds } = await axios.get(url);\n return lastUsedTagIds.map(Number);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to load last used tags'), { error });\n throw new Error(t('systemtags', 'Failed to load last used tags'));\n }\n};\n/**\n * Create a tag and return the Id of the newly created tag.\n *\n * @param tag The tag to create\n */\nexport const createTag = async (tag) => {\n const path = '/systemtags';\n const tagToPost = formatTag(tag);\n try {\n const { headers } = await davClient.customRequest(path, {\n method: 'POST',\n data: tagToPost,\n });\n const contentLocation = headers.get('content-location');\n if (contentLocation) {\n emit('systemtags:tag:created', tag);\n return parseIdFromLocation(contentLocation);\n }\n logger.error(t('systemtags', 'Missing \"Content-Location\" header'));\n throw new Error(t('systemtags', 'Missing \"Content-Location\" header'));\n }\n catch (error) {\n if (error?.response?.status === 409) {\n logger.error(t('systemtags', 'A tag with the same name already exists'), { error });\n throw new Error(t('systemtags', 'A tag with the same name already exists'));\n }\n logger.error(t('systemtags', 'Failed to create tag'), { error });\n throw new Error(t('systemtags', 'Failed to create tag'));\n }\n};\nexport const updateTag = async (tag) => {\n const path = '/systemtags/' + tag.id;\n const data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${tag.displayName}\n\t\t\t\t${tag.userVisible}\n\t\t\t\t${tag.userAssignable}\n\t\t\t\t${tag?.color || null}\n\t\t\t\n\t\t\n\t`;\n try {\n await davClient.customRequest(path, {\n method: 'PROPPATCH',\n data,\n });\n emit('systemtags:tag:updated', tag);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to update tag'), { error });\n throw new Error(t('systemtags', 'Failed to update tag'));\n }\n};\nexport const deleteTag = async (tag) => {\n const path = '/systemtags/' + tag.id;\n try {\n await davClient.deleteFile(path);\n emit('systemtags:tag:deleted', tag);\n }\n catch (error) {\n logger.error(t('systemtags', 'Failed to delete tag'), { error });\n throw new Error(t('systemtags', 'Failed to delete tag'));\n }\n};\nexport const getTagObjects = async function (tag, type) {\n const path = `/systemtags/${tag.id}/${type}`;\n const data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t`;\n const response = await davClient.stat(path, { data, details: true });\n const etag = response?.data?.props?.getetag || '\"\"';\n const objects = Object.values(response?.data?.props?.['object-ids'] || []).flat();\n return {\n etag,\n objects,\n };\n};\n/**\n * Set the objects for a tag.\n * Warning: This will overwrite the existing objects.\n * @param tag The tag to set the objects for\n * @param type The type of the objects\n * @param objectIds The objects to set\n * @param etag Strongly recommended to avoid conflict and data loss.\n */\nexport const setTagObjects = async function (tag, type, objectIds, etag = '') {\n const path = `/systemtags/${tag.id}/${type}`;\n let data = `\n\t\n\t\t\n\t\t\t\n\t\t\t\t${objectIds.map(({ id, type }) => `${id}${type}`).join('')}\n\t\t\t\n\t\t\n\t`;\n if (objectIds.length === 0) {\n data = `\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t`;\n }\n await davClient.customRequest(path, {\n method: 'PROPPATCH',\n data,\n headers: {\n 'if-match': etag,\n },\n });\n};\nexport const updateSystemTagsAdminRestriction = async (isAllowed) => {\n // Convert to string for compatibility\n const isAllowedString = isAllowed ? '1' : '0';\n const url = generateOcsUrl('/apps/provisioning_api/api/v1/config/apps/{appId}/{key}', {\n appId: 'systemtags',\n key: 'restrict_creation_to_admin',\n });\n await confirmPassword();\n const res = await axios.post(url, {\n value: isAllowedString,\n });\n return res.data;\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\tid: moduleId,\n\t\tloaded: false,\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Flag the module as loaded\n\tmodule.loaded = true;\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = (chunkId) => {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = (chunkId) => {\n\t// return url for filenames based on template\n\treturn \"\" + chunkId + \"-\" + chunkId + \".js?v=\" + {\"3278\":\"c97a360506d6ebb6afd2\",\"3564\":\"1f97cb34040f17de0c20\",\"7471\":\"428f6893ae52e7aca00b\",\"8790\":\"9fd8f6ad2d5d29ec25ad\",\"9167\":\"c89e50ac8548b6b57d92\"}[chunkId] + \"\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.nmd = (module) => {\n\tmodule.paths = [];\n\tif (!module.children) module.children = [];\n\treturn module;\n};","__webpack_require__.j = 2766;","var scriptUrl;\nif (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + \"\";\nvar document = __webpack_require__.g.document;\nif (!scriptUrl && document) {\n\tif (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')\n\t\tscriptUrl = document.currentScript.src;\n\tif (!scriptUrl) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tif(scripts.length) {\n\t\t\tvar i = scripts.length - 1;\n\t\t\twhile (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;\n\t\t}\n\t}\n}\n// When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration\n// or pass an empty string (\"\") and set the __webpack_public_path__ variable from your code to use your own logic.\nif (!scriptUrl) throw new Error(\"Automatic publicPath is not supported in this browser\");\nscriptUrl = scriptUrl.replace(/^blob:/, \"\").replace(/#.*$/, \"\").replace(/\\?.*$/, \"\").replace(/\\/[^\\/]+$/, \"/\");\n__webpack_require__.p = scriptUrl;","__webpack_require__.b = (typeof document !== 'undefined' && document.baseURI) || self.location.href;\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t2766: 0\n};\n\n__webpack_require__.f.j = (chunkId, promises) => {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = (event) => {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = (chunkId) => (installedChunks[chunkId] === 0);\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = (parentChunkLoadingFunction, data) => {\n\tvar [chunkIds, moreModules, runtime] = data;\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some((id) => (installedChunks[id] !== 0))) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = globalThis[\"webpackChunknextcloud\"] = globalThis[\"webpackChunknextcloud\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","__webpack_require__.nc = undefined;","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [4208], () => (__webpack_require__(45218)))\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","inProgress","dataWebpackPrefix","rootUrl","generateRemoteUrl","davClient","createClient","setHeaders","token","requesttoken","onRequestTokenUpdate","getRequestToken","parseTags","tags","map","props","Object","fromEntries","entries","key","value","camelCase","String","parseIdFromLocation","url","queryPos","indexOf","substring","parts","split","result","length","pop","Number","formatTag","initialTag","tag","name","displayName","getNodeSystemTags","node","attribute","attributes","undefined","flat","text","setNodeSystemTags","Vue","getLoggerBuilder","setApp","detectUser","build","async","execBatch","nodes","response","Promise","resolve","spawnDialog","defineAsyncComponent","status","Array","fill","action","FileAction","id","t","iconSvgInline","TagMultipleSvg","enabled","isPublicShare","some","isDavResource","permissions","Permission","UPDATE","exec","useActiveStore","defineStore","activeAction","ref","activeFolder","activeNode","activeView","onDeletedNode","source","onChangedView","view","logger","debug","navigation","getNavigation","subscribe","active","addEventListener","event","detail","initialize","rootPath","client","davGetClient","resultToNode","davResultToNode","formatReportPayload","tagId","getDavNameSpaces","getDavProperties","tagToNode","Folder","davRemoteURL","owner","getCurrentUser","uid","root","displayname","READ","systemTagsViewId","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals","cache","renderTag","isMore","tagElement","document","createElement","classList","add","setAttribute","textContent","cachedTag","find","color","mainBackgroundColor","getComputedStyle","body","getPropertyValue","replace","isDarkModeEnabled","primaryElement","elementColor","style","setProperty","renderInline","systemTagsElement","fileid","toString","push","fetchTags","error","append","moreTagElement","slice","join","order","hotkey","description","then","systemTagsHtml","querySelectorAll","forEach","element","replaceWith","splice","findIndex","index","updateSystemTagsColorAttribute","type","FileType","dir","dirname","path","window","OCP","Files","Router","goToRoute","openfile","default","DefaultType","HIDDEN","registerDavProperty","registerFileAction","bulkSystemTagsAction","inlineSystemTagsAction","openInFilesAction","register","View","caption","emptyTitle","emptyCaption","icon","svgTagMultiple","getContents","tagsCache","filter","userVisible","folder","NONE","contents","parseInt","Error","getDirectoryContents","davRootPath","details","data","headers","method","useHotKey","activeStore","_nc_files_pinia","createPinia","currentDir","query","currentNode","currentView","NodeStatus","LOADING","success","showSuccess","showError","executeAction","manageTagAction","stop","prevent","colors","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkgrey","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkslategrey","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dimgrey","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","grey","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightgrey","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightslategrey","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","slategrey","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen","freeze","reverseNames","create","hasOwn","cs","to","get","clamp","number_","min","max","Math","hexDouble","string_","round","toUpperCase","string","model","toLowerCase","hsl","hwb","rgb","match","i","hexAlpha","i2","parseFloat","alpha","isNaN","hex","rgba","percent","r","g","b","hsla","hwba","a","keyword","reverseKeywords","keys","convert","channels","labels","hsv","cmyk","xyz","lab","oklab","lch","oklch","ansi16","ansi256","hcg","apple","LAB_FT","srgbNonlinearTransform","c","cc","srgbNonlinearTransformInv","defineProperty","comparativeDistance","x","y","from","args","wrapConversion","toModel","graph","parent","fn","conversions","cur","unshift","conversion","delta","h","s","l","rdif","gdif","bdif","v","diff","diffc","w","lp","cbrt","mp","sp","k","reversed","currentClosestKeyword","currentClosestDistance","POSITIVE_INFINITY","distance","z","t3","t2","t1","smin","lmin","hi","floor","f","p","q","vmin","sl","wh","bl","ratio","n","m","ll","aa","bb","y2","x2","z2","atan2","PI","sqrt","hr","cos","sin","saturation","ansi","mult","trunc","rem","colorString","char","integer","chroma","hue","pure","mg","fromModel","models","buildGraph","queue","current","adjacents","adjacent","deriveBFS","wrapRaw","wrappedFn","arg0","wrapRounded","routes","routeModels","raw","skippedModels","hashedModelKeys","sort","limiters","object","this","valpha","newArray","prototype","call","zeroArray","hashedKeys","JSON","stringify","limit","toJSON","places","self","arguments_","percentString","array","unitArray","unitObject","roundToPlace","getset","maxfn","saturationl","lightness","saturationv","wblack","hexa","rgbArray","alphaHex","rgbNumber","luminosity","lum","chan","contrast","color2","lum1","lum2","level","contrastRatio","isDark","isLight","negate","lighten","darken","saturate","desaturate","whiten","blacken","grayscale","fade","opaquer","rotate","degrees","mix","mixinColor","weight","color1","w1","w2","includes","isArray","number","toFixed","roundTo","channel","modifier","darkModePreference","matchMedia","matches","darkModeSetting","getAttribute","invertTextColor","colorContrast","backgroundColor","brightBackground","calculateLuma","isBrightColor","blurredBackground","Color","minContrast","highContrastPreference","highContrastSetting","isHighContrastModeEnabled","iteration","epsilon","hexToHSL","hslToHex","hexToRGB","pow","luminance1","luminance2","___CSS_LOADER_EXPORT___","module","fetchTagsPayload","glob","fetchTag","stat","createTag","tagToPost","customRequest","contentLocation","emit","updateTag","userAssignable","getTagObjects","etag","getetag","objects","values","setTagObjects","objectIds","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","exports","loaded","__webpack_modules__","O","chunkIds","priority","notFulfilled","Infinity","fulfilled","j","every","getter","__esModule","d","definition","o","enumerable","e","chunkId","all","reduce","promises","u","globalThis","Function","obj","prop","hasOwnProperty","done","script","needAttach","scripts","getElementsByTagName","charset","nc","src","onScriptComplete","prev","onerror","onload","clearTimeout","timeout","doneFns","parentNode","removeChild","setTimeout","bind","target","head","appendChild","Symbol","toStringTag","nmd","paths","children","scriptUrl","importScripts","location","currentScript","tagName","test","baseURI","href","installedChunks","installedChunkData","promise","reject","errorType","realSrc","message","request","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 29db6ba78e33c..17a3a91e3a606 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,7 +43,7 @@ "camelcase": "^8.0.0", "cancelable-promise": "^4.3.1", "clipboard": "^2.0.11", - "color": "^5.0.2", + "color": "^5.0.3", "core-js": "^3.46.0", "davclient.js": "nextcloud-deps/davclient.js#59d7777d7fe290c5f1fd74a58e7eb529b63e153d", "debounce": "^2.2.0", @@ -9254,12 +9254,12 @@ } }, "node_modules/color": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/color/-/color-5.0.2.tgz", - "integrity": "sha512-e2hz5BzbUPcYlIRHo8ieAhYgoajrJr+hWoceg6E345TPsATMUKqDgzt8fSXZJJbxfpiPzkWyphz8yn8At7q3fA==", + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/color/-/color-5.0.3.tgz", + "integrity": "sha512-ezmVcLR3xAVp8kYOm4GS45ZLLgIE6SPAFoduLr6hTDajwb3KZ2F46gulK3XpcwRFb5KKGCSezCBAY4Dw4HsyXA==", "dependencies": { - "color-convert": "^3.0.1", - "color-string": "^2.0.0" + "color-convert": "^3.1.3", + "color-string": "^2.1.3" }, "engines": { "node": ">=18" @@ -9284,10 +9284,9 @@ "license": "MIT" }, "node_modules/color-string": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-string/-/color-string-2.0.1.tgz", - "integrity": "sha512-5z9FbYTZPAo8iKsNEqRNv+OlpBbDcoE+SY9GjLfDUHEfcNNV7tS9eSAlFHEaub/r5tBL9LtskAeq1l9SaoZ5tQ==", - "license": "MIT", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-2.1.3.tgz", + "integrity": "sha512-r/wfcFshhORndnDjn3GtNVLA4QL4TAi0A/XIBNuWUIEAVyUBNWYLuckrDz/JM1aQlpIDzKuY5hAYdHcLYgwJsg==", "dependencies": { "color-name": "^2.0.0" }, @@ -9296,19 +9295,17 @@ } }, "node_modules/color-string/node_modules/color-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz", - "integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.1.0.tgz", + "integrity": "sha512-1bPaDNFm0axzE4MEAzKPuqKWeRaT43U/hyxKPBdqTfmPF+d6n7FSoTFxLVULUJOmiLp01KjhIPPH+HrXZJN4Rg==", "engines": { "node": ">=12.20" } }, "node_modules/color/node_modules/color-convert": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-3.1.0.tgz", - "integrity": "sha512-TVoqAq8ZDIpK5lsQY874DDnu65CSsc9vzq0wLpNQ6UMBq81GSZocVazPiBbYGzngzBOIRahpkTzCLVe2at4MfA==", - "license": "MIT", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-3.1.3.tgz", + "integrity": "sha512-fasDH2ont2GqF5HpyO4w0+BcewlhHEZOFn9c1ckZdHpJ56Qb7MHhH/IcJZbBGgvdtwdwNbLvxiBEdg336iA9Sg==", "dependencies": { "color-name": "^2.0.0" }, @@ -9317,10 +9314,9 @@ } }, "node_modules/color/node_modules/color-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.0.0.tgz", - "integrity": "sha512-SbtvAMWvASO5TE2QP07jHBMXKafgdZz8Vrsrn96fiL+O92/FN/PLARzUW5sKt013fjAprK2d2iCn2hk2Xb5oow==", - "license": "MIT", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-2.1.0.tgz", + "integrity": "sha512-1bPaDNFm0axzE4MEAzKPuqKWeRaT43U/hyxKPBdqTfmPF+d6n7FSoTFxLVULUJOmiLp01KjhIPPH+HrXZJN4Rg==", "engines": { "node": ">=12.20" } diff --git a/package.json b/package.json index cdcce43503e26..b8c40e1adf37e 100644 --- a/package.json +++ b/package.json @@ -74,7 +74,7 @@ "camelcase": "^8.0.0", "cancelable-promise": "^4.3.1", "clipboard": "^2.0.11", - "color": "^5.0.2", + "color": "^5.0.3", "core-js": "^3.46.0", "davclient.js": "nextcloud-deps/davclient.js#59d7777d7fe290c5f1fd74a58e7eb529b63e153d", "debounce": "^2.2.0",