import c from"deepmerge";import{isObject as i}from"@redocly/theme/core/openapi";import{isMergeableObject as u}from"../utils/index.js";function b(e,r){return!e||!r?!1:s(e)===s(r)}function s(e){if(!e)return;const r=e.split(";")[0].toLowerCase(),[t,n]=r.split("/");if(n===void 0)return t;const p=n.split("+").pop();return`${t}/${p}`}function m(e){const r=new RegExp("%7B","g"),t=new RegExp("%7D","g");return e.replace(r,"{").replace(t,"}").replace("///","//").replace("./",".")}function a(e,r){if(!(e.length&&f(e)))return r;const t=e.filter(n=>Object.keys(n).length>0);return r.forEach(function(n,o){u(n)?t[o]=c(e[o],n,{arrayMerge:a}):Array.isArray(n)?t.push(n):t[o]=n}),t}const f=e=>e.some(r=>i(r)&&Object.keys(r).length>0);function w(e){return!!e&&Object.keys(e).length===0}const x=typeof window<"u"&&(window.crypto||window.msCrypto)||void 0;function l(e){if(typeof e!="object"||e===null)return e;const r=Array.isArray(e)?[]:{};for(const t in e){const n=e[t];r[t]=l(n)}return r}export{a as arrayMergeStrategy,x as cryptoLib,l as deepClone,w as isEmptyObject,b as isSameMime,s as normalizeMimeType,m as unescapeServerVariables};
