1"use strict";(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,18314,22067,34271,36159,43602,49897,62441,87212,98463,99127],{49897(D,y,c){c.r(y),c.d(y,{del:()=>w,get:()=>r,head:()=>t,patch:()=>m,post:()=>s,put:()=>E});var d=c(91749),g=c.n(d),i=c(65303),h=c(17459),l=c.n(h),b=c(68636),A=c.n(b);const e=config.relative_path+"/api/v3";async function a(n,f){if(n.url=n.url.startsWith("/api")?config.relative_path+n.url:e+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 f=="function"){o(n).then(u=>f(null,u),u=>f(u));return}try{return await o(n)}catch(u){if(u.message===await h.translate("[[error:api.401]]",config.userLang)){const{url:p}=await(0,d.fire)("filter:admin.reauth",{url:"login"}),_=await h.translate("[[error:api.reauth-required]]",config.userLang);(0,i.confirm)(_,v=>{v&&(b.setItem("location-hash",window.location.hash),ajaxify.go(p))})}throw u}}async function o(n){const{url:f}=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 u=await fetch(f,n),{headers:p}=u;if(p.get("x-redirect"))return o({url:p.get("x-redirect"),...n});const _=p.get("content-type"),v=_&&_.startsWith("application/json");let P;if(n.method!=="HEAD"&&(v?P=await u.json():P=await u.text()),!u.ok){if(P){const S=v&&(P.status?.message||P.error||""),I=typeof P=="string"?P:u.statusText||`[[error:api.${u.status}]]`;throw new Error(v&&S?S:I)}throw new Error(u.statusText)}return v&&P&&P.hasOwnProperty("status")&&P.hasOwnProperty("response")?P.response:P}function r(n,f,u){return a({url:n+(f&&Object.keys(f).length?"?"+$.param(f):"")},u)}function t(n,f,u){return a({url:n+(f&&Object.keys(f).length?"?"+$.param(f):""),method:"HEAD"},u)}function s(n,f,u,p){return O("POST",n,f,u,p)}function m(n,f,u,p){return O("PATCH",n,f,u,p)}function E(n,f,u,p){return O("PUT",n,f,u,p)}function w(n,f,u,p){return O("DELETE",n,f,u,p)}function O(n,f,u,p,_){return typeof p=="function"&&(_=p,p={}),a({url:f,method:n,data:u,headers:{"x-csrf-token":config.csrf_token,...p}},_)}},65303(D,y,c){c.r(y),c.d(y,{alert:()=>b,confirm:()=>A,dialog:()=>l,prompt:()=>e,promptPassword:()=>a});var d=c(33530),g=c.n(d),i=c(17459),h=c.n(i);d.setDefaults({locale:config.userLang}),i.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 l(t){const[s,m,E]=await Promise.all([i.translate(t.title||""),o(t)||"",r(t.buttons)]);return d.dialog({...t,title:s,message:m,buttons:E})}async function b(t,s){const[m,E]=await Promise.all([t&&t.title?i.translate(t.title):null,o(t)]);return s=typeof s=="function"?s:t.callback,d.alert({...t,title:m,message:E,callback:s})}async function A(t,s){const[m,E]=await Promise.all([t&&t.title?i.translate(t.title):null,o(t)]);return s=typeof s=="function"?s:t.callback,d.confirm({...t,title:m,message:E,callback:s})}async function e(t,s){const[m,E]=await Promise.all([i.translate(typeof t=="string"?t:t.title),t&&t.message?o(t):null]);return s=typeof s=="function"?s:t.callback,d.prompt({...t,title:m,message:E,callback:s})}async function a(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(s=>{e({...t,inputType:"password",required:!0,value:"",callback:s})})}function o(t){const s=t&&t.message?t.message:t;return s instanceof jQuery?s:i.translate(s||"")}async function r(t){if(!Object.keys(t||{}).length)return;const s=Object.values(t);return await Promise.all(s.map(async m=>({...m,label:await i.translateKey(m.label)})))}},68636(D,y,c){var d;d=(function(){function g(){this._store={},this._keys=[]}g.prototype.isMock=!0,g.prototype.setItem=function(l,b){l=String(l),this._keys.indexOf(l)===-1&&this._keys.push(l),this._store[l]=b},g.prototype.getItem=function(l){return l=String(l),this._keys.indexOf(l)===-1?null:this._store[l]},g.prototype.removeItem=function(l){l=String(l),this._keys=this._keys.filter(function(b){return b!==l}),this._store[l]=null},g.prototype.clear=function(){this._keys=[],this._store={}},g.prototype.key=function(l){return l=parseInt(l,10)||0,this._keys[l]},Object.defineProperty&&Object.defineProperty(g.prototype,"length",{get:function(){return this._keys.length}});let i;const h=Date.now().toString();try{if(i=window.localStorage,i.setItem(h,h),i.getItem(h)!==h)throw Error("localStorage behaved unexpectedly");return i.removeItem(h),i}catch(l){console.warn(l),console.warn("localStorage failed, falling back on sessionStorage");try{if(i=window.sessionStorage,i.setItem(h,h),i.getItem(h)!==h)throw Error("sessionStorage behaved unexpectedly");return i.removeItem(h),i}catch(b){return console.warn(b),console.warn("sessionStorage failed, falling back on memory storage"),new g}}}).call(y,c,y,D),d!==void 0&&(D.exports=d)},36159(D,y,c){var d,g;d=[c(49897),c(65303),c(29930),c(24187),c(81335),c(17459),c(65285)],g=(function(i,h,l,b,A,e){const a={};return a.get=o=>i.get(`/topics/${o}/thumbs`,{thumbsOnly:1}),a.delete=(o,r)=>i.del(`/topics/${o}/thumbs`,{path:r}),a.updateTopicThumbs=async o=>{const r=await a.get(o),t=await app.parseAndTranslate("partials/topic/thumbs",{thumbs:r});$('[component="topic/thumb/list"]').html(t)},a.deleteAll=o=>{a.get(o).then(r=>{Promise.all(r.map(t=>a.delete(o,t.url)))})},a.upload=()=>new Promise(o=>{b.show({title:"[[topic:composer.thumb-title]]",method:"put",route:config.relative_path+"/api/topic/thumb/upload"},function(r){o(r)})}),a.modal={},a.modal.open=function(o){const{id:r,postData:t}=o;let{modal:s}=o;const m=t.thumbs||[];return new Promise(E=>{A.render("modals/topic-thumbs",{thumbs:m}).then(async w=>{s?e.translate(w,function(O){s.find(".bootbox-body").html(O),a.modal.handleSort({modal:s,thumbs:m})}):(s=await h.dialog({title:"[[modules:thumbs.modal.title]]",message:w,onEscape:!0,backdrop:!0,buttons:{add:{label:"[[modules:thumbs.modal.add]]",className:"btn-success",callback:()=>(a.upload().then(O=>{const n=O.replace(new RegExp(`^${config.relative_path}`),"").replace(new RegExp(`^${config.upload_url}`),"");t.thumbs.push(n),a.modal.open({...o,modal:s}),$(window).trigger("action:composer.thumbs.updateCount",{uuid:r}),E()}),!1)},close:{label:"[[global:close]]",className:"btn-primary"}}}),a.modal.handleDelete({...o,modal:s}),a.modal.handleSort({modal:s,thumbs:m}))})})},a.modal.handleDelete=o=>{const r=o.modal.get(0),{id:t}=o;
1r.addEventListener("click",s=>{s.target.closest('button[data-action="remove"]')&&h.confirm("[[modules:thumbs.modal.confirm-remove]]",m=>{if(!m)return;const E=s.target.closest("[data-path]").getAttribute("data-path"),w=o.postData;w&&w.thumbs&&w.thumbs.includes(E)&&(w.thumbs=w.thumbs.filter(O=>O!==E),a.modal.open(o),$(window).trigger("action:composer.thumbs.updateCount",{uuid:t}))})})},a.modal.handleSort=({modal:o,thumbs:r})=>{if(r.length>1){const t=o.find(".topic-thumbs-modal");t.sortable({items:"[data-path]"}),t.on("sortupdate",function(){if(!r)return;const s=[];t.find("[data-path]").each(function(){const m=$(this).attr("data-path"),E=r.find(w=>w===m);E&&s.push(E)}),r.length=0,Array.prototype.push.apply(r,s)})}},a}).apply(y,d),g!==void 0&&(D.exports=g)},24187(D,y,c){var d,g;d=[c(64061)],g=(function(){const i={};i.show=function(e,a){const o=e.hasOwnProperty("fileSize")&&e.fileSize!==void 0?parseInt(e.fileSize,10):!1;app.parseAndTranslate("modals/upload-file",{showHelp:e.hasOwnProperty("showHelp")&&e.showHelp!==void 0?e.showHelp:!0,fileSize:o,title:e.title||"[[global:upload-file]]",description:e.description||"",button:e.button||"[[global:upload]]",accept:e.accept?e.accept.replace(/,/g,", "):""},function(r){r.modal("show"),r.on("hidden.bs.modal",function(){r.remove()});const t=r.find("#uploadForm");t.attr("action",e.route),t.find("#params").val(JSON.stringify(e.params)),r.find("#fileUploadSubmitBtn").on("click",function(){$(this).addClass("disabled"),t.submit()}),t.submit(function(){return h(r,o,a),!1})})},i.hideAlerts=function(e){$(e).find("#alert-status, #alert-success, #alert-error, #upload-progress-box").addClass("hide")};function h(e,a,o){l(e,"status","[[uploads:uploading-file]]"),e.find("#upload-progress-bar").css("width","0%"),e.find("#upload-progress-box").show().removeClass("hide");const r=e.find("#fileInput");if(!r.val())return l(e,"error","[[uploads:select-file-to-upload]]");if(!A(r[0],a))return l(e,"error","[[error:file-too-big, "+a+"]]");i.ajaxSubmit(e,o)}function l(e,a,o){i.hideAlerts(e),a==="error"&&e.find("#fileUploadSubmitBtn").removeClass("disabled"),o=o.replace(/&#44/g,","),e.find("#alert-"+a).translateText(o).removeClass("hide")}i.ajaxSubmit=function(e,a){e.find("#uploadForm").ajaxSubmit({headers:{"x-csrf-token":config.csrf_token},error:function(r){r=b(r),l(e,"error",r.responseJSON?.status?.message||r.responseJSON?.error||`[[error:upload-error-fallback, ${r.status} ${r.statusText}]]`)},uploadProgress:function(r,t,s,m){e.find("#upload-progress-bar").css("width",m+"%")},success:function(r){let t=b(r);r.hasOwnProperty("response")&&r.hasOwnProperty("status")&&r.status.code==="ok"&&(t=r.response.images),a(t[0].url),l(e,"success","[[uploads:upload-success]]"),setTimeout(function(){i.hideAlerts(e),e.modal("hide")},750)}})};function b(e){if(typeof e=="string")try{return JSON.parse(e)}catch(a){return console.error(a),{error:"[[error:parse-error]]"}}return e}function A(e,a){return window.FileReader&&a?e.files[0].size<=a*1e3:!0}return i}).apply(y,d),g!==void 0&&(D.exports=g)}}]);
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.