able-baker/bundled/twind/core.js

4 lines
20 KiB
JavaScript
Raw Normal View History

2024-05-14 20:34:18 -04:00
///<reference types="https://esm.sh/v135/@twind/core@1.1.3/core.d.ts"/>
2024-05-15 09:33:06 -04:00
/* esm.sh - esbuild bundle(@twind/core@1.1.3) denonext production */
2024-05-15 09:33:06 -04:00
var B;function ae(e){return[...e.v,(e.i?"!":"")+e.n].join(":")}function ue(e,t=","){return e.map(ae).join(t)}var Y=typeof CSS<"u"&&CSS.escape||(e=>e.replace(/[!"'`*+.,;:\\/<=>?@#$%&^|~()[\]{}]/g,"\\$&").replace(/^\d/,"\\3$& "));function T(e){for(var t=9,r=e.length;r--;)t=Math.imul(t^e.charCodeAt(r),1597334677);return"#"+((t^t>>>9)>>>0).toString(36)}function Ce(e,t="@media "){return t+b(e).map(r=>(typeof r=="string"&&(r={min:r}),r.raw||Object.keys(r).map(i=>`(${i}-width:${r[i]})`).join(" and "))).join(",")}function b(e=[]){return Array.isArray(e)?e:e==null?[]:[e]}function te(e){return e}function F(){}var S={d:0,b:134217728,c:268435456,a:671088640,u:805306368,o:939524096};function Ee(e){return e.match(/[-=:;]/g)?.length||0}function re(e){return Math.min(/(?:^|width[^\d]+)(\d+(?:.\d+)?)(p)?/.test(e)?Math.max(0,29.63*(+RegExp.$1/(RegExp.$2?15:1))**.137-43):0,15)<<22|Math.min(Ee(e),15)<<18}var Ue=["rst-c","st-ch","h-chi","y-lin","nk","sited","ecked","pty","ad-on","cus-w","ver","cus","cus-v","tive","sable","tiona","quire"];function ce({n:e,i:t,v:r=[]},i,n,l){e&&(e=ae({n:e,i:t,v:r})),l=[...b(l)];for(let s of r){let f=i.theme("screens",s);for(let a of b(f&&Ce(f)||i.v(s))){var o;l.push(a),n|=f?67108864|re(a):s=="dark"?1073741824:a[0]=="@"?re(a):(o=a,1<<~(/:([a-z-]+)/.test(o)&&~Ue.indexOf(RegExp.$1.slice(2,7))||-18))}}return{n:e,p:n,r:l,i:t}}var pe=new Map;function ne(e){if(e.d){let t=[],r=H(e.r.reduce((i,n)=>n[0]=="@"?(t.push(n),i):n?H(i,l=>H(n,o=>{let s=/(:merge\(.+?\))(:[a-z-]+|\\[.+])/.exec(o);if(s){let f=l.indexOf(s[1]);return~f?l.slice(0,f)+s[0]+l.slice(f+s[1].length):Q(l,o)}return Q(o,l)})):i,"&"),i=>Q(i,e.n?"."+Y(e.n):""));return r&&t.push(r.replace(/:merge\((.+?)\)/g,"$1")),t.reduceRight((i,n)=>n+"{"+i+"}",e.d)}}function H(e,t){return e.replace(/ *((?:\(.+?\)|\[.+?\]|[^,])+) *(,|$)/g,(r,i,n)=>t(i)+n)}function Q(e,t){return e.replace(/&/g,t)}var $e=new Intl.Collator("en",{numeric:!0});function Me(e,t){for(var r=0,i=e.length;r<i;){let n=i+r>>1;0>=Ne(e[n],t)?r=n+1:i=n}return i}function Ne(e,t){let r=e.p&S.o;return r==(t.p&S.o)&&(r==S.b||r==S.o)?0:e.p-t.p||e.o-t.o||$e.compare(we(e.n),we(t.n))||$e.compare(Ae(e.n),Ae(t.n))}function we(e){return(e||"").split(/:/).pop().split("/").pop()||"\0"}function Ae(e){return(e||"").replace(/\W/g,t=>String.fromCharCode(127+t.charCodeAt(0)))+"\0"}function X(e,t){return Math.round(parseInt(e,16)*t)}function P(e,t={}){if(typeof e=="function")return e(t);let{opacityValue:r="1",opacityVariable:i}=t,n=i?`var(${i})`:r;if(e.includes("<alpha-value>"))return e.replace("<alpha-value>",n);if(e[0]=="#"&&(e.length==4||e.length==7)){let l=(e.length-1)/3,o=[17,1,.062272][l-1];return`rgba(${[X(e.substr(1,l),o),X(e.substr(1+l,l),o),X(e.substr(1+2*l,l),o),n]})`}return n=="1"?e:n=="0"?"#0000":e.replace(/^(rgb|hsl)(\([^)]+)\)$/,`$1a$2,${n})`)}function ct(e,t,{theme:r}){return r(e,t=t.replace(/\d+$/,i=>100*(9-~~(parseInt(i,10)/100)||.5)))}function de(e,t,r,i,n=[]){return function l(o,{n:s,p:f,r:a=[],i:c},u){let p=[],g="",y=0,$=0;for(let h in o||{}){var A,R;let d=o[h];if(h[0]=="@"){if(!d)continue;if(h[1]=="a"){p.push(...ge(s,f,I(""+d),u,f,a,c,!0));continue}if(h[1]=="l"){for(let w of b(d))p.push(...l(w,{n:s,p:(A=S[h[7]],f&~S.o|A),r:h[7]=="d"?[]:a,i:c},u));continue}if(h[1]=="i"){p.push(...b(d).map(w=>({p:-1,o:0,r:[],d:h+" "+w})));continue}if(h[1]=="k"){p.push({p:S.d,o:0,r:[h],d:l(d,{p:S.d},u).map(ne).join("")});continue}if(h[1]=="f"){p.push(...b(d).map(w=>({p:S.d,o:0,r:[h],d:l(w,{p:S.d},u).map(ne).join("")})));continue}}if(typeof d!="object"||Array.isArray(d))h=="label"&&d?s=d+T(JSON.stringify([f,c,o])):(d||d===0)&&(h=h.replace(/[A-Z]/g,w=>"-"+w.toLowerCase()),$+=1,y=Math.max(y,(R=h)[0]=="-"?0:Ee(R)+(/^(?:(border-(?!w|c|sty)|[tlbr].{2,4}m?$|c.{7,8}$)|([fl].{5}l|g.{8}$|pl))/.test(R)?+!!RegExp.$1||-!!RegExp.$2:0)+1),g+=(g?";":"")+b(d).map(w=>u.s(h,he(""+w,u.theme)+(c?" !important":""))).join(";"));else if(h[0]=="@"||h.includes("&")){let w=f;h[0]=="@"&&(h=h.replace(/\bscreen\(([^)]+)\)/g,(x,M)=>{let N=u.theme("screens",M);return N?(w|=67108864,Ce(N,"")):x}),w|=re(h)),p.push(...l(d,{n:s,p:w,r:[...a,h],i:c},u))}else p.p