1"use strict";(self.webpackChunkkunaiu_addon_v2=self.webpackChunkkunaiu_addon_v2||[]).push([[9820],{49820:(e,a,s)=>{s.r(a),s.d(a,{default:()=>u});var r=s(22555),t=s(65043),n=s(97950),o=s(40117),i=s(47174),l=s(30590),c=s(75439),d=s(65469),f=s(98655),m=s(13005),p=s(10624),h=s(70579);const g=[{name:"\u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645",order:1},{name:"\u0646\u0627\u0626\u0628 \u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645",order:1.5},{name:"\u0645\u0633\u0624\u0648\u0644 \u0642\u0633\u0645 \u0641\u0646\u064a \u0645\u062d\u062a\u0648\u0649",order:1.6},{name:"\u0641\u0646\u064a \u0645\u062d\u062a\u0648\u0649",order:1.7},{name:"\u0645\u0633\u0624\u0648\u0644 \u0642\u0633\u0645 \u0627\u0644\u0645\u062d\u062a\u0648\u0649",order:2},{name:"\u0645\u0634\u0631\u0641 \u0627\u0644\u0645\u062d\u062a\u0648\u0649",order:3},{name:"\u0645\u0633\u0624\u0648\u0644 \u0642\u0633\u0645 \u0627\u0644\u0641\u0639\u0627\u0644\u064a\u0627\u062a",order:4},{name:"\u0645\u0634\u0631\u0641 \u0627\u0644\u0641\u0639\u0627\u0644\u064a\u0627\u062a",order:5},{name:"\u0645\u0633\u0624\u0648\u0644 \u0642\u0633\u0645 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a",order:6},{name:"\u0645\u0634\u0631\u0641 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a",order:7},{name:"\u063a\u064a\u0631 \u0645\u062e\u0635\u0635",order:10}],x=[{id:1,label:"\u0627\u0644\u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0639\u0644\u064a\u0627",orders:[1,1.5]},{id:"technical_content",label:"\u0642\u0633\u0645 \u0641\u0646\u064a \u0645\u062d\u062a\u0648\u0649",orders:[1.6,1.7]},{id:2,label:"\u0642\u0633\u0645 \u0627\u0644\u0645\u062d\u062a\u0648\u0649",orders:[2,3]},{id:3,label:"\u0642\u0633\u0645 \u0627\u0644\u0641\u0639\u0627\u0644\u064a\u0627\u062a",orders:[4,5]},{id:4,label:"\u0642\u0633\u0645 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a",orders:[6,7]},{id:5,label:"\u0623\u062e\u0631\u0649",orders:[10]}],u=()=>{var e,a;const s=(0,c.Zp)(),{theme:u}=(0,m.DP)(),{t:b,resolvedDirection:j}=(0,p.o)(),[v,k]=(0,t.useState)([]),[_,y]=(0,t.useState)(!0),[N,C]=(0,t.useState)(null),[w,S]=(0,t.useState)({isOpen:!1,member:null}),A="\u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645"===N||"\u0646\u0627\u0626\u0628 \u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645"===N,O=e=>{if("\u0645\u0633\u062a\u062e\u062f\u0645"===e)return b("staff_role_user");const a=g.find((a=>a.name===e));return a?b("staff_role_".concat(String(a.order).replace(".","_"))):e||b("staff_role_unassigned")},R=async()=>{try{const e=localStorage.getItem("staffCache");e?(k(JSON.parse(e)),y(!1)):y(!0);const a=(0,l.WR)();if(a){const e=(await o.firebase.database().ref("Roles/".concat(a)).once("value")).val(),s="object"===typeof e&&null!==e?e.role||Object.values(e)[0]:e;C(s||null)}const s=o.firebase.database().ref("Roles"),t=(await s.once("value")).val()||{},n={};g.forEach((e=>{n[e.name]=[]}));const c=Object.keys(t),d={};await Promise.all(c.map((async e=>{const a=await i.A.getProfile(e);a&&(d[e]=a)})));for(const r in t){let e=t[r];if(e="object"===typeof e&&null!==e?e.role||Object.values(e)[0]:e,d[r]){const a=d[r],s=n.hasOwnProperty(e)?e:"\u063a\u064a\u0631 \u0645\u062e\u0635\u0635";n[s]||(n[s]=[]),n[s].push({id:r,name:a.name||"Unknown",img:a.img||"/assets/images/global/user_v2.jpg",tag:a.tag||"@Unknown",role:e,sensitive_img:a.sensitive_img||!1})}}const f=[];g.forEach((e=>{n[e.name]&&n[e.name].forEach((a=>{f.push((0,r.A)((0,r.A)({},a),{},{rankOrder:e.order}))}))})),k(f),localStorage.setItem("staffCache",JSON.stringify(f))}catch(e){console.error("Error fetching staff members:",e)}finally{y(!1)}};if((0,t.useEffect)((()=>{R()}),[]),_)return(0,h.jsx)("div",{className:"staff-page ".concat("dark"===u?"theme-dark-space":"theme-light-space"),children:(0,h.jsx)(f.A,{message:b("staff_loading")})});const z=x.map((e=>(0,r.A)((0,r.A)({},e),{},{members:v.filter((a=>e.orders.includes(a.rankOrder)))}))).filter((e=>e.members.length>0)),E="dark"===u;return(0,h.jsxs)("div",{className:"staff-page ".concat(E?"theme-dark-space":"theme-light-space"),dir:j,style:{paddingTop:"70px"},children:[(0,h.jsxs)("div",{className:"staff-top-bar ".concat(E?"theme-dark-item":"theme-light-item"),children:[(0,h.jsx)("button",{className:"staff-top-back ".concat(E?"theme-dark-item":""),onClick:()=>s(-1),children:(0,h.jsx)(d.A,{size:24})}),(0,h.jsx)("h1",{className:"staff-title",style:{margin:0,flex:1,textAlign:"center",fontSize:"18px"},children:b("staff_title")}),(0,h.jsx)("span",{className:"staff-top-spacer","aria-hidden":"true"})]}),(0,h.jsx)("div",{className:"staff-list ".concat(E?"theme-dark-item":""),style:{marginTop:"20px",padding:"0 12px 24px"},children:0===v.length?(0,h.jsx)("div",{className:"empty-staff",children:(0,h.jsx)("p",{children:b("staff_empty")})}):z.map((e=>(0,h.jsxs)("div",{className:"staff-section-group",children:[(0,h.jsxs)("div",{className:"section-header ".concat(E?"section-header-dark":""),children:[(0,h.jsx)("span",{className:"section-header-line"}),(0,h.jsx)("span",{className:"section-header-label",children:b("staff_group_".concat(e.id))}),(0,h.jsx)("span",{className:"section-header-line"})]}),(0,h.jsx)("div",{className:"staff-section-grid",children:e.members.map((e=>(0,h.jsxs)("div",{className:"staff-card ".concat(E?"staff-card-dark":""),onClick:()=>s("/profile/".concat(e.id)),children:[(0,h.jsx)("img",{src:e.sensitive_img?"/assets/images/global/user_sensitive_img_v2.jpg":e.img,alt:e.name,className:"staff-card-img"}),(0,h.jsxs)("div",{className:"staff-card-info",children:[(0,h.jsx)("p",{className:"staff-card-name ".concat(E?"staff-card-name-dark":""),children:e.name}),(0,h.jsx)("p",{className:"staff-card-tag ".concat(E?"staff-card-tag-dark":""),children:e.tag}),(0,h.jsx)("span",{className:"staff-card-role ".concat(E?"staff-card-role-dark":""),onClick:a=>{A&&(a.stopPropagation(),S({isOpen:!0,member:e}))},style:{cursor:A?"pointer":"default"},children:O(e.role)})]})]},e.id)))})]},e.id)))}),w.isOpen&&(0,n.createPortal)((0,h.jsx)("div",{style:{position:"fixed",inset:0,backgroundColor:"rgba(0,0,0,0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:2e3},children:(0,h.jsxs)("div",{style:{backgroundColor:E?"#1a1a1a":"#fff",borderRadius:"12px",padding:"24px",width:"90%",maxWidth:"400px",boxShadow:"0 10px 40px rgba(0,0,0,0.3)",textAlign:"center",color:E?"#e5e7eb":"#1a1a1a"},children:[(0,h.jsx)("h3",{style:{margin:"0 0 16px 0",fontSize:"18px",fontWeight:"600"},children:b("staff_change_role_title",{name:(null===(e=w.member)||void 0===e?void 0:e.name)||""})}),(0,h.jsxs)("select",{value:null===(a=w.member)||void 0===a?void 0:a.role,onChange:e=>S((0,r.A)((0,r.A)({},w),{},{member:(0,r.A)((0,r.A)({},w.member),{},{role:e.target.value})}
1)),style:{width:"100%",padding:"8px",marginBottom:"16px",backgroundColor:E?"#111":"#fff",color:E?"#e5e7eb":"#1a1a1a",border:E?"1px solid #333":"1px solid #ccc",borderRadius:"6px"},children:[g.filter((e=>!["\u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645","\u0646\u0627\u0626\u0628 \u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645"].includes(e.name))).map((e=>(0,h.jsx)("option",{value:e.name,children:O(e.name)},e.name))),(0,h.jsx)("option",{value:"\u0645\u0633\u062a\u062e\u062f\u0645",children:b("staff_role_user")})]}),(0,h.jsxs)("div",{style:{display:"flex",gap:"10px"},children:[(0,h.jsx)("button",{onClick:()=>{(async(e,a)=>{try{"\u0645\u0633\u062a\u062e\u062f\u0645"===a?await o.firebase.database().ref("Roles/".concat(e)).remove():await o.firebase.database().ref("Roles/".concat(e)).set(a),await R()}catch(s){console.error("Error changing role:",s)}})(w.member.id,w.member.role),S({isOpen:!1,member:null})},style:{flex:1,padding:"10px 20px",border:"none",borderRadius:"6px",backgroundColor:"#1da1f2",color:"#fff",fontSize:"14px",fontWeight:"500",cursor:"pointer"},children:b("staff_save")}),(0,h.jsx)("button",{onClick:()=>S({isOpen:!1,member:null}),style:{flex:1,padding:"10px 20px",border:"none",borderRadius:"6px",backgroundColor:E?"#333":"#ccc",color:E?"#fff":"#000",fontSize:"14px",fontWeight:"500",cursor:"pointer"},children:b("staff_cancel")})]})]})}),document.body)]})}}}]); 2//# sourceMappingURL=9820.1fe367dc.chunk.js.map
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.