diff --git a/README.md b/README.md index e8e3e47..d4b9041 100644 --- a/README.md +++ b/README.md @@ -47,14 +47,21 @@ A secure, self-hosted URL shortener with custom paswordless encryption. Perfect pip install -r requirements.txt ``` -3. **Start Server** +3. **Setup the config:** + ```bash + cp config_template.json config.json + python generate_salts.py + ``` + You will see two salts, which you can use in the config. + +4. **Start Server** ```bash python main.py ``` -4. Access at `http://localhost:5000` +5. Access at `http://localhost:5000` -### Deveopment +### Development 1. **Start development server:** ```bash diff --git a/backend/dist/assets/index-gh52jT1v.js b/backend/dist/assets/index-RuzqiqvS.js similarity index 97% rename from backend/dist/assets/index-gh52jT1v.js rename to backend/dist/assets/index-RuzqiqvS.js index 533ed07..652c8b4 100644 --- a/backend/dist/assets/index-gh52jT1v.js +++ b/backend/dist/assets/index-RuzqiqvS.js @@ -107,4 +107,4 @@ Error generating stack: `+d.message+` * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const V0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],B0=An("X",V0);function wh(r){var n,i,l="";if(typeof r=="string"||typeof r=="number")l+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(n=0;n{const n=W0(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=r;return{getClassGroupId:f=>{const p=f.split(Tu);return p[0]===""&&p.length!==1&&p.shift(),_h(p,n)||H0(f)},getConflictingClassGroupIds:(f,p)=>{const g=i[f]||[];return p&&l[f]?[...g,...l[f]]:g}}},_h=(r,n)=>{var f;if(r.length===0)return n.classGroupId;const i=r[0],l=n.nextPart.get(i),a=l?_h(r.slice(1),l):void 0;if(a)return a;if(n.validators.length===0)return;const c=r.join(Tu);return(f=n.validators.find(({validator:p})=>p(c)))==null?void 0:f.classGroupId},yp=/^\[(.+)\]$/,H0=r=>{if(yp.test(r)){const n=yp.exec(r)[1],i=n==null?void 0:n.substring(0,n.indexOf(":"));if(i)return"arbitrary.."+i}},W0=r=>{const{theme:n,prefix:i}=r,l={nextPart:new Map,validators:[]};return q0(Object.entries(r.classGroups),i).forEach(([c,f])=>{mu(f,l,c,n)}),l},mu=(r,n,i,l)=>{r.forEach(a=>{if(typeof a=="string"){const c=a===""?n:gp(n,a);c.classGroupId=i;return}if(typeof a=="function"){if(Z0(a)){mu(a(l),n,i,l);return}n.validators.push({validator:a,classGroupId:i});return}Object.entries(a).forEach(([c,f])=>{mu(f,gp(n,c),i,l)})})},gp=(r,n)=>{let i=r;return n.split(Tu).forEach(l=>{i.nextPart.has(l)||i.nextPart.set(l,{nextPart:new Map,validators:[]}),i=i.nextPart.get(l)}),i},Z0=r=>r.isThemeGetter,q0=(r,n)=>n?r.map(([i,l])=>{const a=l.map(c=>typeof c=="string"?n+c:typeof c=="object"?Object.fromEntries(Object.entries(c).map(([f,p])=>[n+f,p])):c);return[i,a]}):r,Q0=r=>{if(r<1)return{get:()=>{},set:()=>{}};let n=0,i=new Map,l=new Map;const a=(c,f)=>{i.set(c,f),n++,n>r&&(n=0,l=i,i=new Map)};return{get(c){let f=i.get(c);if(f!==void 0)return f;if((f=l.get(c))!==void 0)return a(c,f),f},set(c,f){i.has(c)?i.set(c,f):a(c,f)}}},kh="!",K0=r=>{const{separator:n,experimentalParseClassName:i}=r,l=n.length===1,a=n[0],c=n.length,f=p=>{const g=[];let y=0,x=0,S;for(let A=0;Ax?S-x:void 0;return{modifiers:g,hasImportantModifier:q,baseClassName:L,maybePostfixModifierPosition:b}};return i?p=>i({className:p,parseClassName:f}):f},G0=r=>{if(r.length<=1)return r;const n=[];let i=[];return r.forEach(l=>{l[0]==="["?(n.push(...i.sort(),l),i=[]):i.push(l)}),n.push(...i.sort()),n},Y0=r=>({cache:Q0(r.cacheSize),parseClassName:K0(r),...$0(r)}),J0=/\s+/,X0=(r,n)=>{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:a}=n,c=[],f=r.trim().split(J0);let p="";for(let g=f.length-1;g>=0;g-=1){const y=f[g],{modifiers:x,hasImportantModifier:S,baseClassName:T,maybePostfixModifierPosition:q}=i(y);let L=!!q,b=l(L?T.substring(0,q):T);if(!b){if(!L){p=y+(p.length>0?" "+p:p);continue}if(b=l(T),!b){p=y+(p.length>0?" "+p:p);continue}L=!1}const A=G0(x).join(":"),Q=S?A+kh:A,M=Q+b;if(c.includes(M))continue;c.push(M);const ae=a(b,L);for(let ue=0;ue0?" "+p:p)}return p};function e1(){let r=0,n,i,l="";for(;r{if(typeof r=="string")return r;let n,i="";for(let l=0;lS(x),r());return i=Y0(y),l=i.cache.get,a=i.cache.set,c=p,p(g)}function p(g){const y=l(g);if(y)return y;const x=X0(g,i);return a(g,x),x}return function(){return c(e1.apply(null,arguments))}}const Ge=r=>{const n=i=>i[r]||[];return n.isThemeGetter=!0,n},Eh=/^\[(?:([a-z-]+):)?(.+)\]$/i,n1=/^\d+\/\d+$/,r1=new Set(["px","full","screen"]),s1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,o1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,l1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bn=r=>ss(r)||r1.has(r)||n1.test(r),Jn=r=>fs(r,"length",y1),ss=r=>!!r&&!Number.isNaN(Number(r)),tu=r=>fs(r,"number",ss),ri=r=>!!r&&Number.isInteger(Number(r)),u1=r=>r.endsWith("%")&&ss(r.slice(0,-1)),Se=r=>Eh.test(r),Xn=r=>s1.test(r),c1=new Set(["length","size","percentage"]),d1=r=>fs(r,c1,Ch),f1=r=>fs(r,"position",Ch),p1=new Set(["image","url"]),h1=r=>fs(r,p1,v1),m1=r=>fs(r,"",g1),si=()=>!0,fs=(r,n,i)=>{const l=Eh.exec(r);return l?l[1]?typeof n=="string"?l[1]===n:n.has(l[1]):i(l[2]):!1},y1=r=>i1.test(r)&&!o1.test(r),Ch=()=>!1,g1=r=>l1.test(r),v1=r=>a1.test(r),w1=()=>{const r=Ge("colors"),n=Ge("spacing"),i=Ge("blur"),l=Ge("brightness"),a=Ge("borderColor"),c=Ge("borderRadius"),f=Ge("borderSpacing"),p=Ge("borderWidth"),g=Ge("contrast"),y=Ge("grayscale"),x=Ge("hueRotate"),S=Ge("invert"),T=Ge("gap"),q=Ge("gradientColorStops"),L=Ge("gradientColorStopPositions"),b=Ge("inset"),A=Ge("margin"),Q=Ge("opacity"),M=Ge("padding"),ae=Ge("saturate"),ue=Ge("scale"),oe=Ge("sepia"),pe=Ge("skew"),he=Ge("space"),Ae=Ge("translate"),Re=()=>["auto","contain","none"],Pe=()=>["auto","hidden","clip","visible","scroll"],Ve=()=>["auto",Se,n],Z=()=>[Se,n],ce=()=>["",bn,Jn],ye=()=>["auto",ss,Se],be=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],we=()=>["solid","dashed","dotted","double","none"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Se],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[ss,Se];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[bn,Jn],blur:["none","",Xn,Se],brightness:k(),borderColor:[r],borderRadius:["none","","full",Xn,Se],borderSpacing:Z(),borderWidth:ce(),contrast:k(),grayscale:G(),hueRotate:k(),invert:G(),gap:Z(),gradientColorStops:[r],gradientColorStopPositions:[u1,Jn],inset:Ve(),margin:Ve(),opacity:k(),padding:Z(),saturate:k(),scale:k(),sepia:G(),skew:k(),space:Z(),translate:Z()},classGroups:{aspect:[{aspect:["auto","square","video",Se]}],container:["container"],columns:[{columns:[Xn]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...be(),Se]}],overflow:[{overflow:Pe()}],"overflow-x":[{"overflow-x":Pe()}],"overflow-y":[{"overflow-y":Pe()}],overscroll:[{overscroll:Re()}],"overscroll-x":[{"overscroll-x":Re()}],"overscroll-y":[{"overscroll-y":Re()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ri,Se]}],basis:[{basis:Ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Se]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",ri,Se]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ri,Se]},Se]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ri,Se]},Se]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Se]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[A]}],mx:[{mx:[A]}],my:[{my:[A]}],ms:[{ms:[A]}],me:[{me:[A]}],mt:[{mt:[A]}],mr:[{mr:[A]}],mb:[{mb:[A]}],ml:[{ml:[A]}],"space-x":[{"space-x":[he]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[he]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Se,n]}],"min-w":[{"min-w":[Se,n,"min","max","fit"]}],"max-w":[{"max-w":[Se,n,"none","full","min","max","fit","prose",{screen:[Xn]},Xn]}],h:[{h:[Se,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Se,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Se,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Se,n,"auto","min","max","fit"]}],"font-size":[{text:["base",Xn,Jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tu]}],"font-family":[{font:[si]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Se]}],"line-clamp":[{"line-clamp":["none",ss,tu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bn,Se]}],"list-image":[{"list-image":["none",Se]}],"list-style-type":[{list:["none","disc","decimal",Se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[Q]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bn,Jn]}],"underline-offset":[{"underline-offset":["auto",bn,Se]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[Q]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...be(),f1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",d1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},h1]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[L]}],"gradient-via-pos":[{via:[L]}],"gradient-to-pos":[{to:[L]}],"gradient-from":[{from:[q]}],"gradient-via":[{via:[q]}],"gradient-to":[{to:[q]}],rounded:[{rounded:[c]}],"rounded-s":[{"rounded-s":[c]}],"rounded-e":[{"rounded-e":[c]}],"rounded-t":[{"rounded-t":[c]}],"rounded-r":[{"rounded-r":[c]}],"rounded-b":[{"rounded-b":[c]}],"rounded-l":[{"rounded-l":[c]}],"rounded-ss":[{"rounded-ss":[c]}],"rounded-se":[{"rounded-se":[c]}],"rounded-ee":[{"rounded-ee":[c]}],"rounded-es":[{"rounded-es":[c]}],"rounded-tl":[{"rounded-tl":[c]}],"rounded-tr":[{"rounded-tr":[c]}],"rounded-br":[{"rounded-br":[c]}],"rounded-bl":[{"rounded-bl":[c]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[Q]}],"border-style":[{border:[...we(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Q]}],"divide-style":[{divide:we()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...we()]}],"outline-offset":[{"outline-offset":[bn,Se]}],"outline-w":[{outline:[bn,Jn]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[Q]}],"ring-offset-w":[{"ring-offset":[bn,Jn]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",Xn,m1]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[Q]}],"mix-blend":[{"mix-blend":[...ge(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ge()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[l]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",Xn,Se]}],grayscale:[{grayscale:[y]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[S]}],saturate:[{saturate:[ae]}],sepia:[{sepia:[oe]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[l]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[Q]}],"backdrop-saturate":[{"backdrop-saturate":[ae]}],"backdrop-sepia":[{"backdrop-sepia":[oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Se]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",Se]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",Se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[ue]}],"scale-x":[{"scale-x":[ue]}],"scale-y":[{"scale-y":[ue]}],rotate:[{rotate:[ri,Se]}],"translate-x":[{"translate-x":[Ae]}],"translate-y":[{"translate-y":[Ae]}],"skew-x":[{"skew-x":[pe]}],"skew-y":[{"skew-y":[pe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Se]}],accent:[{accent:["auto",r]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[bn,Jn,tu]}],stroke:[{stroke:[r,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},x1=t1(w1);function Nh(...r){return x1(xh(r))}const Rh=He.forwardRef(({className:r,type:n,value:i,onChange:l,...a},c)=>$.jsxs("div",{className:"relative",children:[$.jsx("input",{type:n,className:Nh("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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 md:text-sm",r),ref:c,value:i,onChange:l,...a}),i&&$.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-300 hover:text-white p-1 rounded-md hover:bg-slate-600 transition-colors",style:{backgroundColor:"rgba(38, 50, 70, 1)"},onClick:()=>l==null?void 0:l({target:{value:""}}),children:$.jsx(B0,{className:"h-5 w-5",style:{color:"white"}})})]}));Rh.displayName="Input";function vp(r,n){if(typeof r=="function")return r(n);r!=null&&(r.current=n)}function _1(...r){return n=>{let i=!1;const l=r.map(a=>{const c=vp(a,n);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let a=0;a{const{children:i,...l}=r,a=He.Children.toArray(i),c=a.find(S1);if(c){const f=c.props.children,p=a.map(g=>g===c?He.Children.count(f)>1?He.Children.only(null):He.isValidElement(f)?f.props.children:null:g);return $.jsx(yu,{...l,ref:n,children:He.isValidElement(f)?He.cloneElement(f,void 0,p):null})}return $.jsx(yu,{...l,ref:n,children:i})});bh.displayName="Slot";var yu=He.forwardRef((r,n)=>{const{children:i,...l}=r;if(He.isValidElement(i)){const a=C1(i);return He.cloneElement(i,{...E1(l,i.props),ref:n?_1(n,a):a})}return He.Children.count(i)>1?He.Children.only(null):null});yu.displayName="SlotClone";var k1=({children:r})=>$.jsx($.Fragment,{children:r});function S1(r){return He.isValidElement(r)&&r.type===k1}function E1(r,n){const i={...n};for(const l in n){const a=r[l],c=n[l];/^on[A-Z]/.test(l)?a&&c?i[l]=(...p)=>{c(...p),a(...p)}:a&&(i[l]=a):l==="style"?i[l]={...a,...c}:l==="className"&&(i[l]=[a,c].filter(Boolean).join(" "))}return{...r,...i}}function C1(r){var l,a;let n=(l=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?r.ref:(n=(a=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}const wp=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,xp=xh,N1=(r,n)=>i=>{var l;if((n==null?void 0:n.variants)==null)return xp(r,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:a,defaultVariants:c}=n,f=Object.keys(a).map(y=>{const x=i==null?void 0:i[y],S=c==null?void 0:c[y];if(x===null)return null;const T=wp(x)||wp(S);return a[y][T]}),p=i&&Object.entries(i).reduce((y,x)=>{let[S,T]=x;return T===void 0||(y[S]=T),y},{}),g=n==null||(l=n.compoundVariants)===null||l===void 0?void 0:l.reduce((y,x)=>{let{class:S,className:T,...q}=x;return Object.entries(q).every(L=>{let[b,A]=L;return Array.isArray(A)?A.includes({...c,...p}[b]):{...c,...p}[b]===A})?[...y,S,T]:y},[]);return xp(r,f,g,i==null?void 0:i.class,i==null?void 0:i.className)},R1=N1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),gu=He.forwardRef(({className:r,variant:n,size:i,asChild:l=!1,...a},c)=>{const f=l?bh:"button";return $.jsx(f,{className:Nh(R1({variant:n,size:i,className:r})),ref:c,...a})});gu.displayName="Button";const b1="#FFDD00",T1=He.forwardRef(function({title:n="Buy Me A Coffee",color:i="currentColor",size:l=24,...a},c){return i==="default"&&(i=b1),$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,fill:i,viewBox:"0 0 24 24",ref:c,...a,children:[$.jsx("title",{children:n}),$.jsx("path",{d:"M20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379-.197-.069-.42-.098-.57-.241-.152-.143-.196-.366-.231-.572-.065-.378-.125-.756-.192-1.133-.057-.325-.102-.69-.25-.987-.195-.4-.597-.634-.996-.788a5.723 5.723 0 00-.626-.194c-1-.263-2.05-.36-3.077-.416a25.834 25.834 0 00-3.7.062c-.915.083-1.88.184-2.75.5-.318.116-.646.256-.888.501-.297.302-.393.77-.177 1.146.154.267.415.456.692.58.36.162.737.284 1.123.366 1.075.238 2.189.331 3.287.37 1.218.05 2.437.01 3.65-.118.299-.033.598-.073.896-.119.352-.054.578-.513.474-.834-.124-.383-.457-.531-.834-.473-.466.074-.96.108-1.382.146-1.177.08-2.358.082-3.536.006a22.228 22.228 0 01-1.157-.107c-.086-.01-.18-.025-.258-.036-.243-.036-.484-.08-.724-.13-.111-.027-.111-.185 0-.212h.005c.277-.06.557-.108.838-.147h.002c.131-.009.263-.032.394-.048a25.076 25.076 0 013.426-.12c.674.019 1.347.067 2.017.144l.228.031c.267.04.533.088.798.145.392.085.895.113 1.07.542.055.137.08.288.111.431l.319 1.484a.237.237 0 01-.199.284h-.003c-.037.006-.075.01-.112.015a36.704 36.704 0 01-4.743.295 37.059 37.059 0 01-4.699-.304c-.14-.017-.293-.042-.417-.06-.326-.048-.649-.108-.973-.161-.393-.065-.768-.032-1.123.161-.29.16-.527.404-.675.701-.154.316-.199.66-.267 1-.069.34-.176.707-.135 1.056.087.753.613 1.365 1.37 1.502a39.69 39.69 0 0011.343.376.483.483 0 01.535.53l-.071.697-1.018 9.907c-.041.41-.047.832-.125 1.237-.122.637-.553 1.028-1.182 1.171-.577.131-1.165.2-1.756.205-.656.004-1.31-.025-1.966-.022-.699.004-1.556-.06-2.095-.58-.475-.458-.54-1.174-.605-1.793l-.731-7.013-.322-3.094c-.037-.351-.286-.695-.678-.678-.336.015-.718.3-.678.679l.228 2.185.949 9.112c.147 1.344 1.174 2.068 2.446 2.272.742.12 1.503.144 2.257.156.966.016 1.942.053 2.892-.122 1.408-.258 2.465-1.198 2.616-2.657.34-3.332.683-6.663 1.024-9.995l.215-2.087a.484.484 0 01.39-.426c.402-.078.787-.212 1.074-.518.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233-2.416.359-4.866.54-7.308.46-1.748-.06-3.477-.254-5.207-.498-.17-.024-.353-.055-.47-.18-.22-.236-.111-.71-.054-.995.052-.26.152-.609.463-.646.484-.057 1.046.148 1.526.22.577.088 1.156.159 1.737.212 2.48.226 5.002.19 7.472-.14.45-.06.899-.13 1.345-.21.399-.072.84-.206 1.08.206.166.281.188.657.162.974a.544.544 0 01-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a5.884 5.884 0 01-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38 0 0 1.243.065 1.658.065.447 0 1.786-.065 1.786-.065.783 0 1.434-.6 1.499-1.38l.94-9.95a3.996 3.996 0 00-1.322-.238c-.826 0-1.491.284-2.26.613z"})]})}),A1=o0({url:i0().min(1,"URL is required").url("Please enter a valid URL").refine(r=>{try{const n=new URL(r);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}},"URL must start with http:// or https://")}),O1="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789+*-",_p="127.0.0.1:5000",kp="http://127.0.0.1:5000",P1=new Uint8Array([116,110,121,114,46,109,101,95,108,111,111,107,117,112,95,115]),L1=(r,n=O1)=>{const i=new Uint8Array(r);return crypto.getRandomValues(i),Array.from(i,l=>n[l%n.length]).join("")},Th=r=>{const n=new Uint8Array(r);return crypto.getRandomValues(n),n},Sp=r=>{const n=new TextEncoder;return gh(n.encode(r),P1,{N:2**17,r:8,p:1,dkLen:32})},Ep=(r,n)=>{const i=new TextEncoder;return gh(i.encode(r),n,{N:2**17,r:8,p:1,dkLen:32})},j1=async(r,n)=>{const i=Th(16),a=new TextEncoder().encode(n),c=await crypto.subtle.importKey("raw",r,{name:"AES-CBC"},!1,["encrypt"]),f=await crypto.subtle.encrypt({name:"AES-CBC",iv:i},c,a);return{iv:i,encrypted:new Uint8Array(f)}},F1=async(r,n,i)=>{const l=await crypto.subtle.importKey("raw",r,{name:"AES-CBC"},!1,["decrypt"]),a=await crypto.subtle.decrypt({name:"AES-CBC",iv:n},l,i);return new TextDecoder().decode(a)},ii=r=>Array.from(r,n=>n.toString(16).padStart(2,"0")).join(""),nu=r=>new Uint8Array(r.match(/.{1,2}/g).map(n=>parseInt(n,16)));function I1(){const[r,n]=He.useState(""),[i,l]=He.useState(!1),[a,c]=He.useState(!1);He.useEffect(()=>{(async()=>{const L=window.location.hash.slice(1);if(L&&L.length===10){c(!0);try{await new Promise(Pe=>setTimeout(Pe,20));const b=Sp(L),A=ii(b),Q=await it.get(`${kp}/get-encrypted-url?lookup_hash=${A}`),{ENCRYTION_SALT:M,IV:ae,ENCRYPTED_URL:ue}=Q.data,oe=nu(M);await new Promise(Pe=>setTimeout(Pe,15));const pe=Ep(L,oe),he=nu(ae),Ae=nu(ue),Re=await F1(pe,he,Ae);window.location.href=Re}catch(b){console.error("Failed to decrypt URL:",b),c(!1)}}})()},[]);const{register:f,handleSubmit:p,formState:{errors:g},setError:y,clearErrors:x}=bv({resolver:Pv(A1),mode:"onChange"}),S=async q=>{l(!0),x();try{await new Promise(he=>setTimeout(he,20));const L=L1(10),b=Th(16),A=Sp(L);await new Promise(he=>setTimeout(he,15));const Q=Ep(L,b);let M=q.url;!M.startsWith("https://")&&!M.startsWith("http://")&&!M.startsWith("magnet:")&&(M="http://"+M);const{iv:ae,encrypted:ue}=await j1(Q,M);await it.post(`${kp}/shorten`,{LOOKUP_HASH:ii(A),ENCRYTION_SALT:ii(b),IV:ii(ae),ENCRYPTED_URL:ii(ue)});const pe=`${typeof window<"u"&&window.location?window.location.protocol:"https:"}//${_p}/#${L}`;n(pe)}catch(L){console.error("Encryption error:",L),y("root",{message:"Error shortening URL. Please try again."})}finally{l(!1)}},T=()=>{navigator.clipboard.writeText(r)};return a?$.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 to-slate-800 text-slate-100 flex flex-col items-center justify-center p-4",children:$.jsxs("div",{className:"text-center space-y-8",children:[$.jsx("div",{className:"flex justify-center",children:$.jsxs("div",{className:"relative",children:[$.jsx(z0,{className:"w-16 h-16 text-indigo-400 animate-spin"}),$.jsx("div",{className:"absolute inset-0 w-16 h-16 border-4 border-indigo-400/20 rounded-full"})]})}),$.jsxs("div",{className:"space-y-4",children:[$.jsx("h1",{className:"text-3xl font-bold",children:"Decrypting URL"}),$.jsx("p",{className:"text-slate-400 text-lg max-w-md",children:"Computing hashes and securely retrieving your destination..."})]}),$.jsxs("div",{className:"flex items-center justify-center gap-2 text-slate-500",children:[$.jsx(eu,{className:"w-4 h-4"}),$.jsx("span",{className:"text-sm",children:"End-to-end encrypted"})]})]})}):$.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 to-slate-800 text-slate-100 flex flex-col items-center justify-center p-4",children:[$.jsxs("div",{className:"w-full max-w-2xl space-y-8",children:[$.jsxs("div",{className:"text-center",children:[$.jsx("h1",{className:"text-4xl font-bold mb-4",children:"tnyr.me"}),$.jsx("p",{className:"text-slate-400 text-lg",children:"Privacy-focused URL shortener with seamless encryption"})]}),$.jsxs("div",{className:"bg-slate-800/50 backdrop-blur-sm rounded-xl p-6 shadow-xl",children:[$.jsx("div",{className:"flex flex-col space-y-4 mb-6 text-slate-300",children:$.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[$.jsx(eu,{className:"w-5 h-5"}),$.jsx("p",{className:"text-center",children:"Your links are end-to-end encrypted - your original URL never leaves your browser unencrypted."})]})}),$.jsxs("form",{onSubmit:p(S),className:"flex flex-col space-y-4",children:[$.jsx(Rh,{type:"text",...f("url"),placeholder:"Enter your long URL here",className:"bg-slate-700/50 border-slate-600 text-lg h-14 rounded-xl"}),g.url&&$.jsx("p",{className:"text-red-400 text-sm",children:g.url.message}),g.root&&$.jsx("p",{className:"text-red-400 text-sm",children:g.root.message}),$.jsx(gu,{type:"submit",disabled:i,className:"h-12 text-lg rounded-xl bg-indigo-600 hover:bg-indigo-700 transition-colors",children:i?"Shortening...":"Create Secure Link"})]}),r&&$.jsxs("div",{className:"mt-6 p-4 bg-slate-700/30 rounded-lg flex items-center justify-between",children:[$.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 break-all",children:r.replace(/^https?:\/\//,"")}),$.jsx(gu,{variant:"ghost",size:"sm",onClick:T,className:"text-slate-400 hover:bg-slate-600/50",children:$.jsx(R0,{className:"w-4 h-4"})})]})]})]}),$.jsx("div",{className:"w-full max-w-3xl mt-12 mb-8",children:$.jsxs("div",{className:"bg-slate-800/50 backdrop-blur-sm rounded-xl p-6 shadow-xl border border-slate-700/30",children:[$.jsxs("h2",{className:"text-2xl font-semibold mb-6 flex items-center gap-2",children:[$.jsx(eu,{className:"w-6 h-6 text-indigo-400"}),"How We Protect Your Privacy"]}),$.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[$.jsxs("div",{className:"space-y-4",children:[$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(U0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"End-to-End Encryption"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"Your URL is encrypted in your browser and never sent to our servers in plaintext. Using AES-256 encryption, only you and those you share the link with can see the destination."})]})]}),$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(L0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"Complete Anonymity"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"There's no way to discover or list existing links. Each URL exists only for those who possess the unique ID."})]})]})]}),$.jsxs("div",{className:"space-y-4",children:[$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(F0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"Secure By Design"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"We derive two separate keys from your link ID. One is used to create a lookup hash, so we can find your encrypted data. The other is used to encrypt your destination URL. Without the original link ID, the data is just random noise."})]})]}),$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(T0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"Security Process"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"We never log IP addresses, track users, or use cookies. Your browsing activity leaves no trace in our systems."})]})]})]})]}),$.jsx("div",{className:"mt-6 p-4 bg-slate-700/30 rounded-lg border border-slate-700/50",children:$.jsxs("p",{className:"text-sm text-slate-400",children:["🔒 ",$.jsx("span",{className:"font-medium",children:"Important:"})," Make sure to Bookmark your ",_p," links safely - there's no way to recover lost IDs or access links without them."]})})]})}),$.jsxs("footer",{className:"bottom-4 flex items-center gap-3 text-slate-400",children:[$.jsx("a",{href:"https://github.com/Sevi-py/tnyr.me",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-300 transition-colors",children:$.jsx(O0,{className:"w-8 h-8"})}),$.jsx("a",{href:"https://www.buymeacoffee.com/severin.hilbert",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-300 transition-colors",children:$.jsx(T1,{className:"w-8 h-8"})})]})]})}Py.createRoot(document.getElementById("root")).render($.jsx(He.StrictMode,{children:$.jsx(I1,{})})); + */const V0=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],B0=An("X",V0);function wh(r){var n,i,l="";if(typeof r=="string"||typeof r=="number")l+=r;else if(typeof r=="object")if(Array.isArray(r)){var a=r.length;for(n=0;n{const n=W0(r),{conflictingClassGroups:i,conflictingClassGroupModifiers:l}=r;return{getClassGroupId:f=>{const p=f.split(Tu);return p[0]===""&&p.length!==1&&p.shift(),_h(p,n)||H0(f)},getConflictingClassGroupIds:(f,p)=>{const g=i[f]||[];return p&&l[f]?[...g,...l[f]]:g}}},_h=(r,n)=>{var f;if(r.length===0)return n.classGroupId;const i=r[0],l=n.nextPart.get(i),a=l?_h(r.slice(1),l):void 0;if(a)return a;if(n.validators.length===0)return;const c=r.join(Tu);return(f=n.validators.find(({validator:p})=>p(c)))==null?void 0:f.classGroupId},yp=/^\[(.+)\]$/,H0=r=>{if(yp.test(r)){const n=yp.exec(r)[1],i=n==null?void 0:n.substring(0,n.indexOf(":"));if(i)return"arbitrary.."+i}},W0=r=>{const{theme:n,prefix:i}=r,l={nextPart:new Map,validators:[]};return q0(Object.entries(r.classGroups),i).forEach(([c,f])=>{mu(f,l,c,n)}),l},mu=(r,n,i,l)=>{r.forEach(a=>{if(typeof a=="string"){const c=a===""?n:gp(n,a);c.classGroupId=i;return}if(typeof a=="function"){if(Z0(a)){mu(a(l),n,i,l);return}n.validators.push({validator:a,classGroupId:i});return}Object.entries(a).forEach(([c,f])=>{mu(f,gp(n,c),i,l)})})},gp=(r,n)=>{let i=r;return n.split(Tu).forEach(l=>{i.nextPart.has(l)||i.nextPart.set(l,{nextPart:new Map,validators:[]}),i=i.nextPart.get(l)}),i},Z0=r=>r.isThemeGetter,q0=(r,n)=>n?r.map(([i,l])=>{const a=l.map(c=>typeof c=="string"?n+c:typeof c=="object"?Object.fromEntries(Object.entries(c).map(([f,p])=>[n+f,p])):c);return[i,a]}):r,Q0=r=>{if(r<1)return{get:()=>{},set:()=>{}};let n=0,i=new Map,l=new Map;const a=(c,f)=>{i.set(c,f),n++,n>r&&(n=0,l=i,i=new Map)};return{get(c){let f=i.get(c);if(f!==void 0)return f;if((f=l.get(c))!==void 0)return a(c,f),f},set(c,f){i.has(c)?i.set(c,f):a(c,f)}}},kh="!",K0=r=>{const{separator:n,experimentalParseClassName:i}=r,l=n.length===1,a=n[0],c=n.length,f=p=>{const g=[];let y=0,x=0,S;for(let A=0;Ax?S-x:void 0;return{modifiers:g,hasImportantModifier:q,baseClassName:L,maybePostfixModifierPosition:b}};return i?p=>i({className:p,parseClassName:f}):f},G0=r=>{if(r.length<=1)return r;const n=[];let i=[];return r.forEach(l=>{l[0]==="["?(n.push(...i.sort(),l),i=[]):i.push(l)}),n.push(...i.sort()),n},Y0=r=>({cache:Q0(r.cacheSize),parseClassName:K0(r),...$0(r)}),J0=/\s+/,X0=(r,n)=>{const{parseClassName:i,getClassGroupId:l,getConflictingClassGroupIds:a}=n,c=[],f=r.trim().split(J0);let p="";for(let g=f.length-1;g>=0;g-=1){const y=f[g],{modifiers:x,hasImportantModifier:S,baseClassName:T,maybePostfixModifierPosition:q}=i(y);let L=!!q,b=l(L?T.substring(0,q):T);if(!b){if(!L){p=y+(p.length>0?" "+p:p);continue}if(b=l(T),!b){p=y+(p.length>0?" "+p:p);continue}L=!1}const A=G0(x).join(":"),Q=S?A+kh:A,M=Q+b;if(c.includes(M))continue;c.push(M);const ae=a(b,L);for(let ue=0;ue0?" "+p:p)}return p};function e1(){let r=0,n,i,l="";for(;r{if(typeof r=="string")return r;let n,i="";for(let l=0;lS(x),r());return i=Y0(y),l=i.cache.get,a=i.cache.set,c=p,p(g)}function p(g){const y=l(g);if(y)return y;const x=X0(g,i);return a(g,x),x}return function(){return c(e1.apply(null,arguments))}}const Ge=r=>{const n=i=>i[r]||[];return n.isThemeGetter=!0,n},Eh=/^\[(?:([a-z-]+):)?(.+)\]$/i,n1=/^\d+\/\d+$/,r1=new Set(["px","full","screen"]),s1=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,i1=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,o1=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,l1=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,a1=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,bn=r=>ss(r)||r1.has(r)||n1.test(r),Jn=r=>fs(r,"length",y1),ss=r=>!!r&&!Number.isNaN(Number(r)),tu=r=>fs(r,"number",ss),ri=r=>!!r&&Number.isInteger(Number(r)),u1=r=>r.endsWith("%")&&ss(r.slice(0,-1)),Se=r=>Eh.test(r),Xn=r=>s1.test(r),c1=new Set(["length","size","percentage"]),d1=r=>fs(r,c1,Ch),f1=r=>fs(r,"position",Ch),p1=new Set(["image","url"]),h1=r=>fs(r,p1,v1),m1=r=>fs(r,"",g1),si=()=>!0,fs=(r,n,i)=>{const l=Eh.exec(r);return l?l[1]?typeof n=="string"?l[1]===n:n.has(l[1]):i(l[2]):!1},y1=r=>i1.test(r)&&!o1.test(r),Ch=()=>!1,g1=r=>l1.test(r),v1=r=>a1.test(r),w1=()=>{const r=Ge("colors"),n=Ge("spacing"),i=Ge("blur"),l=Ge("brightness"),a=Ge("borderColor"),c=Ge("borderRadius"),f=Ge("borderSpacing"),p=Ge("borderWidth"),g=Ge("contrast"),y=Ge("grayscale"),x=Ge("hueRotate"),S=Ge("invert"),T=Ge("gap"),q=Ge("gradientColorStops"),L=Ge("gradientColorStopPositions"),b=Ge("inset"),A=Ge("margin"),Q=Ge("opacity"),M=Ge("padding"),ae=Ge("saturate"),ue=Ge("scale"),oe=Ge("sepia"),pe=Ge("skew"),he=Ge("space"),Ae=Ge("translate"),Re=()=>["auto","contain","none"],Pe=()=>["auto","hidden","clip","visible","scroll"],Ve=()=>["auto",Se,n],Z=()=>[Se,n],ce=()=>["",bn,Jn],ye=()=>["auto",ss,Se],be=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],we=()=>["solid","dashed","dotted","double","none"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],G=()=>["","0",Se],H=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>[ss,Se];return{cacheSize:500,separator:":",theme:{colors:[si],spacing:[bn,Jn],blur:["none","",Xn,Se],brightness:k(),borderColor:[r],borderRadius:["none","","full",Xn,Se],borderSpacing:Z(),borderWidth:ce(),contrast:k(),grayscale:G(),hueRotate:k(),invert:G(),gap:Z(),gradientColorStops:[r],gradientColorStopPositions:[u1,Jn],inset:Ve(),margin:Ve(),opacity:k(),padding:Z(),saturate:k(),scale:k(),sepia:G(),skew:k(),space:Z(),translate:Z()},classGroups:{aspect:[{aspect:["auto","square","video",Se]}],container:["container"],columns:[{columns:[Xn]}],"break-after":[{"break-after":H()}],"break-before":[{"break-before":H()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...be(),Se]}],overflow:[{overflow:Pe()}],"overflow-x":[{"overflow-x":Pe()}],"overflow-y":[{"overflow-y":Pe()}],overscroll:[{overscroll:Re()}],"overscroll-x":[{"overscroll-x":Re()}],"overscroll-y":[{"overscroll-y":Re()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[b]}],"inset-x":[{"inset-x":[b]}],"inset-y":[{"inset-y":[b]}],start:[{start:[b]}],end:[{end:[b]}],top:[{top:[b]}],right:[{right:[b]}],bottom:[{bottom:[b]}],left:[{left:[b]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ri,Se]}],basis:[{basis:Ve()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Se]}],grow:[{grow:G()}],shrink:[{shrink:G()}],order:[{order:["first","last","none",ri,Se]}],"grid-cols":[{"grid-cols":[si]}],"col-start-end":[{col:["auto",{span:["full",ri,Se]},Se]}],"col-start":[{"col-start":ye()}],"col-end":[{"col-end":ye()}],"grid-rows":[{"grid-rows":[si]}],"row-start-end":[{row:["auto",{span:[ri,Se]},Se]}],"row-start":[{"row-start":ye()}],"row-end":[{"row-end":ye()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Se]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Se]}],gap:[{gap:[T]}],"gap-x":[{"gap-x":[T]}],"gap-y":[{"gap-y":[T]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[A]}],mx:[{mx:[A]}],my:[{my:[A]}],ms:[{ms:[A]}],me:[{me:[A]}],mt:[{mt:[A]}],mr:[{mr:[A]}],mb:[{mb:[A]}],ml:[{ml:[A]}],"space-x":[{"space-x":[he]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[he]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Se,n]}],"min-w":[{"min-w":[Se,n,"min","max","fit"]}],"max-w":[{"max-w":[Se,n,"none","full","min","max","fit","prose",{screen:[Xn]},Xn]}],h:[{h:[Se,n,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Se,n,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Se,n,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Se,n,"auto","min","max","fit"]}],"font-size":[{text:["base",Xn,Jn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",tu]}],"font-family":[{font:[si]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Se]}],"line-clamp":[{"line-clamp":["none",ss,tu]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",bn,Se]}],"list-image":[{"list-image":["none",Se]}],"list-style-type":[{list:["none","disc","decimal",Se]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[r]}],"placeholder-opacity":[{"placeholder-opacity":[Q]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[r]}],"text-opacity":[{"text-opacity":[Q]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",bn,Jn]}],"underline-offset":[{"underline-offset":["auto",bn,Se]}],"text-decoration-color":[{decoration:[r]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:Z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Se]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Se]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[Q]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...be(),f1]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",d1]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},h1]}],"bg-color":[{bg:[r]}],"gradient-from-pos":[{from:[L]}],"gradient-via-pos":[{via:[L]}],"gradient-to-pos":[{to:[L]}],"gradient-from":[{from:[q]}],"gradient-via":[{via:[q]}],"gradient-to":[{to:[q]}],rounded:[{rounded:[c]}],"rounded-s":[{"rounded-s":[c]}],"rounded-e":[{"rounded-e":[c]}],"rounded-t":[{"rounded-t":[c]}],"rounded-r":[{"rounded-r":[c]}],"rounded-b":[{"rounded-b":[c]}],"rounded-l":[{"rounded-l":[c]}],"rounded-ss":[{"rounded-ss":[c]}],"rounded-se":[{"rounded-se":[c]}],"rounded-ee":[{"rounded-ee":[c]}],"rounded-es":[{"rounded-es":[c]}],"rounded-tl":[{"rounded-tl":[c]}],"rounded-tr":[{"rounded-tr":[c]}],"rounded-br":[{"rounded-br":[c]}],"rounded-bl":[{"rounded-bl":[c]}],"border-w":[{border:[p]}],"border-w-x":[{"border-x":[p]}],"border-w-y":[{"border-y":[p]}],"border-w-s":[{"border-s":[p]}],"border-w-e":[{"border-e":[p]}],"border-w-t":[{"border-t":[p]}],"border-w-r":[{"border-r":[p]}],"border-w-b":[{"border-b":[p]}],"border-w-l":[{"border-l":[p]}],"border-opacity":[{"border-opacity":[Q]}],"border-style":[{border:[...we(),"hidden"]}],"divide-x":[{"divide-x":[p]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[p]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[Q]}],"divide-style":[{divide:we()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...we()]}],"outline-offset":[{"outline-offset":[bn,Se]}],"outline-w":[{outline:[bn,Jn]}],"outline-color":[{outline:[r]}],"ring-w":[{ring:ce()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[r]}],"ring-opacity":[{"ring-opacity":[Q]}],"ring-offset-w":[{"ring-offset":[bn,Jn]}],"ring-offset-color":[{"ring-offset":[r]}],shadow:[{shadow:["","inner","none",Xn,m1]}],"shadow-color":[{shadow:[si]}],opacity:[{opacity:[Q]}],"mix-blend":[{"mix-blend":[...ge(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":ge()}],filter:[{filter:["","none"]}],blur:[{blur:[i]}],brightness:[{brightness:[l]}],contrast:[{contrast:[g]}],"drop-shadow":[{"drop-shadow":["","none",Xn,Se]}],grayscale:[{grayscale:[y]}],"hue-rotate":[{"hue-rotate":[x]}],invert:[{invert:[S]}],saturate:[{saturate:[ae]}],sepia:[{sepia:[oe]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[i]}],"backdrop-brightness":[{"backdrop-brightness":[l]}],"backdrop-contrast":[{"backdrop-contrast":[g]}],"backdrop-grayscale":[{"backdrop-grayscale":[y]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[x]}],"backdrop-invert":[{"backdrop-invert":[S]}],"backdrop-opacity":[{"backdrop-opacity":[Q]}],"backdrop-saturate":[{"backdrop-saturate":[ae]}],"backdrop-sepia":[{"backdrop-sepia":[oe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[f]}],"border-spacing-x":[{"border-spacing-x":[f]}],"border-spacing-y":[{"border-spacing-y":[f]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Se]}],duration:[{duration:k()}],ease:[{ease:["linear","in","out","in-out",Se]}],delay:[{delay:k()}],animate:[{animate:["none","spin","ping","pulse","bounce",Se]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[ue]}],"scale-x":[{"scale-x":[ue]}],"scale-y":[{"scale-y":[ue]}],rotate:[{rotate:[ri,Se]}],"translate-x":[{"translate-x":[Ae]}],"translate-y":[{"translate-y":[Ae]}],"skew-x":[{"skew-x":[pe]}],"skew-y":[{"skew-y":[pe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Se]}],accent:[{accent:["auto",r]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Se]}],"caret-color":[{caret:[r]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":Z()}],"scroll-mx":[{"scroll-mx":Z()}],"scroll-my":[{"scroll-my":Z()}],"scroll-ms":[{"scroll-ms":Z()}],"scroll-me":[{"scroll-me":Z()}],"scroll-mt":[{"scroll-mt":Z()}],"scroll-mr":[{"scroll-mr":Z()}],"scroll-mb":[{"scroll-mb":Z()}],"scroll-ml":[{"scroll-ml":Z()}],"scroll-p":[{"scroll-p":Z()}],"scroll-px":[{"scroll-px":Z()}],"scroll-py":[{"scroll-py":Z()}],"scroll-ps":[{"scroll-ps":Z()}],"scroll-pe":[{"scroll-pe":Z()}],"scroll-pt":[{"scroll-pt":Z()}],"scroll-pr":[{"scroll-pr":Z()}],"scroll-pb":[{"scroll-pb":Z()}],"scroll-pl":[{"scroll-pl":Z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Se]}],fill:[{fill:[r,"none"]}],"stroke-w":[{stroke:[bn,Jn,tu]}],stroke:[{stroke:[r,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},x1=t1(w1);function Nh(...r){return x1(xh(r))}const Rh=He.forwardRef(({className:r,type:n,value:i,onChange:l,...a},c)=>$.jsxs("div",{className:"relative",children:[$.jsx("input",{type:n,className:Nh("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground 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 md:text-sm",r),ref:c,value:i,onChange:l,...a}),i&&$.jsx("button",{type:"button",className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-300 hover:text-white p-1 rounded-md hover:bg-slate-600 transition-colors",style:{backgroundColor:"rgba(38, 50, 70, 1)"},onClick:()=>l==null?void 0:l({target:{value:""}}),children:$.jsx(B0,{className:"h-5 w-5",style:{color:"white"}})})]}));Rh.displayName="Input";function vp(r,n){if(typeof r=="function")return r(n);r!=null&&(r.current=n)}function _1(...r){return n=>{let i=!1;const l=r.map(a=>{const c=vp(a,n);return!i&&typeof c=="function"&&(i=!0),c});if(i)return()=>{for(let a=0;a{const{children:i,...l}=r,a=He.Children.toArray(i),c=a.find(S1);if(c){const f=c.props.children,p=a.map(g=>g===c?He.Children.count(f)>1?He.Children.only(null):He.isValidElement(f)?f.props.children:null:g);return $.jsx(yu,{...l,ref:n,children:He.isValidElement(f)?He.cloneElement(f,void 0,p):null})}return $.jsx(yu,{...l,ref:n,children:i})});bh.displayName="Slot";var yu=He.forwardRef((r,n)=>{const{children:i,...l}=r;if(He.isValidElement(i)){const a=C1(i);return He.cloneElement(i,{...E1(l,i.props),ref:n?_1(n,a):a})}return He.Children.count(i)>1?He.Children.only(null):null});yu.displayName="SlotClone";var k1=({children:r})=>$.jsx($.Fragment,{children:r});function S1(r){return He.isValidElement(r)&&r.type===k1}function E1(r,n){const i={...n};for(const l in n){const a=r[l],c=n[l];/^on[A-Z]/.test(l)?a&&c?i[l]=(...p)=>{c(...p),a(...p)}:a&&(i[l]=a):l==="style"?i[l]={...a,...c}:l==="className"&&(i[l]=[a,c].filter(Boolean).join(" "))}return{...r,...i}}function C1(r){var l,a;let n=(l=Object.getOwnPropertyDescriptor(r.props,"ref"))==null?void 0:l.get,i=n&&"isReactWarning"in n&&n.isReactWarning;return i?r.ref:(n=(a=Object.getOwnPropertyDescriptor(r,"ref"))==null?void 0:a.get,i=n&&"isReactWarning"in n&&n.isReactWarning,i?r.props.ref:r.props.ref||r.ref)}const wp=r=>typeof r=="boolean"?`${r}`:r===0?"0":r,xp=xh,N1=(r,n)=>i=>{var l;if((n==null?void 0:n.variants)==null)return xp(r,i==null?void 0:i.class,i==null?void 0:i.className);const{variants:a,defaultVariants:c}=n,f=Object.keys(a).map(y=>{const x=i==null?void 0:i[y],S=c==null?void 0:c[y];if(x===null)return null;const T=wp(x)||wp(S);return a[y][T]}),p=i&&Object.entries(i).reduce((y,x)=>{let[S,T]=x;return T===void 0||(y[S]=T),y},{}),g=n==null||(l=n.compoundVariants)===null||l===void 0?void 0:l.reduce((y,x)=>{let{class:S,className:T,...q}=x;return Object.entries(q).every(L=>{let[b,A]=L;return Array.isArray(A)?A.includes({...c,...p}[b]):{...c,...p}[b]===A})?[...y,S,T]:y},[]);return xp(r,f,g,i==null?void 0:i.class,i==null?void 0:i.className)},R1=N1("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),gu=He.forwardRef(({className:r,variant:n,size:i,asChild:l=!1,...a},c)=>{const f=l?bh:"button";return $.jsx(f,{className:Nh(R1({variant:n,size:i,className:r})),ref:c,...a})});gu.displayName="Button";const b1="#FFDD00",T1=He.forwardRef(function({title:n="Buy Me A Coffee",color:i="currentColor",size:l=24,...a},c){return i==="default"&&(i=b1),$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:l,height:l,fill:i,viewBox:"0 0 24 24",ref:c,...a,children:[$.jsx("title",{children:n}),$.jsx("path",{d:"M20.216 6.415l-.132-.666c-.119-.598-.388-1.163-1.001-1.379-.197-.069-.42-.098-.57-.241-.152-.143-.196-.366-.231-.572-.065-.378-.125-.756-.192-1.133-.057-.325-.102-.69-.25-.987-.195-.4-.597-.634-.996-.788a5.723 5.723 0 00-.626-.194c-1-.263-2.05-.36-3.077-.416a25.834 25.834 0 00-3.7.062c-.915.083-1.88.184-2.75.5-.318.116-.646.256-.888.501-.297.302-.393.77-.177 1.146.154.267.415.456.692.58.36.162.737.284 1.123.366 1.075.238 2.189.331 3.287.37 1.218.05 2.437.01 3.65-.118.299-.033.598-.073.896-.119.352-.054.578-.513.474-.834-.124-.383-.457-.531-.834-.473-.466.074-.96.108-1.382.146-1.177.08-2.358.082-3.536.006a22.228 22.228 0 01-1.157-.107c-.086-.01-.18-.025-.258-.036-.243-.036-.484-.08-.724-.13-.111-.027-.111-.185 0-.212h.005c.277-.06.557-.108.838-.147h.002c.131-.009.263-.032.394-.048a25.076 25.076 0 013.426-.12c.674.019 1.347.067 2.017.144l.228.031c.267.04.533.088.798.145.392.085.895.113 1.07.542.055.137.08.288.111.431l.319 1.484a.237.237 0 01-.199.284h-.003c-.037.006-.075.01-.112.015a36.704 36.704 0 01-4.743.295 37.059 37.059 0 01-4.699-.304c-.14-.017-.293-.042-.417-.06-.326-.048-.649-.108-.973-.161-.393-.065-.768-.032-1.123.161-.29.16-.527.404-.675.701-.154.316-.199.66-.267 1-.069.34-.176.707-.135 1.056.087.753.613 1.365 1.37 1.502a39.69 39.69 0 0011.343.376.483.483 0 01.535.53l-.071.697-1.018 9.907c-.041.41-.047.832-.125 1.237-.122.637-.553 1.028-1.182 1.171-.577.131-1.165.2-1.756.205-.656.004-1.31-.025-1.966-.022-.699.004-1.556-.06-2.095-.58-.475-.458-.54-1.174-.605-1.793l-.731-7.013-.322-3.094c-.037-.351-.286-.695-.678-.678-.336.015-.718.3-.678.679l.228 2.185.949 9.112c.147 1.344 1.174 2.068 2.446 2.272.742.12 1.503.144 2.257.156.966.016 1.942.053 2.892-.122 1.408-.258 2.465-1.198 2.616-2.657.34-3.332.683-6.663 1.024-9.995l.215-2.087a.484.484 0 01.39-.426c.402-.078.787-.212 1.074-.518.455-.488.546-1.124.385-1.766zm-1.478.772c-.145.137-.363.201-.578.233-2.416.359-4.866.54-7.308.46-1.748-.06-3.477-.254-5.207-.498-.17-.024-.353-.055-.47-.18-.22-.236-.111-.71-.054-.995.052-.26.152-.609.463-.646.484-.057 1.046.148 1.526.22.577.088 1.156.159 1.737.212 2.48.226 5.002.19 7.472-.14.45-.06.899-.13 1.345-.21.399-.072.84-.206 1.08.206.166.281.188.657.162.974a.544.544 0 01-.169.364zm-6.159 3.9c-.862.37-1.84.788-3.109.788a5.884 5.884 0 01-1.569-.217l.877 9.004c.065.78.717 1.38 1.5 1.38 0 0 1.243.065 1.658.065.447 0 1.786-.065 1.786-.065.783 0 1.434-.6 1.499-1.38l.94-9.95a3.996 3.996 0 00-1.322-.238c-.826 0-1.491.284-2.26.613z"})]})}),A1=o0({url:i0().min(1,"URL is required").url("Please enter a valid URL").refine(r=>{try{const n=new URL(r);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}},"URL must start with http:// or https://")}),O1="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ123456789+*-",_p="tnyr.me",kp="https://tnyr.me",P1=new Uint8Array([116,110,121,114,46,109,101,95,108,111,111,107,117,112,95,115]),L1=(r,n=O1)=>{const i=new Uint8Array(r);return crypto.getRandomValues(i),Array.from(i,l=>n[l%n.length]).join("")},Th=r=>{const n=new Uint8Array(r);return crypto.getRandomValues(n),n},Sp=r=>{const n=new TextEncoder;return gh(n.encode(r),P1,{N:2**17,r:8,p:1,dkLen:32})},Ep=(r,n)=>{const i=new TextEncoder;return gh(i.encode(r),n,{N:2**17,r:8,p:1,dkLen:32})},j1=async(r,n)=>{const i=Th(16),a=new TextEncoder().encode(n),c=await crypto.subtle.importKey("raw",r,{name:"AES-CBC"},!1,["encrypt"]),f=await crypto.subtle.encrypt({name:"AES-CBC",iv:i},c,a);return{iv:i,encrypted:new Uint8Array(f)}},F1=async(r,n,i)=>{const l=await crypto.subtle.importKey("raw",r,{name:"AES-CBC"},!1,["decrypt"]),a=await crypto.subtle.decrypt({name:"AES-CBC",iv:n},l,i);return new TextDecoder().decode(a)},ii=r=>Array.from(r,n=>n.toString(16).padStart(2,"0")).join(""),nu=r=>new Uint8Array(r.match(/.{1,2}/g).map(n=>parseInt(n,16)));function I1(){const[r,n]=He.useState(""),[i,l]=He.useState(!1),[a,c]=He.useState(!1);He.useEffect(()=>{(async()=>{const L=window.location.hash.slice(1);if(L&&L.length===10){c(!0);try{await new Promise(Pe=>setTimeout(Pe,20));const b=Sp(L),A=ii(b),Q=await it.get(`${kp}/get-encrypted-url?lookup_hash=${A}`),{ENCRYTION_SALT:M,IV:ae,ENCRYPTED_URL:ue}=Q.data,oe=nu(M);await new Promise(Pe=>setTimeout(Pe,15));const pe=Ep(L,oe),he=nu(ae),Ae=nu(ue),Re=await F1(pe,he,Ae);window.location.href=Re}catch(b){console.error("Failed to decrypt URL:",b),c(!1)}}})()},[]);const{register:f,handleSubmit:p,formState:{errors:g},setError:y,clearErrors:x}=bv({resolver:Pv(A1),mode:"onChange"}),S=async q=>{l(!0),x();try{await new Promise(he=>setTimeout(he,20));const L=L1(10),b=Th(16),A=Sp(L);await new Promise(he=>setTimeout(he,15));const Q=Ep(L,b);let M=q.url;!M.startsWith("https://")&&!M.startsWith("http://")&&!M.startsWith("magnet:")&&(M="http://"+M);const{iv:ae,encrypted:ue}=await j1(Q,M);await it.post(`${kp}/shorten`,{LOOKUP_HASH:ii(A),ENCRYTION_SALT:ii(b),IV:ii(ae),ENCRYPTED_URL:ii(ue)});const pe=`${typeof window<"u"&&window.location?window.location.protocol:"https:"}//${_p}/#${L}`;n(pe)}catch(L){console.error("Encryption error:",L),y("root",{message:"Error shortening URL. Please try again."})}finally{l(!1)}},T=()=>{navigator.clipboard.writeText(r)};return a?$.jsx("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 to-slate-800 text-slate-100 flex flex-col items-center justify-center p-4",children:$.jsxs("div",{className:"text-center space-y-8",children:[$.jsx("div",{className:"flex justify-center",children:$.jsxs("div",{className:"relative",children:[$.jsx(z0,{className:"w-16 h-16 text-indigo-400 animate-spin"}),$.jsx("div",{className:"absolute inset-0 w-16 h-16 border-4 border-indigo-400/20 rounded-full"})]})}),$.jsxs("div",{className:"space-y-4",children:[$.jsx("h1",{className:"text-3xl font-bold",children:"Decrypting URL"}),$.jsx("p",{className:"text-slate-400 text-lg max-w-md",children:"Computing hashes and securely retrieving your destination..."})]}),$.jsxs("div",{className:"flex items-center justify-center gap-2 text-slate-500",children:[$.jsx(eu,{className:"w-4 h-4"}),$.jsx("span",{className:"text-sm",children:"End-to-end encrypted"})]})]})}):$.jsxs("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 to-slate-800 text-slate-100 flex flex-col items-center justify-center p-4",children:[$.jsxs("div",{className:"w-full max-w-2xl space-y-8",children:[$.jsxs("div",{className:"text-center",children:[$.jsx("h1",{className:"text-4xl font-bold mb-4",children:"tnyr.me"}),$.jsx("p",{className:"text-slate-400 text-lg",children:"Privacy-focused URL shortener with seamless encryption"})]}),$.jsxs("div",{className:"bg-slate-800/50 backdrop-blur-sm rounded-xl p-6 shadow-xl",children:[$.jsx("div",{className:"flex flex-col space-y-4 mb-6 text-slate-300",children:$.jsxs("div",{className:"flex items-center gap-2 justify-center",children:[$.jsx(eu,{className:"w-5 h-5"}),$.jsx("p",{className:"text-center",children:"Your links are end-to-end encrypted - your original URL never leaves your browser unencrypted."})]})}),$.jsxs("form",{onSubmit:p(S),className:"flex flex-col space-y-4",children:[$.jsx(Rh,{type:"text",...f("url"),placeholder:"Enter your long URL here",className:"bg-slate-700/50 border-slate-600 text-lg h-14 rounded-xl"}),g.url&&$.jsx("p",{className:"text-red-400 text-sm",children:g.url.message}),g.root&&$.jsx("p",{className:"text-red-400 text-sm",children:g.root.message}),$.jsx(gu,{type:"submit",disabled:i,className:"h-12 text-lg rounded-xl bg-indigo-600 hover:bg-indigo-700 transition-colors",children:i?"Shortening...":"Create Secure Link"})]}),r&&$.jsxs("div",{className:"mt-6 p-4 bg-slate-700/30 rounded-lg flex items-center justify-between",children:[$.jsx("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"text-indigo-400 hover:text-indigo-300 break-all",children:r.replace(/^https?:\/\//,"")}),$.jsx(gu,{variant:"ghost",size:"sm",onClick:T,className:"text-slate-400 hover:bg-slate-600/50",children:$.jsx(R0,{className:"w-4 h-4"})})]})]})]}),$.jsx("div",{className:"w-full max-w-3xl mt-12 mb-8",children:$.jsxs("div",{className:"bg-slate-800/50 backdrop-blur-sm rounded-xl p-6 shadow-xl border border-slate-700/30",children:[$.jsxs("h2",{className:"text-2xl font-semibold mb-6 flex items-center gap-2",children:[$.jsx(eu,{className:"w-6 h-6 text-indigo-400"}),"How We Protect Your Privacy"]}),$.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[$.jsxs("div",{className:"space-y-4",children:[$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(U0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"End-to-End Encryption"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"Your URL is encrypted in your browser and never sent to our servers in plaintext. Using AES-256 encryption, only you and those you share the link with can see the destination."})]})]}),$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(L0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"Complete Anonymity"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"There's no way to discover or list existing links. Each URL exists only for those who possess the unique ID."})]})]})]}),$.jsxs("div",{className:"space-y-4",children:[$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(F0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"Secure By Design"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"We derive two separate keys from your link ID. One is used to create a lookup hash, so we can find your encrypted data. The other is used to encrypt your destination URL. Without the original link ID, the data is just random noise."})]})]}),$.jsxs("div",{className:"flex gap-3",children:[$.jsx("div",{className:"mt-1",children:$.jsx(T0,{className:"w-5 h-5 text-indigo-400"})}),$.jsxs("div",{children:[$.jsx("h3",{className:"font-medium mb-1",children:"Security Process"}),$.jsx("p",{className:"text-slate-400 text-sm",children:"We never log IP addresses, track users, or use cookies. Your browsing activity leaves no trace in our systems."})]})]})]})]}),$.jsx("div",{className:"mt-6 p-4 bg-slate-700/30 rounded-lg border border-slate-700/50",children:$.jsxs("p",{className:"text-sm text-slate-400",children:["🔒 ",$.jsx("span",{className:"font-medium",children:"Important:"})," Make sure to Bookmark your ",_p," links safely - there's no way to recover lost IDs or access links without them."]})})]})}),$.jsxs("footer",{className:"bottom-4 flex items-center gap-3 text-slate-400",children:[$.jsx("a",{href:"https://github.com/Sevi-py/tnyr.me",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-300 transition-colors",children:$.jsx(O0,{className:"w-8 h-8"})}),$.jsx("a",{href:"https://www.buymeacoffee.com/severin.hilbert",target:"_blank",rel:"noopener noreferrer",className:"hover:text-slate-300 transition-colors",children:$.jsx(T1,{className:"w-8 h-8"})})]})]})}Py.createRoot(document.getElementById("root")).render($.jsx(He.StrictMode,{children:$.jsx(I1,{})})); diff --git a/backend/dist/favicon/site.webmanifest b/backend/dist/favicon/site.webmanifest index 0826337..f6dd956 100644 --- a/backend/dist/favicon/site.webmanifest +++ b/backend/dist/favicon/site.webmanifest @@ -1,6 +1,6 @@ { - "name": "127.0.0.1:5000", - "short_name": "127.0.0.1:5000", + "name": "tnyr.me", + "short_name": "tnyr.me", "icons": [ { "src": "/assets/favicon/web-app-manifest-192x192.png", diff --git a/backend/dist/index.html b/backend/dist/index.html index 1ad16d3..4aa691b 100644 --- a/backend/dist/index.html +++ b/backend/dist/index.html @@ -6,31 +6,31 @@ - + - - + + - - - + + + - + - 127.0.0.1:5000 - Privacy friendly URL shortener - + tnyr.me - Privacy friendly URL shortener + diff --git a/backend/dist/meta/sitemap.xml b/backend/dist/meta/sitemap.xml index b698979..50f479c 100644 --- a/backend/dist/meta/sitemap.xml +++ b/backend/dist/meta/sitemap.xml @@ -6,7 +6,7 @@ http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd"> - https://127.0.0.1:5000/ + https://tnyr.me/