"use strict";const t=require("react"),s=require("./index.cjs39.js");require("./index.cjs40.js");require("./index.cjs41.js");require("./index.cjs42.js");require("./index.cjs43.js");require("./index.cjs44.js");require("./index.cjs45.js");require("./index.cjs46.js");require("./index.cjs47.js");require("./index.cjs48.js");require("./index.cjs49.js");require("./index.cjs50.js");require("./index.cjs51.js");require("./index.cjs52.js");require("./index.cjs53.js");require("./index.cjs54.js");require("./index.cjs55.js");require("./index.cjs56.js");require("./index.cjs57.js");require("./index.cjs58.js");require("./index.cjs59.js");require("./index.cjs60.js");require("./index.cjs61.js");require("./index.cjs62.js");require("./index.cjs63.js");require("./index.cjs64.js");require("./index.cjs65.js");require("./index.cjs66.js");const m=require("./index.cjs75.js"),C=u=>{const[r,f]=t.useState(),[q,h]=t.useState({}),[o,y]=t.useState(),[c,l]=t.useState(),i=t.useMemo(()=>m.default.coreCitationStyles,[]),a=t.useCallback(e=>{const n=s.findWhere(i,{name:e});f(e),y(n?.title)},[i]),S=t.useMemo(()=>({name:r,title:o,xml:c}),[r,o,c]);return t.useEffect(()=>{if(!r){let e;u?e=s.findWhere(i,{name:u}):e=s.findWhere(i,{isDefault:!0}),a(e?.name)}},[i,u]),t.useEffect(()=>{r&&(s.has(q,r)?l(q[r]):fetch(`https://www.zotero.org/styles/${r}`).then(e=>e.text()).then(e=>{l(e),h(n=>({...n,[r]:e}))}))},[r,q]),{onStyleChange:a,style:S,styles:i}};module.exports=C;
//# sourceMappingURL=index.cjs11.js.map
