PageSourceSearch

https://mistarg.cn/assets/forum/account-web-push.de238f79d4536f0283b8.min.js

js mistarg.cn collected 2026-10-06 13:16:53 UTC 6,858 bytes, 1 lines download raw bytes

1(self.webpackChunknodebb=self.webpackChunknodebb||[]).push([[1091,3452,18314,22067,34271,43602,49897,87212,99127],{43586(O,y,s){O.exports=s(4812)},49897(O,y,s){"use strict";s.r(y),s.d(y,{del:()=>M,get:()=>v,head:()=>t,patch:()=>m,post:()=>n,put:()=>E});var l=s(91749),h=s.n(l),i=s(65303),f=s(17459),r=s.n(f),d=s(68636),u=s.n(d);const p=config.relative_path+"/api/v3";async function b(e,o){if(e.url=e.url.startsWith("/api")?config.relative_path+e.url:p+e.url,e.headers=e.headers||{},e.headers["x-return-to"]||(e.headers["x-return-to"]=`${window.location.pathname.slice(config.relative_path.length)}${window.location.search}`),typeof o=="function"){g(e).then(a=>o(null,a),a=>o(a));return}try{return await g(e)}catch(a){if(a.message===await f.translate("[[error:api.401]]",config.userLang)){const{url:c}=await(0,l.fire)("filter:admin.reauth",{url:"login"}),_=await f.translate("[[error:api.reauth-required]]",config.userLang);(0,i.confirm)(_,P=>{P&&(d.setItem("location-hash",window.location.hash),ajaxify.go(c))})}throw a}}async function g(e){const{url:o}=e;delete e.url,e.data&&!(e.data instanceof FormData)&&(e.data=JSON.stringify(e.data||{}),e.headers["content-type"]="application/json; charset=utf-8"),{options:e}=await(0,l.fire)("filter:api.options",{options:e}),e.data&&(e.body=e.data,delete e.data);const a=await fetch(o,e),{headers:c}=a;if(c.get("x-redirect"))return g({url:c.get("x-redirect"),...e});const _=c.get("content-type"),P=_&&_.startsWith("application/json");let w;if(e.method!=="HEAD"&&(P?w=await a.json():w=await a.text()),!a.ok){if(w){const I=P&&(w.status?.message||w.error||""),A=typeof w=="string"?w:a.statusText||`[[error:api.${a.status}]]`;throw new Error(P&&I?I:A)}throw new Error(a.statusText)}return P&&w&&w.hasOwnProperty("status")&&w.hasOwnProperty("response")?w.response:w}function v(e,o,a){return b({url:e+(o&&Object.keys(o).length?"?"+$.param(o):"")},a)}function t(e,o,a){return b({url:e+(o&&Object.keys(o).length?"?"+$.param(o):""),method:"HEAD"},a)}function n(e,o,a,c){return D("POST",e,o,a,c)}function m(e,o,a,c){return D("PATCH",e,o,a,c)}function E(e,o,a,c){return D("PUT",e,o,a,c)}function M(e,o,a,c){return D("DELETE",e,o,a,c)}function D(e,o,a,c,_){return typeof c=="function"&&(_=c,c={}),b({url:o,method:e,data:a,headers:{"x-csrf-token":config.csrf_token,...c}},_)}},65303(O,y,s){"use strict";s.r(y),s.d(y,{alert:()=>d,confirm:()=>u,dialog:()=>r,prompt:()=>p,promptPassword:()=>b});var l=s(33530),h=s.n(l),i=s(17459),f=s.n(i);l.setDefaults({locale:config.userLang}),i.translateKeys(["modules:bootbox.ok","modules:bootbox.cancel","modules:bootbox.confirm"]).then(t=>{l.addLocale(config.userLang,{OK:t[0],CANCEL:t[1],CONFIRM:t[2]}),l.setLocale(config.userLang)});async function r(t){const[n,m,E]=await Promise.all([i.translate(t.title||""),g(t)||"",v(t.buttons)]);return l.dialog({...t,title:n,message:m,buttons:E})}async function d(t,n){const[m,E]=await Promise.all([t&&t.title?i.translate(t.title):null,g(t)]);return n=typeof n=="function"?n:t.callback,l.alert({...t,title:m,message:E,callback:n})}async function u(t,n){const[m,E]=await Promise.all([t&&t.title?i.translate(t.title):null,g(t)]);return n=typeof n=="function"?n:t.callback,l.confirm({...t,title:m,message:E,callback:n})}async function p(t,n){const[m,E]=await Promise.all([i.translate(typeof t=="string"?t:t.title),t&&t.message?g(t):null]);return n=typeof n=="function"?n:t.callback,l.prompt({...t,title:m,message:E,callback:n})}async function b(t){return typeof t=="string"&&(t={title:t}),t=t||{title:"[[user:current-password]]",message:"[[user:emailUpdate.password-challenge]]"},await new Promise(n=>{p({...t,inputType:"password",required:!0,value:"",callback:n})})}function g(t){const n=t&&t.message?t.message:t;return n instanceof jQuery?n:i.translate(n||"")}async function v(t){if(!Object.keys(t||{}).length)return;const n=Object.values(t);return await Promise.all(n.map(async m=>({...m,label:await i.translateKey(m.label)})))}},68636(O,y,s){"use strict";var l;l=(function(){function h(){this._store={},this._keys=[]}h.prototype.isMock=!0,h.prototype.setItem=function(r,d){r=String(r),this._keys.indexOf(r)===-1&&this._keys.push(r),this._store[r]=d},h.prototype.getItem=function(r){return r=String(r),this._keys.indexOf(r)===-1?null:this._store[r]},h.prototype.removeItem=function(r){r=String(r),this._keys=this._keys.filter(function(d){return d!==r}),this._store[r]=null},h.prototype.clear=function(){this._keys=[],this._store={}},h.prototype.key=function(r){return r=parseInt(r,10)||0,this._keys[r]},Object.defineProperty&&Object.defineProperty(h.prototype,"length",{get:function(){return this._keys.length}});let i;const f=Date.now().toString();try{if(i=window.localStorage,i.setItem(f,f),i.getItem(f)!==f)throw Error("localStorage behaved unexpectedly");return i.removeItem(f),i}catch(r){console.warn(r),console.warn("localStorage failed, falling back on sessionStorage");try{if(i=window.sessionStorage,i.setItem(f,f),i.getItem(f)!==f)throw Error("sessionStorage behaved unexpectedly");return i.removeItem(f),i}catch(d){return console.warn(d),console.warn("sessionStorage failed, falling back on memory storage"),new h}}}).call(y,s,y,O),l!==void 0&&(O.exports=l)},4812(O,y,s){"use strict";s.r(y),s.d(y,{init:()=>i});var l=s(49897),h=s(29930);async function i(){const r=document.querySelector('[component="web-push-form"]');if(!r){console.error("Web Push form container not found");return}const d=await navigator.serviceWorker.ready;let u=await d.pushManager.getSubscription();const p=f(config["web-push"].vapidKey);r.addEventListener("click",async t=>{const n=t.target.closest("[data-action]");
1if(n)switch(n.getAttribute("data-action")){case"test":{u?(await(0,l.post)("/plugins/web-push/test",{subscription:u}),(0,h.success)("[[web-push:toast.test_success]]")):(0,h.warning)("[[web-push:toast.test_unavailable]]");break}case"remove":{const E=n.getAttribute("data-endpoint");await(0,l.del)("/plugins/web-push/subscription",{subscription:{endpoint:E}}),ajaxify.refresh();break}case"toggle":{if(u)await u.unsubscribe(),await(0,l.del)("/plugins/web-push/subscription",{subscription:u.toJSON()}),u=null,ajaxify.refresh();else try{u=await d.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:p}),await(0,l.post)("/plugins/web-push/subscription",{subscription:u.toJSON()}),ajaxify.refresh()}catch{n.checked=!1}break}}});const b=document.getElementById("enabled"),g=ajaxify.data.devices||[];u&&g.some(t=>t.endpoint===u.endpoint)?b.checked=!0:u&&(await u.unsubscribe(),u=null),await d.pushManager.permissionState({userVisibleOnly:!0,applicationServerKey:p})==="denied"&&document.getElementById("permission-warning").classList.remove("d-none")}function f(r){const d="=".repeat((4-r.length%4)%4),u=(r+d).replace(/-/g,"+").replace(/_/g,"/"),p=window.atob(u),b=new Uint8Array(p.length);for(let g=0;g<p.length;
1++g)b[g]=p.charCodeAt(g);return b}}}]);

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.