PageSourceSearch

https://mistarg.cn/assets/modules/autocomplete.300cd770f936b2a44b17.min.js

js mistarg.cn collected 2026-10-06 13:17:22 UTC 7,460 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,13417,18314,22067,34271,43602,49897,87212,99127],{49897(_,w,u){u.r(w),u.d(w,{del:()=>c,get:()=>I,head:()=>t,patch:()=>s,post:()=>e,put:()=>o});var d=u(91749),h=u.n(d),l=u(65303),g=u(17459),i=u.n(g),E=u(68636),M=u.n(E);const y=config.relative_path+"/api/v3";async function p(n,a){if(n.url=n.url.startsWith("/api")?config.relative_path+n.url:y+n.url,n.headers=n.headers||{},n.headers["x-return-to"]||(n.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof a=="function"){O(n).then(r=>a(null,r),r=>a(r));return}try{return await O(n)}catch(r){if(r.message===await g.translate("[[error:api.401]]",config.userLang)){const{url:m}=await(0,d.fire)("filter:admin.reauth",{url:"login"}),D=await g.translate("[[error:api.reauth-required]]",config.userLang);(0,l.confirm)(D,A=>{A&&(E.setItem("location-hash",window.location.hash),ajaxify.go(m))})}throw r}}async function O(n){const{url:a}=n;delete n.url,n.data&&!(n.data instanceof FormData)&&(n.data=JSON.stringify(n.data||{}),n.headers["content-type"]="application/json; charset=utf-8"),{options:n}=await(0,d.fire)("filter:api.options",{options:n}),n.data&&(n.body=n.data,delete n.data);const r=await fetch(a,n),{headers:m}=r;if(m.get("x-redirect"))return O({url:m.get("x-redirect"),...n});const D=m.get("content-type"),A=D&&D.startsWith("application/json");let P;if(n.method!=="HEAD"&&(A?P=await r.json():P=await r.text()),!r.ok){if(P){const v=A&&(P.status?.message||P.error||""),T=typeof P=="string"?P:r.statusText||`[[error:api.${r.status}]]`;throw new Error(A&&v?v:T)}throw new Error(r.statusText)}return A&&P&&P.hasOwnProperty("status")&&P.hasOwnProperty("response")?P.response:P}function I(n,a,r){return p({url:n+(a&&Object.keys(a).length?"?"+$.param(a):"")},r)}function t(n,a,r){return p({url:n+(a&&Object.keys(a).length?"?"+$.param(a):""),method:"HEAD"},r)}function e(n,a,r,m){return f("POST",n,a,r,m)}function s(n,a,r,m){return f("PATCH",n,a,r,m)}function o(n,a,r,m){return f("PUT",n,a,r,m)}function c(n,a,r,m){return f("DELETE",n,a,r,m)}function f(n,a,r,m,D){return typeof m=="function"&&(D=m,m={}),p({url:a,method:n,data:r,headers:{"x-csrf-token":config.csrf_token,...m}},D)}},34405(_,w,u){var d,h;d=[u(49897),u(29930),u(36e3),u(9787),u(35786)],h=(function(l,g,{Textcomplete:i},{TextareaEditor:E},{ContenteditableEditor:M}){const y={},p={delay:200,appendTo:null};y.init=t=>{const e={...p,...t},{input:s,onSelect:o}=e;app.loadJQueryUI(function(){s.autocomplete({position:O(),...e,open:function(){$(this).autocomplete("widget").css("z-index",100005)},select:function(c,f){I(s,o,c,f)}})})},y.user=function(t,e,s){typeof e=="function"&&(s=e,e={}),e=e||{},y.init({input:t,onSelect:s,source:(o,c)=>{e.query=o.term,l.get("/api/users",e,function(f,n){if(f)return g.error(f);if(n&&n.users){const a=n.users.map(function(r){return r&&{label:r.username,value:r.username,user:{uid:r.uid,name:r.username,slug:r.userslug,username:r.username,userslug:r.userslug,displayname:r.displayname,picture:r.picture,banned:r.banned,"icon:text":r["icon:text"],"icon:bgColor":r["icon:bgColor"]}}});c(a)}$(".ui-autocomplete a").attr("data-ajaxify","false")})}})},y.group=function(t,e){y.init({input:t,onSelect:e,source:(s,o)=>{l.get("/groups",{query:s.term},function(c,f){if(c)return g.error(c);if(f&&f.groups.length){const n=f.groups.map(function(a){return a&&{label:a.name,value:a.name,group:a}});o(n)}$(".ui-autocomplete a").attr("data-ajaxify","false")})}})},y.tag=function(t,e){y.init({input:t,onSelect:e,delay:100,source:(s,o)=>{socket.emit("topics.autocompleteTags",{query:s.term,cid:ajaxify.data.cid||0},function(c,f){if(c)return g.error(c);f&&o(f),$(".ui-autocomplete a").attr("data-ajaxify","false")})}})};function O(){const t=document.querySelector("html").getAttribute("data-dir")==="rtl"?"right":"left";return{my:`${t} top`,at:`${t} bottom`,collision:"none"}}function I(t,e,s,o){e=e||function(){};const c=jQuery.Event("keypress");c.which=13,c.keyCode=13,setTimeout(function(){t.trigger(c)},100),e(s,o)}return y.setup=function({element:t,strategies:e,options:s}){const o=t.get(0);if(!o)return;let c;if(o.nodeName==="TEXTAREA"||o.nodeName==="INPUT"?c=new E(o):o.nodeName==="DIV"&&o.getAttribute("contenteditable")==="true"&&(c=new M(o)),!c)throw new Error("unknown target element type");o.setAttribute("dir",document.querySelector("html").getAttribute("data-dir"));const f=new i(c,e,{dropdown:s});return f.on("rendered",function(){f.dropdown.items.length&&f.dropdown.items[0].activate()}),f},y}
1).apply(w,d),h!==void 0&&(_.exports=h)},65303(_,w,u){u.r(w),u.d(w,{alert:()=>E,confirm:()=>M,dialog:()=>i,prompt:()=>y,promptPassword:()=>p});var d=u(33530),h=u.n(d),l=u(17459),g=u.n(l);d.setDefaults({locale:config.userLang}),l.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(t=>{d.addLocale(config.userLang,{OK:t[0],CANCEL:t[1],CONFIRM:t[2]}),d.setLocale(config.userLang)});async function i(t){const[e,s,o]=await Promise.all([l.translate(t.title||""),O(t)||"",I(t.buttons)]);return d.dialog({...t,title:e,message:s,buttons:o})}async function E(t,e){const[s,o]=await Promise.all([t&&t.title?l.translate(t.title):null,O(t)]);return e=typeof e=="function"?e:t.callback,d.alert({...t,title:s,message:o,callback:e})}async function M(t,e){const[s,o]=await Promise.all([t&&t.title?l.translate(t.title):null,O(t)]);return e=typeof e=="function"?e:t.callback,d.confirm({...t,title:s,message:o,callback:e})}async function y(t,e){const[s,o]=await Promise.all([l.translate(typeof t=="string"?t:t.title),t&&t.message?O(t):null]);return e=typeof e=="function"?e:t.callback,d.prompt({...t,title:s,message:o,callback:e})}async function p(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(e=>{y({...t,inputType:"password",required:!0,value:"",callback:e})})}function O(t){const e=t&&t.message?t.message:t;return e instanceof jQuery?e:l.translate(e||"")}async function I(t){if(!Object.keys(t||{}).length)return;const e=Object.values(t);return await Promise.all(e.map(async s=>({...s,label:await l.translateKey(s.label)})))}},68636(_,w,u){var d;d=(function(){function h(){this._store={},this._keys=[]}h.prototype.isMock=!0,h.prototype.setItem=function(i,E){i=String(i),this._keys.indexOf(i)===-1&&this._keys.push(i),this._store[i]=E},h.prototype.getItem=function(i){return i=String(i),this._keys.indexOf(i)===-1?null:this._store[i]},h.prototype.removeItem=function(i){i=String(i),this._keys=this._keys.filter(function(E){return E!==i}),this._store[i]=null},h.prototype.clear=function(){this._keys=[],this._store={}},h.prototype.key=function(i){return i=parseInt(i,10)||0,this._keys[i]},Object.defineProperty&&Object.defineProperty(h.prototype,"length",{get:function(){return this._keys.length}});let l;const g=Date.now().toString();try{if(l=window.localStorage,l.setItem(g,g),l.getItem(g)!==g)throw Error("localStorage behaved unexpectedly");return l.removeItem(g),l}catch(i){console.warn(i),console.warn("localStorage failed, falling back on sessionStorage");try{if(l=window.sessionStorage,l.setItem(g,g),l.getItem(g)!==g)throw Error("sessionStorage behaved unexpectedly");return l.removeItem(g),l}catch(E){return console.warn(E),console.warn("sessionStorage failed, falling back on memory storage"),new h}}}).call(w,u,w,_),d!==void 0&&(_.exports=d)}}]);

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.