PageSourceSearch

https://www.affiliate.id/_next/static/chunks/pages/app/tools/link-66bcd8775c70dae5.js

js affiliate.id collected 2026-10-10 02:27:36 UTC 37,803 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="30f424cd-ba73-4795-8231-bc537b189052",e._sentryDebugIdIdentifier="sentry-dbid-30f424cd-ba73-4795-8231-bc537b189052")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3302],{5687:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/tools/link",function(){return a(49381)}])},65521:function(e,t,a){"use strict";a.d(t,{OL:function(){return g},_T:function(){return m},aR:function(){return o},f$:function(){return h},fY:function(){return x},le:function(){return v},vW:function(){return d},xo:function(){return f},yT:function(){return p}});var s=a(85893),l=a(67294),n=a(89532),r=a(5383),i=a(21488);let o=n.fC,d=n.xz,c=n.h_,u=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.aV,{className:(0,r.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...l,ref:t})});u.displayName=n.aV.displayName;let m=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsx)(n.VY,{ref:t,className:(0,r.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...l})]})});m.displayName=n.VY.displayName;let x=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,r.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...a})};x.displayName="AlertDialogHeader";let f=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,r.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="AlertDialogFooter";let h=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,r.cn)("text-lg font-semibold",a),...l})});h.displayName=n.Dx.displayName;let p=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,r.cn)("text-sm text-muted-foreground",a),...l})});p.displayName=n.dk.displayName;let g=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.aU,{ref:t,className:(0,r.cn)((0,i.d)(),a),...l})});g.displayName=n.aU.displayName;let v=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.$j,{ref:t,className:(0,r.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",a),...l})});v.displayName=n.$j.displayName},55002:function(e,t,a){"use strict";a.d(t,{f:function(){return o}});var s=a(85893);a(67294);var l=a(95555),n=a(5383),r=a(21488),i=a(62469);function o(e){let{className:t,classNames:a,showOutsideDays:o=!0,...d}=e;return(0,s.jsx)(l._W,{showOutsideDays:o,className:(0,n.cn)("p-3",t),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:(0,n.cn)((0,r.d)({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:(0,n.cn)("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===d.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:(0,n.cn)((0,r.d)({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...a},components:{IconLeft:e=>{let{...t}=e;return(0,s.jsx)(i.wyc,{className:"h-4 w-4"})},IconRight:e=>{let{...t}=e;return(0,s.jsx)(i.XCv,{className:"h-4 w-4"})}},...d})}
1o.displayName="Calendar"},39970:function(e,t,a){"use strict";a.d(t,{$N:function(){return h},Vq:function(){return o},cN:function(){return f},cZ:function(){return m},fK:function(){return x},hg:function(){return d}});var s=a(85893),l=a(67294),n=a(12854),r=a(62469),i=a(5383);let o=n.fC,d=n.xz,c=n.h_;n.x8;let u=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.aV,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...l})});u.displayName=n.aV.displayName;let m=l.forwardRef((e,t)=>{let{className:a,children:l,...o}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsxs)(n.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...o,children:[l,(0,s.jsxs)(n.x8,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(r.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});m.displayName=n.VY.displayName;let x=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};x.displayName="DialogHeader";let f=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};f.displayName="DialogFooter";let h=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...l})});h.displayName=n.Dx.displayName,l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...l})}).displayName=n.dk.displayName},59892:function(e,t,a){"use strict";a.d(t,{r:function(){return i}});var s=a(85893),l=a(67294),n=a(60761),r=a(5383);let i=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)(n.fC,{className:(0,r.cn)("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...l,ref:t,children:(0,s.jsx)(n.bU,{className:(0,r.cn)("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});i.displayName=n.fC.displayName},80708:function(e,t,a){"use strict";a.d(t,{RM:function(){return o},SC:function(){return d},iA:function(){return r},pj:function(){return u},ss:function(){return c},xD:function(){return i}});var s=a(85893),l=a(67294),n=a(5383);let r=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("div",{className:"relative w-full overflow-auto",children:(0,s.jsx)("table",{ref:t,className:(0,n.cn)("w-full caption-bottom text-sm",a),...l})})});r.displayName="Table";let i=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("thead",{ref:t,className:(0,n.cn)("[&_tr]:border-b",a),...l})});i.displayName="TableHeader";let o=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("tbody",{ref:t,className:(0,n.cn)("[&_tr:last-child]:border-0",a),...l})});o.displayName="TableBody",l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("tfoot",{ref:t,className:(0,n.cn)("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",a),...l})}).displayName="TableFooter";let d=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("tr",{ref:t,className:(0,n.cn)("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",a),...l})});d.displayName="TableRow";let c=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("th",{ref:t,className:(0,n.cn)("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...l})});c.displayName="TableHead";let u=l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("td",{ref:t,className:(0,n.cn)("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...l})});u.displayName="TableCell",l.forwardRef((e,t)=>{let{className:a,...l}=e;return(0,s.jsx)("caption",{ref:t,className:(0,n.cn)("mt-4 text-sm text-muted-foreground",a),...l})}).displayName="TableCaption"},94596:function(e,t,a){"use strict";var s=a(85893),l=a(68256),n=a(11163);a(67294),t.Z=function(e){let{headline:t,href:a}=e,r=(0,n.useRouter)();return(0,s.jsxs)("div",{className:"flex h-10 w-fit items-center justify-center gap-2 cursor-pointer",onClick:()=>a?r.push(a):r.back(),children:[(0,s.jsx)(l.Z,{}),(0,s.jsxs)("h2",{className:"text-2xl font-bold capitalize",children:[t," "]})]})}},32397:function(e,t,a){"use strict";a.d(t,{Z:function(){return r}});var s=a(85893),l=a(23432);let n="#003d9b";function r(e){let{icon:t,label:a,value:r,subtitle:i,subtitleClassName:o,accentBorder:d}=e;return(0,s.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 shadow-sm bg-background ".concat(d?"border-l-4":""),style:d?{borderLeftColor:n}:void 0,children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"flex h-8 w-8 flex-shrink-0 items-center justify-center rounded-full bg-blue-50 dark:bg-blue-950",
1style:{color:n},children:t}),(0,s.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground truncate",children:a})]}),void 0!==r?(0,s.jsx)("p",{className:"text-2xl font-bold truncate",children:r}):(0,s.jsx)(l.Z,{className:"h-5 w-5 animate-spin text-muted-foreground"}),i&&(0,s.jsx)("p",{className:"text-xs truncate ".concat(null!=o?o:"text-muted-foreground"),children:i})]})}},49381:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ev}});var s=a(85893),l=a(83757),n=a(67294),r=a(87066),i=a(23279),o=a.n(i),d=a(8274),c=a(71508),u=a(4270),m=a(52790),x=a(99422),f=a(46611),h=a(90437),p=a(12779),g=a(21488),v=a(39970),j=a(94596),b=a(87760),N=a(32397),w=a(36127),y=a(44976),k=a(56286),C=a(56235);let S=[{value:"all",label:"All Statuses"},{value:"active",label:"Active"},{value:"expired",label:"Expired"},{value:"disabled",label:"Disabled"}],D=[{value:"newest",label:"Newest First"},{value:"clicks",label:"Most Clicked"}];function z(e){let{search:t,onSearchChange:a,status:l,onStatusChange:n,sortBy:r,onSortByChange:i,onRefresh:o,isRefreshing:d}=e;return(0,s.jsxs)("div",{className:"flex flex-col gap-3 rounded-xl border bg-muted/30 p-4 md:flex-row md:items-center",children:[(0,s.jsxs)("div",{className:"relative flex-grow md:max-w-xs",children:[(0,s.jsx)(w.Z,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),(0,s.jsx)(k.I,{className:"pl-9",placeholder:"Filter by keyword or destination URL...",value:t,onChange:e=>a(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 md:ml-auto",children:[(0,s.jsxs)(C.Ph,{value:l,onValueChange:n,children:[(0,s.jsx)(C.i4,{className:"w-[150px]",children:(0,s.jsx)(C.ki,{})}),(0,s.jsx)(C.Bw,{children:S.map(e=>(0,s.jsx)(C.Ql,{value:e.value,children:e.label},e.value))})]}),(0,s.jsxs)(C.Ph,{value:r,onValueChange:i,children:[(0,s.jsx)(C.i4,{className:"w-[160px]",children:(0,s.jsx)(C.ki,{})}),(0,s.jsx)(C.Bw,{children:D.map(e=>(0,s.jsx)(C.Ql,{value:e.value,children:e.label},e.value))})]}),(0,s.jsx)(g.z,{variant:"outline",size:"icon",onClick:o,title:"Refresh",disabled:d,children:(0,s.jsx)(y.Z,{className:"h-4 w-4 ".concat(d?"animate-spin":"")})})]})]})}var _=a(30381),R=a.n(_),Z=a(78865),L=a(18289),A=a(67910),T=a(20425),U=a(33633),I=a(37864),M=a(61258),E=a(4307),Y=a(80708),P=a(7394);let F={active:"bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-950 dark:text-emerald-400 dark:border-emerald-900",expired:"bg-rose-100 text-rose-800 border-rose-200 dark:bg-rose-950 dark:text-rose-400 dark:border-rose-900",disabled:"bg-slate-200 text-slate-700 border-slate-300 dark:bg-slate-800 dark:text-slate-300 dark:border-slate-700"};function B(e){let{value:t}
1=e,[a,l]=(0,n.useState)(!1);return(0,s.jsx)("button",{type:"button",className:"rounded p-1 opacity-0 transition-all hover:bg-muted group-hover:opacity-100",title:"Copy short link",onClick:e=>{e.stopPropagation(),navigator.clipboard.writeText(t),l(!0),setTimeout(()=>l(!1),1500)},children:a?(0,s.jsx)(Z.Z,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,s.jsx)(L.Z,{className:"h-3.5 w-3.5"})})}function O(e){let{links:t,isLoading:a,shortLinkOrigin:l,page:n,totalPages:r,total:i,onPageChange:o,onShowQr:d,onOpenAnalytics:c,onDelete:u}=e;return a||t&&0!==t.length?(0,s.jsxs)("div",{className:"overflow-hidden rounded-xl border bg-background shadow-sm",children:[(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)(Y.iA,{children:[(0,s.jsx)(Y.xD,{children:(0,s.jsxs)(Y.SC,{className:"bg-muted/40 hover:bg-muted/40",children:[(0,s.jsx)(Y.ss,{children:"Short Link"}),(0,s.jsx)(Y.ss,{children:"Original URL"}),(0,s.jsx)(Y.ss,{className:"text-right",children:"Clicks"}),(0,s.jsx)(Y.ss,{children:"Status"}),(0,s.jsx)(Y.ss,{children:"Created"}),(0,s.jsx)(Y.ss,{className:"text-right",children:"Actions"})]})}),(0,s.jsx)(Y.RM,{children:a?Array.from({length:5}).map((e,t)=>(0,s.jsx)(Y.SC,{children:(0,s.jsx)(Y.pj,{colSpan:6,children:(0,s.jsx)("div",{className:"h-5 w-full animate-pulse rounded bg-muted"})})},t)):t.map(e=>{var t,a,n;let r=null!==(t=e.slug)&&void 0!==t?t:e.id,i="".concat(l,"/l/").concat(r);return(0,s.jsxs)(Y.SC,{className:"group cursor-pointer",onClick:()=>c(e),children:[(0,s.jsx)(Y.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsxs)("span",{className:"font-semibold",style:{color:"#003d9b"},children:["/l/",r]}),(0,s.jsx)(B,{value:i})]})}),(0,s.jsx)(Y.pj,{className:"max-w-[220px] truncate text-muted-foreground",title:e.destinationUrl,children:e.destinationUrl}),(0,s.jsx)(Y.pj,{className:"text-right font-bold",children:(null!==(a=e.clickCount)&&void 0!==a?a:0).toLocaleString()}),(0,s.jsx)(Y.pj,{children:(0,s.jsx)(P.C,{variant:"outline",className:"uppercase tracking-wider ".concat(null!==(n=F[e.effectiveStatus])&&void 0!==n?n:F.disabled),children:e.effectiveStatus})}),(0,s.jsx)(Y.pj,{className:"text-muted-foreground",children:e.createdAt?R()(e.createdAt).format("MMM D, YYYY"):"-"}),(0,s.jsx)(Y.pj,{className:"text-right",children:(0,s.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,s.jsx)(g.z,{variant:"ghost",size:"icon",title:"QR Code",onClick:t=>{t.stopPropagation(),d(e)},children:(0,s.jsx)(T.Z,{className:"h-4 w-4"})}),(0,s.jsx)(g.z,{variant:"ghost",size:"icon",title:"Analytics",onClick:t=>{t.stopPropagation(),c(e)},children:(0,s.jsx)(U.Z,{className:"h-4 w-4"})}),(0,s.jsx)(g.z,{variant:"ghost",size:"icon",title:"Delete",className:"hover:bg-rose-100 hover:text-rose-600 dar
1k:hover:bg-rose-950",onClick:t=>{t.stopPropagation(),u(e)},children:(0,s.jsx)(I.Z,{className:"h-4 w-4"})})]})})]},r)})})]})}),!a&&r>1&&(0,s.jsxs)("div",{className:"flex items-center justify-between border-t bg-muted/30 px-4 py-3",children:[(0,s.jsxs)("span",{className:"text-xs text-muted-foreground",children:["Showing page ",n," of ",r," (",i," links)"]}),(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(g.z,{variant:"ghost",size:"icon",disabled:n<=1,onClick:()=>o(n-1),children:(0,s.jsx)(M.Z,{className:"h-4 w-4"})}),(0,s.jsx)(g.z,{variant:"ghost",size:"icon",disabled:n>=r,onClick:()=>o(n+1),children:(0,s.jsx)(E.Z,{className:"h-4 w-4"})})]})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-3 rounded-xl border bg-background py-16 text-center",children:[(0,s.jsx)(A.Z,{className:"h-10 w-10 text-muted-foreground"}),(0,s.jsx)("p",{className:"font-semibold",children:"No links yet"}),(0,s.jsx)("p",{className:"max-w-xs text-sm text-muted-foreground",children:"Create your first trackable short link to see it show up here."})]})}var V=a(42171),q=a(23346),$=a(23432),Q=a(98310),K=a(59892),H=a(46256),X=a(55002),J=a(23616),W=a(45610);function G(e){if(!e||"string"!=typeof e)return!1;try{let t=new URL(e);return"http:"===t.protocol||"https:"===t.protocol}catch(e){return!1}}let ee="#003d9b",et={destinationUrl:"",slug:"",utmSource:"",utmMedium:"",utmCampaign:"",expiryDate:void 0,neverExpires:!0};function ea(e){let{open:t,onOpenChange:a,organizationId:i,userId:o,onCreated:d}=e,[u,x]=(0,n.useState)(et),[f,h]=(0,n.useState)(!1),[p,j]=(0,n.useState)(!1),b=window.location.origin.replace(/^https?:\/\//,""),N=u.slug.trim()||"your-slug",w=()=>{x(et),h(!1),a(!1)},y=async e=>{var t,a,s;if(e.preventDefault(),!G(u.destinationUrl)){(0,W.Am)({title:"Invalid destination URL",description:"Please enter a valid http(s) URL.",className:"bg-red-700 text-white border-0"});return}j(!0);try{let e=l.w.getItem("clerk"),a=await r.Z.post("/api/v1/tools/link/create",{organizationId:i,userId:o,destinationUrl:u.destinationUrl.trim(),slug:u.slug.trim()||void 0,utm:{source:u.utmSource,medium:u.utmMedium,campaign:u.utmCampaign},neverExpires:u.neverExpires,expiresAt:u.neverExpires?null:null!==(t=u.expiryDate)&&void 0!==t?t:null},{headers:{Authorization:"Bearer ".concat(e)}});(0,W.Am)({title:"Link created",className:"bg-green-700 text-white border-0"}),null==d||d(a.data.data),w()}catch(e){(0,W.Am)({title:"Failed to create link",description:(null==e?void 0:null===(s=e.response)||void 0===s?void 0:null===(a=s.data)||void 0===a?void 0:a.message)||e.message,className:"bg-red-700 text-white border-0"})}finally{j(!1)}};return(0,s.jsx)(v.Vq,{open:t,onOpenChange:e=>p?null:e?a(e):w(),children:(0,s.jsxs)(v.cZ,{className:"max-h-[90vh] max-w-lg overflow-y-auto",children:[(0,s.jsx)(v.fK,{children:(0,s.jsxs)(v.$N,{className:"flex items-center gap-2",children:[(0,s.jsx)(m.Z,{className:"h-5 w-5",style:{color:ee}}),"Create New Link"]})}),(0,s.jsxs)("form",{onSubmit:y,className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsxs)(Q._,{children:["Destination URL ",(0,s.jsx)("span",{style:{color:"#ba1a1a"},children:"*"})]}),(0,s.jsx)(k.I,{placeholder:"https://example.com/product/summer-special-2024",value:u.destinationUrl,onChange:e=>x(t=>({...t,destinationUrl:e.target.value})),required:!0})]}),(0,s.jsxs)("div",{className:"grid grid-cols-[auto_1fr] gap-2",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(Q._,{children:"Domain"}),(0,s.jsxs)("div",{className:"flex h-9 items-center rounded-md border bg-muted/40 px-3 text-sm text-muted-foreground",children:[b,"/l/"]})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(Q._,{children:"Custom Slug (optional)"}),(0,s.jsx)(k.I,{placeholder:"summer-sale",value:u.slug,onChange:e=>x(t=>({...t,slug:e.target.value}))})]})]}),(0,s.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-3",children:[(0,s.jsx)("p",{className:"mb-1 text-xs font-semibold uppercase tracking-wide",style:{color:ee},children:"Live Preview"}),(0,s.jsxs)("p",{className:"break-all font-semibold",style:{color:ee},children:[b,"/l/",N]})]}),(0,s.jsxs)(J.zF,{open:f,onOpenChange:h,children:[(0,s.jsx)(J.wy,{asChild:!0,children:(0,s.jsxs)("button",{type:"button",className:"flex w-full items-center justify-between rounded-lg border px-4 py-3 text-sm font-medium hover:bg-muted/40",children:["Advanced options",(0,s.jsx)(V.Z,{className:"h-4 w-4 transition-transform ".concat(f?"rotate-180":"")})]})}),(0,s.jsxs)(J.Fw,{className:"space-y-4 pt-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(Q._,{className:"text-xs uppercase text-muted-foreground",children:"UTM Builder"}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsx)(k.I,{placeholder:"Source",value:u.utmSource,onCh
1ange:e=>x(t=>({...t,utmSource:e.target.value}))}),(0,s.jsx)(k.I,{placeholder:"Medium",value:u.utmMedium,onChange:e=>x(t=>({...t,utmMedium:e.target.value}))}),(0,s.jsx)(k.I,{placeholder:"Campaign",value:u.utmCampaign,onChange:e=>x(t=>({...t,utmCampaign:e.target.value}))})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[(0,s.jsx)(Q._,{className:"cursor-pointer",children:"Never expires"}),(0,s.jsx)(K.r,{checked:u.neverExpires,onCheckedChange:e=>x(t=>({...t,neverExpires:e}))})]}),!u.neverExpires&&(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(Q._,{children:"Expiry Date"}),(0,s.jsxs)(H.J2,{children:[(0,s.jsx)(H.xo,{asChild:!0,children:(0,s.jsxs)(g.z,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[(0,s.jsx)(q.Z,{className:"mr-2 h-4 w-4"}),u.expiryDate?R()(u.expiryDate).format("YYYY-MM-DD"):"Pick a date"]})}),(0,s.jsx)(H.yk,{className:"w-auto p-0",align:"start",children:(0,s.jsx)(X.f,{mode:"single",selected:u.expiryDate,onSelect:e=>x(t=>({...t,expiryDate:e})),disabled:e=>e<new Date(new Date().setHours(0,0,0,0)),initialFocus:!0})})]})]})]})]}),u.destinationUrl&&G(u.destinationUrl)&&(0,s.jsx)("div",{className:"flex justify-center rounded-xl border bg-white p-3",children:(0,s.jsx)(c.t,{value:"https://".concat(b,"/l/").concat(N),size:96})}),(0,s.jsxs)(v.cN,{className:"gap-2",children:[(0,s.jsx)(g.z,{type:"button",variant:"outline",onClick:w,disabled:p,children:"Cancel"}),(0,s.jsxs)(g.z,{type:"submit",style:{backgroundColor:ee},disabled:p,children:[p&&(0,s.jsx)($.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Generate Link"]})]})]})]})})}var es=a(64715),el=a(9984),en=a(25615),er=a(88793),ei=a(24570),eo=a(31536),ed=a(33058),ec=a(14947),eu=a(65521);let em="#003d9b",ex=[7,30,90];function ef(){return l.w.getItem("clerk")}function eh(e){var t,a;let{link:l,open:i,onOpenChange:o,organizationId:d,shortLinkOrigin:u,onUpdated:m,onDeleted:f}
1=e,[h,v]=(0,n.useState)(30),[j,b]=(0,n.useState)(""),[N,w]=(0,n.useState)("active"),[y,C]=(0,n.useState)(void 0),[S,D]=(0,n.useState)(!0),[z,_]=(0,n.useState)(!1),[A,T]=(0,n.useState)(!1),[U,I]=(0,n.useState)(!1),[M,E]=(0,n.useState)(!1);if((0,n.useEffect)(()=>{if(l){var e,t;b(null!==(e=l.destinationUrl)&&void 0!==e?e:""),w(null!==(t=l.status)&&void 0!==t?t:"active"),C(l.expiresAt?new Date(l.expiresAt):void 0),D(!l.expiresAt)}},[l]),!l)return null;let Y=null!==(t=l.slug)&&void 0!==t?t:l.id,P="".concat(u,"/l/").concat(Y),F=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:30,a=[],s=new Date;for(let n=t-1;n>=0;n-=1){var l;let t=new Date(s);t.setUTCDate(t.getUTCDate()-n);let r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,t=new Date(e),a=t.getUTCFullYear(),s=String(t.getUTCMonth()+1).padStart(2,"0"),l=String(t.getUTCDate()).padStart(2,"0");return"".concat(a,"-").concat(s,"-").concat(l)}(t);a.push({date:r,clicks:Number(null!==(l=null==e?void 0:e[r])&&void 0!==l?l:0)})}return a}(l.clicksByDate,h),B=async()=>{if(!G(j)){(0,W.Am)({title:"Invalid destination URL",className:"bg-red-700 text-white border-0"});return}T(!0);
1try{let e=ef(),t=await r.Z.post("/api/v1/tools/link/update",{organizationId:d,slug:Y,updates:{destinationUrl:j,status:N,neverExpires:S,expiresAt:S?null:null!=y?y:null}},{headers:{Authorization:"Bearer ".concat(e)}});(0,W.Am)({title:"Link updated",className:"bg-green-700 text-white border-0"}),null==m||m(t.data.data)}catch(a){var e,t;(0,W.Am)({title:"Failed to update link",description:(null==a?void 0:null===(t=a.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||a.message,className:"bg-red-700 text-white border-0"})}finally{T(!1)}},O=async()=>{I(!0);try{let e=ef();await r.Z.post("/api/v1/tools/link/delete",{organizationId:d,slug:Y},{headers:{Authorization:"Bearer ".concat(e)}}),(0,W.Am)({title:"Link deleted",className:"bg-green-700 text-white border-0"}),E(!1),o(!1),null==f||f(Y)}catch(a){var e,t;(0,W.Am)({title:"Failed to delete link",description:(null==a?void 0:null===(t=a.response)||void 0===t?void 0:null===(e=t.data)||void 0===e?void 0:e.message)||a.message,className:"bg-red-700 text-white border-0"})}finally{I(!1)}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ec.yo,{open:i,onOpenChange:o,children:(0,s.jsxs)(ec.ue,{className:"flex w-full flex-col gap-0 overflow-y-auto p-0 sm:max-w-lg",children:[(0,s.jsxs)(ec.Tu,{className:"space-y-4 border-b p-6 text-left",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(ec.bC,{children:"Analytics"}),(0,s.jsx)("p",{className:"mt-1 truncate font-medium",style:{color:em},children:P})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)(g.z,{variant:"outline",className:"flex-1 gap-2",onClick:()=>{navigator.clipboard.writeText(P),_(!0),setTimeout(()=>_(!1),1500)},children:[z?(0,s.jsx)(Z.Z,{className:"h-4 w-4 text-emerald-500"}):(0,s.jsx)(L.Z,{className:"h-4 w-4"}),"Copy URL"]}),(0,s.jsx)(g.z,{variant:"outline",size:"icon",title:"Download QR",onClick:()=>{let e=document.getElementById("link-qr-".concat(Y));if(!e)return;let t=new XMLSerializer().serializeToString(e),a=document.createElement("canvas");a.width=256,a.height=256;let s=a.getContext("2d"),l=new Image;l.onload=()=>{s.fillStyle="#ffffff",s.fillRect(0,0,a.width,a.height),s.drawImage(l,0,0,a.width,a.height);let e=a.toDataURL("image/png"),t=document.createElement("a");t.href=e,t.download="".concat(Y,"-qr.png"),t.click()},l.src="data:image/svg+xml;base64,".concat(btoa(unescape(encodeURIComponent(t))))},children:(0,s.jsx)(p.Z,{className:"h-4 w-4"})}),(0,s.jsx)("div",{className:"rounded-lg border bg-white p-1.5",children:(0,s.jsx)(c.t,{id:"link-qr-".concat(Y),value:P,size:32})})]})]}),(0,s.jsxs)("div",{className:"flex-1 space-y-6 p-6",children:[(0,s.jsxs)("section",{children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,s.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Click Performance"}),(0,s.jsx)("div",{className:"flex gap-1 rounded-lg bg-muted p-1",children:ex.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>v(e),className:"rounded-md px-2.5 py-1 text-xs font-medium transition-colors ".concat(h===e?"text-white":"text-muted-foreground hover:bg-background"),style:h===e?{backgroundColor:em}:void 0,children:[e,"D"]},e))})]}),(0,s.jsx)("div",{className:"h-48 w-full rounded-xl border bg-muted/20 p-2",children:(0,s.jsx)(es.h,{width:"100%",height:"100%",children:(0,s.jsxs)(el.v,{data:F,children:[(0,s.jsx)(en.K,{dataKey:"date",tickFormatter:e=>R()(e).format("MMM D"),tick:{fontSize:10},interval:Math.max(0,Math.floor(F.length/6))}),(0,s.jsx)(er.B,{allowDecimals:!1,tick:{fontSize:10},width:28}),(0,s.jsx)(ei.u,{labelFormatter:e=>R()(e).format("MMM D, YYYY"),formatter:e=>[e,"Clicks"]}),(0,s.jsx)(eo.$,{dataKey:"clicks",fill:em,radius:[4,4,0,0]})]})})}),(0,s.jsxs)("div",{className:"mt-4 rounded-xl border bg-muted/20 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,s.jsx)(x.Z,{className:"h-3.5 w-3.5"}),"Total Clicks"]}),(0,s.jsx)("p",{className:"mt-1 text-2xl font-bold",children:(null!==(a=l.clickCount)&&void 0!==a?a:0).toLocaleString()})]})]}),(0,s.jsxs)("section",{className:"space-y-3",children:[(0,s.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Audience Insights"}),(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 rounded-xl border border-dashed bg-muted/10 py-8 text-center",children:[(0,s.jsx)(ed.Z,{className:"h-6 w-6 text-muted-foreground"}),(0,s.jsx)("p",{className:"text-sm font-medium",children:"Coming soon"}),(0,s.jsx)("p",{className:"max-w-[240px] text-xs text-muted-foreground",children:"Device, referrer and location breakdown will be available in a future update."})]})]}),(0,s.jsxs)("section",{className:"space-y-4 border-t pt-6",children:[(0,s.jsx)("h4",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:"Configuration"}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(Q._,{children:"Destination URL"}),(0,s.jsx)(k.I,{value:j,onChange:e=>b(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)(Q._,{className:"cursor-pointer",children:"Status"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"active"===N?"Active":"Disabled"})]}),(0,s.jsx)(K.r,{checked:"active"===N,onCheckedChange:e=>w(e?"active":"disabled")})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border px-4 py-3",children:[(0,s.jsx)(Q._,{className:"cursor-pointer",children:"Never expires"}),(0,s.jsx)(K.r,{checked:S,onCheckedChange:D})]}),!S&&(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)(Q._,{children:"Expiry Date"}),(0,s.jsxs)(H.J2,{children:[(0,s.jsx)(H.xo,{asChild:!0,children:(0,s.jsxs)(g.z,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[(0,s.jsx)(q.Z,{className:"mr-2 h-4 w-4"}),y?R()(y).format("YYYY-MM-DD"):"Pick a date"]})}),(0,s.jsx)(H.yk,{className:"w-auto p-0",align:"start",children:(0,s.jsx)(X.f,{mode:"single",selected:y,onSelect:C,initialFocus:!0})})]})]})]})]}),(0,s.jsxs)("div",{className:"flex gap-3 border-t p-6",children:[(0,s.jsxs)(g.z,{className:"flex-grow",style:{backgroundColor:em},onClick:B,disabled:A,children:[A&&(0,s.jsx)($.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]}),(0,s.jsx)(g.z,{variant:"outline",className:"border-rose-500 text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950",onClick:()=>E(!0),children:"Delete"})]})]})}),(0,s.jsx)(eu.aR,{open:M,onOpenChange:E,children:(0,s.jsxs)(eu._T,{children:[(0,s.jsxs)(eu.fY,{children:[(0,s.jsx)(eu.f$,{children:"Delete this link?"}),(0,s.jsxs)(eu.yT,{children:["This will permanently delete ",(0,s.jsx)("span",{className:"font-semibold",children:P})," and stop tracking its clicks. This action cannot be undone."]})]}),(0,s.jsxs)(eu.xo,{children:[(0,s.jsx)(eu.le,{disabled:U,children:"Cancel"}),(0,s.jsxs)(eu.OL,{onClick:O,disabled:U,className:"bg-rose-600 hover:bg-rose-700",children:[U&&(0,s.jsx)($.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Delete"]})]})]})})]})}let ep="#003d9b";function eg(){return l.w.getItem("clerk")}function ev(){var e,t,a,l,i,w,y;let{organization:k}=(0,d.o8)(),{user:C}
1=(0,d.aF)(),S=null==k?void 0:k.id,[D,_]=(0,n.useState)("affiliate.id");(0,n.useEffect)(()=>{_(window.location.origin.replace(/^https?:\/\//,""))},[]);let[R,Z]=(0,n.useState)([]),[L,A]=(0,n.useState)(0),[T,U]=(0,n.useState)(1),[I,M]=(0,n.useState)(!0),[E,Y]=(0,n.useState)(!1),[P,F]=(0,n.useState)(""),[B,V]=(0,n.useState)("all"),[q,$]=(0,n.useState)("newest"),[Q,K]=(0,n.useState)(null),[H,X]=(0,n.useState)(!0),[J,W]=(0,n.useState)(!1),[G,ee]=(0,n.useState)(null),[et,es]=(0,n.useState)(null),el=(0,n.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!S)return;let{silent:t}=e;t?Y(!0):M(!0);try{var a,s,l,n;let e=eg(),t=await r.Z.post("/api/v1/tools/link/list",{organizationId:S,search:P,status:B,sortBy:q,page:T,limit:10},{headers:{Authorization:"Bearer ".concat(e)}});Z(null!==(l=null===(a=t.data.data)||void 0===a?void 0:a.data)&&void 0!==l?l:[]),A(null!==(n=null===(s=t.data.data)||void 0===s?void 0:s.total)&&void 0!==n?n:0)}catch(e){console.error("Failed to load links:",e.message),Z([]),A(0)}finally{M(!1),Y(!1)}},[S,P,B,q,T]),en=(0,n.useCallback)(async()=>{if(S){X(!0);try{let e=eg(),t=await r.Z.post("/api/v1/tools/link/stats",{organizationId:S},{headers:{Authorization:"Bearer ".concat(e)}});K(t.data.data)}catch(e){console.error("Failed to load link stats:",e.message)}finally{X(!1)}}},[S]);(0,n.useEffect)(()=>{el()},[el]),(0,n.useEffect)(()=>{en()},[en]);let er=(0,n.useMemo)(()=>o()(e=>{U(1),F(e)},400),[]),[ei,eo]=(0,n.useState)(""),ed=e=>{Z(t=>t.filter(t=>{var a;return(null!==(a=t.slug)&&void 0!==a?a:t.id)!==e})),ee(null),el({silent:!0}),en()},ec=async e=>{var t,a,s;if(window.confirm("Delete short link /l/".concat(null!==(t=e.slug)&&void 0!==t?t:e.id,"? This cannot be undone.")))try{let t=eg();await r.Z.post("/api/v1/tools/link/delete",{organizationId:S,slug:null!==(a=e.slug)&&void 0!==a?a:e.id},{headers:{Authorization:"Bearer ".concat(t)}}),ed(null!==(s=e.slug)&&void 0!==s?s:e.id)}catch(e){console.error("Failed to delete link:",e.message)}};return S?(0,s.jsxs)("div",{className:"flex h-full min-h-fit w-full flex-col gap-6 p-6",children:[(0,s.jsxs)("div",{className:"flex flex-col items-start justify-between gap-4 md:flex-row md:items-center",children:[(0,s.jsx)(j.Z,{headline:"Link Mask"}),(0,s.jsxs)(g.z,{className:"gap-2",style:{backgroundColor:ep},onClick:()=>W(!0),children:[(0,s.jsx)(u.Z,{className:"h-4 w-4"}),"Create New Link"]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,s.jsx)(N.Z,{icon:(0,s.jsx)(m.Z,{className:"h-4 w-4"}),label:"Total Links Created",value:H?void 0:(null!==(e=null==Q?void 0:Q.totalLinks)&&void 0!==e?e:0).toLocaleString()}),(0,s.jsx)(N.Z,{icon:(0,s.jsx)(x.Z,{className:"h-4 w-4"}),label:"Total Clicks",value:H?void 0:(null!==(t=null==Q?void 0:Q.totalClicks)&&void 0!==t?t:0).toLocaleString()}),(0,s.jsx)(N.Z,{icon:(0,s.jsx)(f.Z,{className:"h-4 w-4"}),label:"Active Links",value:H?void 0:(null!==(a=null==Q?void 0:Q.activeLinks)&&void 0!==a?a:0).toLocaleString(),subtitle:!H&&(null==Q?void 0:Q.inactiveLinks)?"".concat(Q.inactiveLinks," expired or disabled"):void 0,subtitleClassName:"text-rose-600"}),(0,s.jsx)(N.Z,{icon:(0,s.jsx)(h.Z,{className:"h-4 w-4"}),label:"Top Performing Link",value:H?void 0:(null==Q?void 0:Q.topPerformingLink)?"".concat((null!==(l=Q.topPerformingLink.clickCount)&&void 0!==l?l:0).toLocaleString()," clicks"):"-",subtitle:!H&&(null==Q?void 0:Q.topPerformingLink)?"/l/".concat(Q.topPerformingLink.slug):"No clicks yet",accentBorder:!0})]}),(0,s.jsx)(z,{search:ei,onSearchChange:e=>{eo(e),er(e)},status:B,onStatusChange:e=>{U(1),V(e)},sortBy:q,onSortByChange:e=>{U(1),$(e)},onRefresh:()=>el({silent:!0}),isRefreshing:E}),(0,s.jsx)(O,{links:R,isLoading:I,shortLinkOrigin:D,page:T,totalPages:Math.max(1,Math.ceil(L/10)),total:L,onPageChange:U,onShowQr:es,onOpenAnalytics:ee,onDelete:ec}),(0,s.jsx)(ea,{open:J,onOpenChange:W,organizationId:S,userId:null==C?void 0:C.id,onCreated:()=>{U(1),el(),en()}}),(0,s.jsx)(eh,{link:G,open:!!G,onOpenChange:e=>!e&&ee(null),organizationId:S,shortLinkOrigin:D,onUpdated:e=>{var t;let a=null!==(t=e.slug)&&void 0!==t?t:e.id;Z(t=>t.map(t=>{var s;return(null!==(s=t.slug)&&void 0!==s?s:t.id)===a?{...t,...e}:t})),ee(t=>t?{...t,...e}:t),el({silent:!0}),en()},onDeleted:ed}),(0,s.jsx)(v.Vq,{open:!!et,onOpenChange:e=>!e&&es(null),children:(0,s.jsxs)(v.cZ,{className:"max-w-xs",children:[(0,s.jsx)(v.fK,{children:(0,s.jsx)(v.$N,{children:"QR Code"})}),et&&(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,s.jsx)("div",{className:"rounded-xl border bg-white p-4",children:(0,s.jsx)(c.t,{id:"qr-preview-".concat(null!==(i=et.slug)&&void 0!==i?i:et.id),value:"https://".concat(D,"/l/").concat(null!==(w=et.slug)&&void 0!==w?w:et.id),size:180})}),(0,s.jsxs)("p",{className:"text-sm text-muted-foreground",children:["/l/",null!==(y=et.slug)&&void 0!==y?y:et.id]}),(0,s.jsxs)(g.z,{className:"w-full gap-2",style:{backgroundColor:ep},onClick:()=>{var e;if(!et)return;let t=null!==(e=et.slug)&&void 0!==e?e:et.id,a=document.getElementById("qr-preview-".concat(t));if(!a)return;let s=new XMLSerializer().serializeToString(a),l=document.createElement("canvas");l.width=256,l.height=256;let n=l.getContext("2d"),r=new Image;r.onload=()=>{n.fillStyle="#ffffff",n.fillRect(0,0,l.width,l.height),n.drawImage(r,0,0,l.width,l.height);let e=l.toDataURL("image/png"),a=document.createElement("a");a.href=e,a.download="".concat(t,"-qr.png"),a.click()},r.src="data:image/svg+xml;base64,".concat(btoa(unescape(encodeURIComponent(s))))},children:[(0,s.jsx)(p.Z,{className:"h-4 w-4"}),"Download QR"]})]})]})})]}):(0,s.jsx)("div",{className:"flex h-full min-h-fit w-full items-center justify-center p-6",children:(0,s.jsx)(b.Z,{})})}}},function(e){e.O(0,[4885,7010,939,41,6747,1508,6482,2888,9774,179],function(){return e(e.s=5687)}),_N_E=e.O()}]);

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.