1import{I as m,J as F,f as c,b7 as g,k as p,b8 as v}from"./DKX3d90s.js";import{g as h}from"./CZ4unGbA.js";function w(t){return m("/font/page",{method:"GET",params:{...t}})}function y(t){let a=v(t);return a.preview_img_url=t.metadata.cover,a.face=t.metadata.PostScriptName,a.filename=t.metadata.FileName,a.id=a.id.toString(),a.ttf_url=t.url,a}const f=c([]),l=c([]),d=c([]),u=p(()=>[...f.value,...l.value]);function P(t){return new Promise((a,o)=>{w({language:t,page_size:100}).then(e=>{const{code:n,data:s}=e;n?o(new Error("åä½å表å 载失败")):(f.value=s.data.data,a(f))}).catch(e=>{o(e)})})}async function k(){if(g("token"))try{const{data:{data:t,msg:a,code:o}}=await h({type:"font",parent_id:0});if(o!==0)return;if(t?.length){let e=[];t.forEach(n=>{n.assets?.length&&(n.assets=n.assets.map(y),e=e.concat(n.assets))}),l.value=e,d.value=t}}catch(t){console.log(t)}}function A(t=c("")){const a=c(!1);F(()=>[u.value,t.value],e=>{const[n,s]=e;n.map(i=>i.face).includes(s)&&o(s)},{immediate:!0});function o(e){return new Promise((n,s)=>{a.value=!0;const i=u.value.find(r=>r.face===e);new FontFace(i.face,`url(${i.ttf_url}) format("woff2")`).load().then(function(r){document.fonts.add(r),n()}).catch(function(r){s(r)}).finally(()=>{a.value=!1})})}return{isLoadingFont:a}}function B(){return f}function E(){return d}export{B as a,E as b,k as c,P as g,A as u};
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.