PageSourceSearch

https://nircle.com/assets/CreatorLinkBioEditView-BHwrXj_w.js

js nircle.com collected 2026-10-02 22:15:19 UTC 5,401 bytes, 1 lines download raw bytes

1import{e as v,c as g,u as w,r as h,y as _,w as U,f as B,p as V,i as L,b as r,n as u,s as C,h as f,t as m,a as S,k as D,v as N,E as s,H as n,I as M,o as b}from"./vendor-D3ahWMFY.js";import{M as A}from"./MainLayout-IssbuzrT.js";import{_ as E}from"./CoverUploader.vue_vue_type_script_setup_true_lang-DPfx_Zd8.js";import{u as I,a as O}from"./index-YqUjisW-.js";import{r as R}from"./ArrowLeftIcon-u3u3gHvg.js";const T={class:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-6"},j={class:"flex items-center justify-between mb-6"},$={class:"flex items-center gap-3"},q={class:"text-lg font-bold text-gray-900 dark:text-white"},z=["disabled"],F={key:0,class:"w-4 h-4 border-2 border-white border-r-transparent rounded-full animate-spin"},H={class:"space-y-6"},J={class:"flex flex-col sm:flex-row gap-6"},G={class:"flex-1 space-y-4"},K={class:"flex items-center gap-4"},P={class:"p-4 rounded-xl bg-gray-50 dark:bg-gray-800/50 border border-gray-200 dark:border-gray-700"},Q={class:"flex items-center justify-between cursor-pointer"},re=v({__name:"CreatorLinkBioEditView",setup(W){const x=w(),c=C(),y=I(),d=g(()=>x.params.linkId),i=g(()=>d.value==="new"),l=h(!1),t=_({title:"",url:"",description:"",thumbnailUrl:"",order:0,active:!0});function p(){var e;if(i.value)return;const o=(e=window.history.state)==null?void 0:e.linkData;if(o)try{const a=JSON.parse(o);t.title=a.title||"",t.url=a.url||a.link_url||"",t.description=a.description||"",t.thumbnailUrl=a.profile_photo||a.thumbnail_url||a.img_url||"",t.order=a.link_order?parseInt(a.link_order):0,t.active=a.is_active!==!1&&a.is_active!==0}catch{}}async function k(){l.value=!0;const o={title:t.title,link_url:t.url,description:t.description,thumbnail_url:t.thumbnailUrl,link_order:t.order,is_active:t.active};i.value||(o.link_id=d.value);const e=await O.createOrUpdateLinkBio(o);l.value=!1,e.success&&c.replace({name:"CreatorLinkBio",query:{reload:Date.now()}})}return U(d,()=>{t.title="",t.url="",t.description="",t.thumbnailUrl="",t.order=0,t.active=!0,p()}),B(p),(o,e)=>(b(),V(A,{"show-category-tabs":!1,"show-floating-actions":!1,"force-login":!u(y).isAuthenticated},{default:L(()=>[r("div",T,[r("div",j,[r("div",$,[r("button",{class:"p-2 -ml-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",onClick:e[0]||(e[0]=a=>u(c).back())},[f(u(R),{class:"w-5 h-5 text-gray-600 dark:text-gray-400"})]),r("h1",q,m(i.value?"New Link":"Edit Link"),1)]),r("button",{disabled:l.value,class:"flex items-center gap-2 px-4 py-2 bg-[#026B63] text-white text-sm font-semibold rounded-lg hover:bg-[#025A54] transition-colors disabled:opacity-50",onClick:k},[l.value?(b(),S("span",F)):D("",!0),N(" "+m(l.value?"Saving...":i.value?"Create Link":"Update Link"),1)],8,z)]),r("div",H,[r("div",J,[f(E,{modelValue:t.thumbnailUrl,"onUpdate:modelValue":e[1]||(e[1]=a=>t.thumbnailUrl=a),width:120,height:120},null,8,["modelValue"]),r("div",G,[r("div",null,[e[7]||(e[7]=r("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Title",-1)),s(r("input",{"onUpdate:modelValue":e[2]||(e[2]=a=>t.title=a),type:"text",class:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-[#026B63] outline-none",placeholder:"Link title..."},null,512),[[n,t.title]])]),r("div",null,[e[8]||(e[8]=r("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"URL",-1)),s(r("input",{"onUpdate:modelValue":e[3]||(e[3]=a=>t.url=a),type:"url",class:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-[#026B63] outline-none",placeholder:"https://..."},null,512),[[n,t.url]])])])]),r("div",null,[e[9]||(e[9]=r("label",{class:"block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1"},"Description",-1)),s(r("textarea",{"onUpdate:modelValue":e[4]||(e[4]=a=>t.description=a),rows:"4",class:"w-full px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-[#026B63] outline-none resize-none",placeholder:"Brief description..."},null,512),[[n,t.description]])]),r("div",K,[e[10]||(e[10]=r("label",{class:"text-sm font-medium text-gray-700 dark:text-gray-300 whitespace-nowrap"},"Display Order",-1)),s(r("input",{"onUpdate:modelValue":e[5]||(e[5]=a=>t.order=a),type:"number",min:"0",class:"w-24 px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-2 focus:ring-[#026B63] outline-none text-center"},null,512),[[n,t.order,void 0,{number:!0}]])]),r("div",P,[r("label",Q,[e[11]||(e[11]=r("div",null,[r("span",{class:"text-sm font-semibold text-gray-900 dark:text-white"},"Active"),r("p",{class:"text-xs text-gray-400 mt-0.5"},"Show this link on your profile")],-1)),s(r("input",{"onUpdate:modelValue":e[6]||(e[6]=a=>t.active=a),type:"checkbox",class:"sr-only peer"},null,512),[[M,t.active]]),e[12]||(e[12]=r("div",{class:"relative w-10 h-5 bg-gray-300 dark:bg-gray-600 rounded-full peer-checked:bg-[#026B63] transition-colors after:content-[''] after:absolute after:top-0.5 after:left-0.5 after:bg-white after:rounded-full after:h-4 after:w-4 after:transition-transform peer-checked:after:translate-x-5"},null,-1))])])])])]),_:1},8,["force-login"]))}});
1export{re 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.