PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/settings/sitemap-3455d8aaa93e4503.js

js lidomatrip.com collected 2026-09-25 07:11:27 UTC 21,118 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9740],{65645:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/sitemap",function(){return n(56937)}])},56937:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return b}});var a=n(47568),r=n(26042),i=n(69396),s=n(10253),l=n(70655),o=n(85893),c=n(67294),d=n(41664),u=n.n(d),x=n(44389),m=n(49759),g=n(84858),h=n(32474),p=[{value:"ALWAYS",label:"همیشه"},{value:"HOURLY",label:"ساعتی"},{value:"DAILY",label:"روزانه"},{value:"WEEKLY",label:"هفتگی"},{value:"MONTHLY",label:"ماهانه"},{value:"YEARLY",label:"سالانه"},{value:"NEVER",label:"هرگز"}];function b(){var e,t=(0,x.u)("/api/admin/sitemap",function(e){return(0,g.SC)(e)}),n=t.data,r=t.isLoading,i=t.mutate,d=(0,x.u)("/api/admin/robots-rules",function(e){return(0,g.SC)(e)}),p=d.data,b=d.mutate,j=(0,s.Z)((0,c.useState)(null),2),C=j[0],F=j[1],Z=(0,s.Z)((0,c.useState)(null),2),w=Z[0],E=Z[1],A=(0,s.Z)((0,c.useState)(!1),2),D=A[0],S=A[1],I=(e=(0,a.Z)(function(e){return(0,l.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,g.SC)("/api/admin/sitemap/preview/".concat(e))];case 1:return F({title:"robots"===e?"robots.txt":"sitemap.xml",content:t.sent().content}),[2]}})}),function(t){return e.apply(this,arguments)});return(0,o.jsxs)(m.Z,{title:"sitemap و robots",breadcrumb:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u(),{href:"/admin",children:"داشبورد"}),(0,o.jsx)("span",{className:"mx-6 text-gray-B0AFBC",children:"/"}),(0,o.jsx)(u(),{href:"/admin/settings",children:"تنظیمات"})]}),toolbar:(0,o.jsxs)(h.Zb,{className:"px-8 py-6 flex items-center gap-x-4 overflow-x-auto",children:[(0,o.jsx)(u(),{href:"/admin/settings",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"امکانات و قوانین"}),(0,o.jsx)(u(),{href:"/admin/settings/locations",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"دسته‌بندی مکان‌ها"}),(0,o.jsx)(u(),{href:"/admin/settings/tags",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"تگ‌های سئو"}),(0,o.jsx)("span",{className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap bg-primary-main text-white",children:"sitemap و robots"}),(0,o.jsx)(u(),{href:"/admin/settings/faqs",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"سوالات متداول"}),(0,o.jsx)(u(),{href:"/admin/settings/home",className:"px-14 py-8 rounded-10 text-13 leading-20 font-m whitespace-nowrap text-gray-6C6A7D hover:bg-gray-F0F0F0",children:"صفحه اصلی"})]}),children:[r||!n?(0,o.jsx)("div",{className:"flex flex-col gap-12",children:Array.from({length:5}).map(function(e,t){return(0,o.jsx)(h.Od,{className:"h-64"},t)})}):(0,o.jsxs)("div",{className:"flex flex-col gap-y-16",children:[!n.settings.allowIndexing&&(0,o.jsxs)(h.Zb,{className:"px-20 py-16 border-r-4 border-r-[#DC2626]",children:[(0,o.jsx)("div",{className:"text-13 leading-22 font-m text-[#B91C1C] mb-4",children:"ایندکس‌شدن سایت خاموشه"}),(0,o.jsxs)("p",{className:"text-12 leading-22 text-gray-6C6A7D",children:["robots.txt الان برای همه‌ی خزنده‌ها ",(0,o.jsx)("span",{dir:"ltr",className:"font-m",children:"Disallow: /"})," ","می‌فرسته و sitemap.xml هم Û´Û°Û´ می‌ده. این حالت مخصوص قبل از لانچه — برای سایت زنده باید روشن باشه."]})]}),(0,o.jsx)(v,{settings:n.settings,onSaved:function(){return i()},onPreview:I}),(0,o.jsx)(f,{sections:n.sections,stats:n.stats,total:n.total,onSaved:function(){return i()}}),(0,o.jsx)(y,{rules:null!=p?p:[],onEdit:E,onCreate:function(){return S(!0)},onChanged:function(){return b()}})]}),C&&(0,o.jsx)(h.u_,{open:!0,title:C.title,onClose:function(){return F(null)},width:"max-w-[780px]",children:(0,o.jsx)("pre",{dir:"ltr",className:"text-12 leading-20 bg-gray-FAFAFA rounded-10 p-16 overflow-auto max-h-[60vh] whitespace-pre-wrap",children:C.content||"(خالی)"})}),(w||D)&&(0,o.jsx)(N,{rule:w,onClose:function(){E(null),S(!1)},onSaved:function(){E(null),S(!1),b(),i()}})]})}function v(e){var t,n,d,u=e.settings,x=e.onSaved,m=e.onPreview,p=(0,s.Z)((0,c.useState)({siteUrl:u.siteUrl,allowIndexing:u.allowIndexing,sitemapEnabled:u.sitemapEnabled,robotsEnabled:u.robotsEnabled,maxUrlsPerFile:u.maxUrlsPerFile,robotsExtra:null!==(n=u.robotsExtra)&&void 0!==n?n:"",crawlDelay:null!==(d=u.crawlDelay)&&void 0!==d?d:"",imagesEnabled:u.imagesEnabled,imageUrlMode:u.imageUrlMode,imageOptimizerWidth:u.imageOptimizerWidth,listCitySitemapsInRobots:u.listCitySitemapsInRobots}),2),b=p[0],v=p[1],f=(0,s.Z)((0,c.useState)(!1),2),j=f[0],y=f[1],N=(0,s.Z)((0,c.useState)(null),2),C=N[0],F=N[1],Z=(t=(0,a.Z)(function(){var e,t;return(0,l.__generator)(this,function(n){switch(n.label){case 0:y(!0),F(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,g.SC)("/api/admin/sitemap/settings",{method:"PATCH",body:JSON.stringify({siteUrl:b.siteUrl.trim(),allowIndexing:b.allowIndexing,sitemapEnabled:b.sitemapEnabled,robotsEnabled:b.robotsEnabled,maxUrlsPerFile:Number(b.maxUrlsPerFile),robotsExtra:b.robotsExtra.trim()||null,crawlDelay:""===b.crawlDelay?null:Number(b.crawlDelay),imagesEnabled:b.imagesEnabled,imageUrlMode:b.imageUrlMode,imageOptimizerWidth:Number(b.imageOptimizerWidth),listCitySitemapsInRobots:b.listCitySitemapsInRobots})})];case 2:return n.sent(),x(),[3,5];case 3:return F(null!==(t=null==(e=n.sent())?void 0:e.message)&&void 0!==t?t:"ذخیره نشد."),[3,5];case 4:return y(!1),[7];case 5:return[2]}})}),function(){return t.apply(this,arguments)});return(0,o.jsxs)(h.Zb,{className:"px-20 py-18",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between mb-14",children:[(0,o.jsx)("span",{className:"text-14 leading-22 font-m text-gray-1E1D28",children:"تنظیمات کلی"}),(0,o.jsxs)("div",{className:"flex gap-x-8",children:[(0,o.jsx)(h.zx,{variant:"ghost",onClick:function(){return m("robots")},children:"پیش‌نمایش robots.txt"}),(0,o.jsx)(h.zx,{variant:"ghost",onClick:function(){return m("index")},children:"پیش‌نمایش sitemap.xml"})]})]}),(0,o.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,o.jsx)(h.gN,{label:"آدرس سایت",hint:"همه‌ی آدرس‌های sitemap مطلق و با همین دامنه ساخته می‌شن.",children:(0,o.jsx)(h.II,{dir:"ltr",value:b.siteUrl,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{siteUrl:e.target.value}))}})}),(0,o.jsx)(h.gN,{label:"حداکثر آدرس در هر فایل",hint:"استاندارد sitemap سقف ÛµÛ°Ù¬Û°Û°Û° آدرس داره؛ بیشتر از این بشه فایل خودکار تکه می‌شه.",children:(0,o.jsx)(h.II,{type:"number",value:b.maxUrlsPerFile,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{maxUrlsPerFile:Number(e.target.value)}))}})}),(0,o.jsx)(h.gN,{label:"Crawl-delay",hint:"ثانیه، فقط برای *. خالی یعنی بدون محدودیت.",children:(0,o.jsx)(h.II,{type:"number",dir:"ltr",value:b.crawlDelay,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{crawlDelay:e.target.value}))}})}),(0,o.jsxs)("div",{className:"flex flex-col justify-center gap-y-10",children:[(0,o.jsx)(h.ZD,{checked:b.allowIndexing,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{allowIndexing:e}))},label:"اجازه‌ی ایندکس‌شدن سایت"}),(0,o.jsx)(h.ZD,{checked:b.sitemapEnabled,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{sitemapEnabled:e}))},label:"فعال‌بودن sitemap"}),(0,o.jsx)(h.ZD,{checked:b.robotsEnabled,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{robotsEnabled:e}))},label:"فعال‌بودن robots.txt"}),(0,o.jsx)(h.ZD,{checked:b.listCitySitemapsInRobots,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{listCitySitemapsInRobots:e}))},label:"لیست‌کردن sitemap هر شهر در robots.txt"})]})]}),(0,o.jsxs)("div",{className:"mt-16 pt-16 border-t border-gray-EFEFEF",children:[(0,o.jsx)("div",{className:"text-13 leading-22 font-m text-gray-1E1D28 mb-10",children:"sitemap عکس‌ها"}),(0,o.jsxs)("div",{className:"grid md:grid-cols-3 gap-14",children:[(0,o.jsx)("div",{className:"flex items-center",children:(0,o.jsx)(h.ZD,{checked:b.imagesEnabled,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{imagesEnabled:e}))},label:"فعال"})}),(0,o.jsx)(h.gN,{label:"نحوه‌ی آدرس‌دهی عکس",children:(0,o.jsxs)(h.Ph,{value:b.imageUrlMode,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{imageUrlMode:e.target.value}))},children:[(0,o.jsx)("option",{value:"optimizer",children:"از طریق بهینه‌ساز Next"}),(0,o.jsx)("option",{value:"direct",children:"آدرس مستقیم استوریج"})]})}),(0,o.jsx)(h.gN,{label:"عرض تصویر بهینه‌شده",hint:"پیکسل",children:(0,o.jsx)(h.II,{type:"number",value:b.imageOptimizerWidth,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{imageOptimizerWidth:Number(e.target.value)}))}})})]}),"direct"===b.imageUrlMode&&(0,o.jsx)("p",{className:"text-11 leading-20 text-[#B45309] mt-8",children:"هشدار: باکت لیارا به هر User-Agent شامل \xabMozilla\xbb جواب Û´Û°Û´ می‌ده — یعنی به گوگل‌بات و همه‌ی خزنده‌های عکس. تا وقتی این حفاظت برداشته نشده، آدرس مستقیم یعÙ
1†ÛŒ فرستادن Û´Û°Û´ به گوگل. حالت \xabبهینه‌ساز\xbb تنها شکلیه که خزنده می‌تونه بگیره."})]}),(0,o.jsx)(h.gN,{label:"خطوط اضافه‌ی robots.txt",className:"mt-14",hint:"عیناً به انتهای فایل اضافه می‌شه — برای دستورهایی که اینجا فیلد ندارن.",children:(0,o.jsx)("textarea",{dir:"ltr",rows:3,value:b.robotsExtra,onChange:function(e){return v((0,i.Z)((0,r.Z)({},b),{robotsExtra:e.target.value}))},className:"w-full rounded-10 border border-gray-EFEFEF px-14 py-10 text-12 leading-20 outline-none focus:border-primary-main font-mono"})}),C&&(0,o.jsx)("p",{className:"text-12 leading-20 text-[#DC2626] mt-8",children:C}),(0,o.jsx)("div",{className:"flex justify-end mt-14",children:(0,o.jsx)(h.zx,{onClick:Z,disabled:j,children:j?"در حال ذخیره…":"ذخیره تنظیمات"})})]})}function f(e){var t=e.sections,n=e.stats,a=e.total,r=e.onSaved;return(0,o.jsxs)(h.Zb,{className:"p-0 overflow-hidden",children:[(0,o.jsxs)("div",{className:"px-20 py-16 border-b border-gray-EFEFEF flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-14 leading-22 font-m text-gray-1E1D28",children:"بخش‌های sitemap"}),(0,o.jsxs)("span",{className:"text-12 text-gray-6C6A7D",children:["مجموع آدرس‌ها: ",(0,o.jsx)("span",{className:"font-m text-gray-1E1D28",children:(0,h.N)(a)})]})]}),(0,o.jsx)("div",{className:"divide-y divide-gray-F5F5F5",children:t.map(function(e){return(0,o.jsx)(j,{section:e,stat:n.find(function(t){return t.key===e.key}),onSaved:r},e.id)})})]})}function j(e){var t,n=e.section,d=e.stat,u=e.onSaved,x=(0,s.Z)((0,c.useState)({isEnabled:n.isEnabled,changeFreq:n.changeFreq,priority:n.priority,minResidenceCount:n.minResidenceCount,includeLastmod:n.includeLastmod,requireSitemapFlag:n.requireSitemapFlag,tagPriority:n.tagPriority,tagChangeFreq:n.tagChangeFreq,listingPriority:n.listingPriority,listingChangeFreq:n.listingChangeFreq}),2),m=x[0],b=x[1],v=(0,s.Z)((0,c.useState)(!1),2),f=v[0],j=v[1],y=(0,s.Z)((0,c.useState)(!1),2),N=y[0],C=y[1],F=function(e){b((0,r.Z)({},m,e)),C(!0)},Z=(t=(0,a.Z)(function(){return(0,l.__generator)(this,function(e){switch(e.label){case 0:j(!0),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,(0,g.SC)("/api/admin/sitemap/sections/".concat(n.id),{method:"PATCH",body:JSON.stringify((0,i.Z)((0,r.Z)({},m),{priority:Number(m.priority),minResidenceCount:Number(m.minResidenceCount),tagPriority:Number(m.tagPriority),listingPriority:Number(m.listingPriority)}))})];case 2:return e.sent(),C(!1),u(),[3,4];case 3:return j(!1),[7];case 4:return[2]}})}),function(){return t.apply(this,arguments)});return(0,o.jsxs)("div",{className:"px-20 py-16",children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-x-12 gap-y-8 mb-12",children:[(0,o.jsx)(h.ZD,{checked:m.isEnabled,onChange:function(e){return F({isEnabled:e})}}),(0,o.jsx)("span",{className:"text-13 leading-22 font-m text-gray-1E1D28",children:n.label}),(0,o.jsx)("span",{dir:"ltr",className:"text-11 text-gray-B0AFBC",children:"cities"===n.key?"/sitemaps/sitemap-<شهر>.xml":n.key.startsWith("magazine-")?"/blog/sitemap.xml":"/sitemaps/".concat(n.key,"-1.xml")}),d&&(0,o.jsxs)(h.Ct,{tone:d.included>0?"green":"gray",children:[(0,h.N)(d.included)," ","cities"===n.key?"فایل":"آدرس"]}),N&&(0,o.jsx)(h.zx,{onClick:Z,disabled:f,className:"mr-auto",children:f?"…":"ذخیره"})]}),(0,o.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-12",children:[(0,o.jsx)(h.gN,{label:"نرخ تغییر",children:(0,o.jsx)(h.Ph,{value:m.changeFreq,onChange:function(e){return F({changeFreq:e.target.value})},children:p.map(function(e){return(0,o.jsx)("option",{value:e.value,children:e.label},e.value)})})}),(0,o.jsx)(h.gN,{label:"اولویت",hint:"بین Û° تا Û±",children:(0,o.jsx)(h.II,{type:"number",step:"0.1",min:"0",max:"1",value:m.priority,onChange:function(e){return F({priority:Number(e.target.value)})}})}),(0,o.jsx)(h.gN,{label:"حداقل اقامتگاه",hint:"Û° یعنی بدون فیلتر",children:(0,o.jsx)(h.II,{type:"number",min:"0",value:m.minResidenceCount,onChange:function(e){return F({minResidenceCount:Number(e.target.value)})}})}),(0,o.jsxs)("div",{className:"flex flex-col justify-center gap-y-8",children:[(0,o.jsx)(h.ZD,{checked:m.includeLastmod,onChange:function(e){return F({includeLastmod:e})},label:"درج lastmod"}),"tag-pages"===n.key&&(0,o.jsx)(h.ZD,{checked:m.requireSitemapFlag,onChange:function(e){return F({requireSitemapFlag:e})},label:"فقط صفحات فلگ‌دار اودو"})]})]}),"cities"===n.key&&(0,o.jsxs)("div",{className:"mt-14 pt-14 border-t border-gray-F5F5F5",children:[(0,o.jsx)("p",{className:"text-11 leading-20 text-gray-B0AFBC mb-10",children:"فایل هر شهر سه نوع آدرس داره. بالا وزن \xabصفحه‌ی شهر\xbb تنظیم می‌شه؛ این‌جا وزن دو تای دیگه — صفحات تگ همون شهر و اقامتگاه‌هاش."}),(0,o.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-12",children:[(0,o.jsx)(h.gN,{label:"اولویت صفحات تگ",children:(0,o.jsx)(h.II,{type:"number",step:"0.1",min:"0",max:"1",value:m.tagPriority,onChange:function(e){return F({tagPriority:Number(e.target.value)})}})}),(0,o.jsx)(h.gN,{label:"نرخ تغییر صفحات تگ",children:(0,o.jsx)(h.Ph,{value:m.tagChangeFreq,onChange:function(e){return F({tagChangeFreq:e.target.value})},children:p.map(function(e){return(0,o.jsx)("option",{value:e.value,children:e.label},e.value)})})}),(0,o.jsx)(h.gN,{label:"اولویت اقامتگاه‌ها",children:(0,o.jsx)(h.II,{type:"number",step:"0.1",min:"0",max:"1",value:m.listingPriority,onChange:function(e){return F({listingPriority:Number(e.target.value)})}})}),(0,o.jsx)(h.gN,{label:"نرخ تغییر اقامتگاه‌ها",children:(0,o.jsx)(h.Ph,{value:m.listingChangeFreq,onChange:function(e){return F({listingChangeFreq:e.target.value})},children:p.map(function(e){return(0,o.jsx)("option",{value:e.value,children:e.label},e.value)})})})]})]}),"tag-pages"===n.key&&m.requireSitemapFlag&&(0,o.jsx)("p",{className:"text-11 leading-20 text-gray-B0AFBC mt-8",children:"اودو فقط ÛµÛ¸ صفحه از Û¹Ù¬Û³Û±Û² صفحه رو برای sitemap فلگ کرده بود. اگه این گزینه رو خاموش کنی، هر صفحه‌ی تگِ فعال که از حد \xabحداقل اقامتگاه\xbb بگذره وارد sitemap می‌شه."}),d&&d.excluded.length>0&&(0,o.jsxs)("div",{className:"mt-10 text-11 leading-20 text-gray-6C6A7D",children:[(0,o.jsx)("span",{className:"font-m text-gray-1E1D28",children:"کنار گذاشته شد: "}),d.excluded.map(function(e,t){return(0,o.jsxs)("span",{children:[t>0&&" \xb7 ",e.reason," (",(0,h.N)(e.count),")"]},e.reason)})]})]})}
1function y(e){var t=e.rules,n=e.onEdit,r=e.onCreate,i=e.onChanged;return(0,o.jsxs)(h.Zb,{className:"p-0 overflow-hidden",children:[(0,o.jsxs)("div",{className:"px-20 py-16 border-b border-gray-EFEFEF flex items-center justify-between",children:[(0,o.jsx)("span",{className:"text-14 leading-22 font-m text-gray-1E1D28",children:"قوانین robots.txt"}),(0,o.jsx)(h.zx,{onClick:r,children:"افزودن قانون"})]}),0===t.length?(0,o.jsx)(h.ub,{text:"قانونی تعریف نشده — robots.txt همه‌چیز رو مجاز می‌کنه."}):(0,o.jsx)("div",{className:"divide-y divide-gray-F5F5F5",children:t.map(function(e){return(0,o.jsxs)("div",{className:"px-20 py-12 flex flex-wrap items-center gap-x-10 gap-y-4",children:[(0,o.jsx)("span",{dir:"ltr",className:"text-12 font-mono text-gray-1E1D28",children:e.userAgent}),(0,o.jsx)(h.Ct,{tone:"Allow"===e.directive?"green":"gray",children:e.directive}),(0,o.jsx)("span",{dir:"ltr",className:"text-12 font-mono text-gray-6C6A7D",children:e.path}),e.note&&(0,o.jsx)("span",{className:"text-11 text-gray-B0AFBC",children:e.note}),!e.isActive&&(0,o.jsx)(h.Ct,{tone:"red",children:"غیرفعال"}),(0,o.jsxs)("div",{className:"mr-auto flex gap-x-10",children:[(0,o.jsx)("button",{onClick:function(){return n(e)},className:"text-12 text-primary-main hover:underline",children:"ویرایش"}),(0,o.jsx)("button",{onClick:(0,a.Z)(function(){return(0,l.__generator)(this,function(t){switch(t.label){case 0:return[4,(0,g.SC)("/api/admin/robots-rules/".concat(e.id),{method:"DELETE"})];case 1:return t.sent(),i(),[2]}})}),className:"text-12 text-[#DC2626] hover:underline",children:"حذف"})]})]},e.id)})})]})}function N(e){var t,n,d,u,x,m,p,b=e.rule,v=e.onClose,f=e.onSaved,j=(0,s.Z)((0,c.useState)({userAgent:null!==(n=null==b?void 0:b.userAgent)&&void 0!==n?n:"*",directive:null!==(d=null==b?void 0:b.directive)&&void 0!==d?d:"Disallow",path:null!==(u=null==b?void 0:b.path)&&void 0!==u?u:"",note:null!==(x=null==b?void 0:b.note)&&void 0!==x?x:"",isActive:null===(m=null==b?void 0:b.isActive)||void 0===m||m,sortOrder:null!==(p=null==b?void 0:b.sortOrder)&&void 0!==p?p:0}),2),y=j[0],N=j[1],C=(0,s.Z)((0,c.useState)(!1),2),F=C[0],Z=C[1],w=(0,s.Z)((0,c.useState)(null),2),E=w[0],A=w[1],D=(t=(0,a.Z)(function(){var e,t;return(0,l.__generator)(this,function(n){switch(n.label){case 0:Z(!0),A(null),n.label=1;case 1:return n.trys.push([1,3,4,5]),[4,(0,g.SC)(b?"/api/admin/robots-rules/".concat(b.id):"/api/admin/robots-rules",{method:b?"PATCH":"POST",body:JSON.stringify({userAgent:y.userAgent.trim()||"*",directive:y.directive,path:y.path.trim(),note:y.note.trim()||null,isActive:y.isActive,sortOrder:Number(y.sortOrder)||0})})];case 2:return n.sent(),f(),[3,5];case 3:return A(null!==(t=null==(e=n.sent())?void 0:e.message)&&void 0!==t?t:"ذخیره نشد."),[3,5];case 4:return Z(!1),[7];case 5:return[2]}})}),function(){return t.apply(this,arguments)});return(0,o.jsx)(h.u_,{open:!0,title:b?"ویرایش قانون":"افزودن قانون",onClose:v,children:(0,o.jsxs)("div",{className:"flex flex-col gap-y-14",children:[(0,o.jsxs)("div",{className:"grid grid-cols-2 gap-14",children:[(0,o.jsx)(h.gN,{label:"User-agent",hint:"* یعنی همه‌ی خزنده‌ها",children:(0,o.jsx)(h.II,{dir:"ltr",value:y.userAgent,onChange:function(e){return N((0,i.Z)((0,r.Z)({},y),{userAgent:e.target.value}))}})}),(0,o.jsx)(h.gN,{label:"دستور",children:(0,o.jsxs)(h.Ph,{value:y.directive,onChange:function(e){return N((0,i.Z)((0,r.Z)({},y),{directive:e.target.value}))},children:[(0,o.jsx)("option",{value:"Disallow",children:"Disallow"}),(0,o.jsx)("option",{value:"Allow",children:"Allow"})]})})]}),(0,o.jsx)(h.gN,{label:"مسیر",hint:"مثل /admin یا /api/ — با اسلش شروع بشه.",children:(0,o.jsx)(h.II,{dir:"ltr",value:y.path,onChange:function(e){return N((0,i.Z)((0,r.Z)({},y),{path:e.target.value}))},placeholder:"/admin"})}),(0,o.jsx)(h.gN,{label:"یادداشت",hint:"فقط برای تیم؛ توی فایل نمیاد.",children:(0,o.jsx)(h.II,{value:y.note,onChange:function(e){return N((0,i.Z)((0,r.Z)({},y),{note:e.target.value}))}})}),(0,o.jsx)(h.ZD,{checked:y.isActive,onChange:function(e){return N((0,i.Z)((0,r.Z)({},y),{isActive:e}))},label:"فعال"}),E&&(0,o.jsx)("p",{className:"text-12 leading-20 text-[#DC2626]",children:E}),(0,o.jsxs)("div",{className:"flex gap-x-8 justify-end",children:[(0,o.jsx)(h.zx,{variant:"ghost",onClick:v,children:"انصراف"}),(0,o.jsx)(h.zx,{onClick:D,disabled:F||!y.path.trim(),children:F?"در حال ذخیره…":"ذخیره"})]})]})})}}},function(e){e.O(0,[9791,9759,9774,2888,179],function(){return e(e.s=65645)}),_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.