PageSourceSearch

https://sock-shop-spark.lovable.app/assets/_app.profile-C1tC__MX.js

js sock-shop-spark.lovable.app collected 2026-10-03 03:45:45 UTC 6,124 bytes, 1 lines download raw bytes

1import{r as s,j as e,S as I,m as T,d as c,c as K,u as z,a as b,X as D}from"./index-Bratghjx.js";import{B as l}from"./button-W8DTlMrk.js";import{I as f}from"./input-CyjFVtTp.js";import{L as g}from"./label-CaTTPTiq.js";import{C as $}from"./check-Cf8MB9EI.js";import{C as O}from"./copy-D7GMHK56.js";import{E as A}from"./eye-B3533gdR.js";import{G as B}from"./GuideCta-D2ZRN42z.js";import{s as G}from"./errors-DucJlKMR.js";import{L as k}from"./loader-circle-BlACLt8x.js";import{S as H}from"./smartphone-em43ttb3.js";import{L as M}from"./log-out-BTQDQzZj.js";import"./utils-BQHNewu7.js";function R({handle:n,sellerName:u,teamName:x}){const[i,r]=s.useState(!1),o=typeof window<"u"?`${window.location.origin}/s/${n}`:`/s/${n}`,m=x||u||"Sockteam",d=async()=>{try{await navigator.clipboard.writeText(o),r(!0),c.success("Kopierad – redo att klistra in och dela!"),setTimeout(()=>r(!1),2e3)}catch{c.error("Kunde inte kopiera")}};return e.jsxs("div",{className:"rounded-3xl bg-gradient-to-br from-primary/15 via-card to-card p-5 shadow-[var(--shadow-soft)] ring-1 ring-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-primary",children:[e.jsx(I,{className:"h-3.5 w-3.5"}),"Min butik"]}),e.jsx("h2",{className:"mt-2 text-lg font-black text-foreground",children:"Sälj till hela ditt nätverk 🚀"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Skicka din butik till mormor, klassen, träningsgruppen eller dela på Snap, Insta & TikTok."}),e.jsxs(l,{onClick:d,size:"lg",className:"mt-4 h-14 w-full rounded-2xl text-base font-black shadow-[var(--shadow-glow)]",children:[i?e.jsx($,{className:"mr-2 h-5 w-5"}):e.jsx(T,{className:"mr-2 h-5 w-5"}),i?"Kopierad!":`Dela ${m}`]}),e.jsxs("div",{className:"mt-2 grid grid-cols-2 gap-2",children:[e.jsxs(l,{onClick:d,variant:"outline",size:"lg",className:"h-12 rounded-2xl font-bold",children:[e.jsx(O,{className:"mr-2 h-4 w-4"}),"Kopiera länk"]}),e.jsx(l,{asChild:!0,variant:"outline",size:"lg",className:"h-12 rounded-2xl font-bold",children:e.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(A,{className:"mr-2 h-4 w-4"}),"Visa min butik"]})})]})]})}function re(){const{user:n,signOut:u,refresh:x}=K(),i=z(),[r,o]=s.useState(""),[m,d]=s.useState(""),[j,N]=s.useState(""),[y,S]=s.useState(""),[p,C]=s.useState(""),[v,L]=s.useState(null),[_,E]=s.useState(!0),[h,w]=s.useState(!1);s.useEffect(()=>{if(!n)return;let a=!0;return(async()=>{const t=await b.profile().catch(()=>null);a&&(o(t?.first_name??""),d(t?.last_name??""),N(t?.mobile_number??""),S(t?.email??""),C(t?.team_name??""),L(t?.public_slug??null),E(!1))})(),()=>{a=!1}},[n]);const P=async a=>{a.preventDefault(),w(!0);try{await b.updateProfile({first_name:r.trim(),last_name:m.trim(),mobile_number:j.trim()}),await x(),c.success("Profil uppdaterad")}catch(t){c.error(G(t,"Kunde inte spara"))}finally{w(!1)}},F=async()=>{u(),c.success("Utloggad"),i({to:"/"})};return _?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(k,{className:"h-6 w-6 animate-spin text-primary"})}):e.jsxs("div",{className:"space-y-6 animate-[fade-in_0.4s_ease-out]",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-display text-2xl font-bold text-foreground sm:text-3xl",children:"Profil"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:y||p})]}),v&&e.jsx(R,{handle:v,sellerName:r,teamName:p}),e.jsxs("form",{onSubmit:P,className:"rounded-3xl bg-card p-6 shadow-[var(--shadow-soft)] space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"firstName",children:"Förnamn"}),e.jsx(f,{id:"firstName",value:r,onChange:a=>o(a.target.value),className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"lastName",children:"Efternamn"}),e.jsx(f,{id:"lastName",value:m,onChange:a=>d(a.target.value),className:"rounded-xl"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(g,{htmlFor:"phone",children:"Telefon"}),e.jsx(f,{id:"phone",type:"tel",inputMode:"tel",value:j,onChange:a=>N(a.target.value),className:"rounded-xl",placeholder:"07…"})]}),e.jsxs("div",{className:"rounded-2xl bg-muted/40 p-4 space-y-1",children:[e.jsx("p",{className:"text-xs font-bold uppercase tracking-wider text-muted-foreground",children:"Ditt lag"}),e.jsx("p",{className:"text-sm font-semibold text-foreground",children:p||"—"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Lagets uppgifter hanteras av din lagansvariga."})]}),e.jsxs(l,{type:"submit",disabled:h,className:"h-12 w-full rounded-full text-base font-bold",children:[h&&e.jsx(k,{className:"mr-2 h-5 w-5 animate-spin"}),h?"Sparar…":"Spara ändringar"]})]}),e.jsx(B,{compact:!0}),e.jsxs("div",{className:"relative overflow-hidden rounded-3xl bg-gradient-to-br from-primary/15 via-card to-card p-6 shadow-[var(--shadow-soft)] ring-1 ring-primary/20",children:[e.jsx("div",{className:"pointer-events-none absolute -right-16 -top-16 h-48 w-48 rounded-full bg-primary/15 blur-3xl","aria-hidden":"true"}),e.jsxs("div",{className:"relative",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-primary",children:[e.jsx(H,{className:"h-3.5 w-3.5"}),"Ladda ner appen"]}),e.jsx("h2",{className:"mt-2 text-lg font-black text-foreground",children:"Ha Sockteam i fickan 📱"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Installera appen på din mobil — registrera sälj direkt, även utan dator."}),e.jsxs(l,{type:"button",size:"lg",className:"mt-4 h-14 w-full rounded-2xl text-base font-black shadow-[var(--shadow-glow)]",onClick:()=>{sessionStorage.setItem("sockteam:force-install-flow","1"),i({to:"/install"})},children:[e.jsx(D,{className:"mr-2 h-5 w-5"}),"Installera appen nu"]}),e.jsx("p",{className:"mt-3 text-center text-[11px] text-muted-foreground",children:"Fungerar på iPhone och Android — guidar dig steg för steg."})]})]}),e.jsxs(l,{variant:"outline",className:"w-full rounded-full",onClick:F,children:[e.jsx(M,{className:"mr-2 h-4 w-4"}),"Logga ut"]})]})}export{re as component};

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.