19 lines
54 KiB
JavaScript
19 lines
54 KiB
JavaScript
|
|
"use strict";var zt=Object.create;var ae=Object.defineProperty;var Kt=Object.getOwnPropertyDescriptor;var Mt=Object.getOwnPropertyNames;var Ft=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty;var Fe=(e,r)=>{for(var t in r)ae(e,t,{get:r[t],enumerable:!0})},je=(e,r,t,n)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of Mt(r))!jt.call(e,i)&&i!==t&&ae(e,i,{get:()=>r[i],enumerable:!(n=Kt(r,i))||n.enumerable});return e};var T=(e,r,t)=>(t=e!=null?zt(Ft(e)):{},je(r||!e||!e.__esModule?ae(t,"default",{value:e,enumerable:!0}):t,e)),Wt=e=>je(ae({},"__esModule",{value:!0}),e);var kn={};Fe(kn,{Features:()=>_.Features,Instrumentation:()=>Me,Polyfills:()=>_.Polyfills,__unstable__loadDesignSystem:()=>sn,compile:()=>an,compileAst:()=>ln,env:()=>se,loadModule:()=>ze,normalizePath:()=>ve,optimize:()=>mn,toSourceMap:()=>vn});module.exports=Wt(kn);var le=T(require("module")),Lt=require("url");var se={};Fe(se,{DEBUG:()=>be});var be=Bt(process.env.DEBUG);function Bt(e){if(typeof e=="boolean")return e;if(e===void 0)return!1;if(e==="true"||e==="1")return!0;if(e==="false"||e==="0")return!1;if(e==="*")return!0;let r=e.split(",").map(t=>t.split(":")[0]);return r.includes("-tailwindcss")?!1:!!r.includes("tailwindcss")}var We=require("module"),Gt={};var Be=(e,r,t)=>{let n=t(e,r);return Yt(r,n)};function Yt(e,r){if(r.url===Gt.url||(0,We.isBuiltin)(r.url)||!e.parentURL)return r;let n=new URL(e.parentURL).searchParams.get("id");if(n===null)return r;let i=new URL(r.url);return i.searchParams.set("id",n),{...r,url:`${i}`}}var W=T(require("enhanced-resolve")),Nt=require("jiti"),ke=T(require("fs")),Le=T(require("fs/promises")),q=T(require("path")),Ie=require("url"),_=require("tailwindcss");var ue=T(require("fs/promises")),Y=T(require("path")),Ht=[/import[\s\S]*?['"](.{3,}?)['"]/gi,/import[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/export[\s\S]*from[\s\S]*?['"](.{3,}?)['"]/gi,/require\(['"`](.+)['"`]\)/gi],qt=[".js",".cjs",".mjs"],Zt=["",".js",".cjs",".mjs",".ts",".cts",".mts",".jsx",".tsx"],Qt=["",".ts",".cts",".mts",".tsx",".js",".cjs",".mjs",".jsx"];async function Jt(e,r){for(let t of r){let n=`${e}${t}`;if((await ue.default.stat(n).catch(()=>null))?.isFile())return n}for(let t of r){let n=`${e}/index${t}`;if(await ue.default.access(n).then(()=>!0,()=>!1))return n}return null}async function Ye(e,r,t,n){let i=qt.includes(n)?Zt:Qt,l=await Jt(Y.default.resolve(t,r),i);if(l===null||e.has(l))return;e.add(l),t=Y.default.dirname(l),n=Y.default.extname(l);let o=await ue.default.readFile(l,"utf-8"),s=[];for(let a of Ht)for(let u of o.matchAll(a))u[1].startsWith(".")&&s.push(Ye(e,u[1],t,n));await Promise.all(s)}async function Ge(e){let r=new Set;return await Ye(r,e,Y.default.dirname(e),Y.default.extname(e)),Array.from(r)}var _e=T(require("path"));function G(e){return{kind:"word",value:e}}function Xt(e,r){return{kind:"function",value:e,nodes:r}}function er(e){return{kind:"separator",value:e}}function A(e){let r="";for(let t of e)switch(t.kind){case"word":case"separator":{r+=t.value;break}case"function":r+=t.value+"("+A(t.nodes)+")"}return r}var He=92,tr=41,qe=58,Ze=44,rr=34,Qe=61,Je=62,Xe=60,et=10,nr=40,ir=39,or=47,tt=32,rt=9;function y(e){e=e.replaceAll(`\r
|
||
|
|
`,`
|
||
|
|
`);let r=[],t=[],n=null,i="",l;for(let o=0;o<e.length;o++){let s=e.charCodeAt(o);switch(s){case He:{i+=e[o]+e[o+1],o++;break}case or:{if(i.length>0){let u=G(i);n?n.nodes.push(u):r.push(u),i=""}let a=G(e[o]);n?n.nodes.push(a):r.push(a);break}case qe:case Ze:case Qe:case Je:case Xe:case et:case tt:case rt:{if(i.length>0){let c=G(i);n?n.nodes.push(c):r.push(c),i=""}let a=o,u=o+1;for(;u<e.length&&(l=e.charCodeAt(u),!(l!==qe&&l!==Ze&&l!==Qe&&l!==Je&&l!==Xe&&l!==et&&l!==tt&&l!==rt));u++);o=u-1;let p=er(e.slice(a,u));n?n.nodes.push(p):r.push(p);break}case ir:case rr:{let a=o;for(let u=o+1;u<e.length;u++)if(l=e.charCodeAt(u),l===He)u+=1;else if(l===s){o=u;break}i+=e.slice(a,o+1);break}case nr:{let a=Xt(i,[]);i="",n?n.nodes.push(a):r.push(a),t.push(a),n=a;break}case tr:{let a=t.pop();if(i.length>0){let u=G(i);a?.nodes.push(u),i=""}t.length>0?n=t[t.length-1]:n=null;break}default:i+=String.fromCharCode(s)}}return i.length>0&&r.push(G(i)),r}var h=class extends Map{constructor(t){super();this.factory=t}factory;get(t){let n=super.get(t);return n===void 0&&(n=this.factory(t,this),this.set(t,n)),n}};var $n=new Uint8Array(256);var ce=new Uint8Array(256);function w(e,r){let t=0,n=[],i=0,l=e.length,o=r.charCodeAt(0);for(let s=0;s<l;s++){let a=e.charCodeAt(s);if(t===0&&a===o){n.push(e.slice(i,s)),i=s+1;continue}switch(a){case 92:s+=1;break;case 39:case 34:for(;++s<l;){let u=e.charCodeAt(s);if(u===92){s+=1;continue}if(u===a)break}break;case 40:ce[t]=41,t++;break;case 91:ce[t]=93,t++;break;case 123:ce[t]=125,t++;break;case 93:case 125:case 41:t>0&&a===ce[t-1]&&t--;break}}return n.push(e.slice(i)),n}var ye=(o=>(o[o.Continue=0]="Continue",o[o.Skip=1]="Skip",o[o.Stop=2]="Stop",o[o.Replace=3]="Replace",o[o.ReplaceSkip=4]="ReplaceSkip",o[o.ReplaceStop=5]="ReplaceStop",o))(ye||{}),v={Continue:{kind:0},Skip:{kind:1},Stop:{kind:2},Replace:e=>({kind:3,nodes:Array.isArray(e)?e:[e]}),ReplaceSkip:e=>({kind:4,nodes:Array.isArray(e)?e:[e]}),ReplaceStop:e=>({kind:5,nodes:Array.isArray(e)?e:[e]})};function g(e,r){typeof r=="function"?nt(e,r):nt(e,r.enter,r.exit)}function nt(e,r=()=>v.Continue,t=()=>v.Continue){let n={value:[e,0,null],prev:null},i={parent:null,depth:0,index:0,siblings:e,path(){let l=[],o=n;for(;o;){let s=o.value[2];s&&l.push(s),o=o.prev}return l.reverse(),l}};for(;n!==null;){let l=n.value,o=l[0],s=l[1],a=l[2];if(s>=o.length){n=n.prev,i.depth-=1;continue}if(i.parent=a,i.siblings=o,s>=0){i.index=s;let f=o[s],d=r(f,i)??v.Continue;switch(d.kind){case 0:{f.nodes&&f.nodes.length>0&&(i.depth+=1,n={value:[f.nodes,0,f],prev:n}),l[1]=~s;continue}case 2:return;case 1:{l[1]=~s;continue}case 3:{o.splice(s,1,...d.nodes);continue}case 5:{o.splice(s,1,...d.nodes);return}case 4:{o.splice(s,1,...d.nodes),l[1]+=d.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${ye[d.kind]??`Unknown(${d.kind})`}\` in enter.`)}}let u=~s;i.index=u;let p=o[u],c=t(p,i)??v.Continue;switch(c.kind){case 0:l[1]=u+1;continue;case 2:return;case 3:{o.splice(u,1,...c.nodes),l[1]=u+c.nodes.length;continue}case 5:{o.splice(u,1,...c.nodes);return}case 4:{o.splice(u,1,...c.nodes),l[1]=u+c.nodes.length;continue}default:throw new Error(`Invalid \`WalkAction.${ye[c.kind]??`Unknown(${c.kind})`}\` in exit.`)}}}var Un=new h(e=>{let r=y(e),t=new Set,n=new Set(["~",">","+","-","*","/"]);return g(r,(i,l)=>{if(i.kind==="word"&&n.has(i.value)){let o=l.index;if(o===-1)return;let s=l.siblings[o-1];if(s?.kind!=="separator"||s.value!==" ")return;let a=l.siblings[o+1];if(a?.kind!=="separator"||a.value!==" ")return;let u=l.siblings[o-2];if(u&&n.has(u.value))return;let p=l.siblings[o+2];if(p&&n.has(p.value))return;t.add(s),t.add(a)}else if(i.kind==="separator"&&i.value.length>0&&i.value.trim()==="")(l.siblings[0]===i||l.siblings[l.siblings.length-1]===i)&&t.add(i);else if(i.kind==="separator"&&i.value.trim()===",")i.value=",";else if(i.kind==="function"&&i.value.startsWith("--")){let o=l.index;if(o<=0)return;let s=l.siblings[o-1];if(s?.kind==="separator"&&s.value===",")return;let a=l.siblings[o-2];return a&&!n.has(a.value)?void 0:v.ReplaceSkip({kind:"function",value:"",nodes:[i]})}}),t.size
|
||
|
|
`,r){t+=u.length;let p=t;t+=o.property.length,t+=2,t+=o.value?.length??0,o.important&&(t+=11);let c=t;t+=2,o.dst=[n,p,c]}}else if(o.kind==="rule"){if(a+=`${u}${o.selector} {
|
||
|
|
`,r){t+=u.length;let p=t;t+=o.selector.length,t+=1;let c=t;o.dst=[n,p,c],t+=2}for(let p of o.nodes)a+=i(p,s+1);a+=`${u}}
|
||
|
|
`,r&&(t+=u.length,t+=2)}else if(o.kind==="at-rule"){if(o.nodes.length===0){let p=`${u}${o.name} ${o.params};
|
||
|
|
`;if(r){t+=u.length;let c=t;t+=o.name.length,t+=1,t+=o.params.length;let f=t;t+=2,o.dst=[n,c,f]}return p}if(a+=`${u}${o.name}${o.params?` ${o.params} `:" "}{
|
||
|
|
`,r){t+=u.length;let p=t;t+=o.name.length,o.params&&(t+=1,t+=o.params.length),t+=1;let c=t;o.dst=[n,p,c],t+=2}for(let p of o.nodes)a+=i(p,s+1);a+=`${u}}
|
||
|
|
`,r&&(t+=u.length,t+=2)}else if(o.kind==="comment"){if(a+=`${u}/*${o.value}*/
|
||
|
|
`,r){t+=u.length;let p=t;t+=2+o.value.length+2;let c=t;o.dst=[n,p,c],t+=1}}else if(o.kind==="context"||o.kind==="at-root")return"";return a}let l="";for(let o of e)l+=i(o,0);return n.code=l,l}function Wr(e,r){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var t=e.length;if(t<=1)return e;var n="";if(t>4&&e[3]==="\\"){var i=e[2];(i==="?"||i===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//")}var l=e.split(/[/\\]+/);return r!==!1&&l[l.length-1]===""&&l.pop(),n+l.join("/")}function ve(e){let r=Wr(e);return e.startsWith("\\\\")&&r.startsWith("/")&&!r.startsWith("//")?`/${r}`:r}var De=/(?<!@import\s+)(?<=^|[^\w\-\u0080-\uffff])url\((\s*('[^']+'|"[^"]+")\s*|[^'")]+)\)/,xt=/(?<=image-set\()((?:[\w-]{1,256}\([^)]*\)|[^)])*)(?=\))/,Br=/(?:gradient|element|cross-fade|image)\(/,Yr=/^\s*data:/i,Gr=/^([a-z]+:)?\/\//,Hr=/^[A-Z_][.\w-]*\(/i,qr=/(?:^|\s)(?<url>[\w-]+\([^)]*\)|"[^"]*"|'[^']*'|[^,]\S*[^,])\s*(?:\s(?<descriptor>\w[^,]+))?(?:,|$)/g,Zr=/(?<!\\)"/g,Qr=/(?: |\\t|\\n|\\f|\\r)+/g,Jr=e=>Yr.test(e),Xr=e=>Gr.test(e);async function At({css:e,base:r,root:t}){if(!e.includes("url(")&&!e.includes("image-set("))return e;let n=ie(e),i=[];function l(o){if(o[0]==="/")return o;let s=_e.posix.join(ve(r),o),a=_e.posix.relative(ve(t),s);return a.startsWith(".")||(a="./"+a),a}return g(n,o=>{if(o.kind!=="declaration"||!o.value)return;let s=De.test(o.value),a=xt.test(o.value);if(s||a){let u=a?en:Ct;i.push(u(o.value,l).then(p=>{o.value=p}))}}),i.length&&await Promise.all(i),F(n)}function Ct(e,r){return $t(e,De,async t=>{let[n,i]=t;return await St(i.trim(),n,r)})}async function en(e,r){return await $t(e,xt,async t=>{let[,n]=t;return await rn(n,async({url:l})=>De.test(l)?await Ct(l,r):Br.test(l)?l:await St(l,l,r))})}async function St(e,r,t,n="url"){let i="",l=e[0];if((l==='"'||l==="'")&&(i=l,e=e.slice(1,-1)),tn(e))return r;let o=await t(e);return i===""&&o!==encodeURI(o)&&(i='"'),i==="'"&&o.includes("'")&&(i='"'),i==='"'&&o.includes('"')&&(o=o.replace(Zr,'\\"')),`${n}(${i}${o}${i})`}function tn(e,r){return Xr(e)||Jr(e)||!e[0].match(/[.a-zA-Z0-9_]/)||Hr.test(e)}function rn(e,r){return Promise.all(nn(e).map(async({url:t,descriptor:n})=>({url:await r({url:t,descriptor:n}),descriptor:n}))).then(on)}function nn(e){let r=e.trim().replace(Qr," ").replace(/\r?\n/,"").replace(/,\s+/,", ").replaceAll(/\s+/g," ").matchAll(qr);return Array.from(r,({groups:t})=>({url:t?.url?.trim()??"",descriptor:t?.descriptor?.trim()??""})).filter(({url:t})=>!!t)}function on(e){return e.map(({url:r,descriptor:t})=>r+(t?` ${t}`:"")).join(", ")}async function $t(e,r,t){let n,i=e,l="";for(;n=r.exec(i);)l+=i.slice(0,n.index),l+=await t(n),i=i.slice(n.index+n[0].length);return l+=i,l}var dn={};function Rt({base:e,from:r,polyfills:t,onDependency:n,shouldRewriteUrls:i,customCssResolver:l,customJsResolver:o}){return{base:e,polyfills:t,from:r,async loadModule(s,a){return ze(s,a,n,o)},async loadStylesheet(s,a){let u=await Ot(s,a,n,l);return i&&(u.content=await At({css:u.content,root:e,base:u.base})),u}}}async function Pt(e){if(e.root&&e.root!=="none"){let r=/[*{]/,t=[];for(let i of e.root.pattern.split("/")){if(r.test(i))break;t.push(i)}if(!await Le.default.stat(q.default.resolve(e.root.base,t.join("/"))).then(i=>i.isDirectory()).catch(()=>!1))throw new Error(`The \`source(${e.root.pattern})\` does not exist or is not a directory.`)}}async function ln(e,r){let t=await(0,_.compileAst)(e,Rt(r));return await Pt(t),t}async function an(e,r){let t=await(0,_.compile)(e,Rt(r));return await Pt(t),t}async function sn(e,{base:r}){return(0,_.__unstable__loadDesignSystem)(e,{base:r,async loadModule(t,n){return ze(t,n,()=>{})},async loadStylesheet(t,n){return Ot(t,n,()=>{})}})}async function ze(e,r,t,n){if(e[0]!=="."){let s=await Tt(e,r,n);if(!s)throw new Error(`Could not resolve '${e}' from '${r}'`);let a=await Et((0,Ie.pathToFileURL)(s).href);return{path:s,base:q.default.dirname(s),module:a.default??a}}let i=await Tt(e,r,n);if(!i)throw new Error(`Could not resolve '${e}' from '${r}'`);let[l,o]=await Promise.all([Et((0,Ie.pathToFileURL)(i).hre
|
||
|
|
`)}){this.shouldReport=r;this.defaultFlush=t}shouldReport;defaultFlush;#r=new h(()=>({value:0}));#t=new h(()=>({value:0n}));#e=[];hit(r){this.#r.get(r).value++}start(r){let t=this.#e.map(i=>i.label).join("//"),n=`${t}${t.length===0?"":"//"}${r}`;this.#r.get(n).value++,this.#t.get(n),this.#e.push({id:n,label:r,namespace:t,value:process.hrtime.bigint()})}end(r){let t=process.hrtime.bigint();if(this.#e[this.#e.length-1].label!==r)throw new Error(`Mismatched timer label: \`${r}\`, expected \`${this.#e[this.#e.length-1].label}\``);let n=this.#e.pop(),i=t-n.value;this.#t.get(n.id).value+=i}track(r){this.start(r);let t=!1;return{[Symbol.dispose]:()=>{t||(this.end(r),t=!0)},[Symbol.asyncDispose]:()=>{t||(this.end(r),t=!0)}}}span(r,t){this.start(r);let n=!1;try{let i=t();return n=i&&typeof i.then=="function",n?i.finally(()=>this.end(r)):i}finally{n||this.end(r)}}reset(){this.#r.clear(),this.#t.clear(),this.#e.splice(0)}report(r=this.defaultFlush){let t=[],n=!1;for(let o=this.#e.length-1;o>=0;o--)this.end(this.#e[o].label);for(let[o,{value:s}]of this.#r.entries()){if(this.#t.has(o))continue;t.length===0&&(n=!0,t.push("Hits:"));let a=o.split("//").length;t.push(`${" ".repeat(a)}${o} ${we(_t(`\xD7 ${s}`))}`)}this.#t.size>0&&n&&t.push(`
|
||
|
|
Timers:`);let i=-1/0,l=new Map;for(let[o,{value:s}]of this.#t){let a=`${(Number(s)/1e6).toFixed(2)}ms`;l.set(o,a),i=Math.max(i,a.length)}for(let o of this.#t.keys()){let s=o.split("//").length;t.push(`${we(`[${l.get(o).padStart(i," ")}]`)}${" ".repeat(s-1)}${s===1?" ":we(" \u21B3 ")}${o.split("//").pop()} ${this.#r.get(o).value===1?"":we(_t(`\xD7 ${this.#r.get(o).value}`))}`.trimEnd())}r(`
|
||
|
|
${t.join(`
|
||
|
|
`)}
|
||
|
|
`),this.reset()}[Symbol.dispose](){this.shouldReport&&this.report()}};function we(e){return`\x1B[2m${e}\x1B[22m`}function _t(e){return`\x1B[34m${e}\x1B[39m`}var Dt=T(require("@jridgewell/remapping")),L=require("lightningcss"),It=T(require("magic-string"));function mn(e,{file:r="input.css",minify:t=!1,map:n}={}){function i(a,u){return(0,L.transform)({filename:r,code:a,minify:t,sourceMap:typeof u<"u",inputSourceMap:u,drafts:{customMedia:!0},nonStandard:{deepSelectorCombinator:!0},include:L.Features.Nesting|L.Features.MediaQueries,exclude:L.Features.LogicalProperties|L.Features.DirSelector|L.Features.LightDark,targets:{safari:16<<16|1024,ios_saf:16<<16|1024,firefox:8388608,chrome:7274496},errorRecovery:!0})}let l=i(Buffer.from(e),n);if(n=l.map?.toString(),l.warnings=l.warnings.filter(a=>!/'(deep|slotted|global)' is not recognized as a valid pseudo-/.test(a.message)),l.warnings.length>0){let a=e.split(`
|
||
|
|
`),u=[`Found ${l.warnings.length} ${l.warnings.length===1?"warning":"warnings"} while optimizing generated CSS:`];for(let[p,c]of l.warnings.entries()){u.push(""),l.warnings.length>1&&u.push(`Issue #${p+1}:`);let f=2,d=Math.max(0,c.loc.line-f-1),m=Math.min(a.length,c.loc.line+f),C=a.slice(d,m).map((k,z)=>d+z+1===c.loc.line?`${oe("\u2502")} ${k}`:oe(`\u2502 ${k}`));C.splice(c.loc.line-d,0,`${oe("\u2506")}${" ".repeat(c.loc.column-1)} ${gn(`${oe("^--")} ${c.message}`)}`,`${oe("\u2506")}`),u.push(...C)}u.push(""),console.warn(u.join(`
|
||
|
|
`))}l=i(l.code,n),n=l.map?.toString();let o=l.code.toString(),s=new It.default(o);if(s.replaceAll("@media not (","@media not all and ("),n!==void 0&&s.hasChanged()){let a=s.generateMap({source:"original",hires:"boundary"}).toString();n=(0,Dt.default)([a,n],()=>null).toString()}return o=s.toString(),{code:o,map:n}}function oe(e){return`\x1B[2m${e}\x1B[22m`}function gn(e){return`\x1B[33m${e}\x1B[39m`}var Ut=require("source-map-js");function hn(e){let r=new Ut.SourceMapGenerator,t=1,n=new h(i=>({url:i?.url??`<unknown ${t++}>`,content:i?.content??"<none>"}));for(let i of e.mappings){let l=n.get(i.originalPosition?.source??null);r.addMapping({generated:i.generatedPosition,original:i.originalPosition,source:l.url,name:i.name}),r.setSourceContent(l.url,l.content)}return r.toString()}function vn(e){let r=typeof e=="string"?e:hn(e);function t(n){return`/*# sourceMappingURL=${n} */
|
||
|
|
`}return{raw:r,get inline(){let n=Buffer.from(r,"utf-8").toString("base64");return t(`data:application/json;base64,${n}`)},comment:t}}process.versions.bun||(le.registerHooks?le.registerHooks({resolve:Be}):le.register?.((0,Lt.pathToFileURL)(require.resolve("@tailwindcss/node/esm-cache-loader"))));0&&(module.exports={Features,Instrumentation,Polyfills,__unstable__loadDesignSystem,compile,compileAst,env,loadModule,normalizePath,optimize,toSourceMap});
|