From 9faa5fb1702cac6d87b26721f4e642e6ff705856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20B=C3=BClow?= Date: Fri, 25 Jul 2025 13:03:16 +0200 Subject: [PATCH] Templui update to v0.84.0 --- .templui.json | 4 +- server/web/assets/js/avatar.min.js | 1 + server/web/assets/js/calendar.min.js | 1 + server/web/assets/js/carousel.min.js | 1 + server/web/assets/js/chart.min.js | 15 + server/web/assets/js/code.min.js | 10 + server/web/assets/js/datepicker.min.js | 1 + server/web/assets/js/drawer.min.js | 1 + server/web/assets/js/dropdown.min.js | 1 + server/web/assets/js/input.min.js | 1 + server/web/assets/js/inputotp.min.js | 1 + server/web/assets/js/label.min.js | 1 + server/web/assets/js/modal.min.js | 1 + server/web/assets/js/popover.min.js | 6 + server/web/assets/js/progress.min.js | 1 + server/web/assets/js/rating.min.js | 1 + server/web/assets/js/selectbox.min.js | 1 + server/web/assets/js/slider.min.js | 1 + server/web/assets/js/tabs.min.js | 1 + server/web/assets/js/tagsinput.min.js | 5 + server/web/assets/js/textarea.min.js | 1 + server/web/assets/js/toast.min.js | 1 + server/web/assets/styles.css | 227 +++++ server/web/fileView.templ | 12 +- server/web/fileView_templ.go | 16 +- .../components/accordion/accordion.templ | 2 +- .../components/accordion/accordion_templ.go | 2 +- .../web/templui/components/alert/alert.templ | 2 +- .../templui/components/alert/alert_templ.go | 2 +- .../components/aspectratio/aspectratio.templ | 62 ++ .../aspectratio/aspectratio_templ.go | 145 +++ .../templui/components/avatar/avatar.templ | 72 +- .../templui/components/avatar/avatar_templ.go | 59 +- .../web/templui/components/badge/badge.templ | 21 +- .../templui/components/badge/badge_templ.go | 21 +- .../components/breadcrumb/breadcrumb.templ | 2 +- .../components/breadcrumb/breadcrumb_templ.go | 2 +- .../templui/components/button/button.templ | 92 +- .../templui/components/button/button_templ.go | 232 +---- .../components/calendar/calendar.templ | 206 +--- .../components/calendar/calendar_templ.go | 63 +- server/web/templui/components/card/card.templ | 143 +-- .../web/templui/components/card/card_templ.go | 353 +------ .../components/carousel/carousel.templ | 196 +--- .../components/carousel/carousel_templ.go | 61 +- .../web/templui/components/chart/chart.templ | 222 +---- .../templui/components/chart/chart_templ.go | 41 +- .../components/checkbox/checkbox.templ | 2 +- .../components/checkbox/checkbox_templ.go | 2 +- .../checkboxcard/checkboxcard.templ | 152 +++ .../checkboxcard/checkboxcard_templ.go | 548 ++++++++++ server/web/templui/components/code/code.templ | 124 +-- .../web/templui/components/code/code_templ.go | 74 +- .../components/datepicker/datepicker.templ | 141 +++ .../components/datepicker/datepicker_templ.go | 322 ++++++ .../templui/components/drawer/drawer.templ | 251 +---- .../templui/components/drawer/drawer_templ.go | 538 +++++----- .../components/dropdown/dropdown.templ | 69 +- .../components/dropdown/dropdown_templ.go | 484 +++++---- server/web/templui/components/form/form.templ | 2 +- .../web/templui/components/form/form_templ.go | 2 +- server/web/templui/components/icon/icon.go | 2 +- .../icon/{icon_data.go => icondata.go} | 10 +- .../icon/{icon_defs.go => icondefs.go} | 3 +- .../web/templui/components/input/input.templ | 84 +- .../templui/components/input/input_templ.go | 97 +- .../components/inputotp/inputotp.templ | 178 ++++ .../components/inputotp/inputotp_templ.go | 615 ++++++++++++ .../web/templui/components/label/label.templ | 73 +- .../templui/components/label/label_templ.go | 37 +- .../web/templui/components/modal/modal.templ | 220 +---- .../templui/components/modal/modal_templ.go | 319 +++--- .../components/pagination/pagination.templ | 30 +- .../components/pagination/pagination_templ.go | 101 +- .../templui/components/popover/popover.templ | 388 +------- .../components/popover/popover_templ.go | 320 +++--- .../components/progress/progress.templ | 68 +- .../components/progress/progress_templ.go | 207 +--- .../web/templui/components/radio/radio.templ | 2 +- .../templui/components/radio/radio_templ.go | 2 +- .../components/radiocard/radiocard.templ | 135 +++ .../components/radiocard/radiocard_templ.go | 530 ++++++++++ .../templui/components/rating/rating.templ | 242 +---- .../templui/components/rating/rating_templ.go | 63 +- .../components/selectbox/selectbox.templ | 319 ++++++ .../components/selectbox/selectbox_templ.go | 932 ++++++++++++++++++ .../components/separator/separator.templ | 2 +- .../components/separator/separator_templ.go | 2 +- .../components/skeleton/skeleton.templ | 2 +- .../components/skeleton/skeleton_templ.go | 2 +- .../templui/components/slider/slider.templ | 52 +- .../templui/components/slider/slider_templ.go | 59 +- .../web/templui/components/table/table.templ | 2 +- .../templui/components/table/table_templ.go | 2 +- server/web/templui/components/tabs/tabs.templ | 86 +- .../web/templui/components/tabs/tabs_templ.go | 65 +- .../components/tagsinput/tagsinput.templ | 87 ++ .../components/tagsinput/tagsinput_templ.go | 265 +++++ .../components/textarea/textarea.templ | 79 +- .../components/textarea/textarea_templ.go | 98 +- .../web/templui/components/toast/toast.templ | 127 +-- .../templui/components/toast/toast_templ.go | 53 +- .../templui/components/toggle/toggle.templ | 19 +- .../templui/components/toggle/toggle_templ.go | 51 +- .../templui/components/tooltip/tooltip.templ | 6 +- .../components/tooltip/tooltip_templ.go | 46 +- server/web/templui/utils/templui.go | 2 +- 107 files changed, 6055 insertions(+), 5053 deletions(-) create mode 100644 server/web/assets/js/avatar.min.js create mode 100644 server/web/assets/js/calendar.min.js create mode 100644 server/web/assets/js/carousel.min.js create mode 100644 server/web/assets/js/chart.min.js create mode 100644 server/web/assets/js/code.min.js create mode 100644 server/web/assets/js/datepicker.min.js create mode 100644 server/web/assets/js/drawer.min.js create mode 100644 server/web/assets/js/dropdown.min.js create mode 100644 server/web/assets/js/input.min.js create mode 100644 server/web/assets/js/inputotp.min.js create mode 100644 server/web/assets/js/label.min.js create mode 100644 server/web/assets/js/modal.min.js create mode 100644 server/web/assets/js/popover.min.js create mode 100644 server/web/assets/js/progress.min.js create mode 100644 server/web/assets/js/rating.min.js create mode 100644 server/web/assets/js/selectbox.min.js create mode 100644 server/web/assets/js/slider.min.js create mode 100644 server/web/assets/js/tabs.min.js create mode 100644 server/web/assets/js/tagsinput.min.js create mode 100644 server/web/assets/js/textarea.min.js create mode 100644 server/web/assets/js/toast.min.js create mode 100644 server/web/templui/components/aspectratio/aspectratio.templ create mode 100644 server/web/templui/components/aspectratio/aspectratio_templ.go create mode 100644 server/web/templui/components/checkboxcard/checkboxcard.templ create mode 100644 server/web/templui/components/checkboxcard/checkboxcard_templ.go create mode 100644 server/web/templui/components/datepicker/datepicker.templ create mode 100644 server/web/templui/components/datepicker/datepicker_templ.go rename server/web/templui/components/icon/{icon_data.go => icondata.go} (99%) rename server/web/templui/components/icon/{icon_defs.go => icondefs.go} (99%) create mode 100644 server/web/templui/components/inputotp/inputotp.templ create mode 100644 server/web/templui/components/inputotp/inputotp_templ.go create mode 100644 server/web/templui/components/radiocard/radiocard.templ create mode 100644 server/web/templui/components/radiocard/radiocard_templ.go create mode 100644 server/web/templui/components/selectbox/selectbox.templ create mode 100644 server/web/templui/components/selectbox/selectbox_templ.go create mode 100644 server/web/templui/components/tagsinput/tagsinput.templ create mode 100644 server/web/templui/components/tagsinput/tagsinput_templ.go diff --git a/.templui.json b/.templui.json index 5326cba..d8f28a1 100644 --- a/.templui.json +++ b/.templui.json @@ -1,5 +1,7 @@ { "componentsDir": "server/web/templui/components", "utilsDir": "server/web/templui/utils", - "moduleName": "git.jmbit.de/jmb/scanfile" + "moduleName": "git.jmbit.de/jmb/scanfile", + "jsDir": "server/web/assets/js", + "jsPublicPath": "/assets/js" } diff --git a/server/web/assets/js/avatar.min.js b/server/web/assets/js/avatar.min.js new file mode 100644 index 0000000..c426fba --- /dev/null +++ b/server/web/assets/js/avatar.min.js @@ -0,0 +1 @@ +(()=>{(function(){function n(e){if(!e||e.hasAttribute("data-initialized"))return;e.setAttribute("data-initialized","true");let t=e.querySelector("[data-avatar-image]"),a=e.querySelector("[data-avatar-fallback]");if(t&&a){t.style.display="none",a.style.display="none";let i=()=>{t.style.display="none",a.style.display=""},d=()=>{t.style.display="",a.style.display="none"};t.complete?t.naturalWidth>0&&t.naturalHeight>0?d():i():(t.addEventListener("load",d,{once:!0}),t.addEventListener("error",i,{once:!0}),setTimeout(()=>{t.complete&&!(t.naturalWidth>0&&t.naturalHeight>0)&&i()},50))}else a?a.style.display="":t&&(t.style.display="")}function l(e=document){e instanceof Element&&e.matches("[data-avatar]")&&n(e);for(let t of e.querySelectorAll("[data-avatar]:not([data-initialized])"))n(t)}window.templUI=window.templUI||{},window.templUI.avatar={init:l},document.addEventListener("DOMContentLoaded",()=>l())})();})(); diff --git a/server/web/assets/js/calendar.min.js b/server/web/assets/js/calendar.min.js new file mode 100644 index 0000000..c21966c --- /dev/null +++ b/server/web/assets/js/calendar.min.js @@ -0,0 +1 @@ +(()=>{(function(){function w(e){if(!e||e.hasAttribute("data-initialized"))return;e.setAttribute("data-initialized","true");let f=e.querySelector("[data-calendar-month-display]"),g=e.querySelector("[data-calendar-weekdays]"),h=e.querySelector("[data-calendar-days]"),v=e.querySelector("[data-calendar-prev]"),b=e.querySelector("[data-calendar-next]"),M=e.closest("[data-calendar-wrapper]"),y=M?M.querySelector("[data-calendar-hidden-input]"):null;if(!f||!g||!h||!v||!b||!y){console.error("Calendar init error: Missing required elements (or hidden input relative to wrapper).",e);return}let D=e.dataset.localeTag||"en-US",C;try{C=Array.from({length:12},(a,t)=>new Intl.DateTimeFormat(D,{month:"long",timeZone:"UTC"}).format(new Date(Date.UTC(2e3,t,1))))}catch(a){console.error(`Calendar: Error generating month names via Intl (locale: "${D}"). Falling back to English.`,a),C=["January","February","March","April","May","June","July","August","September","October","November","December"]}let U=["Su","Mo","Tu","We","Th","Fr","Sa"];try{U=Array.from({length:7},(a,t)=>new Intl.DateTimeFormat(D,{weekday:"short"}).format(new Date(Date.UTC(2e3,0,t))))}catch(a){console.error("Error generating calendar day names via Intl:",a)}let n=parseInt(e.dataset.initialMonth),l=parseInt(e.dataset.initialYear),u=null;e.dataset.selectedDate&&(u=E(e.dataset.selectedDate));function E(a){if(!a)return null;try{let t=a.split("-"),o=parseInt(t[0],10),i=parseInt(t[1],10)-1,c=parseInt(t[2],10),s=new Date(Date.UTC(o,i,c));if(!isNaN(s)&&s.getUTCFullYear()===o&&s.getUTCMonth()===i&&s.getUTCDate()===c)return s}catch{}return null}function p(){let a=Math.max(0,Math.min(11,n)),o=`${C[a]} ${l}`;f.textContent=o}function S(){g.innerHTML="",U.forEach(a=>{let t=document.createElement("div");t.className="text-center text-xs text-muted-foreground font-medium",t.textContent=a,g.appendChild(t)})}function m(){h.innerHTML="";let o=new Date(Date.UTC(l,n,1)).getUTCDay(),i=new Date(Date.UTC(l,n+1,0)).getUTCDate(),c=new Date,s=new Date(Date.UTC(c.getFullYear(),c.getMonth(),c.getDate()));for(let d=0;d11&&(n=0,l++),p(),m()}function N(a){let t=parseInt(a.target.dataset.day);if(!t)return;let o=new Date(Date.UTC(l,n,t));u=o;let i=o.toISOString().split("T")[0];y.value=i,y.dispatchEvent(new Event("change",{bubbles:!0})),e.dispatchEvent(new CustomEvent("calendar-date-selected",{bubbles:!0,detail:{date:o}})),m()}v.addEventListener("click",k),b.addEventListener("click",L),p(),S(),m();let I=e.closest("form");I&&I.addEventListener("reset",()=>{u=null,y.value="",n=new Date().getMonth(),l=new Date().getFullYear(),p(),m()}),e._calendarInitialized=!0}function T(e=document){e instanceof Element&&e.matches("[data-calendar-container]")&&w(e);for(let f of e.querySelectorAll("[data-calendar-container]:not([data-initialized])"))w(f)}window.templUI=window.templUI||{},window.templUI.calendar={init:T},document.addEventListener("DOMContentLoaded",()=>T())})();})(); diff --git a/server/web/assets/js/carousel.min.js b/server/web/assets/js/carousel.min.js new file mode 100644 index 0000000..0aa78c3 --- /dev/null +++ b/server/web/assets/js/carousel.min.js @@ -0,0 +1 @@ +(()=>{(function(){function c(n){if(!n||n.hasAttribute("data-initialized"))return;n.setAttribute("data-initialized","true");let o=n.querySelector(".carousel-track"),f=Array.from(o?.querySelectorAll(".carousel-item")||[]);if(f.length===0)return;let p=Array.from(n.querySelectorAll(".carousel-indicator")),i=n.querySelector(".carousel-prev"),a=n.querySelector(".carousel-next"),t={currentIndex:0,slideCount:f.length,autoplay:n.dataset.autoplay==="true",interval:parseInt(n.dataset.interval||5e3),loop:n.dataset.loop==="true",autoplayInterval:null,isHovering:!1,touchStartX:0};function v(){o.style.transform=`translateX(-${t.currentIndex*100}%)`}function y(){p.forEach((e,l)=>{l{t.isHovering||r()},t.interval))}function g(){t.autoplayInterval&&(clearInterval(t.autoplayInterval),t.autoplayInterval=null)}function r(){let e=t.currentIndex+1;if(e>=t.slideCount)if(t.loop)e=0;else return;u(e)}function h(){let e=t.currentIndex-1;if(e<0)if(t.loop)e=t.slideCount-1;else return;u(e)}function u(e){if(e<0||e>=t.slideCount)if(t.loop)e=(e+t.slideCount)%t.slideCount;else return;e!==t.currentIndex&&(t.currentIndex=e,v(),y(),I(),t.autoplay&&!t.isHovering&&(g(),s()))}o&&(o.addEventListener("touchstart",e=>{t.touchStartX=e.touches[0].clientX},{passive:!0}),o.addEventListener("touchend",e=>{let l=e.changedTouches[0].clientX,m=t.touchStartX-l;Math.abs(m)>50&&(m>0?r():h())},{passive:!0})),p.forEach((e,l)=>{lu(l))}),i&&i.addEventListener("click",h),a&&a.addEventListener("click",r),n.addEventListener("mouseenter",()=>{t.isHovering=!0,t.autoplay&&g()}),n.addEventListener("mouseleave",()=>{t.isHovering=!1,t.autoplay&&s()}),v(),y(),I(),t.autoplay&&s()}function d(n=document){n instanceof Element&&n.matches(".carousel-component")&&c(n);for(let o of n.querySelectorAll(".carousel-component:not([data-initialized])"))c(o)}window.templUI=window.templUI||{},window.templUI.carousel={init:d},document.addEventListener("DOMContentLoaded",()=>d())})();})(); diff --git a/server/web/assets/js/chart.min.js b/server/web/assets/js/chart.min.js new file mode 100644 index 0000000..0285e4e --- /dev/null +++ b/server/web/assets/js/chart.min.js @@ -0,0 +1,15 @@ +(()=>{var Er=Object.create;var qo=Object.defineProperty;var Rr=Object.getOwnPropertyDescriptor;var Ir=Object.getOwnPropertyNames;var zr=Object.getPrototypeOf,Fr=Object.prototype.hasOwnProperty;var Vr=(G,W)=>()=>(W||G((W={exports:{}}).exports,W),W.exports);var Br=(G,W,ht,I)=>{if(W&&typeof W=="object"||typeof W=="function")for(let F of Ir(W))!Fr.call(G,F)&&F!==ht&&qo(G,F,{get:()=>W[F],enumerable:!(I=Rr(W,F))||I.enumerable});return G};var Wr=(G,W,ht)=>(ht=G!=null?Er(zr(G)):{},Br(W||!G||!G.__esModule?qo(ht,"default",{value:G,enumerable:!0}):ht,G));var Ko=Vr((fs,gs)=>{(function(G,W){typeof fs=="object"&&typeof gs<"u"?gs.exports=W():typeof define=="function"&&define.amd?define(W):(G=typeof globalThis<"u"?globalThis:G||self).Chart=W()})(fs,function(){"use strict";var G=Object.freeze({__proto__:null,get Colors(){return xr},get Decimation(){return _r},get Filler(){return Pr},get Legend(){return Dr},get SubTitle(){return Or},get Title(){return Cr},get Tooltip(){return Lr}});function W(){}let ht=(()=>{let i=0;return()=>i++})();function I(i){return i==null}function F(i){if(Array.isArray&&Array.isArray(i))return!0;let t=Object.prototype.toString.call(i);return t.slice(0,7)==="[object"&&t.slice(-6)==="Array]"}function z(i){return i!==null&&Object.prototype.toString.call(i)==="[object Object]"}function L(i){return(typeof i=="number"||i instanceof Number)&&isFinite(+i)}function X(i,t){return L(i)?i:t}function E(i,t){return i===void 0?t:i}let j=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100:+i/t,Z=(i,t)=>typeof i=="string"&&i.endsWith("%")?parseFloat(i)/100*t:+i;function N(i,t,e){if(i&&typeof i.call=="function")return i.apply(e,t)}function B(i,t,e,s){let n,o,a;if(F(i))if(o=i.length,s)for(n=o-1;n>=0;n--)t.call(e,i[n],n);else for(n=0;ni,x:i=>i.x,y:i=>i.y};function xs(i){let t=i.split("."),e=[],s="";for(let n of t)s+=n,s.endsWith("\\")?s=s.slice(0,-1)+".":(e.push(s),s="");return e}function St(i,t){return(bs[t]||(bs[t]=function(s){let n=xs(s);return o=>{for(let a of n){if(a==="")break;o=o&&o[a]}return o}}(t)))(i)}function Oe(i){return i.charAt(0).toUpperCase()+i.slice(1)}let Qt=i=>i!==void 0,Pt=i=>typeof i=="function",ci=(i,t)=>{if(i.size!==t.size)return!1;for(let e of i)if(!t.has(e))return!1;return!0};function _s(i){return i.type==="mouseup"||i.type==="click"||i.type==="contextmenu"}let $=Math.PI,Y=2*$,ys=Y+$,he=Number.POSITIVE_INFINITY,vs=$/180,q=$/2,Lt=$/4,di=2*$/3,Dt=Math.log10,ft=Math.sign;function te(i,t,e){return Math.abs(i-t)n-o).pop(),t}function $t(i){return!function(t){return typeof t=="symbol"||typeof t=="object"&&t!==null&&!(Symbol.toPrimitive in t||"toString"in t||"valueOf"in t)}(i)&&!isNaN(parseFloat(i))&&isFinite(i)}function Ms(i,t){let e=Math.round(i);return e-t<=i&&e+t>=i}function fi(i,t,e){let s,n,o;for(s=0,n=i.length;sl&&h=Math.min(t,e)-s&&i<=Math.max(t,e)+s}function Le(i,t,e){e=e||(a=>i[a]1;)s=o+n>>1,e(s)?o=s:n=s;return{lo:o,hi:n}}let yt=(i,t,e,s)=>Le(i,e,s?n=>{let o=i[n][t];return oi[n][t]Le(i,e,s=>i[s][t]>=e);function Ds(i,t,e){let s=0,n=i.length;for(;ss&&i[n-1]>e;)n--;return s>0||n{let s="_onData"+Oe(e),n=i[e];Object.defineProperty(i,e,{configurable:!0,enumerable:!1,value(...o){let a=n.apply(this,o);return i._chartjs.listeners.forEach(r=>{typeof r[s]=="function"&&r[s](...o)}),a}})}))}function mi(i,t){let e=i._chartjs;if(!e)return;let s=e.listeners,n=s.indexOf(t);n!==-1&&s.splice(n,1),s.length>0||(Cs.forEach(o=>{delete i[o]}),delete i._chartjs)}function bi(i){let t=new Set(i);return t.size===i.length?i:Array.from(t)}let xi=typeof window>"u"?function(i){return i()}:window.requestAnimationFrame;function _i(i,t){let e=[],s=!1;return function(...n){e=n,s||(s=!0,xi.call(window,()=>{s=!1,i.apply(t,e)}))}}function As(i,t){let e;return function(...s){return t?(clearTimeout(e),e=setTimeout(i,t,s)):i.apply(this,s),t}}let Ee=i=>i==="start"?"left":i==="end"?"right":"center",tt=(i,t,e)=>i==="start"?t:i==="end"?e:(t+e)/2,Ts=(i,t,e,s)=>i===(s?"left":"right")?e:i==="center"?(t+e)/2:t;function yi(i,t,e){let s=t.length,n=0,o=s;if(i._sorted){let{iScale:a,vScale:r,_parsed:l}=i,h=i.dataset&&i.dataset.options?i.dataset.options.spanGaps:null,d=a.axis,{min:c,max:u,minDefined:f,maxDefined:p}=a.getUserBounds();if(f){if(n=Math.min(yt(l,d,c).lo,e?s:yt(t,d,a.getPixelForValue(c)).lo),h){let g=l.slice(0,n+1).reverse().findIndex(m=>!I(m[r.axis]));n-=Math.max(0,g)}n=Q(n,0,s-1)}if(p){let g=Math.max(yt(l,a.axis,u,!0).hi+1,e?0:yt(t,d,a.getPixelForValue(u),!0).hi+1);if(h){let m=l.slice(g-1).findIndex(b=>!I(b[r.axis]));g+=Math.max(0,m)}o=Q(g,n,s)-n}else o=s-n}return{start:n,count:o}}function vi(i){let{xScale:t,yScale:e,_scaleRanges:s}=i,n={xmin:t.min,xmax:t.max,ymin:e.min,ymax:e.max};if(!s)return i._scaleRanges=n,!0;let o=s.xmin!==t.min||s.xmax!==t.max||s.ymin!==e.min||s.ymax!==e.max;return Object.assign(s,n),o}class Go{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,s,n){let o=e.listeners[n],a=e.duration;o.forEach(r=>r({chart:t,initial:e.initial,numSteps:a,currentStep:Math.min(s-e.start,a)}))}_refresh(){this._request||(this._running=!0,this._request=xi.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((s,n)=>{if(!s.running||!s.items.length)return;let o=s.items,a,r=o.length-1,l=!1;for(;r>=0;--r)a=o[r],a._active?(a._total>s.duration&&(s.duration=a._total),a.tick(t),l=!0):(o[r]=o[o.length-1],o.pop());l&&(n.draw(),this._notify(n,s,t,"progress")),o.length||(s.running=!1,this._notify(n,s,t,"complete"),s.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){let e=this._charts,s=e.get(t);return s||(s={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,s)),s}listen(t,e,s){this._getAnims(t).listeners[e].push(s)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){let e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((s,n)=>Math.max(s,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;let e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){let e=this._charts.get(t);if(!e||!e.items.length)return;let s=e.items,n=s.length-1;for(;n>=0;--n)s[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var vt=new Go;function ce(i){return i+.5|0}let Et=(i,t,e)=>Math.max(Math.min(i,e),t);function de(i){return Et(ce(2.55*i),0,255)}function Rt(i){return Et(ce(255*i),0,255)}function Ct(i){return Et(ce(i/2.55)/100,0,1)}function Ls(i){return Et(ce(100*i),0,100)}let dt={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},wi=[..."0123456789ABCDEF"],Zo=i=>wi[15&i],Jo=i=>wi[(240&i)>>4]+wi[15&i],Re=i=>(240&i)>>4==(15&i);function Qo(i){var t=(e=>Re(e.r)&&Re(e.g)&&Re(e.b)&&Re(e.a))(i)?Zo:Jo;return i?"#"+t(i.r)+t(i.g)+t(i.b)+((e,s)=>e<255?s(e):"")(i.a,t):void 0}let ta=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Es(i,t,e){let s=t*Math.min(e,1-e),n=(o,a=(o+i/30)%12)=>e-s*Math.max(Math.min(a-3,9-a,1),-1);return[n(0),n(8),n(4)]}function ea(i,t,e){let s=(n,o=(n+i/60)%6)=>e-e*t*Math.max(Math.min(o,4-o,1),0);return[s(5),s(3),s(1)]}function ia(i,t,e){let s=Es(i,1,.5),n;for(t+e>1&&(n=1/(t+e),t*=n,e*=n),n=0;n<3;n++)s[n]*=1-t-e,s[n]+=t;return s}function Mi(i){let t=i.r/255,e=i.g/255,s=i.b/255,n=Math.max(t,e,s),o=Math.min(t,e,s),a=(n+o)/2,r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=function(d,c,u,f,p){return d===p?(c-u)/f+(c>16&255,r>>8&255,255&r]}return e}(),Ie.transparent=[0,0,0,0]);let t=Ie[i.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:t.length===4?t[3]:255}}let oa=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/,Pi=i=>i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055,ie=i=>i<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4);function ze(i,t,e){if(i){let s=Mi(i);s[t]=Math.max(0,Math.min(s[t]+s[t]*e,t===0?360:1)),s=Si(s),i.r=s[0],i.g=s[1],i.b=s[2]}}function Fs(i,t){return i&&Object.assign(t||{},i)}function Vs(i){var t={r:0,g:0,b:0,a:255};return Array.isArray(i)?i.length>=3&&(t={r:i[0],g:i[1],b:i[2],a:255},i.length>3&&(t.a=Rt(i[3]))):(t=Fs(i,{r:0,g:0,b:0,a:1})).a=Rt(t.a),t}function aa(i){return i.charAt(0)==="r"?function(t){let e=oa.exec(t),s,n,o,a=255;if(e){if(e[7]!==s){let r=+e[7];a=e[8]?de(r):Et(255*r,0,255)}return s=+e[1],n=+e[3],o=+e[5],s=255&(e[2]?de(s):Et(s,0,255)),n=255&(e[4]?de(n):Et(n,0,255)),o=255&(e[6]?de(o):Et(o,0,255)),{r:s,g:n,b:o,a}}}(i):sa(i)}class ue{constructor(t){if(t instanceof ue)return t;let e=typeof t,s;var n,o,a;e==="object"?s=Vs(t):e==="string"&&(a=(n=t).length,n[0]==="#"&&(a===4||a===5?o={r:255&17*dt[n[1]],g:255&17*dt[n[2]],b:255&17*dt[n[3]],a:a===5?17*dt[n[4]]:255}:a!==7&&a!==9||(o={r:dt[n[1]]<<4|dt[n[2]],g:dt[n[3]]<<4|dt[n[4]],b:dt[n[5]]<<4|dt[n[6]],a:a===9?dt[n[7]]<<4|dt[n[8]]:255})),s=o||na(t)||aa(t)),this._rgb=s,this._valid=!!s}get valid(){return this._valid}get rgb(){var t=Fs(this._rgb);return t&&(t.a=Ct(t.a)),t}set rgb(t){this._rgb=Vs(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${Ct(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):void 0;var t}hexString(){return this._valid?Qo(this._rgb):void 0}hslString(){return this._valid?function(t){if(!t)return;let e=Mi(t),s=e[0],n=Ls(e[1]),o=Ls(e[2]);return t.a<255?`hsla(${s}, ${n}%, ${o}%, ${Ct(t.a)})`:`hsl(${s}, ${n}%, ${o}%)`}(this._rgb):void 0}mix(t,e){if(t){let s=this.rgb,n=t.rgb,o,a=e===o?.5:e,r=2*a-1,l=s.a-n.a,h=((r*l==-1?r:(r+l)/(1+r*l))+1)/2;o=1-h,s.r=255&h*s.r+o*n.r+.5,s.g=255&h*s.g+o*n.g+.5,s.b=255&h*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,this.rgb=s}return this}interpolate(t,e){return t&&(this._rgb=function(s,n,o){let a=ie(Ct(s.r)),r=ie(Ct(s.g)),l=ie(Ct(s.b));return{r:Rt(Pi(a+o*(ie(Ct(n.r))-a))),g:Rt(Pi(r+o*(ie(Ct(n.g))-r))),b:Rt(Pi(l+o*(ie(Ct(n.b))-l))),a:s.a+o*(n.a-s.a)}}(this._rgb,t._rgb,e)),this}clone(){return new ue(this.rgb)}alpha(t){return this._rgb.a=Rt(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){let t=this._rgb,e=ce(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){let t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return ze(this._rgb,2,t),this}darken(t){return ze(this._rgb,2,-t),this}saturate(t){return ze(this._rgb,1,t),this}desaturate(t){return ze(this._rgb,1,-t),this}rotate(t){return function(e,s){var n=Mi(e);n[0]=Rs(n[0]+s),n=Si(n),e.r=n[0],e.g=n[1],e.b=n[2]}(this._rgb,t),this}}function Fe(i){if(i&&typeof i=="object"){let t=i.toString();return t==="[object CanvasPattern]"||t==="[object CanvasGradient]"}return!1}function Di(i){return Fe(i)?i:new ue(i)}function Ve(i){return Fe(i)?i:new ue(i).saturate(.5).darken(.1).hexString()}let ra=["x","y","borderWidth","radius","tension"],la=["color","borderColor","backgroundColor"],Bs=new Map;function se(i,t,e){return function(s,n){n=n||{};let o=s+JSON.stringify(n),a=Bs.get(o);return a||(a=new Intl.NumberFormat(s,n),Bs.set(o,a)),a}(t,e).format(i)}let Ws={values:i=>F(i)?i:""+i,numeric(i,t,e){if(i===0)return"0";let s=this.chart.options.locale,n,o=i;if(e.length>1){let h=Math.max(Math.abs(e[0].value),Math.abs(e[e.length-1].value));(h<1e-4||h>1e15)&&(n="scientific"),o=function(d,c){let u=c.length>3?c[2].value-c[1].value:c[1].value-c[0].value;return Math.abs(u)>=1&&d!==Math.floor(d)&&(u=d-Math.floor(d)),u}(i,e)}let a=Dt(Math.abs(o)),r=isNaN(a)?1:Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),se(i,s,l)},logarithmic(i,t,e){if(i===0)return"0";let s=e[t].significand||i/Math.pow(10,Math.floor(Dt(i)));return[1,2,3,5,10,15].includes(s)||t>.8*e.length?Ws.numeric.call(this,i,t,e):""}};var fe={formatters:Ws};let Yt=Object.create(null),Ci=Object.create(null);function ge(i,t){if(!t)return i;let e=t.split(".");for(let s=0,n=e.length;ss.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(s,n)=>Ve(n.backgroundColor),this.hoverBorderColor=(s,n)=>Ve(n.borderColor),this.hoverColor=(s,n)=>Ve(n.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t),this.apply(e)}set(t,e){return Oi(this,t,e)}get(t){return ge(this,t)}describe(t,e){return Oi(Ci,t,e)}override(t,e){return Oi(Yt,t,e)}route(t,e,s,n){let o=ge(this,t),a=ge(this,s),r="_"+e;Object.defineProperties(o,{[r]:{value:o[e],writable:!0},[e]:{enumerable:!0,get(){let l=this[r],h=a[n];return z(l)?Object.assign({},h,l):E(l,h)},set(l){this[r]=l}}})}apply(t){t.forEach(e=>e(this))}}var U=new ha({_scriptable:i=>!i.startsWith("on"),_indexable:i=>i!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[function(i){i.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),i.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:t=>t!=="onProgress"&&t!=="onComplete"&&t!=="fn"}),i.set("animations",{colors:{type:"color",properties:la},numbers:{type:"number",properties:ra}}),i.describe("animations",{_fallback:"animation"}),i.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}})},function(i){i.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})},function(i){i.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(t,e)=>e.lineWidth,tickColor:(t,e)=>e.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:fe.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),i.route("scale.ticks","color","","color"),i.route("scale.grid","color","","borderColor"),i.route("scale.border","color","","borderColor"),i.route("scale.title","color","","color"),i.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&t!=="callback"&&t!=="parser",_indexable:t=>t!=="borderDash"&&t!=="tickBorderDash"&&t!=="dash"}),i.describe("scales",{_fallback:"scale"}),i.describe("scale.ticks",{_scriptable:t=>t!=="backdropPadding"&&t!=="callback",_indexable:t=>t!=="backdropPadding"})}]);function Be(){return typeof window<"u"&&typeof document<"u"}function We(i){let t=i.parentNode;return t&&t.toString()==="[object ShadowRoot]"&&(t=t.host),t}function Ne(i,t,e){let s;return typeof i=="string"?(s=parseInt(i,10),i.indexOf("%")!==-1&&(s=s/100*t.parentNode[e])):s=i,s}let He=i=>i.ownerDocument.defaultView.getComputedStyle(i,null);function Ns(i,t){return He(i).getPropertyValue(t)}let ca=["top","right","bottom","left"];function Ut(i,t,e){let s={};e=e?"-"+e:"";for(let n=0;n<4;n++){let o=ca[n];s[o]=parseFloat(i[t+"-"+o+e])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}let da=(i,t,e)=>(i>0||t>0)&&(!e||!e.shadowRoot);function It(i,t){if("native"in i)return i;let{canvas:e,currentDevicePixelRatio:s}=t,n=He(e),o=n.boxSizing==="border-box",a=Ut(n,"padding"),r=Ut(n,"border","width"),{x:l,y:h,box:d}=function(g,m){let b=g.touches,y=b&&b.length?b[0]:g,{offsetX:_,offsetY:x}=y,v,w,M=!1;if(da(_,x,g.target))v=_,w=x;else{let k=m.getBoundingClientRect();v=y.clientX-k.left,w=y.clientY-k.top,M=!0}return{x:v,y:w,box:M}}(i,e),c=a.left+(d&&r.left),u=a.top+(d&&r.top),{width:f,height:p}=t;return o&&(f-=a.width+r.width,p-=a.height+r.height),{x:Math.round((l-c)/f*e.width/s),y:Math.round((h-u)/p*e.height/s)}}let je=i=>Math.round(10*i)/10;function Hs(i,t,e,s){let n=He(i),o=Ut(n,"margin"),a=Ne(n.maxWidth,i,"clientWidth")||he,r=Ne(n.maxHeight,i,"clientHeight")||he,l=function(c,u,f){let p,g;if(u===void 0||f===void 0){let m=c&&We(c);if(m){let b=m.getBoundingClientRect(),y=He(m),_=Ut(y,"border","width"),x=Ut(y,"padding");u=b.width-x.width-_.width,f=b.height-x.height-_.height,p=Ne(y.maxWidth,m,"clientWidth"),g=Ne(y.maxHeight,m,"clientHeight")}else u=c.clientWidth,f=c.clientHeight}return{width:u,height:f,maxWidth:p||he,maxHeight:g||he}}(i,t,e),{width:h,height:d}=l;if(n.boxSizing==="content-box"){let c=Ut(n,"border","width"),u=Ut(n,"padding");h-=u.width+c.width,d-=u.height+c.height}return h=Math.max(0,h-o.width),d=Math.max(0,s?h/s:d-o.height),h=je(Math.min(h,a,l.maxWidth)),d=je(Math.min(d,r,l.maxHeight)),h&&!d&&(d=je(h/2)),(t!==void 0||e!==void 0)&&s&&l.height&&d>l.height&&(d=l.height,h=je(Math.floor(d*s))),{width:h,height:d}}function Ai(i,t,e){let s=t||1,n=Math.floor(i.height*s),o=Math.floor(i.width*s);i.height=Math.floor(i.height),i.width=Math.floor(i.width);let a=i.canvas;return a.style&&(e||!a.style.height&&!a.style.width)&&(a.style.height=`${i.height}px`,a.style.width=`${i.width}px`),(i.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(i.currentDevicePixelRatio=s,a.height=n,a.width=o,i.ctx.setTransform(s,0,0,s,0,0),!0)}let js=function(){let i=!1;try{let t={get passive(){return i=!0,!1}};Be()&&(window.addEventListener("test",null,t),window.removeEventListener("test",null,t))}catch{}return i}();function Ti(i,t){let e=Ns(i,t),s=e&&e.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function $s(i){return!i||I(i.size)||I(i.family)?null:(i.style?i.style+" ":"")+(i.weight?i.weight+" ":"")+i.size+"px "+i.family}function pe(i,t,e,s,n){let o=t[n];return o||(o=t[n]=i.measureText(n).width,e.push(n)),o>s&&(s=o),s}function Ys(i,t,e,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==t&&(n=s.data={},o=s.garbageCollect=[],s.font=t),i.save(),i.font=t;let a=0,r=e.length,l,h,d,c,u;for(l=0;le.length){for(l=0;l0&&i.stroke()}}function wt(i,t,e){return e=e||.5,!t||i&&i.x>t.left-e&&i.xt.top-e&&i.y0&&o.strokeColor!=="",l,h;for(i.save(),i.font=n.string,function(d,c){c.translation&&d.translate(c.translation[0],c.translation[1]),I(c.rotation)||d.rotate(c.rotation),c.color&&(d.fillStyle=c.color),c.textAlign&&(d.textAlign=c.textAlign),c.textBaseline&&(d.textBaseline=c.textBaseline)}(i,o),l=0;li[0]){let o=e||i;s===void 0&&(s=Zs("_fallback",i));let a={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:i,_rootScopes:o,_fallback:s,_getTarget:n,override:r=>Ye([r,...i],t,o,s)};return new Proxy(a,{deleteProperty:(r,l)=>(delete r[l],delete r._keys,delete i[0][l],!0),get:(r,l)=>qs(r,l,()=>function(h,d,c,u){let f;for(let p of d)if(f=Zs(ga(p,h),c),f!==void 0)return Ii(h,f)?zi(c,u,h,f):f}(l,t,i,r)),getOwnPropertyDescriptor:(r,l)=>Reflect.getOwnPropertyDescriptor(r._scopes[0],l),getPrototypeOf:()=>Reflect.getPrototypeOf(i[0]),has:(r,l)=>Js(r).includes(l),ownKeys:r=>Js(r),set(r,l,h){let d=r._storage||(r._storage=n());return r[l]=d[l]=h,delete r._keys,!0}})}function Xt(i,t,e,s){let n={_cacheable:!1,_proxy:i,_context:t,_subProxy:e,_stack:new Set,_descriptors:Ri(i,s),setContext:o=>Xt(i,o,e,s),override:o=>Xt(i.override(o),t,e,s)};return new Proxy(n,{deleteProperty:(o,a)=>(delete o[a],delete i[a],!0),get:(o,a,r)=>qs(o,a,()=>function(l,h,d){let{_proxy:c,_context:u,_subProxy:f,_descriptors:p}=l,g=c[h];return Pt(g)&&p.isScriptable(h)&&(g=function(m,b,y,_){let{_proxy:x,_context:v,_subProxy:w,_stack:M}=y;if(M.has(m))throw new Error("Recursion detected: "+Array.from(M).join("->")+"->"+m);M.add(m);let k=b(v,w||_);return M.delete(m),Ii(m,k)&&(k=zi(x._scopes,x,m,k)),k}(h,g,l,d)),F(g)&&g.length&&(g=function(m,b,y,_){let{_proxy:x,_context:v,_subProxy:w,_descriptors:M}=y;if(v.index!==void 0&&_(m))return b[v.index%b.length];if(z(b[0])){let k=b,D=x._scopes.filter(S=>S!==k);b=[];for(let S of k){let T=zi(D,x,m,S);b.push(Xt(T,v,w&&w[m],M))}}return b}(h,g,l,p.isIndexable)),Ii(h,g)&&(g=Xt(g,u,f&&f[h],p)),g}(o,a,r)),getOwnPropertyDescriptor:(o,a)=>o._descriptors.allKeys?Reflect.has(i,a)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(i,a),getPrototypeOf:()=>Reflect.getPrototypeOf(i),has:(o,a)=>Reflect.has(i,a),ownKeys:()=>Reflect.ownKeys(i),set:(o,a,r)=>(i[a]=r,delete o[a],!0)})}function Ri(i,t={scriptable:!0,indexable:!0}){let{_scriptable:e=t.scriptable,_indexable:s=t.indexable,_allKeys:n=t.allKeys}=i;return{allKeys:n,scriptable:e,indexable:s,isScriptable:Pt(e)?e:()=>e,isIndexable:Pt(s)?s:()=>s}}let ga=(i,t)=>i?i+Oe(t):t,Ii=(i,t)=>z(t)&&i!=="adapters"&&(Object.getPrototypeOf(t)===null||t.constructor===Object);function qs(i,t,e){if(Object.prototype.hasOwnProperty.call(i,t)||t==="constructor")return i[t];let s=e();return i[t]=s,s}function Ks(i,t,e){return Pt(i)?i(t,e):i}let pa=(i,t)=>i===!0?t:typeof i=="string"?St(t,i):void 0;function ma(i,t,e,s,n){for(let o of t){let a=pa(e,o);if(a){i.add(a);let r=Ks(a._fallback,e,n);if(r!==void 0&&r!==e&&r!==s)return r}else if(a===!1&&s!==void 0&&e!==s)return null}return!1}function zi(i,t,e,s){let n=t._rootScopes,o=Ks(t._fallback,e,s),a=[...i,...n],r=new Set;r.add(s);let l=Gs(r,a,e,o||e,s);return l!==null&&(o===void 0||o===e||(l=Gs(r,a,o,l,s),l!==null))&&Ye(Array.from(r),[""],n,o,()=>function(h,d,c){let u=h._getTarget();d in u||(u[d]={});let f=u[d];return F(f)&&z(c)?c:f||{}}(t,e,s))}function Gs(i,t,e,s,n){for(;e;)e=ma(i,t,e,s,n);return e}function Zs(i,t){for(let e of t){if(!e)continue;let s=e[i];if(s!==void 0)return s}}function Js(i){let t=i._keys;return t||(t=i._keys=function(e){let s=new Set;for(let n of e)for(let o of Object.keys(n).filter(a=>!a.startsWith("_")))s.add(o);return Array.from(s)}(i._scopes)),t}function Fi(i,t,e,s){let{iScale:n}=i,{key:o="r"}=this._parsing,a=new Array(s),r,l,h,d;for(r=0,l=s;rti==="x"?"y":"x";function tn(i,t,e,s){let n=i.skip?t:i,o=t,a=e.skip?t:e,r=Te(o,n),l=Te(a,o),h=r/(r+l),d=l/(r+l);h=isNaN(h)?0:h,d=isNaN(d)?0:d;let c=s*h,u=s*d;return{previous:{x:o.x-c*(a.x-n.x),y:o.y-c*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function en(i,t="x"){let e=Qs(t),s=i.length,n=Array(s).fill(0),o=Array(s),a,r,l,h=oe(i,0);for(a=0;a!h.skip)),t.cubicInterpolationMode==="monotone")en(i,n);else{let h=s?i[i.length-1]:i[0];for(o=0,a=i.length;oi===0||i===1,nn=(i,t,e)=>-Math.pow(2,10*(i-=1))*Math.sin((i-t)*Y/e),on=(i,t,e)=>Math.pow(2,-10*i)*Math.sin((i-t)*Y/e)+1,ae={linear:i=>i,easeInQuad:i=>i*i,easeOutQuad:i=>-i*(i-2),easeInOutQuad:i=>(i/=.5)<1?.5*i*i:-.5*(--i*(i-2)-1),easeInCubic:i=>i*i*i,easeOutCubic:i=>(i-=1)*i*i+1,easeInOutCubic:i=>(i/=.5)<1?.5*i*i*i:.5*((i-=2)*i*i+2),easeInQuart:i=>i*i*i*i,easeOutQuart:i=>-((i-=1)*i*i*i-1),easeInOutQuart:i=>(i/=.5)<1?.5*i*i*i*i:-.5*((i-=2)*i*i*i-2),easeInQuint:i=>i*i*i*i*i,easeOutQuint:i=>(i-=1)*i*i*i*i+1,easeInOutQuint:i=>(i/=.5)<1?.5*i*i*i*i*i:.5*((i-=2)*i*i*i*i+2),easeInSine:i=>1-Math.cos(i*q),easeOutSine:i=>Math.sin(i*q),easeInOutSine:i=>-.5*(Math.cos($*i)-1),easeInExpo:i=>i===0?0:Math.pow(2,10*(i-1)),easeOutExpo:i=>i===1?1:1-Math.pow(2,-10*i),easeInOutExpo:i=>Xe(i)?i:i<.5?.5*Math.pow(2,10*(2*i-1)):.5*(2-Math.pow(2,-10*(2*i-1))),easeInCirc:i=>i>=1?i:-(Math.sqrt(1-i*i)-1),easeOutCirc:i=>Math.sqrt(1-(i-=1)*i),easeInOutCirc:i=>(i/=.5)<1?-.5*(Math.sqrt(1-i*i)-1):.5*(Math.sqrt(1-(i-=2)*i)+1),easeInElastic:i=>Xe(i)?i:nn(i,.075,.3),easeOutElastic:i=>Xe(i)?i:on(i,.075,.3),easeInOutElastic(i){return Xe(i)?i:i<.5?.5*nn(2*i,.1125,.45):.5+.5*on(2*i-1,.1125,.45)},easeInBack(i){return i*i*((1.70158+1)*i-1.70158)},easeOutBack(i){return(i-=1)*i*((1.70158+1)*i+1.70158)+1},easeInOutBack(i){let t=1.70158;return(i/=.5)<1?i*i*((1+(t*=1.525))*i-t)*.5:.5*((i-=2)*i*((1+(t*=1.525))*i+t)+2)},easeInBounce:i=>1-ae.easeOutBounce(1-i),easeOutBounce(i){return i<1/2.75?7.5625*i*i:i<2/2.75?7.5625*(i-=1.5/2.75)*i+.75:i<2.5/2.75?7.5625*(i-=2.25/2.75)*i+.9375:7.5625*(i-=2.625/2.75)*i+.984375},easeInOutBounce:i=>i<.5?.5*ae.easeInBounce(2*i):.5*ae.easeOutBounce(2*i-1)+.5};function Vt(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:i.y+e*(t.y-i.y)}}function an(i,t,e,s){return{x:i.x+e*(t.x-i.x),y:s==="middle"?e<.5?i.y:t.y:s==="after"?e<1?i.y:t.y:e>0?t.y:i.y}}function rn(i,t,e,s){let n={x:i.cp2x,y:i.cp2y},o={x:t.cp1x,y:t.cp1y},a=Vt(i,n,e),r=Vt(n,o,e),l=Vt(o,t,e),h=Vt(a,r,e),d=Vt(r,l,e);return Vt(h,d,e)}let xa=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,_a=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ln(i,t){let e=(""+i).match(xa);if(!e||e[1]==="normal")return 1.2*t;switch(i=+e[2],e[3]){case"px":return i;case"%":i/=100}return t*i}let ya=i=>+i||0;function qe(i,t){let e={},s=z(t),n=s?Object.keys(t):t,o=z(i)?s?a=>E(i[a],i[t[a]]):a=>i[a]:()=>i;for(let a of n)e[a]=ya(o(a));return e}function Vi(i){return qe(i,{top:"y",right:"x",bottom:"y",left:"x"})}function Bt(i){return qe(i,["topLeft","topRight","bottomLeft","bottomRight"])}function et(i){let t=Vi(i);return t.width=t.left+t.right,t.height=t.top+t.bottom,t}function J(i,t){i=i||{},t=t||U.font;let e=E(i.size,t.size);typeof e=="string"&&(e=parseInt(e,10));let s=E(i.style,t.style);s&&!(""+s).match(_a)&&(console.warn('Invalid font style specified: "'+s+'"'),s=void 0);let n={family:E(i.family,t.family),lineHeight:ln(E(i.lineHeight,t.lineHeight),e),size:e,style:s,weight:E(i.weight,t.weight),string:""};return n.string=$s(n),n}function re(i,t,e,s){let n,o,a,r=!0;for(n=0,o=i.length;ne&&r===0?0:r+l;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ot(i,t){return Object.assign(Object.create(i),t)}function qt(i,t,e){return i?function(s,n){return{x:o=>s+s+n-o,setWidth(o){n=o},textAlign:o=>o==="center"?o:o==="right"?"left":"right",xPlus:(o,a)=>o-a,leftForLtr:(o,a)=>o-a}}(t,e):{x:s=>s,setWidth(s){},textAlign:s=>s,xPlus:(s,n)=>s+n,leftForLtr:(s,n)=>s}}function Bi(i,t){let e,s;t!=="ltr"&&t!=="rtl"||(e=i.canvas.style,s=[e.getPropertyValue("direction"),e.getPropertyPriority("direction")],e.setProperty("direction",t,"important"),i.prevTextDirection=s)}function Wi(i,t){t!==void 0&&(delete i.prevTextDirection,i.canvas.style.setProperty("direction",t[0],t[1]))}function cn(i){return i==="angle"?{between:ee,compare:ks,normalize:nt}:{between:_t,compare:(t,e)=>t-e,normalize:t=>t}}function dn({start:i,end:t,count:e,loop:s,style:n}){return{start:i%e,end:t%e,loop:s&&(t-i+1)%e==0,style:n}}function Ni(i,t,e){if(!e)return[i];let{property:s,start:n,end:o}=e,a=t.length,{compare:r,between:l,normalize:h}=cn(s),{start:d,end:c,loop:u,style:f}=function(w,M,k){let{property:D,start:S,end:T}=k,{between:A,normalize:P}=cn(D),O=M.length,C,R,{start:H,end:V,loop:st}=w;if(st){for(H+=O,V+=O,C=0,R=O;Cy||l(n,b,g)&&r(n,b)!==0,v=()=>!y||r(o,g)===0||l(o,b,g);for(let w=d,M=d;w<=c;++w)m=t[w%a],m.skip||(g=h(m[s]),g!==b&&(y=l(g,n,o),_===null&&x()&&(_=r(g,n)===0?w:M),_!==null&&v()&&(p.push(dn({start:_,end:w,loop:u,count:a,style:f})),_=null),M=w,b=g));return _!==null&&p.push(dn({start:_,end:c,loop:u,count:a,style:f})),p}function Hi(i,t){let e=[],s=i.segments;for(let n=0;nu&&l[f%h].skip;)f--;return f%=h,{start:u,end:f}}(e,n,o,s);return s===!0?fn(i,[{start:a,end:r,loop:o}],e,t):fn(i,function(l,h,d,c){let u=l.length,f=[],p,g=h,m=l[h];for(p=h+1;p<=d;++p){let b=l[p%u];b.skip||b.stop?m.skip||(c=!1,f.push({start:h%u,end:(p-1)%u,loop:c}),h=g=b.stop?p:null):(g=p,m.skip&&(h=p)),m=b}return g!==null&&f.push({start:h%u,end:g%u,loop:c}),f}(e,a,r!I(g[c.axis]));d.lo-=Math.max(0,f);let p=u.slice(d.hi).findIndex(g=>!I(g[c.axis]));d.hi+=Math.max(0,p)}return d}if(n._sharedOptions){let d=o[0],c=typeof d.getRange=="function"&&d.getRange(t);if(c){let u=h(o,t,e-c),f=h(o,t,e+c);return{lo:u.lo,hi:f.hi}}}}return{lo:0,hi:o.length-1}}function xe(i,t,e,s,n){let o=i.getSortedVisibleDatasetMetas(),a=e[t];for(let r=0,l=o.length;r{l[a]&&l[a](t[e],n)&&(o.push({element:l,datasetIndex:h,index:d}),r=r||l.inRange(t.x,t.y,n))}),s&&!r?[]:o}var mn={evaluateInteractionItems:xe,modes:{index(i,t,e,s){let n=It(t,i),o=e.axis||"x",a=e.includeInvisible||!1,r=e.intersect?ji(i,n,o,s,a):$i(i,n,o,!1,s,a),l=[];return r.length?(i.getSortedVisibleDatasetMetas().forEach(h=>{let d=r[0].index,c=h.data[d];c&&!c.skip&&l.push({element:c,datasetIndex:h.index,index:d})}),l):[]},dataset(i,t,e,s){let n=It(t,i),o=e.axis||"xy",a=e.includeInvisible||!1,r=e.intersect?ji(i,n,o,s,a):$i(i,n,o,!1,s,a);if(r.length>0){let l=r[0].datasetIndex,h=i.getDatasetMeta(l).data;r=[];for(let d=0;dji(i,It(t,i),e.axis||"xy",s,e.includeInvisible||!1),nearest(i,t,e,s){let n=It(t,i),o=e.axis||"xy",a=e.includeInvisible||!1;return $i(i,n,o,e.intersect,s,a)},x:(i,t,e,s)=>pn(i,It(t,i),"x",e.intersect,s),y:(i,t,e,s)=>pn(i,It(t,i),"y",e.intersect,s)}};let bn=["left","top","right","bottom"];function _e(i,t){return i.filter(e=>e.pos===t)}function xn(i,t){return i.filter(e=>bn.indexOf(e.pos)===-1&&e.box.axis===t)}function ye(i,t){return i.sort((e,s)=>{let n=t?s:e,o=t?e:s;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Sa(i,t){let e=function(l){let h={};for(let d of l){let{stack:c,pos:u,stackWeight:f}=d;if(!c||!bn.includes(u))continue;let p=h[c]||(h[c]={count:0,placed:0,weight:0,size:0});p.count++,p.weight+=f}return h}(i),{vBoxMaxWidth:s,hBoxMaxHeight:n}=t,o,a,r;for(o=0,a=i.length;o{o[a]=Math.max(t[a],e[a])}),o}return s(i?["left","right"]:["top","bottom"])}function ve(i,t,e,s){let n=[],o,a,r,l,h,d;for(o=0,a=i.length,h=0;ok.box.fullSize),!0),y=ye(_e(m,"left"),!0),_=ye(_e(m,"right")),x=ye(_e(m,"top"),!0),v=ye(_e(m,"bottom")),w=xn(m,"x"),M=xn(m,"y");return{fullSize:b,leftAndTop:y.concat(x),rightAndBottom:_.concat(M).concat(v).concat(w),chartArea:_e(m,"chartArea"),vertical:y.concat(_).concat(M),horizontal:x.concat(v).concat(w)}}(i.boxes),l=r.vertical,h=r.horizontal;B(i.boxes,g=>{typeof g.beforeLayout=="function"&&g.beforeLayout()});let d=l.reduce((g,m)=>m.box.options&&m.box.options.display===!1?g:g+1,0)||1,c=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/d,hBoxMaxHeight:a/2}),u=Object.assign({},n);yn(u,et(s));let f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),p=Sa(l.concat(h),c);ve(r.fullSize,f,c,p),ve(l,f,c,p),ve(h,f,c,p)&&ve(l,f,c,p),function(g){let m=g.maxPadding;function b(y){let _=Math.max(m[y]-g[y],0);return g[y]+=_,_}g.y+=b("top"),g.x+=b("left"),b("right"),b("bottom")}(f),vn(r.leftAndTop,f,c,p),f.x+=f.w,f.y+=f.h,vn(r.rightAndBottom,f,c,p),i.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},B(r.chartArea,g=>{let m=g.box;Object.assign(m,i.chartArea),m.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class Yi{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,s){}removeEventListener(t,e,s){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,s,n){return e=Math.max(0,e||t.width),s=s||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):s)}}isAttached(t){return!0}updateConfig(t){}}class wn extends Yi{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}let Ge="$chartjs",Ca={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Mn=i=>i===null||i==="",kn=!!js&&{passive:!0};function Oa(i,t,e){i&&i.canvas&&i.canvas.removeEventListener(t,e,kn)}function Ze(i,t){for(let e of i)if(e===t||e.contains(t))return!0}function Aa(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||Ze(r.addedNodes,s),a=a&&!Ze(r.removedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Ta(i,t,e){let s=i.canvas,n=new MutationObserver(o=>{let a=!1;for(let r of o)a=a||Ze(r.removedNodes,s),a=a&&!Ze(r.addedNodes,s);a&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}let we=new Map,Sn=0;function Pn(){let i=window.devicePixelRatio;i!==Sn&&(Sn=i,we.forEach((t,e)=>{e.currentDevicePixelRatio!==i&&t()}))}function La(i,t,e){let s=i.canvas,n=s&&We(s);if(!n)return;let o=_i((r,l)=>{let h=n.clientWidth;e(r,l),h{let l=r[0],h=l.contentRect.width,d=l.contentRect.height;h===0&&d===0||o(h,d)});return a.observe(n),function(r,l){we.size||window.addEventListener("resize",Pn),we.set(r,l)}(i,o),a}function Ui(i,t,e){e&&e.disconnect(),t==="resize"&&function(s){we.delete(s),we.size||window.removeEventListener("resize",Pn)}(i)}function Ea(i,t,e){let s=i.canvas,n=_i(o=>{i.ctx!==null&&e(function(a,r){let l=Ca[a.type]||a.type,{x:h,y:d}=It(a,r);return{type:l,chart:r,native:a,x:h!==void 0?h:null,y:d!==void 0?d:null}}(o,i))},i);return function(o,a,r){o&&o.addEventListener(a,r,kn)}(s,t,n),n}class Dn extends Yi{acquireContext(t,e){let s=t&&t.getContext&&t.getContext("2d");return s&&s.canvas===t?(function(n,o){let a=n.style,r=n.getAttribute("height"),l=n.getAttribute("width");if(n[Ge]={initial:{height:r,width:l,style:{display:a.display,height:a.height,width:a.width}}},a.display=a.display||"block",a.boxSizing=a.boxSizing||"border-box",Mn(l)){let h=Ti(n,"width");h!==void 0&&(n.width=h)}if(Mn(r))if(n.style.height==="")n.height=n.width/(o||2);else{let h=Ti(n,"height");h!==void 0&&(n.height=h)}}(t,e),s):null}releaseContext(t){let e=t.canvas;if(!e[Ge])return!1;let s=e[Ge].initial;["height","width"].forEach(o=>{let a=s[o];I(a)?e.removeAttribute(o):e.setAttribute(o,a)});let n=s.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Ge],!0}addEventListener(t,e,s){this.removeEventListener(t,e);let n=t.$proxies||(t.$proxies={}),o={attach:Aa,detach:Ta,resize:La}[e]||Ea;n[e]=o(t,e,s)}removeEventListener(t,e){let s=t.$proxies||(t.$proxies={}),n=s[e];n&&(({attach:Ui,detach:Ui,resize:Ui}[e]||Oa)(t,e,n),s[e]=void 0)}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,s,n){return Hs(t,e,s,n)}isAttached(t){let e=t&&We(t);return!(!e||!e.isConnected)}}function Cn(i){return!Be()||typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas?wn:Dn}var On=Object.freeze({__proto__:null,BasePlatform:Yi,BasicPlatform:wn,DomPlatform:Dn,_detectPlatform:Cn});let An="transparent",Ra={boolean:(i,t,e)=>e>.5?t:i,color(i,t,e){let s=Di(i||An),n=s.valid&&Di(t||An);return n&&n.valid?n.mix(s,e).hexString():t},number:(i,t,e)=>i+(t-i)*e};class Tn{constructor(t,e,s,n){let o=e[s];n=re([t.to,n,o,t.from]);let a=re([t.from,o,n]);this._active=!0,this._fn=t.fn||Ra[t.type||typeof a],this._easing=ae[t.easing]||ae.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=s,this._from=a,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,s){if(this._active){this._notify(!1);let n=this._target[this._prop],o=s-this._start,a=this._duration-o;this._start=s,this._duration=Math.floor(Math.max(a,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=re([t.to,e,n,t.from]),this._from=re([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){let e=t-this._start,s=this._duration,n=this._prop,o=this._from,a=this._loop,r=this._to,l;if(this._active=o!==r&&(a||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,r,l))}wait(){let t=this._promises||(this._promises=[]);return new Promise((e,s)=>{t.push({res:e,rej:s})})}_notify(t){let e=t?"res":"rej",s=this._promises||[];for(let n=0;n{let o=t[n];if(!z(o))return;let a={};for(let r of e)a[r]=o[r];(F(o.properties)&&o.properties||[n]).forEach(r=>{r!==n&&s.has(r)||s.set(r,a)})})}_animateOptions(t,e){let s=e.options,n=function(a,r){if(!r)return;let l=a.options;return l?(l.$shared&&(a.options=l=Object.assign({},l,{$shared:!1,$animations:{}})),l):void(a.options=r)}(t,s);if(!n)return[];let o=this._createAnimations(n,s);return s.$shared&&function(a,r){let l=[],h=Object.keys(r);for(let d=0;d{t.options=s},()=>{}),o}_createAnimations(t,e){let s=this._properties,n=[],o=t.$animations||(t.$animations={}),a=Object.keys(e),r=Date.now(),l;for(l=a.length-1;l>=0;--l){let h=a[l];if(h.charAt(0)==="$")continue;if(h==="options"){n.push(...this._animateOptions(t,e));continue}let d=e[h],c=o[h],u=s.get(h);if(c){if(u&&c.active()){c.update(u,d,r);continue}c.cancel()}u&&u.duration?(o[h]=c=new Tn(u,t,h,d),n.push(c)):t[h]=d}return n}update(t,e){if(this._properties.size===0)return void Object.assign(t,e);let s=this._createAnimations(t,e);return s.length?(vt.add(this._chart,s),!0):void 0}}function Ln(i,t){let e=i&&i.options||{},s=e.reverse,n=e.min===void 0?t:0,o=e.max===void 0?t:0;return{start:s?o:n,end:s?n:o}}function En(i,t){let e=[],s=i._getSortedDatasetMetas(t),n,o;for(n=0,o=s.length;n0||!e&&o<0)return n.index}return null}function zn(i,t){let{chart:e,_cachedMeta:s}=i,n=e._stacks||(e._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,d=function(f,p,g){return`${f.id}.${p.id}.${g.stack||g.type}`}(o,a,s),c=t.length,u;for(let f=0;fe[s].axis===t).shift()}function Me(i,t){let e=i.controller.index,s=i.vScale&&i.vScale.axis;if(s){t=t||i._parsed;for(let n of t){let o=n._stacks;if(!o||o[s]===void 0||o[s][e]===void 0)return;delete o[s][e],o[s]._visualValues!==void 0&&o[s]._visualValues[e]!==void 0&&delete o[s]._visualValues[e]}}}let Gi=i=>i==="reset"||i==="none",Fn=(i,t)=>t?i:Object.assign({},i);class At{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){let t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=qi(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&Me(this._cachedMeta),this.index=t}linkScales(){let t=this.chart,e=this._cachedMeta,s=this.getDataset(),n=(c,u,f,p)=>c==="x"?u:c==="r"?p:f,o=e.xAxisID=E(s.xAxisID,Ki(t,"x")),a=e.yAxisID=E(s.yAxisID,Ki(t,"y")),r=e.rAxisID=E(s.rAxisID,Ki(t,"r")),l=e.indexAxis,h=e.iAxisID=n(l,o,a,r),d=e.vAxisID=n(l,a,o,r);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(a),e.rScale=this.getScaleForId(r),e.iScale=this.getScaleForId(h),e.vScale=this.getScaleForId(d)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){let e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){let t=this._cachedMeta;this._data&&mi(this._data,this),t._stacked&&Me(t)}_dataCheck(){let t=this.getDataset(),e=t.data||(t.data=[]),s=this._data;if(z(e)){let n=this._cachedMeta;this._data=function(o,a){let{iScale:r,vScale:l}=a,h=r.axis==="x"?"x":"y",d=l.axis==="x"?"x":"y",c=Object.keys(o),u=new Array(c.length),f,p,g;for(f=0,p=c.length;f0&&s._parsed[t-1];if(this._parsing===!1)s._parsed=n,s._sorted=!0,d=n;else{d=F(n[t])?this.parseArrayData(s,n,t,e):z(n[t])?this.parseObjectData(s,n,t,e):this.parsePrimitiveData(s,n,t,e);let f=()=>h[r]===null||u&&h[r]g&&!m.hidden&&m._stacked&&{keys:En(b,!0),values:null})(e,s,this.chart),h={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:d,max:c}=function(g){let{min:m,max:b,minDefined:y,maxDefined:_}=g.getUserBounds();return{min:y?m:Number.NEGATIVE_INFINITY,max:_?b:Number.POSITIVE_INFINITY}}(r),u,f;function p(){f=n[u];let g=f[r.axis];return!L(f[t.axis])||d>g||c=0;--u)if(!p()){this.updateRangeFromParsed(h,t,f,l);break}}return h}getAllParsedValues(t){let e=this._cachedMeta._parsed,s=[],n,o,a;for(n=0,o=e.length;n=0&&tthis.getContext(s,n,e),c);return p.$shared&&(p.$shared=l,o[a]=Object.freeze(Fn(p,l))),p}_resolveAnimations(t,e,s){let n=this.chart,o=this._cachedDataOpts,a=`animation-${e}`,r=o[a];if(r)return r;let l;if(n.options.animation!==!1){let d=this.chart.config,c=d.datasetAnimationScopeKeys(this._type,e),u=d.getOptionScopes(this.getDataset(),c);l=d.createResolver(u,this.getContext(t,s,e))}let h=new Xi(n,l&&l.animations);return l&&l._cacheable&&(o[a]=Object.freeze(h)),h}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||Gi(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){let s=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(s),a=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,s),{sharedOptions:o,includeOptions:a}}updateElement(t,e,s,n){Gi(n)?Object.assign(t,s):this._resolveAnimations(e,n).update(t,s)}updateSharedOptions(t,e,s){t&&!Gi(e)&&this._resolveAnimations(void 0,e).update(t,s)}_setStyle(t,e,s,n){t.active=n;let o=this.getStyle(e,n);this._resolveAnimations(e,s,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,s){this._setStyle(t,s,"active",!1)}setHoverStyle(t,e,s){this._setStyle(t,s,"active",!0)}_removeDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){let t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){let e=this._data,s=this._cachedMeta.data;for(let[r,l,h]of this._syncList)this[r](l,h);this._syncList=[];let n=s.length,o=e.length,a=Math.min(o,n);a&&this.parse(0,a),o>n?this._insertElements(n,o-n,t):o{for(h.length+=e,r=h.length-1;r>=a;r--)h[r]=h[r-e]};for(l(o),r=t;r{n[o]=s[o]&&s[o].active()?s[o]._to:this[o]}),n}}function za(i,t){let e=i.options.ticks,s=function(c){let u=c.options.offset,f=c._tickSize(),p=c._length/f+(u?0:1),g=c._maxLength/f;return Math.floor(Math.min(p,g))}(i),n=Math.min(e.maxTicksLimit||s,s),o=e.major.enabled?function(c){let u=[],f,p;for(f=0,p=c.length;fn)return function(c,u,f,p){let g,m=0,b=f[0];for(p=Math.ceil(p),g=0;gg)return _}return Math.max(g,1)}(o,t,n);if(a>0){let c,u,f=a>1?Math.round((l-r)/(a-1)):null;for(Je(t,h,d,I(f)?0:r-f,r),c=0,u=a-1;ct==="top"||t==="left"?i[t]+e:i[t]-e,Bn=(i,t)=>Math.min(t||i,i);function Wn(i,t){let e=[],s=i.length/t,n=i.length,o=0;for(;oa+r)))return h}function ke(i){return i.drawTicks?i.tickLength:0}function Nn(i,t){if(!i.display)return 0;let e=J(i.font,t),s=et(i.padding);return(F(i.text)?i.text.length:1)*e.lineHeight+s.height}function Va(i,t,e){let s=Ee(i);return(e&&t!=="right"||!e&&t==="right")&&(s=(n=>n==="left"?"right":n==="right"?"left":n)(s)),s}class Wt extends Mt{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:s,_suggestedMax:n}=this;return t=X(t,Number.POSITIVE_INFINITY),e=X(e,Number.NEGATIVE_INFINITY),s=X(s,Number.POSITIVE_INFINITY),n=X(n,Number.NEGATIVE_INFINITY),{min:X(t,s),max:X(e,n),minDefined:L(t),maxDefined:L(e)}}getMinMax(t){let e,{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();if(o&&a)return{min:s,max:n};let r=this.getMatchingVisibleMetas();for(let l=0,h=r.length;ln?n:s,n=o&&s>n?s:n,{min:X(s,X(n,s)),max:X(n,X(s,n))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){let t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){N(this.options.beforeUpdate,[this])}update(t,e,s){let{beginAtZero:n,grace:o,ticks:a}=this.options,r=a.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=s=Object.assign({left:0,right:0,top:0,bottom:0},s),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+s.left+s.right:this.height+s.top+s.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=hn(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();let l=r=o||s<=1||!this.isHorizontal())return void(this.labelRotation=n);let d=this._getLabelSizes(),c=d.widest.width,u=d.highest.height,f=Q(this.chart.width-c,0,this.maxWidth);a=t.offset?this.maxWidth/s:f/(s-1),c+6>a&&(a=f/(s-(t.offset?.5:1)),r=this.maxHeight-ke(t.grid)-e.padding-Nn(t.title,this.chart.options.font),l=Math.sqrt(c*c+u*u),h=Ae(Math.min(Math.asin(Q((d.highest.height+6)/a,-1,1)),Math.asin(Q(r/l,-1,1))-Math.asin(Q(u/l,-1,1)))),h=Math.max(n,Math.min(o,h))),this.labelRotation=h}afterCalculateLabelRotation(){N(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){N(this.options.beforeFit,[this])}fit(){let t={width:0,height:0},{chart:e,options:{ticks:s,title:n,grid:o}}=this,a=this._isVisible(),r=this.isHorizontal();if(a){let l=Nn(n,e.options.font);if(r?(t.width=this.maxWidth,t.height=ke(o)+l):(t.height=this.maxHeight,t.width=ke(o)+l),s.display&&this.ticks.length){let{first:h,last:d,widest:c,highest:u}=this._getLabelSizes(),f=2*s.padding,p=ct(this.labelRotation),g=Math.cos(p),m=Math.sin(p);if(r){let b=s.mirror?0:m*c.width+g*u.height;t.height=Math.min(this.maxHeight,t.height+b+f)}else{let b=s.mirror?0:g*c.width+m*u.height;t.width=Math.min(this.maxWidth,t.width+b+f)}this._calculatePadding(h,d,m,g)}}this._handleMargins(),r?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,s,n){let{ticks:{align:o,padding:a},position:r}=this.options,l=this.labelRotation!==0,h=r!=="top"&&this.axis==="x";if(this.isHorizontal()){let d=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1),u=0,f=0;l?h?(u=n*t.width,f=s*e.height):(u=s*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-d+a)*this.width/(this.width-d),0),this.paddingRight=Math.max((f-c+a)*this.width/(this.width-c),0)}else{let d=e.height/2,c=t.height/2;o==="start"?(d=0,c=t.height):o==="end"&&(d=e.height,c=0),this.paddingTop=d+a,this.paddingBottom=c+a}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){N(this.options.afterFit,[this])}isHorizontal(){let{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,s;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,s=t.length;e{let A=T.gc,P=A.length/2,O;if(P>S){for(O=0;O({width:a[D]||0,height:r[D]||0});return{first:k(0),last:k(e-1),widest:k(w),highest:k(M),widths:a,heights:r}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){let e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);let e=this._startPixel+t*this._length;return Ss(this._alignToPixels?zt(this.chart,e,0):e)}getDecimalForPixel(t){let e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){let{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){let e=this.ticks||[];if(t>=0&&tr*n?r/s:l/n:l*n0}_computeGridLineItems(t){let e=this.axis,s=this.chart,n=this.options,{grid:o,position:a,border:r}=n,l=o.offset,h=this.isHorizontal(),d=this.ticks.length+(l?1:0),c=ke(o),u=[],f=r.setContext(this.getContext()),p=f.display?f.width:0,g=p/2,m=function(C){return zt(s,C,p)},b,y,_,x,v,w,M,k,D,S,T,A;if(a==="top")b=m(this.bottom),w=this.bottom-c,k=b-g,S=m(t.top)+g,A=t.bottom;else if(a==="bottom")b=m(this.top),S=t.top,A=m(t.bottom)-g,w=b+g,k=this.top+c;else if(a==="left")b=m(this.right),v=this.right-c,M=b-g,D=m(t.left)+g,T=t.right;else if(a==="right")b=m(this.left),D=t.left,T=m(t.right)-g,v=b+g,M=this.left+c;else if(e==="x"){if(a==="center")b=m((t.top+t.bottom)/2+.5);else if(z(a)){let C=Object.keys(a)[0],R=a[C];b=m(this.chart.scales[C].getPixelForValue(R))}S=t.top,A=t.bottom,w=b+g,k=w+c}else if(e==="y"){if(a==="center")b=m((t.left+t.right)/2);else if(z(a)){let C=Object.keys(a)[0],R=a[C];b=m(this.chart.scales[C].getPixelForValue(R))}v=b-g,M=v-c,D=t.left,T=t.right}let P=E(n.ticks.maxTicksLimit,d),O=Math.max(1,Math.ceil(d/P));for(y=0;y0&&(xt-=mt/2)}rt={left:xt,top:bt,width:mt+ut.width,height:pt+ut.height,color:C.backdropColor}}m.push({label:x,font:D,textOffset:A,options:{rotation:g,color:H,strokeColor:V,strokeWidth:st,textAlign:lt,textBaseline:P,translation:[v,w],backdrop:rt}})}return m}_getXAxisLabelAlignment(){let{position:t,ticks:e}=this.options;if(-ct(this.labelRotation))return t==="top"?"left":"right";let s="center";return e.align==="start"?s="left":e.align==="end"?s="right":e.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(t){let{position:e,ticks:{crossAlign:s,mirror:n,padding:o}}=this.options,a=t+o,r=this._getLabelSizes().widest.width,l,h;return e==="left"?n?(h=this.right+o,s==="near"?l="left":s==="center"?(l="center",h+=r/2):(l="right",h+=r)):(h=this.right-a,s==="near"?l="right":s==="center"?(l="center",h-=r/2):(l="left",h=this.left)):e==="right"?n?(h=this.left+o,s==="near"?l="right":s==="center"?(l="center",h-=r/2):(l="left",h-=r)):(h=this.left+a,s==="near"?l="left":s==="center"?(l="center",h+=r/2):(l="right",h=this.right)):l="right",{textAlign:l,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;let t=this.chart,e=this.options.position;return e==="left"||e==="right"?{top:0,left:this.left,bottom:t.height,right:this.right}:e==="top"||e==="bottom"?{top:this.top,left:0,bottom:this.bottom,right:t.width}:void 0}drawBackground(){let{ctx:t,options:{backgroundColor:e},left:s,top:n,width:o,height:a}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(s,n,o,a),t.restore())}getLineWidthForValue(t){let e=this.options.grid;if(!this._isVisible()||!e.display)return 0;let s=this.ticks.findIndex(n=>n.value===t);return s>=0?e.setContext(this.getContext(s)).lineWidth:0}drawGrid(t){let e=this.options.grid,s=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t)),o,a,r=(l,h,d)=>{d.width&&d.color&&(s.save(),s.lineWidth=d.width,s.strokeStyle=d.color,s.setLineDash(d.borderDash||[]),s.lineDashOffset=d.borderDashOffset,s.beginPath(),s.moveTo(l.x,l.y),s.lineTo(h.x,h.y),s.stroke(),s.restore())};if(e.display)for(o=0,a=n.length;o{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]:[{z:e,draw:o=>{this.draw(o)}}]}getMatchingVisibleMetas(t){let e=this.chart.getSortedVisibleDatasetMetas(),s=this.axis+"AxisID",n=[],o,a;for(o=0,a=e.length;o{let p=f.split("."),g=p.pop(),m=[c].concat(p).join("."),b=u[f].split("."),y=b.pop(),_=b.join(".");U.route(m,g,_,y)})}(l,r.defaultRoutes),r.descriptors&&U.describe(l,r.descriptors)}(t,a,s),this.override&&U.override(t.id,t.overrides)),a}get(t){return this.items[t]}unregister(t){let e=this.items,s=t.id,n=this.scope;s in e&&delete e[s],n&&s in U[n]&&(delete U[n][s],this.override&&delete Yt[s])}}class Ba{constructor(){this.controllers=new Qe(At,"datasets",!0),this.elements=new Qe(Mt,"elements"),this.plugins=new Qe(Object,"plugins"),this.scales=new Qe(Wt,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,s){[...e].forEach(n=>{let o=s||this._getRegistryForType(n);s||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):B(n,a=>{let r=s||this._getRegistryForType(a);this._exec(t,r,a)})})}_exec(t,e,s){let n=Oe(t);N(s["before"+n],[],s),e[t](s),N(s["after"+n],[],s)}_getRegistryForType(t){for(let e=0;eo.filter(r=>!a.some(l=>r.plugin.id===l.plugin.id));this._notify(n(e,s),t,"stop"),this._notify(n(s,e),t,"start")}}function Na(i,t){return t||i!==!1?i===!0?{}:i:null}function Ha(i,{plugin:t,local:e},s,n){let o=i.pluginScopeKeys(t),a=i.getOptionScopes(s,o);return e&&t.defaults&&a.push(t.defaults),i.createResolver(a,n,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Zi(i,t){let e=U.datasets[i]||{};return((t.datasets||{})[i]||{}).indexAxis||t.indexAxis||e.indexAxis||"x"}function Hn(i){if(i==="x"||i==="y"||i==="r")return i}function Ji(i,...t){if(Hn(i))return i;for(let s of t){let n=s.axis||((e=s.position)==="top"||e==="bottom"?"x":e==="left"||e==="right"?"y":void 0)||i.length>1&&Hn(i[0].toLowerCase());if(n)return n}var e;throw new Error(`Cannot determine type of '${i}' axis. Please provide 'axis' or 'position' option.`)}function jn(i,t,e){if(e[t+"AxisID"]===i)return{axis:t}}function ja(i,t){let e=Yt[i.type]||{scales:{}},s=t.scales||{},n=Zi(i.type,t),o=Object.create(null);return Object.keys(s).forEach(a=>{let r=s[a];if(!z(r))return console.error(`Invalid scale configuration for scale: ${a}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${a}`);let l=Ji(a,r,function(c,u){if(u.data&&u.data.datasets){let f=u.data.datasets.filter(p=>p.xAxisID===c||p.yAxisID===c);if(f.length)return jn(c,"x",f[0])||jn(c,"y",f[0])}return{}}(a,i),U.scales[r.type]),h=function(c,u){return c===u?"_index_":"_value_"}(l,n),d=e.scales||{};o[a]=Jt(Object.create(null),[{axis:l},r,d[l],d[h]])}),i.data.datasets.forEach(a=>{let r=a.type||i.type,l=a.indexAxis||Zi(r,t),h=(Yt[r]||{}).scales||{};Object.keys(h).forEach(d=>{let c=function(f,p){let g=f;return f==="_index_"?g=p:f==="_value_"&&(g=p==="x"?"y":"x"),g}(d,l),u=a[c+"AxisID"]||c;o[u]=o[u]||Object.create(null),Jt(o[u],[{axis:c},s[u],h[d]])})}),Object.keys(o).forEach(a=>{let r=o[a];Jt(r,[U.scales[r.type],U.scale])}),o}function $n(i){let t=i.options||(i.options={});t.plugins=E(t.plugins,{}),t.scales=ja(i,t)}function Yn(i){return(i=i||{}).datasets=i.datasets||[],i.labels=i.labels||[],i}let Un=new Map,Xn=new Set;function ti(i,t){let e=Un.get(i);return e||(e=t(),Un.set(i,e),Xn.add(e)),e}let Se=(i,t,e)=>{let s=St(t,e);s!==void 0&&i.add(s)};class $a{constructor(t){this._config=function(e){return(e=e||{}).data=Yn(e.data),$n(e),e}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Yn(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){let t=this._config;this.clearCache(),$n(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return ti(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return ti(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return ti(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){let e=t.id;return ti(`${this.type}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){let s=this._scopeCache,n=s.get(t);return n&&!e||(n=new Map,s.set(t,n)),n}getOptionScopes(t,e,s){let{options:n,type:o}=this,a=this._cachedScopes(t,s),r=a.get(e);if(r)return r;let l=new Set;e.forEach(d=>{t&&(l.add(t),d.forEach(c=>Se(l,t,c))),d.forEach(c=>Se(l,n,c)),d.forEach(c=>Se(l,Yt[o]||{},c)),d.forEach(c=>Se(l,U,c)),d.forEach(c=>Se(l,Ci,c))});let h=Array.from(l);return h.length===0&&h.push(Object.create(null)),Xn.has(e)&&a.set(e,h),h}chartOptionScopes(){let{options:t,type:e}=this;return[t,Yt[e]||{},U.datasets[e]||{},{type:e},U,Ci]}resolveNamedOptions(t,e,s,n=[""]){let o={$shared:!0},{resolver:a,subPrefixes:r}=qn(this._resolverCache,t,n),l=a;(function(h,d){let{isScriptable:c,isIndexable:u}=Ri(h);for(let f of d){let p=c(f),g=u(f),m=(g||p)&&h[f];if(p&&(Pt(m)||Ya(m))||g&&F(m))return!0}return!1})(a,e)&&(o.$shared=!1,l=Xt(a,s=Pt(s)?s():s,this.createResolver(t,s,r)));for(let h of e)o[h]=l[h];return o}createResolver(t,e,s=[""],n){let{resolver:o}=qn(this._resolverCache,t,s);return z(e)?Xt(o,e,void 0,n):o}}function qn(i,t,e){let s=i.get(t);s||(s=new Map,i.set(t,s));let n=e.join(),o=s.get(n);return o||(o={resolver:Ye(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},s.set(n,o)),o}let Ya=i=>z(i)&&Object.getOwnPropertyNames(i).some(t=>Pt(i[t])),Ua=["top","bottom","left","right","chartArea"];function Kn(i,t){return i==="top"||i==="bottom"||Ua.indexOf(i)===-1&&t==="x"}function Gn(i,t){return function(e,s){return e[i]===s[i]?e[t]-s[t]:e[i]-s[i]}}function Zn(i){let t=i.chart,e=t.options.animation;t.notifyPlugins("afterRender"),N(e&&e.onComplete,[i],t)}function Xa(i){let t=i.chart,e=t.options.animation;N(e&&e.onProgress,[i],t)}function Jn(i){return Be()&&typeof i=="string"?i=document.getElementById(i):i&&i.length&&(i=i[0]),i&&i.canvas&&(i=i.canvas),i}let ei={},Qn=i=>{let t=Jn(i);return Object.values(ei).filter(e=>e.canvas===t).pop()};function qa(i,t,e){let s=Object.keys(i);for(let n of s){let o=+n;if(o>=t){let a=i[n];delete i[n],(e>0||o>t)&&(i[o+e]=a)}}}function ii(i,t,e){return i.options.clip?i[e]:t[e]}class K{static defaults=U;static instances=ei;static overrides=Yt;static registry=gt;static version="4.4.8";static getChart=Qn;static register(...t){gt.add(...t),to()}static unregister(...t){gt.remove(...t),to()}constructor(t,e){let s=this.config=new $a(e),n=Jn(t),o=Qn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");let a=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||Cn(n)),this.platform.updateConfig(s);let r=this.platform.acquireContext(n,a.aspectRatio),l=r&&r.canvas,h=l&&l.height,d=l&&l.width;this.id=ht(),this.ctx=r,this.canvas=l,this.width=d,this.height=h,this._options=a,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Wa,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=As(c=>this.update(c),a.resizeDelay||0),this._dataChanges=[],ei[this.id]=this,r&&l?(vt.listen(this,"complete",Zn),vt.listen(this,"progress",Xa),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){let{options:{aspectRatio:t,maintainAspectRatio:e},width:s,height:n,_aspectRatio:o}=this;return I(t)?e&&o?o:n?s/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Ai(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Li(this.canvas,this.ctx),this}stop(){return vt.stop(this),this}resize(t,e){vt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){let s=this.options,n=this.canvas,o=s.maintainAspectRatio&&this.aspectRatio,a=this.platform.getMaximumSize(n,t,e,o),r=s.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=a.width,this.height=a.height,this._aspectRatio=this.aspectRatio,Ai(this,r,!0)&&(this.notifyPlugins("resize",{size:a}),N(s.onResize,[this,a],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){B(this.options.scales||{},(t,e)=>{t.id=e})}buildOrUpdateScales(){let t=this.options,e=t.scales,s=this.scales,n=Object.keys(s).reduce((a,r)=>(a[r]=!1,a),{}),o=[];e&&(o=o.concat(Object.keys(e).map(a=>{let r=e[a],l=Ji(a,r),h=l==="r",d=l==="x";return{options:r,dposition:h?"chartArea":d?"bottom":"left",dtype:h?"radialLinear":d?"category":"linear"}}))),B(o,a=>{let r=a.options,l=r.id,h=Ji(l,r),d=E(r.type,a.dtype);r.position!==void 0&&Kn(r.position,h)===Kn(a.dposition)||(r.position=a.dposition),n[l]=!0;let c=null;l in s&&s[l].type===d?c=s[l]:(c=new(gt.getScale(d))({id:l,type:d,ctx:this.ctx,chart:this}),s[c.id]=c),c.init(r,t)}),B(n,(a,r)=>{a||delete s[r]}),B(s,a=>{it.configure(this,a,a.options),it.addBox(this,a)})}_updateMetasets(){let t=this._metasets,e=this.data.datasets.length,s=t.length;if(t.sort((n,o)=>n.index-o.index),s>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((s,n)=>{e.filter(o=>o===s._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){let t=[],e=this.data.datasets,s,n;for(this._removeUnreferencedMetasets(),s=0,n=e.length;s{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){let e=this.config;e.update();let s=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!s.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;let o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let a=0;for(let h=0,d=this.data.datasets.length;h{h.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(Gn("z","_idx"));let{_active:r,_lastEvent:l}=this;l?this._eventHandler(l,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){B(this.scales,t=>{it.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){let t=this.options,e=new Set(Object.keys(this._listeners)),s=new Set(t.events);ci(e,s)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){let{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(let{method:s,start:n,count:o}of e)qa(t,n,s==="_removeElements"?-o:o)}_getUniformDataChanges(){let t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];let e=this.data.datasets.length,s=o=>new Set(t.filter(a=>a[0]===o).map((a,r)=>r+","+a.splice(1).join(","))),n=s(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;it.update(this,this.width,this.height,t);let e=this.chartArea,s=e.width<=0||e.height<=0;this._layers=[],B(this.boxes,n=>{s&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,s=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){let e=this.ctx,s=t._clip,n=!s.disabled,o=function(r,l){let{xScale:h,yScale:d}=r;return h&&d?{left:ii(h,l,"left"),right:ii(h,l,"right"),top:ii(d,l,"top"),bottom:ii(d,l,"bottom")}:l}(t,this.chartArea),a={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",a)!==!1&&(n&&me(e,{left:s.left===!1?0:o.left-s.left,right:s.right===!1?this.width:o.right+s.right,top:s.top===!1?0:o.top-s.top,bottom:s.bottom===!1?this.height:o.bottom+s.bottom}),t.controller.draw(),n&&be(e),a.cancelable=!1,this.notifyPlugins("afterDatasetDraw",a))}isPointInArea(t){return wt(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,s,n){let o=mn.modes[e];return typeof o=="function"?o(this,t,s,n):[]}getDatasetMeta(t){let e=this.data.datasets[t],s=this._metasets,n=s.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},s.push(n)),n}getContext(){return this.$context||(this.$context=Ot(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){let e=this.data.datasets[t];if(!e)return!1;let s=this.getDatasetMeta(t);return typeof s.hidden=="boolean"?!s.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,s){let n=s?"show":"hide",o=this.getDatasetMeta(t),a=o.controller._resolveAnimations(void 0,n);Qt(e)?(o.data[e].hidden=!s,this.update()):(this.setDatasetVisibility(t,s),a.update(o,{visible:s}),this.update(r=>r.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){let e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),vt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,a),t[o]=a},n=(o,a,r)=>{o.offsetX=a,o.offsetY=r,this._eventHandler(o)};B(this.options.events,o=>s(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});let t=this._responsiveListeners,e=this.platform,s=(l,h)=>{e.addEventListener(this,l,h),t[l]=h},n=(l,h)=>{t[l]&&(e.removeEventListener(this,l,h),delete t[l])},o=(l,h)=>{this.canvas&&this.resize(l,h)},a,r=()=>{n("attach",r),this.attached=!0,this.resize(),s("resize",o),s("detach",a)};a=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),s("attach",r)},e.isAttached(this.canvas)?r():a()}unbindEvents(){B(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},B(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,s){let n=s?"set":"remove",o,a,r,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),r=0,l=t.length;r{let a=this.getDatasetMeta(n);if(!a)throw new Error("No dataset found at index "+n);return{datasetIndex:n,element:a.data[o],index:o}});!Ht(s,e)&&(this._active=s,this._lastEvent=null,this._updateHoverStyles(s,e))}notifyPlugins(t,e,s){return this._plugins.notify(this,t,e,s)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,s){let n=this.options.hover,o=(l,h)=>l.filter(d=>!h.some(c=>d.datasetIndex===c.datasetIndex&&d.index===c.index)),a=o(e,t),r=s?t:o(t,e);a.length&&this.updateHoverStyle(a,n.mode,!1),r.length&&n.mode&&this.updateHoverStyle(r,n.mode,!0)}_eventHandler(t,e){let s={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=a=>(a.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",s,n)===!1)return;let o=this._handleEvent(t,e,s.inChartArea);return s.cancelable=!1,this.notifyPlugins("afterEvent",s,n),(o||s.changed)&&this.render(),this}_handleEvent(t,e,s){let{_active:n=[],options:o}=this,a=e,r=this._getActiveElements(t,n,s,a),l=_s(t),h=function(c,u,f,p){return f&&c.type!=="mouseout"?p?u:c:null}(t,this._lastEvent,s,l);s&&(this._lastEvent=null,N(o.onHover,[t,r,this],this),l&&N(o.onClick,[t,r,this],this));let d=!Ht(r,n);return(d||e)&&(this._active=r,this._updateHoverStyles(r,n,e)),this._lastEvent=h,d}_getActiveElements(t,e,s,n){if(t.type==="mouseout")return[];if(!s)return e;let o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}}function to(){return B(K.instances,i=>i._plugins.invalidate())}function Kt(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Qi{static override(t){Object.assign(Qi.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Kt()}parse(){return Kt()}format(){return Kt()}add(){return Kt()}diff(){return Kt()}startOf(){return Kt()}endOf(){return Kt()}}var eo={_date:Qi};function Ka(i){let t=i.iScale,e=function(h,d){if(!h._cache.$bar){let c=h.getMatchingVisibleMetas(d),u=[];for(let f=0,p=c.length;ff-p))}return h._cache.$bar}(t,i.type),s,n,o,a,r=t._length,l=()=>{o!==32767&&o!==-32768&&(Qt(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=e.length;sMath.abs(c)&&(u=c,f=d),o[a.axis]=f,o._custom={barStart:u,barEnd:f,start:l,end:h,min:d,max:c}}(i,t,e,s):t[e.axis]=e.parse(i,s),t}function so(i,t,e,s){let n=i.iScale,o=i.vScale,a=n.getLabels(),r=n===o,l=[],h,d,c,u;for(h=e,d=e+s;hc.x,f="left",p="right"):(u=c.baset!=="spacing",_indexable:t=>t!=="spacing"&&!t.startsWith("borderDash")&&!t.startsWith("hoverBorderDash")};static overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){let e=t.data;if(e.labels.length&&e.datasets.length){let{labels:{pointStyle:s,color:n}}=t.legend.options;return e.labels.map((o,a)=>{let r=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:n,lineWidth:r.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}}};constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){let s=this.getDataset().data,n=this._cachedMeta;if(this._parsing===!1)n._parsed=s;else{let o,a,r=l=>+s[l];if(z(s[t])){let{key:l="value"}=this._parsing;r=h=>+St(s[h],l)}for(o=t,a=t+e;oee(mt,A,P,!0)?1:Math.max(bt,bt*M,xt,xt*M),st=(mt,bt,xt)=>ee(mt,A,P,!0)?-1:Math.min(bt,bt*M,xt,xt*M),rt=V(0,O,R),lt=V(q,C,H),ut=st($,O,R),pt=st($+q,C,H);k=(rt-ut)/2,D=(lt-pt)/2,S=-(rt+ut)/2,T=-(lt+pt)/2}return{ratioX:k,ratioY:D,offsetX:S,offsetY:T}}(c,d,l),m=(s.width-a)/u,b=(s.height-a)/f,y=Math.max(Math.min(m,b)/2,0),_=Z(this.options.radius,y),x=(_-Math.max(_*l,0))/this._getVisibleDatasetWeightTotal();this.offsetX=p*_,this.offsetY=g*_,n.total=this.calculateTotal(),this.outerRadius=_-x*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-x*h,0),this.updateElements(o,0,o.length,t)}_circumference(t,e){let s=this.options,n=this._cachedMeta,o=this._getCircumference();return e&&s.animation.animateRotate||!this.chart.getDataVisibility(t)||n._parsed[t]===null||n.data[t].hidden?0:this.calculateCircumference(n._parsed[t]*o/Y)}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,r=a.chartArea,l=a.options.animation,h=(r.left+r.right)/2,d=(r.top+r.bottom)/2,c=o&&l.animateScale,u=c?0:this.innerRadius,f=c?0:this.outerRadius,{sharedOptions:p,includeOptions:g}=this._getSharedOptions(e,n),m,b=this._getRotation();for(m=0;m0&&!isNaN(t)?Y*(Math.abs(t)/e):0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=se(e._parsed[t],s.options.locale);return{label:n[t]||"",value:o}}getMaxBorderWidth(t){let e=0,s=this.chart,n,o,a,r,l;if(!t){for(n=0,o=s.data.datasets.length;n{let r=t.getDatasetMeta(0).controller.getStyle(a);return{text:o,fillStyle:r.backgroundColor,strokeStyle:r.borderColor,fontColor:n,lineWidth:r.borderWidth,pointStyle:s,hidden:!t.getDataVisibility(a),index:a}})}return[]}},onClick(t,e,s){s.chart.toggleDataVisibility(e.index),s.chart.update()}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){let e=this._cachedMeta,s=this.chart,n=s.data.labels||[],o=se(e._parsed[t].r,s.options.locale);return{label:n[t]||"",value:o}}parseObjectData(t,e,s,n){return Fi.bind(this)(t,e,s,n)}update(t){let e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}getMinMax(){let t=this._cachedMeta,e={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY};return t.data.forEach((s,n)=>{let o=this.getParsed(n).r;!isNaN(o)&&this.chart.getDataVisibility(n)&&(oe.max&&(e.max=o))}),e}_updateRadius(){let t=this.chart,e=t.chartArea,s=t.options,n=Math.min(e.right-e.left,e.bottom-e.top),o=Math.max(n/2,0),a=(o-Math.max(s.cutoutPercentage?o/100*s.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=o-a*this.index,this.innerRadius=this.outerRadius-a}updateElements(t,e,s,n){let o=n==="reset",a=this.chart,r=a.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,d=l.yCenter,c=l.getIndexAngle(0)-.5*$,u,f=c,p=360/this.countVisibleElements();for(u=0;u{!isNaN(this.getParsed(n).r)&&this.chart.getDataVisibility(n)&&e++}),e}_computeAngle(t,e,s){return this.chart.getDataVisibility(t)?ct(this.resolveDataElementOptions(t,e).angle||s):0}}var ro=Object.freeze({__proto__:null,BarController:class extends At{static id="bar";static defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};static overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};parsePrimitiveData(i,t,e,s){return so(i,t,e,s)}parseArrayData(i,t,e,s){return so(i,t,e,s)}parseObjectData(i,t,e,s){let{iScale:n,vScale:o}=i,{xAxisKey:a="x",yAxisKey:r="y"}=this._parsing,l=n.axis==="x"?a:r,h=o.axis==="x"?a:r,d=[],c,u,f,p;for(c=e,u=e+s;ch.controller.options.grouped),n=e.options.stacked,o=[],a=this._cachedMeta.controller.getParsed(t),r=a&&a[e.axis],l=h=>{let d=h._parsed.find(u=>u[e.axis]===r),c=d&&d[h.vScale.axis];if(I(c)||isNaN(c))return!0};for(let h of s)if((t===void 0||!l(h))&&((n===!1||o.indexOf(h.stack)===-1||n===void 0&&h.stack===void 0)&&o.push(h.stack),h.index===i))break;return o.length||o.push(void 0),o}_getStackCount(i){return this._getStacks(void 0,i).length}_getStackIndex(i,t,e){let s=this._getStacks(i,e),n=t!==void 0?s.indexOf(t):-1;return n===-1?s.length-1:n}_getRuler(){let i=this.options,t=this._cachedMeta,e=t.iScale,s=[],n,o;for(n=0,o=t.data.length;n=M?1:-1)}(c,t,a)*o,u===a&&(m-=c/2);let b=t.getPixelForDecimal(0),y=t.getPixelForDecimal(1),_=Math.min(b,y),x=Math.max(b,y);m=Math.max(Math.min(m,x),_),d=m+c,e&&!h&&(r._stacks[t.axis]._visualValues[s]=t.getValueForPixel(d)-t.getValueForPixel(m))}if(m===t.getPixelForValue(a)){let b=ft(c)*t.getLineWidthForValue(a)/2;m+=b,c-=b}return{size:c,base:m,head:d,center:d+c/2}}_calculateBarIndexPixels(i,t){let e=t.scale,s=this.options,n=s.skipNull,o=E(s.maxBarThickness,1/0),a,r;if(t.grouped){let l=n?this._getStackCount(i):t.stackCount,h=s.barThickness==="flex"?function(c,u,f,p){let g=u.pixels,m=g[c],b=c>0?g[c-1]:null,y=c=0;--e)t=Math.max(t,i[e].size(this.resolveDataElementOptions(e))/2);return t>0&&t}getLabelAndValue(i){let t=this._cachedMeta,e=this.chart.data.labels||[],{xScale:s,yScale:n}=t,o=this.getParsed(i),a=s.getLabelForValue(o.x),r=n.getLabelForValue(o.y),l=o._custom;return{label:e[i]||"",value:"("+a+", "+r+(l?", "+l:"")+")"}}update(i){let t=this._cachedMeta.data;this.updateElements(t,0,t.length,i)}updateElements(i,t,e,s){let n=s==="reset",{iScale:o,vScale:a}=this._cachedMeta,{sharedOptions:r,includeOptions:l}=this._getSharedOptions(t,s),h=o.axis,d=a.axis;for(let c=t;c0&&this.getParsed(t-1);for(let x=0;x=b){w.skip=!0;continue}let M=this.getParsed(x),k=I(M[u]),D=w[c]=o.getPixelForValue(M[c],x),S=w[u]=n||k?a.getBasePixel():a.getPixelForValue(r?this.applyStack(a,M,r):M[u],x);w.skip=isNaN(D)||isNaN(S)||k,w.stop=x>0&&Math.abs(M[c]-_[c])>g,p&&(w.parsed=M,w.raw=l.data[x]),d&&(w.options=h||this.resolveDataElementOptions(x,v.active?"active":s)),m||this.updateElement(v,x,w,s),_=M}}getMaxOverflow(){let i=this._cachedMeta,t=i.dataset,e=t.options&&t.options.borderWidth||0,s=i.data||[];if(!s.length)return e;let n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(e,n,o)/2}draw(){let i=this._cachedMeta;i.dataset.updateControlPoints(this.chart.chartArea,i.iScale.axis),super.draw()}},PieController:class extends es{static id="pie";static defaults={cutout:0,rotation:0,circumference:360,radius:"100%"}},PolarAreaController:ao,RadarController:class extends At{static id="radar";static defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};static overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};getLabelAndValue(i){let t=this._cachedMeta.vScale,e=this.getParsed(i);return{label:t.getLabels()[i],value:""+t.getLabelForValue(e[t.axis])}}parseObjectData(i,t,e,s){return Fi.bind(this)(i,t,e,s)}update(i){let t=this._cachedMeta,e=t.dataset,s=t.data||[],n=t.iScale.getLabels();if(e.points=s,i!=="resize"){let o=this.resolveDatasetElementOptions(i);this.options.showLine||(o.borderWidth=0);let a={_loop:!0,_fullLoop:n.length===s.length,options:o};this.updateElement(e,void 0,a,i)}this.updateElements(s,0,s.length,i)}updateElements(i,t,e,s){let n=this._cachedMeta.rScale,o=s==="reset";for(let a=t;a0&&this.getParsed(t-1);for(let _=t;_0&&Math.abs(v[u]-y[u])>m,g&&(w.parsed=v,w.raw=l.data[_]),c&&(w.options=d||this.resolveDataElementOptions(_,x.active?"active":s)),b||this.updateElement(x,_,w,s),y=v}this.updateSharedOptions(d,s,h)}getMaxOverflow(){let i=this._cachedMeta,t=i.data||[];if(!this.options.showLine){let a=0;for(let r=t.length-1;r>=0;--r)a=Math.max(a,t[r].size(this.resolveDataElementOptions(r))/2);return a>0&&a}let e=i.dataset,s=e.options&&e.options.borderWidth||0;if(!t.length)return s;let n=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,n,o)/2}}});function Ja(i,t,e,s){let n=qe(i.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]),o=(e-t)/2,a=Math.min(o,s*t/2),r=l=>{let h=(e-Math.min(o,l))*s/2;return Q(l,0,Math.min(o,h))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:Q(n.innerStart,0,a),innerEnd:Q(n.innerEnd,0,a)}}function le(i,t,e,s){return{x:e+i*Math.cos(t),y:s+i*Math.sin(t)}}function si(i,t,e,s,n,o){let{x:a,y:r,startAngle:l,pixelMargin:h,innerRadius:d}=t,c=Math.max(t.outerRadius+s+e-h,0),u=d>0?d+s+e+h:0,f=0,p=n-l;if(s){let O=((d>0?d-s:0)+(c>0?c-s:0))/2;f=(p-(O!==0?p*O/(O+s):p))/2}let g=(p-Math.max(.001,p*c-e/$)/c)/2,m=l+g+f,b=n-g-f,{outerStart:y,outerEnd:_,innerStart:x,innerEnd:v}=Ja(t,u,c,b-m),w=c-y,M=c-_,k=m+y/w,D=b-_/M,S=u+x,T=u+v,A=m+x/S,P=b-v/T;if(i.beginPath(),o){let O=(k+D)/2;if(i.arc(a,r,c,k,O),i.arc(a,r,c,O,D),_>0){let V=le(M,D,a,r);i.arc(V.x,V.y,_,D,b+q)}let C=le(T,b,a,r);if(i.lineTo(C.x,C.y),v>0){let V=le(T,P,a,r);i.arc(V.x,V.y,v,b+q,P+Math.PI)}let R=(b-v/u+(m+x/u))/2;if(i.arc(a,r,u,b-v/u,R,!0),i.arc(a,r,u,R,m+x/u,!0),x>0){let V=le(S,A,a,r);i.arc(V.x,V.y,x,A+Math.PI,m-q)}let H=le(w,m,a,r);if(i.lineTo(H.x,H.y),y>0){let V=le(w,k,a,r);i.arc(V.x,V.y,y,m-q,k)}}else{i.moveTo(a,r);let O=Math.cos(k)*c+a,C=Math.sin(k)*c+r;i.lineTo(O,C);let R=Math.cos(D)*c+a,H=Math.sin(D)*c+r;i.lineTo(R,H)}i.closePath()}function Qa(i,t,e,s,n){let{fullCircles:o,startAngle:a,circumference:r,options:l}=t,{borderWidth:h,borderJoinStyle:d,borderDash:c,borderDashOffset:u}=l,f=l.borderAlign==="inner";if(!h)return;i.setLineDash(c||[]),i.lineDashOffset=u,f?(i.lineWidth=2*h,i.lineJoin=d||"round"):(i.lineWidth=h,i.lineJoin=d||"bevel");let p=t.endAngle;if(o){si(i,t,e,s,p,n);for(let g=0;g_?(k=_/M,g.arc(x,v,M,b+k,y-k,!0)):g.arc(x,v,_,b+q,y-q),g.closePath(),g.clip()}(i,t,p),o||(si(i,t,e,s,p,n),i.stroke())}function lo(i,t,e=t){i.lineCap=E(e.borderCapStyle,t.borderCapStyle),i.setLineDash(E(e.borderDash,t.borderDash)),i.lineDashOffset=E(e.borderDashOffset,t.borderDashOffset),i.lineJoin=E(e.borderJoinStyle,t.borderJoinStyle),i.lineWidth=E(e.borderWidth,t.borderWidth),i.strokeStyle=E(e.borderColor,t.borderColor)}function tr(i,t,e){i.lineTo(e.x,e.y)}function ho(i,t,e={}){let s=i.length,{start:n=0,end:o=s-1}=e,{start:a,end:r}=t,l=Math.max(n,a),h=Math.min(o,r),d=nr&&o>r;return{count:s,start:l,loop:t.loop,ilen:h(a+(h?r-x:x))%o,_=()=>{f!==p&&(i.lineTo(m,p),i.lineTo(m,f),i.lineTo(m,g))};for(l&&(c=n[y(0)],i.moveTo(c.x,c.y)),d=0;d<=r;++d){if(c=n[y(d)],c.skip)continue;let x=c.x,v=c.y,w=0|x;w===u?(vp&&(p=v),m=(b*m+x)/++b):(_(),i.lineTo(x,v),u=w,b=0,f=p=v),g=v}_()}function is(i){let t=i.options,e=t.borderDash&&t.borderDash.length;return i._decimated||i._loop||t.tension||t.cubicInterpolationMode==="monotone"||t.stepped||e?er:ir}let sr=typeof Path2D=="function";function nr(i,t,e,s){sr&&!t.options.segment?function(n,o,a,r){let l=o._path;l||(l=o._path=new Path2D,o.path(l,a,r)&&l.closePath()),lo(n,o.options),n.stroke(l)}(i,t,e,s):function(n,o,a,r){let{segments:l,options:h}=o,d=is(o);for(let c of l)lo(n,h,c.style),n.beginPath(),d(n,o,c,{start:a,end:a+r-1})&&n.closePath(),n.stroke()}(i,t,e,s)}class ni extends Mt{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){let s=this.options;if((s.tension||s.cubicInterpolationMode==="monotone")&&!s.stepped&&!this._pointsUpdated){let n=s.spanGaps?this._loop:this._fullLoop;sn(this._points,s,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=un(this,this.options.segment))}first(){let t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){let t=this.segments,e=this.points,s=t.length;return s&&e[t[s-1].end]}interpolate(t,e){let s=this.options,n=t[e],o=this.points,a=Hi(this,{property:e,start:n,end:n});if(!a.length)return;let r=[],l=function(c){return c.stepped?an:c.tension||c.cubicInterpolationMode==="monotone"?rn:Vt}(s),h,d;for(h=0,d=a.length;hi!=="borderDash"};circumference;endAngle;fullCircles;innerRadius;outerRadius;pixelMargin;startAngle;constructor(i){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,i&&Object.assign(this,i)}inRange(i,t,e){let s=this.getProps(["x","y"],e),{angle:n,distance:o}=pi(s,{x:i,y:t}),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:h,circumference:d}=this.getProps(["startAngle","endAngle","innerRadius","outerRadius","circumference"],e),c=(this.options.spacing+this.options.borderWidth)/2,u=E(d,r-a),f=ee(n,a,r)&&a!==r,p=u>=Y||f,g=_t(o,l+c,h+c);return p&&g}getCenterPoint(i){let{x:t,y:e,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius"],i),{offset:r,spacing:l}=this.options,h=(s+n)/2,d=(o+a+l+r)/2;return{x:t+Math.cos(h)*d,y:e+Math.sin(h)*d}}tooltipPosition(i){return this.getCenterPoint(i)}draw(i){let{options:t,circumference:e}=this,s=(t.offset||0)/4,n=(t.spacing||0)/2,o=t.circular;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=e>Y?Math.floor(e/Y):0,e===0||this.innerRadius<0||this.outerRadius<0)return;i.save();let a=(this.startAngle+this.endAngle)/2;i.translate(Math.cos(a)*s,Math.sin(a)*s);let r=s*(1-Math.sin(Math.min($,e||0)));i.fillStyle=t.backgroundColor,i.strokeStyle=t.borderColor,function(l,h,d,c,u){let{fullCircles:f,startAngle:p,circumference:g}=h,m=h.endAngle;if(f){si(l,h,d,c,m,u);for(let b=0;b(typeof a=="string"?(r=o.push(a)-1,l.unshift({index:r,label:a})):isNaN(a)&&(r=null),r))(i,t,e,s):n!==i.lastIndexOf(t)?e:n}function fo(i){let t=this.getLabels();return i>=0&&in=e?n:l,r=l=>o=s?o:l;if(t){let l=ft(n),h=ft(o);l<0&&h<0?r(0):l>0&&h>0&&a(0)}if(n===o){let l=o===0?1:Math.abs(.05*o);r(o+l),t||a(n-l)}this.min=n,this.max=o}getTickLimit(){let t=this.options.ticks,e,{maxTicksLimit:s,stepSize:n}=t;return n?(e=Math.ceil(this.max/n)-Math.floor(this.min/n)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${n} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),s=s||11),s&&(e=Math.min(s,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){let t=this.options,e=t.ticks,s=this.getTickLimit();s=Math.max(2,s);let n=function(o,a){let r=[],{bounds:l,step:h,min:d,max:c,precision:u,count:f,maxTicks:p,maxDigits:g,includeBounds:m}=o,b=h||1,y=p-1,{min:_,max:x}=a,v=!I(d),w=!I(c),M=!I(f),k=(x-_)/(g+1),D,S,T,A,P=ui((x-_)/y/b)*b;if(P<1e-14&&!v&&!w)return[{value:_},{value:x}];A=Math.ceil(x/P)-Math.floor(_/P),A>y&&(P=ui(A*P/y/b)*b),I(u)||(D=Math.pow(10,u),P=Math.ceil(P*D)/D),l==="ticks"?(S=Math.floor(_/P)*P,T=Math.ceil(x/P)*P):(S=_,T=x),v&&w&&h&&Ms((c-d)/h,P/1e3)?(A=Math.round(Math.min((c-d)/P,p)),P=(c-d)/A,S=d,T=c):M?(S=v?d:S,T=w?c:T,A=f-1,P=(T-S)/A):(A=(T-S)/P,A=te(A,Math.round(A),P/1e3)?Math.round(A):Math.ceil(A));let O=Math.max(gi(P),gi(S));D=Math.pow(10,I(u)?O:u),S=Math.round(S*D)/D,T=Math.round(T*D)/D;let C=0;for(v&&(m&&S!==d?(r.push({value:d}),Sc)break;r.push({value:R})}return w&&m&&T!==c?r.length&&te(r[r.length-1].value,c,go(c,k,o))?r[r.length-1].value=c:r.push({value:c}):w&&T!==c||r.push({value:T}),r}({maxTicks:s,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},this._range||this);return t.bounds==="ticks"&&fi(n,this,"value"),t.reverse?(n.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),n}configure(){let t=this.ticks,e=this.min,s=this.max;if(super.configure(),this.options.offset&&t.length){let n=(s-e)/Math.max(t.length-1,1)/2;e-=n,s+=n}this._startValue=e,this._endValue=s,this._valueRange=s-e}getLabelForValue(t){return se(t,this.chart.options.locale,this.options.ticks.format)}}class lr extends oi{static id="linear";static defaults={ticks:{callback:fe.formatters.numeric}};determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=L(t)?t:0,this.max=L(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){let t=this.isHorizontal(),e=t?this.width:this.height,s=ct(this.options.ticks.minRotation),n=(t?Math.sin(s):Math.cos(s))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}let Pe=i=>Math.floor(Dt(i)),Gt=(i,t)=>Math.pow(10,Pe(i)+t);function po(i){return i/Math.pow(10,Pe(i))===1}function mo(i,t,e){let s=Math.pow(10,e),n=Math.floor(i/s);return Math.ceil(t/s)-n}function hr(i,{min:t,max:e}){t=X(i.min,t);let s=[],n=Pe(t),o=function(p,g){let m=Pe(g-p);for(;mo(p,g,m)>10;)m++;for(;mo(p,g,m)<10;)m--;return Math.min(m,Pe(p))}(t,e),a=o<0?Math.pow(10,Math.abs(o)):1,r=Math.pow(10,o),l=n>o?Math.pow(10,n):0,h=Math.round((t-l)*a)/a,d=Math.floor((t-l)/r/10)*r*10,c=Math.floor((h-d)/Math.pow(10,o)),u=X(i.min,Math.round((l+d+c*Math.pow(10,o))*a)/a);for(;u=10?c=c<15?15:20:c++,c>=20&&(o++,c=2,a=o>=0?1:a),u=Math.round((l+d+c*Math.pow(10,o))*a)/a;let f=X(i.max,u);return s.push({value:f,major:po(f),significand:c}),s}class cr extends Wt{static id="logarithmic";static defaults={ticks:{callback:fe.formatters.logarithmic,major:{enabled:!0}}};constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(t,e){let s=oi.prototype.parse.apply(this,[t,e]);if(s!==0)return L(s)&&s>0?s:null;this._zero=!0}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!0);this.min=L(t)?Math.max(0,t):null,this.max=L(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this._zero&&this.min!==this._suggestedMin&&!L(this._userMin)&&(this.min=t===Gt(this.min,0)?Gt(this.min,-1):Gt(this.min,0)),this.handleTickRangeOptions()}handleTickRangeOptions(){let{minDefined:t,maxDefined:e}=this.getUserBounds(),s=this.min,n=this.max,o=r=>s=t?s:r,a=r=>n=e?n:r;s===n&&(s<=0?(o(1),a(10)):(o(Gt(s,-1)),a(Gt(n,1)))),s<=0&&o(Gt(n,-1)),n<=0&&a(Gt(s,1)),this.min=s,this.max=n}buildTicks(){let t=this.options,e=hr({min:this._userMin,max:this._userMax},this);return t.bounds==="ticks"&&fi(e,this,"value"),t.reverse?(e.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),e}getLabelForValue(t){return t===void 0?"0":se(t,this.chart.options.locale,this.options.ticks.format)}configure(){let t=this.min;super.configure(),this._startValue=Dt(t),this._valueRange=Dt(this.max)-Dt(t)}getPixelForValue(t){return t!==void 0&&t!==0||(t=this.min),t===null||isNaN(t)?NaN:this.getPixelForDecimal(t===this.min?0:(Dt(t)-this._startValue)/this._valueRange)}getValueForPixel(t){let e=this.getDecimalForPixel(t);return Math.pow(10,this._startValue+e*this._valueRange)}}function as(i){let t=i.ticks;if(t.display&&i.display){let e=et(t.backdropPadding);return E(t.font&&t.font.size,U.font.size)+e.height}return 0}function bo(i,t,e,s,n){return i===s||i===n?{start:t-e/2,end:t+e/2}:in?{start:t-e,end:t}:{start:t,end:t+e}}function dr(i){let t={l:i.left+i._padding.left,r:i.right-i._padding.right,t:i.top+i._padding.top,b:i.bottom-i._padding.bottom},e=Object.assign({},t),s=[],n=[],o=i._pointLabels.length,a=i.options.pointLabels,r=a.centerPointLabels?$/o:0;for(let c=0;ct.r&&(r=(s.end-t.r)/o,i.r=Math.max(i.r,t.r+r)),n.startt.b&&(l=(n.end-t.b)/a,i.b=Math.max(i.b,t.b+l))}function fr(i,t,e){let s=i.drawingArea,{extra:n,additionalAngle:o,padding:a,size:r}=e,l=i.getPointPosition(t,s+n+a,o),h=Math.round(Ae(nt(l.angle+q))),d=function(f,p,g){return g===90||g===270?f-=p/2:(g>270||g<90)&&(f-=p),f}(l.y,r.h,h),c=function(f){return f===0||f===180?"center":f<180?"left":"right"}(h),u=function(f,p,g){return g==="right"?f-=p:g==="center"&&(f-=p/2),f}(l.x,r.w,c);return{visible:!0,x:l.x,y:d,textAlign:c,left:u,top:d,right:u+r.w,bottom:d+r.h}}function gr(i,t){if(!t)return!0;let{left:e,top:s,right:n,bottom:o}=i;return!(wt({x:e,y:s},t)||wt({x:e,y:o},t)||wt({x:n,y:s},t)||wt({x:n,y:o},t))}function pr(i,t,e){let{left:s,top:n,right:o,bottom:a}=e,{backdropColor:r}=t;if(!I(r)){let l=Bt(t.borderRadius),h=et(t.backdropPadding);i.fillStyle=r;let d=s-h.left,c=n-h.top,u=o-s+h.width,f=a-n+h.height;Object.values(l).some(p=>p!==0)?(i.beginPath(),ne(i,{x:d,y:c,w:u,h:f,radius:l}),i.fill()):i.fillRect(d,c,u,f)}}function xo(i,t,e,s){let{ctx:n}=i;if(e)n.arc(i.xCenter,i.yCenter,t,0,Y);else{let o=i.getPointPosition(0,t);n.moveTo(o.x,o.y);for(let a=1;at,padding:5,centerPointLabels:!1}};static defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};static descriptors={angleLines:{_fallback:"grid"}};constructor(t){super(t),this.xCenter=void 0,this.yCenter=void 0,this.drawingArea=void 0,this._pointLabels=[],this._pointLabelItems=[]}setDimensions(){let t=this._padding=et(as(this.options)/2),e=this.width=this.maxWidth-t.width,s=this.height=this.maxHeight-t.height;this.xCenter=Math.floor(this.left+e/2+t.left),this.yCenter=Math.floor(this.top+s/2+t.top),this.drawingArea=Math.floor(Math.min(e,s)/2)}determineDataLimits(){let{min:t,max:e}=this.getMinMax(!1);this.min=L(t)&&!isNaN(t)?t:0,this.max=L(e)&&!isNaN(e)?e:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/as(this.options))}generateTickLabels(t){oi.prototype.generateTickLabels.call(this,t),this._pointLabels=this.getLabels().map((e,s)=>{let n=N(this.options.pointLabels.callback,[e,s],this);return n||n===0?n:""}).filter((e,s)=>this.chart.getDataVisibility(s))}fit(){let t=this.options;t.display&&t.pointLabels.display?dr(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,s,n){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((s-n)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,s,n))}getIndexAngle(t){return nt(t*(Y/(this._pointLabels.length||1))+ct(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if(I(t))return NaN;let e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if(I(t))return NaN;let e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){let e=this._pointLabels||[];if(t>=0&&t=0;p--){let g=d._pointLabelItems[p];if(!g.visible)continue;let m=f.setContext(d.getPointLabelContext(p));pr(u,m,g);let b=J(m.font),{x:y,y:_,textAlign:x}=g;Ft(u,d._pointLabels[p],y,_+b.lineHeight/2,b,{color:m.color,textAlign:x,textBaseline:"middle"})}}(this,a),n.display&&this.ticks.forEach((d,c)=>{if(c!==0||c===0&&this.min<0){l=this.getDistanceFromCenterForValue(d.value);let u=this.getContext(c),f=n.setContext(u),p=o.setContext(u);(function(g,m,b,y,_){let x=g.ctx,v=m.circular,{color:w,lineWidth:M}=m;!v&&!y||!w||!M||b<0||(x.save(),x.strokeStyle=w,x.lineWidth=M,x.setLineDash(_.dash||[]),x.lineDashOffset=_.dashOffset,x.beginPath(),xo(g,b,v,y),x.closePath(),x.stroke(),x.restore())})(this,f,l,a,p)}}),s.display){for(t.save(),r=a-1;r>=0;r--){let d=s.setContext(this.getPointLabelContext(r)),{color:c,lineWidth:u}=d;u&&c&&(t.lineWidth=u,t.strokeStyle=c,t.setLineDash(d.borderDash),t.lineDashOffset=d.borderDashOffset,l=this.getDistanceFromCenterForValue(e.reverse?this.min:this.max),h=this.getPointPosition(r,l),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(h.x,h.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){let t=this.ctx,e=this.options,s=e.ticks;if(!s.display)return;let n=this.getIndexAngle(0),o,a;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(n),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach((r,l)=>{if(l===0&&this.min>=0&&!e.reverse)return;let h=s.setContext(this.getContext(l)),d=J(h.font);if(o=this.getDistanceFromCenterForValue(this.ticks[l].value),h.showLabelBackdrop){t.font=d.string,a=t.measureText(r.label).width,t.fillStyle=h.backdropColor;let c=et(h.backdropPadding);t.fillRect(-a/2-c.left,-o-d.size/2-c.top,a+c.width,d.size+c.height)}Ft(t,r.label,0,-o,d,{color:h.color,strokeColor:h.textStrokeColor,strokeWidth:h.textStrokeWidth})}),t.restore()}drawTitle(){}}let ai={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ot=Object.keys(ai);function _o(i,t){return i-t}function yo(i,t){if(I(t))return null;let e=i._adapter,{parser:s,round:n,isoWeekday:o}=i._parseOpts,a=t;return typeof s=="function"&&(a=s(a)),L(a)||(a=typeof s=="string"?e.parse(a,s):e.parse(a)),a===null?null:(n&&(a=n!=="week"||!$t(o)&&o!==!0?e.startOf(a,n):e.startOf(a,"isoWeek",o)),+a)}function vo(i,t,e,s){let n=ot.length;for(let o=ot.indexOf(i);o=t?e[s]:e[n]]=!0}}else i[t]=!0}function Mo(i,t,e){let s=[],n={},o=t.length,a,r;for(a=0;a=0&&(h[m].major=!0);return h}(i,s,n,e):s}class rs extends Wt{static id="time";static defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}};constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e={}){let s=t.time||(t.time={}),n=this._adapter=new eo._date(t.adapters.date);n.init(e),Jt(s.displayFormats,n.formats()),this._parseOpts={parser:s.parser,round:s.round,isoWeekday:s.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return t===void 0?null:yo(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){let t=this.options,e=this._adapter,s=t.time.unit||"day",{min:n,max:o,minDefined:a,maxDefined:r}=this.getUserBounds();function l(h){a||isNaN(h.min)||(n=Math.min(n,h.min)),r||isNaN(h.max)||(o=Math.max(o,h.max))}a&&r||(l(this._getLabelBounds()),t.bounds==="ticks"&&t.ticks.source==="labels"||l(this.getMinMax(!1))),n=L(n)&&!isNaN(n)?n:+e.startOf(Date.now(),s),o=L(o)&&!isNaN(o)?o:+e.endOf(Date.now(),s)+1,this.min=Math.min(n,o-1),this.max=Math.max(n+1,o)}_getLabelBounds(){let t=this.getLabelTimestamps(),e=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],s=t[t.length-1]),{min:e,max:s}}buildTicks(){let t=this.options,e=t.time,s=t.ticks,n=s.source==="labels"?this.getLabelTimestamps():this._generate();t.bounds==="ticks"&&n.length&&(this.min=this._userMin||n[0],this.max=this._userMax||n[n.length-1]);let o=this.min,a=Ds(n,o,this.max);return this._unit=e.unit||(s.autoSkip?vo(e.minUnit,this.min,this.max,this._getLabelCapacity(o)):function(r,l,h,d,c){for(let u=ot.length-1;u>=ot.indexOf(h);u--){let f=ot[u];if(ai[f].common&&r._adapter.diff(c,d,f)>=l-1)return f}return ot[h?ot.indexOf(h):0]}(this,a.length,e.minUnit,this.min,this.max)),this._majorUnit=s.major.enabled&&this._unit!=="year"?function(r){for(let l=ot.indexOf(r)+1,h=ot.length;l+t.value))}initOffsets(t=[]){let e,s,n=0,o=0;this.options.offset&&t.length&&(e=this.getDecimalForValue(t[0]),n=t.length===1?1-e:(this.getDecimalForValue(t[1])-e)/2,s=this.getDecimalForValue(t[t.length-1]),o=t.length===1?s:(s-this.getDecimalForValue(t[t.length-2]))/2);let a=t.length<3?.5:.25;n=Q(n,0,a),o=Q(o,0,a),this._offsets={start:n,end:o,factor:1/(n+1+o)}}_generate(){let t=this._adapter,e=this.min,s=this.max,n=this.options,o=n.time,a=o.unit||vo(o.minUnit,e,s,this._getLabelCapacity(e)),r=E(n.ticks.stepSize,1),l=a==="week"&&o.isoWeekday,h=$t(l)||l===!0,d={},c,u,f=e;if(h&&(f=+t.startOf(f,"isoWeek",l)),f=+t.startOf(f,h?"day":a),t.diff(s,e,a)>1e5*r)throw new Error(e+" and "+s+" are too far apart with stepSize of "+r+" "+a);let p=n.ticks.source==="data"&&this.getDataTimestamps();for(c=f,u=0;c+g)}getLabelForValue(t){let e=this._adapter,s=this.options.time;return s.tooltipFormat?e.format(t,s.tooltipFormat):e.format(t,s.displayFormats.datetime)}format(t,e){let s=this.options.time.displayFormats,n=this._unit,o=e||s[n];return this._adapter.format(t,o)}_tickFormatFunction(t,e,s,n){let o=this.options,a=o.ticks.callback;if(a)return N(a,[t,e,s],this);let r=o.time.displayFormats,l=this._unit,h=this._majorUnit,d=l&&r[l],c=h&&r[h],u=s[e],f=h&&c&&u&&u.major;return this._adapter.format(t,n||(f?c:d))}generateTickLabels(t){let e,s,n;for(e=0,s=t.length;e0?r:1}getDataTimestamps(){let t,e,s=this._cache.data||[];if(s.length)return s;let n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(t=0,e=n.length;t=i[r].pos&&t<=i[l].pos&&({lo:r,hi:l}=yt(i,"pos",t)),{pos:s,time:o}=i[r],{pos:n,time:a}=i[l]):(t>=i[r].time&&t<=i[l].time&&({lo:r,hi:l}=yt(i,"time",t)),{time:s,pos:o}=i[r],{time:n,pos:a}=i[l]);let h=n-s;return h?o+(a-o)*(t-s)/h:o}var ko=Object.freeze({__proto__:null,CategoryScale:class extends Wt{static id="category";static defaults={ticks:{callback:fo}};constructor(i){super(i),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(i){let t=this._addedLabels;if(t.length){let e=this.getLabels();for(let{index:s,label:n}of t)e[s]===n&&e.splice(s,1);this._addedLabels=[]}super.init(i)}parse(i,t){if(I(i))return null;let e=this.getLabels();return((s,n)=>s===null?null:Q(Math.round(s),0,n))(t=isFinite(t)&&e[t]===i?t:rr(e,i,E(t,i),this._addedLabels),e.length-1)}determineDataLimits(){let{minDefined:i,maxDefined:t}=this.getUserBounds(),{min:e,max:s}=this.getMinMax(!0);this.options.bounds==="ticks"&&(i||(e=0),t||(s=this.getLabels().length-1)),this.min=e,this.max=s}buildTicks(){let i=this.min,t=this.max,e=this.options.offset,s=[],n=this.getLabels();n=i===0&&t===n.length-1?n:n.slice(i,t+1),this._valueRange=Math.max(n.length-(e?0:1),1),this._startValue=this.min-(e?.5:0);for(let o=i;o<=t;o++)s.push({value:o});return s}getLabelForValue(i){return fo.call(this,i)}configure(){super.configure(),this.isHorizontal()||(this._reversePixels=!this._reversePixels)}getPixelForValue(i){return typeof i!="number"&&(i=this.parse(i)),i===null?NaN:this.getPixelForDecimal((i-this._startValue)/this._valueRange)}getPixelForTick(i){let t=this.ticks;return i<0||i>t.length-1?null:this.getPixelForValue(t[i].value)}getValueForPixel(i){return Math.round(this._startValue+this.getDecimalForPixel(i)*this._valueRange)}getBasePixel(){return this.bottom}},LinearScale:lr,LogarithmicScale:cr,RadialLinearScale:mr,TimeScale:rs,TimeSeriesScale:class extends rs{static id="timeseries";static defaults=rs.defaults;constructor(i){super(i),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){let i=this._getTimestampsForTable(),t=this._table=this.buildLookupTable(i);this._minPos=ri(t,this.min),this._tableRange=ri(t,this.max)-this._minPos,super.initOffsets(i)}buildLookupTable(i){let{min:t,max:e}=this,s=[],n=[],o,a,r,l,h;for(o=0,a=i.length;o=t&&l<=e&&s.push(l);if(s.length<2)return[{time:t,pos:0},{time:e,pos:1}];for(o=0,a=s.length;os-n)}_getTimestampsForTable(){let i=this._cache.all||[];if(i.length)return i;let t=this.getDataTimestamps(),e=this.getLabelTimestamps();return i=t.length&&e.length?this.normalize(t.concat(e)):t.length?t:e,i=this._cache.all=i,i}getDecimalForValue(i){return(ri(this._table,i)-this._minPos)/this._tableRange}getValueForPixel(i){let t=this._offsets,e=this.getDecimalForPixel(i)/t.factor-t.end;return ri(this._table,e*this._tableRange+this._minPos,!0)}}});let ls=["rgb(54, 162, 235)","rgb(255, 99, 132)","rgb(255, 159, 64)","rgb(255, 205, 86)","rgb(75, 192, 192)","rgb(153, 102, 255)","rgb(201, 203, 207)"],So=ls.map(i=>i.replace("rgb(","rgba(").replace(")",", 0.5)"));function Po(i){return ls[i%ls.length]}function Do(i){return So[i%So.length]}function br(i){let t=0;return(e,s)=>{let n=i.getDatasetMeta(s).controller;n instanceof es?t=function(o,a){return o.backgroundColor=o.data.map(()=>Po(a++)),a}(e,t):n instanceof ao?t=function(o,a){return o.backgroundColor=o.data.map(()=>Do(a++)),a}(e,t):n&&(t=function(o,a){return o.borderColor=Po(a),o.backgroundColor=Do(a),++a}(e,t))}}function Co(i){let t;for(t in i)if(i[t].borderColor||i[t].backgroundColor)return!0;return!1}var xr={id:"colors",defaults:{enabled:!0,forceOverride:!1},beforeLayout(i,t,e){if(!e.enabled)return;let{data:{datasets:s},options:n}=i.config,{elements:o}=n,a=Co(s)||(r=n)&&(r.borderColor||r.backgroundColor)||o&&Co(o)||U.borderColor!=="rgba(0,0,0,0.1)"||U.backgroundColor!=="rgba(0,0,0,0.1)";var r;if(!e.forceOverride&&a)return;let l=br(i);s.forEach(l)}};function Oo(i){if(i._decimated){let t=i._data;delete i._decimated,delete i._data,Object.defineProperty(i,"data",{configurable:!0,enumerable:!0,writable:!0,value:t})}}function Ao(i){i.data.datasets.forEach(t=>{Oo(t)})}var _r={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(i,t,e)=>{if(!e.enabled)return void Ao(i);let s=i.width;i.data.datasets.forEach((n,o)=>{let{_data:a,indexAxis:r}=n,l=i.getDatasetMeta(o),h=a||n.data;if(re([r,i.options.indexAxis])==="y"||!l.controller.supportsDecimation)return;let d=i.scales[l.xAxisID];if(d.type!=="linear"&&d.type!=="time"||i.options.parsing)return;let{start:c,count:u}=function(p,g){let m=g.length,b,y=0,{iScale:_}=p,{min:x,max:v,minDefined:w,maxDefined:M}=_.getUserBounds();return w&&(y=Q(yt(g,_.axis,x).lo,0,m-1)),b=M?Q(yt(g,_.axis,v).hi+1,y,m)-y:m-y,{start:y,count:b}}(l,h);if(u<=(e.threshold||4*s))return void Oo(n);let f;switch(I(a)&&(n._data=h,delete n.data,Object.defineProperty(n,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(p){this._data=p}})),e.algorithm){case"lttb":f=function(p,g,m,b,y){let _=y.samples||b;if(_>=m)return p.slice(g,g+m);let x=[],v=(m-2)/(_-2),w=0,M=g+m-1,k,D,S,T,A,P=g;for(x[w++]=p[P],k=0;k<_-2;k++){let O,C=0,R=0,H=Math.floor((k+1)*v)+1+g,V=Math.min(Math.floor((k+2)*v)+1,m)+g,st=V-H;for(O=H;OS&&(S=T,D=p[O],A=O);x[w++]=D,P=A}return x[w++]=p[M],x}(h,c,u,s,e);break;case"min-max":f=function(p,g,m,b){let y,_,x,v,w,M,k,D,S,T,A=0,P=0,O=[],C=g+m-1,R=p[g].x,H=p[C].x-R;for(y=g;yT&&(T=v,k=y),A=(P*A+_.x)/++P;else{let st=y-1;if(!I(M)&&!I(k)){let rt=Math.min(M,k),lt=Math.max(M,k);rt!==D&&rt!==st&&O.push({...p[rt],x:A}),lt!==D&<!==st&&O.push({...p[lt],x:A})}y>0&&st!==D&&O.push(p[st]),O.push(_),w=V,P=0,S=T=v,M=k=D=y}}return O}(h,c,u,s);break;default:throw new Error(`Unsupported decimation algorithm '${e.algorithm}'`)}n._decimated=f})},destroy(i){Ao(i)}};function hs(i,t,e,s){if(s)return;let n=t[i],o=e[i];return i==="angle"&&(n=nt(n),o=nt(o)),{property:i,start:n,end:o}}function cs(i,t,e){for(;t>i;t--){let s=e[t];if(!isNaN(s.x)&&!isNaN(s.y))break}return t}function To(i,t,e,s){return i&&t?s(i[e],t[e]):i?i[e]:t?t[e]:0}function Lo(i,t){let e=[],s=!1;return F(i)?(s=!0,e=i):e=function(n,o){let{x:a=null,y:r=null}=n||{},l=o.points,h=[];return o.segments.forEach(({start:d,end:c})=>{c=cs(d,c,l);let u=l[d],f=l[c];r!==null?(h.push({x:u.x,y:r}),h.push({x:f.x,y:r})):a!==null&&(h.push({x:a,y:u.y}),h.push({x:a,y:f.y}))}),h}(i,t),e.length?new ni({points:e,options:{tension:0},_loop:s,_fullLoop:s}):null}function Eo(i){return i&&i.fill!==!1}function yr(i,t,e){let s=i[t].fill,n=[t],o;if(!e)return s;for(;s!==!1&&n.indexOf(s)===-1;){if(!L(s))return s;if(o=i[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function vr(i,t,e){let s=function(o){let a=o.options,r=a.fill,l=E(r&&r.target,r);return l===void 0&&(l=!!a.backgroundColor),l===!1||l===null?!1:l===!0?"origin":l}(i);if(z(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return L(n)&&Math.floor(n)===n?function(o,a,r,l){return o!=="-"&&o!=="+"||(r=a+r),r===a||r<0||r>=l?!1:r}(s[0],t,n,e):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}function wr(i,t,e){let s=[];for(let n=0;n=0;--a){let r=n[a].$filler;r&&(r.line.updateControlPoints(o,r.axis),s&&r.fill&&ds(i.ctx,r,o))}},beforeDatasetsDraw(i,t,e){if(e.drawTime!=="beforeDatasetsDraw")return;let s=i.getSortedVisibleDatasetMetas();for(let n=s.length-1;n>=0;--n){let o=s[n].$filler;Eo(o)&&ds(i.ctx,o,i.chartArea)}},beforeDatasetDraw(i,t,e){let s=t.meta.$filler;Eo(s)&&e.drawTime==="beforeDatasetDraw"&&ds(i.ctx,s,i.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};let Vo=(i,t)=>{let{boxHeight:e=t,boxWidth:s=t}=i;return i.usePointStyle&&(e=Math.min(e,t),s=i.pointStyleWidth||Math.min(s,t)),{boxWidth:s,boxHeight:e,itemHeight:Math.max(t,e)}};class Bo extends Mt{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,s){this.maxWidth=t,this.maxHeight=e,this._margins=s,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){let t=this.options.labels||{},e=N(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(s=>t.filter(s,this.chart.data))),t.sort&&(e=e.sort((s,n)=>t.sort(s,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){let{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);let s=t.labels,n=J(s.font),o=n.size,a=this._computeTitleHeight(),{boxWidth:r,itemHeight:l}=Vo(s,o),h,d;e.font=n.string,this.isHorizontal()?(h=this.maxWidth,d=this._fitRows(a,o,r,l)+10):(d=this.maxHeight,h=this._fitCols(a,n,r,l)+10),this.width=Math.min(h,t.maxWidth||this.maxWidth),this.height=Math.min(d,t.maxHeight||this.maxHeight)}_fitRows(t,e,s,n){let{ctx:o,maxWidth:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],h=this.lineWidths=[0],d=n+r,c=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-d;return this.legendItems.forEach((p,g)=>{let m=s+e/2+o.measureText(p.text).width;(g===0||h[h.length-1]+m+2*r>a)&&(c+=d,h[h.length-(g>0?0:1)]=0,f+=d,u++),l[g]={left:0,top:f,row:u,width:m,height:n},h[h.length-1]+=m+r}),c}_fitCols(t,e,s,n){let{ctx:o,maxHeight:a,options:{labels:{padding:r}}}=this,l=this.legendHitBoxes=[],h=this.columnSizes=[],d=a-t,c=r,u=0,f=0,p=0,g=0;return this.legendItems.forEach((m,b)=>{let{itemWidth:y,itemHeight:_}=function(x,v,w,M,k){let D=function(T,A,P,O){let C=T.text;return C&&typeof C!="string"&&(C=C.reduce((R,H)=>R.length>H.length?R:H)),A+P.size/2+O.measureText(C).width}(M,x,v,w),S=function(T,A,P){let O=T;return typeof A.text!="string"&&(O=Wo(A,P)),O}(k,M,v.lineHeight);return{itemWidth:D,itemHeight:S}}(s,e,o,m,n);b>0&&f+_+2*r>d&&(c+=u+r,h.push({width:u,height:f}),p+=u+r,g++,u=f=0),l[b]={left:p,top:f,col:g,width:y,height:_},u=Math.max(u,y),f+=_+r}),c+=u,h.push({width:u,height:f}),c}adjustHitBoxes(){if(!this.options.display)return;let t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:s,labels:{padding:n},rtl:o}}=this,a=qt(o,this.left,this.width);if(this.isHorizontal()){let r=0,l=tt(s,this.left+n,this.right-this.lineWidths[r]);for(let h of e)r!==h.row&&(r=h.row,l=tt(s,this.left+n,this.right-this.lineWidths[r])),h.top+=this.top+t+n,h.left=a.leftForLtr(a.x(l),h.width),l+=h.width+n}else{let r=0,l=tt(s,this.top+t+n,this.bottom-this.columnSizes[r].height);for(let h of e)h.col!==r&&(r=h.col,l=tt(s,this.top+t+n,this.bottom-this.columnSizes[r].height)),h.top=l,h.left+=this.left+n,h.left=a.leftForLtr(a.x(h.left),h.width),l+=h.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){let t=this.ctx;me(t,this),this._draw(),be(t)}}_draw(){let{options:t,columnSizes:e,lineWidths:s,ctx:n}=this,{align:o,labels:a}=t,r=U.color,l=qt(t.rtl,this.left,this.width),h=J(a.font),{padding:d}=a,c=h.size,u=c/2,f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=h.string;let{boxWidth:p,boxHeight:g,itemHeight:m}=Vo(a,c),b=this.isHorizontal(),y=this._computeTitleHeight();f=b?{x:tt(o,this.left+d,this.right-s[0]),y:this.top+d+y,line:0}:{x:this.left+d,y:tt(o,this.top+y+d,this.bottom-e[0].height),line:0},Bi(this.ctx,t.textDirection);let _=m+d;this.legendItems.forEach((x,v)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;let w=n.measureText(x.text).width,M=l.textAlign(x.textAlign||(x.textAlign=a.textAlign)),k=p+u+w,D=f.x,S=f.y;if(l.setWidth(this.width),b?v>0&&D+k+d>this.right&&(S=f.y+=_,f.line++,D=f.x=tt(o,this.left+d,this.right-s[f.line])):v>0&&S+_>this.bottom&&(D=f.x=D+e[f.line].width+d,f.line++,S=f.y=tt(o,this.top+y+d,this.bottom-e[f.line].height)),function(T,A,P){if(isNaN(p)||p<=0||isNaN(g)||g<0)return;n.save();let O=E(P.lineWidth,1);if(n.fillStyle=E(P.fillStyle,r),n.lineCap=E(P.lineCap,"butt"),n.lineDashOffset=E(P.lineDashOffset,0),n.lineJoin=E(P.lineJoin,"miter"),n.lineWidth=O,n.strokeStyle=E(P.strokeStyle,r),n.setLineDash(E(P.lineDash,[])),a.usePointStyle){let C={radius:g*Math.SQRT2/2,pointStyle:P.pointStyle,rotation:P.rotation,borderWidth:O},R=l.xPlus(T,p/2);Ei(n,C,R,A+u,a.pointStyleWidth&&p)}else{let C=A+Math.max((c-g)/2,0),R=l.leftForLtr(T,p),H=Bt(P.borderRadius);n.beginPath(),Object.values(H).some(V=>V!==0)?ne(n,{x:R,y:C,w:p,h:g,radius:H}):n.rect(R,C,p,g),n.fill(),O!==0&&n.stroke()}n.restore()}(l.x(D),S,x),D=Ts(M,D+p+u,b?D+k:this.right,t.rtl),function(T,A,P){Ft(n,P.text,T,A+m/2,h,{strikethrough:P.hidden,textAlign:l.textAlign(P.textAlign)})}(l.x(D),S,x),b)f.x+=k+d;else if(typeof x.text!="string"){let T=h.lineHeight;f.y+=Wo(x,T)+d}else f.y+=_}),Wi(this.ctx,t.textDirection)}drawTitle(){let t=this.options,e=t.title,s=J(e.font),n=et(e.padding);if(!e.display)return;let o=qt(t.rtl,this.left,this.width),a=this.ctx,r=e.position,l=s.size/2,h=n.top+l,d,c=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),d=this.top+h,c=tt(t.align,c,this.right-u);else{let p=this.columnSizes.reduce((g,m)=>Math.max(g,m.height),0);d=h+tt(t.align,this.top,this.bottom-p-t.labels.padding-this._computeTitleHeight())}let f=tt(r,c,c+u);a.textAlign=o.textAlign(Ee(r)),a.textBaseline="middle",a.strokeStyle=e.color,a.fillStyle=e.color,a.font=s.string,Ft(a,e.text,f,d,s)}_computeTitleHeight(){let t=this.options.title,e=J(t.font),s=et(t.padding);return t.display?e.lineHeight+s.height:0}_getLegendItemAt(t,e){let s,n,o;if(_t(t,this.left,this.right)&&_t(e,this.top,this.bottom)){for(o=this.legendHitBoxes,s=0;si.chart.options.color,boxWidth:40,padding:10,generateLabels(i){let t=i.data.datasets,{labels:{usePointStyle:e,pointStyle:s,textAlign:n,color:o,useBorderRadius:a,borderRadius:r}}=i.legend.options;return i._getSortedDatasetMetas().map(l=>{let h=l.controller.getStyle(e?0:void 0),d=et(h.borderWidth);return{text:t[l.index].label,fillStyle:h.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:h.borderCapStyle,lineDash:h.borderDash,lineDashOffset:h.borderDashOffset,lineJoin:h.borderJoinStyle,lineWidth:(d.width+d.height)/4,strokeStyle:h.borderColor,pointStyle:s||h.pointStyle,rotation:h.rotation,textAlign:n||h.textAlign,borderRadius:a&&(r||h.borderRadius),datasetIndex:l.index}},this)}},title:{color:i=>i.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:i=>!i.startsWith("on"),labels:{_scriptable:i=>!["generateLabels","filter","sort"].includes(i)}}};class us extends Mt{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){let s=this.options;if(this.left=0,this.top=0,!s.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;let n=F(s.text)?s.text.length:1;this._padding=et(s.padding);let o=n*J(s.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){let t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){let{top:e,left:s,bottom:n,right:o,options:a}=this,r=a.align,l,h,d,c=0;return this.isHorizontal()?(h=tt(r,s,o),d=e+t,l=o-s):(a.position==="left"?(h=s+t,d=tt(r,n,e),c=-.5*$):(h=o-t,d=tt(r,e,n),c=.5*$),l=n-e),{titleX:h,titleY:d,maxWidth:l,rotation:c}}draw(){let t=this.ctx,e=this.options;if(!e.display)return;let s=J(e.font),n=s.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);Ft(t,e.text,0,0,s,{color:e.color,maxWidth:r,rotation:l,textAlign:Ee(e.align),textBaseline:"middle",translation:[o,a]})}}var Cr={id:"title",_element:us,start(i,t,e){(function(s,n){let o=new us({ctx:s.ctx,options:n,chart:s});it.configure(s,o,n),it.addBox(s,o),s.titleBlock=o})(i,e)},stop(i){let t=i.titleBlock;it.removeBox(i,t),delete i.titleBlock},beforeUpdate(i,t,e){let s=i.titleBlock;it.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let li=new WeakMap;var Or={id:"subtitle",start(i,t,e){let s=new us({ctx:i.ctx,options:e,chart:i});it.configure(i,s,e),it.addBox(i,s),li.set(i,s)},stop(i){it.removeBox(i,li.get(i)),li.delete(i)},beforeUpdate(i,t,e){let s=li.get(i);it.configure(i,s,e),s.options=e},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};let De={average(i){if(!i.length)return!1;let t,e,s=new Set,n=0,o=0;for(t=0,e=i.length;ta+r)/s.size,y:n/o}},nearest(i,t){if(!i.length)return!1;let e,s,n,o=t.x,a=t.y,r=Number.POSITIVE_INFINITY;for(e=0,s=i.length;e-1?i.split(` +`):i}function Ar(i,t){let{element:e,datasetIndex:s,index:n}=t,o=i.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:i,label:a,parsed:o.getParsed(n),raw:i.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:e}}function No(i,t){let e=i.chart.ctx,{body:s,footer:n,title:o}=i,{boxWidth:a,boxHeight:r}=t,l=J(t.bodyFont),h=J(t.titleFont),d=J(t.footerFont),c=o.length,u=n.length,f=s.length,p=et(t.padding),g=p.height,m=0,b=s.reduce((x,v)=>x+v.before.length+v.lines.length+v.after.length,0);b+=i.beforeBody.length+i.afterBody.length,c&&(g+=c*h.lineHeight+(c-1)*t.titleSpacing+t.titleMarginBottom),b&&(g+=f*(t.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(b-f)*l.lineHeight+(b-1)*t.bodySpacing),u&&(g+=t.footerMarginTop+u*d.lineHeight+(u-1)*t.footerSpacing);let y=0,_=function(x){m=Math.max(m,e.measureText(x).width+y)};return e.save(),e.font=h.string,B(i.title,_),e.font=l.string,B(i.beforeBody.concat(i.afterBody),_),y=t.displayColors?a+2+t.boxPadding:0,B(s,x=>{B(x.before,_),B(x.lines,_),B(x.after,_)}),y=0,e.font=d.string,B(i.footer,_),e.restore(),m+=p.width,{width:m,height:g}}function Tr(i,t,e,s){let{x:n,width:o}=e,{width:a,chartArea:{left:r,right:l}}=i,h="center";return s==="center"?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(d,c,u,f){let{x:p,width:g}=f,m=u.caretSize+u.caretPadding;return d==="left"&&p+g+m>c.width||d==="right"&&p-g-m<0||void 0}(h,i,t,e)&&(h="center"),h}function Ho(i,t,e){let s=e.yAlign||t.yAlign||function(n,o){let{y:a,height:r}=o;return an.height-r/2?"bottom":"center"}(i,e);return{xAlign:e.xAlign||t.xAlign||Tr(i,t,e,s),yAlign:s}}function jo(i,t,e,s){let{caretSize:n,caretPadding:o,cornerRadius:a}=i,{xAlign:r,yAlign:l}=e,h=n+o,{topLeft:d,topRight:c,bottomLeft:u,bottomRight:f}=Bt(a),p=function(m,b){let{x:y,width:_}=m;return b==="right"?y-=_:b==="center"&&(y-=_/2),y}(t,r),g=function(m,b,y){let{y:_,height:x}=m;return b==="top"?_+=y:_-=b==="bottom"?x+y:x/2,_}(t,l,h);return l==="center"?r==="left"?p+=h:r==="right"&&(p-=h):r==="left"?p-=Math.max(d,u)+n:r==="right"&&(p+=Math.max(c,f)+n),{x:Q(p,0,s.width-t.width),y:Q(g,0,s.height-t.height)}}function hi(i,t,e){let s=et(e.padding);return t==="center"?i.x+i.width/2:t==="right"?i.x+i.width-s.right:i.x+s.left}function $o(i){return kt([],Tt(i))}function Yo(i,t){let e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?i.override(e):i}let Uo={beforeTitle:W,title(i){if(i.length>0){let t=i[0],e=t.chart.data.labels,s=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(s>0&&t.dataIndex{let a={before:[],lines:[],after:[]},r=Yo(s,o);kt(a.before,Tt(at(r,"beforeLabel",this,o))),kt(a.lines,at(r,"label",this,o)),kt(a.after,Tt(at(r,"afterLabel",this,o))),n.push(a)}),n}getAfterBody(t,e){return $o(at(e.callbacks,"afterBody",this,t))}getFooter(t,e){let{callbacks:s}=e,n=at(s,"beforeFooter",this,t),o=at(s,"footer",this,t),a=at(s,"afterFooter",this,t),r=[];return r=kt(r,Tt(n)),r=kt(r,Tt(o)),r=kt(r,Tt(a)),r}_createItems(t){let e=this._active,s=this.chart.data,n=[],o=[],a=[],r,l,h=[];for(r=0,l=e.length;rt.filter(d,c,u,s))),t.itemSort&&(h=h.sort((d,c)=>t.itemSort(d,c,s))),B(h,d=>{let c=Yo(t.callbacks,d);n.push(at(c,"labelColor",this,d)),o.push(at(c,"labelPointStyle",this,d)),a.push(at(c,"labelTextColor",this,d))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=a,this.dataPoints=h,h}update(t,e){let s=this.options.setContext(this.getContext()),n=this._active,o,a=[];if(n.length){let r=De[s.position].call(this,n,this._eventPosition);a=this._createItems(s),this.title=this.getTitle(a,s),this.beforeBody=this.getBeforeBody(a,s),this.body=this.getBody(a,s),this.afterBody=this.getAfterBody(a,s),this.footer=this.getFooter(a,s);let l=this._size=No(this,s),h=Object.assign({},r,l),d=Ho(this.chart,s,h),c=jo(s,h,d,this.chart);this.xAlign=d.xAlign,this.yAlign=d.yAlign,o={opacity:1,x:c.x,y:c.y,width:l.width,height:l.height,caretX:r.x,caretY:r.y}}else this.opacity!==0&&(o={opacity:0});this._tooltipItems=a,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&s.external&&s.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,s,n){let o=this.getCaretPosition(t,s,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,s){let{xAlign:n,yAlign:o}=this,{caretSize:a,cornerRadius:r}=s,{topLeft:l,topRight:h,bottomLeft:d,bottomRight:c}=Bt(r),{x:u,y:f}=t,{width:p,height:g}=e,m,b,y,_,x,v;return o==="center"?(x=f+g/2,n==="left"?(m=u,b=m-a,_=x+a,v=x-a):(m=u+p,b=m+a,_=x-a,v=x+a),y=m):(b=n==="left"?u+Math.max(l,d)+a:n==="right"?u+p-Math.max(h,c)-a:this.caretX,o==="top"?(_=f,x=_-a,m=b-a,y=b+a):(_=f+g,x=_+a,m=b+a,y=b-a),v=_),{x1:m,x2:b,x3:y,y1:_,y2:x,y3:v}}drawTitle(t,e,s){let n=this.title,o=n.length,a,r,l;if(o){let h=qt(s.rtl,this.x,this.width);for(t.x=hi(this,s.titleAlign,s),e.textAlign=h.textAlign(s.titleAlign),e.textBaseline="middle",a=J(s.titleFont),r=s.titleSpacing,e.fillStyle=s.titleColor,e.font=a.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ne(t,{x:g,y:p,w:h,h:l,radius:b}),t.fill(),t.stroke(),t.fillStyle=a.backgroundColor,t.beginPath(),ne(t,{x:m,y:p+1,w:h-2,h:l-2,radius:b}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(g,p,h,l),t.strokeRect(g,p,h,l),t.fillStyle=a.backgroundColor,t.fillRect(m,p+1,h-2,l-2))}t.fillStyle=this.labelTextColors[s]}drawBody(t,e,s){let{body:n}=this,{bodySpacing:o,bodyAlign:a,displayColors:r,boxHeight:l,boxWidth:h,boxPadding:d}=s,c=J(s.bodyFont),u=c.lineHeight,f=0,p=qt(s.rtl,this.x,this.width),g=function(k){e.fillText(k,p.x(t.x+f),t.y+u/2),t.y+=u+o},m=p.textAlign(a),b,y,_,x,v,w,M;for(e.textAlign=a,e.textBaseline="middle",e.font=c.string,t.x=hi(this,m,s),e.fillStyle=s.bodyColor,B(this.beforeBody,g),f=r&&m!=="right"?a==="center"?h/2+d:h+2+d:0,x=0,w=n.length;x0&&e.stroke()}_updateAnimationTarget(t){let e=this.chart,s=this.$animations,n=s&&s.x,o=s&&s.y;if(n||o){let a=De[t.position].call(this,this._active,this._eventPosition);if(!a)return;let r=this._size=No(this,t),l=Object.assign({},a,this._size),h=Ho(e,t,l),d=jo(t,l,h,e);n._to===d.x&&o._to===d.y||(this.xAlign=h.xAlign,this.yAlign=h.yAlign,this.width=r.width,this.height=r.height,this.caretX=a.x,this.caretY=a.y,this._resolveAnimations().update(this,d))}}_willRender(){return!!this.opacity}draw(t){let e=this.options.setContext(this.getContext()),s=this.opacity;if(!s)return;this._updateAnimationTarget(e);let n={width:this.width,height:this.height},o={x:this.x,y:this.y};s=Math.abs(s)<.001?0:s;let a=et(e.padding),r=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&r&&(t.save(),t.globalAlpha=s,this.drawBackground(o,t,n,e),Bi(t,e.textDirection),o.y+=a.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),Wi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){let s=this._active,n=t.map(({datasetIndex:r,index:l})=>{let h=this.chart.getDatasetMeta(r);if(!h)throw new Error("Cannot find a dataset at index "+r);return{datasetIndex:r,element:h.data[l],index:l}}),o=!Ht(s,n),a=this._positionChanged(n,e);(o||a)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,s=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;let n=this.options,o=this._active||[],a=this._getActiveElements(t,o,e,s),r=this._positionChanged(a,t),l=e||!Ht(a,o)||r;return l&&(this._active=a,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,s,n){let o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);let a=this.chart.getElementsAtEventForMode(t,o.mode,o,s);return o.reverse&&a.reverse(),a}_positionChanged(t,e){let{caretX:s,caretY:n,options:o}=this,a=De[o.position].call(this,t,e);return a!==!1&&(s!==a.x||n!==a.y)}}var Lr={id:"tooltip",_element:Xo,positioners:De,afterInit(i,t,e){e&&(i.tooltip=new Xo({chart:i,options:e}))},beforeUpdate(i,t,e){i.tooltip&&i.tooltip.initialize(e)},reset(i,t,e){i.tooltip&&i.tooltip.initialize(e)},afterDraw(i){let t=i.tooltip;if(t&&t._willRender()){let e={tooltip:t};if(i.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(i.ctx),i.notifyPlugins("afterTooltipDraw",e)}},afterEvent(i,t){if(i.tooltip){let e=t.replay;i.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(i,t)=>t.bodyFont.size,boxWidth:(i,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Uo},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:i=>i!=="filter"&&i!=="itemSort"&&i!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};return K.register(ro,ko,os,G),K.helpers={...wa},K._adapters=eo,K.Animation=Tn,K.Animations=Xi,K.animator=vt,K.controllers=gt.controllers.items,K.DatasetController=At,K.Element=Mt,K.elements=os,K.Interaction=mn,K.layouts=it,K.platforms=On,K.Scale=Wt,K.Ticks=fe,Object.assign(K,ro,ko,os,G,On),K.Chart=K,typeof window<"u"&&(window.Chart=K),K})});var Qr=Wr(Ko());window.chartInstances=window.chartInstances||{};(function(){if(!window.chartScriptInitialized){let G=function(){let L=getComputedStyle(document.documentElement);return{foreground:L.getPropertyValue("--foreground").trim()||"#000",background:L.getPropertyValue("--background").trim()||"#fff",mutedForeground:L.getPropertyValue("--muted-foreground").trim()||"#666",border:L.getPropertyValue("--border").trim()||"#ccc"}},W=function(L){if(!L||!L.id||!L.hasAttribute("data-chart-id")||L.hasAttribute("data-initialized"))return;L.setAttribute("data-initialized","true"),window.chartInstances[L.id]&&ht(L);let X=L.getAttribute("data-chart-id"),E=document.getElementById(X);if(E)try{let j=JSON.parse(E.textContent),Z=G();Chart.defaults.elements.point.radius=0,Chart.defaults.elements.point.hoverRadius=5;let N=["pie","doughnut","bar","radar"].includes(j.type),B={display:j.showLegend||!1,labels:{color:Z.foreground}},Ht={backgroundColor:Z.background,bodyColor:Z.mutedForeground,titleColor:Z.foreground,borderColor:Z.border,borderWidth:1},jt=j.type==="radar"?{r:{grid:{color:Z.border,display:j.showYGrid!==!1},ticks:{color:Z.mutedForeground,backdropColor:"transparent",display:j.showYLabels!==!1},angleLines:{color:Z.border,display:j.showXGrid!==!1},pointLabels:{color:Z.foreground,font:{size:12}},border:{display:j.showYAxis!==!1,color:Z.border},beginAtZero:!0}}:{x:{beginAtZero:!0,display:j.showXLabels!==!1||j.showXGrid!==!1||j.showXAxis!==!1,border:{display:j.showXAxis!==!1,color:Z.border},ticks:{display:j.showXLabels!==!1,color:Z.mutedForeground},grid:{display:j.showXGrid!==!1,color:Z.border},stacked:j.stacked||!1},y:{offset:!0,beginAtZero:!0,display:j.showYLabels!==!1||j.showYGrid!==!1||j.showYAxis!==!1,border:{display:j.showYAxis!==!1,color:Z.border},ticks:{display:j.showYLabels!==!1,color:Z.mutedForeground},grid:{display:j.showYGrid!==!1,color:Z.border},stacked:j.stacked||!1}},Ce={...j,options:{responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!!N,axis:"xy",mode:N?"nearest":"index"},indexAxis:j.horizontal?"y":"x",plugins:{legend:B,tooltip:Ht},scales:jt}};window.chartInstances[L.id]=new Chart(L,Ce)}catch{}},ht=function(L){if(!(!L||!L.id||!window.chartInstances[L.id]))try{window.chartInstances[L.id].destroy()}finally{delete window.chartInstances[L.id]}},I=function(L=document){if(!(typeof Chart>"u"))for(let X of L.querySelectorAll("canvas[data-chart-id]:not([data-initialized])"))W(X)},F=function(){typeof Chart<"u"?I():setTimeout(F,100)};window.templUI=window.templUI||{},window.templUI.chart={init:I,cleanup:ht},document.addEventListener("DOMContentLoaded",F),new MutationObserver(()=>{let L;clearTimeout(L),L=setTimeout(()=>{for(let X of document.querySelectorAll("canvas[data-chart-id]"))window.chartInstances[X.id]&&(ht(X),W(X))},50)}).observe(document.documentElement,{attributes:!0,attributeFilter:["class","style"]}),window.chartScriptInitialized=!0}})();})(); +/*! + * Chart.js v4.4.8 + * https://www.chartjs.org + * (c) 2025 Chart.js Contributors + * Released under the MIT License + */ +/*! + * @kurkle/color v0.3.2 + * https://github.com/kurkle/color#readme + * (c) 2023 Jukka Kurkela + * Released under the MIT License + */ diff --git a/server/web/assets/js/code.min.js b/server/web/assets/js/code.min.js new file mode 100644 index 0000000..ad56564 --- /dev/null +++ b/server/web/assets/js/code.min.js @@ -0,0 +1,10 @@ +(()=>{var Wn=Object.create;var En=Object.defineProperty;var Qn=Object.getOwnPropertyDescriptor;var Xn=Object.getOwnPropertyNames;var Vn=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty;var Yn=(j,F)=>()=>(F||j((F={exports:{}}).exports,F),F.exports);var et=(j,F,W,C)=>{if(F&&typeof F=="object"||typeof F=="function")for(let z of Xn(F))!Jn.call(j,z)&&z!==W&&En(j,z,{get:()=>F[z],enumerable:!(C=Qn(F,z))||C.enumerable});return j};var nt=(j,F,W)=>(W=j!=null?Wn(Vn(j)):{},et(F||!j||!j.__esModule?En(W,"default",{value:j,enumerable:!0}):W,j));var wn=Yn((yn,je)=>{window.hljs=function(){"use strict";function j(e){return e instanceof Map?e.clear=e.delete=e.set=()=>{throw Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=()=>{throw Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(n=>{let t=e[n],a=typeof t;a!=="object"&&a!=="function"||Object.isFrozen(t)||j(t)}),e}class F{constructor(n){n.data===void 0&&(n.data={}),this.data=n.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function W(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function C(e,...n){let t=Object.create(null);for(let a in e)t[a]=e[a];return n.forEach(a=>{for(let r in a)t[r]=a[r]}),t}let z=e=>!!e.scope;class V{constructor(n,t){this.buffer="",this.classPrefix=t.classPrefix,n.walk(this)}addText(n){this.buffer+=W(n)}openNode(n){if(!z(n))return;let t=((a,{prefix:r})=>{if(a.startsWith("language:"))return a.replace("language:","language-");if(a.includes(".")){let i=a.split(".");return[`${r}${i.shift()}`,...i.map((o,s)=>`${o}${"_".repeat(s+1)}`)].join(" ")}return`${r}${a}`})(n.scope,{prefix:this.classPrefix});this.span(t)}closeNode(n){z(n)&&(this.buffer+="")}value(){return this.buffer}span(n){this.buffer+=``}}let P=(e={})=>{let n={children:[]};return Object.assign(n,e),n};class Q{constructor(){this.rootNode=P(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(n){this.top.children.push(n)}openNode(n){let t=P({scope:n});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(n){return this.constructor._walk(n,this.rootNode)}static _walk(n,t){return typeof t=="string"?n.addText(t):t.children&&(n.openNode(t),t.children.forEach(a=>this._walk(n,a)),n.closeNode(t)),n}static _collapse(n){typeof n!="string"&&n.children&&(n.children.every(t=>typeof t=="string")?n.children=[n.children.join("")]:n.children.forEach(t=>{Q._collapse(t)}))}}class ue extends Q{constructor(n){super(),this.options=n}addText(n){n!==""&&this.add(n)}startScope(n){this.openNode(n)}endScope(){this.closeNode()}__addSublanguage(n,t){let a=n.root;t&&(a.scope="language:"+t),this.add(a)}toHTML(){return new V(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function te(e){return e?typeof e=="string"?e:e.source:null}function X(e){return N("(?=",e,")")}function xe(e){return N("(?:",e,")*")}function vn(e){return N("(?:",e,")?")}function N(...e){return e.map(n=>te(n)).join("")}function U(...e){return"("+((t=>{let a=t[t.length-1];return typeof a=="object"&&a.constructor===Object?(t.splice(t.length-1,1),a):{}})(e).capture?"":"?:")+e.map(t=>te(t)).join("|")+")"}function Ue(e){return RegExp(e.toString()+"|").exec("").length-1}let Nn=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Oe(e,{joinWith:n}){let t=0;return e.map(a=>{t+=1;let r=t,i=te(a),o="";for(;i.length>0;){let s=Nn.exec(i);if(!s){o+=i;break}o+=i.substring(0,s.index),i=i.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+(Number(s[1])+r):(o+=s[0],s[0]==="("&&t++)}return o}).map(a=>`(${a})`).join(n)}let Pe="[a-zA-Z]\\w*",Me="[a-zA-Z_]\\w*",Ke="\\b\\d+(\\.\\d+)?",qe="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",He="\\b(0b[01]+)",de={begin:"\\\\[\\s\\S]",relevance:0},kn={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[de]},xn={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[de]},be=(e,n,t={})=>{let a=C({scope:"comment",begin:e,end:n,contains:[]},t);a.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});let r=U("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return a.contains.push({begin:N(/[ ]+/,"(",r,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),a},On=be("//","$"),Mn=be("/\\*","\\*/"),An=be("#","$");var me=Object.freeze({__proto__:null,APOS_STRING_MODE:kn,BACKSLASH_ESCAPE:de,BINARY_NUMBER_MODE:{scope:"number",begin:He,relevance:0},BINARY_NUMBER_RE:He,COMMENT:be,C_BLOCK_COMMENT_MODE:Mn,C_LINE_COMMENT_MODE:On,C_NUMBER_MODE:{scope:"number",begin:qe,relevance:0},C_NUMBER_RE:qe,END_SAME_AS_BEGIN:e=>Object.assign(e,{"on:begin":(n,t)=>{t.data._beginMatch=n[1]},"on:end":(n,t)=>{t.data._beginMatch!==n[1]&&t.ignoreMatch()}}),HASH_COMMENT_MODE:An,IDENT_RE:Pe,MATCH_NOTHING_RE:/\b\B/,METHOD_GUARD:{begin:"\\.\\s*"+Me,relevance:0},NUMBER_MODE:{scope:"number",begin:Ke,relevance:0},NUMBER_RE:Ke,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},QUOTE_STRING_MODE:xn,REGEXP_MODE:{scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[de,{begin:/\[/,end:/\]/,relevance:0,contains:[de]}]},RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{let n=/^#![ ]*\//;return e.binary&&(e.begin=N(n,/.*\b/,e.binary,/\b.*/)),C({scope:"meta",begin:n,end:/$/,relevance:0,"on:begin":(t,a)=>{t.index!==0&&a.ignoreMatch()}},e)},TITLE_MODE:{scope:"title",begin:Pe,relevance:0},UNDERSCORE_IDENT_RE:Me,UNDERSCORE_TITLE_MODE:{scope:"title",begin:Me,relevance:0}});function Sn(e,n){e.input[e.index-1]==="."&&n.ignoreMatch()}function Cn(e,n){e.className!==void 0&&(e.scope=e.className,delete e.className)}function Tn(e,n){n&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Sn,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Rn(e,n){Array.isArray(e.illegal)&&(e.illegal=U(...e.illegal))}function In(e,n){if(e.match){if(e.begin||e.end)throw Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function Dn(e,n){e.relevance===void 0&&(e.relevance=1)}let Ln=(e,n)=>{if(!e.beforeMatch)return;if(e.starts)throw Error("beforeMatch cannot be used with starts");let t=Object.assign({},e);Object.keys(e).forEach(a=>{delete e[a]}),e.keywords=t.keywords,e.begin=N(t.beforeMatch,X(t.begin)),e.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},e.relevance=0,delete t.beforeMatch},Bn=["of","and","for","in","not","or","if","then","parent","list","value"];function Ge(e,n,t="keyword"){let a=Object.create(null);return typeof e=="string"?r(t,e.split(" ")):Array.isArray(e)?r(t,e):Object.keys(e).forEach(i=>{Object.assign(a,Ge(e[i],n,i))}),a;function r(i,o){n&&(o=o.map(s=>s.toLowerCase())),o.forEach(s=>{let l=s.split("|");a[l[0]]=[i,$n(l[0],l[1])]})}}function $n(e,n){return n?Number(n):(t=>Bn.includes(t.toLowerCase()))(e)?0:1}let Ze={},se=e=>{console.error(e)},We=(e,...n)=>{console.log("WARN: "+e,...n)},le=(e,n)=>{Ze[`${e}/${n}`]||(console.log(`Deprecated as of ${e}. ${n}`),Ze[`${e}/${n}`]=!0)},pe=Error();function Qe(e,n,{key:t}){let a=0,r=e[t],i={},o={};for(let s=1;s<=n.length;s++)o[s+a]=r[s],i[s+a]=!0,a+=Ue(n[s-1]);e[t]=o,e[t]._emit=i,e[t]._multi=!0}function Fn(e){(n=>{n.scope&&typeof n.scope=="object"&&n.scope!==null&&(n.beginScope=n.scope,delete n.scope)})(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),(n=>{if(Array.isArray(n.begin)){if(n.skip||n.excludeBegin||n.returnBegin)throw se("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pe;if(typeof n.beginScope!="object"||n.beginScope===null)throw se("beginScope must be object"),pe;Qe(n,n.begin,{key:"beginScope"}),n.begin=Oe(n.begin,{joinWith:""})}})(e),(n=>{if(Array.isArray(n.end)){if(n.skip||n.excludeEnd||n.returnEnd)throw se("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pe;if(typeof n.endScope!="object"||n.endScope===null)throw se("endScope must be object"),pe;Qe(n,n.end,{key:"endScope"}),n.end=Oe(n.end,{joinWith:""})}})(e)}function zn(e){function n(r,i){return RegExp(te(r),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(i?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(i,o){o.position=this.position++,this.matchIndexes[this.matchAt]=o,this.regexes.push([o,i]),this.matchAt+=Ue(i)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);let i=this.regexes.map(o=>o[1]);this.matcherRe=n(Oe(i,{joinWith:"|"}),!0),this.lastIndex=0}exec(i){this.matcherRe.lastIndex=this.lastIndex;let o=this.matcherRe.exec(i);if(!o)return null;let s=o.findIndex((c,g)=>g>0&&c!==void 0),l=this.matchIndexes[s];return o.splice(0,s),Object.assign(o,l)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(i){if(this.multiRegexes[i])return this.multiRegexes[i];let o=new t;return this.rules.slice(i).forEach(([s,l])=>o.addRule(s,l)),o.compile(),this.multiRegexes[i]=o,o}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(i,o){this.rules.push([i,o]),o.type==="begin"&&this.count++}exec(i){let o=this.getMatcher(this.regexIndex);o.lastIndex=this.lastIndex;let s=o.exec(i);if(this.resumingScanAtSamePosition()&&!(s&&s.index===this.lastIndex)){let l=this.getMatcher(0);l.lastIndex=this.lastIndex+1,s=l.exec(i)}return s&&(this.regexIndex+=s.position+1,this.regexIndex===this.count&&this.considerAll()),s}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=C(e.classNameAliases||{}),function r(i,o){let s=i;if(i.isCompiled)return s;[Cn,In,Fn,Ln].forEach(c=>c(i,o)),e.compilerExtensions.forEach(c=>c(i,o)),i.__beforeBegin=null,[Tn,Rn,Dn].forEach(c=>c(i,o)),i.isCompiled=!0;let l=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),l=i.keywords.$pattern,delete i.keywords.$pattern),l=l||/\w+/,i.keywords&&(i.keywords=Ge(i.keywords,e.case_insensitive)),s.keywordPatternRe=n(l,!0),o&&(i.begin||(i.begin=/\B|\b/),s.beginRe=n(s.begin),i.end||i.endsWithParent||(i.end=/\B|\b/),i.end&&(s.endRe=n(s.end)),s.terminatorEnd=te(s.end)||"",i.endsWithParent&&o.terminatorEnd&&(s.terminatorEnd+=(i.end?"|":"")+o.terminatorEnd)),i.illegal&&(s.illegalRe=n(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(c=>(g=>(g.variants&&!g.cachedVariants&&(g.cachedVariants=g.variants.map(p=>C(g,{variants:null},p))),g.cachedVariants?g.cachedVariants:Xe(g)?C(g,{starts:g.starts?C(g.starts):null}):Object.isFrozen(g)?C(g):g))(c==="self"?i:c))),i.contains.forEach(c=>{r(c,s)}),i.starts&&r(i.starts,o),s.matcher=(c=>{let g=new a;return c.contains.forEach(p=>g.addRule(p.begin,{rule:p,type:"begin"})),c.terminatorEnd&&g.addRule(c.terminatorEnd,{type:"end"}),c.illegal&&g.addRule(c.illegal,{type:"illegal"}),g})(s),s}(e)}function Xe(e){return!!e&&(e.endsWithParent||Xe(e.starts))}class jn extends Error{constructor(n,t){super(n),this.name="HTMLInjectionError",this.html=t}}let Ae=W,Ve=C,Je=Symbol("nomatch"),Ye=e=>{let n=Object.create(null),t=Object.create(null),a=[],r=!0,i="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]},s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:ue};function l(d){return s.noHighlightRe.test(d)}function c(d,m,h){let D="",T="";typeof m=="object"?(D=d,h=m.ignoreIllegals,T=m.language):(le("10.7.0","highlight(lang, code, ...args) has been deprecated."),le("10.7.0",`Please use highlight(code, options) instead. +https://github.com/highlightjs/highlight.js/issues/2277`),T=d,D=m),h===void 0&&(h=!0);let A={code:D,language:T};$("before:highlight",A);let x=A.result?A.result:g(A.language,A.code,h);return x.code=A.code,$("after:highlight",x),x}function g(d,m,h,D){let T=Object.create(null);function A(){if(!f.keywords)return void E.addText(M);let u=0;f.keywordPatternRe.lastIndex=0;let _=f.keywordPatternRe.exec(M),R="";for(;_;){R+=M.substring(u,_.index);let L=H.case_insensitive?_[0].toLowerCase():_[0],K=(S=L,f.keywords[S]);if(K){let[ne,ze]=K;if(E.addText(R),R="",T[L]=(T[L]||0)+1,T[L]<=7&&(Y+=ze),ne.startsWith("_"))R+=_[0];else{let ke=H.classNameAliases[ne]||ne;O(_[0],ke)}}else R+=_[0];u=f.keywordPatternRe.lastIndex,_=f.keywordPatternRe.exec(M)}var S;R+=M.substring(u),E.addText(R)}function x(){f.subLanguage!=null?(()=>{if(M==="")return;let u=null;if(typeof f.subLanguage=="string"){if(!n[f.subLanguage])return void E.addText(M);u=g(f.subLanguage,M,!0,Ne[f.subLanguage]),Ne[f.subLanguage]=u._top}else u=p(M,f.subLanguage.length?f.subLanguage:null);f.relevance>0&&(Y+=u.relevance),E.__addSublanguage(u._emitter,u.language)})():A(),M=""}function O(u,_){u!==""&&(E.startScope(_),E.addText(u),E.endScope())}function k(u,_){let R=1,S=_.length-1;for(;R<=S;){if(!u._emit[R]){R++;continue}let L=H.classNameAliases[u[R]]||u[R],K=_[R];L?O(K,L):(M=K,A(),M=""),R++}}function B(u,_){return u.scope&&typeof u.scope=="string"&&E.openNode(H.classNameAliases[u.scope]||u.scope),u.beginScope&&(u.beginScope._wrap?(O(M,H.classNameAliases[u.beginScope._wrap]||u.beginScope._wrap),M=""):u.beginScope._multi&&(k(u.beginScope,_),M="")),f=Object.create(u,{parent:{value:f}}),f}function G(u,_,R){let S=((L,K)=>{let ne=L&&L.exec(K);return ne&&ne.index===0})(u.endRe,R);if(S){if(u["on:end"]){let L=new F(u);u["on:end"](_,L),L.isMatchIgnored&&(S=!1)}if(S){for(;u.endsParent&&u.parent;)u=u.parent;return u}}if(u.endsWithParent)return G(u.parent,_,R)}function re(u){return f.matcher.regexIndex===0?(M+=u[0],1):(Fe=!0,0)}function ae(u){let _=u[0],R=m.substring(u.index),S=G(f,u,R);if(!S)return Je;let L=f;f.endScope&&f.endScope._wrap?(x(),O(_,f.endScope._wrap)):f.endScope&&f.endScope._multi?(x(),k(f.endScope,u)):L.skip?M+=_:(L.returnEnd||L.excludeEnd||(M+=_),x(),L.excludeEnd&&(M=_));do f.scope&&E.closeNode(),f.skip||f.subLanguage||(Y+=f.relevance),f=f.parent;while(f!==S.parent);return S.starts&&B(S.starts,u),L.returnEnd?0:_.length}let Z={};function ie(u,_){let R=_&&_[0];if(M+=u,R==null)return x(),0;if(Z.type==="begin"&&_.type==="end"&&Z.index===_.index&&R===""){if(M+=m.slice(_.index,_.index+1),!r){let S=Error(`0 width match regex (${d})`);throw S.languageName=d,S.badRule=Z.rule,S}return 1}if(Z=_,_.type==="begin")return(S=>{let L=S[0],K=S.rule,ne=new F(K),ze=[K.__beforeBegin,K["on:begin"]];for(let ke of ze)if(ke&&(ke(S,ne),ne.isMatchIgnored))return re(L);return K.skip?M+=L:(K.excludeBegin&&(M+=L),x(),K.returnBegin||K.excludeBegin||(M=L)),B(K,S),K.returnBegin?0:L.length})(_);if(_.type==="illegal"&&!h){let S=Error('Illegal lexeme "'+R+'" for mode "'+(f.scope||"")+'"');throw S.mode=f,S}if(_.type==="end"){let S=ae(_);if(S!==Je)return S}if(_.type==="illegal"&&R==="")return M+=` +`,1;if($e>1e5&&$e>3*_.index)throw Error("potential infinite loop, way more iterations than matches");return M+=R,R.length}let H=v(d);if(!H)throw se(i.replace("{}",d)),Error('Unknown language: "'+d+'"');let ge=zn(H),oe="",f=D||ge,Ne={},E=new s.__emitter(s);(()=>{let u=[];for(let _=f;_!==H;_=_.parent)_.scope&&u.unshift(_.scope);u.forEach(_=>E.openNode(_))})();let M="",Y=0,ee=0,$e=0,Fe=!1;try{if(H.__emitTokens)H.__emitTokens(m,E);else{for(f.matcher.considerAll();;){$e++,Fe?Fe=!1:f.matcher.considerAll(),f.matcher.lastIndex=ee;let u=f.matcher.exec(m);if(!u)break;let _=ie(m.substring(ee,u.index),u);ee=u.index+_}ie(m.substring(ee))}return E.finalize(),oe=E.toHTML(),{language:d,value:oe,relevance:Y,illegal:!1,_emitter:E,_top:f}}catch(u){if(u.message&&u.message.includes("Illegal"))return{language:d,value:Ae(m),illegal:!0,relevance:0,_illegalBy:{message:u.message,index:ee,context:m.slice(ee-100,ee+100),mode:u.mode,resultSoFar:oe},_emitter:E};if(r)return{language:d,value:Ae(m),illegal:!1,relevance:0,errorRaised:u,_emitter:E,_top:f};throw u}}function p(d,m){m=m||s.languages||Object.keys(n);let h=(k=>{let B={value:Ae(k),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return B._emitter.addText(k),B})(d),D=m.filter(v).filter(q).map(k=>g(k,d,!1));D.unshift(h);let T=D.sort((k,B)=>{if(k.relevance!==B.relevance)return B.relevance-k.relevance;if(k.language&&B.language){if(v(k.language).supersetOf===B.language)return 1;if(v(B.language).supersetOf===k.language)return-1}return 0}),[A,x]=T,O=A;return O.secondBest=x,O}function b(d){let m=null,h=(A=>{let x=A.className+" ";x+=A.parentNode?A.parentNode.className:"";let O=s.languageDetectRe.exec(x);if(O){let k=v(O[1]);return k||(We(i.replace("{}",O[1])),We("Falling back to no-highlight mode for this block.",A)),k?O[1]:"no-highlight"}return x.split(/\s+/).find(k=>l(k)||v(k))})(d);if(l(h))return;if($("before:highlightElement",{el:d,language:h}),d.dataset.highlighted)return void console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",d);if(d.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(d)),s.throwUnescapedHTML))throw new jn("One of your code blocks includes unescaped HTML.",d.innerHTML);m=d;let D=m.textContent,T=h?c(D,{language:h,ignoreIllegals:!0}):p(D);d.innerHTML=T.value,d.dataset.highlighted="yes",((A,x,O)=>{let k=x&&t[x]||O;A.classList.add("hljs"),A.classList.add("language-"+k)})(d,h,T.language),d.result={language:T.language,re:T.relevance,relevance:T.relevance},T.secondBest&&(d.secondBest={language:T.secondBest.language,relevance:T.secondBest.relevance}),$("after:highlightElement",{el:d,result:T,text:D})}let y=!1;function w(){if(document.readyState==="loading")return y||window.addEventListener("DOMContentLoaded",()=>{w()},!1),void(y=!0);document.querySelectorAll(s.cssSelector).forEach(b)}function v(d){return d=(d||"").toLowerCase(),n[d]||n[t[d]]}function I(d,{languageName:m}){typeof d=="string"&&(d=[d]),d.forEach(h=>{t[h.toLowerCase()]=m})}function q(d){let m=v(d);return m&&!m.disableAutodetect}function $(d,m){let h=d;a.forEach(D=>{D[h]&&D[h](m)})}Object.assign(e,{highlight:c,highlightAuto:p,highlightAll:w,highlightElement:b,highlightBlock:d=>(le("10.7.0","highlightBlock will be removed entirely in v12.0"),le("10.7.0","Please use highlightElement now."),b(d)),configure:d=>{s=Ve(s,d)},initHighlighting:()=>{w(),le("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:()=>{w(),le("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:(d,m)=>{let h=null;try{h=m(e)}catch(D){if(se("Language definition for '{}' could not be registered.".replace("{}",d)),!r)throw D;se(D),h=o}h.name||(h.name=d),n[d]=h,h.rawDefinition=m.bind(null,e),h.aliases&&I(h.aliases,{languageName:d})},unregisterLanguage:d=>{delete n[d];for(let m of Object.keys(t))t[m]===d&&delete t[m]},listLanguages:()=>Object.keys(n),getLanguage:v,registerAliases:I,autoDetection:q,inherit:Ve,addPlugin:d=>{(m=>{m["before:highlightBlock"]&&!m["before:highlightElement"]&&(m["before:highlightElement"]=h=>{m["before:highlightBlock"](Object.assign({block:h.el},h))}),m["after:highlightBlock"]&&!m["after:highlightElement"]&&(m["after:highlightElement"]=h=>{m["after:highlightBlock"](Object.assign({block:h.el},h))})})(d),a.push(d)},removePlugin:d=>{let m=a.indexOf(d);m!==-1&&a.splice(m,1)}}),e.debugMode=()=>{r=!1},e.safeMode=()=>{r=!0},e.versionString="11.11.1",e.regex={concat:N,lookahead:X,either:U,optional:vn,anyNumberOfTimes:xe};for(let d in me)typeof me[d]=="object"&&j(me[d]);return Object.assign(e,me),e},en=Ye({});en.newInstance=()=>Ye({});let Se=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ce=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video","defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Te=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),_e=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),he=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Re=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),Un=_e.concat(he).sort().reverse();var ce="[0-9](_*[0-9])*",fe=`\\.(${ce})`,Ee="[0-9a-fA-F](_*[0-9a-fA-F])*",Ie={className:"number",variants:[{begin:`(\\b(${ce})((${fe})|\\.)?|(${fe}))[eE][+-]?(${ce})[fFdD]?\\b`},{begin:`\\b(${ce})((${fe})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${fe})[fFdD]?\\b`},{begin:`\\b(${ce})[fFdD]\\b`},{begin:`\\b0[xX]((${Ee})\\.?|(${Ee})?\\.(${Ee}))[pP][+-]?(${ce})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ee})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function nn(e,n,t){return t===-1?"":e.replace(n,a=>nn(e,n,t-1))}let ye="[A-Za-z$_][0-9A-Za-z$_]*",tn=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],an=["true","false","null","undefined","NaN","Infinity"],sn=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],rn=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],on=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],ln=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cn=[].concat(on,sn,rn);function dn(e){let n=e.regex,t=ye,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(B,G)=>{let re=B[0].length+B.index,ae=B.input[re];if(ae==="<"||ae===",")return void G.ignoreMatch();let Z;ae===">"&&(((H,{after:ge})=>{let oe="B+"\\s*\\("),n.concat("(?!",T.join("|"),")")),t,n.lookahead(/\s*\(/)),className:"title.function",relevance:0};var T;let A={begin:n.concat(/\./,n.lookahead(n.concat(t,/(?![0-9A-Za-z$_(])/))),end:t,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},x={match:[/get|set/,/\s+/,t,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},$]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",k={match:[/const|var|let/,/\s+/,t,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[$]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:r,exports:{PARAMS_CONTAINS:q,CLASS_REFERENCE:m},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),{label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,g,p,b,y,w,{match:/\$\d+/},l,m,{scope:"attr",match:t+n.lookahead(":"),relevance:0},k,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[w,e.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:q}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:"<>",end:""},{match:/<[A-Za-z0-9\\._:-]+\s*\/>/},{begin:a.begin,"on:begin":a.isTrulyOpeningTag,end:a.end}],subLanguage:"xml",contains:[{begin:a.begin,end:a.end,skip:!0,contains:["self"]}]}]},h,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[$,e.inherit(e.TITLE_MODE,{begin:t,className:"title.function"})]},{match:/\.\.\./,relevance:0},A,{match:"\\$"+t,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[$]},D,{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},d,x,{match:/\$[(.]/}]}}let De=e=>N(/\b/,e,/\w$/.test(e)?/\b/:/\B/),Pn=["Protocol","Type"].map(De),gn=["init","self"].map(De),Kn=["Any","Self"],Le=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],un=["false","nil","true"],qn=["assignment","associativity","higherThan","left","lowerThan","none","right"],Hn=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],bn=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],mn=U(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),pn=U(mn,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),Be=N(mn,pn,"*"),_n=U(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),we=U(_n,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),J=N(_n,we,"*"),ve=N(/[A-Z]/,we,"*"),Gn=["attached","autoclosure",N(/convention\(/,U("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",N(/objc\(/,J,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],Zn=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];var hn=Object.freeze({__proto__:null,grmr_bash:e=>{let n=e.regex,t={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[t]}]};Object.assign(t,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});let r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),o={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},s={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t,r]};r.contains.push(s);let l={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,t]},c=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],literal:["true","false"],built_in:["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset","alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias","set","shopt","autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp","chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"]},contains:[c,e.SHEBANG(),g,l,i,o,{match:/(\/[a-z._-]+)+/},s,{match:/\\"/},{className:"string",begin:/'/,end:/'/},{match:/\\'/},t]}},grmr_c:e=>{let n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="("+a+"|"+n.optional(r)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",o={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:n.optional(r)+e.IDENT_RE,relevance:0},p=n.optional(r)+e.IDENT_RE+"\\s*\\(",b={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},y=[c,o,t,e.C_BLOCK_COMMENT_MODE,l,s],w={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:y.concat([{begin:/\(/,end:/\)/,keywords:b,contains:y.concat(["self"]),relevance:0}]),relevance:0},v={begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:b,relevance:0},{begin:p,returnBegin:!0,contains:[e.inherit(g,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C",aliases:["h"],keywords:b,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:c,strings:s,keywords:b}}},grmr_cpp:e=>{let n=e.regex,t=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),a="decltype\\(auto\\)",r="[a-zA-Z_]\\w*::",i="(?!struct)("+a+"|"+n.optional(r)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",o={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},s={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},l={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},c={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(s,{className:"string"}),{className:"string",begin:/<.*?>/},t,e.C_BLOCK_COMMENT_MODE]},g={className:"title",begin:n.optional(r)+e.IDENT_RE,relevance:0},p=n.optional(r)+e.IDENT_RE+"\\s*\\(",b={type:["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],keyword:["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"]},y={className:"function.dispatch",relevance:0,keywords:{_hint:["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"]},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},w=[y,c,o,t,e.C_BLOCK_COMMENT_MODE,l,s],v={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:b,contains:w.concat([{begin:/\(/,end:/\)/,keywords:b,contains:w.concat(["self"]),relevance:0}]),relevance:0},I={className:"function",begin:"("+i+"[\\*&\\s]+)+"+p,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:b,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:a,keywords:b,relevance:0},{begin:p,returnBegin:!0,contains:[g],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[s,l]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:[t,e.C_BLOCK_COMMENT_MODE,s,l,o,{begin:/\(/,end:/\)/,keywords:b,relevance:0,contains:["self",t,e.C_BLOCK_COMMENT_MODE,s,l,o]}]},o,t,e.C_BLOCK_COMMENT_MODE,c]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:b,illegal:"",keywords:b,contains:["self",o]},{begin:e.IDENT_RE+"::",keywords:b},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}},grmr_csharp:e=>{let n={keyword:["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"].concat(["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"]),built_in:["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],literal:["default","false","null","true"]},t=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},r={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},i=e.inherit(r,{illegal:/\n/}),o={className:"subst",begin:/\{/,end:/\}/,keywords:n},s=e.inherit(o,{illegal:/\n/}),l={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,s]},c={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},o]},g=e.inherit(c,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},s]});o.contains=[c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],s.contains=[g,l,i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];let p={variants:[{className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},c,l,r,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},b={begin:"<",end:">",contains:[{beginKeywords:"in out"},t]},y=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",w={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},p,a,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},t,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[t,b,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+y+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{beginKeywords:"public private protected static internal protected abstract async extern override unsafe virtual new sealed partial",relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,b],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,contains:[p,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},w]}},grmr_css:e=>{let n=e.regex,t=Se(e),a=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[t.BLOCK_COMMENT,{begin:/-(webkit|moz|ms|o)-(?=[a-z])/},t.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\.[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+_e.join("|")+")"},{begin:":(:)?("+he.join("|")+")"}]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Re.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[t.BLOCK_COMMENT,t.HEXCOLOR,t.IMPORTANT,t.CSS_NUMBER_MODE,...a,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...a,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},t.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:/@-?\w[\w]*(-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Te.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...a,t.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Ce.join("|")+")\\b"}]}},grmr_diff:e=>{let n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}},grmr_go:e=>{let n={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:n,illegal:"{let n=e.regex;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:n.concat(/[_A-Za-z][_0-9A-Za-z]*/,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}},grmr_ini:e=>{let n=e.regex,t={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},a=e.COMMENT();a.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];let r={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},i={className:"literal",begin:/\bon|off|true|false|yes|no\b/},o={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},s={begin:/\[/,end:/\]/,contains:[a,i,r,o,t,"self"],relevance:0},l=n.either(/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/);return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[a,{className:"section",begin:/\[+/,end:/\]+/},{begin:n.concat(l,"(\\s*\\.\\s*",l,")*",n.lookahead(/\s*=\s*[^#\s]/)),className:"attr",starts:{end:/$/,contains:[a,s,i,r,o,t]}}]}},grmr_java:e=>{let n=e.regex,t="[\xC0-\u02B8a-zA-Z_$][\xC0-\u02B8a-zA-Z_$0-9]*",a=t+nn("(?:<"+t+"~~~(?:\\s*,\\s*"+t+"~~~)*>)?",/~~~/g,2),r={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},i={className:"meta",begin:"@"+t,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},o={className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:r,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,t],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[n.concat(/(?!else)/,t),/\s+/,t,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,t],className:{1:"keyword",3:"title.class"},contains:[o,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+a+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:r,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:r,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,Ie,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},Ie,i]}},grmr_javascript:dn,grmr_json:e=>{let n=["true","false","null"],t={scope:"literal",beginKeywords:n.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:n},contains:[{className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},{match:/[{}[\],:]/,className:"punctuation",relevance:0},e.QUOTE_STRING_MODE,t,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}},grmr_kotlin:e=>{let n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},t={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},r={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},i={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[r,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,r,a]}]};a.contains.push(i);let o={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},s={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(i,{className:"string"}),"self"]}]},l=Ie,c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),g={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},p=g;return p.variants[1].contains=[g],g.variants[1].contains=[p],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},t,o,s,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[g,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,o,s,i,e.C_NUMBER_MODE]},c]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},o,s]},i,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` +`},l]}},grmr_less:e=>{let n=Se(e),t=Un,a="[\\w-]+",r="("+a+"|@\\{"+a+"\\})",i=[],o=[],s=$=>({className:"string",begin:"~?"+$+".*?"+$}),l=($,d,m)=>({className:$,begin:d,relevance:m}),c={$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Te.join(" ")},g={begin:"\\(",end:"\\)",contains:o,keywords:c,relevance:0};o.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s("'"),s('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},n.HEXCOLOR,g,l("variable","@@?"+a,10),l("variable","@\\{"+a+"\\}"),l("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);let p=o.concat({begin:/\{/,end:/\}/,contains:i}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(o)},y={begin:r+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Re.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:o}}]},w={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:c,returnEnd:!0,contains:o,relevance:0}},v={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:p}},I={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:r,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,l("keyword","all\\b"),l("variable","@\\{"+a+"\\}"),{begin:"\\b("+Ce.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,l("selector-tag",r,0),l("selector-id","#"+r),l("selector-class","\\."+r,0),l("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+_e.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+he.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:p},{begin:"!important"},n.FUNCTION_DISPATCH]},q={begin:a+`:(:)?(${t.join("|")})`,returnBegin:!0,contains:[I]};return i.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,w,v,q,y,I,b,n.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:i}},grmr_lua:e=>{let n="\\[=*\\[",t="\\]=*\\]",a={begin:n,end:t,contains:["self"]},r=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,t,{contains:[a],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:r.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:r}].concat(r)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:n,end:t,contains:[a],relevance:5}])}},grmr_makefile:e=>{let n={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%{let n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},t={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:e.regex.concat(/\[.+?\]\(/,/[A-Za-z][A-Za-z0-9+.-]*/,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},a={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},r={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},i=e.inherit(a,{contains:[]}),o=e.inherit(r,{contains:[]});a.contains.push(o),r.contains.push(i);let s=[n,t];return[a,r,i,o].forEach(l=>{l.contains=l.contains.concat(s)}),s=s.concat(a,r),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:s},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:s}]}]},n,{className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},a,r,{className:"quote",begin:"^>\\s+",contains:s,end:"$"},{className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},t,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}},grmr_objectivec:e=>{let n=/[a-zA-Z@][a-zA-Z0-9_]*/,t={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:{"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+t.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:t,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}},grmr_perl:e=>{let n=e.regex,t=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:"abs accept alarm and atan2 bind binmode bless break caller chdir chmod chomp chop chown chr chroot class close closedir connect continue cos crypt dbmclose dbmopen defined delete die do dump each else elsif endgrent endhostent endnetent endprotoent endpwent endservent eof eval exec exists exit exp fcntl field fileno flock for foreach fork format formline getc getgrent getgrgid getgrnam gethostbyaddr gethostbyname gethostent getlogin getnetbyaddr getnetbyname getnetent getpeername getpgrp getpriority getprotobyname getprotobynumber getprotoent getpwent getpwnam getpwuid getservbyname getservbyport getservent getsockname getsockopt given glob gmtime goto grep gt hex if index int ioctl join keys kill last lc lcfirst length link listen local localtime log lstat lt ma map method mkdir msgctl msgget msgrcv msgsnd my ne next no not oct open opendir or ord our pack package pipe pop pos print printf prototype push q|0 qq quotemeta qw qx rand read readdir readline readlink readpipe recv redo ref rename require reset return reverse rewinddir rindex rmdir say scalar seek seekdir select semctl semget semop send setgrent sethostent setnetent setpgrp setpriority setprotoent setpwent setservent setsockopt shift shmctl shmget shmread shmwrite shutdown sin sleep socket socketpair sort splice split sprintf sqrt srand stat state study sub substr symlink syscall sysopen sysread sysseek system syswrite tell telldir tie tied time times tr truncate uc ucfirst umask undef unless unlink unpack unshift untie until use utime values vec wait waitpid wantarray warn when while write x|0 xor y|0"},r={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},i={begin:/->\{/,end:/\}/},o={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},s={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[o]},l={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},c=[e.BACKSLASH_ESCAPE,r,s],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],p=(w,v,I="\\1")=>{let q=I==="\\1"?I:n.concat(I,v);return n.concat(n.concat("(?:",w,")"),v,/(?:\\.|[^\\\/])*?/,q,/(?:\\.|[^\\\/])*?/,I,t)},b=(w,v,I)=>n.concat(n.concat("(?:",w,")"),v,/(?:\\.|[^\\\/])*?/,I,t),y=[s,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),i,{className:"string",contains:c,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},l,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:p("s|tr|y",n.either(...g,{capture:!0}))},{begin:p("s|tr|y","\\(","\\)")},{begin:p("s|tr|y","\\[","\\]")},{begin:p("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",n.either(...g,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,o,l]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return r.contains=y,i.contains=y,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:y}},grmr_php:e=>{let n=e.regex,t=/(?![A-Za-z0-9])(?![$])/,a=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,t),r=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,t),i=n.concat(/[A-Z]+/,t),o={scope:"variable",match:"\\$+"+a},s={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},l=e.inherit(e.APOS_STRING_MODE,{illegal:null}),c=`[ +]`,g={scope:"string",variants:[e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(s)}),l,{begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(s),"on:begin":(x,O)=>{O.data._beginMatch=x[1]||x[2]},"on:end":(x,O)=>{O.data._beginMatch!==x[1]&&O.ignoreMatch()}},e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/})]},p={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},b=["false","null","true"],y=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],w=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],v={keyword:y,literal:(x=>{let O=[];return x.forEach(k=>{O.push(k),k.toLowerCase()===k?O.push(k.toUpperCase()):O.push(k.toLowerCase())}),O})(b),built_in:w},I=x=>x.map(O=>O.replace(/\|\d+$/,"")),q={variants:[{match:[/new/,n.concat(c,"+"),n.concat("(?!",I(w).join("\\b|"),"\\b)"),r],scope:{1:"keyword",4:"title.class"}}]},$=n.concat(a,"\\b(?!\\()"),d={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),$],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[r,n.concat(/::/,n.lookahead(/(?!class\b)/)),$],scope:{1:"title.class",3:"variable.constant"}},{match:[r,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[r,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},m={scope:"attr",match:n.concat(a,n.lookahead(":"),n.lookahead(/(?!::)/))},h={relevance:0,begin:/\(/,end:/\)/,keywords:v,contains:[m,o,d,e.C_BLOCK_COMMENT_MODE,g,p,q]},D={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",I(y).join("\\b|"),"|",I(w).join("\\b|"),"\\b)"),a,n.concat(c,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[h]};h.contains.push(D);let T=[m,d,e.C_BLOCK_COMMENT_MODE,g,p,q],A={begin:n.concat(/#\[\s*\\?/,n.either(r,i)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:b,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:b,keyword:["new","array"]},contains:["self",...T]},...T,{scope:"meta",variants:[{match:r},{match:i}]}]};return{case_insensitive:!1,keywords:v,contains:[A,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},{scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},{scope:"variable.language",match:/\$this\b/},o,D,d,{match:[/const/,/\s/,a],scope:{1:"keyword",3:"variable.constant"}},q,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:v,contains:["self",A,o,d,e.C_BLOCK_COMMENT_MODE,g,p]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},g,p]}},grmr_php_template:e=>({name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}),grmr_plaintext:e=>({name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}),grmr_python:e=>{let n=e.regex,t=/[\p{XID_Start}_]\p{XID_Continue}*/u,a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],r={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},i={className:"meta",begin:/^(>>>|\.\.\.) /},o={className:"subst",begin:/\{/,end:/\}/,keywords:r,illegal:/#/},s={begin:/\{\{/,relevance:0},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,i,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,i,s,o]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,o]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,o]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},c="[0-9](_?[0-9])*",g=`(\\b(${c}))?\\.(${c})|\\b(${c})\\.`,p="\\b|"+a.join("|"),b={className:"number",relevance:0,variants:[{begin:`(\\b(${c})|(${g}))[eE][+-]?(${c})[jJ]?(?=${p})`},{begin:`(${g})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${p})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${p})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${p})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${p})`},{begin:`\\b(${c})[jJ](?=${p})`}]},y={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:r,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},w={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:r,contains:["self",i,b,l,e.HASH_COMMENT_MODE]}]};return o.contains=[l,b,i],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:r,illegal:/(<\/|\?)|=>/,contains:[i,b,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},l,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[w]},{variants:[{match:[/\bclass/,/\s+/,t,/\s*/,/\(\s*/,t,/\s*\)/]},{match:[/\bclass/,/\s+/,t]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[b,w,l]}]}},grmr_python_repl:e=>({aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}),grmr_r:e=>{let n=e.regex,t=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,a=n.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),r=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,i=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:t,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:t},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[r,a]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,a]},{scope:{1:"punctuation",2:"number"},match:[i,a]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,a]}]},{scope:{3:"operator"},match:[t,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:r},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:i},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}},grmr_ruby:e=>{let n=e.regex,t="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",a=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),r=n.concat(a,/(::\w+)*/),i={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield","include","extend","prepend","public","private","protected","raise","throw"],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},o={className:"doctag",begin:"@[A-Za-z]+"},s={begin:"#<",end:">"},l=[e.COMMENT("#","$",{contains:[o]}),e.COMMENT("^=begin","^=end",{contains:[o],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],c={className:"subst",begin:/#\{/,end:/\}/,keywords:i},g={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:n.concat(/<<[-~]?'?/,n.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},p="[0-9](_?[0-9])*",b={className:"number",relevance:0,variants:[{begin:`\\b([1-9](_?[0-9])*|0)(\\.(${p}))?([eE][+-]?(${p})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},y={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:i}]},w=[g,{variants:[{match:[/class\s+/,r,/\s+<\s+/,r]},{match:[/\b(class|module)\s+/,r]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:i},{match:[/(include|extend)\s+/,r],scope:{2:"title.class"},keywords:i},{relevance:0,match:[r,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:a,scope:"title.class"},{match:[/def/,/\s+/,t],scope:{1:"keyword",3:"title.function"},contains:[y]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:t}],relevance:0},b,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:i},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(s,l),relevance:0}].concat(s,l);c.contains=w,y.contains=w;let v=[{begin:/^\s*=>/,starts:{end:"$",contains:w}},{className:"meta.prompt",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]|(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>)(?=[ ])",starts:{end:"$",keywords:i,contains:w}}];return l.unshift(s),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:i,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(v).concat(l).concat(w)}},grmr_rust:e=>{let n=e.regex,t=/(r#)?/,a=n.concat(t,e.UNDERSCORE_IDENT_RE),r=n.concat(t,e.IDENT_RE),i={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,r,n.lookahead(/\s*\(/))},o="([ui](8|16|32|64|128|size)|f(32|64))?",s=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],l=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:l,keyword:["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],literal:["true","false","Some","None","Ok","Err"],built_in:s},illegal:""},i]}},grmr_scss:e=>{let n=Se(e),t=he,a=_e,r="@[a-z-]+",i={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,n.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+Ce.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+t.join("|")+")"},i,{begin:/\(/,end:/\)/,contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Re.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[n.BLOCK_COMMENT,i,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:r,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:"and or not only",attribute:Te.join(" ")},contains:[{begin:r,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},i,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE]},n.FUNCTION_DISPATCH]}},grmr_shell:e=>({name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}),grmr_sql:e=>{let n=e.regex,t=e.COMMENT("--","$"),a=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],r=a,i=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year","add","asc","collation","desc","final","first","last","view"].filter(c=>!a.includes(c)),o={match:n.concat(/\b/,n.either(...r),/\s*\(/),relevance:0,keywords:{built_in:r}};function s(c){return n.concat(/\b/,n.either(...c.map(g=>g.replace(/\s+/,"\\s+"))),/\b/)}let l={scope:"keyword",match:s(["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"]),relevance:0};return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:((c,{exceptions:g,when:p}={})=>{let b=p;return g=g||[],c.map(y=>y.match(/\|\d+$/)||g.includes(y)?y:b(y)?y+"|0":y)})(i,{when:c=>c.length<3}),literal:["true","false","unknown"],type:["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],built_in:["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"]},contains:[{scope:"type",match:s(["double precision","large object","with timezone","without timezone"])},l,o,{scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},{scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},{begin:/"/,end:/"/,contains:[{match:/""/}]},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,{scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0}]}},grmr_swift:e=>{let n={match:/\s+/,relevance:0},t=e.COMMENT("/\\*","\\*/",{contains:["self"]}),a=[e.C_LINE_COMMENT_MODE,t],r={match:[/\./,U(...Pn,...gn)],className:{2:"keyword"}},i={match:N(/\./,U(...Le)),relevance:0},o=Le.filter(E=>typeof E=="string").concat(["_|0"]),s={variants:[{className:"keyword",match:U(...Le.filter(E=>typeof E!="string").concat(Kn).map(De),...gn)}]},l={$pattern:U(/\b\w+/,/#\w+/),keyword:o.concat(Hn),literal:un},c=[r,i,s],g=[{match:N(/\./,U(...bn)),relevance:0},{className:"built_in",match:N(/\b/,U(...bn),/(?=\()/)}],p={match:/->/,relevance:0},b=[p,{className:"operator",relevance:0,variants:[{match:Be},{match:`\\.(\\.|${pn})+`}]}],y="([0-9]_*)+",w="([0-9a-fA-F]_*)+",v={className:"number",relevance:0,variants:[{match:`\\b(${y})(\\.(${y}))?([eE][+-]?(${y}))?\\b`},{match:`\\b0x(${w})(\\.(${w}))?([pP][+-]?(${y}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},I=(E="")=>({className:"subst",variants:[{match:N(/\\/,E,/[0\\tnr"']/)},{match:N(/\\/,E,/u\{[0-9a-fA-F]{1,8}\}/)}]}),q=(E="")=>({className:"subst",match:N(/\\/,E,/[\t ]*(?:[\r\n]|\r\n)/)}),$=(E="")=>({className:"subst",label:"interpol",begin:N(/\\/,E,/\(/),end:/\)/}),d=(E="")=>({begin:N(E,/"""/),end:N(/"""/,E),contains:[I(E),q(E),$(E)]}),m=(E="")=>({begin:N(E,/"/),end:N(/"/,E),contains:[I(E),$(E)]}),h={className:"string",variants:[d(),d("#"),d("##"),d("###"),m(),m("#"),m("##"),m("###")]},D=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],T={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:D},A=E=>{let M=N(E,/\//),Y=N(/\//,E);return{begin:M,end:Y,contains:[...D,{scope:"comment",begin:`#(?!.*${Y})`,end:/$/}]}},x={scope:"regexp",variants:[A("###"),A("##"),A("#"),T]},O={match:N(/`/,J,/`/)},k=[O,{className:"variable",match:/\$\d+/},{className:"variable",match:`\\$${we}+`}],B=[{match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:Zn,contains:[...b,v,h]}]}},{scope:"keyword",match:N(/@/,U(...Gn),X(U(/\(/,/\s+/)))},{scope:"meta",match:N(/@/,J)}],G={match:X(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:N(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,we,"+")},{className:"type",match:ve,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:N(/\s+&\s+/,X(ve)),relevance:0}]},re={begin://,keywords:l,contains:[...a,...c,...B,p,G]};G.contains.push(re);let ae={begin:/\(/,end:/\)/,relevance:0,keywords:l,contains:["self",{match:N(J,/\s*:/),keywords:"_|0",relevance:0},...a,x,...c,...g,...b,v,h,...k,...B,G]},Z={begin://,keywords:"repeat each",contains:[...a,G]},ie={begin:/\(/,end:/\)/,keywords:l,contains:[{begin:U(X(N(J,/\s*:/)),X(N(J,/\s+/,J,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:J}]},...a,...c,...b,v,h,...B,G,ae],endsParent:!0,illegal:/["']/},H={match:[/(func|macro)/,/\s+/,U(O.match,J,Be)],className:{1:"keyword",3:"title.function"},contains:[Z,ie,n],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[Z,ie,n],illegal:/\[|%/},oe={match:[/operator/,/\s+/,Be],className:{1:"keyword",3:"title"}},f={begin:[/precedencegroup/,/\s+/,ve],className:{1:"keyword",3:"title"},contains:[G],keywords:[...qn,...un],end:/}/},Ne={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,J,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:l,contains:[Z,...c,{begin:/:/,end:/\{/,keywords:l,contains:[{scope:"title.class.inherited",match:ve},...c],relevance:0}]};for(let E of h.variants){let M=E.contains.find(ee=>ee.label==="interpol");M.keywords=l;let Y=[...c,...g,...b,v,h,...k];M.contains=[...Y,{begin:/\(/,end:/\)/,contains:["self",...Y]}]}return{name:"Swift",keywords:l,contains:[...a,H,ge,{match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},{match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Ne,oe,f,{beginKeywords:"import",end:/$/,contains:[...a],relevance:0},x,...c,...g,...b,v,h,...k,...B,G,ae]}},grmr_typescript:e=>{let n=e.regex,t=dn(e),a=ye,r=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},o={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:r},contains:[t.exports.CLASS_REFERENCE]},s={$pattern:ye,keyword:tn.concat(["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"]),literal:an,built_in:cn.concat(r),"variable.language":ln},l={className:"meta",begin:"@"+a},c=(b,y,w)=>{let v=b.contains.findIndex(I=>I.label===y);if(v===-1)throw Error("can not find mode to replace");b.contains.splice(v,1,w)};Object.assign(t.keywords,s),t.exports.PARAMS_CONTAINS.push(l);let g=t.contains.find(b=>b.scope==="attr"),p=Object.assign({},g,{match:n.concat(a,n.lookahead(/\s*\?:/))});return t.exports.PARAMS_CONTAINS.push([t.exports.CLASS_REFERENCE,g,p]),t.contains=t.contains.concat([l,i,o,p]),c(t,"shebang",e.SHEBANG()),c(t,"use_strict",{className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/}),t.contains.find(b=>b.label==="func.def").relevance=0,Object.assign(t,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),t},grmr_vbnet:e=>{let n=e.regex,t=/\d{1,2}\/\d{1,2}\/\d{4}/,a=/\d{4}-\d{1,2}-\d{1,2}/,r=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,i=/\d{1,2}(:\d{1,2}){1,2}/,o={className:"literal",variants:[{begin:n.concat(/# */,n.either(a,t),/ *#/)},{begin:n.concat(/# */,i,/ *#/)},{begin:n.concat(/# */,r,/ *#/)},{begin:n.concat(/# */,n.either(a,t),/ +/,n.either(r,i),/ *#/)}]},s=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),l=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[{className:"string",begin:/"(""|[^/n])"C\b/},{className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},o,{className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},{className:"label",begin:/^\w+:/},s,l,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[l]}]}},grmr_wasm:e=>{e.regex;let n=e.COMMENT(/\(;/,/;\)/);return n.contains.push("self"),{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"]},contains:[e.COMMENT(/;;/,/$/),n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},{className:"variable",begin:/\$[\w_]+/},{match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},{begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},e.QUOTE_STRING_MODE,{match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},{className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/},{className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/}]}},grmr_xml:e=>{let n=e.regex,t=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},r={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},i=e.inherit(r,{begin:/\(/,end:/\)/}),o=e.inherit(e.APOS_STRING_MODE,{className:"string"}),s=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),l={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[r,s,o,i,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[r,i,s,o]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[s]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[l],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[l],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:t,relevance:0,starts:l}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(t,/>/))),contains:[{className:"name",begin:t,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}},grmr_yaml:e=>{let n="true false yes no null",t="[\\w#;/?:@&=+$,.~*'()[\\]]+",a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]}]},r=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),i={end:",",endsWithParent:!0,excludeEnd:!0,keywords:n,relevance:0},o={begin:/\{/,end:/\}/,contains:[i],illegal:"\\n",relevance:0},s={begin:"\\[",end:"\\]",contains:[i],illegal:"\\n",relevance:0},l=[{className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+t},{className:"type",begin:"!<"+t+">"},{className:"type",begin:"!"+t},{className:"type",begin:"!!"+t},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},o,s,{className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a],c=[...l];return c.pop(),c.push(r),i.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:l}}});let fn=en;for(let e of Object.keys(hn)){let n=e.replace("grmr_","").replace("_","-");fn.registerLanguage(n,hn[e])}return fn}();typeof yn=="object"&&typeof je<"u"&&(je.exports=hljs)});var at=nt(wn());(function(){function j(C,z,V){let P=document.createElement("textarea");P.value=C,P.style.position="fixed",P.style.top="-9999px",P.style.left="-9999px",document.body.appendChild(P),P.focus(),P.select();try{document.execCommand("copy")&&(z.style.display="inline",V.style.display="none",setTimeout(()=>{z.style.display="none",V.style.display="inline"},2e3))}catch(Q){console.error("Fallback copy failed",Q)}finally{document.body.removeChild(P)}}function F(C){if(!C||C.hasAttribute("data-initialized"))return;C.setAttribute("data-initialized","true");let z=C.querySelector("[data-code-block]"),V=C.querySelector("[data-copy-button]"),P=C.querySelector("[data-icon-check]"),Q=C.querySelector("[data-icon-clipboard]");if(z&&window.hljs&&(z.classList.contains("hljs")||window.hljs.highlightElement(z)),V&&z&&P&&Q){let ue=V._copyListener;ue&&V.removeEventListener("click",ue);let te=()=>{let X=z.textContent||"",xe=()=>{P.style.display="inline",Q.style.display="none",setTimeout(()=>{P.style.display="none",Q.style.display="inline"},2e3)};navigator.clipboard&&window.isSecureContext?navigator.clipboard.writeText(X).then(xe).catch(()=>j(X,P,Q)):j(X,P,Q)};V.addEventListener("click",te),V._copyListener=te}C._codeInitialized=!0}function W(C=document){C instanceof Element&&C.matches("[data-code-component]")&&F(C);for(let z of C.querySelectorAll("[data-code-component]:not([data-initialized])"))F(z)}window.templUI=window.templUI||{},window.templUI.code={init:W},document.addEventListener("DOMContentLoaded",()=>W())})();})(); +/*! + Highlight.js v11.11.1 (git: 08cb242e7d) + (c) 2006-2024 Josh Goebel and other contributors + License: BSD-3-Clause + */ diff --git a/server/web/assets/js/datepicker.min.js b/server/web/assets/js/datepicker.min.js new file mode 100644 index 0000000..1ac4bce --- /dev/null +++ b/server/web/assets/js/datepicker.min.js @@ -0,0 +1 @@ +(()=>{(function(){function D(e){if(!e||typeof e!="string")return null;let a=e.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!a)return null;let t=parseInt(a[1],10),n=parseInt(a[2],10)-1,i=parseInt(a[3],10),l=new Date(Date.UTC(t,n,i));return l.getUTCFullYear()===t&&l.getUTCMonth()===n&&l.getUTCDate()===i?l:null}function f(e,a,t){if(!e||isNaN(e.getTime()))return"";let n={timeZone:"UTC"};switch(a){case"locale-short":n.dateStyle="short";break;case"locale-long":n.dateStyle="long";break;case"locale-full":n.dateStyle="full";break;case"locale-medium":default:n.dateStyle="medium";break}try{return new Intl.DateTimeFormat(t,n).format(e)}catch(i){console.error(`Error formatting date with Intl (locale: ${t}, format: ${a}, timezone: UTC):`,i);try{let l={dateStyle:"medium",timeZone:"UTC"};return new Intl.DateTimeFormat(t,l).format(e)}catch(l){console.error(`Error formatting date with fallback Intl (locale: ${t}, timezone: UTC):`,l);let s=e.getUTCFullYear(),o=(e.getUTCMonth()+1).toString().padStart(2,"0"),r=e.getUTCDate().toString().padStart(2,"0");return`${s}-${o}-${r}`}}}function p(e){if(!e||e.hasAttribute("data-initialized"))return;e.setAttribute("data-initialized","true");let a=e.id,t=e.querySelector("[data-datepicker-display]"),n=a+"-calendar-instance",i=document.getElementById(n),l=n+"-hidden",s=document.getElementById(l),o=i,r=s;if(!i||!s){let d=e.getAttribute("aria-controls"),c=d?document.getElementById(d):null;if(c&&(o||(o=c.querySelector("[data-calendar-container]")),!r)){let u=c.querySelector("[data-calendar-wrapper]");r=u?u.querySelector("[data-calendar-hidden-input]"):null}}if(!t||!o||!r){console.error("DatePicker init error: Missing required elements.",{datePickerID:a,displaySpan:t,calendar:o,hiddenInput:r});return}let I=e.dataset.displayFormat||"locale-medium",C=e.dataset.localeTag||"en-US",m=e.dataset.placeholder||"Select a date",h=d=>{if(!d.detail||!d.detail.date||!(d.detail.date instanceof Date))return;let c=d.detail.date,u=f(c,I,C);t.textContent=u,t.classList.remove("text-muted-foreground");let S=e.closest("[data-popover]")?.querySelector("[data-popover-trigger]");S instanceof HTMLElement?S.click():e.click()},T=()=>{if(r&&r.value){let d=D(r.value);if(d){let c=f(d,I,C);t.textContent.trim()!==c&&(t.textContent=c,t.classList.remove("text-muted-foreground"))}else t.textContent=m,t.classList.add("text-muted-foreground")}else t.textContent=m,t.classList.add("text-muted-foreground")};o.addEventListener("calendar-date-selected",h),T(),e._datePickerInitialized=!0,e._datePickerCleanup=()=>{o&&o.removeEventListener("calendar-date-selected",h)};let k=e.closest("form");k&&k.addEventListener("reset",()=>{r&&(r.value=""),t.textContent=m,t.classList.add("text-muted-foreground")})}function y(e=document){e instanceof Element&&e.matches('[data-datepicker="true"]')&&p(e),e.querySelectorAll('[data-datepicker="true"]:not([data-initialized])').forEach(a=>{p(a)})}window.templUI=window.templUI||{},window.templUI.datePicker={init:y},document.addEventListener("DOMContentLoaded",()=>y())})();})(); diff --git a/server/web/assets/js/drawer.min.js b/server/web/assets/js/drawer.min.js new file mode 100644 index 0000000..61a6db4 --- /dev/null +++ b/server/web/assets/js/drawer.min.js @@ -0,0 +1 @@ +(()=>{(function(){let d=new Map;function w(t,i){document.querySelectorAll(`[data-drawer-trigger="${t}"]`).forEach(n=>{n.setAttribute("data-open",i)})}function g(t,i){if(i)return"translate(0)";switch(t){case"left":return"translateX(-100%)";case"right":return"translateX(100%)";case"top":return"translateY(-100%)";case"bottom":return"translateY(100%)";default:return"translateX(100%)"}}function E(t){if(!t||t.hasAttribute("data-initialized"))return null;t.setAttribute("data-initialized","true");let i=t.id,n=document.getElementById(i+"-content"),v=n?.getAttribute("data-drawer-position")||"right",u=t.hasAttribute("data-initial-open");if(!n||!i)return null;let a=u;function l(e){a=e;let s=e?"block":"none",o=e?"1":"0";e&&(t.style.display=s,n.style.display=s,n.offsetHeight,t.style.transition="opacity 300ms ease",n.style.transition="opacity 300ms ease, transform 300ms ease"),t.style.opacity=o,n.style.opacity=o,n.style.transform=g(v,e),t.setAttribute("data-open",e),w(i,e),document.body.style.overflow=e?"hidden":""}function f(){l(!0),t.addEventListener("click",r),document.addEventListener("keydown",y),document.addEventListener("click",m)}function r(){l(!1),t.removeEventListener("click",r),document.removeEventListener("keydown",y),document.removeEventListener("click",m),setTimeout(()=>{a||(t.style.display="none",n.style.display="none")},300)}function A(){a?r():f()}function y(e){e.key==="Escape"&&a&&r()}function m(e){!n.contains(e.target)&&!h(e.target)&&r()}function h(e){let s=document.querySelectorAll(`[data-drawer-trigger="${i}"]`);return Array.from(s).some(o=>o.contains(e))}return n.querySelectorAll("[data-drawer-close]").forEach(e=>{e.addEventListener("click",r)}),n.querySelector("[data-drawer-inner]")?.addEventListener("click",e=>{e.stopPropagation()}),l(u),{open:f,close:r,toggle:A}}function c(t=document){t.querySelectorAll('[data-component="drawer"]:not([data-initialized])').forEach(i=>{let n=E(i);n&&i.id&&d.set(i.id,n)}),t.querySelectorAll("[data-drawer-trigger]").forEach(i=>{if(i.dataset.initialized)return;i.dataset.initialized="true";let n=i.getAttribute("data-drawer-trigger");i.addEventListener("click",()=>{d.get(n)?.toggle()})})}window.templUI=window.templUI||{},window.templUI.drawer={init:c},document.addEventListener("DOMContentLoaded",()=>c())})();})(); diff --git a/server/web/assets/js/dropdown.min.js b/server/web/assets/js/dropdown.min.js new file mode 100644 index 0000000..617cfd1 --- /dev/null +++ b/server/web/assets/js/dropdown.min.js @@ -0,0 +1 @@ +(()=>{(function(){function n(o){let t=o.currentTarget;if(t.dataset.preventClose==="true")return;let e=t.closest("[data-popover-id]");if(e){let d=e.dataset.popoverId;window.closePopover?window.closePopover(d,!0):(console.warn("popover.Script's closePopover function not found."),document.body.click())}}function i(o=document){o.querySelectorAll("[data-dropdown-item]:not([data-dropdown-submenu-trigger]):not([data-initialized])").forEach(e=>{e.setAttribute("data-initialized","true"),e.removeEventListener("click",n),e.addEventListener("click",n)})}window.templUI=window.templUI||{},window.templUI.dropdown={init:i},document.addEventListener("DOMContentLoaded",()=>i())})();})(); diff --git a/server/web/assets/js/input.min.js b/server/web/assets/js/input.min.js new file mode 100644 index 0000000..5931049 --- /dev/null +++ b/server/web/assets/js/input.min.js @@ -0,0 +1 @@ +(()=>{(function(){function s(t){t.hasAttribute("data-initialized")||(t.setAttribute("data-initialized","true"),t.addEventListener("click",function(){let n=t.getAttribute("data-toggle-password"),e=document.getElementById(n);if(e){let d=t.querySelector(".icon-open"),o=t.querySelector(".icon-closed");e.type==="password"?(e.type="text",d.classList.add("hidden"),o.classList.remove("hidden")):(e.type="password",d.classList.remove("hidden"),o.classList.add("hidden"))}}))}function i(t=document){t.querySelectorAll("[data-toggle-password]:not([data-initialized])").forEach(e=>{s(e)})}window.templUI=window.templUI||{},window.templUI.input={init:i},document.addEventListener("DOMContentLoaded",()=>i())})();})(); diff --git a/server/web/assets/js/inputotp.min.js b/server/web/assets/js/inputotp.min.js new file mode 100644 index 0000000..fa91f75 --- /dev/null +++ b/server/web/assets/js/inputotp.min.js @@ -0,0 +1 @@ +(()=>{typeof window.inputOTPState>"u"&&(window.inputOTPState=new WeakMap);(function(){if(window.inputOTPSystemInitialized)return;function p(i){if(!i||i.hasAttribute("data-initialized"))return;i.setAttribute("data-initialized","true");let l=i.querySelector("[data-input-otp-value-target]"),n=Array.from(i.querySelectorAll("[data-input-otp-slot]")).sort((t,e)=>parseInt(t.dataset.inputIndex)-parseInt(e.dataset.inputIndex));if(!l||n.length===0)return;i.hasAttribute("autofocus")&&requestAnimationFrame(()=>{let t=n[0];t&&(t.focus(),t.select())});let s=()=>{l.value=n.map(t=>t.value).join("")},f=()=>n.findIndex(t=>!t.value),o=t=>{t>=0&&tn[t].select(),0))},v=t=>{let e=t.target,a=parseInt(e.dataset.inputIndex);if(e.value===" "){e.value="";return}e.value.length>1&&(e.value=e.value.slice(-1)),e.value&&a{let e=t.target,a=parseInt(e.dataset.inputIndex);if(t.key==="Backspace"){let u=e.value;a>0&&(t.preventDefault(),u?(e.value="",s(),o(a-1)):(n[a-1].value="",s(),o(a-1)))}else t.key==="ArrowLeft"&&a>0?(t.preventDefault(),o(a-1)):t.key==="ArrowRight"&&a{let e=t.target,a=parseInt(e.dataset.inputIndex),u=f();if(u!==-1&&a!==u){o(u);return}setTimeout(()=>e.select(),0)},w=t=>{t.preventDefault();let a=(t.clipboardData||window.clipboardData).getData("text").replace(/\s/g,"").split(""),u=0,g=n.find(r=>r===document.activeElement);g&&(u=parseInt(g.dataset.inputIndex));for(let r=0;r0&&d>u&&(d=u),o(Math.min(d,n.length-1))};for(let t of n)t.addEventListener("input",v),t.addEventListener("keydown",I),t.addEventListener("focus",h);i.addEventListener("paste",w);let m=l.id;if(m){for(let t of document.querySelectorAll(`label[for="${m}"]`))if(!t.dataset.inputOtpListener){let e=a=>{a.preventDefault(),n.length>0&&o(0)};t.addEventListener("click",e),t.dataset.inputOtpListener="true",t._inputOtpClickListener=e}}if(i.dataset.value){let t=i.dataset.value;for(let e=0;ec()),window.inputOTPSystemInitialized=!0})();})(); diff --git a/server/web/assets/js/label.min.js b/server/web/assets/js/label.min.js new file mode 100644 index 0000000..3eac1d5 --- /dev/null +++ b/server/web/assets/js/label.min.js @@ -0,0 +1 @@ +(()=>{(function(){function s(t){if(!t||t.hasAttribute("data-initialized")||(t.setAttribute("data-initialized","true"),!t.hasAttribute("for")||!t.hasAttribute("data-disabled-style")))return;let e=t.getAttribute("for"),i=e?document.getElementById(e):null,a=t.getAttribute("data-disabled-style");if(!a)return;let n=a.split(" ").filter(Boolean);function d(){i&&i.disabled?t.classList.add(...n):t.classList.remove(...n)}i&&new MutationObserver(u=>{for(let r of u)r.type==="attributes"&&r.attributeName==="disabled"&&d()}).observe(i,{attributes:!0,attributeFilter:["disabled"]}),d()}function o(t=document){t instanceof Element&&t.matches("label[for][data-disabled-style]")&&s(t);for(let e of t.querySelectorAll("label[for][data-disabled-style]:not([data-initialized])"))s(e)}document.addEventListener("DOMContentLoaded",()=>o())})();})(); diff --git a/server/web/assets/js/modal.min.js b/server/web/assets/js/modal.min.js new file mode 100644 index 0000000..66e6461 --- /dev/null +++ b/server/web/assets/js/modal.min.js @@ -0,0 +1 @@ +(()=>{(function(){let o=new Map,n=null;function b(t,e){document.querySelectorAll(`[data-modal-trigger="${t}"]`).forEach(a=>{a.setAttribute("data-open",e)})}function g(t){if(!t||t.hasAttribute("data-initialized"))return null;t.setAttribute("data-initialized","true");let e=t.id,a=t.querySelector("[data-modal-content]"),u=t.hasAttribute("data-initial-open");if(!a||!e)return null;let c=u;function l(i){c=i,t.style.display=i?"flex":"none",t.setAttribute("data-open",i),b(e,i),i?(n=e,document.body.style.overflow="hidden",t.classList.remove("opacity-0"),t.classList.add("opacity-100"),a.classList.remove("scale-95","opacity-0"),a.classList.add("scale-100","opacity-100"),setTimeout(()=>{a.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')?.focus()},50)):(n===e&&(n=null,document.body.style.overflow=""),t.classList.remove("opacity-100"),t.classList.add("opacity-0"),a.classList.remove("scale-100","opacity-100"),a.classList.add("scale-95","opacity-0"))}function f(){n&&n!==e&&o.get(n)?.close(!0),t.style.display="flex",t.offsetHeight,l(!0),document.addEventListener("keydown",y),document.addEventListener("click",p)}function s(i=!1){l(!1),document.removeEventListener("keydown",y),document.removeEventListener("click",p),i||setTimeout(()=>{c||(t.style.display="none")},300)}function L(){c?s():f()}function y(i){i.key==="Escape"&&c&&t.getAttribute("data-disable-esc")!=="true"&&s()}function p(i){t.getAttribute("data-disable-click-away")!=="true"&&!a.contains(i.target)&&!v(i.target)&&s()}function v(i){let d=i.closest("[data-modal-trigger]");return d&&d.getAttribute("data-modal-trigger")===e}return t.querySelectorAll("[data-modal-close]").forEach(i=>{i.addEventListener("click",s)}),l(u),{open:f,close:s,toggle:L}}function r(t=document){t.querySelectorAll("[data-modal]:not([data-initialized])").forEach(e=>{let a=g(e);a&&e.id&&o.set(e.id,a)}),t.querySelectorAll("[data-modal-trigger]").forEach(e=>{if(e.dataset.initialized)return;e.dataset.initialized="true";let a=e.getAttribute("data-modal-trigger");e.addEventListener("click",()=>{!e.hasAttribute("disabled")&&!e.classList.contains("opacity-50")&&o.get(a)?.toggle()})})}window.templUI=window.templUI||{},window.templUI.modal={init:r},document.addEventListener("DOMContentLoaded",()=>r())})();})(); diff --git a/server/web/assets/js/popover.min.js b/server/web/assets/js/popover.min.js new file mode 100644 index 0000000..edb7ee7 --- /dev/null +++ b/server/web/assets/js/popover.min.js @@ -0,0 +1,6 @@ +(()=>{var Ve=Object.create;var Me=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var je=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var ze=(y,O)=>()=>(O||y((O={exports:{}}).exports,O),O.exports);var Ye=(y,O,se,ae)=>{if(O&&typeof O=="object"||typeof O=="function")for(let K of $e(O))!Xe.call(y,K)&&K!==se&&Me(y,K,{get:()=>O[K],enumerable:!(ae=Ne(O,K))||ae.enumerable});return y};var We=(y,O,se)=>(se=y!=null?Ve(je(y)):{},Ye(O||!y||!y.__esModule?Me(se,"default",{value:y,enumerable:!0}):se,y));var Re=ze((Te,Ue)=>{(function(y,O){typeof Te=="object"&&typeof Ue<"u"?O(Te):typeof define=="function"&&define.amd?define(["exports"],O):O((y=typeof globalThis<"u"?globalThis:y||self).FloatingUICore={})})(Te,function(y){"use strict";let O=["top","right","bottom","left"],se=["start","end"],ae=O.reduce((o,r)=>o.concat(r,r+"-"+se[0],r+"-"+se[1]),[]),K=Math.min,oe=Math.max,ce={left:"right",right:"left",bottom:"top",top:"bottom"},he={start:"end",end:"start"};function de(o,r,v){return oe(o,K(r,v))}function q(o,r){return typeof o=="function"?o(r):o}function N(o){return o.split("-")[0]}function Y(o){return o.split("-")[1]}function ie(o){return o==="x"?"y":"x"}function le(o){return o==="y"?"height":"width"}function fe(o){return["top","bottom"].includes(N(o))?"y":"x"}function pe(o){return ie(fe(o))}function we(o,r,v){v===void 0&&(v=!1);let c=Y(o),L=pe(o),f=le(L),g=L==="x"?c===(v?"end":"start")?"right":"left":c==="start"?"bottom":"top";return r.reference[f]>r.floating[f]&&(g=n(g)),[g,n(g)]}function me(o){return o.replace(/start|end/g,r=>he[r])}function n(o){return o.replace(/left|right|bottom|top/g,r=>ce[r])}function p(o){return typeof o!="number"?function(r){return{top:0,right:0,bottom:0,left:0,...r}}(o):{top:o,right:o,bottom:o,left:o}}function a(o){let{x:r,y:v,width:c,height:L}=o;return{width:c,height:L,top:v,left:r,right:r+c,bottom:v+L,x:r,y:v}}function m(o,r,v){let{reference:c,floating:L}=o,f=fe(r),g=pe(r),P=le(g),M=N(r),z=f==="y",R=c.x+c.width/2-L.width/2,h=c.y+c.height/2-L.height/2,E=c[P]/2-L[P]/2,w;switch(M){case"top":w={x:R,y:c.y-L.height};break;case"bottom":w={x:R,y:c.y+c.height};break;case"right":w={x:c.x+c.width,y:h};break;case"left":w={x:c.x-L.width,y:h};break;default:w={x:c.x,y:c.y}}switch(Y(r)){case"start":w[g]-=E*(v&&z?-1:1);break;case"end":w[g]+=E*(v&&z?-1:1)}return w}async function x(o,r){var v;r===void 0&&(r={});let{x:c,y:L,platform:f,rects:g,elements:P,strategy:M}=o,{boundary:z="clippingAncestors",rootBoundary:R="viewport",elementContext:h="floating",altBoundary:E=!1,padding:w=0}=q(r,o),A=p(w),S=P[E?h==="floating"?"reference":"floating":h],D=a(await f.getClippingRect({element:(v=await(f.isElement==null?void 0:f.isElement(S)))==null||v?S:S.contextElement||await(f.getDocumentElement==null?void 0:f.getDocumentElement(P.floating)),boundary:z,rootBoundary:R,strategy:M})),F=h==="floating"?{x:c,y:L,width:g.floating.width,height:g.floating.height}:g.reference,B=await(f.getOffsetParent==null?void 0:f.getOffsetParent(P.floating)),k=await(f.isElement==null?void 0:f.isElement(B))&&await(f.getScale==null?void 0:f.getScale(B))||{x:1,y:1},H=a(f.convertOffsetParentRelativeRectToViewportRelativeRect?await f.convertOffsetParentRelativeRectToViewportRelativeRect({elements:P,rect:F,offsetParent:B,strategy:M}):F);return{top:(D.top-H.top+A.top)/k.y,bottom:(H.bottom-D.bottom+A.bottom)/k.y,left:(D.left-H.left+A.left)/k.x,right:(H.right-D.right+A.right)/k.x}}function $(o,r){return{top:o.top-r.height,right:o.right-r.width,bottom:o.bottom-r.height,left:o.left-r.width}}function re(o){return O.some(r=>o[r]>=0)}function Q(o){let r=K(...o.map(c=>c.left)),v=K(...o.map(c=>c.top));return{x:r,y:v,width:oe(...o.map(c=>c.right))-r,height:oe(...o.map(c=>c.bottom))-v}}y.arrow=o=>({name:"arrow",options:o,async fn(r){let{x:v,y:c,placement:L,rects:f,platform:g,elements:P,middlewareData:M}=r,{element:z,padding:R=0}=q(o,r)||{};if(z==null)return{};let h=p(R),E={x:v,y:c},w=pe(L),A=le(w),S=await g.getDimensions(z),D=w==="y",F=D?"top":"left",B=D?"bottom":"right",k=D?"clientHeight":"clientWidth",H=f.reference[A]+f.reference[w]-E[w]-f.floating[A],_=E[w]-f.reference[w],G=await(g.getOffsetParent==null?void 0:g.getOffsetParent(z)),J=G?G[k]:0;J&&await(g.isElement==null?void 0:g.isElement(G))||(J=P.floating[k]||f.floating[A]);let ne=H/2-_/2,U=J/2-S[A]/2-1,j=K(h[F],U),e=K(h[B],U),t=j,i=J-S[A]-e,l=J/2-S[A]/2+ne,s=de(t,l,i),u=!M.arrow&&Y(L)!=null&&l!==s&&f.reference[A]/2-(lY(t)===U),...e.filter(t=>Y(t)!==U)]:e.filter(t=>N(t)===t)).filter(t=>!U||Y(t)===U||!!j&&me(t)!==t)}(h||null,w,E):E,D=await x(r,A),F=((v=g.autoPlacement)==null?void 0:v.index)||0,B=S[F];if(B==null)return{};let k=we(B,f,await(M.isRTL==null?void 0:M.isRTL(z.floating)));if(P!==B)return{reset:{placement:S[0]}};let H=[D[N(B)],D[k[0]],D[k[1]]],_=[...((c=g.autoPlacement)==null?void 0:c.overflows)||[],{placement:B,overflows:H}],G=S[F+1];if(G)return{data:{index:F+1,overflows:_},reset:{placement:G}};let J=_.map(U=>{let j=Y(U.placement);return[U.placement,j&&R?U.overflows.slice(0,2).reduce((e,t)=>e+t,0):U.overflows[0],U.overflows]}).sort((U,j)=>U[1]-j[1]),ne=((L=J.filter(U=>U[2].slice(0,Y(U[0])?2:3).every(j=>j<=0))[0])==null?void 0:L[0])||J[0][0];return ne!==P?{data:{index:F+1,overflows:_},reset:{placement:ne}}:{}}}},y.computePosition=async(o,r,v)=>{let{placement:c="bottom",strategy:L="absolute",middleware:f=[],platform:g}=v,P=f.filter(Boolean),M=await(g.isRTL==null?void 0:g.isRTL(r)),z=await g.getElementRects({reference:o,floating:r,strategy:L}),{x:R,y:h}=m(z,c,M),E=c,w={},A=0;for(let S=0;SW+"-"+d),u&&(b=b.concat(b.map(me)))),b}(P,S,A,H));let J=[P,..._],ne=await x(r,D),U=[],j=((c=f.flip)==null?void 0:c.overflows)||[];if(R&&U.push(ne[F]),h){let s=we(L,g,H);U.push(ne[s[0]],ne[s[1]])}if(j=[...j,{placement:L,overflows:U}],!U.every(s=>s<=0)){var e,t;let s=(((e=f.flip)==null?void 0:e.index)||0)+1,u=J[s];if(u){var i;let C=h==="alignment"&&B!==fe(u),d=((i=j[0])==null?void 0:i.overflows[0])>0;if(!C||d)return{data:{index:s,overflows:j},reset:{placement:u}}}let T=(t=j.filter(C=>C.overflows[0]<=0).sort((C,d)=>C.overflows[1]-d.overflows[1])[0])==null?void 0:t.placement;if(!T)switch(w){case"bestFit":{var l;let C=(l=j.filter(d=>{if(G){let b=fe(d.placement);return b===B||b==="y"}return!0}).map(d=>[d.placement,d.overflows.filter(b=>b>0).reduce((b,W)=>b+W,0)]).sort((d,b)=>d[1]-b[1])[0])==null?void 0:l[0];C&&(T=C);break}case"initialPlacement":T=P}if(L!==T)return{reset:{placement:T}}}return{}}}},y.hide=function(o){return o===void 0&&(o={}),{name:"hide",options:o,async fn(r){let{rects:v}=r,{strategy:c="referenceHidden",...L}=q(o,r);switch(c){case"referenceHidden":{let f=$(await x(r,{...L,elementContext:"reference"}),v.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:re(f)}}}case"escaped":{let f=$(await x(r,{...L,altBoundary:!0}),v.floating);return{data:{escapedOffsets:f,escaped:re(f)}}}default:return{}}}}},y.inline=function(o){return o===void 0&&(o={}),{name:"inline",options:o,async fn(r){let{placement:v,elements:c,rects:L,platform:f,strategy:g}=r,{padding:P=2,x:M,y:z}=q(o,r),R=Array.from(await(f.getClientRects==null?void 0:f.getClientRects(c.reference))||[]),h=function(S){let D=S.slice().sort((k,H)=>k.y-H.y),F=[],B=null;for(let k=0;kB.height/2?F.push([H]):F[F.length-1].push(H),B=H}return F.map(k=>a(Q(k)))}(R),E=a(Q(R)),w=p(P),A=await f.getElementRects({reference:{getBoundingClientRect:function(){if(h.length===2&&h[0].left>h[1].right&&M!=null&&z!=null)return h.find(S=>M>S.left-w.left&&MS.top-w.top&&z=2){if(fe(v)==="y"){let _=h[0],G=h[h.length-1],J=N(v)==="top",ne=_.top,U=G.bottom,j=J?_.left:G.left,e=J?_.right:G.right;return{top:ne,bottom:U,left:j,right:e,width:e-j,height:U-ne,x:j,y:ne}}let S=N(v)==="left",D=oe(...h.map(_=>_.right)),F=K(...h.map(_=>_.left)),B=h.filter(_=>S?_.left===F:_.right===D),k=B[0].top,H=B[B.length-1].bottom;return{top:k,bottom:H,left:F,right:D,width:D-F,height:H-k,x:F,y:k}}return E}},floating:c.floating,strategy:g});return L.reference.x!==A.reference.x||L.reference.y!==A.reference.y||L.reference.width!==A.reference.width||L.reference.height!==A.reference.height?{reset:{rects:A}}:{}}}},y.limitShift=function(o){return o===void 0&&(o={}),{options:o,fn(r){let{x:v,y:c,placement:L,rects:f,middlewareData:g}=r,{offset:P=0,mainAxis:M=!0,crossAxis:z=!0}=q(o,r),R={x:v,y:c},h=fe(L),E=ie(h),w=R[E],A=R[h],S=q(P,r),D=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(M){let k=E==="y"?"height":"width",H=f.reference[E]-f.floating[k]+D.mainAxis,_=f.reference[E]+f.reference[k]-D.mainAxis;w_&&(w=_)}if(z){var F,B;let k=E==="y"?"width":"height",H=["top","left"].includes(N(L)),_=f.reference[h]-f.floating[k]+(H&&((F=g.offset)==null?void 0:F[h])||0)+(H?0:D.crossAxis),G=f.reference[h]+f.reference[k]+(H?0:((B=g.offset)==null?void 0:B[h])||0)-(H?D.crossAxis:0);A<_?A=_:A>G&&(A=G)}return{[E]:w,[h]:A}}}},y.offset=function(o){return o===void 0&&(o=0),{name:"offset",options:o,async fn(r){var v,c;let{x:L,y:f,placement:g,middlewareData:P}=r,M=await async function(z,R){let{placement:h,platform:E,elements:w}=z,A=await(E.isRTL==null?void 0:E.isRTL(w.floating)),S=N(h),D=Y(h),F=fe(h)==="y",B=["left","top"].includes(S)?-1:1,k=A&&F?-1:1,H=q(R,z),{mainAxis:_,crossAxis:G,alignmentAxis:J}=typeof H=="number"?{mainAxis:H,crossAxis:0,alignmentAxis:null}:{mainAxis:H.mainAxis||0,crossAxis:H.crossAxis||0,alignmentAxis:H.alignmentAxis};return D&&typeof J=="number"&&(G=D==="end"?-1*J:J),F?{x:G*k,y:_*B}:{x:_*B,y:G*k}}(r,o);return g===((v=P.offset)==null?void 0:v.placement)&&(c=P.arrow)!=null&&c.alignmentOffset?{}:{x:L+M.x,y:f+M.y,data:{...M,placement:g}}}}},y.rectToClientRect=a,y.shift=function(o){return o===void 0&&(o={}),{name:"shift",options:o,async fn(r){let{x:v,y:c,placement:L}=r,{mainAxis:f=!0,crossAxis:g=!1,limiter:P={fn:D=>{let{x:F,y:B}=D;return{x:F,y:B}}},...M}=q(o,r),z={x:v,y:c},R=await x(r,M),h=fe(N(L)),E=ie(h),w=z[E],A=z[h];if(f){let D=E==="y"?"bottom":"right";w=de(w+R[E==="y"?"top":"left"],w,w-R[D])}if(g){let D=h==="y"?"bottom":"right";A=de(A+R[h==="y"?"top":"left"],A,A-R[D])}let S=P.fn({...r,[E]:w,[h]:A});return{...S,data:{x:S.x-v,y:S.y-c,enabled:{[E]:f,[h]:g}}}}}},y.size=function(o){return o===void 0&&(o={}),{name:"size",options:o,async fn(r){var v,c;let{placement:L,rects:f,platform:g,elements:P}=r,{apply:M=()=>{},...z}=q(o,r),R=await x(r,z),h=N(L),E=Y(L),w=fe(L)==="y",{width:A,height:S}=f.floating,D,F;h==="top"||h==="bottom"?(D=h,F=E===(await(g.isRTL==null?void 0:g.isRTL(P.floating))?"start":"end")?"left":"right"):(F=h,D=E==="end"?"top":"bottom");let B=S-R.top-R.bottom,k=A-R.left-R.right,H=K(S-R[D],B),_=K(A-R[F],k),G=!r.middlewareData.shift,J=H,ne=_;if((v=r.middlewareData.shift)!=null&&v.enabled.x&&(ne=k),(c=r.middlewareData.shift)!=null&&c.enabled.y&&(J=B),G&&!E){let j=oe(R.left,0),e=oe(R.right,0),t=oe(R.top,0),i=oe(R.bottom,0);w?ne=A-2*(j!==0||e!==0?j+e:oe(R.left,R.right)):J=S-2*(t!==0||i!==0?t+i:oe(R.top,R.bottom))}await M({...r,availableWidth:ne,availableHeight:J});let U=await g.getDimensions(P.floating);return A!==U.width||S!==U.height?{reset:{rects:!0}}:{}}}}})});var qe=ze((Ce,Ie)=>{(function(y,O){typeof Ce=="object"&&typeof Ie<"u"?O(Ce,Re()):typeof define=="function"&&define.amd?define(["exports","./floatingUICore"],O):O((y=typeof globalThis<"u"?globalThis:y||self).FloatingUIDOM={},y.FloatingUICore)})(Ce,function(y,O){"use strict";let se=Math.min,ae=Math.max,K=Math.round,oe=Math.floor,ce=e=>({x:e,y:e});function he(){return typeof window<"u"}function de(e){return Y(e)?(e.nodeName||"").toLowerCase():"#document"}function q(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function N(e){var t;return(t=(Y(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Y(e){return!!he()&&(e instanceof Node||e instanceof q(e).Node)}function ie(e){return!!he()&&(e instanceof Element||e instanceof q(e).Element)}function le(e){return!!he()&&(e instanceof HTMLElement||e instanceof q(e).HTMLElement)}function fe(e){return!(!he()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof q(e).ShadowRoot)}function pe(e){let{overflow:t,overflowX:i,overflowY:l,display:s}=m(e);return/auto|scroll|overlay|hidden|clip/.test(t+l+i)&&!["inline","contents"].includes(s)}function we(e){return["table","td","th"].includes(de(e))}function me(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function n(e){let t=p(),i=ie(e)?m(e):e;return["transform","translate","scale","rotate","perspective"].some(l=>!!i[l]&&i[l]!=="none")||!!i.containerType&&i.containerType!=="normal"||!t&&!!i.backdropFilter&&i.backdropFilter!=="none"||!t&&!!i.filter&&i.filter!=="none"||["transform","translate","scale","rotate","perspective","filter"].some(l=>(i.willChange||"").includes(l))||["paint","layout","strict","content"].some(l=>(i.contain||"").includes(l))}function p(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function a(e){return["html","body","#document"].includes(de(e))}function m(e){return q(e).getComputedStyle(e)}function x(e){return ie(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function $(e){if(de(e)==="html")return e;let t=e.assignedSlot||e.parentNode||fe(e)&&e.host||N(e);return fe(t)?t.host:t}function re(e){let t=$(e);return a(t)?e.ownerDocument?e.ownerDocument.body:e.body:le(t)&&pe(t)?t:re(t)}function Q(e,t,i){var l;t===void 0&&(t=[]),i===void 0&&(i=!0);let s=re(e),u=s===((l=e.ownerDocument)==null?void 0:l.body),T=q(s);if(u){let C=o(T);return t.concat(T,T.visualViewport||[],pe(s)?s:[],C&&i?Q(C):[])}return t.concat(s,Q(s,[],i))}function o(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function r(e){let t=m(e),i=parseFloat(t.width)||0,l=parseFloat(t.height)||0,s=le(e),u=s?e.offsetWidth:i,T=s?e.offsetHeight:l,C=K(i)!==u||K(l)!==T;return C&&(i=u,l=T),{width:i,height:l,$:C}}function v(e){return ie(e)?e:e.contextElement}function c(e){let t=v(e);if(!le(t))return ce(1);let i=t.getBoundingClientRect(),{width:l,height:s,$:u}=r(t),T=(u?K(i.width):i.width)/l,C=(u?K(i.height):i.height)/s;return T&&Number.isFinite(T)||(T=1),C&&Number.isFinite(C)||(C=1),{x:T,y:C}}let L=ce(0);function f(e){let t=q(e);return p()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:L}function g(e,t,i,l){t===void 0&&(t=!1),i===void 0&&(i=!1);let s=e.getBoundingClientRect(),u=v(e),T=ce(1);t&&(l?ie(l)&&(T=c(l)):T=c(e));let C=function(te,Z,I){return Z===void 0&&(Z=!1),!(!I||Z&&I!==q(te))&&Z}(u,i,l)?f(u):ce(0),d=(s.left+C.x)/T.x,b=(s.top+C.y)/T.y,W=s.width/T.x,X=s.height/T.y;if(u){let te=q(u),Z=l&&ie(l)?q(l):l,I=te,ee=o(I);for(;ee&&l&&Z!==I;){let V=c(ee),ue=ee.getBoundingClientRect(),ve=m(ee),ye=ue.left+(ee.clientLeft+parseFloat(ve.paddingLeft))*V.x,xe=ue.top+(ee.clientTop+parseFloat(ve.paddingTop))*V.y;d*=V.x,b*=V.y,W*=V.x,X*=V.y,d+=ye,b+=xe,I=q(ee),ee=o(I)}}return O.rectToClientRect({width:W,height:X,x:d,y:b})}function P(e,t){let i=x(e).scrollLeft;return t?t.left+i:g(N(e)).left+i}function M(e,t,i){i===void 0&&(i=!1);let l=e.getBoundingClientRect();return{x:l.left+t.scrollLeft-(i?0:P(e,l)),y:l.top+t.scrollTop}}function z(e,t,i){let l;if(t==="viewport")l=function(s,u){let T=q(s),C=N(s),d=T.visualViewport,b=C.clientWidth,W=C.clientHeight,X=0,te=0;if(d){b=d.width,W=d.height;let Z=p();(!Z||Z&&u==="fixed")&&(X=d.offsetLeft,te=d.offsetTop)}return{width:b,height:W,x:X,y:te}}(e,i);else if(t==="document")l=function(s){let u=N(s),T=x(s),C=s.ownerDocument.body,d=ae(u.scrollWidth,u.clientWidth,C.scrollWidth,C.clientWidth),b=ae(u.scrollHeight,u.clientHeight,C.scrollHeight,C.clientHeight),W=-T.scrollLeft+P(s),X=-T.scrollTop;return m(C).direction==="rtl"&&(W+=ae(u.clientWidth,C.clientWidth)-d),{width:d,height:b,x:W,y:X}}(N(e));else if(ie(t))l=function(s,u){let T=g(s,!0,u==="fixed"),C=T.top+s.clientTop,d=T.left+s.clientLeft,b=le(s)?c(s):ce(1);return{width:s.clientWidth*b.x,height:s.clientHeight*b.y,x:d*b.x,y:C*b.y}}(t,i);else{let s=f(e);l={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return O.rectToClientRect(l)}function R(e,t){let i=$(e);return!(i===t||!ie(i)||a(i))&&(m(i).position==="fixed"||R(i,t))}function h(e,t,i){let l=le(t),s=N(t),u=i==="fixed",T=g(e,!0,u,t),C={scrollLeft:0,scrollTop:0},d=ce(0);function b(){d.x=P(s)}if(l||!l&&!u)if((de(t)!=="body"||pe(s))&&(C=x(t)),l){let X=g(t,!0,u,t);d.x=X.x+t.clientLeft,d.y=X.y+t.clientTop}else s&&b();u&&!l&&s&&b();let W=!s||l||u?ce(0):M(s,C);return{x:T.left+C.scrollLeft-d.x-W.x,y:T.top+C.scrollTop-d.y-W.y,width:T.width,height:T.height}}function E(e){return m(e).position==="static"}function w(e,t){if(!le(e)||m(e).position==="fixed")return null;if(t)return t(e);let i=e.offsetParent;return N(e)===i&&(i=i.ownerDocument.body),i}function A(e,t){let i=q(e);if(me(e))return i;if(!le(e)){let s=$(e);for(;s&&!a(s);){if(ie(s)&&!E(s))return s;s=$(s)}return i}let l=w(e,t);for(;l&&we(l)&&E(l);)l=w(l,t);return l&&a(l)&&E(l)&&!n(l)?i:l||function(s){let u=$(s);for(;le(u)&&!a(u);){if(n(u))return u;if(me(u))return null;u=$(u)}return null}(e)||i}let S={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:i,offsetParent:l,strategy:s}=e,u=s==="fixed",T=N(l),C=!!t&&me(t.floating);if(l===T||C&&u)return i;let d={scrollLeft:0,scrollTop:0},b=ce(1),W=ce(0),X=le(l);if((X||!X&&!u)&&((de(l)!=="body"||pe(T))&&(d=x(l)),le(l))){let Z=g(l);b=c(l),W.x=Z.x+l.clientLeft,W.y=Z.y+l.clientTop}let te=!T||X||u?ce(0):M(T,d,!0);return{width:i.width*b.x,height:i.height*b.y,x:i.x*b.x-d.scrollLeft*b.x+W.x+te.x,y:i.y*b.y-d.scrollTop*b.y+W.y+te.y}},getDocumentElement:N,getClippingRect:function(e){let{element:t,boundary:i,rootBoundary:l,strategy:s}=e,u=[...i==="clippingAncestors"?me(t)?[]:function(d,b){let W=b.get(d);if(W)return W;let X=Q(d,[],!1).filter(ee=>ie(ee)&&de(ee)!=="body"),te=null,Z=m(d).position==="fixed",I=Z?$(d):d;for(;ie(I)&&!a(I);){let ee=m(I),V=n(I);V||ee.position!=="fixed"||(te=null),(Z?!V&&!te:!V&&ee.position==="static"&&te&&["absolute","fixed"].includes(te.position)||pe(I)&&!V&&R(d,I))?X=X.filter(ue=>ue!==I):te=ee,I=$(I)}return b.set(d,X),X}(t,this._c):[].concat(i),l],T=u[0],C=u.reduce((d,b)=>{let W=z(t,b,s);return d.top=ae(W.top,d.top),d.right=se(W.right,d.right),d.bottom=se(W.bottom,d.bottom),d.left=ae(W.left,d.left),d},z(t,T,s));return{width:C.right-C.left,height:C.bottom-C.top,x:C.left,y:C.top}},getOffsetParent:A,getElementRects:async function(e){let t=this.getOffsetParent||A,i=this.getDimensions,l=await i(e.floating);return{reference:h(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:l.width,height:l.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:i}=r(e);return{width:t,height:i}},getScale:c,isElement:ie,isRTL:function(e){return m(e).direction==="rtl"}};function D(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}let F=O.detectOverflow,B=O.offset,k=O.autoPlacement,H=O.shift,_=O.flip,G=O.size,J=O.hide,ne=O.arrow,U=O.inline,j=O.limitShift;return y.arrow=ne,y.autoPlacement=k,y.autoUpdate=function(e,t,i,l){l===void 0&&(l={});let{ancestorScroll:s=!0,ancestorResize:u=!0,elementResize:T=typeof ResizeObserver=="function",layoutShift:C=typeof IntersectionObserver=="function",animationFrame:d=!1}=l,b=v(e),W=s||u?[...b?Q(b):[],...Q(t)]:[];W.forEach(V=>{s&&V.addEventListener("scroll",i,{passive:!0}),u&&V.addEventListener("resize",i)});let X=b&&C?function(V,ue){let ve,ye=null,xe=N(V);function Ee(){var ge;clearTimeout(ve),(ge=ye)==null||ge.disconnect(),ye=null}return function ge(Ae,be){Ae===void 0&&(Ae=!1),be===void 0&&(be=1),Ee();let Se=V.getBoundingClientRect(),{left:Oe,top:De,width:Pe,height:ke}=Se;if(Ae||ue(),!Pe||!ke)return;let He={rootMargin:-oe(De)+"px "+-oe(xe.clientWidth-(Oe+Pe))+"px "+-oe(xe.clientHeight-(De+ke))+"px "+-oe(Oe)+"px",threshold:ae(0,se(1,be))||1},_e=!0;function Be(Fe){let Le=Fe[0].intersectionRatio;if(Le!==be){if(!_e)return ge();Le?ge(!1,Le):ve=setTimeout(()=>{ge(!1,1e-7)},1e3)}Le!==1||D(Se,V.getBoundingClientRect())||ge(),_e=!1}try{ye=new IntersectionObserver(Be,{...He,root:xe.ownerDocument})}catch{ye=new IntersectionObserver(Be,He)}ye.observe(V)}(!0),Ee}(b,i):null,te,Z=-1,I=null;T&&(I=new ResizeObserver(V=>{let[ue]=V;ue&&ue.target===b&&I&&(I.unobserve(t),cancelAnimationFrame(Z),Z=requestAnimationFrame(()=>{var ve;(ve=I)==null||ve.observe(t)})),i()}),b&&!d&&I.observe(b),I.observe(t));let ee=d?g(e):null;return d&&function V(){let ue=g(e);ee&&!D(ee,ue)&&i(),ee=ue,te=requestAnimationFrame(V)}(),i(),()=>{var V;W.forEach(ue=>{s&&ue.removeEventListener("scroll",i),u&&ue.removeEventListener("resize",i)}),X?.(),(V=I)==null||V.disconnect(),I=null,d&&cancelAnimationFrame(te)}},y.computePosition=(e,t,i)=>{let l=new Map,s={platform:S,...i},u={...s.platform,_c:l};return O.computePosition(e,t,{...s,platform:u})},y.detectOverflow=F,y.flip=_,y.getOverflowAncestors=Q,y.hide=J,y.inline=U,y.limitShift=j,y.offset=B,y.platform=S,y.shift=H,y.size=G,window.FloatingUIDOM=y,y})});var Je=We(qe()),Ke=We(Re());typeof window.popoverState>"u"&&(window.popoverState=new Map);(function(){if(window.popoverSystemInitialized)return;let y=document.querySelector("[data-popover-portal-container]");y||(y=document.createElement("div"),y.setAttribute("data-popover-portal-container",""),y.className="fixed inset-0 z-[9999] pointer-events-none",document.body.appendChild(y));let O=null;function se(n,p=1){window.FloatingUIDOM?(O=window.FloatingUIDOM,n()):p<40?setTimeout(()=>se(n,p+1),50):console.error("Floating UI DOM failed to load after several attempts.")}function ae(n){let p=n.children;if(p.length===0)return n;let a=n,m=0;for(let x of p){if(typeof x.getBoundingClientRect!="function")continue;let $=x.getBoundingClientRect(),re=$.width*$.height;re>m&&(m=re,a=x)}return a}function K(n,p,a,m){let{x,y:$}=a,re={top:"bottom",right:"left",bottom:"top",left:"right"}[p.split("-")[0]];Object.assign(n.style,{left:x!=null?`${x}px`:"",top:$!=null?`${$}px`:"",right:"",bottom:"",[re]:"-5px"});let Q=window.getComputedStyle(m),o=Q.borderColor;switch(n.style.backgroundColor=Q.backgroundColor,n.style.borderTopColor=o,n.style.borderRightColor=o,n.style.borderBottomColor=o,n.style.borderLeftColor=o,re){case"top":n.style.borderBottomColor="transparent",n.style.borderRightColor="transparent";break;case"bottom":n.style.borderTopColor="transparent",n.style.borderLeftColor="transparent";break;case"left":n.style.borderTopColor="transparent",n.style.borderRightColor="transparent";break;case"right":n.style.borderBottomColor="transparent",n.style.borderLeftColor="transparent";break}}function oe(){if(document.getElementById("popover-animations"))return;let n=document.createElement("style");n.id="popover-animations",n.textContent=` + @keyframes popover-in { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } } + @keyframes popover-out { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.95); } } + [data-popover-id].popover-animate-in { animation: popover-in 0.15s cubic-bezier(0.16, 1, 0.3, 1); } + [data-popover-id].popover-animate-out { animation: popover-out 0.1s cubic-bezier(0.16, 1, 0.3, 1) forwards; } + `,document.head.appendChild(n)}function ce(n,p){document.querySelectorAll(`[data-popover-trigger="${n}"]`).forEach(a=>{a.setAttribute("data-open",p)})}function he(n){if(!O||!n||!n.trigger||!n.content)return;let{computePosition:p,offset:a,flip:m,shift:x,arrow:$}=O,re=ae(n.trigger),Q=n.content.querySelector("[data-popover-arrow]"),o=n.content.dataset.popoverPlacement||"bottom",r=parseInt(n.content.dataset.popoverOffset)||(Q?8:4),v=n.content.dataset.popoverMatchWidth==="true",c=[a(r),m({padding:10}),x({padding:10})];Q&&c.push($({element:Q,padding:5})),p(re,n.content,{placement:o,middleware:c}).then(({x:L,y:f,placement:g,middlewareData:P})=>{if(Object.assign(n.content.style,{left:`${L}px`,top:`${f}px`}),v){let M=re.offsetWidth;n.content.style.setProperty("--popover-trigger-width",`${M}px`)}Q&&P.arrow&&K(Q,g,P.arrow,n.content)})}function de(n,p){if(q(p),p.content.dataset.popoverDisableClickaway!=="true"){let a=m=>{!p.trigger.contains(m.target)&&!p.content.contains(m.target)&&Y(n)};setTimeout(()=>document.addEventListener("click",a),0),p.eventListeners.clickAway=a}if(p.content.dataset.popoverDisableEsc!=="true"){let a=m=>{m.key==="Escape"&&Y(n)};document.addEventListener("keydown",a),p.eventListeners.esc=a}}function q(n){n.eventListeners.clickAway&&document.removeEventListener("click",n.eventListeners.clickAway),n.eventListeners.esc&&document.removeEventListener("keydown",n.eventListeners.esc),n.eventListeners={}}function N(n,p){if(!O)return;let{autoUpdate:a}=O,m=document.getElementById(n);if(!m)return;let x=window.popoverState.get(n);if(!x)x={trigger:p,content:m,isOpen:!1,cleanup:null,hoverState:{},eventListeners:{}},window.popoverState.set(n,x);else if(x.isOpen)return;x.trigger=p,x.content=m;let $=document.querySelector("[data-popover-portal-container]");$&&m.parentNode!==$&&$.appendChild(m),m.style.display="block",m.classList.remove("popover-animate-out"),m.classList.add("popover-animate-in"),m.setAttribute("data-open","true"),ce(n,"true"),he(x),x.cleanup&&x.cleanup(),x.cleanup=a(ae(p),m,()=>he(x),{animationFrame:!0}),de(n,x),x.isOpen=!0}function Y(n,p=!1){let a=window.popoverState.get(n);if(!a||!a.isOpen)return;a.cleanup&&(a.cleanup(),a.cleanup=null),q(a);let m=a.content;m.setAttribute("data-open","false"),ce(n,"false");function x(){m.style.display="none",m.classList.remove("popover-animate-in","popover-animate-out")}p?x():(m.classList.remove("popover-animate-in"),m.classList.add("popover-animate-out"),setTimeout(x,150)),a.isOpen=!1}window.closePopover=Y;function ie(n){for(let[p,a]of window.popoverState)p!==n&&a.isOpen&&Y(p)}function le(n,p){let a=m=>{m.stopPropagation(),window.popoverState.get(p)?.isOpen?Y(p):(ie(p),N(p,n))};n.addEventListener("click",a),n._popoverListener=a}function fe(n,p){let a=document.getElementById(p);if(!a)return;let m=window.popoverState.get(p);if(!m)return;let x=parseInt(a.dataset.popoverHoverDelay)||100,$=parseInt(a.dataset.popoverHoverOutDelay)||200,re=()=>{clearTimeout(m.hoverState.leaveTimeout),m.hoverState.enterTimeout=setTimeout(()=>N(p,n),x)},Q=v=>{clearTimeout(m.hoverState.enterTimeout),m.hoverState.leaveTimeout=setTimeout(()=>{a.contains(v.relatedTarget)||Y(p)},$)},o=()=>clearTimeout(m.hoverState.leaveTimeout),r=v=>{m.hoverState.leaveTimeout=setTimeout(()=>{n.contains(v.relatedTarget)||Y(p)},$)};n.addEventListener("mouseenter",re),n.addEventListener("mouseleave",Q),a.addEventListener("mouseenter",o),a.addEventListener("mouseleave",r),n._popoverHoverListeners={handleTriggerEnter:re,handleTriggerLeave:Q},a._popoverHoverListeners={handleContentEnter:o,handleContentLeave:r}}function pe(n){if(!n||n.hasAttribute("data-initialized"))return;n.setAttribute("data-initialized","true");let p=n.getAttribute("data-popover-trigger"),a=document.getElementById(p);if(!p||!a||n._popoverListenerAttached)return;if(!window.popoverState.has(p))window.popoverState.set(p,{trigger:n,content:a,isOpen:!1,cleanup:null,hoverState:{},eventListeners:{}});else{let x=window.popoverState.get(p);x.trigger=n,x.content=a,x.isOpen&&Y(p,!0)}n._popoverListener&&n.removeEventListener("click",n._popoverListener),n._popoverHoverListeners&&(n.removeEventListener("mouseenter",n._popoverHoverListeners.handleTriggerEnter),n.removeEventListener("mouseleave",n._popoverHoverListeners.handleTriggerLeave)),a._popoverHoverListeners&&(a.removeEventListener("mouseenter",a._popoverHoverListeners.handleContentEnter),a.removeEventListener("mouseleave",a._popoverHoverListeners.handleContentLeave)),delete n._popoverListener,delete n._popoverHoverListeners,a&&delete a._popoverHoverListeners;let m=n.dataset.popoverType||"click";m==="click"?le(n,p):m==="hover"&&fe(n,p),n._popoverListenerAttached=!0}function we(n){let p=a=>{let m=a.getAttribute("data-popover-trigger");m&&Y(m,!0),a._popoverListener&&a.removeEventListener("click",a._popoverListener),a._popoverHoverListeners&&(a.removeEventListener("mouseenter",a._popoverHoverListeners.handleTriggerEnter),a.removeEventListener("mouseleave",a._popoverHoverListeners.handleTriggerLeave));let x=document.getElementById(m);x&&x._popoverHoverListeners&&(x.removeEventListener("mouseenter",x._popoverHoverListeners.handleContentEnter),x.removeEventListener("mouseleave",x._popoverHoverListeners.handleContentLeave),delete x._popoverHoverListeners),delete a._popoverListener,delete a._popoverHoverListeners,delete a._popoverListenerAttached};n.matches&&n.matches("[data-popover-trigger]")&&p(n),n.querySelectorAll&&n.querySelectorAll("[data-popover-trigger]").forEach(p)}function me(n=document){if(O&&(n instanceof Element&&n.matches("[data-popover-trigger]")&&pe(n),n&&typeof n.querySelectorAll=="function"))for(let p of n.querySelectorAll("[data-popover-trigger]:not([data-initialized])"))pe(p)}window.templUI=window.templUI||{},window.templUI.popover={init:me,cleanup:we},document.addEventListener("DOMContentLoaded",()=>{se(()=>{oe(),me()})}),window.popoverSystemInitialized=!0})();})(); diff --git a/server/web/assets/js/progress.min.js b/server/web/assets/js/progress.min.js new file mode 100644 index 0000000..9f93d0c --- /dev/null +++ b/server/web/assets/js/progress.min.js @@ -0,0 +1 @@ +(()=>{(function(){function n(t){if(!t||t.hasAttribute("data-initialized"))return;t.setAttribute("data-initialized","true");let i=t.querySelector("[data-progress-indicator]");if(!i)return;let d=parseFloat(t.getAttribute("aria-valuenow")||"0"),e=parseFloat(t.getAttribute("aria-valuemax")||"100");e<=0&&(e=100);let l=0;e>0&&(l=Math.max(0,Math.min(d,e))/e*100),i.style.width=l+"%"}function a(t=document){if(t instanceof Element&&t.matches('[role="progressbar"]')&&n(t),t&&typeof t.querySelectorAll=="function")for(let i of t.querySelectorAll('[role="progressbar"]:not([data-initialized])'))n(i)}window.templUI=window.templUI||{},window.templUI.progress={init:a},document.addEventListener("DOMContentLoaded",()=>a())})();})(); diff --git a/server/web/assets/js/rating.min.js b/server/web/assets/js/rating.min.js new file mode 100644 index 0000000..23b6a37 --- /dev/null +++ b/server/web/assets/js/rating.min.js @@ -0,0 +1 @@ +(()=>{typeof window.ratingState>"u"&&(window.ratingState=new WeakMap);(function(){function h(e){if(!e||e.hasAttribute("data-initialized"))return;e.setAttribute("data-initialized","true");let r=window.ratingState.get(e);r&&I(e,r),e.dataset.ratingInitialized="true";let a={value:parseFloat(e.dataset.initialValue)||0,precision:parseFloat(e.dataset.precision)||1,readonly:e.dataset.readonly==="true",name:e.dataset.name||"",onlyInteger:e.dataset.onlyinteger==="true",maxValue:0},d=e.querySelector("[data-rating-input]"),s=Array.from(e.querySelectorAll("[data-rating-item]")),o=a.value,u=0,f={click:L,mouseover:g,mouseleave:x};function p(){let n=0;for(let t of s){let i=parseInt(t.dataset.ratingValue,10);!isNaN(i)&&i>n&&(n=i)}a.maxValue=Math.max(1,n),o=Math.max(0,Math.min(a.maxValue,o)),o=Math.round(o/a.precision)*a.precision,v()}function v(){d&&(d.value=o.toFixed(2))}function c(n){for(let t of s){let i=parseInt(t.dataset.ratingValue,10);if(isNaN(i))continue;let b=t.querySelector("[data-rating-item-foreground]");if(!b)continue;let l=n>0?n:o,M=i<=Math.floor(l),V=!M&&i-1{o=a.value,u=0,v(),c(0)});let w=new MutationObserver(()=>{try{e.querySelectorAll("[data-rating-item]").length!==s.length&&(s=Array.from(e.querySelectorAll("[data-rating-item]")),p(),c(u>0?u:0))}catch(n){console.error("Error in rating MutationObserver:",n)}});w.observe(e,{childList:!0,subtree:!0});let A={handlers:f,observer:w,items:s};window.ratingState.set(e,A)}function I(e,r){!e||!r||(!e.dataset.readonly==="true"&&(e.removeEventListener("click",r.handlers.click),e.removeEventListener("mouseover",r.handlers.mouseover),e.removeEventListener("mouseleave",r.handlers.mouseleave)),r.observer&&r.observer.disconnect(),window.ratingState.delete(e),e.removeAttribute("data-rating-initialized"))}function m(e=document){e instanceof Element&&e.matches("[data-rating-component]")&&h(e),e&&typeof e.querySelectorAll=="function"&&e.querySelectorAll("[data-rating-component]:not([data-initialized])").forEach(h)}window.templUI=window.templUI||{},window.templUI.rating={init:m},document.addEventListener("DOMContentLoaded",()=>m())})();})(); diff --git a/server/web/assets/js/selectbox.min.js b/server/web/assets/js/selectbox.min.js new file mode 100644 index 0000000..9177142 --- /dev/null +++ b/server/web/assets/js/selectbox.min.js @@ -0,0 +1 @@ +(()=>{(function(){let v=!1;function k(d){if(!d||d.hasAttribute("data-initialized"))return;d.setAttribute("data-initialized","true");let r=d.querySelector("button.select-trigger");if(!r){console.error("Select box: Trigger button (.select-trigger) not found in wrapper",d);return}let x=r.getAttribute("data-tui-selectbox-content-id"),A=r.getAttribute("data-tui-selectbox-multiple")==="true",w=r.getAttribute("data-tui-selectbox-show-pills")==="true",y=x?document.getElementById(x):null,c=r.querySelector(".select-value"),a=r.querySelector('input[type="hidden"]');if(!y||!c||!a){console.error("Select box: Missing required elements for initialization.",{wrapper:d,contentID:x,contentExists:!!y,valueElExists:!!c,hiddenInputExists:!!a});return}r.addEventListener("keydown",t=>{(t.key.length===1||t.key==="Backspace"||t.key==="Delete")&&(t.preventDefault(),document.getElementById(x).click(),setTimeout(()=>{let e=document.querySelector("[data-tui-selectbox-search]");e&&(e.focus(),t.key!=="Backspace"&&t.key!=="Delete"&&(e.value=t.key))},0))});let n=y.cloneNode(!0);y.parentNode.replaceChild(n,y);let f=n.querySelector("[data-tui-selectbox-search]");if(f){let t=()=>{let e=window.getComputedStyle(n);e.display!=="none"&&e.visibility!=="hidden"&&e.opacity!=="0"&&f.focus()};document.addEventListener("click",e=>{r.contains(e.target)&&setTimeout(t,50)}),r.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&setTimeout(t,50)}),f.addEventListener("input",e=>{let o=e.target.value.toLowerCase().trim();n.querySelectorAll(".select-item").forEach(s=>{let u=s.querySelector(".select-item-text")?.textContent.toLowerCase()||"",i=s.getAttribute("data-tui-selectbox-value")?.toLowerCase()||"",g=o===""||u.includes(o)||i.includes(o);s.style.display=g?"":"none"})})}n.addEventListener("keydown",t=>{if(t.key==="ArrowDown"||t.key==="ArrowUp"){t.preventDefault();let e=Array.from(n.querySelectorAll(".select-item")).filter(s=>s.style.display!=="none");if(e.length===0)return;let o=n.querySelector(".select-item:focus"),l=0;if(o){let s=e.indexOf(o);t.key==="ArrowDown"?l=(s+1)%e.length:l=(s-1+e.length)%e.length}e[l].focus()}else if(t.key==="Enter"){t.preventDefault();let e=n.querySelector(".select-item:focus");e&&h(e)}else t.key==="Escape"&&(t.preventDefault(),n.querySelector(".select-item:focus")?f.focus():document.activeElement===f&&window.closePopover&&(window.closePopover(x,!0),setTimeout(()=>{r.focus()},50)))});let m=n.querySelectorAll('.select-item[data-tui-selectbox-selected="true"]');if(m.length>0)if(A){if(w){c.innerHTML="";let e=document.createElement("div");e.className="flex flex-nowrap overflow-hidden max-w-full whitespace-nowrap gap-1",Array.from(m).forEach(o=>{let l=document.createElement("div");l.className="flex items-center gap-1 px-2 py-1 text-xs rounded-md bg-primary text-primary-foreground";let s=document.createElement("span");s.textContent=o.querySelector(".select-item-text").textContent;let u=document.createElement("button");u.className="hover:text-destructive focus:outline-none",u.innerHTML="x",u.onclick=i=>{i.stopPropagation(),h(o)},l.appendChild(s),l.appendChild(u),e.appendChild(l)}),c.appendChild(e),c.classList.remove("text-muted-foreground"),setTimeout(()=>{let o=e.scrollWidth,l=c.clientWidth;if(o>l){let u=(r.getAttribute("data-tui-selectbox-selected-count-text")||`${m.length} items selected`).replace("{n}",m.length);c.innerHTML=u,c.classList.remove("text-muted-foreground")}},0)}else c.textContent=`${m.length} items selected`,c.classList.remove("text-muted-foreground");let t=Array.from(m).map(e=>e.getAttribute("data-tui-selectbox-value"));a.value=t.join(",")}else{let t=m[0],e=t.querySelector(".select-item-text");if(e&&(c.textContent=e.textContent,c.classList.remove("text-muted-foreground")),a){let o=t.getAttribute("data-value")||"";a.hasAttribute("data-initialized")||(a.value=o,a.setAttribute("data-initialized","true"),a.dispatchEvent(new Event("change",{bubbles:!0})))}}function C(){n.querySelectorAll(".select-item").forEach(t=>{t.getAttribute("data-tui-selectbox-selected")==="true"?(t.classList.add("bg-accent","text-accent-foreground"),t.classList.remove("bg-muted")):t.classList.remove("bg-accent","text-accent-foreground","bg-muted")})}function h(t){if(!t||t.getAttribute("data-tui-selectbox-disabled")==="true"||v)return;v=!0;let e=t.getAttribute("data-tui-selectbox-value"),o=t.querySelector(".select-item-text");if(A){let l=t.getAttribute("data-tui-selectbox-selected")==="true";if(t.setAttribute("data-tui-selectbox-selected",(!l).toString()),l){t.classList.remove("bg-accent","text-accent-foreground");let i=t.querySelector(".select-check");i&&i.classList.replace("opacity-100","opacity-0")}else{t.classList.add("bg-accent","text-accent-foreground");let i=t.querySelector(".select-check");i&&i.classList.replace("opacity-0","opacity-100")}let s=n.querySelectorAll('.select-item[data-tui-selectbox-selected="true"]');if(s.length>0)if(w){c.innerHTML="";let i=document.createElement("div");i.className="flex flex-nowrap overflow-hidden max-w-full whitespace-nowrap gap-1",Array.from(s).forEach(g=>{let p=document.createElement("div");p.className="flex items-center gap-1 px-2 py-0.5 text-xs rounded-full bg-accent text-accent-foreground";let E=document.createElement("span");E.textContent=g.querySelector(".select-item-text").textContent;let b=document.createElement("button");b.className="hover:text-destructive focus:outline-none",b.innerHTML="\xD7",b.onclick=q=>{q.stopPropagation(),h(g)},p.appendChild(E),p.appendChild(b),i.appendChild(p)}),c.appendChild(i),c.classList.remove("text-muted-foreground"),setTimeout(()=>{let g=i.scrollWidth,p=c.clientWidth;if(g>p){let b=(r.getAttribute("data-tui-selectbox-selected-count-text")||`${s.length} items selected`).replace("{n}",s.length);c.innerHTML=b,c.classList.remove("text-muted-foreground")}},0)}else c.textContent=`${s.length} items selected`,c.classList.remove("text-muted-foreground");else c.textContent=c.getAttribute("data-tui-selectbox-placeholder")||"",c.classList.add("text-muted-foreground");let u=Array.from(s).map(i=>i.getAttribute("data-tui-selectbox-value"));a.value=u.join(","),a.dispatchEvent(new Event("change",{bubbles:!0}))}else{n.querySelectorAll(".select-item").forEach(s=>{s.setAttribute("data-tui-selectbox-selected","false"),s.classList.remove("bg-accent","text-accent-foreground","bg-muted");let u=s.querySelector(".select-check");u&&u.classList.replace("opacity-100","opacity-0")}),t.setAttribute("data-tui-selectbox-selected","true"),t.classList.add("bg-accent","text-accent-foreground");let l=t.querySelector(".select-check");if(l&&l.classList.replace("opacity-0","opacity-100"),c&&o&&(c.textContent=o.textContent,c.classList.remove("text-muted-foreground")),a&&e!==null){let s=a.value;a.value=e,s!==e&&a.dispatchEvent(new Event("change",{bubbles:!0}))}window.closePopover?(window.closePopover(x,!0),setTimeout(()=>{r.focus()},50)):console.warn("closePopover function not found")}setTimeout(()=>{v=!1},100)}n.addEventListener("click",t=>{let e=t.target.closest(".select-item");e&&h(e)}),n.addEventListener("keydown",t=>{let e=t.target.closest(".select-item");e&&(t.key==="Enter"||t.key===" ")&&(t.preventDefault(),h(e))}),n.addEventListener("mouseover",t=>{let e=t.target.closest(".select-item");!e||e.getAttribute("data-tui-selectbox-disabled")==="true"||(n.querySelectorAll(".select-item").forEach(o=>{o.classList.remove("bg-accent","text-accent-foreground","bg-muted")}),e.getAttribute("data-tui-selectbox-selected")!=="true"&&e.classList.add("bg-accent","text-accent-foreground"))}),n.addEventListener("mouseleave",C);let S=d.closest("form");S&&S.addEventListener("reset",()=>{n.querySelectorAll(".select-item").forEach(e=>{e.setAttribute("data-tui-selectbox-selected","false");let o=e.querySelector(".select-check");o&&o.classList.replace("opacity-100","opacity-0"),e.classList.remove("bg-accent","text-accent-foreground")});let t=c.getAttribute("data-placeholder")||r.querySelector(".select-value")?.getAttribute("data-placeholder")||"Select...";c.textContent=t,c.classList.add("text-muted-foreground"),a.value="",f&&(f.value="",n.querySelectorAll(".select-item").forEach(e=>{e.style.display=""}))})}function L(d=document){d.querySelectorAll(".select-container").forEach(k)}window.templUI=window.templUI||{},window.templUI.selectbox={init:L},document.addEventListener("DOMContentLoaded",()=>L())})();})(); diff --git a/server/web/assets/js/slider.min.js b/server/web/assets/js/slider.min.js new file mode 100644 index 0000000..23b40f6 --- /dev/null +++ b/server/web/assets/js/slider.min.js @@ -0,0 +1 @@ +(()=>{(function(){function i(t){if(t.hasAttribute("data-initialized"))return;t.setAttribute("data-initialized","true");let e=t.id;if(!e)return;let d=document.querySelectorAll(`[data-slider-value][data-slider-value-for="${e}"]`);function a(){d.forEach(l=>{l.textContent=t.value})}a(),t.addEventListener("input",a)}function n(t=document){t instanceof Element&&t.matches('input[type="range"][data-slider-input]')&&i(t);for(let e of t.querySelectorAll('input[type="range"][data-slider-input]:not([data-initialized])'))i(e)}window.templUI=window.templUI||{},window.templUI.slider={init:n},document.addEventListener("DOMContentLoaded",()=>n())})();})(); diff --git a/server/web/assets/js/tabs.min.js b/server/web/assets/js/tabs.min.js new file mode 100644 index 0000000..7fa481c --- /dev/null +++ b/server/web/assets/js/tabs.min.js @@ -0,0 +1 @@ +(()=>{(function(){function o(e){if(e.hasAttribute("data-initialized"))return;e.setAttribute("data-initialized","true");let i=e.dataset.tabsId;if(!i)return;let d=Array.from(e.querySelectorAll(`[data-tabs-trigger][data-tabs-id="${i}"]`)),u=Array.from(e.querySelectorAll(`[data-tabs-content][data-tabs-id="${i}"]`)),n=e.querySelector(`[data-tabs-marker][data-tabs-id="${i}"]`);function b(t){!n||!t||(n.style.width=t.offsetWidth+"px",n.style.height=t.offsetHeight+"px",n.style.left=t.offsetLeft+"px")}function r(t){let f=null;for(let a of d){let s=a.dataset.tabsValue===t;a.dataset.state=s?"active":"inactive",a.classList.toggle("text-foreground",s),a.classList.toggle("bg-background",s),a.classList.toggle("shadow-xs",s),s&&(f=a)}for(let a of u){let s=a.dataset.tabsValue===t;a.dataset.state=s?"active":"inactive",a.classList.toggle("hidden",!s)}b(f)}let c=d.find(t=>t.dataset.state==="active")||d[0];c&&r(c.dataset.tabsValue);for(let t of d)t.addEventListener("click",()=>{r(t.dataset.tabsValue)})}function l(e=document){e instanceof Element&&e.matches("[data-tabs]")&&o(e);for(let i of e.querySelectorAll("[data-tabs]:not([data-initialized])"))o(i)}window.templUI=window.templUI||{},window.templUI.tabs={init:l},document.addEventListener("DOMContentLoaded",()=>l())})();})(); diff --git a/server/web/assets/js/tagsinput.min.js b/server/web/assets/js/tagsinput.min.js new file mode 100644 index 0000000..49de995 --- /dev/null +++ b/server/web/assets/js/tagsinput.min.js @@ -0,0 +1,5 @@ +(()=>{(function(){function g(n){if(!n||n.hasAttribute("data-initialized"))return;n.setAttribute("data-initialized","true");let a=n.querySelector("[data-text-input]"),s=n.querySelector("[data-hidden-inputs]"),d=n.querySelector("[data-tags-container]"),h=n.dataset.name,l=a?a.hasAttribute("disabled"):!1;if(!a)return;function v(t,e){let o=document.createElement("div");o.setAttribute("data-tag-chip",""),o.className="inline-flex items-center gap-2 rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-primary text-primary-foreground";let i=document.createElement("span");i.textContent=t;let r=document.createElement("button");return r.type="button",r.className="ml-1 text-current hover:text-destructive disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer",r.setAttribute("data-tag-remove",""),e&&(r.disabled=!0),r.innerHTML=` + + + + `,o.appendChild(i),o.appendChild(r),o}function y(t){if(l)return;let e=t.trim();if(!e)return;let o=s.querySelectorAll('input[type="hidden"]');for(let w of o)if(w.value.toLowerCase()===e.toLowerCase()){a.value="";return}let i=v(e,l),r=document.createElement("input");r.type="hidden",r.name=h,r.value=e,d.appendChild(i),s.appendChild(r),a.value=""}function c(t){if(l)return;let e=t.closest("[data-tag-chip]");if(!e)return;let o=e.querySelector("span").textContent.trim(),i=s.querySelector(`input[type="hidden"][value="${o}"]`);i&&i.remove(),e.remove()}function p(t){if(t.key==="Enter"||t.key===",")t.preventDefault(),y(a.value);else if(t.key==="Backspace"&&a.value===""){t.preventDefault();let e=d.querySelector("[data-tag-chip]:last-child");if(e){let o=e.querySelector("[data-tag-remove]");o&&c(o)}}}function f(t){t.target.closest("[data-tag-remove]")?(t.preventDefault(),t.stopPropagation(),c(t.target.closest("[data-tag-remove]"))):t.target.closest("input")||a.focus()}a.removeEventListener("keydown",p),a.addEventListener("keydown",p),n.removeEventListener("click",f),n.addEventListener("click",f);let m=n.closest("form");m&&m.addEventListener("reset",()=>{d.querySelectorAll("[data-tag-chip]").forEach(t=>t.remove()),s.querySelectorAll('input[type="hidden"]').forEach(t=>t.remove()),a.value=""})}function u(n=document){n.querySelectorAll("[data-tags-input]:not([data-initialized])").forEach(g)}window.templUI=window.templUI||{},window.templUI.tagsInput={init:u},document.addEventListener("DOMContentLoaded",()=>u())})();})(); diff --git a/server/web/assets/js/textarea.min.js b/server/web/assets/js/textarea.min.js new file mode 100644 index 0000000..926c106 --- /dev/null +++ b/server/web/assets/js/textarea.min.js @@ -0,0 +1 @@ +(()=>{(function(){function e(t){if(t.hasAttribute("data-initialized")||(t.setAttribute("data-initialized","true"),!(t.dataset.autoResize==="true")))return;let d=window.getComputedStyle(t).minHeight;function n(){t.style.height=d,t.style.height=`${t.scrollHeight}px`}n(),t.addEventListener("input",n)}function a(t=document){t instanceof Element&&t.matches("textarea[data-textarea]")&&e(t);for(let i of t.querySelectorAll("textarea[data-textarea]:not([data-initialized])"))e(i)}document.addEventListener("DOMContentLoaded",()=>a())})();})(); diff --git a/server/web/assets/js/toast.min.js b/server/web/assets/js/toast.min.js new file mode 100644 index 0000000..749b2bd --- /dev/null +++ b/server/web/assets/js/toast.min.js @@ -0,0 +1 @@ +(()=>{(function(){if(typeof window.toastHandler>"u"){let a=function(t){if(!t||t.hasAttribute("data-initialized")||(t.setAttribute("data-initialized","true"),window.toasts.has(t)))return;let i=parseInt(t.dataset.duration||"0"),r=t.querySelector("[data-toast-progress]"),d=t.querySelector("[data-toast-dismiss]"),e={timer:null,remaining:i,startTime:Date.now(),progress:r,paused:!1};window.toasts.set(t,e);function o(){clearTimeout(e.timer),t.classList.remove("toast-enter-active"),t.classList.add("toast-leave-active"),t.addEventListener("transitionend",()=>{t.remove(),window.toasts.delete(t)},{once:!0})}function u(n){n<=0||(clearTimeout(e.timer),e.startTime=Date.now(),e.remaining=n,e.paused=!1,e.timer=setTimeout(o,n),e.progress&&(e.progress.style.transition=`width ${n}ms linear`,e.progress.offsetWidth,e.progress.style.width="0%"))}function l(){if(!(e.paused||e.remaining<=0)&&(clearTimeout(e.timer),e.remaining-=Date.now()-e.startTime,e.paused=!0,e.progress)){let n=window.getComputedStyle(e.progress).width;e.progress.style.transition="none",e.progress.style.width=n}}function c(){!e.paused||e.remaining<=0||u(e.remaining)}i>0&&(t.addEventListener("mouseenter",l),t.addEventListener("mouseleave",c)),d&&d.addEventListener("click",o),setTimeout(()=>{t.classList.add("toast-enter-active"),e.progress&&(e.progress.style.width="100%"),u(i)},50)},s=function(t=document){let i=[];t instanceof Element&&t.matches("[data-toast]")&&(t.hasAttribute("data-initialized")||i.push(t)),t&&typeof t.querySelectorAll=="function"&&t.querySelectorAll("[data-toast]:not([data-initialized])").forEach(r=>{i.push(r)}),i.forEach(a)};var m=a,f=s;window.toastHandler=!0,window.toasts=new Map,window.templUI=window.templUI||{},window.templUI.toast={init:s},document.addEventListener("DOMContentLoaded",()=>s())}})();})(); diff --git a/server/web/assets/styles.css b/server/web/assets/styles.css index 4b2cc74..e4d543b 100644 --- a/server/web/assets/styles.css +++ b/server/web/assets/styles.css @@ -639,6 +639,9 @@ .left-2 { left: calc(var(--spacing) * 2); } + .left-3 { + left: calc(var(--spacing) * 3); + } .isolate { isolation: isolate; } @@ -1013,6 +1016,9 @@ .max-h-\[250px\] { max-height: 250px; } + .max-h-\[300px\] { + max-height: 300px; + } .max-h-\[501px\] { max-height: 501px; } @@ -1031,6 +1037,9 @@ .max-h-screen { max-height: 100vh; } + .min-h-0 { + min-height: calc(var(--spacing) * 0); + } .min-h-\[80px\] { min-height: 80px; } @@ -1136,6 +1145,9 @@ .max-w-7xl { max-width: var(--container-7xl); } + .max-w-full { + max-width: 100%; + } .max-w-md { max-width: var(--container-md); } @@ -1943,6 +1955,9 @@ .rounded-md { border-radius: calc(var(--radius) - 2px); } + .rounded-none { + border-radius: 0; + } .rounded-sm { border-radius: calc(var(--radius) - 4px); } @@ -2616,6 +2631,9 @@ .object-top-right { object-position: right top; } + .p-0 { + padding: calc(var(--spacing) * 0); + } .p-1 { padding: calc(var(--spacing) * 1); } @@ -2634,6 +2652,9 @@ .p-8 { padding: calc(var(--spacing) * 8); } + .px-0 { + padding-inline: calc(var(--spacing) * 0); + } .px-2 { padding-inline: calc(var(--spacing) * 2); } @@ -2709,6 +2730,9 @@ .pl-2 { padding-left: calc(var(--spacing) * 2); } + .pl-8 { + padding-left: calc(var(--spacing) * 8); + } .text-center { text-align: center; } @@ -2923,6 +2947,9 @@ .text-card-foreground { color: var(--card-foreground); } + .text-current { + color: currentcolor; + } .text-destructive { color: var(--destructive); } @@ -3194,6 +3221,12 @@ .ring-destructive { --tw-ring-color: var(--destructive); } + .ring-destructive\/20 { + --tw-ring-color: var(--destructive); + @supports (color: color-mix(in lab, red, red)) { + --tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent); + } + } .ring-ring { --tw-ring-color: var(--ring); } @@ -3262,6 +3295,9 @@ .filter { filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,); } + .filter\! { + filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,) !important; + } .backdrop-blur { --tw-backdrop-blur: blur(8px); -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,); @@ -3798,6 +3834,25 @@ border-color: #f3d5a3; } } + .focus-within\:border-ring { + &:focus-within { + border-color: var(--ring); + } + } + .focus-within\:ring-\[3px\] { + &:focus-within { + --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + } + .focus-within\:ring-ring\/50 { + &:focus-within { + --tw-ring-color: var(--ring); + @supports (color: color-mix(in lab, red, red)) { + --tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent); + } + } + } .hover\:-translate-y-px { &:hover { @media (hover: hover) { @@ -3918,6 +3973,13 @@ } } } + .hover\:text-destructive { + &:hover { + @media (hover: hover) { + color: var(--destructive); + } + } + } .hover\:text-foreground { &:hover { @media (hover: hover) { @@ -4016,6 +4078,11 @@ outline-style: none; } } + .focus-visible\:border-ring { + &:focus-visible { + border-color: var(--ring); + } + } .focus-visible\:ring-0 { &:focus-visible { --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor); @@ -4034,11 +4101,33 @@ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); } } + .focus-visible\:ring-\[3px\] { + &:focus-visible { + --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor); + box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + } + } + .focus-visible\:ring-destructive\/20 { + &:focus-visible { + --tw-ring-color: var(--destructive); + @supports (color: color-mix(in lab, red, red)) { + --tw-ring-color: color-mix(in oklab, var(--destructive) 20%, transparent); + } + } + } .focus-visible\:ring-ring { &:focus-visible { --tw-ring-color: var(--ring); } } + .focus-visible\:ring-ring\/50 { + &:focus-visible { + --tw-ring-color: var(--ring); + @supports (color: color-mix(in lab, red, red)) { + --tw-ring-color: color-mix(in oklab, var(--ring) 50%, transparent); + } + } + } .focus-visible\:ring-offset-0 { &:focus-visible { --tw-ring-offset-width: 0px; @@ -4093,6 +4182,11 @@ opacity: 50%; } } + .disabled\:opacity-100 { + &:disabled { + opacity: 100%; + } + } .has-\[\>svg\]\:px-2\.5 { &:has(>svg) { padding-inline: calc(var(--spacing) * 2.5); @@ -4349,6 +4443,40 @@ padding-inline: calc(var(--spacing) * 8); } } + .dark\:border-input { + &:where(.dark, .dark *) { + border-color: var(--input); + } + } + .dark\:bg-destructive\/60 { + &:where(.dark, .dark *) { + background-color: var(--destructive); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--destructive) 60%, transparent); + } + } + } + .dark\:bg-input\/30 { + &:where(.dark, .dark *) { + background-color: var(--input); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--input) 30%, transparent); + } + } + } + .dark\:bg-transparent { + &:where(.dark, .dark *) { + background-color: transparent; + } + } + .dark\:ring-destructive\/40 { + &:where(.dark, .dark *) { + --tw-ring-color: var(--destructive); + @supports (color: color-mix(in lab, red, red)) { + --tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent); + } + } + } .dark\:ring-ring\/20 { &:where(.dark, .dark *) { --tw-ring-color: var(--ring); @@ -4365,6 +4493,40 @@ } } } + .dark\:hover\:bg-accent\/50 { + &:where(.dark, .dark *) { + &:hover { + @media (hover: hover) { + background-color: var(--accent); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--accent) 50%, transparent); + } + } + } + } + } + .dark\:hover\:bg-input\/50 { + &:where(.dark, .dark *) { + &:hover { + @media (hover: hover) { + background-color: var(--input); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--input) 50%, transparent); + } + } + } + } + } + .dark\:focus-visible\:ring-destructive\/40 { + &:where(.dark, .dark *) { + &:focus-visible { + --tw-ring-color: var(--destructive); + @supports (color: color-mix(in lab, red, red)) { + --tw-ring-color: color-mix(in oklab, var(--destructive) 40%, transparent); + } + } + } + } .dark\:aria-invalid\:border-destructive { &:where(.dark, .dark *) { &[aria-invalid="true"] { @@ -4586,6 +4748,11 @@ } } } + .\[\&\>svg\]\:pointer-events-none { + &>svg { + pointer-events: none; + } + } .\[\&\>svg\]\:absolute { &>svg { position: absolute; @@ -4601,6 +4768,12 @@ left: calc(var(--spacing) * 4); } } + .\[\&\>svg\]\:size-3 { + &>svg { + width: calc(var(--spacing) * 3); + height: calc(var(--spacing) * 3); + } + } .\[\&\>svg\+div\]\:translate-y-\[-3px\] { &>svg+div { --tw-translate-y: -3px; @@ -4615,6 +4788,60 @@ } } } + .\[a\&\]\:hover\:bg-accent { + a& { + &:hover { + @media (hover: hover) { + background-color: var(--accent); + } + } + } + } + .\[a\&\]\:hover\:bg-destructive\/90 { + a& { + &:hover { + @media (hover: hover) { + background-color: var(--destructive); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--destructive) 90%, transparent); + } + } + } + } + } + .\[a\&\]\:hover\:bg-primary\/90 { + a& { + &:hover { + @media (hover: hover) { + background-color: var(--primary); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--primary) 90%, transparent); + } + } + } + } + } + .\[a\&\]\:hover\:bg-secondary\/90 { + a& { + &:hover { + @media (hover: hover) { + background-color: var(--secondary); + @supports (color: color-mix(in lab, red, red)) { + background-color: color-mix(in oklab, var(--secondary) 90%, transparent); + } + } + } + } + } + .\[a\&\]\:hover\:text-accent-foreground { + a& { + &:hover { + @media (hover: hover) { + color: var(---accent-foreground); + } + } + } + } } :root { --background: hsl(0 0% 100%); diff --git a/server/web/fileView.templ b/server/web/fileView.templ index 98c9b1a..b3e172c 100644 --- a/server/web/fileView.templ +++ b/server/web/fileView.templ @@ -28,7 +28,7 @@ templ FileView(file sqlc.File, fileProperties sqlc.FileProperty) { templ FileViewDeleteModal(fileid string) { @modal.Trigger(modal.TriggerProps{ - ModalID: "delete-modal", + For: "delete-modal", Class: "p-1", }) { @button.Button(button.Props{ @@ -52,14 +52,14 @@ templ FileViewDeleteModal(fileid string) { @modal.Footer() {
@modal.Close(modal.CloseProps{ - ModalID: "delete-modal", + For: "delete-modal", }) { @button.Button() { Cancel } } @modal.Close(modal.CloseProps{ - ModalID: "delete-modal", + For: "delete-modal", }) { @button.Button(button.Props{ Variant: button.VariantDestructive, @@ -76,7 +76,7 @@ templ FileViewDeleteModal(fileid string) { templ FileViewDownloadModal(fileid string) { @modal.Trigger(modal.TriggerProps{ - ModalID: "download-modal", + For: "download-modal", Class: "p-1", }) { @button.Button(button.Props{ @@ -100,14 +100,14 @@ templ FileViewDownloadModal(fileid string) { @modal.Footer() {
@modal.Close(modal.CloseProps{ - ModalID: "download-modal", + For: "download-modal", }) { @button.Button() { Cancel } } @modal.Close(modal.CloseProps{ - ModalID: "download-modal", + For: "download-modal", }) { @button.Button(button.Props{ Variant: button.VariantDestructive, diff --git a/server/web/fileView_templ.go b/server/web/fileView_templ.go index 5db9c68..af01338 100644 --- a/server/web/fileView_templ.go +++ b/server/web/fileView_templ.go @@ -166,8 +166,8 @@ func FileViewDeleteModal(fileid string) templ.Component { return nil }) templ_7745c5c3_Err = modal.Trigger(modal.TriggerProps{ - ModalID: "delete-modal", - Class: "p-1", + For: "delete-modal", + Class: "p-1", }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -289,7 +289,7 @@ func FileViewDeleteModal(fileid string) templ.Component { return nil }) templ_7745c5c3_Err = modal.Close(modal.CloseProps{ - ModalID: "delete-modal", + For: "delete-modal", }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -334,7 +334,7 @@ func FileViewDeleteModal(fileid string) templ.Component { return nil }) templ_7745c5c3_Err = modal.Close(modal.CloseProps{ - ModalID: "delete-modal", + For: "delete-modal", }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -431,8 +431,8 @@ func FileViewDownloadModal(fileid string) templ.Component { return nil }) templ_7745c5c3_Err = modal.Trigger(modal.TriggerProps{ - ModalID: "download-modal", - Class: "p-1", + For: "download-modal", + Class: "p-1", }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -554,7 +554,7 @@ func FileViewDownloadModal(fileid string) templ.Component { return nil }) templ_7745c5c3_Err = modal.Close(modal.CloseProps{ - ModalID: "download-modal", + For: "download-modal", }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var22), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -599,7 +599,7 @@ func FileViewDownloadModal(fileid string) templ.Component { return nil }) templ_7745c5c3_Err = modal.Close(modal.CloseProps{ - ModalID: "download-modal", + For: "download-modal", }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var24), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err diff --git a/server/web/templui/components/accordion/accordion.templ b/server/web/templui/components/accordion/accordion.templ index 3206e59..9c81b10 100644 --- a/server/web/templui/components/accordion/accordion.templ +++ b/server/web/templui/components/accordion/accordion.templ @@ -1,4 +1,4 @@ -// templui component accordion - version: main installed by templui v0.71.0 +// templui component accordion - version: v0.84.0 installed by templui v0.84.0 package accordion import ( diff --git a/server/web/templui/components/accordion/accordion_templ.go b/server/web/templui/components/accordion/accordion_templ.go index 6bd6d99..0b6f3e3 100644 --- a/server/web/templui/components/accordion/accordion_templ.go +++ b/server/web/templui/components/accordion/accordion_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component accordion - version: main installed by templui v0.71.0 +// templui component accordion - version: v0.84.0 installed by templui v0.84.0 package accordion diff --git a/server/web/templui/components/alert/alert.templ b/server/web/templui/components/alert/alert.templ index 675502b..5bdeaf4 100644 --- a/server/web/templui/components/alert/alert.templ +++ b/server/web/templui/components/alert/alert.templ @@ -1,4 +1,4 @@ -// templui component alert - version: main installed by templui v0.71.0 +// templui component alert - version: v0.84.0 installed by templui v0.84.0 package alert import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" diff --git a/server/web/templui/components/alert/alert_templ.go b/server/web/templui/components/alert/alert_templ.go index 614c9ee..eb29d51 100644 --- a/server/web/templui/components/alert/alert_templ.go +++ b/server/web/templui/components/alert/alert_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component alert - version: main installed by templui v0.71.0 +// templui component alert - version: v0.84.0 installed by templui v0.84.0 package alert diff --git a/server/web/templui/components/aspectratio/aspectratio.templ b/server/web/templui/components/aspectratio/aspectratio.templ new file mode 100644 index 0000000..a2afcb7 --- /dev/null +++ b/server/web/templui/components/aspectratio/aspectratio.templ @@ -0,0 +1,62 @@ +// templui component aspectratio - version: v0.84.0 installed by templui v0.84.0 +package aspectratio + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Ratio string + +const ( + RatioAuto Ratio = "auto" + RatioSquare Ratio = "square" + RatioVideo Ratio = "video" + RatioPortrait Ratio = "portrait" + RatioWide Ratio = "wide" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Ratio Ratio +} + +templ AspectRatio(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+
+ { children... } +
+
+} + +func ratioClass(ratio Ratio) string { + switch ratio { + case RatioSquare: + return "aspect-square" + case RatioVideo: + return "aspect-video" + case RatioPortrait: + return "aspect-[3/4]" + case RatioWide: + return "aspect-[2/1]" + case RatioAuto: + return "aspect-auto" + default: + return "aspect-auto" + } +} diff --git a/server/web/templui/components/aspectratio/aspectratio_templ.go b/server/web/templui/components/aspectratio/aspectratio_templ.go new file mode 100644 index 0000000..7132b2e --- /dev/null +++ b/server/web/templui/components/aspectratio/aspectratio_templ.go @@ -0,0 +1,145 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component aspectratio - version: v0.84.0 installed by templui v0.84.0 + +package aspectratio + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Ratio string + +const ( + RatioAuto Ratio = "auto" + RatioSquare Ratio = "square" + RatioVideo Ratio = "video" + RatioPortrait Ratio = "portrait" + RatioWide Ratio = "wide" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Ratio Ratio +} + +func AspectRatio(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative w-full", + ratioClass(p.Ratio), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func ratioClass(ratio Ratio) string { + switch ratio { + case RatioSquare: + return "aspect-square" + case RatioVideo: + return "aspect-video" + case RatioPortrait: + return "aspect-[3/4]" + case RatioWide: + return "aspect-[2/1]" + case RatioAuto: + return "aspect-auto" + default: + return "aspect-auto" + } +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/avatar/avatar.templ b/server/web/templui/components/avatar/avatar.templ index dc68bba..220855e 100644 --- a/server/web/templui/components/avatar/avatar.templ +++ b/server/web/templui/components/avatar/avatar.templ @@ -1,4 +1,4 @@ -// templui component avatar - version: main installed by templui v0.71.0 +// templui component avatar - version: v0.84.0 installed by templui v0.84.0 package avatar import ( @@ -52,7 +52,6 @@ type GroupProps struct { } templ Avatar(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -188,7 +187,7 @@ func Initials(name string) string { break } if len(part) > 0 { - initials += string(part[0]) + initials += string([]rune(part)[0]) } } return strings.ToUpper(initials) @@ -221,71 +220,6 @@ func avatarAlt(p ImageProps) string { return "" } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/avatar/avatar_templ.go b/server/web/templui/components/avatar/avatar_templ.go index 8ca0bf1..721ceeb 100644 --- a/server/web/templui/components/avatar/avatar_templ.go +++ b/server/web/templui/components/avatar/avatar_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component avatar - version: main installed by templui v0.71.0 +// templui component avatar - version: v0.84.0 installed by templui v0.84.0 package avatar @@ -81,10 +81,6 @@ func Avatar(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -114,7 +110,7 @@ func Avatar(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 63, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 62, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -210,7 +206,7 @@ func Image(props ...ImageProps) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 88, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 87, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -229,7 +225,7 @@ func Image(props ...ImageProps) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.Src) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 91, Col: 14} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 90, Col: 14} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -247,7 +243,7 @@ func Image(props ...ImageProps) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(avatarAlt(p)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 93, Col: 20} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 92, Col: 20} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -329,7 +325,7 @@ func Fallback(props ...FallbackProps) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 113, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 112, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -425,7 +421,7 @@ func Group(props ...GroupProps) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 134, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 133, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -522,7 +518,7 @@ func GroupOverflow(count int, props ...Props) templ.Component { var templ_7745c5c3_Var21 string templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 156, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 155, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { @@ -561,7 +557,7 @@ func GroupOverflow(count int, props ...Props) templ.Component { var templ_7745c5c3_Var23 string templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprint(count)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 168, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/avatar/avatar.templ`, Line: 167, Col: 56} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { @@ -594,7 +590,7 @@ func Initials(name string) string { break } if len(part) > 0 { - initials += string(part[0]) + initials += string([]rune(part)[0]) } } return strings.ToUpper(initials) @@ -627,8 +623,6 @@ func avatarAlt(p ImageProps) string { return "" } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -650,38 +644,7 @@ func Script() templ.Component { templ_7745c5c3_Var24 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var25 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/badge/badge.templ b/server/web/templui/components/badge/badge.templ index 01f9395..ca557d8 100644 --- a/server/web/templui/components/badge/badge.templ +++ b/server/web/templui/components/badge/badge.templ @@ -1,4 +1,4 @@ -// templui component badge - version: main installed by templui v0.71.0 +// templui component badge - version: v0.84.0 installed by templui v0.84.0 package badge import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" @@ -24,15 +24,16 @@ templ Badge(props ...Props) { if len(props) > 0 { {{ p = props[0] }} } -
svg]:size-3 gap-1 [&>svg]:pointer-events-none", + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", + "transition-[color,box-shadow] overflow-hidden", p.variantClasses(), p.Class, ), @@ -40,18 +41,18 @@ templ Badge(props ...Props) { { p.Attributes... } > { children... } -
+ } func (p Props) variantClasses() string { switch p.Variant { case VariantDestructive: - return "border-transparent bg-destructive text-destructive-foreground" + return "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" case VariantOutline: - return "text-foreground border-border" + return "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground" case VariantSecondary: - return "border-transparent bg-secondary text-secondary-foreground" + return "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90" default: - return "border-transparent bg-primary text-primary-foreground" + return "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90" } } diff --git a/server/web/templui/components/badge/badge_templ.go b/server/web/templui/components/badge/badge_templ.go index f6cb426..8b8a639 100644 --- a/server/web/templui/components/badge/badge_templ.go +++ b/server/web/templui/components/badge/badge_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component badge - version: main installed by templui v0.71.0 +// templui component badge - version: v0.84.0 installed by templui v0.84.0 package badge @@ -55,9 +55,10 @@ func Badge(props ...Props) templ.Component { } var templ_7745c5c3_Var2 = []any{ utils.TwMerge( - "inline-flex items-center gap-2", - "rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors", - "focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2", + "inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none", + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", + "transition-[color,box-shadow] overflow-hidden", p.variantClasses(), p.Class, ), @@ -66,7 +67,7 @@ func Badge(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -129,13 +130,13 @@ func Badge(props ...Props) templ.Component { func (p Props) variantClasses() string { switch p.Variant { case VariantDestructive: - return "border-transparent bg-destructive text-destructive-foreground" + return "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" case VariantOutline: - return "text-foreground border-border" + return "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground" case VariantSecondary: - return "border-transparent bg-secondary text-secondary-foreground" + return "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90" default: - return "border-transparent bg-primary text-primary-foreground" + return "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90" } } diff --git a/server/web/templui/components/breadcrumb/breadcrumb.templ b/server/web/templui/components/breadcrumb/breadcrumb.templ index 4dbb94d..0d62d3c 100644 --- a/server/web/templui/components/breadcrumb/breadcrumb.templ +++ b/server/web/templui/components/breadcrumb/breadcrumb.templ @@ -1,4 +1,4 @@ -// templui component breadcrumb - version: main installed by templui v0.71.0 +// templui component breadcrumb - version: v0.84.0 installed by templui v0.84.0 package breadcrumb import ( diff --git a/server/web/templui/components/breadcrumb/breadcrumb_templ.go b/server/web/templui/components/breadcrumb/breadcrumb_templ.go index babfd74..4dd0850 100644 --- a/server/web/templui/components/breadcrumb/breadcrumb_templ.go +++ b/server/web/templui/components/breadcrumb/breadcrumb_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component breadcrumb - version: main installed by templui v0.71.0 +// templui component breadcrumb - version: v0.84.0 installed by templui v0.84.0 package breadcrumb diff --git a/server/web/templui/components/button/button.templ b/server/web/templui/components/button/button.templ index 58f7a5c..a2b10bc 100644 --- a/server/web/templui/components/button/button.templ +++ b/server/web/templui/components/button/button.templ @@ -1,4 +1,4 @@ -// templui component button - version: main installed by templui v0.71.0 +// templui component button - version: v0.84.0 installed by templui v0.84.0 package button import ( @@ -26,28 +26,23 @@ const ( ) const ( - SizeIcon Size = "icon" + SizeDefault Size = "default" + SizeSm Size = "sm" + SizeLg Size = "lg" + SizeIcon Size = "icon" ) type Props struct { - ID string - Class string - Attributes templ.Attributes - Variant Variant - Size Size - FullWidth bool - Href string - Target string - Disabled bool - Type Type - HxGet string - HxPost string - HxPut string - HxDelete string - HxTrigger string - HxTarget string - HxSwap string - HxReplaceUrl string + ID string + Class string + Attributes templ.Attributes + Variant Variant + Size Size + FullWidth bool + Href string + Target string + Disabled bool + Type Type } templ Button(props ...Props) { @@ -69,8 +64,10 @@ templ Button(props ...Props) { } class={ utils.TwMerge( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors", - "focus-visible:outline-hidden focus-visible:ring-2 focus:ring-ring focus-visible:ring-offset-2", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all", + "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0", + "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", "cursor-pointer", p.variantClasses(), p.sizeClasses(), @@ -89,9 +86,10 @@ templ Button(props ...Props) { } class={ utils.TwMerge( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors", - "focus-visible:outline-hidden focus-visible:ring-2 focus:ring-ring focus-visible:ring-offset-2", - "disabled:opacity-50 disabled:cursor-not-allowed", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all", + "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0", + "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", "cursor-pointer", p.variantClasses(), p.sizeClasses(), @@ -103,30 +101,6 @@ templ Button(props ...Props) { type={ string(p.Type) } } disabled?={ p.Disabled } - if p.HxGet != "" { - hx-get={ p.HxGet } - } - if p.HxPost != "" { - hx-post={ p.HxPost } - } - if p.HxPut != "" { - hx-put={ p.HxPut } - } - if p.HxDelete != "" { - hx-delete={ p.HxDelete } - } - if p.HxTrigger != "" { - hx-trigger={ p.HxTrigger } - } - if p.HxTarget != "" { - hx-target={ p.HxTarget } - } - if p.HxSwap != "" { - hx-swap={ p.HxSwap } - } - if p.HxReplaceUrl != "" { - hx-replace-url={ p.HxReplaceUrl } - } { p.Attributes... } > { children... } @@ -137,26 +111,30 @@ templ Button(props ...Props) { func (b Props) variantClasses() string { switch b.Variant { case VariantDestructive: - return "bg-destructive text-destructive-foreground hover:bg-destructive/90" + return "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" case VariantOutline: - return "border border-input bg-background hover:bg-accent hover:text-accent-foreground" + return "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50" case VariantSecondary: - return "bg-secondary text-secondary-foreground hover:bg-secondary/80" + return "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80" case VariantGhost: - return "hover:bg-accent hover:text-accent-foreground" + return "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50" case VariantLink: return "text-primary underline-offset-4 hover:underline" default: - return "bg-primary text-primary-foreground hover:bg-primary/90" + return "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90" } } func (b Props) sizeClasses() string { switch b.Size { + case SizeSm: + return "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5" + case SizeLg: + return "h-10 rounded-md px-6 has-[>svg]:px-4" case SizeIcon: - return "h-10 w-10" - default: - return "h-10 px-4 py-2 rounded-md" + return "size-9" + default: // SizeDefault + return "h-9 px-4 py-2 has-[>svg]:px-3" } } diff --git a/server/web/templui/components/button/button_templ.go b/server/web/templui/components/button/button_templ.go index e538fc7..8a880d3 100644 --- a/server/web/templui/components/button/button_templ.go +++ b/server/web/templui/components/button/button_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component button - version: main installed by templui v0.71.0 +// templui component button - version: v0.84.0 installed by templui v0.84.0 package button @@ -35,28 +35,23 @@ const ( ) const ( - SizeIcon Size = "icon" + SizeDefault Size = "default" + SizeSm Size = "sm" + SizeLg Size = "lg" + SizeIcon Size = "icon" ) type Props struct { - ID string - Class string - Attributes templ.Attributes - Variant Variant - Size Size - FullWidth bool - Href string - Target string - Disabled bool - Type Type - HxGet string - HxPost string - HxPut string - HxDelete string - HxTrigger string - HxTarget string - HxSwap string - HxReplaceUrl string + ID string + Class string + Attributes templ.Attributes + Variant Variant + Size Size + FullWidth bool + Href string + Target string + Disabled bool + Type Type } func Button(props ...Props) templ.Component { @@ -90,8 +85,10 @@ func Button(props ...Props) templ.Component { if p.Href != "" && !p.Disabled { var templ_7745c5c3_Var2 = []any{ utils.TwMerge( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors", - "focus-visible:outline-hidden focus-visible:ring-2 focus:ring-ring focus-visible:ring-offset-2", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all", + "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0", + "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", "cursor-pointer", p.variantClasses(), p.sizeClasses(), @@ -115,7 +112,7 @@ func Button(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 64, Col: 13} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 59, Col: 13} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -147,7 +144,7 @@ func Button(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 68, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 63, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -194,9 +191,10 @@ func Button(props ...Props) templ.Component { } else { var templ_7745c5c3_Var7 = []any{ utils.TwMerge( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors", - "focus-visible:outline-hidden focus-visible:ring-2 focus:ring-ring focus-visible:ring-offset-2", - "disabled:opacity-50 disabled:cursor-not-allowed", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all", + "disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0", + "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", "cursor-pointer", p.variantClasses(), p.sizeClasses(), @@ -220,7 +218,7 @@ func Button(props ...Props) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 88, Col: 13} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 85, Col: 13} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -256,7 +254,7 @@ func Button(props ...Props) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(string(p.Type)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 103, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 101, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -273,163 +271,11 @@ func Button(props ...Props) templ.Component { return templ_7745c5c3_Err } } - if p.HxGet != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " hx-get=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxGet) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 107, Col: 20} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxPost != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, " hx-post=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxPost) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 110, Col: 22} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxPut != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, " hx-put=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var13 string - templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxPut) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 113, Col: 20} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxDelete != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " hx-delete=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var14 string - templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxDelete) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 116, Col: 26} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxTrigger != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, " hx-trigger=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxTrigger) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 119, Col: 28} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxTarget != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, " hx-target=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var16 string - templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxTarget) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 122, Col: 26} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxSwap != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, " hx-swap=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var17 string - templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxSwap) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 125, Col: 22} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxReplaceUrl != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, " hx-replace-url=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var18 string - templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxReplaceUrl) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/button/button.templ`, Line: 128, Col: 35} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } templ_7745c5c3_Err = templ.RenderAttributes(ctx, templ_7745c5c3_Buffer, p.Attributes) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, ">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -437,7 +283,7 @@ func Button(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -449,26 +295,30 @@ func Button(props ...Props) templ.Component { func (b Props) variantClasses() string { switch b.Variant { case VariantDestructive: - return "bg-destructive text-destructive-foreground hover:bg-destructive/90" + return "bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60" case VariantOutline: - return "border border-input bg-background hover:bg-accent hover:text-accent-foreground" + return "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50" case VariantSecondary: - return "bg-secondary text-secondary-foreground hover:bg-secondary/80" + return "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80" case VariantGhost: - return "hover:bg-accent hover:text-accent-foreground" + return "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50" case VariantLink: return "text-primary underline-offset-4 hover:underline" default: - return "bg-primary text-primary-foreground hover:bg-primary/90" + return "bg-primary text-primary-foreground shadow-xs hover:bg-primary/90" } } func (b Props) sizeClasses() string { switch b.Size { + case SizeSm: + return "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5" + case SizeLg: + return "h-10 rounded-md px-6 has-[>svg]:px-4" case SizeIcon: - return "h-10 w-10" - default: - return "h-10 px-4 py-2 rounded-md" + return "size-9" + default: // SizeDefault + return "h-9 px-4 py-2 has-[>svg]:px-3" } } diff --git a/server/web/templui/components/calendar/calendar.templ b/server/web/templui/components/calendar/calendar.templ index 05cdb61..af7539c 100644 --- a/server/web/templui/components/calendar/calendar.templ +++ b/server/web/templui/components/calendar/calendar.templ @@ -1,4 +1,4 @@ -// templui component calendar - version: main installed by templui v0.71.0 +// templui component calendar - version: v0.84.0 installed by templui v0.84.0 package calendar import ( @@ -32,7 +32,6 @@ type Props struct { } templ Calendar(props ...Props) { - @Script() {{ var p Props if len(props) > 0 { @@ -93,10 +92,18 @@ templ Calendar(props ...Props) {
- -
@@ -109,195 +116,6 @@ templ Calendar(props ...Props) {
} -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/calendar/calendar_templ.go b/server/web/templui/components/calendar/calendar_templ.go index e333575..16789d3 100644 --- a/server/web/templui/components/calendar/calendar_templ.go +++ b/server/web/templui/components/calendar/calendar_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component calendar - version: main installed by templui v0.71.0 +// templui component calendar - version: v0.84.0 installed by templui v0.84.0 package calendar @@ -61,10 +61,6 @@ func Calendar(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { @@ -129,7 +125,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID + "-wrapper") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 76, Col: 46} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 75, Col: 46} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -142,7 +138,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 79, Col: 16} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 78, Col: 16} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -155,7 +151,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(initialSelectedISO) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 80, Col: 29} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 79, Col: 29} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -168,7 +164,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID + "-hidden") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 81, Col: 24} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 80, Col: 24} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -181,7 +177,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 85, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 84, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -194,7 +190,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(string(p.LocaleTag)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 87, Col: 40} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 86, Col: 40} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -207,7 +203,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(initialMonth)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 88, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 87, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -220,7 +216,7 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(initialYear)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 89, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 88, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -233,13 +229,13 @@ func Calendar(props ...Props) templ.Component { var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(initialSelectedISO) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 90, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/calendar/calendar.templ`, Line: 89, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\">
} - -templ Horizontal(props ...HorizontalProps) { - {{ var p HorizontalProps }} - if len(props) > 0 { - {{ p = props[0] }} - } -
- { children... } -
-} - -templ Media(props ...MediaProps) { - {{ var p MediaProps }} - if len(props) > 0 { - {{ p = props[0] }} - } -
- @aspectratio.AspectRatio(aspectratio.Props{ - ID: p.ID + "-aspect", - Ratio: p.AspectRatio, - Class: "h-full w-full", - }) { - { - } -
-} - -func mediaPositionClasses(position MediaPosition, width MediaWidth) string { - var positionClass string - - switch position { - case MediaPositionTop: - return "w-full rounded-t-lg" - case MediaPositionBottom: - return "w-full rounded-b-lg" - case MediaPositionLeft: - positionClass = "shrink-0 rounded-l-lg" - case MediaPositionRight: - positionClass = "shrink-0 rounded-r-lg" - default: - positionClass = "" - } - - if position == MediaPositionLeft || position == MediaPositionRight { - return positionClass + " " + widthClass(width) - } - - return positionClass -} - -func widthClass(width MediaWidth) string { - switch width { - case MediaWidthFull: - return "w-full" - case MediaWidthHalf: - return "w-1/2" - case MediaWidthThird: - return "w-1/3" - case MediaWidthQuarter: - return "w-1/4" - case MediaWidthTwoThirds: - return "w-2/3" - case MediaWidthThreeQuarters: - return "w-3/4" - default: - return "w-1/3" - } -} diff --git a/server/web/templui/components/card/card_templ.go b/server/web/templui/components/card/card_templ.go index 28aa5d5..d857a69 100644 --- a/server/web/templui/components/card/card_templ.go +++ b/server/web/templui/components/card/card_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component card - version: main installed by templui v0.71.0 +// templui component card - version: v0.84.0 installed by templui v0.84.0 package card @@ -10,30 +10,7 @@ package card import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import ( - "git.jmbit.de/jmb/scanfile/server/web/templui/components/aspectratio" - "git.jmbit.de/jmb/scanfile/server/web/templui/utils" -) - -type MediaPosition string -type MediaWidth string - -const ( - MediaPositionTop MediaPosition = "top" - MediaPositionBottom MediaPosition = "bottom" - MediaPositionLeft MediaPosition = "left" - MediaPositionRight MediaPosition = "right" -) - -const ( - MediaWidthAuto MediaWidth = "auto" - MediaWidthFull MediaWidth = "full" - MediaWidthHalf MediaWidth = "half" - MediaWidthThird MediaWidth = "third" - MediaWidthQuarter MediaWidth = "quarter" - MediaWidthTwoThirds MediaWidth = "two-thirds" - MediaWidthThreeQuarters MediaWidth = "three-quarters" -) +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" type Props struct { ID string @@ -71,23 +48,6 @@ type FooterProps struct { Attributes templ.Attributes } -type HorizontalProps struct { - ID string - Class string - Attributes templ.Attributes -} - -type MediaProps struct { - ID string - Class string - Attributes templ.Attributes - Src string - Alt string - Position MediaPosition - Width MediaWidth - AspectRatio aspectratio.Ratio -} - func Card(props ...Props) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -135,7 +95,7 @@ func Card(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 89, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 49, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -230,7 +190,7 @@ func Header(props ...HeaderProps) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 110, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 70, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -325,7 +285,7 @@ func Title(props ...TitleProps) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 131, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 91, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -420,7 +380,7 @@ func Description(props ...DescriptionProps) templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 152, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 112, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -515,7 +475,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 173, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 133, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { @@ -610,7 +570,7 @@ func Footer(props ...FooterProps) templ.Component { var templ_7745c5c3_Var23 string templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 194, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/card/card.templ`, Line: 154, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { @@ -658,301 +618,4 @@ func Footer(props ...FooterProps) templ.Component { }) } -func Horizontal(props ...HorizontalProps) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var25 := templ.GetChildren(ctx) - if templ_7745c5c3_Var25 == nil { - templ_7745c5c3_Var25 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - var p HorizontalProps - if len(props) > 0 { - p = props[0] - } - var templ_7745c5c3_Var26 = []any{ - utils.TwMerge( - "flex overflow-hidden", - p.Class, - ), - } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var26...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var25.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func Media(props ...MediaProps) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var29 := templ.GetChildren(ctx) - if templ_7745c5c3_Var29 == nil { - templ_7745c5c3_Var29 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - var p MediaProps - if len(props) > 0 { - p = props[0] - } - var templ_7745c5c3_Var30 = []any{ - utils.TwMerge( - "overflow-hidden", - mediaPositionClasses(p.Position, p.Width), - p.Class, - ), - } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var30...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Var33 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = aspectratio.AspectRatio(aspectratio.Props{ - ID: p.ID + "-aspect", - Ratio: p.AspectRatio, - Class: "h-full w-full", - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var33), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func mediaPositionClasses(position MediaPosition, width MediaWidth) string { - var positionClass string - - switch position { - case MediaPositionTop: - return "w-full rounded-t-lg" - case MediaPositionBottom: - return "w-full rounded-b-lg" - case MediaPositionLeft: - positionClass = "shrink-0 rounded-l-lg" - case MediaPositionRight: - positionClass = "shrink-0 rounded-r-lg" - default: - positionClass = "" - } - - if position == MediaPositionLeft || position == MediaPositionRight { - return positionClass + " " + widthClass(width) - } - - return positionClass -} - -func widthClass(width MediaWidth) string { - switch width { - case MediaWidthFull: - return "w-full" - case MediaWidthHalf: - return "w-1/2" - case MediaWidthThird: - return "w-1/3" - case MediaWidthQuarter: - return "w-1/4" - case MediaWidthTwoThirds: - return "w-2/3" - case MediaWidthThreeQuarters: - return "w-3/4" - default: - return "w-1/3" - } -} - var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/carousel/carousel.templ b/server/web/templui/components/carousel/carousel.templ index 5a23fd6..f073608 100644 --- a/server/web/templui/components/carousel/carousel.templ +++ b/server/web/templui/components/carousel/carousel.templ @@ -1,4 +1,4 @@ -// templui component carousel - version: main installed by templui v0.71.0 +// templui component carousel - version: v0.84.0 installed by templui v0.84.0 package carousel import ( @@ -49,7 +49,6 @@ type IndicatorsProps struct { } templ Carousel(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -198,197 +197,6 @@ templ Indicators(props ...IndicatorsProps) { } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/carousel/carousel_templ.go b/server/web/templui/components/carousel/carousel_templ.go index 214d410..36a90fd 100644 --- a/server/web/templui/components/carousel/carousel_templ.go +++ b/server/web/templui/components/carousel/carousel_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component carousel - version: main installed by templui v0.71.0 +// templui component carousel - version: v0.84.0 installed by templui v0.84.0 package carousel @@ -78,10 +78,6 @@ func Carousel(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -108,7 +104,7 @@ func Carousel(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 59, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 58, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -139,7 +135,7 @@ func Carousel(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatBool(p.Autoplay)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 67, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 66, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -157,7 +153,7 @@ func Carousel(props ...Props) templ.Component { return p.Interval }())) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 73, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 72, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -170,7 +166,7 @@ func Carousel(props ...Props) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatBool(p.Loop)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 74, Col: 40} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 73, Col: 40} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -247,7 +243,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 88, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 87, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -342,7 +338,7 @@ func Item(props ...ItemProps) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 109, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 108, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -437,7 +433,7 @@ func Previous(props ...PreviousProps) templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 130, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 129, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -532,7 +528,7 @@ func Next(props ...NextProps) templ.Component { var templ_7745c5c3_Var22 string templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 153, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 152, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { @@ -627,7 +623,7 @@ func Indicators(props ...IndicatorsProps) templ.Component { var templ_7745c5c3_Var26 string templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 176, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 175, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) if templ_7745c5c3_Err != nil { @@ -694,7 +690,7 @@ func Indicators(props ...IndicatorsProps) templ.Component { var templ_7745c5c3_Var30 string templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("Go to slide %d", i+1)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 194, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/carousel/carousel.templ`, Line: 193, Col: 51} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) if templ_7745c5c3_Err != nil { @@ -713,8 +709,6 @@ func Indicators(props ...IndicatorsProps) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -736,38 +730,7 @@ func Script() templ.Component { templ_7745c5c3_Var31 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var32 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var32), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/chart/chart.templ b/server/web/templui/components/chart/chart.templ index 1a72305..2dfbc8e 100644 --- a/server/web/templui/components/chart/chart.templ +++ b/server/web/templui/components/chart/chart.templ @@ -1,4 +1,4 @@ -// templui component chart - version: main installed by templui v0.71.0 +// templui component chart - version: v0.84.0 installed by templui v0.84.0 package chart import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" @@ -49,7 +49,6 @@ type Config struct { Stacked bool `json:"stacked"` } -// Erweiterung des Props um ID und Attributes type Props struct { ID string Variant Variant @@ -69,7 +68,6 @@ type Props struct { } templ Chart(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -110,221 +108,5 @@ templ Chart(props ...Props) { } templ Script() { - - + } diff --git a/server/web/templui/components/chart/chart_templ.go b/server/web/templui/components/chart/chart_templ.go index 3ebc801..6ae285a 100644 --- a/server/web/templui/components/chart/chart_templ.go +++ b/server/web/templui/components/chart/chart_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component chart - version: main installed by templui v0.71.0 +// templui component chart - version: v0.84.0 installed by templui v0.84.0 package chart @@ -58,7 +58,6 @@ type Config struct { Stacked bool `json:"stacked"` } -// Erweiterung des Props um ID und Attributes type Props struct { ID string Variant Variant @@ -98,10 +97,6 @@ func Chart(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -127,7 +122,7 @@ func Chart(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/chart/chart.templ`, Line: 83, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/chart/chart.templ`, Line: 81, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -161,7 +156,7 @@ func Chart(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(canvasId) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/chart/chart.templ`, Line: 91, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/chart/chart.templ`, Line: 89, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -174,7 +169,7 @@ func Chart(props ...Props) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(dataId) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/chart/chart.templ`, Line: 91, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/chart/chart.templ`, Line: 89, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -228,33 +223,7 @@ func Script() templ.Component { templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/checkbox/checkbox.templ b/server/web/templui/components/checkbox/checkbox.templ index 6967465..421bd52 100644 --- a/server/web/templui/components/checkbox/checkbox.templ +++ b/server/web/templui/components/checkbox/checkbox.templ @@ -1,4 +1,4 @@ -// templui component checkbox - version: main installed by templui v0.71.0 +// templui component checkbox - version: v0.84.0 installed by templui v0.84.0 package checkbox import ( diff --git a/server/web/templui/components/checkbox/checkbox_templ.go b/server/web/templui/components/checkbox/checkbox_templ.go index 9f8648b..7e8ea74 100644 --- a/server/web/templui/components/checkbox/checkbox_templ.go +++ b/server/web/templui/components/checkbox/checkbox_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component checkbox - version: main installed by templui v0.71.0 +// templui component checkbox - version: v0.84.0 installed by templui v0.84.0 package checkbox diff --git a/server/web/templui/components/checkboxcard/checkboxcard.templ b/server/web/templui/components/checkboxcard/checkboxcard.templ new file mode 100644 index 0000000..b37b72a --- /dev/null +++ b/server/web/templui/components/checkboxcard/checkboxcard.templ @@ -0,0 +1,152 @@ +// templui component checkboxcard - version: v0.84.0 installed by templui v0.84.0 +package checkboxcard + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Checked bool + Disabled bool + Required bool + Name string + Value string +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ CheckboxCard(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } + {{ inputId := p.ID + "-input" }} +
+ + +
+} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

+ { children... } +

+} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} diff --git a/server/web/templui/components/checkboxcard/checkboxcard_templ.go b/server/web/templui/components/checkboxcard/checkboxcard_templ.go new file mode 100644 index 0000000..db1689f --- /dev/null +++ b/server/web/templui/components/checkboxcard/checkboxcard_templ.go @@ -0,0 +1,548 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component checkboxcard - version: v0.84.0 installed by templui v0.84.0 + +package checkboxcard + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Checked bool + Disabled bool + Required bool + Name string + Value string +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func CheckboxCard(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + inputId := p.ID + "-input" + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative", + utils.If(p.Disabled, "opacity-60"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 = []any{ + utils.TwMerge( + "block w-full rounded-lg border overflow-hidden h-full", + "bg-card text-card-foreground p-4 flex flex-col", + "cursor-pointer", + "hover:border-primary/50", + "peer-checked:ring-1 peer-checked:ring-primary peer-checked:border-primary", + utils.If(p.Disabled, "cursor-not-allowed"), + "transition-all duration-200", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var12 = []any{ + utils.TwMerge( + "flex items-center justify-between mb-2", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var16 = []any{ + utils.TwMerge( + "text-sm text-muted-foreground", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{ + utils.TwMerge( + "mt-auto pt-4 w-full", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var19.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/code/code.templ b/server/web/templui/components/code/code.templ index 82842ad..8ca0521 100644 --- a/server/web/templui/components/code/code.templ +++ b/server/web/templui/components/code/code.templ @@ -1,4 +1,4 @@ -// templui component code - version: main installed by templui v0.71.0 +// templui component code - version: v0.84.0 installed by templui v0.84.0 package code import ( @@ -25,7 +25,7 @@ type Props struct { } templ Code(props ...Props) { - @Script() + {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -74,124 +74,6 @@ templ Code(props ...Props) { } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - - - } + } diff --git a/server/web/templui/components/code/code_templ.go b/server/web/templui/components/code/code_templ.go index 5d8874c..3afc1b7 100644 --- a/server/web/templui/components/code/code_templ.go +++ b/server/web/templui/components/code/code_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component code - version: main installed by templui v0.71.0 +// templui component code - version: v0.84.0 installed by templui v0.84.0 package code @@ -54,7 +54,7 @@ func Code(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -70,7 +70,7 @@ func Code(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
")
+		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, ">
")
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
@@ -123,7 +123,7 @@ func Code(props ...Props) templ.Component {
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
-		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "")
+		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\">")
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
@@ -144,12 +144,12 @@ func Code(props ...Props) templ.Component {
 		if templ_7745c5c3_Err != nil {
 			return templ_7745c5c3_Err
 		}
-		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if p.ShowCopyButton { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -178,8 +178,6 @@ func Code(props ...Props) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -201,51 +199,7 @@ func Script() templ.Component { templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/datepicker/datepicker.templ b/server/web/templui/components/datepicker/datepicker.templ new file mode 100644 index 0000000..aae9fe4 --- /dev/null +++ b/server/web/templui/components/datepicker/datepicker.templ @@ -0,0 +1,141 @@ +// templui component datepicker - version: v0.84.0 installed by templui v0.84.0 +package datepicker + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/calendar" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/card" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "time" +) + +type Format string +type LocaleTag string + +const ( + FormatLOCALE_SHORT Format = "locale-short" // Locale-specific short format (e.g., MM/DD/YY or DD.MM.YY) + FormatLOCALE_MEDIUM Format = "locale-medium" // Locale-specific medium format (e.g., Jan 5, 2024 or 5. Jan. 2024) + FormatLOCALE_LONG Format = "locale-long" // Locale-specific long format (e.g., January 5, 2024 or 5. Januar 2024) + FormatLOCALE_FULL Format = "locale-full" // Locale-specific full format (e.g., Monday, January 5, 2024 or Montag, 5. Januar 2024) +) + +// Common Locale (BCP 47) +var ( + LocaleDefaultTag = LocaleTag("en-US") + LocaleTagChinese = LocaleTag("zh-CN") + LocaleTagFrench = LocaleTag("fr-FR") + LocaleTagGerman = LocaleTag("de-DE") + LocaleTagItalian = LocaleTag("it-IT") + LocaleTagJapanese = LocaleTag("ja-JP") + LocaleTagPortuguese = LocaleTag("pt-PT") + LocaleTagSpanish = LocaleTag("es-ES") +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value time.Time + Format Format // Controls the display format using Intl dateStyle options. + LocaleTag LocaleTag // BCP 47 Locale Tag (e.g., "en-US", "es-ES"). Determines language and regional format defaults. + Placeholder string + Disabled bool + Required bool + HasError bool + Name string +} + +templ DatePicker(props ...Props) { + {{ + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + if p.Name == "" { + p.Name = p.ID + } + if p.Placeholder == "" { + p.Placeholder = "Select a date" + } + if p.LocaleTag == "" { + p.LocaleTag = LocaleDefaultTag + } + if p.Format == "" { + p.Format = FormatLOCALE_MEDIUM + } + + var contentID = p.ID + "-content" + var valuePtr *time.Time + if !p.Value.IsZero() { + valuePtr = &p.Value + } + }} + @popover.Trigger(popover.TriggerProps{For: contentID}) { + @button.Button(button.Props{ + ID: p.ID, + Variant: button.VariantOutline, + Class: utils.TwMerge( + // Base styles matching input + "w-full h-9 px-3 py-1 text-base md:text-sm", + "flex items-center justify-between", + "rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none", + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes(p.Attributes, templ.Attributes{ + "data-datepicker": "true", + "data-display-format": string(p.Format), + "data-locale-tag": string(p.LocaleTag), + "data-placeholder": p.Placeholder, + "aria-invalid": utils.If(p.HasError, "true"), + }), + }) { + if p.Placeholder != "" { + + { p.Placeholder } + + } + + @icon.Calendar(icon.Props{Size: 16}) + + } + } + @popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Class: "p-0", + }) { + @card.Card(card.Props{ + Class: "border-0 shadow-none", + }) { + @card.Content(card.ContentProps{ + Class: "p-3", + }) { + @calendar.Calendar(calendar.Props{ + ID: p.ID + "-calendar-instance", // Pass ID for calendar instance + Name: p.Name, // Pass Name for hidden input + LocaleTag: calendar.LocaleTag(p.LocaleTag), // Pass locale tag to calendar + Value: valuePtr, // Pass pointer to value + }) + } + } + } +} + +templ Script() { + +} diff --git a/server/web/templui/components/datepicker/datepicker_templ.go b/server/web/templui/components/datepicker/datepicker_templ.go new file mode 100644 index 0000000..dfce9f7 --- /dev/null +++ b/server/web/templui/components/datepicker/datepicker_templ.go @@ -0,0 +1,322 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component datepicker - version: v0.84.0 installed by templui v0.84.0 + +package datepicker + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/calendar" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/card" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "time" +) + +type Format string +type LocaleTag string + +const ( + FormatLOCALE_SHORT Format = "locale-short" // Locale-specific short format (e.g., MM/DD/YY or DD.MM.YY) + FormatLOCALE_MEDIUM Format = "locale-medium" // Locale-specific medium format (e.g., Jan 5, 2024 or 5. Jan. 2024) + FormatLOCALE_LONG Format = "locale-long" // Locale-specific long format (e.g., January 5, 2024 or 5. Januar 2024) + FormatLOCALE_FULL Format = "locale-full" // Locale-specific full format (e.g., Monday, January 5, 2024 or Montag, 5. Januar 2024) +) + +// Common Locale (BCP 47) +var ( + LocaleDefaultTag = LocaleTag("en-US") + LocaleTagChinese = LocaleTag("zh-CN") + LocaleTagFrench = LocaleTag("fr-FR") + LocaleTagGerman = LocaleTag("de-DE") + LocaleTagItalian = LocaleTag("it-IT") + LocaleTagJapanese = LocaleTag("ja-JP") + LocaleTagPortuguese = LocaleTag("pt-PT") + LocaleTagSpanish = LocaleTag("es-ES") +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value time.Time + Format Format // Controls the display format using Intl dateStyle options. + LocaleTag LocaleTag // BCP 47 Locale Tag (e.g., "en-US", "es-ES"). Determines language and regional format defaults. + Placeholder string + Disabled bool + Required bool + HasError bool + Name string +} + +func DatePicker(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + if p.Name == "" { + p.Name = p.ID + } + if p.Placeholder == "" { + p.Placeholder = "Select a date" + } + if p.LocaleTag == "" { + p.LocaleTag = LocaleDefaultTag + } + if p.Format == "" { + p.Format = FormatLOCALE_MEDIUM + } + + var contentID = p.ID + "-content" + var valuePtr *time.Time + if !p.Value.IsZero() { + valuePtr = &p.Value + } + templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + if p.Placeholder != "" { + var templ_7745c5c3_Var4 = []any{"text-left grow text-muted-foreground"} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var4...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p.Placeholder) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/datepicker/datepicker.templ`, Line: 109, Col: 20} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.Calendar(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Variant: button.VariantOutline, + Class: utils.TwMerge( + // Base styles matching input + "w-full h-9 px-3 py-1 text-base md:text-sm", + "flex items-center justify-between", + "rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none", + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes(p.Attributes, templ.Attributes{ + "data-datepicker": "true", + "data-display-format": string(p.Format), + "data-locale-tag": string(p.LocaleTag), + "data-placeholder": p.Placeholder, + "aria-invalid": utils.If(p.HasError, "true"), + }), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{For: contentID}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = calendar.Calendar(calendar.Props{ + ID: p.ID + "-calendar-instance", // Pass ID for calendar instance + Name: p.Name, // Pass Name for hidden input + LocaleTag: calendar.LocaleTag(p.LocaleTag), // Pass locale tag to calendar + Value: valuePtr, // Pass pointer to value + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Content(card.ContentProps{ + Class: "p-3", + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var9), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = card.Card(card.Props{ + Class: "border-0 shadow-none", + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Class: "p-0", + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/drawer/drawer.templ b/server/web/templui/components/drawer/drawer.templ index fcfaac3..3151c93 100644 --- a/server/web/templui/components/drawer/drawer.templ +++ b/server/web/templui/components/drawer/drawer.templ @@ -1,4 +1,4 @@ -// templui component drawer - version: main installed by templui v0.71.0 +// templui component drawer - version: v0.84.0 installed by templui v0.84.0 package drawer import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" @@ -12,24 +12,19 @@ const ( PositionLeft Position = "left" ) -type Props struct { - ID string - Class string - Attributes templ.Attributes - Side Position -} - type TriggerProps struct { ID string Class string Attributes templ.Attributes + For string // ID of the drawer to trigger } type ContentProps struct { - ID string - Class string - Attributes templ.Attributes - Position Position + ID string + Class string + Attributes templ.Attributes + Position Position + InitialOpen bool } type HeaderProps struct { @@ -60,26 +55,7 @@ type CloseProps struct { ID string Class string Attributes templ.Attributes -} - -templ Drawer(props ...Props) { - @Script() - {{ var p Props }} - if len(props) > 0 { - {{ p = props[0] }} - } - if p.ID == "" { - {{ p.ID = utils.RandomID() }} - } -
- { children... } -
+ For string // ID of the drawer to close (optional, defaults to closest drawer) } templ Trigger(props ...TriggerProps) { @@ -91,8 +67,11 @@ templ Trigger(props ...TriggerProps) { if p.ID != "" { id={ p.ID } } - class={ utils.TwMerge("cursor-pointer", p.Class) } - data-drawer-trigger + class={ utils.TwMerge("group cursor-pointer", p.Class) } + if p.For != "" { + data-drawer-trigger={ p.For } + } + data-open="false" { p.Attributes... } > { children... } @@ -113,6 +92,11 @@ templ Content(props ...ContentProps) { } class="fixed inset-0 z-50 bg-background/80 backdrop-blur-xs templui-drawer-backdrop hidden" data-drawer-backdrop + data-component="drawer" + data-open="false" + if p.InitialOpen { + data-initial-open="true" + } >
{ children... } } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/drawer/drawer_templ.go b/server/web/templui/components/drawer/drawer_templ.go index 1095418..30d6ba2 100644 --- a/server/web/templui/components/drawer/drawer_templ.go +++ b/server/web/templui/components/drawer/drawer_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component drawer - version: main installed by templui v0.71.0 +// templui component drawer - version: v0.84.0 installed by templui v0.84.0 package drawer @@ -21,24 +21,19 @@ const ( PositionLeft Position = "left" ) -type Props struct { - ID string - Class string - Attributes templ.Attributes - Side Position -} - type TriggerProps struct { ID string Class string Attributes templ.Attributes + For string // ID of the drawer to trigger } type ContentProps struct { - ID string - Class string - Attributes templ.Attributes - Position Position + ID string + Class string + Attributes templ.Attributes + Position Position + InitialOpen bool } type HeaderProps struct { @@ -69,9 +64,10 @@ type CloseProps struct { ID string Class string Attributes templ.Attributes + For string // ID of the drawer to close (optional, defaults to closest drawer) } -func Drawer(props ...Props) templ.Component { +func Trigger(props ...TriggerProps) templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { @@ -92,36 +88,39 @@ func Drawer(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var p Props + var p TriggerProps if len(props) > 0 { p = props[0] } - if p.ID == "" { - p.ID = utils.RandomID() - } - var templ_7745c5c3_Var2 = []any{utils.TwMerge("relative", p.Class)} + var templ_7745c5c3_Var2 = []any{utils.TwMerge("group cursor-pointer", p.Class)} templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -163,97 +172,7 @@ func Drawer(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "
") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) -} - -func Trigger(props ...TriggerProps) templ.Component { - return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { - return templ_7745c5c3_CtxErr - } - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var6 := templ.GetChildren(ctx) - if templ_7745c5c3_Var6 == nil { - templ_7745c5c3_Var6 = templ.NopComponent - } - ctx = templ.ClearChildren(ctx) - var p TriggerProps - if len(props) > 0 { - p = props[0] - } - var templ_7745c5c3_Var7 = []any{utils.TwMerge("cursor-pointer", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var7...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -277,9 +196,9 @@ func Content(props ...ContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var10 := templ.GetChildren(ctx) - if templ_7745c5c3_Var10 == nil { - templ_7745c5c3_Var10 = templ.NopComponent + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p ContentProps @@ -289,34 +208,44 @@ func Content(props ...ContentProps) templ.Component { if p.ID == "" { p.ID = utils.RandomID() } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " class=\"fixed inset-0 z-50 bg-background/80 backdrop-blur-xs templui-drawer-backdrop hidden\" data-drawer-backdrop data-component=\"drawer\" data-open=\"false\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 = []any{ + if p.InitialOpen { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " data-initial-open=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, ">") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 = []any{ utils.TwMerge( "fixed z-50 templui-drawer-content hidden", p.Class, @@ -326,50 +255,50 @@ func Content(props ...ContentProps) templ.Component { utils.If(p.Position == PositionBottom, "inset-x-0 bottom-0 h-auto sm:h-1/2"), ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var16 = []any{ + var templ_7745c5c3_Var12 = []any{ utils.TwMerge( "h-full overflow-y-auto bg-background p-6 shadow-lg", utils.If(p.Position == PositionRight, "border-l"), @@ -390,32 +319,32 @@ func Content(props ...ContentProps) templ.Component { utils.If(p.Position == PositionTop, "border-b"), ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "\" data-drawer-inner>") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var10.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -439,57 +368,57 @@ func Header(props ...HeaderProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var18 := templ.GetChildren(ctx) - if templ_7745c5c3_Var18 == nil { - templ_7745c5c3_Var18 = templ.NopComponent + templ_7745c5c3_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p HeaderProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var19 = []any{utils.TwMerge("flex flex-col space-y-1.5 pb-4", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var19...) + var templ_7745c5c3_Var15 = []any{utils.TwMerge("flex flex-col space-y-1.5 pb-4", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var18.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var14.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -529,57 +458,57 @@ func Title(props ...TitleProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var22 := templ.GetChildren(ctx) - if templ_7745c5c3_Var22 == nil { - templ_7745c5c3_Var22 = templ.NopComponent + templ_7745c5c3_Var18 := templ.GetChildren(ctx) + if templ_7745c5c3_Var18 == nil { + templ_7745c5c3_Var18 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p TitleProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var23 = []any{utils.TwMerge("text-lg font-semibold leading-none tracking-tight", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) + var templ_7745c5c3_Var19 = []any{utils.TwMerge("text-lg font-semibold leading-none tracking-tight", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var19...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var22.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var18.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -619,57 +548,57 @@ func Description(props ...DescriptionProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var26 := templ.GetChildren(ctx) - if templ_7745c5c3_Var26 == nil { - templ_7745c5c3_Var26 = templ.NopComponent + templ_7745c5c3_Var22 := templ.GetChildren(ctx) + if templ_7745c5c3_Var22 == nil { + templ_7745c5c3_Var22 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p DescriptionProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var27 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) + var templ_7745c5c3_Var23 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var26.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var22.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "

") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "

") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -709,57 +638,57 @@ func Footer(props ...FooterProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var30 := templ.GetChildren(ctx) - if templ_7745c5c3_Var30 == nil { - templ_7745c5c3_Var30 = templ.NopComponent + templ_7745c5c3_Var26 := templ.GetChildren(ctx) + if templ_7745c5c3_Var26 == nil { + templ_7745c5c3_Var26 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p FooterProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var31 = []any{utils.TwMerge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pt-4", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var31...) + var templ_7745c5c3_Var27 = []any{utils.TwMerge("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2 pt-4", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var30.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var26.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -799,16 +728,16 @@ func Close(props ...CloseProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var34 := templ.GetChildren(ctx) - if templ_7745c5c3_Var34 == nil { - templ_7745c5c3_Var34 = templ.NopComponent + templ_7745c5c3_Var30 := templ.GetChildren(ctx) + if templ_7745c5c3_Var30 == nil { + templ_7745c5c3_Var30 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p CloseProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var35 = []any{ + var templ_7745c5c3_Var31 = []any{ utils.TwMerge( "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background", "transition-colors focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", @@ -817,63 +746,87 @@ func Close(props ...CloseProps) templ.Component { p.Class, ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var35...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var31...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var34.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var30.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -881,8 +834,6 @@ func Close(props ...CloseProps) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -899,43 +850,12 @@ func Script() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var38 := templ.GetChildren(ctx) - if templ_7745c5c3_Var38 == nil { - templ_7745c5c3_Var38 = templ.NopComponent + templ_7745c5c3_Var35 := templ.GetChildren(ctx) + if templ_7745c5c3_Var35 == nil { + templ_7745c5c3_Var35 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var39 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var39), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/dropdown/dropdown.templ b/server/web/templui/components/dropdown/dropdown.templ index 5677d2b..2a790cb 100644 --- a/server/web/templui/components/dropdown/dropdown.templ +++ b/server/web/templui/components/dropdown/dropdown.templ @@ -1,4 +1,4 @@ -// templui component dropdown - version: main installed by templui v0.71.0 +// templui component dropdown - version: v0.84.0 installed by templui v0.84.0 package dropdown import ( @@ -50,12 +50,13 @@ type LabelProps struct { } type ItemProps struct { - ID string - Class string - Attributes templ.Attributes - Disabled bool - Href string - Target string + ID string + Class string + Attributes templ.Attributes + Disabled bool + Href string + Target string + PreventClose bool } type SeparatorProps struct { @@ -95,7 +96,6 @@ type PortalProps struct { } templ Dropdown(props ...Props) { - @Script() {{ var p Props if len(props) > 0 { @@ -107,11 +107,7 @@ templ Dropdown(props ...Props) { } ctx = context.WithValue(ctx, contentIDKey, contentID) }} - @popover.Popover(popover.Props{ - Class: p.Class, - }) { - { children... } - } + { children... } } templ Trigger(props ...TriggerProps) { @@ -232,6 +228,9 @@ templ Item(props ...ItemProps) { } role="menuitem" data-dropdown-item + if p.PreventClose { + data-prevent-close="true" + } { p.Attributes... } > { children... } @@ -250,6 +249,9 @@ templ Item(props ...ItemProps) { role="menuitem" data-dropdown-item disabled?={ p.Disabled } + if p.PreventClose { + data-prevent-close="true" + } { p.Attributes... } > { children... } @@ -377,45 +379,6 @@ templ SubContent(props ...SubContentProps) { } } -var dropdownHandle = templ.NewOnceHandle() - templ Script() { - + } diff --git a/server/web/templui/components/dropdown/dropdown_templ.go b/server/web/templui/components/dropdown/dropdown_templ.go index e0625fb..c3a82cd 100644 --- a/server/web/templui/components/dropdown/dropdown_templ.go +++ b/server/web/templui/components/dropdown/dropdown_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component dropdown - version: main installed by templui v0.71.0 +// templui component dropdown - version: v0.84.0 installed by templui v0.84.0 package dropdown @@ -59,12 +59,13 @@ type LabelProps struct { } type ItemProps struct { - ID string - Class string - Attributes templ.Attributes - Disabled bool - Href string - Target string + ID string + Class string + Attributes templ.Attributes + Disabled bool + Href string + Target string + PreventClose bool } type SeparatorProps struct { @@ -124,10 +125,6 @@ func Dropdown(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { @@ -138,27 +135,7 @@ func Dropdown(props ...Props) templ.Component { contentID = utils.RandomID() } ctx = context.WithValue(ctx, contentIDKey, contentID) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = popover.Popover(popover.Props{ - Class: p.Class, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -182,9 +159,9 @@ func Trigger(props ...TriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) @@ -196,7 +173,7 @@ func Trigger(props ...TriggerProps) templ.Component { if !ok { contentID = "fallback-content-id" } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -208,8 +185,8 @@ func Trigger(props ...TriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - var templ_7745c5c3_Var5 = []any{utils.TwMerge("inline-block", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var5...) + var templ_7745c5c3_Var4 = []any{utils.TwMerge("inline-block", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var4...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -217,12 +194,12 @@ func Trigger(props ...TriggerProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var5).String()) + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var4).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -238,7 +215,7 @@ func Trigger(props ...TriggerProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var2.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -251,7 +228,7 @@ func Trigger(props ...TriggerProps) templ.Component { templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{ ID: p.ID, For: contentID, TriggerType: popover.TriggerTypeClick, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -275,9 +252,9 @@ func Content(props ...ContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var7 := templ.GetChildren(ctx) - if templ_7745c5c3_Var7 == nil { - templ_7745c5c3_Var7 = templ.NopComponent + templ_7745c5c3_Var6 := templ.GetChildren(ctx) + if templ_7745c5c3_Var6 == nil { + templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p ContentProps @@ -294,7 +271,7 @@ func Content(props ...ContentProps) templ.Component { maxHeight = p.MaxHeight } maxHeightClass := fmt.Sprintf("max-h-[%s]", maxHeight) - templ_7745c5c3_Var8 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -306,7 +283,7 @@ func Content(props ...ContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var7.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var6.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -325,7 +302,7 @@ func Content(props ...ContentProps) templ.Component { p.Class, ), Attributes: p.Attributes, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var8), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -349,17 +326,17 @@ func Group(props ...GroupProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var9 := templ.GetChildren(ctx) - if templ_7745c5c3_Var9 == nil { - templ_7745c5c3_Var9 = templ.NopComponent + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p GroupProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var10 = []any{utils.TwMerge("py-1", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + var templ_7745c5c3_Var9 = []any{utils.TwMerge("py-1", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -372,12 +349,12 @@ func Group(props ...GroupProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var10 string + templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 182, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 178, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -390,12 +367,12 @@ func Group(props ...GroupProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var10).String()) + var templ_7745c5c3_Var11 string + templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var9).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -411,7 +388,7 @@ func Group(props ...GroupProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var8.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -439,17 +416,17 @@ func Label(props ...LabelProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var13 := templ.GetChildren(ctx) - if templ_7745c5c3_Var13 == nil { - templ_7745c5c3_Var13 = templ.NopComponent + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p LabelProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var14 = []any{utils.TwMerge("px-2 py-1.5 text-sm font-semibold", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + var templ_7745c5c3_Var13 = []any{utils.TwMerge("px-2 py-1.5 text-sm font-semibold", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -462,12 +439,12 @@ func Label(props ...LabelProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 199, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 195, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -480,12 +457,12 @@ func Label(props ...LabelProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var16 string - templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var14).String()) + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var13).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -501,7 +478,7 @@ func Label(props ...LabelProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var13.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var12.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -529,9 +506,9 @@ func Item(props ...ItemProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var17 := templ.GetChildren(ctx) - if templ_7745c5c3_Var17 == nil { - templ_7745c5c3_Var17 = templ.NopComponent + templ_7745c5c3_Var16 := templ.GetChildren(ctx) + if templ_7745c5c3_Var16 == nil { + templ_7745c5c3_Var16 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p ItemProps @@ -542,7 +519,7 @@ func Item(props ...ItemProps) templ.Component { p.ID = utils.RandomID() } if p.Href != "" { - var templ_7745c5c3_Var18 = []any{ + var templ_7745c5c3_Var17 = []any{ utils.TwMerge( "flex text-left items-center px-2 py-1.5 text-sm rounded-sm", utils.If(!p.Disabled, "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default"), @@ -550,7 +527,7 @@ func Item(props ...ItemProps) templ.Component { p.Class, ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var17...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -558,12 +535,12 @@ func Item(props ...ItemProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var19 string - templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var18 string + templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 218, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 214, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -576,8 +553,8 @@ func Item(props ...ItemProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var20 templ.SafeURL = templ.SafeURL(p.Href) - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var20))) + var templ_7745c5c3_Var19 templ.SafeURL = templ.SafeURL(p.Href) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(string(templ_7745c5c3_Var19))) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -591,12 +568,12 @@ func Item(props ...ItemProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var21 string - templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target) + var templ_7745c5c3_Var20 string + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 223, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 219, Col: 21} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -609,12 +586,12 @@ func Item(props ...ItemProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var22 string - templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var18).String()) + var templ_7745c5c3_Var21 string + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var17).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/dropdown/dropdown.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -622,67 +599,8 @@ func Item(props ...ItemProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ.RenderAttributes(ctx, templ_7745c5c3_Buffer, p.Attributes) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, ">") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templ_7745c5c3_Var17.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } else { - var templ_7745c5c3_Var23 = []any{ - utils.TwMerge( - "w-full text-left flex items-center justify-between px-2 py-1.5 text-sm rounded-sm", - utils.If(!p.Disabled, "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default"), - utils.If(p.Disabled, "opacity-50 pointer-events-none"), - p.Class, - ), - } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + var templ_7745c5c3_Var22 = []any{ + utils.TwMerge( + "w-full text-left flex items-center justify-between px-2 py-1.5 text-sm rounded-sm", + utils.If(!p.Disabled, "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default"), + utils.If(p.Disabled, "opacity-50 pointer-events-none"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var22...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -724,57 +713,57 @@ func Separator(props ...SeparatorProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var26 := templ.GetChildren(ctx) - if templ_7745c5c3_Var26 == nil { - templ_7745c5c3_Var26 = templ.NopComponent + templ_7745c5c3_Var25 := templ.GetChildren(ctx) + if templ_7745c5c3_Var25 == nil { + templ_7745c5c3_Var25 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p SeparatorProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var27 = []any{utils.TwMerge("h-px my-1 -mx-1 bg-muted", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) + var templ_7745c5c3_Var26 = []any{utils.TwMerge("h-px my-1 -mx-1 bg-muted", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var26...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -806,57 +795,57 @@ func Shortcut(props ...ShortcutProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var30 := templ.GetChildren(ctx) - if templ_7745c5c3_Var30 == nil { - templ_7745c5c3_Var30 = templ.NopComponent + templ_7745c5c3_Var29 := templ.GetChildren(ctx) + if templ_7745c5c3_Var29 == nil { + templ_7745c5c3_Var29 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p ShortcutProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var31 = []any{utils.TwMerge("ml-auto text-xs tracking-widest opacity-60", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var31...) + var templ_7745c5c3_Var30 = []any{utils.TwMerge("ml-auto text-xs tracking-widest opacity-60", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var30...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var30.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var29.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -896,9 +885,9 @@ func Sub(props ...SubProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var34 := templ.GetChildren(ctx) - if templ_7745c5c3_Var34 == nil { - templ_7745c5c3_Var34 = templ.NopComponent + templ_7745c5c3_Var33 := templ.GetChildren(ctx) + if templ_7745c5c3_Var33 == nil { + templ_7745c5c3_Var33 = templ.NopComponent } ctx = templ.ClearChildren(ctx) @@ -911,48 +900,48 @@ func Sub(props ...SubProps) templ.Component { subContentID = utils.RandomID() } ctx = context.WithValue(ctx, subContentIDKey, subContentID) - var templ_7745c5c3_Var35 = []any{utils.TwMerge("relative", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var35...) + var templ_7745c5c3_Var34 = []any{utils.TwMerge("relative", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var34...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var34.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var33.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -992,9 +981,9 @@ func SubTrigger(props ...SubTriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var38 := templ.GetChildren(ctx) - if templ_7745c5c3_Var38 == nil { - templ_7745c5c3_Var38 = templ.NopComponent + templ_7745c5c3_Var37 := templ.GetChildren(ctx) + if templ_7745c5c3_Var37 == nil { + templ_7745c5c3_Var37 = templ.NopComponent } ctx = templ.ClearChildren(ctx) @@ -1006,7 +995,7 @@ func SubTrigger(props ...SubTriggerProps) templ.Component { if !ok { subContentID = "fallback-subcontent-id" } - templ_7745c5c3_Var39 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var38 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -1018,31 +1007,31 @@ func SubTrigger(props ...SubTriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - var templ_7745c5c3_Var40 = []any{ + var templ_7745c5c3_Var39 = []any{ utils.TwMerge( "w-full text-left flex items-center justify-between px-2 py-1.5 text-sm rounded-sm", "focus:bg-accent focus:text-accent-foreground hover:bg-accent hover:text-accent-foreground cursor-default", p.Class, ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var40...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var39...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1068,7 +1057,7 @@ func SubTrigger(props ...SubTriggerProps) templ.Component { ID: p.ID, For: subContentID, TriggerType: popover.TriggerTypeHover, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var39), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var38), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1092,9 +1081,9 @@ func SubContent(props ...SubContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var42 := templ.GetChildren(ctx) - if templ_7745c5c3_Var42 == nil { - templ_7745c5c3_Var42 = templ.NopComponent + templ_7745c5c3_Var41 := templ.GetChildren(ctx) + if templ_7745c5c3_Var41 == nil { + templ_7745c5c3_Var41 = templ.NopComponent } ctx = templ.ClearChildren(ctx) @@ -1106,7 +1095,7 @@ func SubContent(props ...SubContentProps) templ.Component { if !ok { subContentID = "fallback-subcontent-id" } - templ_7745c5c3_Var43 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var42 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -1118,7 +1107,7 @@ func SubContent(props ...SubContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var42.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var41.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1135,7 +1124,7 @@ func SubContent(props ...SubContentProps) templ.Component { p.Class, ), Attributes: p.Attributes, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var43), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var42), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -1143,8 +1132,6 @@ func SubContent(props ...SubContentProps) templ.Component { }) } -var dropdownHandle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -1161,25 +1148,12 @@ func Script() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var44 := templ.GetChildren(ctx) - if templ_7745c5c3_Var44 == nil { - templ_7745c5c3_Var44 = templ.NopComponent + templ_7745c5c3_Var43 := templ.GetChildren(ctx) + if templ_7745c5c3_Var43 == nil { + templ_7745c5c3_Var43 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/form/form.templ b/server/web/templui/components/form/form.templ index 3999bc4..6db33f8 100644 --- a/server/web/templui/components/form/form.templ +++ b/server/web/templui/components/form/form.templ @@ -1,4 +1,4 @@ -// templui component form - version: main installed by templui v0.71.0 +// templui component form - version: v0.84.0 installed by templui v0.84.0 package form import ( diff --git a/server/web/templui/components/form/form_templ.go b/server/web/templui/components/form/form_templ.go index 6582349..2e79621 100644 --- a/server/web/templui/components/form/form_templ.go +++ b/server/web/templui/components/form/form_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component form - version: main installed by templui v0.71.0 +// templui component form - version: v0.84.0 installed by templui v0.84.0 package form diff --git a/server/web/templui/components/icon/icon.go b/server/web/templui/components/icon/icon.go index 8d1f5df..64a98b7 100644 --- a/server/web/templui/components/icon/icon.go +++ b/server/web/templui/components/icon/icon.go @@ -1,4 +1,4 @@ -// templui component icon - version: main installed by templui v0.71.0 +// templui component icon - version: v0.84.0 installed by templui v0.84.0 package icon import ( diff --git a/server/web/templui/components/icon/icon_data.go b/server/web/templui/components/icon/icondata.go similarity index 99% rename from server/web/templui/components/icon/icon_data.go rename to server/web/templui/components/icon/icondata.go index 1d7bbf2..74e10e6 100644 --- a/server/web/templui/components/icon/icon_data.go +++ b/server/web/templui/components/icon/icondata.go @@ -1,4 +1,4 @@ -// templui component icon - version: main installed by templui v0.71.0 +// templui component icon - version: v0.84.0 installed by templui v0.84.0 package icon // This file is auto generated @@ -498,7 +498,7 @@ var internalSvgData = map[string]string{ `, "navigation": ``, - "minus": ``, + "minus": ``, "list-check": ` @@ -2471,7 +2471,7 @@ var internalSvgData = map[string]string{ "toy-brick": ` `, - "wrench": ``, + "wrench": ``, "rectangle-horizontal": ``, "map-pin-check-inside": ` `, @@ -4515,7 +4515,7 @@ var internalSvgData = map[string]string{ "ticket-plus": ` `, - "wifi-zero": ``, + "wifi-zero": ``, "type-outline": ``, "circle-pause": ` @@ -4657,7 +4657,7 @@ var internalSvgData = map[string]string{ `, "chevron-down": ``, - "chevron-up": ``, + "chevron-up": ``, "dice-5": ` diff --git a/server/web/templui/components/icon/icon_defs.go b/server/web/templui/components/icon/icondefs.go similarity index 99% rename from server/web/templui/components/icon/icon_defs.go rename to server/web/templui/components/icon/icondefs.go index dbfe0d0..ad62a7a 100644 --- a/server/web/templui/components/icon/icon_defs.go +++ b/server/web/templui/components/icon/icondefs.go @@ -1,6 +1,5 @@ -// templui component icon - version: main installed by templui v0.71.0 +// templui component icon - version: v0.84.0 installed by templui v0.84.0 package icon - // This file is auto generated // Using Lucide icons version 0.507.0 var ALargeSmall = Icon("a-large-small") diff --git a/server/web/templui/components/input/input.templ b/server/web/templui/components/input/input.templ index eb329c7..14b22d3 100644 --- a/server/web/templui/components/input/input.templ +++ b/server/web/templui/components/input/input.templ @@ -1,4 +1,4 @@ -// templui component input - version: main installed by templui v0.71.0 +// templui component input - version: v0.84.0 installed by templui v0.84.0 package input import ( @@ -49,9 +49,6 @@ templ Input(props ...Props) { if p.ID == "" { {{ p.ID = utils.RandomID() }} } - if p.Type == TypePassword && !p.NoTogglePassword { - @Script() - }
} -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/input/input_templ.go b/server/web/templui/components/input/input_templ.go index 09b0ed0..c46ed9b 100644 --- a/server/web/templui/components/input/input_templ.go +++ b/server/web/templui/components/input/input_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component input - version: main installed by templui v0.71.0 +// templui component input - version: v0.84.0 installed by templui v0.84.0 package input @@ -78,25 +78,29 @@ func Input(props ...Props) templ.Component { if p.ID == "" { p.ID = utils.RandomID() } - if p.Type == TypePassword && !p.NoTogglePassword { - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var2 = []any{ utils.TwMerge( - "peer flex h-10 w-full px-3 py-2", - "rounded-md border border-input bg-background text-sm ring-offset-background", - "file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", + // Base styles + "flex h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none md:text-sm", + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Placeholder "placeholder:text-muted-foreground", - "focus-visible:outline-hidden focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", - "disabled:cursor-not-allowed disabled:opacity-50", - utils.If(p.HasError, "border-destructive ring-destructive"), + // File input styles + "file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Disabled styles + "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), utils.If(p.Type == TypePassword && !p.NoTogglePassword, "pr-8"), p.Class, ), @@ -112,7 +116,7 @@ func Input(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 57, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 54, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -125,7 +129,7 @@ func Input(props ...Props) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(string(p.Type)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 58, Col: 24} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 55, Col: 24} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -143,7 +147,7 @@ func Input(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 60, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 57, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -162,7 +166,7 @@ func Input(props ...Props) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p.Placeholder) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 63, Col: 31} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 60, Col: 31} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -181,7 +185,7 @@ func Input(props ...Props) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.Value) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 66, Col: 19} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 63, Col: 19} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -200,7 +204,7 @@ func Input(props ...Props) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.FileAccept) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 69, Col: 25} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/input/input.templ`, Line: 66, Col: 25} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -229,7 +233,13 @@ func Input(props ...Props) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " class=\"") + if p.HasError { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, " aria-invalid=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, " class=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -242,7 +252,7 @@ func Input(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -250,7 +260,7 @@ func Input(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "> ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "> ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -267,7 +277,7 @@ func Input(props ...Props) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -277,7 +287,7 @@ func Input(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -287,7 +297,7 @@ func Input(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -303,7 +313,7 @@ func Input(props ...Props) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -311,8 +321,6 @@ func Input(props ...Props) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -334,38 +342,7 @@ func Script() templ.Component { templ_7745c5c3_Var11 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/inputotp/inputotp.templ b/server/web/templui/components/inputotp/inputotp.templ new file mode 100644 index 0000000..4921c2d --- /dev/null +++ b/server/web/templui/components/inputotp/inputotp.templ @@ -0,0 +1,178 @@ +// templui component inputotp - version: v0.84.0 installed by templui v0.84.0 +package inputotp + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value string + Required bool + Name string + HasError bool +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SlotProps struct { + ID string + Class string + Attributes templ.Attributes + Index int + Type string + Placeholder string + Disabled bool + HasError bool +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ InputOTP(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ + { children... } +
+} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Slot(props ...SlotProps) { + {{ var p SlotProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.Type == "" { + {{ p.Type = "text" }} + } +
+ +
+} + +templ Separator(props ...SeparatorProps) { + {{ var p SeparatorProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ - +
+} + +templ Script() { + +} diff --git a/server/web/templui/components/inputotp/inputotp_templ.go b/server/web/templui/components/inputotp/inputotp_templ.go new file mode 100644 index 0000000..ab8abbf --- /dev/null +++ b/server/web/templui/components/inputotp/inputotp_templ.go @@ -0,0 +1,615 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component inputotp - version: v0.84.0 installed by templui v0.84.0 + +package inputotp + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Value string + Required bool + Name string + HasError bool +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type SlotProps struct { + ID string + Class string + Attributes templ.Attributes + Index int + Type string + Placeholder string + Disabled bool + HasError bool +} + +type SeparatorProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func InputOTP(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "flex flex-row items-center gap-2 w-fit", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var8 := templ.GetChildren(ctx) + if templ_7745c5c3_Var8 == nil { + templ_7745c5c3_Var8 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var9 = []any{ + utils.TwMerge( + "flex gap-2", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var8.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Slot(props ...SlotProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p SlotProps + if len(props) > 0 { + p = props[0] + } + if p.Type == "" { + p.Type = "text" + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var14 = []any{ + utils.TwMerge( + // Base styles - keeping the specific OTP dimensions + "w-10 h-12 text-center rounded-md border border-input bg-transparent text-base shadow-xs transition-[color,box-shadow] outline-none md:text-sm", + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Placeholder + "placeholder:text-muted-foreground", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Disabled styles + "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var14...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Separator(props ...SeparatorProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p SeparatorProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{ + utils.TwMerge( + "flex items-center text-muted-foreground text-xl", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "-") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var23 := templ.GetChildren(ctx) + if templ_7745c5c3_Var23 == nil { + templ_7745c5c3_Var23 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/label/label.templ b/server/web/templui/components/label/label.templ index 8514617..0b8d484 100644 --- a/server/web/templui/components/label/label.templ +++ b/server/web/templui/components/label/label.templ @@ -1,4 +1,4 @@ -// templui component label - version: main installed by templui v0.71.0 +// templui component label - version: v0.84.0 installed by templui v0.84.0 package label import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" @@ -37,75 +37,6 @@ templ Label(props ...Props) { } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/label/label_templ.go b/server/web/templui/components/label/label_templ.go index ea39ced..d2ddeda 100644 --- a/server/web/templui/components/label/label_templ.go +++ b/server/web/templui/components/label/label_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component label - version: main installed by templui v0.71.0 +// templui component label - version: v0.84.0 installed by templui v0.84.0 package label @@ -135,8 +135,6 @@ func Label(props ...Props) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -158,38 +156,7 @@ func Script() templ.Component { templ_7745c5c3_Var6 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/modal/modal.templ b/server/web/templui/components/modal/modal.templ index 21c4472..b081935 100644 --- a/server/web/templui/components/modal/modal.templ +++ b/server/web/templui/components/modal/modal.templ @@ -1,10 +1,7 @@ -// templui component modal - version: main installed by templui v0.71.0 +// templui component modal - version: v0.84.0 installed by templui v0.84.0 package modal -import ( - "git.jmbit.de/jmb/scanfile/server/web/templui/utils" - "strconv" -) +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" type Props struct { ID string @@ -12,6 +9,7 @@ type Props struct { Attributes templ.Attributes DisableClickAway bool DisableESC bool + InitialOpen bool } type TriggerProps struct { @@ -19,14 +17,14 @@ type TriggerProps struct { Class string Attributes templ.Attributes Disabled bool - ModalID string // ID of the modal to trigger + For string // ID of the modal to trigger } type CloseProps struct { ID string Class string Attributes templ.Attributes - ModalID string // ID of the modal to close (optional, defaults to closest modal) + For string // ID of the modal to close (optional, defaults to closest modal) } type HeaderProps struct { @@ -48,7 +46,6 @@ type FooterProps struct { } templ Modal(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -59,12 +56,20 @@ templ Modal(props ...Props) { } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/modal/modal_templ.go b/server/web/templui/components/modal/modal_templ.go index 1514b52..a60faa4 100644 --- a/server/web/templui/components/modal/modal_templ.go +++ b/server/web/templui/components/modal/modal_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component modal - version: main installed by templui v0.71.0 +// templui component modal - version: v0.84.0 installed by templui v0.84.0 package modal @@ -10,10 +10,7 @@ package modal import "github.com/a-h/templ" import templruntime "github.com/a-h/templ/runtime" -import ( - "git.jmbit.de/jmb/scanfile/server/web/templui/utils" - "strconv" -) +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" type Props struct { ID string @@ -21,6 +18,7 @@ type Props struct { Attributes templ.Attributes DisableClickAway bool DisableESC bool + InitialOpen bool } type TriggerProps struct { @@ -28,14 +26,14 @@ type TriggerProps struct { Class string Attributes templ.Attributes Disabled bool - ModalID string // ID of the modal to trigger + For string // ID of the modal to trigger } type CloseProps struct { ID string Class string Attributes templ.Attributes - ModalID string // ID of the modal to close (optional, defaults to closest modal) + For string // ID of the modal to close (optional, defaults to closest modal) } type HeaderProps struct { @@ -77,10 +75,6 @@ func Modal(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -95,101 +89,93 @@ func Modal(props ...Props) templ.Component { var templ_7745c5c3_Var2 string templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 60, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 57, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" data-modal data-disable-click-away=\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\" data-modal data-open=\"false\" class=\"modal-container fixed inset-0 z-50 items-center justify-center overflow-y-auto opacity-0 transition-opacity duration-300 ease-out hidden\" aria-labelledby=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var3 string - templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatBool(p.DisableClickAway)) + templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID + "-title") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 62, Col: 66} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 61, Col: 35} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" data-disable-esc=\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" role=\"dialog\" aria-modal=\"true\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var4 string - templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatBool(p.DisableESC)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 63, Col: 53} + if p.DisableClickAway { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " data-disable-click-away=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if p.DisableESC { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, " data-disable-esc=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" class=\"modal-container fixed inset-0 z-50 flex items-center justify-center overflow-y-auto opacity-0 transition-opacity duration-300 ease-out hidden\" aria-labelledby=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID + "-title") - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 65, Col: 35} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" role=\"dialog\" aria-modal=\"true\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err + if p.InitialOpen { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " data-initial-open=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } } templ_7745c5c3_Err = templ.RenderAttributes(ctx, templ_7745c5c3_Buffer, p.Attributes) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, ">
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, ">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var6 = []any{ + var templ_7745c5c3_Var4 = []any{ utils.TwMerge( "modal-content relative bg-background rounded-lg border text-left overflow-hidden shadow-xl transform transition-all sm:my-8 w-full scale-95 opacity-0", // Base classes + transition start "duration-300 ease-out", // Enter duration p.Class, ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var6...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var4...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "\">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -197,7 +183,7 @@ func Modal(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -221,63 +207,60 @@ func Trigger(props ...TriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var9 := templ.GetChildren(ctx) - if templ_7745c5c3_Var9 == nil { - templ_7745c5c3_Var9 = templ.NopComponent + templ_7745c5c3_Var7 := templ.GetChildren(ctx) + if templ_7745c5c3_Var7 == nil { + templ_7745c5c3_Var7 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p TriggerProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var10 = []any{ + var templ_7745c5c3_Var8 = []any{ utils.TwMerge( + "group", utils.IfElse(p.Disabled, "cursor-not-allowed opacity-50", "cursor-pointer"), p.Class, ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " 0 { p = props[0] } - var templ_7745c5c3_Var15 = []any{utils.TwMerge("cursor-pointer", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var15...) + var templ_7745c5c3_Var13 = []any{utils.TwMerge("cursor-pointer", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -362,12 +345,12 @@ func Close(props ...CloseProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var16 string - templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 119, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 125, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -376,25 +359,26 @@ func Close(props ...CloseProps) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, " data-modal-close") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - if p.ModalID != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, " data-modal-target-id=\"") + if p.For != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, " data-modal-close=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var17 string - templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(p.ModalID) + var templ_7745c5c3_Var15 string + templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.For) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 123, Col: 35} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 128, Col: 27} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } else { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " data-modal-close") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -403,12 +387,12 @@ func Close(props ...CloseProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var18 string - templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var15).String()) + var templ_7745c5c3_Var16 string + templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var13).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -424,7 +408,7 @@ func Close(props ...CloseProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var14.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var12.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -452,17 +436,17 @@ func Header(props ...HeaderProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var19 := templ.GetChildren(ctx) - if templ_7745c5c3_Var19 == nil { - templ_7745c5c3_Var19 = templ.NopComponent + templ_7745c5c3_Var17 := templ.GetChildren(ctx) + if templ_7745c5c3_Var17 == nil { + templ_7745c5c3_Var17 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p HeaderProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var20 = []any{utils.TwMerge("px-4 pt-5 pb-4 sm:p-6 sm:pb-4 text-lg leading-6 font-medium text-foreground", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + var templ_7745c5c3_Var18 = []any{utils.TwMerge("px-4 pt-5 pb-4 sm:p-6 sm:pb-4 text-lg leading-6 font-medium text-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var18...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -475,12 +459,12 @@ func Header(props ...HeaderProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var21 string - templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var19 string + templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 139, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 146, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -493,12 +477,12 @@ func Header(props ...HeaderProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var22 string - templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var20).String()) + var templ_7745c5c3_Var20 string + templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var18).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -514,12 +498,12 @@ func Header(props ...HeaderProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var23 string - templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID + "-title") + var templ_7745c5c3_Var21 string + templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID + "-title") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 144, Col: 80} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 151, Col: 80} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -527,7 +511,7 @@ func Header(props ...HeaderProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var19.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var17.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -555,17 +539,17 @@ func Body(props ...BodyProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var24 := templ.GetChildren(ctx) - if templ_7745c5c3_Var24 == nil { - templ_7745c5c3_Var24 = templ.NopComponent + templ_7745c5c3_Var22 := templ.GetChildren(ctx) + if templ_7745c5c3_Var22 == nil { + templ_7745c5c3_Var22 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p BodyProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var25 = []any{utils.TwMerge("px-4 pt-5 pb-4 sm:p-6 sm:pb-4", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var25...) + var templ_7745c5c3_Var23 = []any{utils.TwMerge("px-4 pt-5 pb-4 sm:p-6 sm:pb-4", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var23...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -578,12 +562,12 @@ func Body(props ...BodyProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var26 string - templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var24 string + templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 158, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 165, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -596,12 +580,12 @@ func Body(props ...BodyProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var27 string - templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var25).String()) + var templ_7745c5c3_Var25 string + templ_7745c5c3_Var25, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var23).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var25)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -617,7 +601,7 @@ func Body(props ...BodyProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var24.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var22.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -645,17 +629,17 @@ func Footer(props ...FooterProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var28 := templ.GetChildren(ctx) - if templ_7745c5c3_Var28 == nil { - templ_7745c5c3_Var28 = templ.NopComponent + templ_7745c5c3_Var26 := templ.GetChildren(ctx) + if templ_7745c5c3_Var26 == nil { + templ_7745c5c3_Var26 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p FooterProps if len(props) > 0 { p = props[0] } - var templ_7745c5c3_Var29 = []any{utils.TwMerge("px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse", p.Class)} - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var29...) + var templ_7745c5c3_Var27 = []any{utils.TwMerge("px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var27...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -668,12 +652,12 @@ func Footer(props ...FooterProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var30 string - templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) + var templ_7745c5c3_Var28 string + templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 174, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 181, Col: 12} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -686,12 +670,12 @@ func Footer(props ...FooterProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var31 string - templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var29).String()) + var templ_7745c5c3_Var29 string + templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(templ.CSSClasses(templ_7745c5c3_Var27).String()) if templ_7745c5c3_Err != nil { return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/modal/modal.templ`, Line: 1, Col: 0} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var31)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -707,7 +691,7 @@ func Footer(props ...FooterProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templ_7745c5c3_Var28.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var26.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -719,8 +703,6 @@ func Footer(props ...FooterProps) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -737,43 +719,12 @@ func Script() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var32 := templ.GetChildren(ctx) - if templ_7745c5c3_Var32 == nil { - templ_7745c5c3_Var32 = templ.NopComponent + templ_7745c5c3_Var30 := templ.GetChildren(ctx) + if templ_7745c5c3_Var30 == nil { + templ_7745c5c3_Var30 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var33 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var33), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/pagination/pagination.templ b/server/web/templui/components/pagination/pagination.templ index d60c47b..1ba3bb0 100644 --- a/server/web/templui/components/pagination/pagination.templ +++ b/server/web/templui/components/pagination/pagination.templ @@ -1,4 +1,4 @@ -// templui component pagination - version: main installed by templui v0.71.0 +// templui component pagination - version: v0.84.0 installed by templui v0.84.0 package pagination import ( @@ -32,9 +32,6 @@ type LinkProps struct { Href string IsActive bool Disabled bool - HxGet string - HxTarget string - HxSwap string } type PreviousProps struct { @@ -44,9 +41,6 @@ type PreviousProps struct { Href string Disabled bool Label string - HxGet string - HxTarget string - HxSwap string } type NextProps struct { @@ -56,9 +50,6 @@ type NextProps struct { Href string Disabled bool Label string - HxGet string - HxTarget string - HxSwap string } templ Pagination(props ...Props) { @@ -126,19 +117,6 @@ templ Link(props ...LinkProps) { }) { { children... } } - } else if p.HxGet != "" { - @button.Button(button.Props{ - ID: p.ID, - HxGet: p.HxGet, - HxTarget: p.HxTarget, - HxSwap: p.HxSwap, - Size: button.SizeIcon, - Variant: button.Variant(buttonVariant(p.IsActive)), - Class: p.Class, - Attributes: p.Attributes, - }) { - { children... } - } } else { @button.Button(button.Props{ ID: p.ID, @@ -161,9 +139,6 @@ templ Previous(props ...PreviousProps) { @button.Button(button.Props{ ID: p.ID, Href: p.Href, - HxGet: p.HxGet, - HxTarget: p.HxTarget, - HxSwap: p.HxSwap, Disabled: p.Disabled, Variant: button.VariantGhost, Class: utils.TwMerge("gap-1", p.Class), @@ -184,9 +159,6 @@ templ Next(props ...NextProps) { @button.Button(button.Props{ ID: p.ID, Href: p.Href, - HxGet: p.HxGet, - HxTarget: p.HxTarget, - HxSwap: p.HxSwap, Disabled: p.Disabled, Variant: button.VariantGhost, Class: utils.TwMerge("gap-1", p.Class), diff --git a/server/web/templui/components/pagination/pagination_templ.go b/server/web/templui/components/pagination/pagination_templ.go index 49ff213..5b13dd4 100644 --- a/server/web/templui/components/pagination/pagination_templ.go +++ b/server/web/templui/components/pagination/pagination_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component pagination - version: main installed by templui v0.71.0 +// templui component pagination - version: v0.84.0 installed by templui v0.84.0 package pagination @@ -41,9 +41,6 @@ type LinkProps struct { Href string IsActive bool Disabled bool - HxGet string - HxTarget string - HxSwap string } type PreviousProps struct { @@ -53,9 +50,6 @@ type PreviousProps struct { Href string Disabled bool Label string - HxGet string - HxTarget string - HxSwap string } type NextProps struct { @@ -65,9 +59,6 @@ type NextProps struct { Href string Disabled bool Label string - HxGet string - HxTarget string - HxSwap string } func Pagination(props ...Props) templ.Component { @@ -112,7 +103,7 @@ func Pagination(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 71, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 62, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -197,7 +188,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 89, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 80, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -269,7 +260,7 @@ func Item(props ...ItemProps) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 105, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 96, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -355,40 +346,8 @@ func Link(props ...LinkProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - } else if p.HxGet != "" { - templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = button.Button(button.Props{ - ID: p.ID, - HxGet: p.HxGet, - HxTarget: p.HxTarget, - HxSwap: p.HxSwap, - Size: button.SizeIcon, - Variant: button.Variant(buttonVariant(p.IsActive)), - Class: p.Class, - Attributes: p.Attributes, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } } else { - templ_7745c5c3_Var12 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var11 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -413,7 +372,7 @@ func Link(props ...LinkProps) templ.Component { Variant: button.Variant(buttonVariant(p.IsActive)), Class: p.Class, Attributes: p.Attributes, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var12), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var11), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -438,16 +397,16 @@ func Previous(props ...PreviousProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var13 := templ.GetChildren(ctx) - if templ_7745c5c3_Var13 == nil { - templ_7745c5c3_Var13 = templ.NopComponent + templ_7745c5c3_Var12 := templ.GetChildren(ctx) + if templ_7745c5c3_Var12 == nil { + templ_7745c5c3_Var12 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p PreviousProps if len(props) > 0 { p = props[0] } - templ_7745c5c3_Var14 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var13 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -472,12 +431,12 @@ func Previous(props ...PreviousProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var15 string - templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) + var templ_7745c5c3_Var14 string + templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 174, Col: 18} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 149, Col: 18} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -491,14 +450,11 @@ func Previous(props ...PreviousProps) templ.Component { templ_7745c5c3_Err = button.Button(button.Props{ ID: p.ID, Href: p.Href, - HxGet: p.HxGet, - HxTarget: p.HxTarget, - HxSwap: p.HxSwap, Disabled: p.Disabled, Variant: button.VariantGhost, Class: utils.TwMerge("gap-1", p.Class), Attributes: p.Attributes, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var14), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var13), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -522,16 +478,16 @@ func Next(props ...NextProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var16 := templ.GetChildren(ctx) - if templ_7745c5c3_Var16 == nil { - templ_7745c5c3_Var16 = templ.NopComponent + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p NextProps if len(props) > 0 { p = props[0] } - templ_7745c5c3_Var17 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -548,12 +504,12 @@ func Next(props ...NextProps) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var18 string - templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) + var templ_7745c5c3_Var17 string + templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 196, Col: 18} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/pagination/pagination.templ`, Line: 168, Col: 18} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -575,14 +531,11 @@ func Next(props ...NextProps) templ.Component { templ_7745c5c3_Err = button.Button(button.Props{ ID: p.ID, Href: p.Href, - HxGet: p.HxGet, - HxTarget: p.HxTarget, - HxSwap: p.HxSwap, Disabled: p.Disabled, Variant: button.VariantGhost, Class: utils.TwMerge("gap-1", p.Class), Attributes: p.Attributes, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var17), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -606,9 +559,9 @@ func Ellipsis() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var19 := templ.GetChildren(ctx) - if templ_7745c5c3_Var19 == nil { - templ_7745c5c3_Var19 = templ.NopComponent + templ_7745c5c3_Var18 := templ.GetChildren(ctx) + if templ_7745c5c3_Var18 == nil { + templ_7745c5c3_Var18 = templ.NopComponent } ctx = templ.ClearChildren(ctx) templ_7745c5c3_Err = icon.Ellipsis(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) diff --git a/server/web/templui/components/popover/popover.templ b/server/web/templui/components/popover/popover.templ index 04c7c99..5963758 100644 --- a/server/web/templui/components/popover/popover.templ +++ b/server/web/templui/components/popover/popover.templ @@ -1,4 +1,4 @@ -// templui component popover - version: main installed by templui v0.71.0 +// templui component popover - version: v0.84.0 installed by templui v0.84.0 package popover import ( @@ -30,12 +30,10 @@ const ( TriggerTypeClick TriggerType = "click" ) -type Props struct { - Class string -} - type TriggerProps struct { ID string + Class string + Attributes templ.Attributes For string TriggerType TriggerType } @@ -54,17 +52,6 @@ type ContentProps struct { MatchWidth bool } -templ Popover(props ...Props) { - @Script() - {{ var p Props }} - if len(props) > 0 { - {{ p = props[0] }} - } -
- { children... } -
-} - templ Trigger(props ...TriggerProps) { {{ var p TriggerProps }} if len(props) > 0 { @@ -77,9 +64,13 @@ templ Trigger(props ...TriggerProps) { if p.ID != "" { id={ p.ID } } - data-popover-trigger - data-popover-for={ p.For } + class={ utils.TwMerge("group cursor-pointer", p.Class) } + if p.For != "" { + data-popover-trigger={ p.For } + } + data-open="false" data-popover-type={ string(p.TriggerType) } + { p.Attributes... } > { children... } @@ -103,6 +94,7 @@ templ Content(props ...ContentProps) { ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -436,8 +407,6 @@ func Content(props ...ContentProps) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -454,55 +423,12 @@ func Script() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var20 := templ.GetChildren(ctx) - if templ_7745c5c3_Var20 == nil { - templ_7745c5c3_Var20 = templ.NopComponent + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var21 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = FloatingUICore().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = FloatingUIDom().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, " ") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var21), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/progress/progress.templ b/server/web/templui/components/progress/progress.templ index 07de32f..cab496e 100644 --- a/server/web/templui/components/progress/progress.templ +++ b/server/web/templui/components/progress/progress.templ @@ -1,4 +1,4 @@ -// templui component progress - version: main installed by templui v0.71.0 +// templui component progress - version: v0.84.0 installed by templui v0.84.0 package progress import ( @@ -32,14 +32,9 @@ type Props struct { Size Size Variant Variant BarClass string - HxGet string - HxTrigger string - HxTarget string - HxSwap string } templ Progress(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -50,18 +45,6 @@ templ Progress(props ...Props) {
- (function() { // IIFE Start - function updateProgressWidth(progressBar) { - if (!progressBar) return; - - const indicator = progressBar.querySelector('[data-progress-indicator]'); - if (!indicator) return; - - const value = parseFloat(progressBar.getAttribute('aria-valuenow') || '0'); - let max = parseFloat(progressBar.getAttribute('aria-valuemax') || '100'); - if (max <= 0) max = 100; - - let percentage = 0; - if (max > 0) { - percentage = (Math.max(0, Math.min(value, max)) / max) * 100; - } - - indicator.style.width = percentage + '%'; - } - - function initAllComponents(root = document) { - if (root instanceof Element && root.matches('[role="progressbar"]')) { - updateProgressWidth(root); - } - if (root && typeof root.querySelectorAll === 'function') { - for (const progressBar of root.querySelectorAll('[role="progressbar"]')) { - updateProgressWidth(progressBar); - } - } - } - - const handleHtmxSwap = (event) => { - const target = event.detail.target || event.detail.elt; - if (target instanceof Element) { - requestAnimationFrame(() => initAllComponents(target)); - } - }; - - initAllComponents(); - document.addEventListener('DOMContentLoaded', () => initAllComponents()); - document.body.addEventListener('htmx:afterSwap', handleHtmxSwap); - document.body.addEventListener('htmx:oobAfterSwap', handleHtmxSwap); - })(); // IIFE End - - } + } diff --git a/server/web/templui/components/progress/progress_templ.go b/server/web/templui/components/progress/progress_templ.go index d3a09b5..2118879 100644 --- a/server/web/templui/components/progress/progress_templ.go +++ b/server/web/templui/components/progress/progress_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component progress - version: main installed by templui v0.71.0 +// templui component progress - version: v0.84.0 installed by templui v0.84.0 package progress @@ -41,10 +41,6 @@ type Props struct { Size Size Variant Variant BarClass string - HxGet string - HxTrigger string - HxTarget string - HxSwap string } func Progress(props ...Props) templ.Component { @@ -68,10 +64,6 @@ func Progress(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -91,7 +83,7 @@ func Progress(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 51, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 46, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -110,113 +102,33 @@ func Progress(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\" aria-valuemin=\"0\" aria-valuemax=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - if p.HxGet != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, " hx-get=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var5 string - templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxGet) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 54, Col: 19} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } + var templ_7745c5c3_Var5 string + templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", maxValue(p.Max))) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 49, Col: 52} } - if p.HxTrigger != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, " hx-trigger=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var6 string - templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxTrigger) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 57, Col: 27} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxTarget != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, " hx-target=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var7 string - templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxTarget) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 60, Col: 25} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - if p.HxSwap != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " hx-swap=\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - var templ_7745c5c3_Var8 string - templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.HxSwap) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 63, Col: 21} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "\"") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " aria-valuemin=\"0\" aria-valuemax=\"") + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var9 string - templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", maxValue(p.Max))) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 66, Col: 52} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\" aria-valuenow=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\" aria-valuenow=\"") + var templ_7745c5c3_Var6 string + templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", p.Value)) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 50, Col: 44} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var10 string - templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", p.Value)) - if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 67, Col: 44} - } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "\" role=\"progressbar\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "\" role=\"progressbar\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -224,63 +136,63 @@ func Progress(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, ">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if p.Label != "" || p.ShowValue { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } if p.Label != "" { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var11 string - templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 74, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 57, Col: 48} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } if p.ShowValue { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var12 string - templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d%%", percentage(p.Value, p))) + var templ_7745c5c3_Var8 string + templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d%%", percentage(p.Value, p))) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 78, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/progress/progress.templ`, Line: 61, Col: 51} } - _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - var templ_7745c5c3_Var13 = []any{ + var templ_7745c5c3_Var9 = []any{ utils.TwMerge( "h-full rounded-full transition-all", sizeClasses(p.Size), @@ -288,24 +200,24 @@ func Progress(props ...Props) templ.Component { p.BarClass, ), } - templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var13...) + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var9...) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -355,8 +267,6 @@ func variantClasses(variant Variant) string { } } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -373,43 +283,12 @@ func Script() templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var15 := templ.GetChildren(ctx) - if templ_7745c5c3_Var15 == nil { - templ_7745c5c3_Var15 = templ.NopComponent + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var16 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var16), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/radio/radio.templ b/server/web/templui/components/radio/radio.templ index 8fe571e..3b12514 100644 --- a/server/web/templui/components/radio/radio.templ +++ b/server/web/templui/components/radio/radio.templ @@ -1,4 +1,4 @@ -// templui component radio - version: main installed by templui v0.71.0 +// templui component radio - version: v0.84.0 installed by templui v0.84.0 package radio import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" diff --git a/server/web/templui/components/radio/radio_templ.go b/server/web/templui/components/radio/radio_templ.go index 058c9ea..ac79dc2 100644 --- a/server/web/templui/components/radio/radio_templ.go +++ b/server/web/templui/components/radio/radio_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component radio - version: main installed by templui v0.71.0 +// templui component radio - version: v0.84.0 installed by templui v0.84.0 package radio diff --git a/server/web/templui/components/radiocard/radiocard.templ b/server/web/templui/components/radiocard/radiocard.templ new file mode 100644 index 0000000..6716df2 --- /dev/null +++ b/server/web/templui/components/radiocard/radiocard.templ @@ -0,0 +1,135 @@ +// templui component radiocard - version: v0.84.0 installed by templui v0.84.0 +package radiocard + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Checked bool + Disabled bool + Required bool +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +templ RadioCard(props ...Props) { + {{ var p Props }} + if len(props) > 0 { + {{ p = props[0] }} + } + if p.ID == "" { + {{ p.ID = utils.RandomID() }} + } +
+ + +
+} + +templ Header(props ...HeaderProps) { + {{ var p HeaderProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Description(props ...DescriptionProps) { + {{ var p DescriptionProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +

+ { children... } +

+} + +templ Footer(props ...FooterProps) { + {{ var p FooterProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} diff --git a/server/web/templui/components/radiocard/radiocard_templ.go b/server/web/templui/components/radiocard/radiocard_templ.go new file mode 100644 index 0000000..5247a30 --- /dev/null +++ b/server/web/templui/components/radiocard/radiocard_templ.go @@ -0,0 +1,530 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component radiocard - version: v0.84.0 installed by templui v0.84.0 + +package radiocard + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Name string + Value string + Checked bool + Disabled bool + Required bool +} + +type HeaderProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type DescriptionProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type FooterProps struct { + ID string + Class string + Attributes templ.Attributes +} + +func RadioCard(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p Props + if len(props) > 0 { + p = props[0] + } + if p.ID == "" { + p.ID = utils.RandomID() + } + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + "relative", + utils.If(p.Disabled, "opacity-60"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var8 = []any{ + utils.TwMerge( + "block w-full rounded-lg border overflow-hidden h-full", + "bg-card text-card-foreground p-4 flex flex-col", + "cursor-pointer", + "hover:border-primary/50", + "peer-checked:ring-1 peer-checked:ring-primary peer-checked:border-primary", + utils.If(p.Disabled, "cursor-not-allowed"), + "transition-all duration-200", + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var8...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Header(props ...HeaderProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var11 := templ.GetChildren(ctx) + if templ_7745c5c3_Var11 == nil { + templ_7745c5c3_Var11 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p HeaderProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var12 = []any{utils.TwMerge("flex items-center justify-between mb-2", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var12...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var11.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Description(props ...DescriptionProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var15 := templ.GetChildren(ctx) + if templ_7745c5c3_Var15 == nil { + templ_7745c5c3_Var15 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p DescriptionProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var16 = []any{utils.TwMerge("text-sm text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var16...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var15.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "

") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Footer(props ...FooterProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var19 := templ.GetChildren(ctx) + if templ_7745c5c3_Var19 == nil { + templ_7745c5c3_Var19 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p FooterProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var20 = []any{utils.TwMerge("mt-auto pt-4 w-full", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var20...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var19.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/rating/rating.templ b/server/web/templui/components/rating/rating.templ index 84e2afe..5643eeb 100644 --- a/server/web/templui/components/rating/rating.templ +++ b/server/web/templui/components/rating/rating.templ @@ -1,4 +1,4 @@ -// templui component rating - version: main installed by templui v0.71.0 +// templui component rating - version: v0.84.0 installed by templui v0.84.0 package rating import ( @@ -42,7 +42,6 @@ type ItemProps struct { } templ Rating(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -184,243 +183,6 @@ func (p *Props) setDefaults() { } } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/rating/rating_templ.go b/server/web/templui/components/rating/rating_templ.go index 49a8486..2226842 100644 --- a/server/web/templui/components/rating/rating_templ.go +++ b/server/web/templui/components/rating/rating_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component rating - version: main installed by templui v0.71.0 +// templui component rating - version: v0.84.0 installed by templui v0.84.0 package rating @@ -71,10 +71,6 @@ func Rating(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -102,7 +98,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 53, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 52, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -120,7 +116,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", p.Value)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 56, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 55, Col: 51} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -133,7 +129,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", p.Precision)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 57, Col: 51} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 56, Col: 51} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -146,7 +142,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatBool(p.ReadOnly)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 58, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 57, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -164,7 +160,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 60, Col: 21} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 59, Col: 21} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -182,7 +178,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.FormatBool(p.OnlyInteger)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 62, Col: 54} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 61, Col: 54} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -225,7 +221,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 75, Col: 17} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 74, Col: 17} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -238,7 +234,7 @@ func Rating(props ...Props) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", p.Value)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 76, Col: 40} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 75, Col: 40} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -299,7 +295,7 @@ func Group(props ...GroupProps) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 90, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 89, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -398,7 +394,7 @@ func Item(props ...ItemProps) templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 107, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 106, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -416,7 +412,7 @@ func Item(props ...ItemProps) templ.Component { var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(p.Value)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 110, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/rating/rating.templ`, Line: 109, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { @@ -520,8 +516,6 @@ func (p *Props) setDefaults() { } } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -543,38 +537,7 @@ func Script() templ.Component { templ_7745c5c3_Var21 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var22 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var22), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/selectbox/selectbox.templ b/server/web/templui/components/selectbox/selectbox.templ new file mode 100644 index 0000000..6773a56 --- /dev/null +++ b/server/web/templui/components/selectbox/selectbox.templ @@ -0,0 +1,319 @@ +// templui component selectbox - version: v0.84.0 installed by templui v0.84.0 +package selectbox + +import ( + "context" + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/input" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type contextKey string + +var contentIDKey contextKey = "contentID" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Multiple bool +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Name string + Required bool + Disabled bool + HasError bool + Multiple bool + ShowPills bool + SelectedCountText string +} + +type ValueProps struct { + ID string + Class string + Attributes templ.Attributes + Placeholder string + Multiple bool +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + NoSearch bool + SearchPlaceholder string +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + Selected bool + Disabled bool +} + +templ SelectBox(props ...Props) { + {{ + var p Props + if len(props) > 0 { + p = props[0] + } + wrapperID := p.ID + if wrapperID == "" { + wrapperID = utils.RandomID() + } + contentID := fmt.Sprintf("%s-content", wrapperID) + ctx = context.WithValue(ctx, contentIDKey, contentID) + }} +
+ { children... } +
+} + +templ Trigger(props ...TriggerProps) { + {{ + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + if p.ShowPills { + p.Multiple = true + } + }} + @popover.Trigger(popover.TriggerProps{ + For: contentID, + TriggerType: popover.TriggerTypeClick, + }) { + @button.Button(button.Props{ + ID: p.ID, + Type: "button", + Variant: button.VariantOutline, + Class: utils.TwMerge( + // Required class for JavaScript + "select-trigger", + // Base styles matching input + "w-full h-9 px-3 py-1 text-base md:text-sm", + "flex items-center justify-between", + "rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none", + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes( + templ.Attributes{ + "data-tui-selectbox-content-id": contentID, + "data-tui-selectbox-multiple": strconv.FormatBool(p.Multiple), + "data-tui-selectbox-show-pills": strconv.FormatBool(p.ShowPills), + "data-tui-selectbox-selected-count-text": p.SelectedCountText, + "tabindex": "0", + "required": strconv.FormatBool(p.Required), + "aria-invalid": utils.If(p.HasError, "true"), + }, + ), + }) { + + { children... } + + @icon.ChevronDown(icon.Props{ + Size: 16, + Class: "text-muted-foreground", + }) + + } + } +} + +templ Value(props ...ValueProps) { + {{ var p ValueProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + if p.Placeholder != "" { + { p.Placeholder } + } + { children... } + +} + +templ Content(props ...ContentProps) { + {{ + var p ContentProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + }} + @popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Offset: 4, + MatchWidth: true, + DisableESC: !p.NoSearch, + Class: utils.TwMerge( + "p-1 select-content z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md", + "min-w-[var(--popover-trigger-width)] w-[var(--popover-trigger-width)]", + p.Class, + ), + Attributes: utils.MergeAttributes( + templ.Attributes{ + "role": "listbox", + "tabindex": "-1", + }, + p.Attributes, + ), + }) { + if !p.NoSearch { +
+
+ + @icon.Search(icon.Props{Size: 16}) + + @input.Input(input.Props{ + Type: input.TypeSearch, + Class: "pl-8", + Placeholder: utils.IfElse(p.SearchPlaceholder != "", p.SearchPlaceholder, "Search..."), + Attributes: templ.Attributes{ + "data-tui-selectbox-search": "", + }, + }) +
+
+ } +
+ { children... } +
+ } +} + +templ Group(props ...GroupProps) { + {{ var p GroupProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ { children... } +
+} + +templ Label(props ...LabelProps) { + {{ var p LabelProps }} + if len(props) > 0 { + {{ p = props[0] }} + } + + { children... } + +} + +templ Item(props ...ItemProps) { + {{ var p ItemProps }} + if len(props) > 0 { + {{ p = props[0] }} + } +
+ + { children... } + + + @icon.Check(icon.Props{Size: 16}) + +
+} + +templ Script() { + +} diff --git a/server/web/templui/components/selectbox/selectbox_templ.go b/server/web/templui/components/selectbox/selectbox_templ.go new file mode 100644 index 0000000..6c33b1e --- /dev/null +++ b/server/web/templui/components/selectbox/selectbox_templ.go @@ -0,0 +1,932 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component selectbox - version: v0.84.0 installed by templui v0.84.0 + +package selectbox + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "context" + "fmt" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/button" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/icon" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/input" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/popover" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" + "strconv" +) + +type contextKey string + +var contentIDKey contextKey = "contentID" + +type Props struct { + ID string + Class string + Attributes templ.Attributes + Multiple bool +} + +type TriggerProps struct { + ID string + Class string + Attributes templ.Attributes + Name string + Required bool + Disabled bool + HasError bool + Multiple bool + ShowPills bool + SelectedCountText string +} + +type ValueProps struct { + ID string + Class string + Attributes templ.Attributes + Placeholder string + Multiple bool +} + +type ContentProps struct { + ID string + Class string + Attributes templ.Attributes + NoSearch bool + SearchPlaceholder string +} + +type GroupProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type LabelProps struct { + ID string + Class string + Attributes templ.Attributes +} + +type ItemProps struct { + ID string + Class string + Attributes templ.Attributes + Value string + Selected bool + Disabled bool +} + +func SelectBox(props ...Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p Props + if len(props) > 0 { + p = props[0] + } + wrapperID := p.ID + if wrapperID == "" { + wrapperID = utils.RandomID() + } + contentID := fmt.Sprintf("%s-content", wrapperID) + ctx = context.WithValue(ctx, contentIDKey, contentID) + var templ_7745c5c3_Var2 = []any{utils.TwMerge("select-container w-full relative", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Trigger(props ...TriggerProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var5 := templ.GetChildren(ctx) + if templ_7745c5c3_Var5 == nil { + templ_7745c5c3_Var5 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p TriggerProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + if p.ShowPills { + p.Multiple = true + } + templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var7 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.ChevronDown(icon.Props{ + Size: 16, + Class: "text-muted-foreground", + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = button.Button(button.Props{ + ID: p.ID, + Type: "button", + Variant: button.VariantOutline, + Class: utils.TwMerge( + // Required class for JavaScript + "select-trigger", + // Base styles matching input + "w-full h-9 px-3 py-1 text-base md:text-sm", + "flex items-center justify-between", + "rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none", + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), + p.Class, + ), + Disabled: p.Disabled, + Attributes: utils.MergeAttributes( + templ.Attributes{ + "data-tui-selectbox-content-id": contentID, + "data-tui-selectbox-multiple": strconv.FormatBool(p.Multiple), + "data-tui-selectbox-show-pills": strconv.FormatBool(p.ShowPills), + "data-tui-selectbox-selected-count-text": p.SelectedCountText, + "tabindex": "0", + "required": strconv.FormatBool(p.Required), + "aria-invalid": utils.If(p.HasError, "true"), + }, + ), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var7), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Trigger(popover.TriggerProps{ + For: contentID, + TriggerType: popover.TriggerTypeClick, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Value(props ...ValueProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var9 := templ.GetChildren(ctx) + if templ_7745c5c3_Var9 == nil { + templ_7745c5c3_Var9 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ValueProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var10 = []any{utils.TwMerge("block truncate select-value text-muted-foreground", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var10...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if p.Placeholder != "" { + var templ_7745c5c3_Var13 string + templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(p.Placeholder) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/selectbox/selectbox.templ`, Line: 183, Col: 18} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templ_7745c5c3_Var9.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Content(props ...ContentProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var14 := templ.GetChildren(ctx) + if templ_7745c5c3_Var14 == nil { + templ_7745c5c3_Var14 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + + var p ContentProps + if len(props) > 0 { + p = props[0] + } + contentID, ok := ctx.Value(contentIDKey).(string) + if !ok { + contentID = "fallback-select-content-id" + } + templ_7745c5c3_Var15 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + if !p.NoSearch { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.Search(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = input.Input(input.Props{ + Type: input.TypeSearch, + Class: "pl-8", + Placeholder: utils.IfElse(p.SearchPlaceholder != "", p.SearchPlaceholder, "Search..."), + Attributes: templ.Attributes{ + "data-tui-selectbox-search": "", + }, + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var14.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = popover.Content(popover.ContentProps{ + ID: contentID, + Placement: popover.PlacementBottomStart, + Offset: 4, + MatchWidth: true, + DisableESC: !p.NoSearch, + Class: utils.TwMerge( + "p-1 select-content z-50 overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md", + "min-w-[var(--popover-trigger-width)] w-[var(--popover-trigger-width)]", + p.Class, + ), + Attributes: utils.MergeAttributes( + templ.Attributes{ + "role": "listbox", + "tabindex": "-1", + }, + p.Attributes, + ), + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var15), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Group(props ...GroupProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var16 := templ.GetChildren(ctx) + if templ_7745c5c3_Var16 == nil { + templ_7745c5c3_Var16 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p GroupProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var17 = []any{utils.TwMerge("p-1", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var17...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var16.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Label(props ...LabelProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var20 := templ.GetChildren(ctx) + if templ_7745c5c3_Var20 == nil { + templ_7745c5c3_Var20 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p LabelProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var21 = []any{utils.TwMerge("px-2 py-1.5 text-sm font-medium", p.Class)} + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var21...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var20.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Item(props ...ItemProps) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var24 := templ.GetChildren(ctx) + if templ_7745c5c3_Var24 == nil { + templ_7745c5c3_Var24 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var p ItemProps + if len(props) > 0 { + p = props[0] + } + var templ_7745c5c3_Var25 = []any{ + utils.TwMerge( + "select-item relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 px-2 text-sm font-light outline-none", + "hover:bg-accent hover:text-accent-foreground", + "focus:bg-accent focus:text-accent-foreground", + utils.If(p.Selected, "bg-accent text-accent-foreground"), + utils.If(p.Disabled, "pointer-events-none opacity-50"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var25...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templ_7745c5c3_Var24.Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var31 = []any{ + utils.TwMerge( + "select-check absolute right-2 flex h-3.5 w-3.5 items-center justify-center", + utils.IfElse(p.Selected, "opacity-100", "opacity-0"), + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var31...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = icon.Check(icon.Props{Size: 16}).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var33 := templ.GetChildren(ctx) + if templ_7745c5c3_Var33 == nil { + templ_7745c5c3_Var33 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/separator/separator.templ b/server/web/templui/components/separator/separator.templ index f1a66d3..5d9d697 100644 --- a/server/web/templui/components/separator/separator.templ +++ b/server/web/templui/components/separator/separator.templ @@ -1,4 +1,4 @@ -// templui component separator - version: main installed by templui v0.71.0 +// templui component separator - version: v0.84.0 installed by templui v0.84.0 package separator import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" diff --git a/server/web/templui/components/separator/separator_templ.go b/server/web/templui/components/separator/separator_templ.go index 65cb042..87b162e 100644 --- a/server/web/templui/components/separator/separator_templ.go +++ b/server/web/templui/components/separator/separator_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component separator - version: main installed by templui v0.71.0 +// templui component separator - version: v0.84.0 installed by templui v0.84.0 package separator diff --git a/server/web/templui/components/skeleton/skeleton.templ b/server/web/templui/components/skeleton/skeleton.templ index 02f4e27..5551812 100644 --- a/server/web/templui/components/skeleton/skeleton.templ +++ b/server/web/templui/components/skeleton/skeleton.templ @@ -1,4 +1,4 @@ -// templui component skeleton - version: main installed by templui v0.71.0 +// templui component skeleton - version: v0.84.0 installed by templui v0.84.0 package skeleton import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" diff --git a/server/web/templui/components/skeleton/skeleton_templ.go b/server/web/templui/components/skeleton/skeleton_templ.go index ad1a1c2..f510649 100644 --- a/server/web/templui/components/skeleton/skeleton_templ.go +++ b/server/web/templui/components/skeleton/skeleton_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component skeleton - version: main installed by templui v0.71.0 +// templui component skeleton - version: v0.84.0 installed by templui v0.84.0 package skeleton diff --git a/server/web/templui/components/slider/slider.templ b/server/web/templui/components/slider/slider.templ index a381b6a..3c3a368 100644 --- a/server/web/templui/components/slider/slider.templ +++ b/server/web/templui/components/slider/slider.templ @@ -1,4 +1,4 @@ -// templui component slider - version: main installed by templui v0.71.0 +// templui component slider - version: v0.84.0 installed by templui v0.84.0 package slider import ( @@ -32,7 +32,6 @@ type ValueProps struct { } templ Slider(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -116,53 +115,6 @@ templ Value(props ...ValueProps) { } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/slider/slider_templ.go b/server/web/templui/components/slider/slider_templ.go index 228baf2..0c23fd4 100644 --- a/server/web/templui/components/slider/slider_templ.go +++ b/server/web/templui/components/slider/slider_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component slider - version: main installed by templui v0.71.0 +// templui component slider - version: v0.84.0 installed by templui v0.84.0 package slider @@ -61,10 +61,6 @@ func Slider(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -86,7 +82,7 @@ func Slider(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 42, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 41, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -187,7 +183,7 @@ func Input(props ...InputProps) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 62, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 61, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -205,7 +201,7 @@ func Input(props ...InputProps) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 65, Col: 16} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 64, Col: 16} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -224,7 +220,7 @@ func Input(props ...InputProps) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", p.Value)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 68, Col: 37} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 67, Col: 37} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -243,7 +239,7 @@ func Input(props ...InputProps) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", p.Min)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 71, Col: 33} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 70, Col: 33} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -262,7 +258,7 @@ func Input(props ...InputProps) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", p.Max)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 74, Col: 33} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 73, Col: 33} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -281,7 +277,7 @@ func Input(props ...InputProps) templ.Component { var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%d", p.Step)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 77, Col: 35} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 76, Col: 35} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { @@ -375,7 +371,7 @@ func Value(props ...ValueProps) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 108, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 107, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -393,7 +389,7 @@ func Value(props ...ValueProps) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(p.For) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 111, Col: 31} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/slider/slider.templ`, Line: 110, Col: 31} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -428,8 +424,6 @@ func Value(props ...ValueProps) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -451,38 +445,7 @@ func Script() templ.Component { templ_7745c5c3_Var19 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var20 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var20), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/table/table.templ b/server/web/templui/components/table/table.templ index 35081fd..f54bbe9 100644 --- a/server/web/templui/components/table/table.templ +++ b/server/web/templui/components/table/table.templ @@ -1,4 +1,4 @@ -// templui component table - version: main installed by templui v0.71.0 +// templui component table - version: v0.84.0 installed by templui v0.84.0 package table import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" diff --git a/server/web/templui/components/table/table_templ.go b/server/web/templui/components/table/table_templ.go index da08bcd..b9eebc3 100644 --- a/server/web/templui/components/table/table_templ.go +++ b/server/web/templui/components/table/table_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component table - version: main installed by templui v0.71.0 +// templui component table - version: v0.84.0 installed by templui v0.84.0 package table diff --git a/server/web/templui/components/tabs/tabs.templ b/server/web/templui/components/tabs/tabs.templ index 2cbd49b..0f4f901 100644 --- a/server/web/templui/components/tabs/tabs.templ +++ b/server/web/templui/components/tabs/tabs.templ @@ -1,4 +1,4 @@ -// templui component tabs - version: main installed by templui v0.71.0 +// templui component tabs - version: v0.84.0 installed by templui v0.84.0 package tabs import ( @@ -37,7 +37,6 @@ type ContentProps struct { } templ Tabs(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -163,87 +162,6 @@ func IDFromContext(ctx context.Context) string { return "" } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/tabs/tabs_templ.go b/server/web/templui/components/tabs/tabs_templ.go index 3acccb8..16b9048 100644 --- a/server/web/templui/components/tabs/tabs_templ.go +++ b/server/web/templui/components/tabs/tabs_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component tabs - version: main installed by templui v0.71.0 +// templui component tabs - version: v0.84.0 installed by templui v0.84.0 package tabs @@ -66,10 +66,6 @@ func Tabs(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -95,7 +91,7 @@ func Tabs(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 51, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 50, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -126,7 +122,7 @@ func Tabs(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(tabsID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 55, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 54, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -205,7 +201,7 @@ func List(props ...ListProps) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 71, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 70, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -252,7 +248,7 @@ func List(props ...ListProps) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(tabsID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 84, Col: 24} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 83, Col: 24} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -323,7 +319,7 @@ func Trigger(props ...TriggerProps) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 106, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 105, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -354,7 +350,7 @@ func Trigger(props ...TriggerProps) templ.Component { var templ_7745c5c3_Var15 string templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(tabsID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 116, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 115, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -367,7 +363,7 @@ func Trigger(props ...TriggerProps) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(p.Value) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 117, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 116, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -380,7 +376,7 @@ func Trigger(props ...TriggerProps) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(utils.IfElse(p.IsActive, "active", "inactive")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 118, Col: 61} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 117, Col: 61} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -468,7 +464,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var20 string templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 140, Col: 12} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 139, Col: 12} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20)) if templ_7745c5c3_Err != nil { @@ -499,7 +495,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var22 string templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(tabsID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 150, Col: 23} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 149, Col: 23} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22)) if templ_7745c5c3_Err != nil { @@ -512,7 +508,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var23 string templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(p.Value) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 151, Col: 27} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 150, Col: 27} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23)) if templ_7745c5c3_Err != nil { @@ -525,7 +521,7 @@ func Content(props ...ContentProps) templ.Component { var templ_7745c5c3_Var24 string templ_7745c5c3_Var24, templ_7745c5c3_Err = templ.JoinStringErrs(utils.IfElse(p.IsActive, "active", "inactive")) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 152, Col: 61} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tabs/tabs.templ`, Line: 151, Col: 61} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var24)) if templ_7745c5c3_Err != nil { @@ -562,8 +558,6 @@ func IDFromContext(ctx context.Context) string { return "" } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -585,38 +579,7 @@ func Script() templ.Component { templ_7745c5c3_Var25 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var26 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var26), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/tagsinput/tagsinput.templ b/server/web/templui/components/tagsinput/tagsinput.templ new file mode 100644 index 0000000..8fac524 --- /dev/null +++ b/server/web/templui/components/tagsinput/tagsinput.templ @@ -0,0 +1,87 @@ +// templui component tagsinput - version: v0.84.0 installed by templui v0.84.0 +package tagsinput + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/badge" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/input" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Name string + Value []string + Placeholder string + Class string + HasError bool + Attributes templ.Attributes + Disabled bool + Readonly bool +} + +templ TagsInput(p Props) { +
+
+ for _, tag := range p.Value { + @badge.Badge(badge.Props{ + Attributes: templ.Attributes{"data-tag-chip": ""}, + }) { + { tag } + + } + } +
+ @input.Input(input.Props{ + ID: p.ID, + Class: "border-0 shadow-none focus-visible:ring-0 h-auto py-0 px-0 bg-transparent rounded-none min-h-0 disabled:opacity-100 dark:bg-transparent", + Type: input.TypeText, + Placeholder: p.Placeholder, + Disabled: p.Disabled, + Readonly: p.Readonly, + Attributes: utils.MergeAttributes( + templ.Attributes{"data-text-input": ""}, + p.Attributes, + ), + }) +
+ for _, tag := range p.Value { + + } +
+
+} + +templ Script() { + +} diff --git a/server/web/templui/components/tagsinput/tagsinput_templ.go b/server/web/templui/components/tagsinput/tagsinput_templ.go new file mode 100644 index 0000000..fac63d3 --- /dev/null +++ b/server/web/templui/components/tagsinput/tagsinput_templ.go @@ -0,0 +1,265 @@ +// Code generated by templ - DO NOT EDIT. + +// templ: version: v0.3.865 +// templui component tagsinput - version: v0.84.0 installed by templui v0.84.0 + +package tagsinput + +//lint:file-ignore SA4006 This context is only used if a nested component is present. + +import "github.com/a-h/templ" +import templruntime "github.com/a-h/templ/runtime" + +import ( + "git.jmbit.de/jmb/scanfile/server/web/templui/components/badge" + "git.jmbit.de/jmb/scanfile/server/web/templui/components/input" + "git.jmbit.de/jmb/scanfile/server/web/templui/utils" +) + +type Props struct { + ID string + Name string + Value []string + Placeholder string + Class string + HasError bool + Attributes templ.Attributes + Disabled bool + Readonly bool +} + +func TagsInput(p Props) templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var1 := templ.GetChildren(ctx) + if templ_7745c5c3_Var1 == nil { + templ_7745c5c3_Var1 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + var templ_7745c5c3_Var2 = []any{ + utils.TwMerge( + // Base styles + "flex items-center flex-wrap gap-2 p-2 rounded-md border border-input bg-transparent shadow-xs transition-[color,box-shadow] outline-none", + // Dark mode background + "dark:bg-input/30", + // Focus styles + "focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]", + // Disabled styles + utils.If(p.Disabled, "opacity-50 cursor-not-allowed"), + // Width + "w-full", + // Error/Invalid styles + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), + p.Class, + ), + } + templ_7745c5c3_Err = templ.RenderCSSItems(ctx, templ_7745c5c3_Buffer, templ_7745c5c3_Var2...) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, tag := range p.Value { + templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + var templ_7745c5c3_Var7 string + templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(tag) + if templ_7745c5c3_Err != nil { + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/tagsinput/tagsinput.templ`, Line: 51, Col: 16} + } + _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) + templ_7745c5c3_Err = badge.Badge(badge.Props{ + Attributes: templ.Attributes{"data-tag-chip": ""}, + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = input.Input(input.Props{ + ID: p.ID, + Class: "border-0 shadow-none focus-visible:ring-0 h-auto py-0 px-0 bg-transparent rounded-none min-h-0 disabled:opacity-100 dark:bg-transparent", + Type: input.TypeText, + Placeholder: p.Placeholder, + Disabled: p.Disabled, + Readonly: p.Readonly, + Attributes: utils.MergeAttributes( + templ.Attributes{"data-text-input": ""}, + p.Attributes, + ), + }).Render(ctx, templ_7745c5c3_Buffer) + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + for _, tag := range p.Value { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "
") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +func Script() templ.Component { + return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context + if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil { + return templ_7745c5c3_CtxErr + } + templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) + if !templ_7745c5c3_IsBuffer { + defer func() { + templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) + if templ_7745c5c3_Err == nil { + templ_7745c5c3_Err = templ_7745c5c3_BufErr + } + }() + } + ctx = templ.InitializeContext(ctx) + templ_7745c5c3_Var10 := templ.GetChildren(ctx) + if templ_7745c5c3_Var10 == nil { + templ_7745c5c3_Var10 = templ.NopComponent + } + ctx = templ.ClearChildren(ctx) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + return nil + }) +} + +var _ = templruntime.GeneratedTemplate diff --git a/server/web/templui/components/textarea/textarea.templ b/server/web/templui/components/textarea/textarea.templ index 672444e..cc48072 100644 --- a/server/web/templui/components/textarea/textarea.templ +++ b/server/web/templui/components/textarea/textarea.templ @@ -1,4 +1,4 @@ -// templui component textarea - version: main installed by templui v0.71.0 +// templui component textarea - version: v0.84.0 installed by templui v0.84.0 package textarea import ( @@ -17,10 +17,11 @@ type Props struct { AutoResize bool Disabled bool Required bool + Readonly bool + HasError bool } templ Textarea(props ...Props) { - @Script() {{ var p Props }} if len(props) > 0 { {{ p = props[0] }} @@ -42,18 +43,31 @@ templ Textarea(props ...Props) { } disabled?={ p.Disabled } required?={ p.Required } + readonly?={ p.Readonly } + if p.HasError { + aria-invalid="true" + } if p.AutoResize { data-auto-resize="true" } class={ utils.TwMerge( - "flex w-full px-3 py-2", - "min-h-[80px]", // Default min-height (adjust if needed) - "rounded-md border border-input bg-background text-sm", - "ring-offset-background", + // Base styles + "flex w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none md:text-sm", + "min-h-[80px]", // Default min-height + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Placeholder "placeholder:text-muted-foreground", - "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", - "disabled:cursor-not-allowed disabled:opacity-50", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Disabled styles + "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), // Add overflow-hidden only if auto-resizing to prevent scrollbar flicker utils.If(p.AutoResize, "overflow-hidden resize-none"), p.Class, @@ -63,53 +77,6 @@ templ Textarea(props ...Props) { >{ p.Value } } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/textarea/textarea_templ.go b/server/web/templui/components/textarea/textarea_templ.go index ce2b36b..34a86cd 100644 --- a/server/web/templui/components/textarea/textarea_templ.go +++ b/server/web/templui/components/textarea/textarea_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component textarea - version: main installed by templui v0.71.0 +// templui component textarea - version: v0.84.0 installed by templui v0.84.0 package textarea @@ -26,6 +26,8 @@ type Props struct { AutoResize bool Disabled bool Required bool + Readonly bool + HasError bool } func Textarea(props ...Props) templ.Component { @@ -49,10 +51,6 @@ func Textarea(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } var p Props if len(props) > 0 { p = props[0] @@ -62,13 +60,22 @@ func Textarea(props ...Props) templ.Component { } var templ_7745c5c3_Var2 = []any{ utils.TwMerge( - "flex w-full px-3 py-2", - "min-h-[80px]", // Default min-height (adjust if needed) - "rounded-md border border-input bg-background text-sm", - "ring-offset-background", + // Base styles + "flex w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none md:text-sm", + "min-h-[80px]", // Default min-height + // Dark mode background + "dark:bg-input/30", + // Selection styles + "selection:bg-primary selection:text-primary-foreground", + // Placeholder "placeholder:text-muted-foreground", - "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", - "disabled:cursor-not-allowed disabled:opacity-50", + // Focus styles + "focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]", + // Disabled styles + "disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50", + // Error/Invalid styles + "aria-invalid:ring-destructive/20 aria-invalid:border-destructive dark:aria-invalid:ring-destructive/40", + utils.If(p.HasError, "border-destructive ring-destructive/20 dark:ring-destructive/40"), // Add overflow-hidden only if auto-resizing to prevent scrollbar flicker utils.If(p.AutoResize, "overflow-hidden resize-none"), p.Class, @@ -85,7 +92,7 @@ func Textarea(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 32, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 33, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -103,7 +110,7 @@ func Textarea(props ...Props) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.Name) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 35, Col: 16} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 36, Col: 16} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -122,7 +129,7 @@ func Textarea(props ...Props) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(p.Placeholder) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 38, Col: 30} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 39, Col: 30} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) if templ_7745c5c3_Err != nil { @@ -141,7 +148,7 @@ func Textarea(props ...Props) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(p.Rows)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 41, Col: 30} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 42, Col: 30} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) if templ_7745c5c3_Err != nil { @@ -164,13 +171,25 @@ func Textarea(props ...Props) templ.Component { return templ_7745c5c3_Err } } - if p.AutoResize { - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " data-auto-resize=\"true\"") + if p.Readonly { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, " readonly") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " class=\"") + if p.HasError { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " aria-invalid=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + if p.AutoResize { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, " data-auto-resize=\"true\"") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " class=\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -183,7 +202,7 @@ func Textarea(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "\"") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "\"") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -191,20 +210,20 @@ func Textarea(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, ">") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, ">") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(p.Value) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 63, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/textarea/textarea.templ`, Line: 77, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -212,8 +231,6 @@ func Textarea(props ...Props) templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -235,38 +252,7 @@ func Script() templ.Component { templ_7745c5c3_Var9 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var10 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var10), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/toast/toast.templ b/server/web/templui/components/toast/toast.templ index 84d3b68..6472db5 100644 --- a/server/web/templui/components/toast/toast.templ +++ b/server/web/templui/components/toast/toast.templ @@ -1,4 +1,4 @@ -// templui component toast - version: main installed by templui v0.71.0 +// templui component toast - version: v0.84.0 installed by templui v0.84.0 package toast import ( @@ -43,7 +43,6 @@ type Props struct { } templ Toast(props ...Props) { - @Script() @ToastCSS() {{ var p Props }} if len(props) > 0 { @@ -74,7 +73,7 @@ templ Toast(props ...Props) { ) } { p.Attributes... } > -
+
if p.ShowIndicator { @indicator(p) } @@ -206,126 +205,6 @@ templ ToastCSS() { } } -var handle = templ.NewOnceHandle() - templ Script() { - @handle.Once() { - - } + } diff --git a/server/web/templui/components/toast/toast_templ.go b/server/web/templui/components/toast/toast_templ.go index d2b22f5..615fd4f 100644 --- a/server/web/templui/components/toast/toast_templ.go +++ b/server/web/templui/components/toast/toast_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component toast - version: main installed by templui v0.71.0 +// templui component toast - version: v0.84.0 installed by templui v0.84.0 package toast @@ -72,10 +72,6 @@ func Toast(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Err = Script().Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } templ_7745c5c3_Err = ToastCSS().Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err @@ -114,7 +110,7 @@ func Toast(props ...Props) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(p.ID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 59, Col: 11} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 58, Col: 11} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -127,7 +123,7 @@ func Toast(props ...Props) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(p.Duration)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 61, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 60, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -154,7 +150,7 @@ func Toast(props ...Props) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, ">
") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, ">
") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -329,7 +325,7 @@ func title(p Props) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 121, Col: 53} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 120, Col: 53} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -373,7 +369,7 @@ func description(p Props) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(p.Description) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 127, Col: 52} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 126, Col: 52} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -518,7 +514,7 @@ func ToastCSS() templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(templ.GetNonce(ctx)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 182, Col: 36} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `server/web/templui/components/toast/toast.templ`, Line: 181, Col: 36} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18)) if templ_7745c5c3_Err != nil { @@ -538,8 +534,6 @@ func ToastCSS() templ.Component { }) } -var handle = templ.NewOnceHandle() - func Script() templ.Component { return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context @@ -561,38 +555,7 @@ func Script() templ.Component { templ_7745c5c3_Var19 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var20 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = handle.Once().Render(templ.WithChildren(ctx, templ_7745c5c3_Var20), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/toggle/toggle.templ b/server/web/templui/components/toggle/toggle.templ index addb034..71f6ea0 100644 --- a/server/web/templui/components/toggle/toggle.templ +++ b/server/web/templui/components/toggle/toggle.templ @@ -1,4 +1,4 @@ -// templui component toggle - version: main installed by templui v0.71.0 +// templui component toggle - version: v0.84.0 installed by templui v0.84.0 package toggle import "git.jmbit.de/jmb/scanfile/server/web/templui/utils" @@ -23,10 +23,11 @@ templ Toggle(props ...Props) { ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/components/tooltip/tooltip.templ b/server/web/templui/components/tooltip/tooltip.templ index dc580c7..b1a527a 100644 --- a/server/web/templui/components/tooltip/tooltip.templ +++ b/server/web/templui/components/tooltip/tooltip.templ @@ -1,4 +1,4 @@ -// templui component tooltip - version: main installed by templui v0.71.0 +// templui component tooltip - version: v0.84.0 installed by templui v0.84.0 package tooltip import ( @@ -55,9 +55,7 @@ type ContentProps struct { } templ Tooltip(props ...Props) { - @popover.Popover() { - { children... } - } + { children... } } templ Trigger(props ...TriggerProps) { diff --git a/server/web/templui/components/tooltip/tooltip_templ.go b/server/web/templui/components/tooltip/tooltip_templ.go index cad9fef..e05293d 100644 --- a/server/web/templui/components/tooltip/tooltip_templ.go +++ b/server/web/templui/components/tooltip/tooltip_templ.go @@ -1,7 +1,7 @@ // Code generated by templ - DO NOT EDIT. // templ: version: v0.3.865 -// templui component tooltip - version: main installed by templui v0.71.0 +// templui component tooltip - version: v0.84.0 installed by templui v0.84.0 package tooltip @@ -84,25 +84,7 @@ func Tooltip(props ...Props) templ.Component { templ_7745c5c3_Var1 = templ.NopComponent } ctx = templ.ClearChildren(ctx) - templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { - templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context - templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) - if !templ_7745c5c3_IsBuffer { - defer func() { - templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer) - if templ_7745c5c3_Err == nil { - templ_7745c5c3_Err = templ_7745c5c3_BufErr - } - }() - } - ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) - if templ_7745c5c3_Err != nil { - return templ_7745c5c3_Err - } - return nil - }) - templ_7745c5c3_Err = popover.Popover().Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var1.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -126,16 +108,16 @@ func Trigger(props ...TriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var3 := templ.GetChildren(ctx) - if templ_7745c5c3_Var3 == nil { - templ_7745c5c3_Var3 = templ.NopComponent + templ_7745c5c3_Var2 := templ.GetChildren(ctx) + if templ_7745c5c3_Var2 == nil { + templ_7745c5c3_Var2 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p TriggerProps if len(props) > 0 { p = props[0] } - templ_7745c5c3_Var4 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var3 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -147,7 +129,7 @@ func Trigger(props ...TriggerProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var3.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var2.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -157,7 +139,7 @@ func Trigger(props ...TriggerProps) templ.Component { ID: p.ID, TriggerType: popover.TriggerTypeHover, For: p.For, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var4), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var3), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -181,16 +163,16 @@ func Content(props ...ContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Var5 := templ.GetChildren(ctx) - if templ_7745c5c3_Var5 == nil { - templ_7745c5c3_Var5 = templ.NopComponent + templ_7745c5c3_Var4 := templ.GetChildren(ctx) + if templ_7745c5c3_Var4 == nil { + templ_7745c5c3_Var4 = templ.NopComponent } ctx = templ.ClearChildren(ctx) var p ContentProps if len(props) > 0 { p = props[0] } - templ_7745c5c3_Var6 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { + templ_7745c5c3_Var5 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) { templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W) if !templ_7745c5c3_IsBuffer { @@ -202,7 +184,7 @@ func Content(props ...ContentProps) templ.Component { }() } ctx = templ.InitializeContext(ctx) - templ_7745c5c3_Err = templ_7745c5c3_Var5.Render(ctx, templ_7745c5c3_Buffer) + templ_7745c5c3_Err = templ_7745c5c3_Var4.Render(ctx, templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -216,7 +198,7 @@ func Content(props ...ContentProps) templ.Component { ShowArrow: p.ShowArrow, HoverDelay: p.HoverDelay, HoverOutDelay: p.HoverOutDelay, - }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var6), templ_7745c5c3_Buffer) + }).Render(templ.WithChildren(ctx, templ_7745c5c3_Var5), templ_7745c5c3_Buffer) if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } diff --git a/server/web/templui/utils/templui.go b/server/web/templui/utils/templui.go index 3f7c7a9..8396023 100644 --- a/server/web/templui/utils/templui.go +++ b/server/web/templui/utils/templui.go @@ -1,4 +1,4 @@ -// templui util templui.go - version: main installed by templui v0.71.0 +// templui util templui.go - version: v0.84.0 installed by templui v0.84.0 package utils import (