(function(o,e){typeof exports=="object"&&typeof module<"u"?e(exports):typeof define=="function"&&define.amd?define(["exports"],e):(o=typeof globalThis<"u"?globalThis:o||self,e(o["my-ts"]={}))})(this,function(o){"use strict";let e={baseURL:"https://api.streamfy.net/",apiVersion:"v1/",baseEndpoint:"my/",headers:{},authorization:"Authorization",token:"",endpoints:{projects:"projects/",channels:"channels/",playlists:"playlists/",videos:"videos/",shorts:"shorts/",tags:"tags/"}};const a=async t=>{if(t.ok)return await t.json();{const s=await t.text();return Promise.reject(new Error(s))}},u={Accept:"Application/json","Content-Type":"Application/json"},r=t=>e.baseURL+e.apiVersion+(e.baseEndpoint?e.baseEndpoint:"")+t?t:e.endpoints[t],c=(t,s="GET",n)=>({headers:{...u,...e.headers,[e.authorization]:e.token,extraHeaders:n},method:s,body:t}),h=async t=>await fetch(r(t||e.endpoints.tags),c()).then(async s=>await a(s)),y=async(t,s)=>await fetch(r(t||e.endpoints.tags+s),c()).then(async n=>await a(n)),l=()=>({list:h,single:y}),w=async t=>await fetch(r(t||e.endpoints.projects),c()).then(async s=>await a(s)),d=async(t,s)=>await fetch(r(t||e.endpoints.projects+s),c()).then(async n=>await a(n)),p=async(t,s)=>await fetch(r(t||e.endpoints.projects+s),c(void 0,"DELETE")).then(async n=>await a(n)),f=async(t,s)=>await fetch(r(t||e.endpoints.projects),c(s,"POST")).then(async n=>await a(n)),T=async(t,s,n)=>await fetch(r(t||e.endpoints.projects+n),c(s,"PUT")).then(async i=>await a(i)),$=()=>({list:w,single:d,store:f,update:T,destroy:p}),g=async t=>await fetch(r(t||e.endpoints.channels),c()).then(async s=>await a(s)),E=async(t,s)=>await fetch(r(t||e.endpoints.channels+s),c()).then(async n=>await a(n)),j=async(t,s)=>await fetch(r(t||e.endpoints.channels+s),c("DELETE")).then(async n=>await a(n)),P=async(t,s)=>await fetch(r(t||e.endpoints.channels),c(s,"POST")).then(async n=>await a(n)),m=async(t,s,n)=>await fetch(r(t||e.endpoints.channels+n),c(s,"PUT")).then(async i=>await a(i)),v=()=>({list:g,single:E,store:P,update:m,destroy:j}),U=async t=>await fetch(r(t||e.endpoints.playlists),c()).then(async s=>await a(s)),b=async(t,s)=>await fetch(r(t||e.endpoints.playlists+s),c()).then(async n=>await a(n)),L=async(t,s)=>await fetch(r(t||e.endpoints.playlists+s),c("DELETE")).then(async n=>await a(n)),S=async(t,s)=>await fetch(r(t||e.endpoints.playlists),c(s,"POST")).then(async n=>await a(n)),O=async(t,s,n)=>await fetch(r(t||e.endpoints.playlists+n),c(s,"PUT")).then(async i=>await a(i)),D=()=>({list:U,single:b,store:S,update:O,destroy:L}),A=async(t,s)=>await fetch(r(t||e.endpoints.attachments),c(s,"POST")).then(async n=>await a(n)),R=()=>({store:A}),k=async t=>await fetch(r(t||e.endpoints.videos),c()).then(async s=>await a(s)),x=async(t,s)=>await fetch(r(t||e.endpoints.videos+s),c()).then(async n=>await a(n)),z=async(t,s)=>await fetch(r(t||e.endpoints.videos+s),c("DELETE")).then(async n=>await a(n)),H=async(t,s)=>await fetch(r(t||e.endpoints.videos),c(s,"POST")).then(async n=>await a(n)),M=async(t,s,n)=>await fetch(r(t||e.endpoints.videos+n),c(s,"PUT")).then(async i=>await a(i)),V=()=>({list:k,single:x,store:H,update:M,destroy:z}),q=async t=>await fetch(r(t||e.endpoints.shorts),c()).then(async s=>await a(s)),C=async(t,s)=>await fetch(r(t||e.endpoints.shorts+s),c()).then(async n=>await a(n)),G=async(t,s)=>await fetch(r(t||e.endpoints.shorts+s),c("DELETE")).then(async n=>await a(n)),B=async(t,s)=>await fetch(r(t||e.endpoints.shorts),c(s,"POST")).then(async n=>await a(n)),F=async(t,s,n)=>await fetch(r(t||e.endpoints.shorts+n),c(s,"PUT")).then(async i=>await a(i)),I=()=>({list:q,single:C,store:B,update:F,destroy:G}),J=()=>({config:e,tags:l(),projects:$(),channels:v(),playlists:D(),attachments:R(),videos:V(),shorts:I()});o.myTs=J,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});