1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,13230,18314,22067,26174,26874,34271,43602,49897,87212,99127],{49897(P,_,l){l.r(_),l.d(_,{del:()=>p,get:()=>y,head:()=>e,patch:()=>m,post:()=>r,put:()=>s});var c=l(91749),h=l.n(c),i=l(65303),d=l(17459),o=l.n(d),E=l(68636),v=l.n(E);const u=config.relative_path+"/api/v3";async function f(t,n){if(t.url=t.url.startsWith("/api")?config.relative_path+t.url:u+t.url,t.headers=t.headers||{},t.headers["x-return-to"]||(t.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof n=="function"){w(t).then(a=>n(null,a),a=>n(a));return}try{return await w(t)}catch(a){if(a.message===await d.translate("[[error:api.401]]",config.userLang)){const{url:g}=await(0,c.fire)("filter:admin.reauth",{url:"login"}),I=await d.translate("[[error:api.reauth-required]]",config.userLang);(0,i.confirm)(I,A=>{A&&(E.setItem("location-hash",window.location.hash),ajaxify.go(g))})}throw a}}async function w(t){const{url:n}=t;delete t.url,t.data&&!(t.data instanceof FormData)&&(t.data=JSON.stringify(t.data||{}),t.headers["content-type"]="application/json; charset=utf-8"),{options:t}=await(0,c.fire)("filter:api.options",{options:t}),t.data&&(t.body=t.data,delete t.data);const a=await fetch(n,t),{headers:g}=a;if(g.get("x-redirect"))return w({url:g.get("x-redirect"),...t});const I=g.get("content-type"),A=I&&I.startsWith("application/json");let D;if(t.method!=="HEAD"&&(A?D=await a.json():D=await a.text()),!a.ok){if(D){const M=A&&(D.status?.message||D.error||""),L=typeof D=="str
1ing"?D:a.statusText||`[[error:api.${a.status}]]`;throw new Error(A&&M?M:L)}throw new Error(a.statusText)}return A&&D&&D.hasOwnProperty("status")&&D.hasOwnProperty("response")?D.response:D}function y(t,n,a){return f({url:t+(n&&Object.keys(n).length?"?"+$.param(n):"")},a)}function e(t,n,a){return f({url:t+(n&&Object.keys(n).length?"?"+$.param(n):""),method:"HEAD"},a)}function r(t,n,a,g){return O("POST",t,n,a,g)}function m(t,n,a,g){return O("PATCH",t,n,a,g)}function s(t,n,a,g){return O("PUT",t,n,a,g)}function p(t,n,a,g){return O("DELETE",t,n,a,g)}function O(t,n,a,g,I){return typeof g=="function"&&(I=g,g={}),f({url:n,method:t,data:a,headers:{"x-csrf-token":config.csrf_token,...g}},I)}},65303(P,_,l){l.r(_),l.d(_,{alert:()=>E,confirm:()=>v,dialog:()=>o,prompt:()=>u,promptPassword:()=>f});var c=l(33530),h=l.n(c),i=l(17459),d=l.n(i);c.setDefaults({locale:config.userLang}),i.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(e=>{c.addLocale(config.userLang,{OK:e[0],CANCEL:e[1],CONFIRM:e[2]}
1),c.setLocale(config.userLang)});async function o(e){const[r,m,s]=await Promise.all([i.translate(e.title||""),w(e)||"",y(e.buttons)]);return c.dialog({...e,title:r,message:m,buttons:s})}async function E(e,r){const[m,s]=await Promise.all([e&&e.title?i.translate(e.title):null,w(e)]);return r=typeof r=="function"?r:e.callback,c.alert({...e,title:m,message:s,callback:r})}async function v(e,r){const[m,s]=await Promise.all([e&&e.title?i.translate(e.title):null,w(e)]);return r=typeof r=="function"?r:e.callback,c.confirm({...e,title:m,message:s,callback:r})}async function u(e,r){const[m,s]=await Promise.all([i.translate(typeof e=="string"?e:e.title),e&&e.message?w(e):null]);return r=typeof r=="function"?r:e.callback,c.prompt({...e,title:m,message:s,callback:r})}async function f(e){return typeof e=="string"&&(e={title:e}),e=e||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(r=>{u({...e,inputType:"password",required:!0,value:"",callback:r})})}function w(e){const r=e&&e.message?e.message:e;return r instanceof jQuery?r:i.translate(r||"")}async function y(e){if(!Object.keys(e||{}).length)return;const r=Object.values(e);return await Promise.all(r.map(async m=>({...m,label:await i.translateKey(m.label)})))}},13230(P,_,l){var c,h;(function(i){c=i,h=typeof c=="function"?c.call(_,l,_,P):c,h!==void 0&&(P.exports=h)})(function(){const i=/[^\p{L}\s\d\-_@.]/gu,d=/[^\w\s\d\-_@.]/g,o=/^\s+|\s+$/g,E=/\s+/g,v=/-+/g,u=/-$/g,f=/^-/g,w=/^[\w\d\s.,\-@]+$/;return function(e,r){return!e||(e=String(e).replace(o,""),w.test(e)?e=e.replace(d,"-"):e=e.replace(i,"-"),e=r?e:e.toLocaleLowerCase(),e=e.replace(E,"-"),e=e.replace(v,"-"),e=e.replace(u,""),e=e.replace(f,""),e==="."||e==="..")?"":e}})},68636(P,_,l){var c;c=(function(){function h(){this._store={},this._keys=[]}h.prototype.isMock=!0,h.prototype.setItem=function(o,E){o=String(o),this._keys.indexOf(o)===-1&&this._keys.push(o),this._store[o]=E},h.prototype.getItem=function(o){return o=String(o),this._keys.indexOf(o)===-1?null:this._store[o]},h.prototype.removeItem=function(o){o=String(o),this._keys=this._keys.filter(function(E){return E!==o}),this._store[o]=null},h.prototype.clear=function(){this._keys=[],this._store={}},h.prototype.key=function(o){return o=parseInt(o,10)||0,this._keys[o]},Object.defineProperty&&Object.defineProperty(h.prototype,"length",{get:function(){return this._keys.length}});let i;const d=Date.now().toString();try{if(i=window.localStorage,i.setItem(d,d),i.getItem(d)!==d)throw Error("localStorage behaved unexpectedly");return i.removeItem(d),i}catch(o){console.warn(o),console.warn("localStorage failed, falling back on sessionStorage");try{if(i=window.sessionStorage,i.setItem(d,d),i.getItem(d)!==d)throw Error("sessionStorage behaved unexpectedly");return i.removeItem(d),i}catch(E){return console.warn(E),console.warn("sessionStorage failed, falling back on memory storage"),new h}}}).call(_,l,_,P),c!==void 0&&(P.exports=c)},64308(P,_,l){var c,h;c=[l(49897),l(91749),l(13230),l(81335)],h=(function(i,d,o,E){const v={};return v.init=function(u,f){if(!u||!u.length)return;f=f||{};let w,y=[];f.selectedUsers&&(y=f.selectedUsers.map(s=>({...s}))),d.fire("action:user.filter.options",{el:u,options:f});async function e(){const s=f.selectedBlock||"userFilterSelected",p={};if(s.indexOf(".")!==-1){const t=s.split(".");p[t[0]]={},p[t[0]][t[1]]=y}else p[s]=y;const O=await app.parseAndTranslate(f.template,s,p);u.find('[component="user/filter/selected"]').html(O)}async function r(){await e(),f.onSelect&&f.onSelect(y)}async function m(){let s={users:[]};const p=u.find('[component="user/filter/search"]').val();if(p&&p.length>1)if(app.user.privileges["search:users"])s=await i.get("/api/users",{query:p});else try{const n=await i.get(`/api/user/${o(p)}`);s.users.push(n)}catch(n){console.error(n)}if(!s.users.length){u.find('[component="user/filter/results"]').translateText("[[users:no-users-found]]");return}s.users=s.users.slice(0,20);const O={};s.users.forEach(n=>{O[n.uid]=n});const t=await app.parseAndTranslate(f.template,"userFilterResults",{userFilterResults:s.users});u.find('[component="user/filter/results"]').html(t),u.find('[component="user/filter/results"] [data-uid]').on("click",async function(){const n=parseInt($(this).attr("data-uid"),10);y.find(a=>a.uid===n)||(y.push(O[n]),await r())})}u.find('[component="user/filter/search"]').on("keyup",()=>{u.find('[component="user/filter/results"]').html(w)}),u.find('[component="user/filter/search"]').on("keyup",utils.debounce(function(){app.user.privileges["search:users"]&&m()},1e3)),u.on("click",'[component="user/filter/delete"]',async function(){const s=$(this).attr("data-uid");y=y.filter(p=>parseInt(p.uid,10)!==parseInt(s,10)),await r()}),u.find('[component="user/filter/search"]').on("keyup",s=>{s.key==="Enter"&&!app.user.privileges["search:users"]&&m()}),u.on("shown.bs.dropdown",function(){u.find('[component="user/filter/search"]').trigger("focus")}),u.on("hidden.bs.dropdown",function(){f.onHidden&&f.onHidden(y)}),E.render(f.placeholderTemplate||"partials/userFilter-placeholders").then(s=>{w=s})},v}
1).apply(_,c),h!==void 0&&(P.exports=h)}}]);
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.