PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/settings/profile-backgrounds-3441da94b410e7f8.js

js lidomatrip.com collected 2026-09-25 07:11:25 UTC 6,502 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2725],{14664:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/profile-backgrounds",function(){return t(10201)}])},10201:function(e,n,t){"use strict";t.r(n);var r=t(47568),a=t(10253),s=t(70655),i=t(85893),c=t(67294),l=t(44389),u=t(49759),o=t(84858),d=t(32474);function h(e){var n=e.item;return(0,i.jsx)("span",{className:"block h-full w-full",style:"IMAGE"===n.kind?{backgroundImage:"url(".concat(n.value,")"),backgroundSize:"cover",backgroundPosition:"center"}:{background:n.value}})}n.default=function(){var e=(0,l.u)("/api/admin/profile-backgrounds",function(e){return(0,o.SC)(e)}),n=e.data,t=e.error,p=e.isLoading,f=e.mutate,g=(0,c.useRef)(null),x=(0,a.Z)((0,c.useState)(""),2),m=x[0],b=x[1],v=(0,a.Z)((0,c.useState)("#0EA5A8"),2),j=v[0],y=v[1],N=(0,a.Z)((0,c.useState)("#0B4F6C"),2),k=N[0],w=N[1],C=(0,a.Z)((0,c.useState)(!1),2),E=C[0],_=C[1],S=(0,a.Z)((0,c.useState)(null),2),Z=S[0],A=S[1],F=n||[],O=F.filter(function(e){return e.isActive}).length;function T(){return(T=(0,r.Z)(function(e){var n,t;return(0,s.__generator)(this,function(r){switch(r.label){case 0:_(!0),A(null),r.label=1;case 1:return r.trys.push([1,4,5,6]),(n=new FormData).append("image",e),m.trim()&&n.append("alt",m.trim()),[4,(0,o.SC)("/api/admin/profile-backgrounds",{method:"POST",body:n})];case 2:return r.sent(),b(""),g.current&&(g.current.value=""),[4,f()];case 3:return r.sent(),[3,6];case 4:return A((null==(t=r.sent())?void 0:t.message)||"بارگذاری انجام نشد"),[3,6];case 5:return _(!1),[7];case 6:return[2]}})})).apply(this,arguments)}function D(){return(D=(0,r.Z)(function(){var e,n;return(0,s.__generator)(this,function(t){switch(t.label){case 0:_(!0),A(null),t.label=1;case 1:return t.trys.push([1,4,5,6]),e="linear-gradient(135deg, ".concat(j," 0%, ").concat(k," 100%)"),[4,(0,o.SC)("/api/admin/profile-backgrounds/gradient",{method:"POST",body:JSON.stringify({value:e,alt:m.trim()||void 0})})];case 2:return t.sent(),b(""),[4,f()];case 3:return t.sent(),[3,6];case 4:return A((null==(n=t.sent())?void 0:n.message)||"افزودن انجام نشد"),[3,6];case 5:return _(!1),[7];case 6:return[2]}})})).apply(this,arguments)}function P(){return(P=(0,r.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:return[4,(0,o.SC)("/api/admin/profile-backgrounds/".concat(e.id),{method:"PATCH",body:JSON.stringify({isActive:!e.isActive})})];case 1:return n.sent(),[4,f()];case 2:return n.sent(),[2]}})})).apply(this,arguments)}function I(){return(I=(0,r.Z)(function(e){return(0,s.__generator)(this,function(n){switch(n.label){case 0:if(!window.confirm("این پس‌زمینه حذف شود؟"))return[2];return[4,(0,o.SC)("/api/admin/profile-backgrounds/".concat(e.id),{method:"DELETE"})];case 1:return n.sent(),[4,f()];case 2:return n.sent(),[2]}})})).apply(this,arguments)}return(0,i.jsxs)(u.Z,{title:"تصاویر پس‌زمینه پروفایل",children:[(0,i.jsxs)(d.Zb,{children:[(0,i.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"این پس‌زمینه‌ها کجا دیده می‌شوند"}),(0,i.jsx)("p",{className:"mt-4 text-12 leading-20 font-r text-gray-6C6A7D",children:"در صفحه‌ی جزئیات کاربر پنل ادمین، پشت هدر پروفایل. یک ادمین از این فهرست برای هر کاربر یکی را انتخاب می‌کند؛ روی حساب خودِ کاربر یا سایت اصلی اثری ندارد."}),(0,i.jsxs)("div",{className:"mt-16 border-t-1 border-solid border-gray-F0F0F0 pt-16",children:[(0,i.jsx)(d.gN,{label:"عنوان (اختیاری)",className:"max-w-[260px] mb-12",children:(0,i.jsx)(d.II,{value:m,onChange:function(e){return b(e.target.value)},placeholder:"مثلاً: اقیانوسی"})}),(0,i.jsxs)("div",{className:"flex flex-wrap items-end gap-24",children:[(0,i.jsxs)("div",{className:"flex items-end gap-12",children:[(0,i.jsx)(d.gN,{label:"از رنگ",children:(0,i.jsx)("input",{type:"color",value:j,onChange:function(e){return y(e.target.value)},className:"h-38 w-52 rounded-8 border border-gray-E5E5E6 cursor-pointer"})}),(0,i.jsx)(d.gN,{label:"به رنگ",children:(0,i.jsx)("input",{type:"color",value:k,onChange:function(e){return w(e.target.value)},className:"h-38 w-52 rounded-8 border border-gray-E5E5E6 cursor-pointer"})}),(0,i.jsx)("span",{className:"h-38 w-72 rounded-8 border border-gray-E5E5E6",style:{background:"linear-gradient(135deg, ".concat(j," 0%, ").concat(k," 100%)")}}),(0,i.jsx)(d.zx,{disabled:E,onClick:function(){return D.apply(this,arguments)},children:"افزودن گرادیان"})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("input",{ref:g,type:"file",accept:"image/*",className:"hidden",onChange:function(e){var n,t=null===(n=e.target.files)||void 0===n?void 0:n[0];t&&function(e){T.apply(this,arguments)}(t)}}),(0,i.jsx)(d.zx,{variant:"secondary",disabled:E,onClick:function(){var e;return null===(e=g.current)||void 0===e?void 0:e.click()},children:E?"در حال بارگذاری…":"یا بارگذاری تصویر"})]})]})]}),Z&&(0,i.jsx)("p",{className:"mt-12 text-12 leading-20 text-error",children:Z})]}),(0,i.jsxs)(d.Zb,{className:"mt-16",children:[(0,i.jsxs)("div",{className:"mb-12 flex items-center justify-between",children:[(0,i.jsx)("p",{className:"text-14 leading-24 font-m text-black",children:"پس‌زمینه‌ها"}),(0,i.jsxs)(d.Ct,{children:[O," فعال"]})]}),p?(0,i.jsx)(d.Od,{}):t?(0,i.jsx)(d.ub,{text:"فهرست بارگذاری نشد"}):0===F.length?(0,i.jsx)(d.ub,{text:"هنوز پس‌زمینه‌ای اضافه نشده"}):(0,i.jsx)("ul",{className:"flex flex-wrap gap-16",children:F.map(function(e){return(0,i.jsxs)("li",{className:"flex w-[150px] flex-col items-center gap-8 rounded-12 border-1 border-solid border-gray-F0F0F0 p-12",children:[(0,i.jsx)("span",{className:"overflow-hidden rounded-10",style:{height:64,width:102.4},children:(0,i.jsx)(h,{item:e})}),(0,i.jsx)("span",{className:"truncate text-11 leading-18 text-gray-6C6A7D",title:e.alt||"",children:e.alt||("GRADIENT"===e.kind?"گرادیان":"—")}),(0,i.jsx)(d.ZD,{checked:e.isActive,onChange:function(){!function(e){P.apply(this,arguments)}(e)}}),(0,i.jsx)("button",{type:"button",onClick:function(){!function(e){I.apply(this,arguments)}(e)},className:"text-11 leading-18 text-error hover:underline",children:"حذف"})]},e.id)})})]})]})}}},function(e){e.O(0,[9791,9759,9774,2888,179],function(){return e(e.s=14
1664)}),_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.