1import{c as G,r as K,j as t,L as T,a as $,H as B}from"./app-C3WiU00I.js";import{D as H}from"./x-DG5AUD7T.js";import{P as k,a as M}from"./app-layout-BopuvJYF.js";import{u as V,a as A,D as Z,c as q,S as F,v as J,s as O,K as Q,P as U,b as W,d as X,C as Y,G as ee}from"./sortable.esm-DiWIxOm0.js";import{P as te}from"./plus-k9rrR9Na.js";import{P as re}from"./pencil-LZu5NP6s.js";import{T as se}from"./trash-2-CiOHFgQj.js";/* empty css *//* empty css */import"./createLucideIcon-CL8NG2br.js";import"./index-lTUhdoHw.js";import"./index-BXW0mVPq.js";import"./index-ByHX2IpO.js";import"./users-BLrRLA1h.js";const ae=[{title:"Dashboard",href:H.index().url},{title:"Partnerzy",href:k.index().url}];function ne(n){const e=G.c(48),{partner:r}=n;let s;e[0]!==r.id?(s={id:r.id},e[0]=r.id,e[1]=s):s=e[1];const{attributes:P,listeners:c,setNodeRef:h,transform:d,transition:u,isDragging:j}=X(s);let a;e[2]!==d?(a=Y.Transform.toString(d),e[2]=d,e[3]=a):a=e[3];const m=j?.5:1,x=j?10:void 0;let o;e[4]!==a||e[5]!==m||e[6]!==x||e[7]!==u?(o={transform:a,transition:u,opacity:m,zIndex:x},e[4]=a,e[5]=m,e[6]=x,e[7]=u,e[8]=o):o=e[8];const D=o,g=r.is_active?"":"opacity-50";let f;e[9]===Symbol.for("react.memo_cache_sentinel")?(f=t.jsx(ee,{className:"h-4 w-4"}),e[9]=f):f=e[9];let p;e[10]!==P||e[11]!==c?(p=t.jsx("td",{className:"w-10 border p-2",children:t.jsx("button",{...P,...c,className:"cursor-grab touch-none rounded p-1 text-gray-400 hover:text-gray-600 active:cursor-grabbing",title:"PrzeciÄ
gnij, aby zmieniÄ kolejnoÅÄ",children:f})}),e[10]=P,e[11]=c,e[12]=p):p=e[12];let b;e[13]!==r.logo_url||e[14]!==r.name?(b=t.jsx("td",{className:"w-24 border p-2 text-center",children:r.logo_url?t.jsx("img",{src:r.logo_url,alt:r.name,className:"mx-auto h-10 w-auto object-contain"}):t.jsx("span",{className:"text-xs text-gray-400",children:"brak"})}),e[13]=r.logo_url,e[14]=r.name,e[15]=b):b=e[15];let i;e[16]!==r.name?(i=t.jsx("td",{className:"border p-2 font-medium",children:r.name}),e[16]=r.name,e[17]=i):i=e[17];let l;e[18]!==r.website_url?(l=r.website_url?t.jsx("a",{href:r.website_url,target:"_blank",rel:"noreferrer",className:"text-blue-600 hover:underline",children:r.website_url}):"-",e[18]=r.website_url,e[19]=l):l=e[19];let y;e[20]!==l?(y=t.jsx("td",{className:"border p-2 text-sm text-gray-500",children:l}),e[20]=l,e[21]=y):y=e[21];const L=`inline-block rounded-full px-2 py-0.5 text-xs font-semibold ${r.is_active?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"}`,R=r.is_active?"Tak":"Nie";let N;e[22]!==L||e[23]!==R?(N=t.jsx("td",{className:"border p-2 text-center",children:t.jsx("span",{className:L,children:R})}),e[22]=L,e[23]=R,e[24]=N):N=e[24];let _;e[25]!==r.id?(_=k.edit(r.id),e[25]=r.id,e[26]=_):_=e[26];let C;e[27]===Symbol.for("react.memo_cache_sentinel")?(C=t.jsx(re,{className:"h-3.5 w-3.5"}),e[27]=C):C=e[27];let w;e[28]!==_.url?(w=t.jsx(T,{href:_.url,className:"inline-flex items-center rounded-md border border-amber-200 bg-amber-50 px-3 py-1.5 text-sm font-medium text-amber-700 transition hover:bg-amber-100",children:C}),e[28]=_.url,e[29]=w):w=e[29];let S;e[30]!==r.id?(S=k.destroy(r.id),e[30]=r.id,e[31]=S):S=e[31];let I;e[32]===Symbol.for("react.memo_cache_sentinel")?(I=t.jsx(se,{className:"h-3.5 w-3.5"}),e[32]=I):I=e[32];let v;e[33]!==S?(v=t.jsx(T,{href:S,method:"delete",as:"button",onBefore:le,className:"inline-flex cursor-pointer items-center rounded-md border border-rose-200 bg-rose-50 px-3 py-1.5 text-sm font-medium text-rose-700 transition hover:bg-rose-100",children:I}),e[33]=S,e[34]=v):v=e[34];let z;e[35]!==w||e[36]!==v?(z=t.jsx("td",{className:"border p-2",children:t.jsxs("div",{className:"flex justify-center gap-2",children:[w,v]})}),e[35]=w,e[36]=v,e[37]=z):z=e[37];let E;return e[38]!==h||e[39]!==D||e[40]!==i||e[41]!==y||e[42]!==N||e[43]!==z||e[44]!==g||e[45]!==p||e[46]!==b?(E=t.jsxs("tr",{ref:h,style:D,className:g,children:[p,b,i,y,N,z]}),e[38]=h,e[39]=D,e[40]=i,e[41]=y,e[42]=N,e[43]=z,e[44]=g,e[45]=p,e[46]=b,e[47]=E):E=e[47],E}function le(){return confirm("Czy na pewno chcesz usunÄ
Ä tego partnera?")}function Se(n){const e=G.c(11),{partners:r}=n,[s,P]=K.useState(r);let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c={coordinateGetter:O},e[0]=c):c=e[0];const h=V(A(U),A(Q,c));let d;e[1]!==s?(d=D=>{const{active:g,over:f}=D;if(!f||g.id===f.id)return;const p=s.findIndex(l=>l.id===g.id),b=s.findIndex(l=>l.id===f.id),i=W(s,p,b);P(i),$.post(k.reorder().url,{ids:i.map(ce)},{preserveScroll:!0})},e[1]=s,e[2]=d):d=e[2];const u=d;let j;e[3]===Symbol.for("react.memo_cache_sentinel")?(j=t.jsx(B,{title:"Partnerzy",children:t.jsx("meta",{name:"robots",content:"noindex, nofollow"})}),e[3]=j):j=e[3];let a;e[4]===Symbol.for("react.memo_cache_sentinel")?(a=t.jsxs("div",{children:[t.jsx("h1",{className:"text-2xl font-bold text-gray-800",children:"Partnerzy"}),t.jsx("p",{className:"text-sm text-gray-500",children:"PrzeciÄ
gnij wiersze, aby zmieniÄ kolejnoÅÄ. Zmiany zapisujÄ
siÄ automatycznie."})]}),e[4]=a):a=e[4];let m;e[5]===Symbol.for("react.memo_cache_sentinel")?(m=k.create(),e[5]=m):m=e[5];let x;e[6]===Symbol.for("react.memo_cache_sentinel")?(x=t.jsxs("div",{className:"mb-6 flex flex-col gap-4 p-6 sm:flex-row sm:items-center sm:justify-between",children:[a,t.jsxs(T,{href:m.url,className:"inline-flex items-center gap-2 rounded bg-scp-purple px-4 py-2 font-bold text-white hover:bg-blue-700",children:[t.jsx(te,{className:"h-4 w-4"}),"Dodaj partnera"]})]}),e[6]=x):x=e[6];let o;return e[7]!==u||e[8]!==s||e[9]!==h?(o=t.jsxs(M,{breadcrumbs:ae,children:[j,x,t.jsx("div",{className:"p-6",children:s.length===0?t.jsx("p",{className:"py-12 text-center text-gray-500",children:"Brak partnerów. Dodaj pierwszego partnera."}):t.jsx(Z,{sensors:h,collisionDetection:q,onDragEnd:u,children:t.jsxs("table",{className:"w-full border",children:[t.jsx("thead",{children:t.jsxs("tr",{className:"bg-gray-100",children:[t.jsx("th",{className:"w-10 border p-2"}),t.jsx("th",{className:"w-24 border p-2",children:"Logo"}),t.jsx("th",{className:"border p-2 text-left",children:"Nazwa"}),t.jsx("th",{className:"border p-2 text-left",children:"Strona"}),t.jsx("th",{className:"w-20 border p-2",children:"Aktywny"}),t.jsx("th",{className:"w-32 border p-2",children:"Akcje"})]})}),t.jsx(F,{items:s.map(ie),strategy:J,children:t.jsx("tbody",{children:s.map(oe)})})]})})})]}),e[7]=u,e[8]=s,e[9]=h,e[10]=o):o=e[10],o}function oe(n){return t.jsx(ne,{partner:n},n.id)}function ie(n){return n.id}function ce(n){return n.id}export{Se 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.