"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("mime");let i;function o(n){i=n}function l(n,s){const t=s.split(",").map(e=>e.trim());for(const e of t){if(e==="*")return!0;if(e.endsWith("/*")){const[p]=e.split("/"),[r]=n?.type?.split("/")||[];if(p===r)return!0}else if(/^\./.test(e)){if(n.type===a.getType(e))return!0;const p=n.name?.lastIndexOf(".");if(p>-1&&n.name?.slice(p)===e)return!0}else{if(n.type===e)return!0;const p=n.name?.lastIndexOf(".");if(p>-1&&[...a.getAllExtensions(e)||[]].map(c=>`.${c}`).includes(n.name?.slice(p)))return!0}}return!1}function u(n){const s={image:i("ap.apUpload.pictureType"),video:i("ap.apUpload.videoType"),audio:i("ap.apUpload.audioType"),application:i("ap.apUpload.documentType"),"*":i("ap.apUpload.allTypes")};return n.split(",").map(t=>t.trim()).map(t=>{if(t==="*")return s[t];if(t.endsWith("/*")){const[e]=t.split("/");return s[e]||e}else return/^\./.test(t)?t:[...a.getAllExtensions(t)||[]].map(e=>`.${e}`).join(",")||t}).join(",")}exports.fileMatchesAccept=l;exports.getAcceptText=u;exports.injectUtilAccept=o;
