import{r as e}from"./norm-CeclA1Tu.js";var t=`he_usage_feature_overrides_v1`,n=`he_web_tool_run_v2:`,r=e=>{try{return e?JSON.parse(e):null}catch{return null}},i=()=>{try{let e=r(globalThis.localStorage?.getItem(t)||null);return Array.isArray(e)?e:[]}catch{return[]}},a=n=>{try{let r=Date.now(),a=n.map(t=>({requestId:e(t?.requestId).toLowerCase(),label:e(t?.label),createdAt:r})).filter(e=>e.requestId&&e.label);if(!a.length)return;let o=new Map;for(let t of i()){let n=e(t?.requestId).toLowerCase(),i=e(t?.label);n&&i&&o.set(n,{requestId:n,label:i,createdAt:Number(t?.createdAt||0)||r})}for(let e of a)o.set(e.requestId,e);let s=Array.from(o.values()).sort((e,t)=>Number(t.createdAt||0)-Number(e.createdAt||0)).slice(0,500);globalThis.localStorage?.setItem(t,JSON.stringify(s))}catch{}},o=t=>{try{let i=globalThis.localStorage;if(!i)return``;for(let a=i.length-1;a>=0;a--){let o=i.key(a);if(!o||!o.startsWith(n)||!o.endsWith(`:multi_model_lab`))continue;let s=r(i.getItem(o));if((Array.isArray(s?.runs)?s.runs:[]).some(n=>Array.isArray(n?.requestIds)&&n.requestIds.map(t=>e(t).toLowerCase()).includes(t)))return e(s?.scene)===`resume_optimize`?`多模型实验室（简历优化）`:`多模型实验室（简历匹配）`}}catch{}return``},s=t=>{let n=e(t).toLowerCase();if(!n)return``;let r=i().find(t=>e(t?.requestId).toLowerCase()===n);return r?.label?e(r.label):o(n)};export{a as n,s as t};