PageSourceSearch

https://new.sportsnconnect.com/_next/static/chunks/pages/admin/magazine/tags-7d276525d1974020.js

js sportsnconnect.com collected 2026-10-02 14:32:38 UTC 11,405 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9e3],{18867:function(e,r,t){"use strict";t.d(r,{V:function(){return p},f:function(){return x}});var n,s,a=t(50029),i=t(64687),c=t.n(i),l=t(27829),o=null,d=null,u=(n=(0,a.Z)(c().mark(function e(r){var t;return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.r)({endpoint:"/article_tags",apiOptions:{page:1,itemsPerPage:200},dynamicParams:{"order[title]":"asc"},refreshToken:r});case 2:var n;return t=e.sent,e.abrupt("return",Array.isArray(n=t.data)?n:[]);case 4:case"end":return e.stop()}},e)})),function(e){return n.apply(this,arguments)}),p=(s=(0,a.Z)(c().mark(function e(r){return c().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!o){e.next=2;break}return e.abrupt("return",o);case 2:return d||(d=u(r).then(function(e){return o=e,e}).finally(function(){d=null})),e.abrupt("return",d);case 4:case"end":return e.stop()}},e)})),function(e){return s.apply(this,arguments)}),x=function(){o=null,d=null}},96461:function(e,r,t){"use strict";var n=t(59499),s=t(94024),a=t(11163),i=t(67294),c=t(9473),l=t(85893);function o(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}r.Z=function(e){function r(r){var t,d=(0,c.I0)(),u=(0,a.useRouter)(),p=!!(null!==(t=JSON.parse(localStorage.getItem("sessionActive")||"{}"))&&void 0!==t&&t.token);return(0,i.useEffect)(function(){p||(d((0,s.setUserConnected)(null)),d((0,s.setIsSidebar)(!1)),u.push("/login?redirect=".concat(btoa(window.location.href))))},[]),(0,l.jsx)(e,function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?o(Object(t),!0).forEach(function(r){(0,n.Z)(e,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):o(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})}return e}({},r))}return e.getInitialProps&&(r.getInitialProps=e.getInitialProps),r}},44741:function(e,r,t){"use strict";t.r(r);var n=t(50029),s=t(64687),a=t.n(s),i=t(91281),c=t(28837),l=t(18867),o=t(96461),d=t(197),u=t(94024),p=t(50306),x=t(41664),g=t.n(x),f=t(67294),m=t(9473),h=t(64712),b=t(85893);r.default=(0,o.Z)(function(){var e,r,t,s=(0,m.I0)(),o=(0,d.a)().refreshToken,x=(0,f.useRef)(o),y=(0,f.useState)([]),j=y[0],v=y[1],w=(0,f.useState)(""),N=w[0],k=w[1],A=(0,f.useState)(""),E=A[0],_=A[1],O=(0,f.useState)("#1D4ED8"),C=O[0],S=O[1],P=(0,f.useState)(!0),D=P[0],T=P[1],B=(0,f.useState)(!1),I=B[0],Z=B[1],L=(0,f.useState)(null),M=L[0],z=L[1],H=(0,f.useState)(null),R=H[0],J=H[1],X=(0,u.useApiMutation)("POST","application/ld+json",void 0,o).mutateAsync,V=(0,u.useApiMutation)("PATCH","application/merge-patch+json",void 0,o).mutateAsync,G=(0,u.useApiMutation)("DELETE","application/ld+json",void 0,o).mutateAsync;(0,f.useEffect)(function(){x.current=o},[o]);var U=(e=(0,n.Z)(a().mark(function e(){return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return T(!0),e.prev=1,e.next=4,(0,l.V)(x.current);case 4:v(e.sent),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),h.Am.error("Erreur lors du chargement des tags");case 11:return e.prev=11,T(!1),e.finish(11);case 14:case"end":return e.stop()}},e,null,[[1,8,11,14]])}
1)),function(){return e.apply(this,arguments)});(0,f.useEffect)(function(){s((0,u.setAreaActiv)(p.$J.ADMINAREA))},[s]),(0,f.useEffect)(function(){U()},[]);var W=function(){k(""),_(""),S("#1D4ED8"),J(null)},Y=function(e){J(e),k(e.title||""),_(e.description||""),S(e.color||"#1D4ED8")},$=(r=(0,n.Z)(a().mark(function e(r){var t;return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r.preventDefault(),N.trim()){e.next=4;break}return h.Am.error("Le titre du tag est obligatoire"),e.abrupt("return");case 4:if(Z(!0),e.prev=5,t={title:N.trim(),description:E.trim()||null,color:C},!R){e.next=13;break}return e.next=10,V({url:"/article_tags/".concat(R.id),variables:t});case 10:h.Am.success("Tag modifi\xe9 avec succ\xe8s"),e.next=16;break;case 13:return e.next=15,X({url:"/article_tags",variables:t});case 15:h.Am.success("Tag cr\xe9\xe9 avec succ\xe8s");case 16:return(0,l.f)(),W(),e.next=20,U();case 20:e.next=25;break;case 22:e.prev=22,e.t0=e.catch(5),h.Am.error(R?"Erreur lors de la modification du tag":"Erreur lors de la cr\xe9ation du tag");case 25:return e.prev=25,Z(!1),e.finish(25);case 28:case"end":return e.stop()}},e,null,[[5,22,25,28]])})),function(e){return r.apply(this,arguments)}),q=(t=(0,n.Z)(a().mark(function e(r){return a().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(window.confirm('Supprimer le tag "'.concat(r.title||"#".concat(r.id),'" ?'))){e.next=3;break}return e.abrupt("return");case 3:return z(r.id),e.prev=4,e.next=7,G({url:"/article_tags/".concat(r.id)});case 7:return h.Am.success("Tag supprim\xe9 avec succ\xe8s"),(0,l.f)(),e.next=11,U();case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),h.Am.error("Erreur lors de la suppression du tag. Il est peut-\xeatre encore utilis\xe9.");case 16:return e.prev=16,z(null),e.finish(16);case 19:case"end":return e.stop()}},e,null,[[4,13,16,19]])})),function(e){return t.apply(this,arguments)}),F="Ajouter";return R&&(F="Enregistrer"),I&&(F=R?"Mise \xe0 jour...":"Ajout..."),(0,b.jsx)("div",{className:"px-5 lg:px-8 py-4 pb-10",children:(0,b.jsxs)("div",{className:"space-y-6",children:[(0,b.jsx)(c.aGc,{aeraActive:"admin",pathArray:["dashboard","magazine","magazineTags"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[(0,b.jsx)("div",{className:"space-y-2",children:(0,b.jsx)("h1",{className:"text-titre-3-mobile lg:text-titre-3 font-delightExtrabold text-gray-900",children:"Tags du magazine"})}),(0,b.jsx)(g(),{href:"/admin/magazine",className:"inline-flex w-fit items-center justify-center rounded-xl border border-gray-300 px-4 py-2.5 text-sm font-delightBold text-gray-700 transition-colors hover:bg-gray-50",children:"Retour au tableau de bord"})]}),(0,b.jsx)("form",{onSubmit:$,className:"rounded-3xl border border-gray-200 bg-white p-5 shadow-sm lg:p-6",children:(0,b.jsxs)("div",{className:"grid gap-4 lg:grid-cols-[minmax(0,1.2fr)_minmax(0,1.4fr)_140px_auto] lg:items-end",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"block text-sm font-delightBold text-gray-700",children:"Titre"}),(0,b.jsx)("input",{id:"tag-title",type:"text",maxLength:30,value:N,onChange:function(e){return k(e.target.value)},placeholder:"Ex: Actu",className:"w-full rounded-xl border border-gray-200 px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-primaryColor/30"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"block text-sm font-delightBold text-gray-700",children:"Description"}),(0,b.jsx)("input",{id:"tag-description",type:"text",maxLength:255,value:E,onChange:function(e){return _(e.target.value)},placeholder:"Description optionnelle",className:"w-full rounded-xl border border-gray-200 px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-primaryColor/30"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)("p",{className:"block text-sm font-delightBold text-gray-700",children:"Couleur"}),(0,b.jsx)("input",{id:"tag-color",type:"color",value:C,onChange:function(e){return S(e.target.value)},className:"h-[46px] w-full rounded-xl border border-gray-200 bg-white p-1"})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center",children:[(0,b.jsx)("button",{type:"submit",disabled:I,className:"inline-flex items-center justify-center rounded-xl bg-primaryColor px-4 py-2.5 text-sm font-delightBold text-black transition-opacity hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",children:F}),R?(0,b.jsx)("button",{type:"button",onClick:W,disabled:I,className:"inline-flex items-center justify-center rounded-xl border border-gray-200 px-4 py-2.5 text-sm font-delightBold text-gray-700 transition-colors hover:bg-gray-50 disabled:cursor-not-allowed disabled:opacity-60",children:"Annuler"}):null]})]})}),D?(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsx)(c.HeL,{height:"4rem",addClass:"!rou
1nded-xl"}),(0,b.jsx)(c.HeL,{height:"4rem",addClass:"!rounded-xl"}),(0,b.jsx)(c.HeL,{height:"4rem",addClass:"!rounded-xl"})]}):(0,b.jsxs)("div",{className:"overflow-hidden rounded-3xl border border-gray-200 bg-white shadow-sm",children:[(0,b.jsxs)("div",{className:"hidden md:grid grid-cols-[minmax(0,1.1fr)_minmax(0,1.6fr)_140px_148px] gap-4 border-b border-gray-200 bg-gray-50 px-6 py-4 text-xs font-delightBold uppercase tracking-wide text-gray-500",children:[(0,b.jsx)("span",{children:"Titre"}),(0,b.jsx)("span",{children:"Description"}),(0,b.jsx)("span",{children:"Couleur"}),(0,b.jsx)("span",{children:"Action"})]}),0===j.length?(0,b.jsx)("div",{className:"px-6 py-10 text-center text-sm text-gray-500",children:"Aucun tag n'a encore \xe9t\xe9 cr\xe9\xe9."}):j.map(function(e){return(0,b.jsx)("div",{className:"border-b border-gray-100 px-6 py-4 last:border-b-0",children:(0,b.jsxs)("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1.1fr)_minmax(0,1.6fr)_140px_148px] md:items-center",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs font-delightBold uppercase tracking-wide text-gray-500 md:hidden",children:"Titre"}),(0,b.jsx)("p",{className:"text-sm font-delightBold text-gray-900",children:e.title||"Tag #".concat(e.id)})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs font-delightBold uppercase tracking-wide text-gray-500 md:hidden",children:"Description"}),(0,b.jsx)("p",{className:"text-sm text-gray-700",children:e.description||"—"})]}),(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("p",{className:"text-xs font-delightBold uppercase tracking-wide text-gray-500 md:hidden",children:"Couleur"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"inline-flex h-4 w-4 rounded-full border border-gray-200",style:{backgroundColor:e.color||"#E5E7EB"}}),(0,b.jsx)("span",{className:"text-sm text-gray-700",children:e.color||"—"})]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("button",{type:"button",onClick:function(){return Y(e)},className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-gray-200 text-gray-600 transition-colors hover:bg-gray-50 hover:text-gray-900","aria-label":"Modifier le tag ".concat(e.title||"#".concat(e.id)),title:"Modifier",children:(0,b.jsx)(i.dY8,{className:"h-4 w-4",strokeWidth:1.5})}),(0,b.jsxs)("button",{type:"button",onClick:function(){return q(e)},disabled:M===e.id,className:"inline-flex h-9 w-9 items-center justify-center rounded-lg border border-red-200 text-red-600 transition-colors hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-60","aria-label":"Supprimer le tag ".concat(e.title||"#".concat(e.id)),title:"Supprimer",children:[(0,b.jsx)(i.XHJ,{width:"1rem",he
1ight:"1rem"}),(0,b.jsx)("span",{className:"sr-only",children:M===e.id?"Suppression...":"Supprimer"})]})]})]})},e.id)})]})]})})})},77455:function(e,r,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/magazine/tags",function(){return t(44741)}])}},function(e){e.O(0,[2888,9774,179],function(){return e(e.s=77455)}),_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.