PageSourceSearch

https://babylonbee.com/build/assets/submissionOutbox-Bl_dcaHM.js

js babylonbee.com collected 2026-09-24 08:28:45 UTC 2,599 bytes, 1 lines download raw bytes

1import{e as l}from"./_plugin-vue_export-helper-CZPp-EVN.js";const g="pendingSubmissions",p=[2e3,5e3,1e4,2e4,3e4,6e4],E=2,c=new Set;let f={},o=null;function w(){if(o!==null)return o;try{const t="__outbox_probe__";window.localStorage.setItem(t,"1"),window.localStorage.removeItem(t),o=!0}catch{o=!1}return o}function s(){if(w())try{return JSON.parse(window.localStorage.getItem(g))||{}}catch{return Object.assign({},f)}return Object.assign({},f)}function h(t){if(f=t||{},w())try{window.localStorage.setItem(g,JSON.stringify(t))}catch{o=!1}}function i(t){return s()[t]||null}function S(t){const e=s();e[t.token]=t,h(e)}function y(t){const e=s();delete e[t],h(e),c.delete(t)}function j(){return window.crypto&&typeof window.crypto.randomUUID=="function"?window.crypto.randomUUID():"sub-"+Date.now().toString(36)+"-"+Math.random().toString(36).slice(2,10)}function x(t){const e=new FormData;return Object.keys(t.fields||{}).forEach(n=>{e.append(n,t.fields[n])}),e.set("idempotency_key",t.token),e}function A(){try{const t=document.querySelector('meta[name="bearer"]'),e=t?t.getAttribute("content"):"";return e?{Authorization:e}:{}}catch{return{}}}function _(t){if(!t||!t.response)return"retry";const e=t.response.status;return e>=500||e===408||e===429?"retry":"reject"}function I(t){return p[Math.min(t,p.length-1)]}function D(t){const e=i(t);if(!e){c.delete(t);return}const n=I(e.attempts||0);setTimeout(()=>{c.delete(t),u(t)},n)}function u(t){if(c.has(t))return;const e=i(t);e&&(c.add(t),window.axios.post(e.url,x(e),{timeout:6e4,headers:A()}).then(n=>{const r=n&&n.data;if(r==="error"||r===void 0||r===null){b(t);return}y(t),l.emit("outbox:success",{token:t,composerKey:e.composerKey,data:r})}).catch(n=>{if(_(n)==="reject"){const r=n.response&&n.response.data;y(t),l.emit("outbox:rejected",{token:t,composerKey:e.composerKey,status:n.response?n.response.status:null,data:r});return}b(t)}))}function b(t){const e=i(t);if(!e){c.delete(t);return}e.attempts=(e.attempts||0)+1,S(e),e.attempts>=E&&l.emit("outbox:stillPending",{token:t,composerKey:e.composerKey}),D(t)}const U={enqueue({url:t,fields:e,composerKey:n,dedupeKey:r}){const K=s(),a=Object.values(K).find(m=>m.dedupeKey&&m.dedupeKey===r);if(a)return u(a.token),a.token;const d=j(),O={token:d,url:t,fields:e||{},composerKey:n||"",dedupeKey:r||"",attempts:0,createdAt:Date.now()};return S(O),u(d),d},resume(){const t=s();Object.keys(t).forEach(e=>u(e))},findByComposer(t){const e=Object.values(s()).filter(n=>n.composerKey===t);return e.length?e.sort((n,r)=>(r.createdAt||0)-(n.createdAt||0))[0]:null},hasPending(t){return!!i(t)}};export{U as s};

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.