import{i as e}from"./authSession-Dulxhbeq.js";var t=`he_conv_mem_v1:`,n=8e5,r=e=>`${t}${String(e||``).trim()}`,i=()=>String(e()?.user?.id||``).trim(),a=e=>{try{let t=e?JSON.parse(e):null;return t&&typeof t==`object`?t:null}catch{return null}},o=e=>{try{let t=a(localStorage.getItem(r(e)));if(!t)return null;let n=String(t.userId||``).trim(),o=i();if(o){if(!n||n!==o)return null}else if(n)return null;return t}catch{return null}},s=(e,t)=>{try{let a={...o(e)||{},...t&&typeof t==`object`?t:{},userId:i()||void 0,_ts:Date.now()},s=``;try{s=JSON.stringify(a)}catch{return}if(s.length>n){let e={...a};delete e.uploadedDocs;try{let t=JSON.stringify(e);s=t.length>n?``:t}catch{s=``}if(!s)return}localStorage.setItem(r(e),s)}catch{}},c=e=>{try{localStorage.removeItem(r(e))}catch{}};export{o as n,s as r,c as t};