1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7250],{7250:(e,t,r)=>{r.r(t),r.d(t,{clearSaves:()=>g,existsOnDevice:()=>v,getSaves:()=>a,neutralTitle:()=>h,recordSave:()=>m,removeSave:()=>w,sourceUrlFromDownloadUrl:()=>f,stashThumbnail:()=>u,titleFromFilename:()=>s});let n="sr_saves_v1";function i(){return void 0!==window.localStorage}function a(){if(!i())return[];try{let e=window.localStorage.getItem(n);if(!e)return[];let t=JSON.parse(e);if(!Array.isArray(t))return[];return t.filter(e=>!!e&&"string"==typeof e.id&&"number"==typeof e.ts)}catch(e){return[]}}function o(e){if(!i())return;let t=e.slice(0,100);try{window.localStorage.setItem(n,JSON.stringify(t))}catch(e){try{let e=t.map((e,t)=>t<20?e:{...e,thumb:void 0});window.localStorage.setItem(n,JSON.stringify(e))}catch(e){}}}let l=new Map;async function c(e){if("undefined"!=typeof document)try{let t=new Image;t.crossOrigin="anonymous";let r=new Promise((e,r)=>{t.onload=()=>e(),t.onerror=()=>r(Error("thumb load failed"))});t.src=e,await Promise.race([r,new Promise((e,t)=>setTimeout(()=>t(Error("thumb timeout")),6e3))]);let n=document.createElement("canvas");n.width=96,n.height=96;let i=n.getContext("2d");if(!i||!t.width||!t.height)return;let a=Math.max(96/t.width,96/t.height),o=t.width*a,l=t.height*a;i.drawImage(t,(96-o)/2,(96-l)/2,o,l);let c=n.toDataURL("image/jpeg",.6);return c.length>2e4?void 0:c}catch(e){return}}function u(e,t){e&&t&&c(t).then(t=>{t&&l.set(e,t)})}function s(e){return e.replace(/^savereels\.online-/i,"").replace(/\.[a-z0-9]{2,4}$/i,"").replace(/-\d+-[a-z0-9]{6,}$/i,"").replace(/-sr[a-z0-9]{10,}$/i,"").replace(/-+/g," ").trim()||"Saved file"}let d=/^(youtube|snapchat)\b[\s-]*(shorts?|reel|video|story|media|photo)?[\s-]*/i;function h(e){let t=d.exec(e.title);if(!t)return e.title;let r=e.title.slice(t[0].length).trim(),n="audio"===e.kind?"Audio":"photo"===e.kind?"Photo":"Video";return r?"".concat(n," ").concat(r):n}function f(e){try{var t;return null!=(t=new URL(e,window.location.href).searchParams.get("sourceUrl"))?t:void 0}catch(e){return}}function m(e){var t,r;let n=l.get(e.filename);l.delete(e.filename);let i={...e,...(null!=(t=e.thumb)?t:n)?{thumb:null!=(r=e.thumb)?r:n}:{},id:"".concat(e.ts,"-").concat(Math.random().toString(36).slice(2,8))},c=a().filter(e=>e.filename!==i.filename);return o([i,...c]),i}function w(e){o(a().filter(t=>t.id!==e))}function g(){if(i())try{window.localStorage.removeItem(n)}catch(e){}}async function v(e){if(!e)return null;try{let{Capacitor:t}=await Promise.resolve().then(r.bind(r,8666));if(!t.isNativePlatform())return null;let{Filesystem:n}=await r.e(4604).then(r.bind(r,4604));return await n.stat({path:e}),!0}catch(r){var t;let e=String(null!=(t=null==r?void 0:r.message)?t:r).toLowerCase();if(e.includes("does not exist")||e.includes("not exist")||e.includes("no such file"))return!1;return null}}}}]);
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.