1import{u as G,n as $,j as e,S as K,N as J,a8 as X,ae as M,ad as W,a9 as Y,y as Z,X as ee,A as te,aa as se,o as re,p as ae,_ as ie,a0 as D,z as le}from"./index-s7cxMHZ5.js";import{r as n}from"./vendor-react-0R6VX6ld.js";import{c as ne}from"./index-eD7lYc4e.js";import{h as z,H as oe}from"./index-zMxkKZQp.js";import{Q as ce}from"./qr-code-styling-k8W5yEAY.js";import me from"./Footer-3pdh7hf8.js";import{H as de}from"./HealthGradientBackground-F2i7HU9B.js";import{m as o,A as c}from"./vendor-framer-JqHIcSWX.js";import"./vendor-three-dec0Z_i3.js";import"./vendor-icons-LlCGcXb-.js";import"./index-v2SWm-nz.js";const B={source:["google","facebook","instagram","twitter","linkedin","newsletter","email","tiktok","youtube"],medium:["cpc","social","email","organic","referral","display","affiliate","banner","video"],campaign:["spring_sale","summer_promo","black_friday","launch","brand_awareness","retargeting"]},ve=()=>{const{t:s,language:C}=G(),[l,p]=n.useState("https://"),[r,b]=n.useState({source:"",medium:"",campaign:"",term:"",content:""}),[y,u]=n.useState(!1),[j,S]=n.useState(!1),[m,_]=n.useState(!1),[d,N]=n.useState([]),[w,v]=n.useState(!1),h=n.useRef(null),g=n.useRef(null),x=n.useMemo(()=>{if(!l||l==="https://"||l==="http://")return{isValid:!1,error:null};const t=l.trim();if(t.includes(" "))return{isValid:!1,error:"urlHasSpaces"};if(t.match(/^https?:\/\//i))try{new URL(t)}catch{return{isValid:!1,error:"invalidFormat"}}else{const a="https://"+t;try{new URL(a)}catch{return{isValid:!1,error:"invalidFormat"}}}return t.match(/https?:\/\/[^.]+$/)?{isValid:!1,error:"missingDomain"}:{isValid:!0,error:null}},[l]);n.useEffect(()=>{const t=localStorage.getItem("utm-history");if(t)try{N(JSON.parse(t))}catch{}},[]);const i=n.useMemo(()=>{if(!l||l==="https://"||l==="http://")return"";try{let t=l.trim();t.match(/^https?:\/\//)||(t="https://"+t);const a=new URL(t);return r.source&&a.searchParams.set("utm_source",r.source),r.medium&&a.searchParams.set("utm_medium",r.medium),r.campaign&&a.searchParams.set("utm_campaign",r.campaign),r.term&&a.searchParams.set("utm_term",r.term),r.content&&a.searchParams.set("utm_content",r.content),a.toString()}catch{return""}},[l,r]),f=r.source||r.medium||r.campaign||r.term||r.content,T=(i==null?void 0:i.length)||0,U=T>2e3,H=async()=>{if(i)try{if(await navigator.clipboard.writeText(i),u(!0),setTimeout(()=>u(!1),2e3),f){const a=[{url:i,params:{...r},timestamp:Date.now()},...d.filter(k=>k.url!==i)].slice(0,10);N(a),localStorage.setItem("utm-history",JSON.stringify(a))}}catch{const t=document.createElement("textarea");t.value=i,document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t),u(!0),setTimeout(()=>u(!1),2e3)}},L=()=>{p("https://"),b({source:"",medium:"",campaign:"",term:"",content:""})},q=t=>{try{const a=new URL(t.url);a.searchParams.delete("utm_source"),a.searchParams.delete("utm_medium"),a.searchParams.delete("utm_campaign"),a.searchParams.delete("utm_term"),a.searchParams.delete("utm_content"),p(a.toString().replace(/\?$/,""))}catch{p(t.url.split("?")[0])}b(t.params),S(!1)},R=()=>{N([]),localStorage.removeItem("utm-history")},F=(t,a)=>{const k=a.toLowerCase().replace(/\s+/g,"_").replace(/[^a-z0-9_-]/g,"");b(V=>({...V,[t]:k}))},O=()=>{!i||!f||v(!0)};n.useEffect(()=>{w&&i&&h.current&&(h.current.innerHTML="",g.current=new ce({width:280,height:280,data:i,dotsOptions:{color:"#a855f7",type:"rounded"},backgroundOptions:{color:"#ffffff"},cornersSquareOptions:{color:"#7c3aed",type:"extra-rounded"},cornersDotOptions:{color:"#7c3aed",type:"dot"},imageOptions:{crossOrigin:"anonymous",margin:10}}),g.current.append(h.current))},[w,i]);const P=t=>{g.current&&g.current.download({name:"utm-qr-code",extension:t})},E=[{key:"source",label:s("utmBuilder.source"),placeholder:"google, facebook, newsletter",description:s("utmBuilder.sourceDesc"),required:!0,presets:B.source},{key:"medium",label:s("utmBuilder.medium"),placeholder:"cpc, social, email",description:s("utmBuilder.mediumDesc"),required:!0,presets:B.medium},{key:"campaign",label:s("utmBuilder.campaign"),placeholder:"spring_sale, product_launch",description:s("utmBuilder.campaignDesc"),required:!0,presets:B.campaign},{key:"term",label:s("utmBuilder.term"),placeholder:"running+shoes",description:s("utmBuilder.termDesc"),required:!1,presets:[]},{key:"content",label:s("utmBuilder.content"),placeholder:"logolink, textlink",description:s("utmBuilder.contentDesc"),required:!1,presets:[]}],I=["rgba(147, 51, 234, 0.3)","rgba(139, 92, 246, 0.25)","rgba(30, 27, 75, 0.4)","rgba(88, 28, 135, 0.3)","rgba(17, 24, 39, 0.5)"],A=le("UTM Builder",C==="de"?"Kostenloses UTM-Builder Tool für Marketing-Kampagnen. Erstellen Sie UTM-Parameter für Google Analytics Tracking.":"Free UTM builder tool for marketing campaigns. Create UTM parameters for Google Analytics tracking.","/utm-builder"),Q=$([{name:"Home",url:"/"},{name:"Tools",url:"/tools"},{name:"UTM Builder",url:"/utm-builder"}]);return e.jsxs(de,{colors:I,speed:50,opacity:.4,children:[e.jsx(K,{title:"UTM Builder",description:C==="de"?"Kostenloses UTM-Builder Tool für Marketing-Kampagnen. Erstellen Sie UTM-Parameter für Google Analytics Tracking.":"Free UTM builder tool for marketing campaigns. Create UTM parameters for Google Analytics tracking.",url:"/utm-builder",structuredData:[A,Q]}),e.jsx(J,{minimal:!0}),e.jsx("main",{className:"flex-1 px-4 pt-24 md:pt-28 pb-8 md:pb-12",children:e.jsxs("div",{className:"max-w-3xl mx-auto",children:[e.jsxs(o.div,{initial:{opacity:0,y:-20}
1,animate:{opacity:1,y:0},className:"text-center mb-8",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-purple-500/10 border border-purple-500/20 mb-4",children:[e.jsx(X,{className:"text-purple-400",size:14}),e.jsx("span",{className:"text-xs text-purple-300 font-medium",children:s("utmBuilder.badge")})]}),e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-white mb-3",children:s("utmBuilder.title")}),e.jsx("p",{className:"text-gray-400",children:s("utmBuilder.description")})]}),e.jsxs(o.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{delay:.1},className:"bg-gradient-to-br from-purple-600/20 via-violet-600/15 to-fuchsia-600/20 rounded-3xl p-6 md:p-8 border border-purple-500/30 shadow-2xl mb-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsxs("label",{className:"text-sm font-medium text-purple-400 mb-2 block",children:[s("utmBuilder.baseUrl")," ",e.jsx("span",{className:"text-rose-400",children:"*"})]}),e.jsx("input",{type:"text",value:l,onChange:t=>p(t.target.value),placeholder:"https://example.com/landing-page",className:`w-full bg-[#0f0f1a] rounded-xl p-4 text-white outline-none border transition-colors placeholder:text-gray-600 font-mono text-sm ${x.error?"border-rose-500/50 focus:border-rose-500":"border-white/10 focus:border-purple-500/50"}`}),e.jsx(c,{children:x.error&&e.jsxs(o.div,{initial:{opacity:0,y:-5},animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"flex items-center gap-2 mt-2 text-rose-400 text-sm",children:[e.jsx(M,{size:14}),e.jsxs("span",{children:[x.error==="urlHasSpaces"&&s("utmBuilder.errors.urlHasSpaces"),x.error==="invalidFormat"&&s("utmBuilder.errors.invalidFormat"),x.error==="missingDomain"&&s("utmBuilder.errors.missingDomain")]})]})})]}),e.jsxs("div",{className:"space-y-4 mb-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"text-white font-semibold",children:"UTM Parameters"}),e.jsx("button",{onClick:()=>_(!m),className:"text-gray-400 hover:text-purple-400 transition-colors",children:e.jsx(W,{size:18})})]}),E.map(t=>e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("label",{className:"text-sm font-medium text-gray-300",children:["utm_",t.key," ",t.required&&e.jsx("span",{className:"text-rose-400",children:"*"})]}),e.jsx(c,{initial:!1,children:m&&e.jsx(o.span,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"text-xs text-gray-500",children:t.description})})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("input",{type:"text",value:r[t.key],onChange:a=>F(t.key,a.target.value),placeholder:t.placeholder,className:"flex-1 bg-[#0f0f1a] rounded-xl px-4 py-3 text-white outline-none border border-white/10 focus:border-purple-500/50 transition-colors placeholder:text-gray-600 font-mono text-sm"})}),t.presets.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:t.presets.map(a=>e.jsx("button",{onClick:()=>F(t.key,a),className:`px-2.5 py-1 text-xs rounded-lg transition-all ${r[t.key]===a?"bg-purple-500/30 text-purple-300 border border-purple-500/50":"bg-white/5 text-gray-400 hover:text-white hover:bg-white/10 border border-transparent"}`,children:a},a))})]},t.key))]}),e.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 mb-6",children:[e.jsxs("button",{onClick:L,className:"px-4 py-2.5 bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white rounded-xl flex items-center gap-2 transition-all border border-white/10 text-sm",children:[e.jsx(Y,{size:14}),s("utmBuilder.reset")]}),d.length>0&&e.jsxs("button",{onClick:()=>S(!j),className:`px-4 py-2.5 rounded-xl flex items-center gap-2 transition-all text-sm ${j?"bg-purple-500/20 text-purple-400 border border-purple-500/30":"bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white border border-white/10"}`,children:[e.jsx(Z,{size:14}),s("utmBuilder.history")," (",d.length,")"]})]}),e.jsx(c,{children:j&&d.length>0&&e.jsx(o.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden mb-6",children:e.jsxs("div",{className:"bg-[#0f0f1a] rounded-xl border border-white/10 p-3",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-xs text-gray-400",children:s("utmBuilder.recentUrls")}),e.jsxs("button",{onClick:R,className:"text-xs text-gray-500 hover:text-rose-400 transition-colors flex items-center gap-1",children:[e.jsx(ee,{size:12}),s("utmBuilder.clearHistory")]})]}),e.jsx("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:d.map((t,a)=>e.jsxs("button",{onClick:()=>q(t),className:"w-full text-left p-2 rounded-lg bg-white/5 hover:bg-white/10 transition-colors group",children:[e.jsx("div",{className:"text-xs text-gray-400 truncate font-mono",children:t.url}),e.jsxs("div",{className:"flex gap-2 mt-1 flex-wrap",children:[t.params.source&&e.jsx("span",{className:"text-xs bg-purple-500/20 text-purple-400 px-1.5 py-0.5 rounded",children:t.params.source}),t.params.medium&&e.jsx("span",{className:"text-xs bg-violet-500/20 text-violet-400 px-1.5 py-0.5 rounded",children:t.params.medium}),t.params.campaign&&e.jsx("span",{className:"text-xs bg-fuchsia-500/20 text-fuchsia-400 px-1.5 py-0.5 rounded",children:t.params.campaign})]})]},a))})]})})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("label",{className:"text-sm font-medium text-purple-400",children:s("utmBuilder.generatedUrl")}),i&&e.jsxs("span",{className:`text-xs ${U?"text-rose-400":"text-gray-500"}`,children:[T," ",s("utmBuilder.chars")]})]}),i&&f&&e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:O,className:"flex items-center gap-2 px-3 py-2 rounded-xl text-sm font-medium transition-all bg-white/5 hover:bg-white/10 text-gray-400 hover:text-white border border-white/10",title:s("utmBuilder.showQr"),children:e.jsx(z,{size:16})}),e.jsxs("button",{onClick:H,className:`flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium transition-all ${y?"bg-green-500/20 text-green-400 border border-green-500/30":"bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 border border-purple-500/30"}`,children:[y?e.jsx(te,{size:14}):e.jsx(se,{size:14}),s(y?"utmBuilder.copied":"utmBuilder.copy")]})]})]}),e.jsx(c,{children:U&&e.jsxs(o.div,{initial:{opacity:0,y:-5}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-5},className:"flex items-center gap-2 mb-2 text-amber-400 text-sm bg-amber-500/10 px-3 py-2 rounded-lg border border-amber-500/20",children:[e.jsx(M,{size:14}),e.jsx("span",{children:s("utmBuilder.urlTooLong")})]})}),e.jsx("div",{className:"w-full min-h-24 bg-[#0f0f1a] rounded-2xl p-4 border border-white/10",children:i&&f?e.jsxs("div",{className:"font-mono text-sm break-all",children:[e.jsx("span",{className:"text-gray-400",children:l.split("?")[0]}),e.jsx("span",{className:"text-gray-500",children:"?"}),r.source&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-purple-400",children:"utm_source"}),e.jsx("span",{className:"text-gray-500",children:"="}),e.jsx("span",{className:"text-purple-300",children:r.source})]}),r.medium&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-500",children:"&"}),e.jsx("span",{className:"text-violet-400",children:"utm_medium"}),e.jsx("span",{className:"text-gray-500",children:"="}),e.jsx("span",{className:"text-violet-300",children:r.medium})]}),r.campaign&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-500",children:"&"}),e.jsx("span",{className:"text-fuchsia-400",children:"utm_campaign"}),e.jsx("span",{className:"text-gray-500",children:"="}),e.jsx("span",{className:"text-fuchsia-300",children:r.campaign})]}),r.term&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-500",children:"&"}),e.jsx("span",{className:"text-pink-400",children:"utm_term"}),e.jsx("span",{className:"text-gray-500",children:"="}),e.jsx("span",{className:"text-pink-300",children:r.term})]}),r.content&&e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"text-gray-500",children:"&"}),e.jsx("span",{className:"text-rose-400",children:"utm_content"}),e.jsx("span",{className:"text-gray-500",children:"="}),e.jsx("span",{className:"text-rose-300",children:r.content})]})]}):e.jsx("span",{className:"text-gray-600 text-sm",children:s(!l||l==="https://"?"utmBuilder.enterUrl":"utmBuilder.addParams")})})]})]}),e.jsxs(o.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.2},className:"bg-[#1a1a2e] rounded-2xl border border-purple-500/20 overflow-hidden mb-6",children:[e.jsxs("button",{onClick:()=>_(!m),className:"w-full flex items-center justify-between p-4 text-left",children:[e.jsx("span",{className:"text-white font-semibold",children:s("utmBuilder.whatIsUtm")}),m?e.jsx(re,{className:"text-gray-400"}):e.jsx(ae,{className:"text-gray-400"})]}),e.jsx(c,{initial:!1,children:m&&e.jsxs(o.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"px-4 pb-4",children:[e.jsx("p",{className:"text-gray-400 text-sm mb-4",children:s("utmBuilder.whatIsUtmText")}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 sm:items-start",children:[e.jsx("code",{className:"text-purple-400 bg-purple-500/10 px-2 py-1 rounded text-xs font-mono w-fit",children:"utm_source"}),e.jsx("span",{className:"text-gray-400 text-sm",children:s("utmBuilder.sourceDesc")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 sm:items-start",children:[e.jsx("code",{className:"text-violet-400 bg-violet-500/10 px-2 py-1 rounded text-xs font-mono w-fit",children:"utm_medium"}),e.jsx("span",{className:"text-gray-400 text-sm",children:s("utmBuilder.mediumDesc")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 sm:items-start",children:[e.jsx("code",{className:"text-fuchsia-400 bg-fuchsia-500/10 px-2 py-1 rounded text-xs font-mono w-fit",children:"utm_campaign"}),e.jsx("span",{className:"text-gray-400 text-sm",children:s("utmBuilder.campaignDesc")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 sm:items-start",children:[e.jsx("code",{className:"text-pink-400 bg-pink-500/10 px-2 py-1 rounded text-xs font-mono w-fit",children:"utm_term"}),e.jsx("span",{className:"text-gray-400 text-sm",children:s("utmBuilder.termDesc")})]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-1 sm:gap-3 sm:items-start",children:[e.jsx("code",{className:"text-rose-400 bg-rose-500/10 px-2 py-1 rounded text-xs font-mono w-fit",children:"utm_content"}),e.jsx("span",{className:"text-gray-400 text-sm",children:s("utmBuilder.contentDesc")})]})]})]})})]}),e.jsx(o.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},transition:{delay:.3},className:"bg-gradient-to-br from-purple-500/10 via-violet-500/10 to-fuchsia-500/10 rounded-2xl p-6 border border-purple-500/20 overflow-hidden",children:e.jsxs("div",{className:"flex gap-4 items-start",children:[e.jsx("a",{href:"https://apps.apple.com/de/app/lynkr-link-in-bio/id6504898644",target:"_blank",rel:"noopener noreferrer",className:"flex-shrink-0",children:e.jsx("img",{src:"/assets/apps/lynkr.png",alt:"Lynkr - Link in Bio",className:"w-14 h-14 rounded-xl shadow-lg hover:scale-105 transition-transform"})}),e.jsxs("div",{className:"flex-1",children:[e.jsxs("h4",{className:"text-white font-semibold flex items-center gap-2",children:[s("utmBuilder.promo.title"),e.jsx(oe,{className:"text-purple-400"})]}),e.jsx("p",{className:"text-gray-400 text-sm mt-1 mb-3",children:s("utmBuilder.promo.description")}),e.jsxs("a",{href:"https://apps.apple.com/de/app/lynkr-link-in-bio/id6504898644",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-4 py-2 bg-white text-black text-sm font-semibold rounded-xl hover:bg-gray-100 transition-colors",children:[e.jsx(ne,{size:16}),s("utmBuilder.promo.cta")]})]})]})})]})}),e.jsx(c,{children:w&&e.jsx(o.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/80 backdrop-blur-sm z-50 flex items-center justify-center p-4",onClick:()=>v(!1),children:e.jsxs(o.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},onClick:t=>t.stopPropagation(),className:"bg-[#1a1a2e] rounded-2xl p-6 border border-purple-500/30 max-w-sm w-full",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("h3",{className:"text-white font-semibold flex items-center gap-2",children:[e.jsx(z,{className:"text-purple-400"}),s("utmBuilder.qrCode")]}),e.jsx("button",{onClick:()=>v(!1),className:"text-gray-400 hover:text-white transition-colors",children:e.jsx(ie,{size:20})})]}),e.jsx("div",{className:"bg-white rounded-xl p-4 flex items-center justify-center mb-4",children:e.jsx("div",{ref:h})}),e.jsx("p",{className:"text-gray-400 text-xs font-mono truncate mb-4 bg-black/30 px-3 py-2 rounded-lg",children:i}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs("button",{onClick:()=>P("png"),className:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-purple-500/20 hover:bg-purple-500/30 text-purple-300 rounded-xl text-sm font-medium transition-all border border-purple-500/30",children:[e.jsx(D,{size:14}),"PNG"]}),e.jsxs("button",{onClick:()=>P("svg"),className:"flex-1 flex items-center justify-center gap-2 px-4 py-2.5 bg-white/5 hover:bg-white/10 text-gray-300 rounded-xl text-sm font-medium transition-all border border-white/10",children:[e.jsx(D,{size:14}),"SVG"]})]}),e.jsx("a",{href:"/qr-code-generator",className:"mt-4 block text-center text-xs text-gray-500 hover:text-purple-400 transition-colors",children:s("utmBuilder.moreQrOptions")})]})})}),e.jsx(me,{})]})};export{ve as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.