import{g as j,b as L,a as P}from"./BwvpQLVM.js";import{f as D,a1 as b,r as K}from"./D6pLkgTX.js";const U=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function T(n,r){r?r={...U,...r}:r=U;const s=A(r);return s.dispatch(n),s.toString()}const H=Object.freeze(["prototype","__proto__","constructor"]);function A(n){let r="",s=new Map;const t=e=>{r+=e};return{toString(){return r},getContext(){return s},dispatch(e){return n.replacer&&(e=n.replacer(e)),this[e===null?"null":typeof e](e)},object(e){if(e&&typeof e.toJSON=="function")return this.object(e.toJSON());const i=Object.prototype.toString.call(e);let a="";const h=i.length;h<10?a="unknown:["+i+"]":a=i.slice(8,h-1),a=a.toLowerCase();let u=null;if((u=s.get(e))===void 0)s.set(e,s.size);else return this.dispatch("[CIRCULAR:"+u+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(e))return t("buffer:"),t(e.toString("utf8"));if(a!=="object"&&a!=="function"&&a!=="asyncfunction")this[a]?this[a](e):n.ignoreUnknown||this.unkown(e,a);else{let o=Object.keys(e);n.unorderedObjects&&(o=o.sort());let l=[];n.respectType!==!1&&!O(e)&&(l=H),n.excludeKeys&&(o=o.filter(c=>!n.excludeKeys(c)),l=l.filter(c=>!n.excludeKeys(c))),t("object:"+(o.length+l.length)+":");const p=c=>{this.dispatch(c),t(":"),n.excludeValues||this.dispatch(e[c]),t(",")};for(const c of o)p(c);for(const c of l)p(c)}},array(e,i){if(i=i===void 0?n.unorderedArrays!==!1:i,t("array:"+e.length+":"),!i||e.length<=1){for(const u of e)this.dispatch(u);return}const a=new Map,h=e.map(u=>{const o=A(n);o.dispatch(u);for(const[l,p]of o.getContext())a.set(l,p);return o.toString()});return s=a,h.sort(),this.array(h,!1)},date(e){return t("date:"+e.toJSON())},symbol(e){return t("symbol:"+e.toString())},unkown(e,i){if(t(i),!!e&&(t(":"),e&&typeof e.entries=="function"))return this.array(Array.from(e.entries()),!0)},error(e){return t("error:"+e.toString())},boolean(e){return t("bool:"+e)},string(e){t("string:"+e.length+":"),t(e)},function(e){t("fn:"),O(e)?this.dispatch("[native]"):this.dispatch(e.toString()),n.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(e.name)),n.respectFunctionProperties&&this.object(e)},number(e){return t("number:"+e)},xml(e){return t("xml:"+e.toString())},null(){return t("Null")},undefined(){return t("Undefined")},regexp(e){return t("regex:"+e.toString())},uint8array(e){return t("uint8array:"),this.dispatch(Array.prototype.slice.call(e))},uint8clampedarray(e){return t("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(e))},int8array(e){return t("int8array:"),this.dispatch(Array.prototype.slice.call(e))},uint16array(e){return t("uint16array:"),this.dispatch(Array.prototype.slice.call(e))},int16array(e){return t("int16array:"),this.dispatch(Array.prototype.slice.call(e))},uint32array(e){return t("uint32array:"),this.dispatch(Array.prototype.slice.call(e))},int32array(e){return t("int32array:"),this.dispatch(Array.prototype.slice.call(e))},float32array(e){return t("float32array:"),this.dispatch(Array.prototype.slice.call(e))},float64array(e){return t("float64array:"),this.dispatch(Array.prototype.slice.call(e))},arraybuffer(e){return t("arraybuffer:"),this.dispatch(new Uint8Array(e))},url(e){return t("url:"+e.toString())},map(e){t("map:");const i=[...e];return this.array(i,n.unorderedSets!==!1)},set(e){t("set:");const i=[...e];return this.array(i,n.unorderedSets!==!1)},file(e){return t("file:"),this.dispatch([e.name,e.size,e.type,e.lastModfied])},blob(){if(n.ignoreUnknown)return t("[blob]");throw new Error(`Hashing Blob objects is currently not supported
Use "options.replacer" or "options.ignoreUnknown"
`)},domwindow(){return t("domwindow")},bigint(e){return t("bigint:"+e.toString())},process(){return t("process")},timer(){return t("timer")},pipe(){return t("pipe")},tcp(){return t("tcp")},udp(){return t("udp")},tty(){return t("tty")},statwatcher(){return t("statwatcher")},securecontext(){return t("securecontext")},connection(){return t("connection")},zlib(){return t("zlib")},context(){return t("context")},nodescript(){return t("nodescript")},httpparser(){return t("httpparser")},dataview(){return t("dataview")},signal(){return t("signal")},fsevent(){return t("fsevent")},tlswrap(){return t("tlswrap")}}}const F="[native code] }",M=F.length;function O(n){return typeof n!="function"?!1:Function.prototype.toString.call(n).slice(-M)===F}class g{constructor(r,s){r=this.words=r||[],this.sigBytes=s===void 0?r.length*4:s}toString(r){return(r||N).stringify(this)}concat(r){if(this.clamp(),this.sigBytes%4)for(let s=0;s<r.sigBytes;s++){const t=r.words[s>>>2]>>>24-s%4*8&255;this.words[this.sigBytes+s>>>2]|=t<<24-(this.sigBytes+s)%4*8}else for(let s=0;s<r.sigBytes;s+=4)this.words[this.sigBytes+s>>>2]=r.words[s>>>2];return this.sigBytes+=r.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new g([...this.words])}}const N={stringify(n){const r=[];for(let s=0;s<n.sigBytes;s++){const t=n.words[s>>>2]>>>24-s%4*8&255;r.push((t>>>4).toString(16),(t&15).toString(16))}return r.join("")}},W={stringify(n){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",s=[];for(let t=0;t<n.sigBytes;t+=3){const e=n.words[t>>>2]>>>24-t%4*8&255,i=n.words[t+1>>>2]>>>24-(t+1)%4*8&255,a=n.words[t+2>>>2]>>>24-(t+2)%4*8&255,h=e<<16|i<<8|a;for(let u=0;u<4&&t*8+u*6<n.sigBytes*8;u++)s.push(r.charAt(h>>>6*(3-u)&63))}return s.join("")}},q={parse(n){const r=n.length,s=[];for(let t=0;t<r;t++)s[t>>>2]|=(n.charCodeAt(t)&255)<<24-t%4*8;return new g(s,r)}},E={parse(n){return q.parse(unescape(encodeURIComponent(n)))}};class I{constructor(){this._data=new g,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new g,this._nDataBytes=0}_append(r){typeof r=="string"&&(r=E.parse(r)),this._data.concat(r),this._nDataBytes+=r.sigBytes}_doProcessBlock(r,s){}_process(r){let s,t=this._data.sigBytes/(this.blockSize*4);r?t=Math.ceil(t):t=Math.max((t|0)-this._minBufferSize,0);const e=t*this.blockSize,i=Math.min(e*4,this._data.sigBytes);if(e){for(let a=0;a<e;a+=this.blockSize)this._doProcessBlock(this._data.words,a);s=this._data.words.splice(0,e),this._data.sigBytes-=i}return new g(s,i)}}class J extends I{update(r){return this._append(r),this._process(),this}finalize(r){r&&this._append(r)}}const R=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],V=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],w=[];class G extends J{constructor(){super(...arguments),this._hash=new g([...R])}reset(){super.reset(),this._hash=new g([...R])}_doProcessBlock(r,s){const t=this._hash.words;let e=t[0],i=t[1],a=t[2],h=t[3],u=t[4],o=t[5],l=t[6],p=t[7];for(let c=0;c<64;c++){if(c<16)w[c]=r[s+c]|0;else{const y=w[c-15],k=(y<<25|y>>>7)^(y<<14|y>>>18)^y>>>3,f=w[c-2],C=(f<<15|f>>>17)^(f<<13|f>>>19)^f>>>10;w[c]=k+w[c-7]+C+w[c-16]}const d=u&o^~u&l,m=e&i^e&a^i&a,B=(e<<30|e>>>2)^(e<<19|e>>>13)^(e<<10|e>>>22),x=(u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25),_=p+x+d+V[c]+w[c],S=B+m;p=l,l=o,o=u,u=h+_|0,h=a,a=i,i=e,e=_+S|0}t[0]=t[0]+e|0,t[1]=t[1]+i|0,t[2]=t[2]+a|0,t[3]=t[3]+h|0,t[4]=t[4]+u|0,t[5]=t[5]+o|0,t[6]=t[6]+l|0,t[7]=t[7]+p|0}finalize(r){super.finalize(r);const s=this._nDataBytes*8,t=this._data.sigBytes*8;return this._data.words[t>>>5]|=128<<24-t%32,this._data.words[(t+64>>>9<<4)+14]=Math.floor(s/4294967296),this._data.words[(t+64>>>9<<4)+15]=s,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function Q(n){return new G().finalize(n).toString(W)}function X(n,r={}){const s=typeof n=="string"?n:T(n,r);return Q(s).slice(0,10)}function Y(n,r,s){const[t={},e]=[{},r],i=D(()=>b(n)),a=t.key||X([e,typeof i.value=="string"?i.value:"",...Z(t)]);if(!a||typeof a!="string")throw new TypeError("[nuxt] [useFetch] key must be a string: "+a);if(!n)throw new Error("[nuxt] [useFetch] request is missing.");const h=a===e?"$f"+a:a;if(!t.baseURL&&typeof i.value=="string"&&i.value[0]==="/"&&i.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const{server:u,lazy:o,default:l,transform:p,pick:c,watch:d,immediate:m,getCachedData:B,deep:x,dedupe:_,...S}=t,y=K({...j,...S,cache:typeof t.cache=="boolean"?void 0:t.cache}),k={server:u,lazy:o,default:l,transform:p,pick:c,immediate:m,getCachedData:B,deep:x,dedupe:_,watch:d===!1?[]:[y,i,...d||[]]};let f;return L(h,()=>{var $;($=f==null?void 0:f.abort)==null||$.call(f),f=typeof AbortController<"u"?new AbortController:{};const z=b(t.timeout);let v;return z&&(v=setTimeout(()=>f.abort(),z),f.signal.onabort=()=>clearTimeout(v)),(t.$fetch||globalThis.$fetch)(i.value,{signal:f.signal,...y}).finally(()=>{clearTimeout(v)})},k)}function Z(n){var s;const r=[((s=b(n.method))==null?void 0:s.toUpperCase())||"GET",b(n.baseURL)];for(const t of[n.params||n.query]){const e=b(t);if(!e)continue;const i={};for(const[a,h]of Object.entries(e))i[b(a)]=b(h);r.push(i)}return r}const rt=()=>{const r=P().public.wpUrl,s=async o=>Y(`${r}/wp-json/wp/v2/${o}`,"$dsHKOUxpdW");return{get:s,getPosts:async(o,l,p=1,c=20,d="author,id,excerpt,title,link,slug,date")=>{let m=`posts?page=${p}&per_page=${c}&_embed=1`;return l&&(m+=`&categories=${l}`),o&&(m+=`&sticky=${o}`),s(m)},getPost:async o=>s(`posts?slug=${o}&_embed=1`),getCategories:async(o="name,slug,count")=>s("categories"),getCategory:async o=>s(`categories?slug=${o}`),getResources:async(o,l=1,p=20,c="author,id,excerpt,title,link,slug,date")=>{let d=`cuxcr_resources?page=${l}&per_page=${p}&_embed=1`;return o&&(d+=`&categories=${o}`),s(d)},getResource:async o=>s(`cuxcr_resources?slug=${o}&_embed=1`)}};export{rt as u};
