"use strict";(self.webpackChunkui=self.webpackChunkui||[]).push([[5],{20:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function c(e){try{l(r.next(e))}catch(e){i(e)}}function u(e){try{l(r.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(c,u)}l((r=r.apply(e,t||[])).next())}))},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isBDraddy=t.colorIsLight=t.restoreScrollbar=t.hideScrollbar=t.getScrollbarWidth=t.getClearTagHref=t.kebabize=t.toTitleCase=t.fetchJson=t.getTagHref=t.camelize=t.cap=t.stripSiteDomain=void 0;const i=n(8),c=o(n(25));function u(){const e=document.documentElement.clientWidth;return window.innerWidth-e}t.stripSiteDomain=function(e){try{const t=new URL(e),{domainName:n}=(0,i.getEnvConfig)().site;if(t.host===n||`www.${t.host}`===n)return`${t.pathname}${t.search}`}catch(e){}return e},t.cap=function(e){return"string"!=typeof e?"":e.charAt(0).toUpperCase()+e.slice(1)},t.camelize=function(e){return e.replace(/(?:^\w|[A-Z]|\b\w)/g,(function(e,t){return 0===t?e.toLowerCase():e.toUpperCase()})).replace(/\s+/g,"")},t.getTagHref=function(e,t,n){const r=`${t}-${n}`,{collection:o}=e;return{pathname:"/collections/[collection]/[tagQuery]",query:{collection:o,tagQuery:e.tagQuery?e.tagQuery.indexOf(`${t}-`)>-1?e.tagQuery.replace(new RegExp(`${t}-[^+]+`),r):`${e.tagQuery}+${r}`:r}}},t.fetchJson=function(e,t){return r(this,void 0,void 0,(function*(){return(0,c.default)(e,t).then((e=>e.json()))}))},t.toTitleCase=function(e){return e.split("-").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")},t.kebabize=function(e){return e.replace(/[\s.]/g,"-").toLowerCase()},t.getClearTagHref=function(e,t){if(e.tagQuery){if(e.tagQuery.includes("+")){const n=e.tagQuery.split("+").filter((e=>!e.includes(t))).join("+");return`/collections/${e.collection}/${n}`}return`/collections/${e.collection}`}return""},t.getScrollbarWidth=u,t.hideScrollbar=function(){const e=u().toString();document.documentElement.style.overflow="hidden",document.documentElement.style.marginRight=`${e}px`},t.restoreScrollbar=function(){document.documentElement.style.overflow="",document.documentElement.style.marginRight=""},t.colorIsLight=function(e){return["White","Bright White","Ivory","White Solid"].includes(e)},t.isBDraddy=function(){return"bd"===(0,i.getEnvConfig)().site.prefix}}}]);