import{encodeBackSlashes,queryString}from"../../utils";import{getActiveMediaType}from"../../models/mediaContent";export function isSameHash(e,o){return e===o||"#"+e===o||e==="#"+o}function getContentTypeName(e,o){var n,t,i,d,s,r,p,l,a,v,u,c,y;if(!e.in)return"request"===e.deps.type&&(null===(i=null===(t=null===(n=e.deps.operation)||void 0===n?void 0:n.requestBody)||void 0===t?void 0:t.content)||void 0===i?void 0:i.mediaTypes)?(null===(r=null===(s=null===(d=e.deps.operation)||void 0===d?void 0:d.requestBody)||void 0===s?void 0:s.content)||void 0===r?void 0:r.mediaTypes.length)>1?(null===(l=null===(p=e.deps.operation)||void 0===p?void 0:p.requestBody)||void 0===l?void 0:l.content)&&getActiveMediaType(e.deps.operation.requestBody.content,o).name:void 0:"response"===e.deps.type&&(null===(v=null===(a=e.deps.response)||void 0===a?void 0:a.content)||void 0===v?void 0:v.mediaTypes)&&(null===(c=null===(u=e.deps.response)||void 0===u?void 0:u.content)||void 0===c?void 0:c.mediaTypes.length)>1?(null===(y=e.deps.response)||void 0===y?void 0:y.content)&&getActiveMediaType(e.deps.response.content,o).name:void 0}export function constructFieldDeepFragment(e,o){var n,t;if(!e)return"";const i={t:e.deps.type,in:e.in||e.deps.in,c:"response"===e.deps.type?null===(n=e.deps.response)||void 0===n?void 0:n.code:void 0,cb:(null===(t=e.deps.operation)||void 0===t?void 0:t.isCallback)?e.deps.operation.callbackId:void 0,ct:getContentTypeName(e,o),path:e.fieldFullPath};return queryString.stringify(i,{encode:!1,sort:!1})}export function joinWithSeparator(e="",o="",n="/"){return e.endsWith(n)&&(e=e.slice(0,-n.length)),o.startsWith(n)&&(o=o.slice(n.length)),e&&o?e+n+o:e+o}export function makeDeepLink(e,o){return(`/${e=encodeBackSlashes(e)}#`+joinWithSeparator(e,o)).toLowerCase()}
//# sourceMappingURL=helpers.js.map