/*! For license information please see 118.a5192ffb.storeFrontContainer.4.4.0.chunk.js.LICENSE.txt */ (self.webpackChunkapp_container=self.webpackChunkapp_container||[]).push([[118],{118:(t,e,n)=>{"use strict";n.r(e),n.d(e,{API:()=>Q});const o="https://localhost:3001";var i;const a="https://".concat(null===(i=window)||void 0===i||null===(i=i.location)||void 0===i?void 0:i.host);function r(t){return Object.entries(t).map((t=>{let[e,n]=t;return"".concat(encodeURIComponent(e),"=").concat(encodeURIComponent(n))})).join("&")}async function c(t,e){return await fetch(t,{headers:e})}async function l(t,e,n){return await fetch(t,{method:"POST",headers:e,body:n})}function s(t){return o+t}function u(t){return a+t}function d(t){var e,n,o,i,a;let r="https://{SHOP_NAME}"+(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e?void 0:e.base_url);return r=r.replace("{SHOP_NAME}",null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.request)||void 0===n?void 0:n.host).replace("{APP_PROXY}",null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.Metafields)||void 0===o?void 0:o.APP_PROXY).replace("{APP_ID}",null===(i=window)||void 0===i||null===(i=i.flitsThemeAppExtensionObjects)||void 0===i||null===(i=i.Metafields)||void 0===i?void 0:i.APP_ID).replace("{SHOP_ID}",null===(a=window)||void 0===a||null===(a=a.flitsThemeAppExtensionObjects)||void 0===a||null===(a=a.Metafields)||void 0===a?void 0:a.SHOP_ID),r+t}var p,m;const f={customer_hash:null===(p=window)||void 0===p||null===(p=p.flitsThemeAppExtensionObjects)||void 0===p||null===(p=p.customer)||void 0===p?void 0:p.customer_hash,token:null===(m=window)||void 0===m||null===(m=m.flitsThemeAppExtensionObjects)||void 0===m||null===(m=m.customer)||void 0===m?void 0:m.shop_token};async function h(t){let e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o={...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},initialParam:f};return e=(arguments.length>3?arguments[3]:void 0)?t:Object.keys(o).length?"".concat(s(t),"?").concat(r(o)):s(t),c(e,n)}async function v(t){let e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0,i={...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},...f};return e=o?t:Object.keys(i).length?"".concat(d(t),"?").concat(r(i)):d(t),c(e,n)}async function w(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0,a={...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},...f};const c=new URLSearchParams;for(const[t,e]of Object.entries(n))c.append(t,e);return e=i?t:Object.keys(a).length?"".concat(d(t),"?").concat(r(a)):d(t),l(e,o,c.toString())}async function y(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0,a={...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},...f};const c=new URLSearchParams;for(const[t,e]of Object.entries(n))c.append(t,e);return e=i?t:Object.keys(a).length?"".concat(d(t),"?").concat(r(a)):d(t),async function(t,e,n){return await fetch(t,{method:"PUT",headers:e,body:n})}(e,o,c.toString())}async function g(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0,a={...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},...f};const c=new URLSearchParams;for(const[t,e]of Object.entries(n))c.append(t,e);return e=i?t:Object.keys(a).length?"".concat(d(t),"?").concat(r(a)):d(t),async function(t,e,n){return await fetch(t,{method:"DELETE",headers:e,body:n})}(e,o,c.toString())}async function _(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0,a={...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},...f};const c=new FormData;for(const[t,e]of Object.entries(n))c.append(t,e);return e=i?t:Object.keys(a).length?"".concat(d(t),"?").concat(r(a)):d(t),l(e,o,c)}const T={get:async function(){try{var t,e,n,o;const i={NODE_ENV:"production",PUBLIC_URL:"",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_CODE_BUILD_VERSION:"4.4.0"}.REACT_APP_MODE,a="local"===i?"/microFrontEndData.json":"/theme/".concat(null===(t=window)||void 0===t||null===(t=t.Shopify)||void 0===t||null===(t=t.theme)||void 0===t?void 0:t.id),r={},c=document.getElementsByTagName("html")[0].getAttribute("lang"),l=null===(e=window.flitsThemeAppExtensionObjects)||void 0===e?void 0:e.Metafields["THEME_SETTINGS_".concat(null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.theme)||void 0===n?void 0:n.id)];if(l)return l;const s={lang:null==c?void 0:c.split("-")[0],APP_SETTINGS_UPDATED:null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.Metafields)||void 0===o?void 0:o.APP_SETTINGS_UPDATED},u=!1,d="local"===i?await h(a,s,r,u):await v(a,s,r,u);return await d.json()}catch(t){}}},E={get:async function(t){try{var e;const n={},o={},i=!0;let a=await(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e?void 0:e.languageData(t));if(null!=a&&a.status&&null!=a&&a.data)return null==a?void 0:a.data;const r=await h(null==a?void 0:a.endpoint,o,n,i);return await r.json()}catch(t){}}},A={get:async function(){try{const t="/MyProfile.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}},profile_save:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/profile_save"),o={},i={},a=await _(n,t,i,o);return await a.json()}catch(t){}},user_custom_field:async function(t){try{var e,n,o;const i=-1===parseInt(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id)||""===(null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.customer)||void 0===n?void 0:n.customer_id)?"/custom-fields/get":"/".concat(null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.customer)||void 0===o?void 0:o.customer_id,"/custom-fields/get"),a={"Content-Type":"application/json"},r=!1,c=await v(i,t,a,r);return await c.json()}catch(t){}},get_url:async function(t){try{var e;const n="/custom-fields/generate-file-url",o={"Content-Type":"application/json"},i={filePath:t,token:null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.shop_token},a=!1,r=await v(n,i,o,a),c=await r.json();return null==c?void 0:c.fileUrl}catch(t){}},get_custom_fields_assets:async function(t){try{var e,n,o;const i=-1===parseInt(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id)||""===(null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.customer)||void 0===n?void 0:n.customer_id)?"/custom-fields/get-asset":"/".concat(null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.customer)||void 0===o?void 0:o.customer_id,"/custom-fields/get-asset"),a={"Content-Type":"application/json"},r=!1,c=await v(i,t,a,r);return await c.json()}catch(t){}},get_asset_data:async function(t){const e=await v(t,{},{},!0);return await e.json()},upload_temp_file_custom_field:async function(t){var e,n={...t,token:null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.Metafields)||void 0===e?void 0:e.SHOP_TOKEN};const o=await _("/custom-fields/upload-file",n);return await o.json()},save_custom_fields_data:async function(t){var e,n,o;const i="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/custom-fields/save");t={...t,token:null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.Metafields)||void 0===n?void 0:n.SHOP_TOKEN,customer_hash:null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o?void 0:o.customerHash};const a=await _(i,t);return await a.json()}},b={get:async function(){try{const t="/ChangePassword.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}},update_password:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/update_password"),o={"Content-Type":"application/x-www-form-urlencoded"},i={},a=await w(n,t,i,o);return await a.json()}catch(t){}}};var O=n(2605),x=n.n(O);async function S(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e=(arguments.length>3?arguments[3]:void 0)?t:Object.keys(n).length?"".concat(u(t),"?").concat(r(n)):u(t),c(e,o)}async function j(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return e=(arguments.length>4?arguments[4]:void 0)?t:Object.keys(o).length?"".concat(u(t),"?").concat(r(o)):u(t),l(e,i,n)}const N={get:async function(t,e){try{const o=t,i={},a={},r=!0,c=await S(o,a,i,r);if(e&&0!==(null==e?void 0:e.length)){const t=await c.text(),e=(new DOMParser).parseFromString(t,"text/html").getElementById("MainContent");return e?e.innerHTML:""}{var n;const t=await c.json();return x().sanitize(null==t||null===(n=t.page)||void 0===n?void 0:n.body_html,{ADD_TAGS:["iframe","script"]})}}catch(t){}}},C={get:async function(){try{const t="/HowToManageCredit.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}},general_subscription_save:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/general_subscription_save"),o={"Content-Type":"application/x-www-form-urlencoded"},i={},a=await w(n,t,i,o);return await a.json()}catch(t){}},getRuleData:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/get_rule"),o={"Content-Type":"application/x-www-form-urlencoded"},i={},a=await w(n,t,i,o);return await a.json()}catch(t){}}},D={get:async function(){try{const t="/Credit.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}},get_data:async function(){try{var t,e;const n="/".concat(window.flitsThemeAppExtensionObjects.customer.customer_id,"/credit/get_credit"),o={"Content-Type":"application/x-www-form-urlencoded"},i={token:null===(t=window)||void 0===t||null===(t=t.flitsThemeAppExtensionObjects)||void 0===t||null===(t=t.customer)||void 0===t?void 0:t.shop_token,customer_hash:null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_hash},a=!1,r=await v(n,i,o,a);return await r.json()}catch(t){}},get_available_rules:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/get_credit"),o={"Content-Type":"application/x-www-form-urlencoded"},i={},a=await w(n,t,i,o);return await a.json()}catch(t){}},apply_credit:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/credit/apply_credit"),o={"Content-Type":"application/x-www-form-urlencoded"},i={},a=await w(n,t,i,o);return await a.json()}catch(t){}},delete_discounts:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/delete-discounts"),o={"Content-Type":"application/x-www-form-urlencoded"},i={};return await w(n,t,i,o)}catch(t){}},refund_credit:async function(t,e){try{var n,o;const i="/".concat(window.flitsThemeAppExtensionObjects.customer.customer_id,"/refund_credit/get_credit"),a={"Content-Type":"application/x-www-form-urlencoded"},r={token:null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.customer)||void 0===n?void 0:n.shop_token,customer_hash:null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.customer)||void 0===o?void 0:o.customer_hash,page:t,per_page:e},c=!1,l=await v(i,r,a,c);return await l.json()}catch(t){}}},R={get:async function(){try{const t="/Credit.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}},get_data:async function(){try{var t,e;const n="/".concat(window.flitsThemeAppExtensionObjects.customer.customer_id,"/refer_friend/get_referral_data"),o={"Content-Type":"application/x-www-form-urlencoded"},i={token:null===(t=window)||void 0===t||null===(t=t.flitsThemeAppExtensionObjects)||void 0===t||null===(t=t.customer)||void 0===t?void 0:t.shop_token,customer_hash:null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_hash},a=!1,r=await v(n,i,o,a);return await r.json()}catch(t){}}};var k,L;const M={customer_hash:null===(k=window)||void 0===k||null===(k=k.flitsThemeAppExtensionObjects)||void 0===k||null===(k=k.customer)||void 0===k?void 0:k.customer_hash,token:null===(L=window)||void 0===L||null===(L=L.flitsThemeAppExtensionObjects)||void 0===L||null===(L=L.customer)||void 0===L?void 0:L.shop_token};async function I(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=arguments.length>4?arguments[4]:void 0,a={...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},...M};return e=i?t:Object.keys(a).length?"".concat(d(t),"?").concat(r(a)):d(t),l(e,o,n)}const P={FlitsDev1:"dev.",FlitsDev2:"dev.",FlitsDev3:"dev.",FlistDev4:"dev.",FlitsTesting:"testing.",flits:""},U={getJwttoken:async function(t){try{var e,n,o;const i=null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e?void 0:e.proxy_name,a="https://".concat(P[i],"analytics.getflits.com/"),r={"Content-Type":"application/json",Authorization:null===(n=window)||void 0===n?void 0:n.flitsThemeAppExtensionObjects.shop_token},c=!0,l=await I(a,JSON.stringify(t),{},r,c),s=await l.json();return null==s||null===(o=s.result)||void 0===o?void 0:o.token}catch(t){}},promptData:async function(t){try{var e;const n=null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e?void 0:e.proxy_name,o="https://".concat(P[n],"notifications.getflits.com/notification_prompts"),i={Authorization:t},a=!0,l=await async function(t){let e,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0,i={...arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},...M};return e=o?t:Object.keys(i).length?"".concat(d(t),"?").concat(r(i)):d(t),c(e,n)}(o,{},i,a),s=await l.json();return null==s?void 0:s.data[0]}catch(t){}},linkUser:async function(t,e){try{var n;const o=null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n?void 0:n.proxy_name,i="https://".concat(P[o],"analytics.getflits.com/"),a={"Content-Type":"application/json",Authorization:e},r=!0,c=await I(i,JSON.stringify(t),{},a,r);return await c.json()}catch(t){}},subscribeInfo:async function(t,e){try{var n;const o=null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n?void 0:n.proxy_name,i="https://".concat(P[o],"notifications.getflits.com/notification_users"),a={"Content-Type":"application/json",Authorization:e},r=!0,c=await I(i,JSON.stringify(t),{},a,r),l=await c.json();return null==l?void 0:l.data}catch(t){}}},H={get:async function(t){try{const e={},n={},o=!0;return(await v(t,n,e,o)).text()}catch(t){}},get_data:async function(){try{const t="/wishlist",e={"Content-Type":"application/x-www-form-urlencoded"},n={customer_hash:window.flitsThemeAppExtensionObjects.customerHash,customer_id:window.flitsThemeAppExtensionObjects.customer.customer_id,token:window.flitsThemeAppExtensionObjects.shop_token},o=!1,i=await v(t,n,e,o);return await i.json()}catch(t){return null}},add_to_wishlist:async function(t){try{const e="/wishlist/add_to_wishlist",n={"Content-Type":"application/x-www-form-urlencoded"},o={},i=await w(e,t,o,n);return await i.json()}catch(t){}},remove_from_wishlist:async function(t){try{const e="/wishlist/remove_from_wishlist",n={"Content-Type":"application/x-www-form-urlencoded"},o={},i=await g(e,t,o,n);return await i.json()}catch(t){}}},F={get:async function(t){try{const e={},n={},o=!0;return(await S(t,n,e,o)).text()}catch(t){}},get_data:async function(){try{const n=localStorage.getItem("RecentViewed")&&JSON.parse(localStorage.getItem("RecentViewed")),o=[];for(let i=0;i<(null==n?void 0:n.length);i++){var t;const a=await this.get("https://".concat(window.location.host,"/products/").concat(null===(t=n[i])||void 0===t?void 0:t.product_handle));var e=document.createElement("div");e.innerHTML=a;const r=e.querySelectorAll(".flits-product-variant-data"),c=[];r.forEach((t=>{try{const e=JSON.parse(t.textContent.trim());c.push({...e,available:"deny"===e.inventory_policy&&e.inventory_quantity>0,originalTitle:null==e?void 0:e.title,title:"deny"===e.inventory_policy&&e.inventory_quantity>0?e.title:"".concat(e.title," - Sold Out"),value:"deny"===e.inventory_policy&&e.inventory_quantity>0?e.value:"".concat(e.title," - Sold Out")})}catch(t){}})),o.push({...n[i],product_variant:c})}return o}catch(t){}}};function z(t){if("string"==typeof t)return e=decodeURIComponent(atob(t).replace(/\+/g," ")),(n=document.createElement("textarea")).innerHTML=e,n.value;if(Array.isArray(t))return t.map((t=>z(t)));if("object"==typeof t&&null!==t){const e={};for(const n in t)Object.hasOwnProperty.call(t,n)&&(e[n]=z(t[n]));return e}var e,n;return t}const B={get_data:async function(t){try{const e="/account",n={"Content-Type":"application/x-www-form-urlencoded"},o={page:t,type:"order"},i=!1,a=await S(e,o,n,i);return function(t){var e=document.createElement("div");e.innerHTML=t;let n=e.querySelector(".flits-order-data");return n?z(JSON.parse("["+decodeURIComponent(atob(n.textContent))+"]")):[]}(await a.text())}catch(t){}},reorder:async function(t){try{const e="/cart/add.js",n={"Content-Type":"application/x-www-form-urlencoded"},o={},i=new URLSearchParams;for(const[e,n]of Object.entries(t))i.append(e,n);const a=await j(e,i,o,n);return await a.json()}catch(t){}}},W={get_data:async function(t){try{let e=[];const n="/account",o={"Content-Type":"application/x-www-form-urlencoded"},i={page:t},a=!1,r=await S(n,i,o,a);let c;r&&r.ok&&(c=await r.text());const l=function(t){var e=document.createElement("div");e.innerHTML=t;let n=e.querySelector(".flits-address-data");return n?JSON.parse("["+n.textContent+"]"):[]}(c);if(l){const t=l.map((t=>({id:t.id,customer_id:t.customer_id,firstName:t.first_name,lastName:t.last_name,company:t.company,addressLine1:t.address1,addressLine2:t.address2,province:t.province,country:t.country,city:t.city,zip:t.zip,phone:t.phone,name:t.name,provinceCode:t.province_code,default:t.default,countryCode:t.country_code,countryName:t.countryName,needMark:!t.default})));e=[...e,...t]}return e}catch(t){}},delete_address:async function(t){try{var e,n,o;const i="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/account/addresses/").concat(t),a={"Content-Type":"application/x-www-form-urlencoded"},r={customer_hash:null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.customer)||void 0===n?void 0:n.customer_hash,token:null===(o=window)||void 0===o||null===(o=o.flitsThemeAppExtensionObjects)||void 0===o||null===(o=o.customer)||void 0===o?void 0:o.shop_token,_method:"DELETE"},c={},l=await g(i,c,r,a);return await l.json()}catch(t){}},default_address:async function(t,e){try{var n;const o="/".concat(null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.customer)||void 0===n?void 0:n.customer_id,"/account/addresses/").concat(e),i={"Content-Type":"application/x-www-form-urlencoded"},a={},r=await y(o,t,a,i);return await r.json()}catch(t){}},update_address:async function(t,e){try{var n;const o="/".concat(null===(n=window)||void 0===n||null===(n=n.flitsThemeAppExtensionObjects)||void 0===n||null===(n=n.customer)||void 0===n?void 0:n.customer_id,"/account/addresses/").concat(e),i={"Content-Type":"application/x-www-form-urlencoded"},a={},r=await y(o,t,a,i);return await r.json()}catch(t){}},add_address:async function(t){try{var e;const n="/".concat(null===(e=window)||void 0===e||null===(e=e.flitsThemeAppExtensionObjects)||void 0===e||null===(e=e.customer)||void 0===e?void 0:e.customer_id,"/account/addresses"),o={"Content-Type":"application/x-www-form-urlencoded"},i={},a=await w(n,t,i,o);return await a.json()}catch(t){}}},G={get:async function(){try{const t="/storeFrontLoginPageRemoteData.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}}},Y={account_login:async function(t){try{const e="/account/login",n={"Content-Type":"application/x-www-form-urlencoded"},o={},i=new URLSearchParams;for(const[e,n]of Object.entries(t))i.append(e,n);return await j(e,i,o,n)}catch(t){}},reset_password:async function(t){try{const e="/".concat(t.customer_id,"/reset-password/secure"),n={"Content-Type":"application/x-www-form-urlencoded"},o={},i=await w(e,t,o,n);return await i.json()}catch(t){}}},q={get:async function(){try{const t="/storeFrontCartPageRemoteData.json",e={},n={},o=!1,i=await h(t,n,e,o);return await i.json()}catch(t){}}},J={getProductData:async function(t,e,n,o){const i=await S("/products/".concat(t),{},{},!1),a=await i.text();var r=document.createElement("div");r.innerHTML=a;const c=r.querySelectorAll(".flits-product-variant-data"),l=r.querySelector("#flits-product-data");if(!l)return void n(o({handle:t}));let s={...JSON.parse(l.textContent.trim())};const u=[];return c.forEach((t=>{try{const n=JSON.parse(t.textContent.trim());u.push({...n,available:n.variant_available,originalTitle:null==n?void 0:n.title,title:n.variant_available?n.title:"".concat(n.title," - ").concat(e("flits.buttons.sold_out","Sold Out")),value:n.variant_available?n.value:"".concat(n.title," - ").concat(e("flits.buttons.sold_out","Sold Out"))})}catch(t){}})),s.variants=u,s},addToCart:async function(t){try{const e="/cart/add.js",n={"Content-Type":"application/x-www-form-urlencoded"},o={},i=new URLSearchParams;for(const[e,n]of Object.entries(t))i.append(e,n);const a=await j(e,i,o,n);return await a.json()}catch(t){}},getCart:async function(){try{const t="/cart.json",e={},n={app:"flits"},o=!1,i=await S(t,n,e,o);return await i.json()}catch(t){}}};var X,K;const V={customer_hash:null===(X=window)||void 0===X||null===(X=X.flitsThemeAppExtensionObjects)||void 0===X||null===(X=X.customer)||void 0===X?void 0:X.customer_hash,token:null===(K=window)||void 0===K||null===(K=K.flitsThemeAppExtensionObjects)||void 0===K||null===(K=K.customer)||void 0===K?void 0:K.shop_token},$=()=>{var t;const e=null===(t=window)||void 0===t||null===(t=t.flitsThemeAppExtensionObjects)||void 0===t?void 0:t.proxy_name;return"https://".concat({FlitsDev1:"dev.",FlitsDev2:"dev.",FlitsDev3:"dev.",FlistDev4:"dev.",FlitsTesting:"testing.",flits:""}[e],"analytics.getflits.com")};async function Z(t){let e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={...arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},...V};return e=(arguments.length>4?arguments[4]:void 0)?t:Object.keys(i).length?"".concat(d(t),"?").concat(r(i)):d(t),l(e,o,n)}const Q={referfriend:R,wishlist:H,analytic:{get_token:async function(t){try{const e=$(),n={"Content-Type":"application/json"},o={},i=!0,a=await Z(e,JSON.stringify(t),o,n,i);return await a.json()}catch(t){}},analytic_push_data:async function(t,e){try{const n=$(),o={Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},i={},a=!0,r=await Z(n,JSON.stringify(t),i,o,a);return await r.json()}catch(t){}}},microfrontend:T,credit:D,custompage:N,notification:U,deliveryaddress:W,howtomanagecredit:C,sociallogin:Y,changepassword:b,loginPage:G,cartpage:q,myprofile:A,order:B,recentlyviewedproducts:F,multilangauge:E,productPage:{},Shopify:J}},2605:function(t){t.exports=function(){"use strict";const{entries:t,setPrototypeOf:e,isFrozen:n,getPrototypeOf:o,getOwnPropertyDescriptor:i}=Object;let{freeze:a,seal:r,create:c}=Object,{apply:l,construct:s}="undefined"!=typeof Reflect&&Reflect;a||(a=function(t){return t}),r||(r=function(t){return t}),l||(l=function(t,e,n){return t.apply(e,n)}),s||(s=function(t,e){return new t(...e)});const u=A(Array.prototype.forEach),d=A(Array.prototype.pop),p=A(Array.prototype.push),m=A(String.prototype.toLowerCase),f=A(String.prototype.toString),h=A(String.prototype.match),v=A(String.prototype.replace),w=A(String.prototype.indexOf),y=A(String.prototype.trim),g=A(Object.prototype.hasOwnProperty),_=A(RegExp.prototype.test),T=(E=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;n1?n-1:0),i=1;i2&&void 0!==arguments[2]?arguments[2]:m;e&&e(t,null);let a=o.length;for(;a--;){let e=o[a];if("string"==typeof e){const t=i(e);t!==e&&(n(o)||(o[a]=t),e=t)}t[e]=!0}return t}function O(t){for(let e=0;e/gm),z=r(/\${[\w\W]*}/gm),B=r(/^data-[\-\w.\u00B7-\uFFFF]/),W=r(/^aria-[\-\w]+$/),G=r(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Y=r(/^(?:\w+script|data):/i),q=r(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),J=r(/^html$/i),X=r(/^[a-z][.\w]*(-[.\w]+)+$/i);var K=Object.freeze({__proto__:null,MUSTACHE_EXPR:H,ERB_EXPR:F,TMPLIT_EXPR:z,DATA_ATTR:B,ARIA_ATTR:W,IS_ALLOWED_URI:G,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:q,DOCTYPE_NAME:J,CUSTOM_ELEMENT:X});const V=function(){return"undefined"==typeof window?null:window};return function e(){let n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:V();const o=t=>e(t);if(o.version="3.1.6",o.removed=[],!n||!n.document||9!==n.document.nodeType)return o.isSupported=!1,o;let{document:i}=n;const r=i,l=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:E,Node:A,Element:O,NodeFilter:H,NamedNodeMap:F=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:z,DOMParser:B,trustedTypes:W}=n,Y=O.prototype,q=S(Y,"cloneNode"),X=S(Y,"remove"),$=S(Y,"nextSibling"),Z=S(Y,"childNodes"),Q=S(Y,"parentNode");if("function"==typeof E){const t=i.createElement("template");t.content&&t.content.ownerDocument&&(i=t.content.ownerDocument)}let tt,et="";const{implementation:nt,createNodeIterator:ot,createDocumentFragment:it,getElementsByTagName:at}=i,{importNode:rt}=r;let ct={};o.isSupported="function"==typeof t&&"function"==typeof Q&&nt&&void 0!==nt.createHTMLDocument;const{MUSTACHE_EXPR:lt,ERB_EXPR:st,TMPLIT_EXPR:ut,DATA_ATTR:dt,ARIA_ATTR:pt,IS_SCRIPT_OR_DATA:mt,ATTR_WHITESPACE:ft,CUSTOM_ELEMENT:ht}=K;let{IS_ALLOWED_URI:vt}=K,wt=null;const yt=b({},[...j,...N,...C,...R,...L]);let gt=null;const _t=b({},[...M,...I,...P,...U]);let Tt=Object.seal(c(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Et=null,At=null,bt=!0,Ot=!0,xt=!1,St=!0,jt=!1,Nt=!0,Ct=!1,Dt=!1,Rt=!1,kt=!1,Lt=!1,Mt=!1,It=!0,Pt=!1,Ut=!0,Ht=!1,Ft={},zt=null;const Bt=b({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Wt=null;const Gt=b({},["audio","video","img","source","image","track"]);let Yt=null;const qt=b({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jt="http://www.w3.org/1998/Math/MathML",Xt="http://www.w3.org/2000/svg",Kt="http://www.w3.org/1999/xhtml";let Vt=Kt,$t=!1,Zt=null;const Qt=b({},[Jt,Xt,Kt],f);let te=null;const ee=["application/xhtml+xml","text/html"];let ne=null,oe=null;const ie=i.createElement("form"),ae=function(t){return t instanceof RegExp||t instanceof Function},re=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!oe||oe!==t){if(t&&"object"==typeof t||(t={}),t=x(t),te=-1===ee.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,ne="application/xhtml+xml"===te?f:m,wt=g(t,"ALLOWED_TAGS")?b({},t.ALLOWED_TAGS,ne):yt,gt=g(t,"ALLOWED_ATTR")?b({},t.ALLOWED_ATTR,ne):_t,Zt=g(t,"ALLOWED_NAMESPACES")?b({},t.ALLOWED_NAMESPACES,f):Qt,Yt=g(t,"ADD_URI_SAFE_ATTR")?b(x(qt),t.ADD_URI_SAFE_ATTR,ne):qt,Wt=g(t,"ADD_DATA_URI_TAGS")?b(x(Gt),t.ADD_DATA_URI_TAGS,ne):Gt,zt=g(t,"FORBID_CONTENTS")?b({},t.FORBID_CONTENTS,ne):Bt,Et=g(t,"FORBID_TAGS")?b({},t.FORBID_TAGS,ne):{},At=g(t,"FORBID_ATTR")?b({},t.FORBID_ATTR,ne):{},Ft=!!g(t,"USE_PROFILES")&&t.USE_PROFILES,bt=!1!==t.ALLOW_ARIA_ATTR,Ot=!1!==t.ALLOW_DATA_ATTR,xt=t.ALLOW_UNKNOWN_PROTOCOLS||!1,St=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,jt=t.SAFE_FOR_TEMPLATES||!1,Nt=!1!==t.SAFE_FOR_XML,Ct=t.WHOLE_DOCUMENT||!1,kt=t.RETURN_DOM||!1,Lt=t.RETURN_DOM_FRAGMENT||!1,Mt=t.RETURN_TRUSTED_TYPE||!1,Rt=t.FORCE_BODY||!1,It=!1!==t.SANITIZE_DOM,Pt=t.SANITIZE_NAMED_PROPS||!1,Ut=!1!==t.KEEP_CONTENT,Ht=t.IN_PLACE||!1,vt=t.ALLOWED_URI_REGEXP||G,Vt=t.NAMESPACE||Kt,Tt=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&ae(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Tt.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&ae(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Tt.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(Tt.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),jt&&(Ot=!1),Lt&&(kt=!0),Ft&&(wt=b({},L),gt=[],!0===Ft.html&&(b(wt,j),b(gt,M)),!0===Ft.svg&&(b(wt,N),b(gt,I),b(gt,U)),!0===Ft.svgFilters&&(b(wt,C),b(gt,I),b(gt,U)),!0===Ft.mathMl&&(b(wt,R),b(gt,P),b(gt,U))),t.ADD_TAGS&&(wt===yt&&(wt=x(wt)),b(wt,t.ADD_TAGS,ne)),t.ADD_ATTR&&(gt===_t&&(gt=x(gt)),b(gt,t.ADD_ATTR,ne)),t.ADD_URI_SAFE_ATTR&&b(Yt,t.ADD_URI_SAFE_ATTR,ne),t.FORBID_CONTENTS&&(zt===Bt&&(zt=x(zt)),b(zt,t.FORBID_CONTENTS,ne)),Ut&&(wt["#text"]=!0),Ct&&b(wt,["html","head","body"]),wt.table&&(b(wt,["tbody"]),delete Et.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw T('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');tt=t.TRUSTED_TYPES_POLICY,et=tt.createHTML("")}else void 0===tt&&(tt=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const i="dompurify"+(n?"#"+n:"");try{return t.createPolicy(i,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return null}}(W,l)),null!==tt&&"string"==typeof et&&(et=tt.createHTML(""));a&&a(t),oe=t}},ce=b({},["mi","mo","mn","ms","mtext"]),le=b({},["foreignobject","annotation-xml"]),se=b({},["title","style","font","a","script"]),ue=b({},[...N,...C,...D]),de=b({},[...R,...k]),pe=function(t){p(o.removed,{element:t});try{Q(t).removeChild(t)}catch(e){X(t)}},me=function(t,e){try{p(o.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){p(o.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t&&!gt[t])if(kt||Lt)try{pe(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},fe=function(t){let e=null,n=null;if(Rt)t=""+t;else{const e=h(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===te&&Vt===Kt&&(t=''+t+"");const o=tt?tt.createHTML(t):t;if(Vt===Kt)try{e=(new B).parseFromString(o,te)}catch(t){}if(!e||!e.documentElement){e=nt.createDocument(Vt,"template",null);try{e.documentElement.innerHTML=$t?et:o}catch(t){}}const a=e.body||e.documentElement;return t&&n&&a.insertBefore(i.createTextNode(n),a.childNodes[0]||null),Vt===Kt?at.call(e,Ct?"html":"body")[0]:Ct?e.documentElement:a},he=function(t){return ot.call(t.ownerDocument||t,t,H.SHOW_ELEMENT|H.SHOW_COMMENT|H.SHOW_TEXT|H.SHOW_PROCESSING_INSTRUCTION|H.SHOW_CDATA_SECTION,null)},ve=function(t){return t instanceof z&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||!(t.attributes instanceof F)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes)},we=function(t){return"function"==typeof A&&t instanceof A},ye=function(t,e,n){ct[t]&&u(ct[t],(t=>{t.call(o,e,n,oe)}))},ge=function(t){let e=null;if(ye("beforeSanitizeElements",t,null),ve(t))return pe(t),!0;const n=ne(t.nodeName);if(ye("uponSanitizeElement",t,{tagName:n,allowedTags:wt}),t.hasChildNodes()&&!we(t.firstElementChild)&&_(/<[/\w]/g,t.innerHTML)&&_(/<[/\w]/g,t.textContent))return pe(t),!0;if(7===t.nodeType)return pe(t),!0;if(Nt&&8===t.nodeType&&_(/<[/\w]/g,t.data))return pe(t),!0;if(!wt[n]||Et[n]){if(!Et[n]&&Te(n)){if(Tt.tagNameCheck instanceof RegExp&&_(Tt.tagNameCheck,n))return!1;if(Tt.tagNameCheck instanceof Function&&Tt.tagNameCheck(n))return!1}if(Ut&&!zt[n]){const e=Q(t)||t.parentNode,n=Z(t)||t.childNodes;if(n&&e)for(let o=n.length-1;o>=0;--o){const i=q(n[o],!0);i.__removalCount=(t.__removalCount||0)+1,e.insertBefore(i,$(t))}}return pe(t),!0}return t instanceof O&&!function(t){let e=Q(t);e&&e.tagName||(e={namespaceURI:Vt,tagName:"template"});const n=m(t.tagName),o=m(e.tagName);return!!Zt[t.namespaceURI]&&(t.namespaceURI===Xt?e.namespaceURI===Kt?"svg"===n:e.namespaceURI===Jt?"svg"===n&&("annotation-xml"===o||ce[o]):Boolean(ue[n]):t.namespaceURI===Jt?e.namespaceURI===Kt?"math"===n:e.namespaceURI===Xt?"math"===n&&le[o]:Boolean(de[n]):t.namespaceURI===Kt?!(e.namespaceURI===Xt&&!le[o])&&!(e.namespaceURI===Jt&&!ce[o])&&!de[n]&&(se[n]||!ue[n]):!("application/xhtml+xml"!==te||!Zt[t.namespaceURI]))}(t)?(pe(t),!0):"noscript"!==n&&"noembed"!==n&&"noframes"!==n||!_(/<\/no(script|embed|frames)/i,t.innerHTML)?(jt&&3===t.nodeType&&(e=t.textContent,u([lt,st,ut],(t=>{e=v(e,t," ")})),t.textContent!==e&&(p(o.removed,{element:t.cloneNode()}),t.textContent=e)),ye("afterSanitizeElements",t,null),!1):(pe(t),!0)},_e=function(t,e,n){if(It&&("id"===e||"name"===e)&&(n in i||n in ie))return!1;if(Ot&&!At[e]&&_(dt,e));else if(bt&&_(pt,e));else if(!gt[e]||At[e]){if(!(Te(t)&&(Tt.tagNameCheck instanceof RegExp&&_(Tt.tagNameCheck,t)||Tt.tagNameCheck instanceof Function&&Tt.tagNameCheck(t))&&(Tt.attributeNameCheck instanceof RegExp&&_(Tt.attributeNameCheck,e)||Tt.attributeNameCheck instanceof Function&&Tt.attributeNameCheck(e))||"is"===e&&Tt.allowCustomizedBuiltInElements&&(Tt.tagNameCheck instanceof RegExp&&_(Tt.tagNameCheck,n)||Tt.tagNameCheck instanceof Function&&Tt.tagNameCheck(n))))return!1}else if(Yt[e]);else if(_(vt,v(n,ft,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==w(n,"data:")||!Wt[t])if(xt&&!_(mt,v(n,ft,"")));else if(n)return!1;return!0},Te=function(t){return"annotation-xml"!==t&&h(t,ht)},Ee=function(t){ye("beforeSanitizeAttributes",t,null);const{attributes:e}=t;if(!e)return;const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:gt};let i=e.length;for(;i--;){const a=e[i],{name:r,namespaceURI:c,value:l}=a,s=ne(r);let p="value"===r?l:y(l);if(n.attrName=s,n.attrValue=p,n.keepAttr=!0,n.forceKeepAttr=void 0,ye("uponSanitizeAttribute",t,n),p=n.attrValue,Nt&&_(/((--!?|])>)|<\/(style|title)/i,p)){me(r,t);continue}if(n.forceKeepAttr)continue;if(me(r,t),!n.keepAttr)continue;if(!St&&_(/\/>/i,p)){me(r,t);continue}jt&&u([lt,st,ut],(t=>{p=v(p,t," ")}));const m=ne(t.nodeName);if(_e(m,s,p)){if(!Pt||"id"!==s&&"name"!==s||(me(r,t),p="user-content-"+p),tt&&"object"==typeof W&&"function"==typeof W.getAttributeType)if(c);else switch(W.getAttributeType(m,s)){case"TrustedHTML":p=tt.createHTML(p);break;case"TrustedScriptURL":p=tt.createScriptURL(p)}try{c?t.setAttributeNS(c,r,p):t.setAttribute(r,p),ve(t)?pe(t):d(o.removed)}catch(t){}}}ye("afterSanitizeAttributes",t,null)},Ae=function t(e){let n=null;const o=he(e);for(ye("beforeSanitizeShadowDOM",e,null);n=o.nextNode();)ye("uponSanitizeShadowNode",n,null),ge(n)||(n.content instanceof s&&t(n.content),Ee(n));ye("afterSanitizeShadowDOM",e,null)};return o.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,i=null,a=null,c=null;if($t=!t,$t&&(t="\x3c!--\x3e"),"string"!=typeof t&&!we(t)){if("function"!=typeof t.toString)throw T("toString is not a function");if("string"!=typeof(t=t.toString()))throw T("dirty is not a string, aborting")}if(!o.isSupported)return t;if(Dt||re(e),o.removed=[],"string"==typeof t&&(Ht=!1),Ht){if(t.nodeName){const e=ne(t.nodeName);if(!wt[e]||Et[e])throw T("root node is forbidden and cannot be sanitized in-place")}}else if(t instanceof A)n=fe("\x3c!----\x3e"),i=n.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?n=i:n.appendChild(i);else{if(!kt&&!jt&&!Ct&&-1===t.indexOf("<"))return tt&&Mt?tt.createHTML(t):t;if(n=fe(t),!n)return kt?null:Mt?et:""}n&&Rt&&pe(n.firstChild);const l=he(Ht?t:n);for(;a=l.nextNode();)ge(a)||(a.content instanceof s&&Ae(a.content),Ee(a));if(Ht)return t;if(kt){if(Lt)for(c=it.call(n.ownerDocument);n.firstChild;)c.appendChild(n.firstChild);else c=n;return(gt.shadowroot||gt.shadowrootmode)&&(c=rt.call(r,c,!0)),c}let d=Ct?n.outerHTML:n.innerHTML;return Ct&&wt["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&_(J,n.ownerDocument.doctype.name)&&(d="\n"+d),jt&&u([lt,st,ut],(t=>{d=v(d,t," ")})),tt&&Mt?tt.createHTML(d):d},o.setConfig=function(){re(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Dt=!0},o.clearConfig=function(){oe=null,Dt=!1},o.isValidAttribute=function(t,e,n){oe||re({});const o=ne(t),i=ne(e);return _e(o,i,n)},o.addHook=function(t,e){"function"==typeof e&&(ct[t]=ct[t]||[],p(ct[t],e))},o.removeHook=function(t){if(ct[t])return d(ct[t])},o.removeHooks=function(t){ct[t]&&(ct[t]=[])},o.removeAllHooks=function(){ct={}},o}()}()}}]);