@returnflows/shop-overlay 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,2 +1,2 @@
1
- function e(e,t,r){return(t=function(e){var t=function(e,t){if('object'!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if('object'!=typeof n)return n;throw new TypeError('@@toPrimitive must return a primitive value.')}return('string'===t?String:Number)(e)}(e,'string');return'symbol'==typeof t?t:t+''}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(null,arguments)}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)),r.push.apply(r,n)}return r}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach(r=>{e(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach(e=>{Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function o(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i,a;function s(){var e,t;return'undefined'==typeof window?null:null!==(e=null===(t=window.Returnflows)||void 0===t?void 0:t._cartProvider)&&void 0!==e?e:null}function l(){var e;return'undefined'!=typeof window&&null!=(null===(e=window.Returnflows)||void 0===e?void 0:e._cartProvider)}function c(e){var t,r,n='';if('string'==typeof e||'number'==typeof e)n+=e;else if('object'==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=c(e[t]))&&(n&&(n+=' '),n+=r)}else for(r in e)e[r]&&(n&&(n+=' '),n+=r);return n}function u(){for(var e,t,r=0,n='',o=arguments.length;r<o;r++)(e=arguments[r])&&(t=c(e))&&(n&&(n+=' '),n+=t);return n}(()=>{const e={VITE_WIDGET_BASE_URL:'https://static.returnflows.com/dist/production',VITE_API_URL:'https://app.returnflows.com/api/proxy',VITE_PLATFORM_URL:'https://returnflows.com'};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}})(),(e=>{e.Collapsed='COLLAPSED',e.Open='OPEN'})(i||(i={})),(e=>{e.Collapsed='COLLAPSED',e.Open='OPEN'})(a||(a={}));const d=function(){return{nextPart:arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,validators:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,classGroupId:arguments.length>2?arguments[2]:void 0}},h='-',f=[],m=e=>{const t=g(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith('[')&&e.endsWith(']'))return _(e);const r=e.split(h),n=''===r[0]&&r.length>1?1:0;return p(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],o=r[e];return t?o?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(o,t):t:o||f}return r[e]||f}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],o=r.nextPart.get(n);if(o){const r=p(e,t+1,o);if(r)return r}const i=r.validators;if(null===i)return;const a=0===t?e.join(h):e.slice(t).join(h),s=i.length;for(let e=0;e<s;e++){const t=i[e];if(t.validator(a))return t.classGroupId}},_=e=>-1===e.slice(1,-1).indexOf(':')?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(':'),n=t.slice(0,r);return n?'arbitrary..'+n:void 0})(),g=e=>{const{theme:t,classGroups:r}=e;return v(r,t)},v=(e,t)=>{const r=d();for(const n in e){const o=e[n];b(o,r,n,t)}return r},b=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const o=e[i];y(o,t,r,n)}},y=(e,t,r,n)=>{'string'!=typeof e?'function'!=typeof e?N(e,t,r,n):E(e,t,r,n):w(e,t,r)},w=(e,t,r)=>{(''===e?t:x(t,e)).classGroupId=r},E=(e,t,r,n)=>{k(e)?b(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},N=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let e=0;e<i;e++){const[i,a]=o[e];b(a,x(t,i),r,n)}},x=(e,t)=>{let r=e;const n=t.split(h),o=n.length;for(let e=0;e<o;e++){const t=n[e];let o=r.nextPart.get(t);o||(o=d(),r.nextPart.set(t,o)),r=o}return r},k=e=>'isThemeGetter'in e&&!0===e.isThemeGetter,C=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(o,i)=>{r[o]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}},S=[],T=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),I=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,o=0,i=0;const a=e.length;for(let s=0;s<a;s++){const a=e[s];if(0===n&&0===o){if(':'===a){t.push(e.slice(i,s)),i=s+1;continue}if('/'===a){r=s;continue}}'['===a?n++:']'===a?n--:'('===a?o++:')'===a&&o--}const s=0===t.length?e:e.slice(i);let l=s,c=!1;s.endsWith('!')?(l=s.slice(0,-1),c=!0):s.startsWith('!')&&(l=s.slice(1),c=!0);return T(t,c,l,r&&r>i?r-i:void 0)};if(t){const e=t+':',r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):T(S,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},A=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let o=0;o<e.length;o++){const i=e[o],a='['===i[0],s=t.has(i);a||s?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},P=/\s+/,R=e=>{if('string'==typeof e)return e;let t,r='';for(let n=0;n<e.length;n++)e[n]&&(t=R(e[n]))&&(r&&(r+=' '),r+=t);return r},H=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];let i,a,s,l;const c=e=>{const t=a(e);if(t)return t;const r=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(P);let l='';for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(c){l=t+(l.length>0?' '+l:l);continue}let m=!!f,p=n(m?h.substring(0,f):h);if(!p){if(!m){l=t+(l.length>0?' '+l:l);continue}if(p=n(h),!p){l=t+(l.length>0?' '+l:l);continue}m=!1}const _=0===u.length?'':1===u.length?u[0]:i(u).join(':'),g=d?_+'!':_,v=g+p;if(a.indexOf(v)>-1)continue;a.push(v);const b=o(p,m);for(let e=0;e<b.length;++e){const t=b[e];a.push(g+t)}l=t+(l.length>0?' '+l:l)}return l})(e,i);return s(e,r),r};return l=t=>{const o=r.reduce((e,t)=>t(e),e());return i=(e=>n({cache:C(e.cacheSize),parseClassName:I(e),sortModifiers:A(e)},m(e)))(o),a=i.cache.get,s=i.cache.set,l=c,c(t)},function(){return l(function(){let e,t,r=0,n='';for(;r<arguments.length;){var o;(e=(o=r++)<0||arguments.length<=o?void 0:arguments[o])&&(t=R(e))&&(n&&(n+=' '),n+=t)}return n}(...arguments))}},O=[],L=e=>{const t=t=>t[e]||O;return t.isThemeGetter=!0,t},B=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M=/^\((?:(\w[\w-]*):)?(.+)\)$/i,D=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,U=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,G=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>D.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),W=e=>!!e&&Number.isInteger(Number(e)),X=e=>e.endsWith('%')&&q(e.slice(0,-1)),K=e=>F.test(e),Z=()=>!0,Y=e=>U.test(e)&&!G.test(e),J=()=>!1,Q=e=>z.test(e),$=e=>j.test(e),ee=e=>!re(e)&&!ue(e),te=e=>ve(e,Ee,J),re=e=>B.test(e),ne=e=>ve(e,Ne,Y),oe=e=>ve(e,xe,q),ie=e=>ve(e,Ce,Z),ae=e=>ve(e,ke,J),se=e=>ve(e,ye,J),le=e=>ve(e,we,$),ce=e=>ve(e,Se,Q),ue=e=>M.test(e),de=e=>be(e,Ne),he=e=>be(e,ke),fe=e=>be(e,ye),me=e=>be(e,Ee),pe=e=>be(e,we),_e=e=>be(e,Se,!0),ge=e=>be(e,Ce,!0),ve=(e,t,r)=>{const n=B.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},be=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=M.exec(e);return!!n&&(n[1]?t(n[1]):r)},ye=e=>'position'===e||'percentage'===e,we=e=>'image'===e||'url'===e,Ee=e=>'length'===e||'size'===e||'bg-size'===e,Ne=e=>'length'===e,xe=e=>'number'===e,ke=e=>'family-name'===e,Ce=e=>'number'===e||'weight'===e,Se=e=>'shadow'===e,Te=H(()=>{const e=L('color'),t=L('font'),r=L('text'),n=L('font-weight'),o=L('tracking'),i=L('leading'),a=L('breakpoint'),s=L('container'),l=L('spacing'),c=L('radius'),u=L('shadow'),d=L('inset-shadow'),h=L('text-shadow'),f=L('drop-shadow'),m=L('blur'),p=L('perspective'),_=L('aspect'),g=L('ease'),v=L('animate'),b=()=>['center','top','bottom','left','right','top-left','left-top','top-right','right-top','bottom-right','right-bottom','bottom-left','left-bottom',ue,re],y=()=>[ue,re,l],w=()=>[V,'full','auto',...y()],E=()=>[W,'none','subgrid',ue,re],N=()=>['auto',{span:['full',W,ue,re]},W,ue,re],x=()=>[W,'auto',ue,re],k=()=>['auto','min','max','fr',ue,re],C=()=>['auto',...y()],S=()=>[V,'auto','full','dvw','dvh','lvw','lvh','svw','svh','min','max','fit',...y()],T=()=>[V,'screen','full','dvw','lvw','svw','min','max','fit',...y()],I=()=>[V,'screen','full','lh','dvh','lvh','svh','min','max','fit',...y()],A=()=>[e,ue,re],P=()=>['center','top','bottom','left','right','top-left','left-top','top-right','right-top','bottom-right','right-bottom','bottom-left','left-bottom',fe,se,{position:[ue,re]}],R=()=>['auto','cover','contain',me,te,{size:[ue,re]}],H=()=>[X,de,ne],O=()=>['','none','full',c,ue,re],B=()=>['',q,de,ne],M=()=>[q,X,fe,se],D=()=>['','none',m,ue,re],F=()=>['none',q,ue,re],U=()=>['none',q,ue,re],G=()=>[q,ue,re],z=()=>[V,'full',...y()];return{cacheSize:500,theme:{animate:['spin','ping','pulse','bounce'],aspect:['video'],blur:[K],breakpoint:[K],color:[Z],container:[K],'drop-shadow':[K],ease:['in','out','in-out'],font:[ee],'font-weight':['thin','extralight','light','normal','medium','semibold','bold','extrabold','black'],'inset-shadow':[K],leading:['none','tight','snug','normal','relaxed','loose'],perspective:['dramatic','near','normal','midrange','distant','none'],radius:[K],shadow:[K],spacing:['px',q],text:[K],'text-shadow':[K],tracking:['tighter','tight','normal','wide','wider','widest']},classGroups:{aspect:[{aspect:['auto','square',V,re,ue,_]}],container:['container'],columns:[{columns:[q,re,ue,s]}],'break-after':[{'break-after':['auto','avoid','all','avoid-page','page','left','right','column']}],'break-before':[{'break-before':['auto','avoid','all','avoid-page','page','left','right','column']}],'break-inside':[{'break-inside':['auto','avoid','avoid-page','avoid-column']}],'box-decoration':[{'box-decoration':['slice','clone']}],box:[{box:['border','content']}],display:['block','inline-block','inline','flex','inline-flex','table','inline-table','table-caption','table-cell','table-column','table-column-group','table-footer-group','table-header-group','table-row-group','table-row','flow-root','grid','inline-grid','contents','list-item','hidden'],sr:['sr-only','not-sr-only'],float:[{float:['right','left','none','start','end']}],clear:[{clear:['left','right','both','none','start','end']}],isolation:['isolate','isolation-auto'],'object-fit':[{object:['contain','cover','fill','none','scale-down']}],'object-position':[{object:b()}],overflow:[{overflow:['auto','hidden','clip','visible','scroll']}],'overflow-x':[{'overflow-x':['auto','hidden','clip','visible','scroll']}],'overflow-y':[{'overflow-y':['auto','hidden','clip','visible','scroll']}],overscroll:[{overscroll:['auto','contain','none']}],'overscroll-x':[{'overscroll-x':['auto','contain','none']}],'overscroll-y':[{'overscroll-y':['auto','contain','none']}],position:['static','fixed','absolute','relative','sticky'],inset:[{inset:w()}],'inset-x':[{'inset-x':w()}],'inset-y':[{'inset-y':w()}],start:[{'inset-s':w(),start:w()}],end:[{'inset-e':w(),end:w()}],'inset-bs':[{'inset-bs':w()}],'inset-be':[{'inset-be':w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:['visible','invisible','collapse'],z:[{z:[W,'auto',ue,re]}],basis:[{basis:[V,'full','auto',s,...y()]}],'flex-direction':[{flex:['row','row-reverse','col','col-reverse']}],'flex-wrap':[{flex:['nowrap','wrap','wrap-reverse']}],flex:[{flex:[q,V,'auto','initial','none',re]}],grow:[{grow:['',q,ue,re]}],shrink:[{shrink:['',q,ue,re]}],order:[{order:[W,'first','last','none',ue,re]}],'grid-cols':[{'grid-cols':E()}],'col-start-end':[{col:N()}],'col-start':[{'col-start':x()}],'col-end':[{'col-end':x()}],'grid-rows':[{'grid-rows':E()}],'row-start-end':[{row:N()}],'row-start':[{'row-start':x()}],'row-end':[{'row-end':x()}],'grid-flow':[{'grid-flow':['row','col','dense','row-dense','col-dense']}],'auto-cols':[{'auto-cols':k()}],'auto-rows':[{'auto-rows':k()}],gap:[{gap:y()}],'gap-x':[{'gap-x':y()}],'gap-y':[{'gap-y':y()}],'justify-content':[{justify:['start','end','center','between','around','evenly','stretch','baseline','center-safe','end-safe','normal']}],'justify-items':[{'justify-items':['start','end','center','stretch','center-safe','end-safe','normal']}],'justify-self':[{'justify-self':['auto','start','end','center','stretch','center-safe','end-safe']}],'align-content':[{content:['normal','start','end','center','between','around','evenly','stretch','baseline','center-safe','end-safe']}],'align-items':[{items:['start','end','center','stretch','center-safe','end-safe',{baseline:['','last']}]}],'align-self':[{self:['auto','start','end','center','stretch','center-safe','end-safe',{baseline:['','last']}]}],'place-content':[{'place-content':['start','end','center','between','around','evenly','stretch','baseline','center-safe','end-safe']}],'place-items':[{'place-items':['start','end','center','stretch','center-safe','end-safe','baseline']}],'place-self':[{'place-self':['auto','start','end','center','stretch','center-safe','end-safe']}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pbs:[{pbs:y()}],pbe:[{pbe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],'space-x':[{'space-x':y()}],'space-x-reverse':['space-x-reverse'],'space-y':[{'space-y':y()}],'space-y-reverse':['space-y-reverse'],size:[{size:S()}],'inline-size':[{inline:['auto',...T()]}],'min-inline-size':[{'min-inline':['auto',...T()]}],'max-inline-size':[{'max-inline':['none',...T()]}],'block-size':[{block:['auto',...I()]}],'min-block-size':[{'min-block':['auto',...I()]}],'max-block-size':[{'max-block':['none',...I()]}],w:[{w:[s,'screen',...S()]}],'min-w':[{'min-w':[s,'screen','none',...S()]}],'max-w':[{'max-w':[s,'screen','none','prose',{screen:[a]},...S()]}],h:[{h:['screen','lh',...S()]}],'min-h':[{'min-h':['screen','lh','none',...S()]}],'max-h':[{'max-h':['screen','lh',...S()]}],'font-size':[{text:['base',r,de,ne]}],'font-smoothing':['antialiased','subpixel-antialiased'],'font-style':['italic','not-italic'],'font-weight':[{font:[n,ge,ie]}],'font-stretch':[{'font-stretch':['ultra-condensed','extra-condensed','condensed','semi-condensed','normal','semi-expanded','expanded','extra-expanded','ultra-expanded',X,re]}],'font-family':[{font:[he,ae,t]}],'font-features':[{'font-features':[re]}],'fvn-normal':['normal-nums'],'fvn-ordinal':['ordinal'],'fvn-slashed-zero':['slashed-zero'],'fvn-figure':['lining-nums','oldstyle-nums'],'fvn-spacing':['proportional-nums','tabular-nums'],'fvn-fraction':['diagonal-fractions','stacked-fractions'],tracking:[{tracking:[o,ue,re]}],'line-clamp':[{'line-clamp':[q,'none',ue,oe]}],leading:[{leading:[i,...y()]}],'list-image':[{'list-image':['none',ue,re]}],'list-style-position':[{list:['inside','outside']}],'list-style-type':[{list:['disc','decimal','none',ue,re]}],'text-alignment':[{text:['left','center','right','justify','start','end']}],'placeholder-color':[{placeholder:A()}],'text-color':[{text:A()}],'text-decoration':['underline','overline','line-through','no-underline'],'text-decoration-style':[{decoration:['solid','dashed','dotted','double','wavy']}],'text-decoration-thickness':[{decoration:[q,'from-font','auto',ue,ne]}],'text-decoration-color':[{decoration:A()}],'underline-offset':[{'underline-offset':[q,'auto',ue,re]}],'text-transform':['uppercase','lowercase','capitalize','normal-case'],'text-overflow':['truncate','text-ellipsis','text-clip'],'text-wrap':[{text:['wrap','nowrap','balance','pretty']}],indent:[{indent:y()}],'vertical-align':[{align:['baseline','top','middle','bottom','text-top','text-bottom','sub','super',ue,re]}],whitespace:[{whitespace:['normal','nowrap','pre','pre-line','pre-wrap','break-spaces']}],break:[{break:['normal','words','all','keep']}],wrap:[{wrap:['break-word','anywhere','normal']}],hyphens:[{hyphens:['none','manual','auto']}],content:[{content:['none',ue,re]}],'bg-attachment':[{bg:['fixed','local','scroll']}],'bg-clip':[{'bg-clip':['border','padding','content','text']}],'bg-origin':[{'bg-origin':['border','padding','content']}],'bg-position':[{bg:P()}],'bg-repeat':[{bg:['no-repeat',{repeat:['','x','y','space','round']}]}],'bg-size':[{bg:R()}],'bg-image':[{bg:['none',{linear:[{to:['t','tr','r','br','b','bl','l','tl']},W,ue,re],radial:['',ue,re],conic:[W,ue,re]},pe,le]}],'bg-color':[{bg:A()}],'gradient-from-pos':[{from:H()}],'gradient-via-pos':[{via:H()}],'gradient-to-pos':[{to:H()}],'gradient-from':[{from:A()}],'gradient-via':[{via:A()}],'gradient-to':[{to:A()}],rounded:[{rounded:O()}],'rounded-s':[{'rounded-s':O()}],'rounded-e':[{'rounded-e':O()}],'rounded-t':[{'rounded-t':O()}],'rounded-r':[{'rounded-r':O()}],'rounded-b':[{'rounded-b':O()}],'rounded-l':[{'rounded-l':O()}],'rounded-ss':[{'rounded-ss':O()}],'rounded-se':[{'rounded-se':O()}],'rounded-ee':[{'rounded-ee':O()}],'rounded-es':[{'rounded-es':O()}],'rounded-tl':[{'rounded-tl':O()}],'rounded-tr':[{'rounded-tr':O()}],'rounded-br':[{'rounded-br':O()}],'rounded-bl':[{'rounded-bl':O()}],'border-w':[{border:B()}],'border-w-x':[{'border-x':B()}],'border-w-y':[{'border-y':B()}],'border-w-s':[{'border-s':B()}],'border-w-e':[{'border-e':B()}],'border-w-bs':[{'border-bs':B()}],'border-w-be':[{'border-be':B()}],'border-w-t':[{'border-t':B()}],'border-w-r':[{'border-r':B()}],'border-w-b':[{'border-b':B()}],'border-w-l':[{'border-l':B()}],'divide-x':[{'divide-x':B()}],'divide-x-reverse':['divide-x-reverse'],'divide-y':[{'divide-y':B()}],'divide-y-reverse':['divide-y-reverse'],'border-style':[{border:['solid','dashed','dotted','double','hidden','none']}],'divide-style':[{divide:['solid','dashed','dotted','double','hidden','none']}],'border-color':[{border:A()}],'border-color-x':[{'border-x':A()}],'border-color-y':[{'border-y':A()}],'border-color-s':[{'border-s':A()}],'border-color-e':[{'border-e':A()}],'border-color-bs':[{'border-bs':A()}],'border-color-be':[{'border-be':A()}],'border-color-t':[{'border-t':A()}],'border-color-r':[{'border-r':A()}],'border-color-b':[{'border-b':A()}],'border-color-l':[{'border-l':A()}],'divide-color':[{divide:A()}],'outline-style':[{outline:['solid','dashed','dotted','double','none','hidden']}],'outline-offset':[{'outline-offset':[q,ue,re]}],'outline-w':[{outline:['',q,de,ne]}],'outline-color':[{outline:A()}],shadow:[{shadow:['','none',u,_e,ce]}],'shadow-color':[{shadow:A()}],'inset-shadow':[{'inset-shadow':['none',d,_e,ce]}],'inset-shadow-color':[{'inset-shadow':A()}],'ring-w':[{ring:B()}],'ring-w-inset':['ring-inset'],'ring-color':[{ring:A()}],'ring-offset-w':[{'ring-offset':[q,ne]}],'ring-offset-color':[{'ring-offset':A()}],'inset-ring-w':[{'inset-ring':B()}],'inset-ring-color':[{'inset-ring':A()}],'text-shadow':[{'text-shadow':['none',h,_e,ce]}],'text-shadow-color':[{'text-shadow':A()}],opacity:[{opacity:[q,ue,re]}],'mix-blend':[{'mix-blend':['normal','multiply','screen','overlay','darken','lighten','color-dodge','color-burn','hard-light','soft-light','difference','exclusion','hue','saturation','color','luminosity','plus-darker','plus-lighter']}],'bg-blend':[{'bg-blend':['normal','multiply','screen','overlay','darken','lighten','color-dodge','color-burn','hard-light','soft-light','difference','exclusion','hue','saturation','color','luminosity']}],'mask-clip':[{'mask-clip':['border','padding','content','fill','stroke','view']},'mask-no-clip'],'mask-composite':[{mask:['add','subtract','intersect','exclude']}],'mask-image-linear-pos':[{'mask-linear':[q]}],'mask-image-linear-from-pos':[{'mask-linear-from':M()}],'mask-image-linear-to-pos':[{'mask-linear-to':M()}],'mask-image-linear-from-color':[{'mask-linear-from':A()}],'mask-image-linear-to-color':[{'mask-linear-to':A()}],'mask-image-t-from-pos':[{'mask-t-from':M()}],'mask-image-t-to-pos':[{'mask-t-to':M()}],'mask-image-t-from-color':[{'mask-t-from':A()}],'mask-image-t-to-color':[{'mask-t-to':A()}],'mask-image-r-from-pos':[{'mask-r-from':M()}],'mask-image-r-to-pos':[{'mask-r-to':M()}],'mask-image-r-from-color':[{'mask-r-from':A()}],'mask-image-r-to-color':[{'mask-r-to':A()}],'mask-image-b-from-pos':[{'mask-b-from':M()}],'mask-image-b-to-pos':[{'mask-b-to':M()}],'mask-image-b-from-color':[{'mask-b-from':A()}],'mask-image-b-to-color':[{'mask-b-to':A()}],'mask-image-l-from-pos':[{'mask-l-from':M()}],'mask-image-l-to-pos':[{'mask-l-to':M()}],'mask-image-l-from-color':[{'mask-l-from':A()}],'mask-image-l-to-color':[{'mask-l-to':A()}],'mask-image-x-from-pos':[{'mask-x-from':M()}],'mask-image-x-to-pos':[{'mask-x-to':M()}],'mask-image-x-from-color':[{'mask-x-from':A()}],'mask-image-x-to-color':[{'mask-x-to':A()}],'mask-image-y-from-pos':[{'mask-y-from':M()}],'mask-image-y-to-pos':[{'mask-y-to':M()}],'mask-image-y-from-color':[{'mask-y-from':A()}],'mask-image-y-to-color':[{'mask-y-to':A()}],'mask-image-radial':[{'mask-radial':[ue,re]}],'mask-image-radial-from-pos':[{'mask-radial-from':M()}],'mask-image-radial-to-pos':[{'mask-radial-to':M()}],'mask-image-radial-from-color':[{'mask-radial-from':A()}],'mask-image-radial-to-color':[{'mask-radial-to':A()}],'mask-image-radial-shape':[{'mask-radial':['circle','ellipse']}],'mask-image-radial-size':[{'mask-radial':[{closest:['side','corner'],farthest:['side','corner']}]}],'mask-image-radial-pos':[{'mask-radial-at':['center','top','bottom','left','right','top-left','left-top','top-right','right-top','bottom-right','right-bottom','bottom-left','left-bottom']}],'mask-image-conic-pos':[{'mask-conic':[q]}],'mask-image-conic-from-pos':[{'mask-conic-from':M()}],'mask-image-conic-to-pos':[{'mask-conic-to':M()}],'mask-image-conic-from-color':[{'mask-conic-from':A()}],'mask-image-conic-to-color':[{'mask-conic-to':A()}],'mask-mode':[{mask:['alpha','luminance','match']}],'mask-origin':[{'mask-origin':['border','padding','content','fill','stroke','view']}],'mask-position':[{mask:P()}],'mask-repeat':[{mask:['no-repeat',{repeat:['','x','y','space','round']}]}],'mask-size':[{mask:R()}],'mask-type':[{'mask-type':['alpha','luminance']}],'mask-image':[{mask:['none',ue,re]}],filter:[{filter:['','none',ue,re]}],blur:[{blur:D()}],brightness:[{brightness:[q,ue,re]}],contrast:[{contrast:[q,ue,re]}],'drop-shadow':[{'drop-shadow':['','none',f,_e,ce]}],'drop-shadow-color':[{'drop-shadow':A()}],grayscale:[{grayscale:['',q,ue,re]}],'hue-rotate':[{'hue-rotate':[q,ue,re]}],invert:[{invert:['',q,ue,re]}],saturate:[{saturate:[q,ue,re]}],sepia:[{sepia:['',q,ue,re]}],'backdrop-filter':[{'backdrop-filter':['','none',ue,re]}],'backdrop-blur':[{'backdrop-blur':D()}],'backdrop-brightness':[{'backdrop-brightness':[q,ue,re]}],'backdrop-contrast':[{'backdrop-contrast':[q,ue,re]}],'backdrop-grayscale':[{'backdrop-grayscale':['',q,ue,re]}],'backdrop-hue-rotate':[{'backdrop-hue-rotate':[q,ue,re]}],'backdrop-invert':[{'backdrop-invert':['',q,ue,re]}],'backdrop-opacity':[{'backdrop-opacity':[q,ue,re]}],'backdrop-saturate':[{'backdrop-saturate':[q,ue,re]}],'backdrop-sepia':[{'backdrop-sepia':['',q,ue,re]}],'border-collapse':[{border:['collapse','separate']}],'border-spacing':[{'border-spacing':y()}],'border-spacing-x':[{'border-spacing-x':y()}],'border-spacing-y':[{'border-spacing-y':y()}],'table-layout':[{table:['auto','fixed']}],caption:[{caption:['top','bottom']}],transition:[{transition:['','all','colors','opacity','shadow','transform','none',ue,re]}],'transition-behavior':[{transition:['normal','discrete']}],duration:[{duration:[q,'initial',ue,re]}],ease:[{ease:['linear','initial',g,ue,re]}],delay:[{delay:[q,ue,re]}],animate:[{animate:['none',v,ue,re]}],backface:[{backface:['hidden','visible']}],perspective:[{perspective:[p,ue,re]}],'perspective-origin':[{'perspective-origin':b()}],rotate:[{rotate:F()}],'rotate-x':[{'rotate-x':F()}],'rotate-y':[{'rotate-y':F()}],'rotate-z':[{'rotate-z':F()}],scale:[{scale:U()}],'scale-x':[{'scale-x':U()}],'scale-y':[{'scale-y':U()}],'scale-z':[{'scale-z':U()}],'scale-3d':['scale-3d'],skew:[{skew:G()}],'skew-x':[{'skew-x':G()}],'skew-y':[{'skew-y':G()}],transform:[{transform:[ue,re,'','none','gpu','cpu']}],'transform-origin':[{origin:b()}],'transform-style':[{transform:['3d','flat']}],translate:[{translate:z()}],'translate-x':[{'translate-x':z()}],'translate-y':[{'translate-y':z()}],'translate-z':[{'translate-z':z()}],'translate-none':['translate-none'],accent:[{accent:A()}],appearance:[{appearance:['none','auto']}],'caret-color':[{caret:A()}],'color-scheme':[{scheme:['normal','dark','light','light-dark','only-dark','only-light']}],cursor:[{cursor:['auto','default','pointer','wait','text','move','help','not-allowed','none','context-menu','progress','cell','crosshair','vertical-text','alias','copy','no-drop','grab','grabbing','all-scroll','col-resize','row-resize','n-resize','e-resize','s-resize','w-resize','ne-resize','nw-resize','se-resize','sw-resize','ew-resize','ns-resize','nesw-resize','nwse-resize','zoom-in','zoom-out',ue,re]}],'field-sizing':[{'field-sizing':['fixed','content']}],'pointer-events':[{'pointer-events':['auto','none']}],resize:[{resize:['none','','y','x']}],'scroll-behavior':[{scroll:['auto','smooth']}],'scroll-m':[{'scroll-m':y()}],'scroll-mx':[{'scroll-mx':y()}],'scroll-my':[{'scroll-my':y()}],'scroll-ms':[{'scroll-ms':y()}],'scroll-me':[{'scroll-me':y()}],'scroll-mbs':[{'scroll-mbs':y()}],'scroll-mbe':[{'scroll-mbe':y()}],'scroll-mt':[{'scroll-mt':y()}],'scroll-mr':[{'scroll-mr':y()}],'scroll-mb':[{'scroll-mb':y()}],'scroll-ml':[{'scroll-ml':y()}],'scroll-p':[{'scroll-p':y()}],'scroll-px':[{'scroll-px':y()}],'scroll-py':[{'scroll-py':y()}],'scroll-ps':[{'scroll-ps':y()}],'scroll-pe':[{'scroll-pe':y()}],'scroll-pbs':[{'scroll-pbs':y()}],'scroll-pbe':[{'scroll-pbe':y()}],'scroll-pt':[{'scroll-pt':y()}],'scroll-pr':[{'scroll-pr':y()}],'scroll-pb':[{'scroll-pb':y()}],'scroll-pl':[{'scroll-pl':y()}],'snap-align':[{snap:['start','end','center','align-none']}],'snap-stop':[{snap:['normal','always']}],'snap-type':[{snap:['none','x','y','both']}],'snap-strictness':[{snap:['mandatory','proximity']}],touch:[{touch:['auto','none','manipulation']}],'touch-x':[{'touch-pan':['x','left','right']}],'touch-y':[{'touch-pan':['y','up','down']}],'touch-pz':['touch-pinch-zoom'],select:[{select:['none','text','all','auto']}],'will-change':[{'will-change':['auto','scroll','contents','transform',ue,re]}],fill:[{fill:['none',...A()]}],'stroke-w':[{stroke:[q,de,ne,oe]}],stroke:[{stroke:['none',...A()]}],'forced-color-adjust':[{'forced-color-adjust':['auto','none']}]},conflictingClassGroups:{overflow:['overflow-x','overflow-y'],overscroll:['overscroll-x','overscroll-y'],inset:['inset-x','inset-y','inset-bs','inset-be','start','end','top','right','bottom','left'],'inset-x':['right','left'],'inset-y':['top','bottom'],flex:['basis','grow','shrink'],gap:['gap-x','gap-y'],p:['px','py','ps','pe','pbs','pbe','pt','pr','pb','pl'],px:['pr','pl'],py:['pt','pb'],m:['mx','my','ms','me','mbs','mbe','mt','mr','mb','ml'],mx:['mr','ml'],my:['mt','mb'],size:['w','h'],'font-size':['leading'],'fvn-normal':['fvn-ordinal','fvn-slashed-zero','fvn-figure','fvn-spacing','fvn-fraction'],'fvn-ordinal':['fvn-normal'],'fvn-slashed-zero':['fvn-normal'],'fvn-figure':['fvn-normal'],'fvn-spacing':['fvn-normal'],'fvn-fraction':['fvn-normal'],'line-clamp':['display','overflow'],rounded:['rounded-s','rounded-e','rounded-t','rounded-r','rounded-b','rounded-l','rounded-ss','rounded-se','rounded-ee','rounded-es','rounded-tl','rounded-tr','rounded-br','rounded-bl'],'rounded-s':['rounded-ss','rounded-es'],'rounded-e':['rounded-se','rounded-ee'],'rounded-t':['rounded-tl','rounded-tr'],'rounded-r':['rounded-tr','rounded-br'],'rounded-b':['rounded-br','rounded-bl'],'rounded-l':['rounded-tl','rounded-bl'],'border-spacing':['border-spacing-x','border-spacing-y'],'border-w':['border-w-x','border-w-y','border-w-s','border-w-e','border-w-bs','border-w-be','border-w-t','border-w-r','border-w-b','border-w-l'],'border-w-x':['border-w-r','border-w-l'],'border-w-y':['border-w-t','border-w-b'],'border-color':['border-color-x','border-color-y','border-color-s','border-color-e','border-color-bs','border-color-be','border-color-t','border-color-r','border-color-b','border-color-l'],'border-color-x':['border-color-r','border-color-l'],'border-color-y':['border-color-t','border-color-b'],translate:['translate-x','translate-y','translate-none'],'translate-none':['translate','translate-x','translate-y','translate-z'],'scroll-m':['scroll-mx','scroll-my','scroll-ms','scroll-me','scroll-mbs','scroll-mbe','scroll-mt','scroll-mr','scroll-mb','scroll-ml'],'scroll-mx':['scroll-mr','scroll-ml'],'scroll-my':['scroll-mt','scroll-mb'],'scroll-p':['scroll-px','scroll-py','scroll-ps','scroll-pe','scroll-pbs','scroll-pbe','scroll-pt','scroll-pr','scroll-pb','scroll-pl'],'scroll-px':['scroll-pr','scroll-pl'],'scroll-py':['scroll-pt','scroll-pb'],touch:['touch-x','touch-y','touch-pz'],'touch-x':['touch'],'touch-y':['touch'],'touch-pz':['touch']},conflictingClassGroupModifiers:{'font-size':['leading']},orderSensitiveModifiers:['*','**','after','backdrop','before','details-content','file','first-letter','first-line','marker','placeholder','selection']}});function Ie(e){return 60*e*1e3}const Ae={key:'session_id',type:'sessionStorage',expiration:(Pe=1,60*Pe*60*1e3)};var Pe;const Re={key:'dialog_expiration',type:'sessionStorage'},He=Ie(10),Oe={key:'cart',type:'sessionStorage',expiration:Ie(5)},Le={key:'debug_mode',type:'sessionStorage'};function Be(e){return''.concat('rflows_').concat(e)}var Me=(e,t)=>{let{key:r,type:n,expiration:o}=e;const i={value:t,expiration:o?Date.now()+o:void 0};Ue(n).setItem(Be(r),JSON.stringify(i))},De=e=>{let{key:t,type:r}=e;const n=Ue(r),o=n.getItem(Be(t));if(!o)return null;try{const e=JSON.parse(o);return e.expiration&&Date.now()>e.expiration?(n.removeItem(Be(t)),null):e.value}catch(e){return null}},Fe=e=>{let{key:t,type:r}=e;Ue(r).removeItem(Be(t))};function Ue(e){if('sessionStorage'===e)return sessionStorage;if('localStorage'===e)return localStorage;throw new Error('Invalid storage type: '.concat(e))}const Ge='[RF]';var ze;(e=>{e[e.DEBUG=0]='DEBUG',e[e.INFO=1]='INFO',e[e.WARN=2]='WARN',e[e.ERROR=3]='ERROR'})(ze||(ze={}));class je{constructor(){}static getInstance(){return je.instance||(je.instance=new je),je.instance}checkDebugMode(){const e=De(Le);return Boolean(e)}log(e,t){if(this.checkDebugMode()){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];switch(e){case ze.DEBUG:console.debug(''.concat(Ge,' ').concat(t),...n);break;case ze.INFO:console.info(''.concat(Ge,' ').concat(t),...n);break;case ze.WARN:console.warn(''.concat(Ge,' ').concat(t),...n);break;case ze.ERROR:console.error(''.concat(Ge,' ').concat(t),...n)}}}debug(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.DEBUG,e,...r)}info(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.INFO,e,...r)}warn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.WARN,e,...r)}error(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.ERROR,e,...r)}}const Ve=je.getInstance();function qe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Te(u(t))}function We(e){return null==e}function Xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return We(e)||''===e?t:('number'!=typeof e&&(e=parseFloat(e)),isNaN(e)||'Infinity'===e.toString()?t:e)}function Ke(){let e=window.__rf_original_search;return e||(e=window.location.search),new URLSearchParams(e)}function Ze(e,t){const r=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.startsWith('http://')||e.startsWith('https://')?e:t?'https://'.concat(e):'http://'.concat(e)}(window.location.host);!function(e,t){if(We(e)||''===e)throw new Error(t)}(r,'Shopify root URL is not defined');const n=new URLSearchParams;t&&Object.entries(t).forEach(e=>{let[t,r]=e;n.set(t,r)});let o=r;return e.startsWith('/')||(o+='/'),o+=e,n.toString()&&(o+='?'.concat(n.toString())),o}async function Ye(e,t){var r;const o=Ze(e,{rf:'true'}),i=await fetch(o,n({method:null!==(r=null==t?void 0:t.method)&&void 0!==r?r:null!=t&&t.body?'POST':'GET',cache:'no-cache',headers:{'Content-Type':'application/json'}},t));if(!i.ok){const e=await i.json();if(e&&'message'in e)throw e;throw new Error('Unknown error')}return await i.json()}function Je(){Fe(Oe),Fe(Ae),Fe(Re),Fe(Le)}function Qe(e){if(!e)return'';const t=e.toString().split('/').pop();return t||''}function $e(e){return r='ProductVariant','string'==typeof(t=e)&&t.startsWith('gid://')?t:'gid://shopify/'.concat(r,'/').concat(t);var t,r}function et(e,t){return e.filter(e=>e.type===t).flatMap(e=>e.products.map(e=>Number(Qe(e.shopifyProductId))))}function tt(e,t){const r=et(t,'NO_EXCHANGE_TO'),o=[],i=[],{items:a,itemCount:s}=(e.items||[]).reduce((e,t)=>{if(r.includes(t.product_id))return o.push(t),e;if(t.has_components)return i.push(t),e;const a=e.items.find(e=>e.variant_id===t.variant_id);return e.itemCount+=t.quantity||0,a?(a.quantity+=t.quantity,e):(e.items.push(n({},t)),e)},{items:[],itemCount:0});return{cart:n(n({},e),{},{items:a,item_count:s}),excludedItems:o,bundleItems:i}}function rt(e){let{cart1:t,cart2:r,rules:n}=e;const{cart:o}=tt(t,n),{cart:i}=tt(r,n),a=o.items||[],s=i.items||[];if(a.length!==s.length)return!1;const l=new Map(a.map(e=>[e.variant_id,e.quantity]));for(const e of s)if(l.get(e.variant_id)!==e.quantity)return!1;return!0}async function nt(){let e,t=!1,r=!1;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){const r=De(Oe);r&&(t=!0,e=r)}if(!e){if(l()){const t=s();t&&(Ve.info('[CartProvider] Using provider.getCart()'),e=await t.getCart(),r=!0)}e||(Ve.info('[CartProvider] No provider, falling back to /cart.js'),e=await Ye('/cart.js')),st(e)}const n=t?'Storage':r?'Provider':'API';return Ve.info('Fetched cart ('.concat(n,')'),e),e}async function ot(){if(l()){const e=s();if(null!=e&&e.clearCart){Ve.info('[CartProvider] Using provider.clearCart()');const t=await e.clearCart();return st(t),t}Ve.info('[CartProvider] Provider exists but clearCart not implemented, falling back to /cart/clear.js')}const e=await Ye('/cart/clear.js',{method:'POST'});return st(e),e}async function it(e){let{variantId:t,quantity:r,isRetry:n=!1}=e;try{if(We(r))throw new Error('Quantity cannot be null or undefined');if(l()){const e=s();if(e){const o=(await nt(!n)).items.find(e=>e.variant_id===t);if(!o)return Ve.warn('[CartProvider] Item with variantId '.concat(t,' not found in cart')),n?(await at(t,r),nt(!1)):(Ve.info('[CartProvider] Retrying with fresh cart data...'),it({variantId:t,quantity:r,isRetry:!0}));const i=o.line_id,a=o.merchandise_id||$e(t);if(!i)return Ve.warn('[CartProvider] No line_id on cart item'),n?(Ve.warn('[CartProvider] Still no line_id after retry, falling back to /cart/change.js'),await at(t,r),nt(!1)):(Ve.info('[CartProvider] Retrying with fresh cart data...'),it({variantId:t,quantity:r,isRetry:!0}));if(0===r&&e.removeItems)Ve.info('[CartProvider] Using provider.removeItems(['.concat(i,'])')),await e.removeItems([i]);else if(e.updateItems){const t={id:i,merchandiseId:a,quantity:r};Ve.info('[CartProvider] Using provider.updateItems()',t),await e.updateItems([t])}else Ve.info('[CartProvider] Provider exists but removeItems/updateItems not implemented, falling back to /cart/change.js'),await at(t,r);return nt(!1)}}return await at(t,r),nt(!1)}catch(e){const t=e;if(Ve.error('Error updating cart item quantity:',t),'status'in t)throw new Error(t.status.toString());throw new Error(t.message)}}async function at(e,t){var r;if(0===t)return void await Ye('/cart/change.js',{body:JSON.stringify({id:String(e),quantity:t})});const n=(await nt()).items||[],o=n.filter(t=>t.variant_id===e).reduce((e,t)=>e+(t.quantity||0),0),i=n.findIndex(t=>t.variant_id===e),a=t-o,s=Xe(null===(r=n[i])||void 0===r?void 0:r.quantity)+a;if(-1!==i){const e={line:String(i+1),quantity:s};await Ye('/cart/change.js',{body:JSON.stringify(e)})}}function st(e){e?Me(Oe,e):Fe(Oe)}function lt(e){return'edges'in e?e.edges.map(e=>e.node):e.map(e=>'node'in e?e.node:e)}function ct(e){const t=parseFloat(e);return Number.isNaN(t)?0:Math.round(100*t)}function ut(e){var t,r,n;if(null!==(t=e.merchandise.image)&&void 0!==t&&t.url)return e.merchandise.image.url;if(null!==(r=e.merchandise.product.featuredImage)&&void 0!==r&&r.url)return e.merchandise.product.featuredImage.url;const o=lt(null!==(n=e.merchandise.product.images)&&void 0!==n?n:[]);return o.length>0?o[0].url:''}function dt(e){var t;const{merchandise:r,quantity:n}=e,{product:o}=r,i=Number(Qe(r.id)),a=Number(Qe(o.id));let s,l;null!==(t=e.cost)&&void 0!==t&&t.amountPerQuantity?(s=ct(e.cost.amountPerQuantity.amount),l=e.cost.totalAmount?ct(e.cost.totalAmount.amount):s*n):r.price?(s=ct(r.price.amount),l=s*n):(s=0,l=0);const c=r.title,u=o.title,d=!c||'Default Title'===c||'Default'===c;return{variant_id:i,quantity:n,title:d?u:''.concat(u,' - ').concat(c),price:s,product_id:a,product_title:u,handle:o.handle,image:ut(e),grams:0,line_price:l,final_price:s,final_line_price:l,line_id:e.id,merchandise_id:r.id,variant_title:d?void 0:c,sku:r.sku,vendor:o.vendor,product_type:o.productType,requires_shipping:r.requiresShipping}}function ht(e){return function(e){if(!('lines'in e))return!1;const t=e.lines;return Array.isArray(t)||null!=t&&'object'==typeof t&&'edges'in t}(e)?function(e){var t,r;const n=lt(e.lines).map(dt),o=null!==(t=e.totalQuantity)&&void 0!==t?t:n.reduce((e,t)=>e+t.quantity,0);return{items:n,item_count:o,token:e.id,note:null!==(r=e.note)&&void 0!==r?r:''}}(e):e}function ft(e){const t=ht(e);return st(t),t}const mt={widgetViewState:null,config:null,returnContext:null,toastContext:null,cartProvider:null,isInitialized:!1,eventListeners:new Map};function pt(){mt.widgetViewState=null,mt.returnContext=null,mt.toastContext=null,mt.config=null,mt.cartProvider=null,mt.isInitialized=!1,mt.eventListeners.clear()}function _t(e){const t=e?function(e){return{async getCart(){const t=await e.getCart();return t?ft(t):void 0},clearCart:async()=>ft(await e.clearCart()),addItems:async t=>ft(await e.addItems(t)),updateItems:async t=>ft(await e.updateItems(t)),removeItems:async t=>ft(await e.removeItems(t))}}(e):null;if(mt.cartProvider=t,'undefined'!=typeof window){const e=window.Returnflows;e&&(e._cartProvider=t)}e?console.info('[RF] Cart provider registered.'):console.info('[RF] Cart provider cleared.')}function gt(){return mt.isInitialized}function vt(e){mt.widgetViewState?mt.widgetViewState.set(e):console.warn('[RF] Widget not initialized. Call init() first.')}async function bt(e){var t,r,n,o,i;const a=null===(t=mt.returnContext)||void 0===t?void 0:t.cartState,s=null===(r=mt.returnContext)||void 0===r?void 0:r.orderState,l=null===(n=mt.returnContext)||void 0===n?void 0:n.calculationState,c=null===(o=mt.config)||void 0===o?void 0:o.data.returnData;if(!a||null==s||!s.value.data)return console.warn('[RF] Widget not initialized or order not loaded.'),{cart:null,calculation:null,hasChanged:!1};const u=s.value.data,d=ht(e),h=u.orderData.productRules||[],f=null===(i=a.value.data)||void 0===i?void 0:i.original;var m;if(f&&rt({cart1:f,cart2:d,rules:h}))return{cart:f,calculation:null!==(m=null==l?void 0:l.value.data)&&void 0!==m?m:null,hasChanged:!1};const{cart:p}=tt(d,h);a.set({data:{original:d,transformed:p},pending:!1,error:null}),st(d),wt('cart:updated',d);const _=await(null==l?void 0:l.query({cart:p,orderId:u.orderData.id,lineItems:(null==c?void 0:c.items)||[]}));return{cart:p,calculation:null!=_?_:null,hasChanged:!0}}function yt(e,t){var r;null===(r=mt.eventListeners.get(e))||void 0===r||r.delete(t)}function wt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const o=mt.eventListeners.get(e);o&&o.forEach(t=>{try{t(...r)}catch(t){console.error('[RF] Error in '.concat(e,' event handler:'),t)}})}const Et=['onReady','onError','cartProvider'];const Nt=new class{constructor(){Object.defineProperty(this,'_initPromise',{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,'_cartProvider',{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,'version',{enumerable:!0,configurable:!0,writable:!0,value:'1.0.3'}),Object.defineProperty(this,'drawer',{enumerable:!0,configurable:!0,writable:!0,value:{open:()=>{this._ensureInitialized(),vt(i.Open)},close:()=>{this._ensureInitialized(),vt(i.Collapsed)},toggle:()=>{this._ensureInitialized();var e,t;vt((null!==(e=null===(t=mt.widgetViewState)||void 0===t?void 0:t.value)&&void 0!==e?e:null)===i.Open?i.Collapsed:i.Open)},isOpen:()=>{return this._ensureInitialized(),(null===(e=mt.widgetViewState)||void 0===e?void 0:e.value)===i.Open;var e}}}),Object.defineProperty(this,'data',{enumerable:!0,configurable:!0,writable:!0,value:{getCart:()=>function(){var e;const t=null===(e=mt.returnContext)||void 0===e?void 0:e.cartState;return null!=t&&t.value.data?t.value.data.original:null}(),getCalculation:()=>{return null!==(e=null===(t=mt.returnContext)||void 0===t?void 0:t.calculationState.value.data)&&void 0!==e?e:null;var e,t},getOrder:()=>function(){var e;const t=null===(e=mt.returnContext)||void 0===e||null===(e=e.orderState.value.data)||void 0===e?void 0:e.orderData;return t?{id:t.id,orderId:t.orderId,orderName:t.orderName,instantExchange:t.instantExchange,freeExchangeLabel:t.freeExchangeLabel,productsToExchange:t.productsToExchange,totalPrice:t.totalPrice}:null}(),isLoading:()=>{return null===(e=null===(t=mt.returnContext)||void 0===t?void 0:t.isPending)||void 0===e||e;var e,t}}}),Object.defineProperty(this,'cart',{enumerable:!0,configurable:!0,writable:!0,value:{setCart:async e=>(this._ensureInitialized(),bt(e)),refetch:async()=>{this._ensureInitialized(),await async function(){var e,t;const r=null===(e=mt.returnContext)||void 0===e?void 0:e.cartState,n=null===(t=mt.returnContext)||void 0===t?void 0:t.orderState;if(r&&null!=n&&n.value.data){if(mt.cartProvider)try{const e=await mt.cartProvider.getCart();if(!e)return;return bt(e)}catch(e){return console.error('[RF] Cart provider getCart failed:',e),void wt('error',e instanceof Error?e:new Error(String(e)))}await r.query(n.value.data)}else console.warn('[RF] Widget not initialized or order not loaded.')}()},clear:async()=>{this._ensureInitialized(),await async function(){var e;if(mt.isInitialized){if(null!==(e=mt.cartProvider)&&void 0!==e&&e.clearCart)try{return bt(await mt.cartProvider.clearCart())}catch(e){return console.error('[RF] Cart provider clearCart failed:',e),void wt('error',e instanceof Error?e:new Error(String(e)))}document.dispatchEvent(new CustomEvent('RF_CART_AND_CALCULATION_REFETCH'))}else console.warn('[RF] Widget not initialized. Call init() first.')}()}}}),Object.defineProperty(this,'toast',{enumerable:!0,configurable:!0,writable:!0,value:{show:e=>(this._ensureInitialized(),function(e){return mt.toastContext?mt.toastContext.add({message:e.message,tone:e.tone,duration:e.duration,onClose:e.onClose}):(console.warn('[RF] Widget not initialized. Call init() first.'),'')}(e)),dismiss:e=>{this._ensureInitialized(),function(e){mt.toastContext?mt.toastContext.remove(e):console.warn('[RF] Widget not initialized.')}(e)},clear:()=>{this._ensureInitialized(),mt.toastContext?mt.toastContext.clear():console.warn('[RF] Widget not initialized.')}}})}async init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._initPromise?(console.warn('[RF] Already initializing. Returning existing promise.'),this._initPromise):gt()?void console.warn('[RF] Already initialized. Call destroy() first to reinitialize.'):(this._initPromise=new Promise((t,r)=>{(async()=>{try{var i;const{onReady:r,onError:s,cartProvider:l}=e,c=o(e,Et);l&&_t(l);const{default:u}=await Promise.resolve().then(()=>Br),{default:d}=await Promise.resolve().then(()=>Ml),{h}=await Promise.resolve().then(()=>_r),f=await u(e=>h(d,e),n({networkInterceptionMethod:'none'},c));if(!f.success){var a;if('CONTAINER_EXISTS'===f.reason)return await this._waitForBridge(),null===(a=e.onReady)||void 0===a||a.call(e),t();if('MISSING_SESSION_ID'===f.reason)return this._initPromise=null,t();throw new Error('Widget initialization failed: '.concat(f.message,' (').concat(f.reason,')'))}await this._waitForBridge(),null===(i=e.onReady)||void 0===i||i.call(e),t()}catch(t){var s;const n=t instanceof Error?t:new Error(String(t));null===(s=e.onError)||void 0===s||s.call(e,n),_t(null),this._initPromise=null,r(n)}})()}),this._initPromise)}destroy(){if(_t(null),pt(),'undefined'!=typeof document){const e=document.getElementById('rf-overlay-widget');e&&e.remove()}this._initPromise=null}isInitialized(){return gt()}on(e,t){return function(e,t){mt.eventListeners.has(e)||mt.eventListeners.set(e,new Set),mt.eventListeners.get(e).add(t)}(e,t),()=>yt(e,t)}off(e,t){yt(e,t)}_ensureInitialized(){if(!gt())throw new Error('[RF] Widget not initialized. Call init() first.')}async _waitForBridge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;const t=Date.now();for(;!gt();){if(Date.now()-t>e)throw new Error('[RF] Initialization timeout');await new Promise(e=>setTimeout(e,50))}}};'undefined'!=typeof window&&(window.Returnflows=Nt);var xt,kt,Ct,St,Tt,It,At,Pt,Rt,Ht,Ot,Lt,Bt,Mt={},Dt=[],Ft=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ut=Array.isArray;function Gt(e,t){for(var r in t)e[r]=t[r];return e}function zt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function jt(e,t,r){var n,o,i,a={};for(i in t)'key'==i?n=t[i]:'ref'==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?xt.call(arguments,2):r),'function'==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return Vt(e,a,n,o,null)}function Vt(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ct,__i:-1,__u:0};return null==o&&null!=kt.vnode&&kt.vnode(i),i}function qt(e){return e.children}function Wt(e,t){this.props=e,this.context=t}function Xt(e,t){if(null==t)return e.__?Xt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return'function'==typeof e.type?Xt(e):null}function Kt(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],o=[],i=Gt({},t);i.__v=t.__v+1,kt.vnode&&kt.vnode(i),ir(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??Xt(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,sr(n,i,o),t.__e=t.__=null,i.__e!=r&&Zt(i)}}function Zt(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(t=>{if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Zt(e)}function Yt(e){(!e.__d&&(e.__d=!0)&&Tt.push(e)&&!Jt.__r++||It!=kt.debounceRendering)&&((It=kt.debounceRendering)||At)(Jt)}function Jt(){for(var e,t=1;Tt.length;)Tt.length>t&&Tt.sort(Pt),e=Tt.shift(),t=Tt.length,Kt(e);Jt.__r=0}function Qt(e,t,r,n,o,i,a,s,l,c,u){var d,h,f,m,p,_,g,v=n&&n.__k||Dt,b=t.length;for(l=function(e,t,r,n,o){var i,a,s,l,c,u=r.length,d=u,h=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&'boolean'!=typeof a&&'function'!=typeof a?('string'==typeof a||'number'==typeof a||'bigint'==typeof a||a.constructor==String?a=e.__k[i]=Vt(null,a,null,null,null):Ut(a)?a=e.__k[i]=Vt(qt,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=Vt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(c=a.__i=tr(a,r,l,d))&&(d--,(s=r[c])&&(s.__u|=2)),null==s||null==s.__v?(-1==c&&(o>u?h--:o<u&&h++),'function'!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)null!=(s=r[i])&&!(2&s.__u)&&(s.__e==n&&(n=Xt(s)),dr(s,s));return n}(r,t,v,l,b),d=0;d<b;d++)null!=(f=r.__k[d])&&(h=-1!=f.__i&&v[f.__i]||Mt,f.__i=d,_=ir(e,f,h,o,i,a,s,l,c,u),m=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ur(h.ref,null,f),u.push(f.ref,f.__c||m,f)),null==p&&null!=m&&(p=m),(g=!!(4&f.__u))||h.__k===f.__k?l=$t(f,l,e,g):'function'==typeof f.type&&void 0!==_?l=_:m&&(l=m.nextSibling),f.__u&=-7);return r.__e=p,l}function $t(e,t,r,n){var o,i;if('function'==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=$t(o[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Xt(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function er(e,t){return t=t||[],null==e||'boolean'==typeof e||(Ut(e)?e.some(e=>{er(e,t)}):t.push(e)),t}function tr(e,t,r,n){var o,i,a,s=e.key,l=e.type,c=t[r],u=null!=c&&!(2&c.__u);if(null===c&&null==s||u&&s==c.key&&l==c.type)return r;if(n>(u?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;)if(null!=(c=t[a=o>=0?o--:i++])&&!(2&c.__u)&&s==c.key&&l==c.type)return a;return-1}function rr(e,t,r){'-'==t[0]?e.setProperty(t,r??''):e[t]=null==r?'':'number'!=typeof r||Ft.test(t)?r:r+'px'}function nr(e,t,r,n,o){var i,a;e:if('style'==t)if('string'==typeof r)e.style.cssText=r;else{if('string'==typeof n&&(e.style.cssText=n=''),n)for(t in n)r&&t in r||rr(e.style,t,'');if(r)for(t in r)n&&r[t]==n[t]||rr(e.style,t,r[t])}else if('o'==t[0]&&'n'==t[1])i=t!=(t=t.replace(Rt,'$1')),a=t.toLowerCase(),t=a in e||'onFocusOut'==t||'onFocusIn'==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Ht,e.addEventListener(t,i?Lt:Ot,i)):e.removeEventListener(t,i?Lt:Ot,i);else{if('http://www.w3.org/2000/svg'==o)t=t.replace(/xlink(H|:h)/,'h').replace(/sName$/,'s');else if('width'!=t&&'height'!=t&&'href'!=t&&'list'!=t&&'form'!=t&&'tabIndex'!=t&&'download'!=t&&'rowSpan'!=t&&'colSpan'!=t&&'role'!=t&&'popover'!=t&&t in e)try{e[t]=r??'';break e}catch(e){}'function'==typeof r||(null==r||!1===r&&'-'!=t[4]?e.removeAttribute(t):e.setAttribute(t,'popover'==t&&1==r?'':r))}}function or(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=Ht++;else if(t.t<r.u)return;return r(kt.event?kt.event(t):t)}}}function ir(e,t,r,n,o,i,a,s,l,c){var u,d,h,f,m,p,_,g,v,b,y,w,E,N,x,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=t.__e=r.__e]),(u=kt.__b)&&u(t);e:if('function'==typeof k)try{if(g=t.props,v='prototype'in k&&k.prototype.render,b=(u=k.contextType)&&n[u.__c],y=u?b?b.props.value:u.__:n,r.__c?_=(d=t.__c=r.__c).__=d.__E:(v?t.__c=d=new k(g,y):(t.__c=d=new Wt(g,y),d.constructor=k,d.render=hr),b&&b.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),v&&null==d.__s&&(d.__s=d.state),v&&null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Gt({},d.__s)),Gt(d.__s,k.getDerivedStateFromProps(g,d.__s))),f=d.props,m=d.state,d.__v=t,h)v&&null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),v&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(v&&null==k.getDerivedStateFromProps&&g!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(g,y),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(g,d.__s,y)){t.__v!=r.__v&&(d.props=g,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(e=>{e&&(e.__=t)}),Dt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(g,d.__s,y),v&&null!=d.componentDidUpdate&&d.__h.push(()=>{d.componentDidUpdate(f,m,p)})}if(d.context=y,d.props=g,d.__P=e,d.__e=!1,w=kt.__r,E=0,v)d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),Dt.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++E<25);d.state=d.__s,null!=d.getChildContext&&(n=Gt(Gt({},n),d.getChildContext())),v&&!h&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(f,m)),N=null!=u&&u.type===qt&&null==u.key?lr(u.props.children):u,s=Qt(e,Ut(N)?N:[N],t,r,n,o,i,a,s,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),_&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=i)if(e.then){for(t.__u|=l?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(x=i.length;x--;)zt(i[x]);ar(t)}else t.__e=r.__e,t.__k=r.__k,e.then||ar(t);kt.__e(e,t,r)}else null==i&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=cr(r.__e,t,r,n,o,i,a,l,c);return(u=kt.diffed)&&u(t),128&t.__u?void 0:s}function ar(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ar))}function sr(e,t,r){for(var n=0;n<r.length;n++)ur(r[n],r[++n],r[++n]);kt.__c&&kt.__c(t,e),e.some(t=>{try{e=t.__h,t.__h=[],e.some(e=>{e.call(t)})}catch(e){kt.__e(e,t.__v)}})}function lr(e){return'object'!=typeof e||null==e||e.__b>0?e:Ut(e)?e.map(lr):Gt({},e)}function cr(e,t,r,n,o,i,a,s,l){var c,u,d,h,f,m,p,_=r.props||Mt,g=t.props,v=t.type;if('svg'==v?o='http://www.w3.org/2000/svg':'math'==v?o='http://www.w3.org/1998/Math/MathML':o||(o='http://www.w3.org/1999/xhtml'),null!=i)for(c=0;c<i.length;c++)if((f=i[c])&&'setAttribute'in f==!!v&&(v?f.localName==v:3==f.nodeType)){e=f,i[c]=null;break}if(null==e){if(null==v)return document.createTextNode(g);e=document.createElementNS(o,v,g.is&&g),s&&(kt.__m&&kt.__m(t,i),s=!1),i=null}if(null==v)_===g||s&&e.data==g||(e.data=g);else{if(i=i&&xt.call(e.childNodes),!s&&null!=i)for(_={},c=0;c<e.attributes.length;c++)_[(f=e.attributes[c]).name]=f.value;for(c in _)f=_[c],'dangerouslySetInnerHTML'==c?d=f:'children'==c||c in g||'value'==c&&'defaultValue'in g||'checked'==c&&'defaultChecked'in g||nr(e,c,null,f,o);for(c in g)f=g[c],'children'==c?h=f:'dangerouslySetInnerHTML'==c?u=f:'value'==c?m=f:'checked'==c?p=f:s&&'function'!=typeof f||_[c]===f||nr(e,c,f,_[c],o);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=''),Qt('template'==t.type?e.content:e,Ut(h)?h:[h],t,r,n,'foreignObject'==v?'http://www.w3.org/1999/xhtml':o,i,a,i?i[0]:r.__k&&Xt(r,0),s,l),null!=i)for(c=i.length;c--;)zt(i[c]);s||(c='value','progress'==v&&null==m?e.removeAttribute('value'):null!=m&&(m!==e[c]||'progress'==v&&!m||'option'==v&&m!=_[c])&&nr(e,c,m,_[c],o),c='checked',null!=p&&p!=e[c]&&nr(e,c,p,_[c],o))}return e}function ur(e,t,r){try{if('function'==typeof e){var n='function'==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){kt.__e(e,r)}}function dr(e,t,r){var n,o;if(kt.unmount&&kt.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ur(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){kt.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&dr(n[o],t,r||'function'!=typeof e.type);r||zt(e.__e),e.__c=e.__=e.__e=void 0}function hr(e,t,r){return this.constructor(e,r)}function fr(e,t,r){var n,o,i,a;t==document&&(t=document.documentElement),kt.__&&kt.__(e,t),o=(n='function'==typeof r)?null:r&&r.__k||t.__k,i=[],a=[],ir(t,e=(!n&&r||t).__k=jt(qt,null,[e]),o||Mt,Mt,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?xt.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),sr(i,e,a)}function mr(e,t,r){var n,o,i,a,s=Gt({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)'key'==i?n=t[i]:'ref'==i?o=t[i]:s[i]=void 0===t[i]&&null!=a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?xt.call(arguments,2):r),Vt(e.type,s,n||e.key,o||e.ref,null)}function pr(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=()=>n,this.componentWillUnmount=()=>{r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(e=>{e.__e=!0,Yt(e)})},this.sub=e=>{r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=()=>{r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c='__cC'+Bt++,t.__=e,t.Provider=t.__l=(t.Consumer=(e,t)=>e.children(t)).contextType=t,t}xt=Dt.slice,kt={__e:(e,t,r,n)=>{for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},Ct=0,St=e=>null!=e&&void 0===e.constructor,Wt.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Gt({},this.state),'function'==typeof e&&(e=e(Gt({},r),this.props)),e&&Gt(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Yt(this))},Wt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Yt(this))},Wt.prototype.render=qt,Tt=[],At='function'==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pt=(e,t)=>e.__v.__b-t.__v.__b,Jt.__r=0,Rt=/(PointerCapture)$|Capture$/i,Ht=0,Ot=or(!1),Lt=or(!0),Bt=0;var _r=Object.freeze({__proto__:null,Component:Wt,Fragment:qt,cloneElement:mr,createContext:pr,createElement:jt,createRef:function(){return{current:null}},h:jt,hydrate:function e(t,r){fr(t,r,e)},get isValidElement(){return St},get options(){return kt},render:fr,toChildArray:er});function gr(e,t){let r;try{var n;r=null===(n=process.env)||void 0===n?void 0:n[e]}catch(t){var o;r=null===(o=import.meta.env)||void 0===o?void 0:o[e]}return null!=r||(r=t),r}const vr=gr('VITE_API_URL','http://localhost:8080'),br=gr('VITE_PLATFORM_URL','http://localhost:3000'),yr=gr('VITE_WIDGET_BASE_URL','http://localhost:3334'),wr='rflowsId',Er=['lineItems','slug','locale','currency'],Nr='root',xr='rf-overlay-widget';var kr,Cr;(e=>{e.FetchInterception='RF_FETCH_INTERCEPTION',e.XHRInterception='RF_XHR_INTERCEPTION',e.DrawerStateChange='RF_DRAWER_STATE_CHANGE',e.WidgetInitialization='RF_WIDGET_INITIALIZATION'})(kr||(kr={})),(e=>{e.DrawerOpen='RF_DRAWER_OPEN',e.DrawerClose='RF_DRAWER_CLOSE',e.DrawerToggle='RF_DRAWER_TOGGLE',e.CalculationRefetch='RF_CALCULATION_REFETCH',e.CartRefetch='RF_CART_REFETCH',e.CartAndCalculationRefetch='RF_CART_AND_CALCULATION_REFETCH',e.DrawerOpenAndRefetch='RF_DRAWER_OPEN_AND_REFETCH'})(Cr||(Cr={}));const Sr={subscribe:function(e,t){const r=e=>t(e);return document.addEventListener(e,r),()=>{document.removeEventListener(e,r)}},publish:function(e){const t=new CustomEvent(e,{detail:arguments.length<=1?void 0:arguments[1]});document.dispatchEvent(t)},unsubscribe:function(e,t){document.removeEventListener(e,t)}},Tr='en';const Ir=['clientStorage'];async function Ar(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{clientStorage:r}=t,i=o(t,Ir);const a=!!r;if(a&&!1!==r.shouldUseCachedResult){const{key:e,type:t,logging:n}=r,o=De({key:e,type:t});if(o)return!1!==n&&Ve.info('Using cached data for '.concat(e,' from ').concat(t)),o}const s=new URL(''.concat(vr).concat(e));null!=i&&i.params&&(i.params instanceof URLSearchParams?s.search=i.params.toString():Object.entries(i.params).forEach(e=>{let[t,r]=e;s.searchParams.set(t,String(r))}));const l=await fetch(s.toString(),n(n({},i),{},{body:null!=i&&i.body?JSON.stringify(i.body):void 0,headers:n({'Content-Type':'application/json'},null==i?void 0:i.headers)})),c=await async function(e){try{return await e.json()}catch(e){throw Ve.error('Error parsing JSON response:',e),new Error('Failed to parse JSON response')}}(l);if(!c||c.error||!1===c.success){const e=(null==c?void 0:c.error)||(null==c?void 0:c.message)||'Error fetching calculation data';throw new Error(e)}if(a&&!1!==r.storeResult){const{key:e,type:t,expiration:n}=r;Me({key:e,type:t,expiration:n},c.responseObject)}return c.responseObject}async function Pr(e){var t,r;let{isFirstLoad:n,options:{clearCartOnStart:o},id:i,data:a}=e,c=null;if(n){var u;const e=null!==(u=a.returnItems)&&void 0!==u?u:[];if(e.length>0){const t=e.map(e=>({id:e.variantId,quantity:e.quantity}));Ve.info('Setting cart items from cached return items on initialization.',t),c=await async function(e){const t=await ot();if(0===e.length)return t;if(l()){const t=s();if(null!=t&&t.addItems){const r=e.map(e=>({merchandiseId:$e(e.id),quantity:e.quantity}));Ve.info('[CartProvider] Using provider.addItems() (setCartItems)',r);const n=await t.addItems(r);return st(n),n}Ve.info('[CartProvider] Provider exists but addItems not implemented, falling back to /cart/add.js')}return await Ye('/cart/add.js',{method:'POST',body:JSON.stringify({items:e})}),nt(!1)}(t)}else o&&(Ve.info('Clearing cart on initialization as per configuration.'),c=await ot());st(c);const t=(new Date).getTime()+He;Me(Re,t);const r=new URL(window.location.href);r.searchParams.delete(wr),Er.forEach(e=>{r.searchParams.delete(e)}),window.history.replaceState(null,'',r)}Me(Ae,i);const d=null!==(t=null===(r=a.returnData)||void 0===r||null===(r=r.items)||void 0===r?void 0:r.map(e=>e.id).join(','))&&void 0!==t?t:'',h=await async function(e,t,r){const n=''.concat(t,'_').concat(r);return await Ar('/shop-overlay',{params:{internalId:t,orderLines:r},clientStorage:{shouldUseCachedResult:!e,key:n,type:'sessionStorage'}})}(n,i,d);return{orderData:h,updatedCart:c}}function Rr(e){const t={};return Object.entries(e).forEach(e=>{let[r,n]=e;if(We(n))return n;let o=n;if('true'===n)o=!0;else if('false'===n)o=!1;else if(function(e){return'number'==typeof e||!isNaN(Number(e))&&isFinite(Number(e))}(n))o=Number(n);else if('null'===n)o=null;else if('undefined'===n)o=void 0;else try{o=JSON.parse(n)}catch(e){}t[r]=o}),t}async function Hr(e){var t,r;const o=(i=e,'undefined'!=typeof DOMStringMap&&i instanceof DOMStringMap||'[object DOMStringMap]'===Object.prototype.toString.call(i)?Rr(e):e);var i;const a=function(){const e=document.getElementById('rf-settings-json');if(!e)return null;try{return JSON.parse(e.innerHTML)}catch(e){return Ve.error('Failed to parse widget settings JSON',e),null}}(),s=Ke(),l=s.get(wr),c=Boolean(l),u=l||De(Ae);if(!u){const e='Session ID is missing from URL and storage';return Ve.warn(e),{success:!1,reason:'MISSING_SESSION_ID',message:e}}const d=await async function(e){if(!e)return null;try{return await Ar('/shop-overlay/session/'.concat(e))}catch(e){return Ve.error('Error getting session cache:',e),null}}(u);if(!d){const e='No session cache found for id: '.concat(u);return Ve.warn(e),{success:!1,reason:'SESSION_NOT_FOUND',message:e}}const h=d.data.currency||o.defaultCurrency||'DKK',f='development'===o.env||'test'===o.env,m='true'===s.get('debug'),p=De(Le);(f||m)&&Me(Le,!0);const _=Boolean(null!=p?p:f||m),g=[d.data.locale,o.defaultLocale,Tr].filter(e=>void 0!==e),{locale:v,messages:b}=await async function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t.length>0?t:[Tr];for(const e of n)try{const t=await fetch(''.concat(yr,'/messages/').concat(e,'.json'));if(t.ok)return{messages:await t.json(),locale:e}}catch(t){Ve.error('Error loading messages for locale '.concat(e,':'),t)}throw new Error('No messages found for any of the locales: '.concat(n.join(', ')))}(...g),y=null==a||null===(t=a.translations)||void 0===t?void 0:t.messages;y&&(Ve.info('Merging custom translations into messages...'),Object.entries(y).forEach(e=>{let[t,r]=e;!function(e,t,r){const n=t.split('.'),o=n.pop();if(!o)throw new Error('Invalid path');n.reduce((e,r)=>{if(e&&'object'==typeof e&&r in e){const t=e[r];if(t&&'object'==typeof t)return t}throw new Error('Cannot access property \''.concat(r,'\' on path \'').concat(t,'\''))},e)[o]=r}(b,t,r)}));return{success:!0,config:n({locale:v,currency:h,debugMode:_,isFirstLoad:c,messages:b,options:o,theme:null!==(r=null==a?void 0:a.theme)&&void 0!==r?r:null},d)}}function Or(e){const t=Object.entries(e).filter(e=>{let[t,r]=e;return'string'==typeof r||'number'==typeof r}).map(e=>{let[t,r]=e;return'['.concat(t,'="').concat(r,'"]')}).join(''),r=document.querySelector('link'.concat(t));if(r)return Ve.warn('Link element with attributes '.concat(JSON.stringify(e),' already exists.')),r;const n=document.createElement('link');return Object.assign(n,e),document.head.appendChild(n),n}function Lr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.head;if(!e)return;if(!function(e){return(e.match(/{/g)||[]).length===(e.match(/}/g)||[]).length&&![/javascript:/gi,/expression\s*\(/gi,/behavior\s*:/gi,/binding\s*:/gi,/@import.*url\s*\(\s*["']?javascript:/gi].some(t=>t.test(e))}(e))throw new Error('Invalid CSS detected. Please check your CSS syntax and remove any dangerous patterns.');const r=document.createElement('style');return r.setAttribute('data-'.concat('rf-custom-css'),'true'),r.textContent=e,Ve.info('Injecting custom CSS...'),t.appendChild(r),r}var Br=Object.freeze({__proto__:null,default:async function(e,t){try{const r=await Hr(t);if(!r.success)return r;const n=function(){if(document.getElementById(xr))return{success:!1,reason:'CONTAINER_EXISTS',message:'Container with ID "'.concat(xr,'" already exists')};const e=document.createElement('div');e.id=xr,e.style.display='block';const t=e.attachShadow({mode:'closed'}),r=document.createElement('div');return r.className='rf-container',r.id='shadow-root',r.style.display='none',t.appendChild(r),{success:!0,value:[e,r]}}();if(!n.success)return n;const[o,i]=n.value,{config:a}=r,{options:{customCssOverlay:s,customCssPage:l}}=a;return function(e){const t=document.createElement('link');t.rel='stylesheet';const r=gr('WIDGET_NAME')||'widget';t.href=''.concat(yr,'/').concat(r,'.css'),t.onload=()=>{Ve.info('Stylesheet loaded successfully')},e.appendChild(t)}(i),function(){const e=document.createElement('link');e.rel='stylesheet',e.href=''.concat(yr,'/variables.css'),e.onload=()=>{Ve.info('Public CSS variables loaded successfully')},e.onerror=()=>{Ve.warn('Failed to load public CSS variables')},document.head.appendChild(e)}(),new Promise((e,t)=>{const r=Or({rel:'preconnect',href:'https://fonts.googleapis.com'}),n=Or({rel:'preconnect',href:'https://fonts.gstatic.com',crossOrigin:'anonymous'}),o=Or({rel:'stylesheet',href:'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'});o.onload=()=>{Ve.info('Font stylesheet loaded successfully'),e([r,n,o])},o.onerror=()=>{Ve.error('Failed to load font stylesheet'),t(new Error('Failed to load font stylesheet'))},document.head.appendChild(o)}),Lr(l),Lr(s,i),function(e,t,r){Ve.info('Injecting widget with options...',r),fr(e(r),t)}(e,i,a),document.body.appendChild(o),Sr.publish(kr.WidgetInitialization,a),{success:!0,config:a}}catch(e){const t=e instanceof Error?e.message:String(e);return Ve.error('Initialization failed',e),{success:!1,reason:'UNKNOWN_ERROR',message:t}}}}),Mr=0;function Dr(e,t,r,n,o,i){t||(t={});var a,s,l=t;if('ref'in l)for(s in l={},t)'ref'==s?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mr,__i:-1,__u:0,__source:o,__self:i};if('function'==typeof e&&(a=e.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return kt.vnode&&kt.vnode(c),c}function Fr(e,t){const r=t&&t.cache?t.cache:Wr,n=t&&t.serializer?t.serializer:Vr;return(t&&t.strategy?t.strategy:jr)(e,{cache:r,serializer:n})}function Ur(e,t,r,n){const o=null==(i=n)||'number'==typeof i||'boolean'==typeof i?n:r(n);var i;let a=t.get(o);return void 0===a&&(a=e.call(this,n),t.set(o,a)),a}function Gr(e,t,r){const n=Array.prototype.slice.call(arguments,3),o=r(n);let i=t.get(o);return void 0===i&&(i=e.apply(this,n),t.set(o,i)),i}function zr(e,t,r,n,o){return r.bind(t,e,n,o)}function jr(e,t){return zr(e,this,1===e.length?Ur:Gr,t.cache.create(),t.serializer)}const Vr=function(){return JSON.stringify(arguments)};class qr{constructor(){e(this,'cache',void 0),this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Wr={create:function(){return new qr}},Xr={variadic:function(e,t){return zr(e,this,Gr,t.cache.create(),t.serializer)}};let Kr=class extends Error{constructor(e,t){let r=e;t&&(r+=': '+t),super(r),this.code=e,t&&(this.originalMessage=t)}};var Zr=(e=>(e.MISSING_MESSAGE='MISSING_MESSAGE',e.MISSING_FORMAT='MISSING_FORMAT',e.ENVIRONMENT_FALLBACK='ENVIRONMENT_FALLBACK',e.INSUFFICIENT_PATH='INSUFFICIENT_PATH',e.INVALID_MESSAGE='INVALID_MESSAGE',e.INVALID_KEY='INVALID_KEY',e.FORMATTING_ERROR='FORMATTING_ERROR',e))(Zr||{});function Yr(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function Jr(e,t){return Fr(e,{cache:(r=t,{create:()=>({get:e=>r[e],set(e,t){r[e]=t}})}),strategy:Xr.variadic});var r}function Qr(e,t){return Jr(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new e(...r)},t)}function $r(e){return{getDateTimeFormat:Qr(Intl.DateTimeFormat,e.dateTime),getNumberFormat:Qr(Intl.NumberFormat,e.number),getPluralRules:Qr(Intl.PluralRules,e.pluralRules),getRelativeTimeFormat:Qr(Intl.RelativeTimeFormat,e.relativeTime),getListFormat:Qr(Intl.ListFormat,e.list),getDisplayNames:Qr(Intl.DisplayNames,e.displayNames)}}var en,tn,rn,nn,on=0,an=[],sn=kt,ln=sn.__b,cn=sn.__r,un=sn.diffed,dn=sn.__c,hn=sn.unmount,fn=sn.__;function mn(e,t){sn.__h&&sn.__h(tn,e,on||t),on=0;var r=tn.__H||(tn.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function pn(e){return on=1,function(e,t,r){var n=mn(en++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Sn(void 0,t),e=>{var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=tn,!tn.__f)){var o=function(e,t,r){if(!n.__c.__H)return!0;var o=n.__c.__H.__.filter(e=>e.__c);if(o.every(e=>!e.__N))return!i||i.call(this,e,t,r);var a=n.__c.props!==e;return o.some(e=>{if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),i&&i.call(this,e,t,r)||a};tn.__f=!0;var i=tn.shouldComponentUpdate,a=tn.componentWillUpdate;tn.componentWillUpdate=function(e,t,r){if(this.__e){var n=i;i=void 0,o(e,t,r),i=n}a&&a.call(this,e,t,r)},tn.shouldComponentUpdate=o}return n.__N||n.__}(Sn,e)}function _n(e,t){var r=mn(en++,3);!sn.__s&&Cn(r.__H,t)&&(r.__=e,r.u=t,tn.__H.__h.push(r))}function gn(e){return on=5,vn(()=>({current:e}),[])}function vn(e,t){var r=mn(en++,7);return Cn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function bn(e,t){return on=8,vn(()=>e,t)}function yn(e){var t=tn.context[e.__c],r=mn(en++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(tn)),t.props.value):e.__}function wn(){for(var e;e=an.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(xn),t.__h.some(kn),t.__h=[]}catch(r){t.__h=[],sn.__e(r,e.__v)}}}sn.__b=e=>{tn=null,ln&&ln(e)},sn.__=(e,t)=>{e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),fn&&fn(e,t)},sn.__r=e=>{cn&&cn(e),en=0;var t=(tn=e.__c).__H;t&&(rn===tn?(t.__h=[],tn.__h=[],t.__.some(e=>{e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(xn),t.__h.some(kn),t.__h=[],en=0)),rn=tn},sn.diffed=e=>{un&&un(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==an.push(t)&&nn===sn.requestAnimationFrame||((nn=sn.requestAnimationFrame)||Nn)(wn)),t.__H.__.some(e=>{e.u&&(e.__H=e.u),e.u=void 0})),rn=tn=null},sn.__c=(e,t)=>{t.some(e=>{try{e.__h.some(xn),e.__h=e.__h.filter(e=>!e.__||kn(e))}catch(r){t.some(e=>{e.__h&&(e.__h=[])}),t=[],sn.__e(r,e.__v)}}),dn&&dn(e,t)},sn.unmount=e=>{hn&&hn(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(e=>{try{xn(e)}catch(e){t=e}}),r.__H=void 0,t&&sn.__e(t,r.__v))};var En='function'==typeof requestAnimationFrame;function Nn(e){var t,r=()=>{clearTimeout(n),En&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);En&&(t=requestAnimationFrame(r))}function xn(e){var t=tn,r=e.__c;'function'==typeof r&&(e.__c=void 0,r()),tn=t}function kn(e){var t=tn;e.__c=e.__(),tn=t}function Cn(e,t){return!e||e.length!==t.length||t.some((t,r)=>t!==e[r])}function Sn(e,t){return'function'==typeof t?t(e):t}function Tn(e,t){for(var r in e)if('__source'!==r&&!(r in t))return!0;for(var n in t)if('__source'!==n&&e[n]!==t[n])return!0;return!1}function In(e,t){this.props=e,this.context=t}function An(e,t){function r(e){var r=this.props.ref,n=r==e.ref;return!n&&r&&(r.call?r(null):r.current=null),t?!t(this.props,e)||!n:Tn(this.props,e)}function n(t){return this.shouldComponentUpdate=r,jt(e,t)}return n.displayName='Memo('+(e.displayName||e.name)+')',n.prototype.isReactComponent=!0,n.__f=!0,n.type=e,n}(In.prototype=new Wt).isPureReactComponent=!0,In.prototype.shouldComponentUpdate=function(e,t){return Tn(this.props,e)||Tn(this.state,t)};var Pn=kt.__b;kt.__b=e=>{e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pn&&Pn(e)};var Rn=kt.__e;kt.__e=(e,t,r,n)=>{if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t);Rn(e,t,r,n)};var Hn=kt.unmount;function On(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(e=>{'function'==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(e=>On(e,t,r))),e}function Ln(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(e=>Ln(e,t,r)),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Bn(){this.__u=0,this.o=null,this.__b=null}function Mn(e){if(!e.__)return null;var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Dn(){this.i=null,this.l=null}kt.unmount=e=>{var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Hn&&Hn(e)},(Bn.prototype=new Wt).__c=function(e,t){var r=t.__c,n=this;null==n.o&&(n.o=[]),n.o.push(r);var o=Mn(n.__v),i=!1,a=()=>{i||n.__z||(i=!0,r.__R=null,o?o(l):l())};r.__R=a;var s=r.__P;r.__P=null;var l=()=>{if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=Ln(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.o.pop();)t.__P=s,t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Bn.prototype.componentWillUnmount=function(){this.o=[]},Bn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement('div'),n=this.__v.__k[0].__c;this.__v.__k[0]=On(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&jt(qt,null,e.fallback);return o&&(o.__u&=-33),[jt(qt,null,t.__a?null:e.children),o]};var Fn=(e,t,r)=>{if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&('t'!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function Un(e){return this.getChildContext=()=>e.context,e.children}function Gn(e){var t=this,r=e.h;if(t.componentWillUnmount=()=>{fr(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:()=>!0,namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}fr(jt(Un,{context:t.context},e.__v),t.v)}(Dn.prototype=new Wt).__a=function(e){var t=this,r=Mn(t.__v),n=t.l.get(e);return n[0]++,o=>{var i=()=>{t.props.revealOrder?(n.push(o),Fn(t,e,n)):o()};r?r(i):i()}},Dn.prototype.render=function(e){this.i=null,this.l=new Map;var t=er(e.children);e.revealOrder&&'b'===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Dn.prototype.componentDidUpdate=Dn.prototype.componentDidMount=function(){var e=this;this.l.forEach((t,r)=>{Fn(e,r,t)})};var zn='undefined'!=typeof Symbol&&Symbol.for&&Symbol.for('react.element')||60103,jn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Vn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,qn=/[A-Z0-9]/g,Wn='undefined'!=typeof document,Xn=e=>('undefined'!=typeof Symbol&&'symbol'==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e);Wt.prototype.isReactComponent={},['componentWillMount','componentWillReceiveProps','componentWillUpdate'].forEach(function(e){Object.defineProperty(Wt.prototype,e,{configurable:!0,get:function(){return this['UNSAFE_'+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Kn=kt.event;function Zn(){}function Yn(){return this.cancelBubble}function Jn(){return this.defaultPrevented}kt.event=e=>(Kn&&(e=Kn(e)),e.persist=Zn,e.isPropagationStopped=Yn,e.isDefaultPrevented=Jn,e.nativeEvent=e);var Qn={enumerable:!1,configurable:!0,get:function(){return this.class}},$n=kt.vnode;kt.vnode=e=>{'string'==typeof e.type&&(e=>{var t=e.props,r=e.type,n={},o=-1===r.indexOf('-');for(var i in t){var a=t[i];if(!('value'===i&&'defaultValue'in t&&null==a||Wn&&'children'===i&&'noscript'===r||'class'===i||'className'===i)){var s=i.toLowerCase();'defaultValue'===i&&'value'in t&&null==t.value?i='value':'download'===i&&!0===a?a='':'translate'===s&&'no'===a?a=!1:'o'===s[0]&&'n'===s[1]?'ondoubleclick'===s?i='ondblclick':'onchange'!==s||'input'!==r&&'textarea'!==r||Xn(t.type)?'onfocus'===s?i='onfocusin':'onblur'===s?i='onfocusout':Vn.test(i)&&(i=s):s=i='oninput':o&&jn.test(i)?i=i.replace(qn,'-$&').toLowerCase():null===a&&(a=void 0),'oninput'===s&&n[i=s]&&(i='oninputCapture'),n[i]=a}}'select'==r&&n.multiple&&Array.isArray(n.value)&&(n.value=er(t.children).forEach(e=>{e.props.selected=-1!=n.value.indexOf(e.props.value)})),'select'==r&&null!=n.defaultValue&&(n.value=er(t.children).forEach(e=>{e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value})),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,'className',Qn)):t.className&&(n.class=n.className=t.className),e.props=n})(e),e.$$typeof=zn,$n&&$n(e)};var eo=kt.__r;kt.__r=e=>{eo&&eo(e),e.__c};var to=kt.diffed;function ro(e){return!!e&&e.$$typeof===zn}function no(e){return ro(e)?mr.apply(null,arguments):e}kt.diffed=e=>{to&&to(e);var t=e.props,r=e.__e;null!=r&&'textarea'===e.type&&'value'in t&&t.value!==r.value&&(r.value=null==t.value?'':t.value)};const oo=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function io(e){const t={};return e.replace(oo,e=>{const r=e.length;switch(e[0]){case'G':t.era=4===r?'long':5===r?'narrow':'short';break;case'y':t.year=2===r?'2-digit':'numeric';break;case'Y':case'u':case'U':case'r':throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');case'q':case'Q':throw new RangeError('`q/Q` (quarter) patterns are not supported');case'M':case'L':t.month=['numeric','2-digit','short','long','narrow'][r-1];break;case'w':case'W':throw new RangeError('`w/W` (week) patterns are not supported');case'd':t.day=['numeric','2-digit'][r-1];break;case'D':case'F':case'g':throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');case'E':t.weekday=4===r?'long':5===r?'narrow':'short';break;case'e':if(r<4)throw new RangeError('`e..eee` (weekday) patterns are not supported');t.weekday=['short','long','narrow','short'][r-4];break;case'c':if(r<4)throw new RangeError('`c..ccc` (weekday) patterns are not supported');t.weekday=['short','long','narrow','short'][r-4];break;case'a':t.hour12=!0;break;case'b':case'B':throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');case'h':t.hourCycle='h12',t.hour=['numeric','2-digit'][r-1];break;case'H':t.hourCycle='h23',t.hour=['numeric','2-digit'][r-1];break;case'K':t.hourCycle='h11',t.hour=['numeric','2-digit'][r-1];break;case'k':t.hourCycle='h24',t.hour=['numeric','2-digit'][r-1];break;case'j':case'J':case'C':throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');case'm':t.minute=['numeric','2-digit'][r-1];break;case's':t.second=['numeric','2-digit'][r-1];break;case'S':case'A':throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');case'z':t.timeZoneName=r<4?'short':'long';break;case'Z':case'O':case'v':case'V':case'X':case'x':throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead')}return''}),t}const ao=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function so(e){return e.replace(/^(.*?)-/,'')}const lo=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,co=/^(@+)?(\+|#+)?[rs]?$/g,uo=/(\*)(0+)|(#+)(0+)|(0+)/g,ho=/^(0+)$/;function fo(e){const t={};return'r'===e[e.length-1]?t.roundingPriority='morePrecision':'s'===e[e.length-1]&&(t.roundingPriority='lessPrecision'),e.replace(co,(e,r,n)=>('string'!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):'+'===n?t.minimumSignificantDigits=r.length:'#'===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+('string'==typeof n?n.length:0)),'')),t}function mo(e){switch(e){case'sign-auto':return{signDisplay:'auto'};case'sign-accounting':case'()':return{currencySign:'accounting'};case'sign-always':case'+!':return{signDisplay:'always'};case'sign-accounting-always':case'()!':return{signDisplay:'always',currencySign:'accounting'};case'sign-except-zero':case'+?':return{signDisplay:'exceptZero'};case'sign-accounting-except-zero':case'()?':return{signDisplay:'exceptZero',currencySign:'accounting'};case'sign-never':case'+_':return{signDisplay:'never'}}}function po(e){let t;if('E'===e[0]&&'E'===e[1]?(t={notation:'engineering'},e=e.slice(2)):'E'===e[0]&&(t={notation:'scientific'},e=e.slice(1)),t){const r=e.slice(0,2);if('+!'===r?(t.signDisplay='always',e=e.slice(2)):'+?'===r&&(t.signDisplay='exceptZero',e=e.slice(2)),!ho.test(e))throw new Error('Malformed concise eng/scientific notation');t.minimumIntegerDigits=e.length}return t}function _o(e){const t=mo(e);return t||{}}function go(e){let t={};for(const r of e){switch(r.stem){case'percent':case'%':t.style='percent';continue;case'%x100':t.style='percent',t.scale=100;continue;case'currency':t.style='currency',t.currency=r.options[0];continue;case'group-off':case',_':t.useGrouping=!1;continue;case'precision-integer':case'.':t.maximumFractionDigits=0;continue;case'measure-unit':case'unit':t.style='unit',t.unit=so(r.options[0]);continue;case'compact-short':case'K':t.notation='compact',t.compactDisplay='short';continue;case'compact-long':case'KK':t.notation='compact',t.compactDisplay='long';continue;case'scientific':t=n(n({},t),{},{notation:'scientific'},r.options.reduce((e,t)=>n(n({},e),_o(t)),{}));continue;case'engineering':t=n(n({},t),{},{notation:'engineering'},r.options.reduce((e,t)=>n(n({},e),_o(t)),{}));continue;case'notation-simple':t.notation='standard';continue;case'unit-width-narrow':t.currencyDisplay='narrowSymbol',t.unitDisplay='narrow';continue;case'unit-width-short':t.currencyDisplay='code',t.unitDisplay='short';continue;case'unit-width-full-name':t.currencyDisplay='name',t.unitDisplay='long';continue;case'unit-width-iso-code':t.currencyDisplay='symbol';continue;case'scale':t.scale=parseFloat(r.options[0]);continue;case'rounding-mode-floor':t.roundingMode='floor';continue;case'rounding-mode-ceiling':t.roundingMode='ceil';continue;case'rounding-mode-down':t.roundingMode='trunc';continue;case'rounding-mode-up':t.roundingMode='expand';continue;case'rounding-mode-half-even':t.roundingMode='halfEven';continue;case'rounding-mode-half-down':t.roundingMode='halfTrunc';continue;case'rounding-mode-half-up':t.roundingMode='halfExpand';continue;case'integer-width':if(r.options.length>1)throw new RangeError('integer-width stems only accept a single optional option');r.options[0].replace(uo,(e,r,n,o,i,a)=>{if(r)t.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error('We currently do not support maximum integer digits');if(a)throw new Error('We currently do not support exact integer digits')}return''});continue}if(ho.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(lo.test(r.stem)){if(r.options.length>1)throw new RangeError('Fraction-precision stems only accept a single optional option');r.stem.replace(lo,(e,r,n,o,i,a)=>('*'===n?t.minimumFractionDigits=r.length:o&&'#'===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),''));const e=r.options[0];'w'===e?t=n(n({},t),{},{trailingZeroDisplay:'stripIfInteger'}):e&&(t=n(n({},t),fo(e)));continue}if(co.test(r.stem)){t=n(n({},t),fo(r.stem));continue}const e=mo(r.stem);e&&(t=n(n({},t),e));const o=po(r.stem);o&&(t=n(n({},t),o))}return t}let vo=(e=>(e[e.literal=0]='literal',e[e.argument=1]='argument',e[e.number=2]='number',e[e.date=3]='date',e[e.time=4]='time',e[e.select=5]='select',e[e.plural=6]='plural',e[e.pound=7]='pound',e[e.tag=8]='tag',e))({}),bo=(e=>(e[e.number=0]='number',e[e.dateTime=1]='dateTime',e))({});function yo(e){return e.type===vo.literal}function wo(e){return e.type===vo.argument}function Eo(e){return e.type===vo.number}function No(e){return e.type===vo.date}function xo(e){return e.type===vo.time}function ko(e){return e.type===vo.select}function Co(e){return e.type===vo.plural}function So(e){return e.type===vo.pound}function To(e){return e.type===vo.tag}function Io(e){return!(!e||'object'!=typeof e||e.type!==bo.number)}function Ao(e){return!(!e||'object'!=typeof e||e.type!==bo.dateTime)}let Po=(e=>(e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]='EXPECT_ARGUMENT_CLOSING_BRACE',e[e.EMPTY_ARGUMENT=2]='EMPTY_ARGUMENT',e[e.MALFORMED_ARGUMENT=3]='MALFORMED_ARGUMENT',e[e.EXPECT_ARGUMENT_TYPE=4]='EXPECT_ARGUMENT_TYPE',e[e.INVALID_ARGUMENT_TYPE=5]='INVALID_ARGUMENT_TYPE',e[e.EXPECT_ARGUMENT_STYLE=6]='EXPECT_ARGUMENT_STYLE',e[e.INVALID_NUMBER_SKELETON=7]='INVALID_NUMBER_SKELETON',e[e.INVALID_DATE_TIME_SKELETON=8]='INVALID_DATE_TIME_SKELETON',e[e.EXPECT_NUMBER_SKELETON=9]='EXPECT_NUMBER_SKELETON',e[e.EXPECT_DATE_TIME_SKELETON=10]='EXPECT_DATE_TIME_SKELETON',e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]='UNCLOSED_QUOTE_IN_ARGUMENT_STYLE',e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]='EXPECT_SELECT_ARGUMENT_OPTIONS',e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]='EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE',e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]='INVALID_PLURAL_ARGUMENT_OFFSET_VALUE',e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]='EXPECT_SELECT_ARGUMENT_SELECTOR',e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]='EXPECT_PLURAL_ARGUMENT_SELECTOR',e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]='EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT',e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]='EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT',e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]='INVALID_PLURAL_ARGUMENT_SELECTOR',e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]='DUPLICATE_PLURAL_ARGUMENT_SELECTOR',e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]='DUPLICATE_SELECT_ARGUMENT_SELECTOR',e[e.MISSING_OTHER_CLAUSE=22]='MISSING_OTHER_CLAUSE',e[e.INVALID_TAG=23]='INVALID_TAG',e[e.INVALID_TAG_NAME=25]='INVALID_TAG_NAME',e[e.UNMATCHED_CLOSING_TAG=26]='UNMATCHED_CLOSING_TAG',e[e.UNCLOSED_TAG=27]='UNCLOSED_TAG',e))({});const Ro=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ho={'001':['H','h'],419:['h','H','hB','hb'],AC:['H','h','hb','hB'],AD:['H','hB'],AE:['h','hB','hb','H'],AF:['H','hb','hB','h'],AG:['h','hb','H','hB'],AI:['H','h','hb','hB'],AL:['h','H','hB'],AM:['H','hB'],AO:['H','hB'],AR:['h','H','hB','hb'],AS:['h','H'],AT:['H','hB'],AU:['h','hb','H','hB'],AW:['H','hB'],AX:['H'],AZ:['H','hB','h'],BA:['H','hB','h'],BB:['h','hb','H','hB'],BD:['h','hB','H'],BE:['H','hB'],BF:['H','hB'],BG:['H','hB','h'],BH:['h','hB','hb','H'],BI:['H','h'],BJ:['H','hB'],BL:['H','hB'],BM:['h','hb','H','hB'],BN:['hb','hB','h','H'],BO:['h','H','hB','hb'],BQ:['H'],BR:['H','hB'],BS:['h','hb','H','hB'],BT:['h','H'],BW:['H','h','hb','hB'],BY:['H','h'],BZ:['H','h','hb','hB'],CA:['h','hb','H','hB'],CC:['H','h','hb','hB'],CD:['hB','H'],CF:['H','h','hB'],CG:['H','hB'],CH:['H','hB','h'],CI:['H','hB'],CK:['H','h','hb','hB'],CL:['h','H','hB','hb'],CM:['H','h','hB'],CN:['H','hB','hb','h'],CO:['h','H','hB','hb'],CP:['H'],CR:['h','H','hB','hb'],CU:['h','H','hB','hb'],CV:['H','hB'],CW:['H','hB'],CX:['H','h','hb','hB'],CY:['h','H','hb','hB'],CZ:['H'],DE:['H','hB'],DG:['H','h','hb','hB'],DJ:['h','H'],DK:['H'],DM:['h','hb','H','hB'],DO:['h','H','hB','hb'],DZ:['h','hB','hb','H'],EA:['H','h','hB','hb'],EC:['h','H','hB','hb'],EE:['H','hB'],EG:['h','hB','hb','H'],EH:['h','hB','hb','H'],ER:['h','H'],ES:['H','hB','h','hb'],ET:['hB','hb','h','H'],FI:['H'],FJ:['h','hb','H','hB'],FK:['H','h','hb','hB'],FM:['h','hb','H','hB'],FO:['H','h'],FR:['H','hB'],GA:['H','hB'],GB:['H','h','hb','hB'],GD:['h','hb','H','hB'],GE:['H','hB','h'],GF:['H','hB'],GG:['H','h','hb','hB'],GH:['h','H'],GI:['H','h','hb','hB'],GL:['H','h'],GM:['h','hb','H','hB'],GN:['H','hB'],GP:['H','hB'],GQ:['H','hB','h','hb'],GR:['h','H','hb','hB'],GS:['H','h','hb','hB'],GT:['h','H','hB','hb'],GU:['h','hb','H','hB'],GW:['H','hB'],GY:['h','hb','H','hB'],HK:['h','hB','hb','H'],HN:['h','H','hB','hb'],HR:['H','hB'],HU:['H','h'],IC:['H','h','hB','hb'],ID:['H'],IE:['H','h','hb','hB'],IL:['H','hB'],IM:['H','h','hb','hB'],IN:['h','H'],IO:['H','h','hb','hB'],IQ:['h','hB','hb','H'],IR:['hB','H'],IS:['H'],IT:['H','hB'],JE:['H','h','hb','hB'],JM:['h','hb','H','hB'],JO:['h','hB','hb','H'],JP:['H','K','h'],KE:['hB','hb','H','h'],KG:['H','h','hB','hb'],KH:['hB','h','H','hb'],KI:['h','hb','H','hB'],KM:['H','h','hB','hb'],KN:['h','hb','H','hB'],KP:['h','H','hB','hb'],KR:['h','H','hB','hb'],KW:['h','hB','hb','H'],KY:['h','hb','H','hB'],KZ:['H','hB'],LA:['H','hb','hB','h'],LB:['h','hB','hb','H'],LC:['h','hb','H','hB'],LI:['H','hB','h'],LK:['H','h','hB','hb'],LR:['h','hb','H','hB'],LS:['h','H'],LT:['H','h','hb','hB'],LU:['H','h','hB'],LV:['H','hB','hb','h'],LY:['h','hB','hb','H'],MA:['H','h','hB','hb'],MC:['H','hB'],MD:['H','hB'],ME:['H','hB','h'],MF:['H','hB'],MG:['H','h'],MH:['h','hb','H','hB'],MK:['H','h','hb','hB'],ML:['H'],MM:['hB','hb','H','h'],MN:['H','h','hb','hB'],MO:['h','hB','hb','H'],MP:['h','hb','H','hB'],MQ:['H','hB'],MR:['h','hB','hb','H'],MS:['H','h','hb','hB'],MT:['H','h'],MU:['H','h'],MV:['H','h'],MW:['h','hb','H','hB'],MX:['h','H','hB','hb'],MY:['hb','hB','h','H'],MZ:['H','hB'],NA:['h','H','hB','hb'],NC:['H','hB'],NE:['H'],NF:['H','h','hb','hB'],NG:['H','h','hb','hB'],NI:['h','H','hB','hb'],NL:['H','hB'],NO:['H','h'],NP:['H','h','hB'],NR:['H','h','hb','hB'],NU:['H','h','hb','hB'],NZ:['h','hb','H','hB'],OM:['h','hB','hb','H'],PA:['h','H','hB','hb'],PE:['h','H','hB','hb'],PF:['H','h','hB'],PG:['h','H'],PH:['h','hB','hb','H'],PK:['h','hB','H'],PL:['H','h'],PM:['H','hB'],PN:['H','h','hb','hB'],PR:['h','H','hB','hb'],PS:['h','hB','hb','H'],PT:['H','hB'],PW:['h','H'],PY:['h','H','hB','hb'],QA:['h','hB','hb','H'],RE:['H','hB'],RO:['H','hB'],RS:['H','hB','h'],RU:['H'],RW:['H','h'],SA:['h','hB','hb','H'],SB:['h','hb','H','hB'],SC:['H','h','hB'],SD:['h','hB','hb','H'],SE:['H'],SG:['h','hb','H','hB'],SH:['H','h','hb','hB'],SI:['H','hB'],SJ:['H'],SK:['H'],SL:['h','hb','H','hB'],SM:['H','h','hB'],SN:['H','h','hB'],SO:['h','H'],SR:['H','hB'],SS:['h','hb','H','hB'],ST:['H','hB'],SV:['h','H','hB','hb'],SX:['H','h','hb','hB'],SY:['h','hB','hb','H'],SZ:['h','hb','H','hB'],TA:['H','h','hb','hB'],TC:['h','hb','H','hB'],TD:['h','H','hB'],TF:['H','h','hB'],TG:['H','hB'],TH:['H','h'],TJ:['H','h'],TL:['H','hB','hb','h'],TM:['H','h'],TN:['h','hB','hb','H'],TO:['h','H'],TR:['H','hB'],TT:['h','hb','H','hB'],TW:['hB','hb','h','H'],TZ:['hB','hb','H','h'],UA:['H','hB','h'],UG:['hB','hb','H','h'],UM:['h','hb','H','hB'],US:['h','hb','H','hB'],UY:['h','H','hB','hb'],UZ:['H','hB','h'],VA:['H','h','hB'],VC:['h','hb','H','hB'],VE:['h','H','hB','hb'],VG:['h','hb','H','hB'],VI:['h','hb','H','hB'],VN:['H','h'],VU:['h','H'],WF:['H','hB'],WS:['h','H'],XK:['H','hB','h'],YE:['h','hB','hb','H'],YT:['H','hB'],ZA:['H','h','hb','hB'],ZM:['h','hb','H','hB'],ZW:['H','h'],'af-ZA':['H','h','hB','hb'],'ar-001':['h','hB','hb','H'],'ca-ES':['H','h','hB'],'en-001':['h','hb','H','hB'],'en-HK':['h','hb','H','hB'],'en-IL':['H','h','hb','hB'],'en-MY':['h','hb','H','hB'],'es-BR':['H','h','hB','hb'],'es-ES':['H','h','hB','hb'],'es-GQ':['H','h','hB','hb'],'fr-CA':['H','h','hB'],'gl-ES':['H','h','hB'],'gu-IN':['hB','hb','h','H'],'hi-IN':['hB','h','H'],'it-CH':['H','h','hB'],'it-IT':['H','h','hB'],'kn-IN':['hB','h','H'],'ku-SY':['H','hB'],'ml-IN':['hB','h','H'],'mr-IN':['hB','hb','h','H'],'pa-IN':['hB','hb','h','H'],'ta-IN':['hB','h','hb','H'],'te-IN':['hB','h','H'],'zu-ZA':['H','hB','hb','h']};function Oo(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case'h24':return'k';case'h23':return'H';case'h12':return'h';case'h11':return'K';default:throw new Error('Invalid hourCycle')}const r=e.language;let n;'root'!==r&&(n=e.maximize().region);return(Ho[n||'']||Ho[r||'']||Ho[''.concat(r,'-001')]||Ho['001'])[0]}const Lo=new RegExp('^'.concat(Ro.source,'*')),Bo=new RegExp(''.concat(Ro.source,'*$'));function Mo(e,t){return{start:e,end:t}}const Do=!!Object.fromEntries,Fo=!!String.prototype.trimStart,Uo=!!String.prototype.trimEnd,Go=Do?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},zo=Fo?function(e){return e.trimStart()}:function(e){return e.replace(Lo,'')},jo=Uo?function(e){return e.trimEnd()}:function(e){return e.replace(Bo,'')},Vo=new RegExp('([^\\p{White_Space}\\p{Pattern_Syntax}]*)','yu');class qo{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(this,'message',void 0),e(this,'position',void 0),e(this,'locale',void 0),e(this,'ignoreTag',void 0),e(this,'requiresOtherClause',void 0),e(this,'shouldParseSkeletons',void 0),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error('parser can only be used once');return this.parseMessage(0,'',!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const o=this.char();if(123===o){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===o&&e>0)break;if(35!==o||'plural'!==t&&'selectordinal'!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(Po.UNMATCHED_CLOSING_TAG,Mo(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&Wo(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:vo.pound,location:Mo(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf('/>'))return{val:{type:vo.literal,value:'<'.concat(n,'/>'),location:Mo(r,this.clonePosition())},err:null};if(this.bumpIf('>')){const o=this.parseMessage(e+1,t,!0);if(o.err)return o;const i=o.val,a=this.clonePosition();if(this.bumpIf('</')){if(this.isEOF()||!Wo(this.char()))return this.error(Po.INVALID_TAG,Mo(a,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(Po.UNMATCHED_CLOSING_TAG,Mo(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf('>')?{val:{type:vo.tag,value:n,children:i,location:Mo(r,this.clonePosition())},err:null}:this.error(Po.INVALID_TAG,Mo(a,this.clonePosition())))}return this.error(Po.UNCLOSED_TAG,Mo(r,this.clonePosition()))}return this.error(Po.INVALID_TAG,Mo(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Xo(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n='';for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const o=this.tryParseUnquoted(e,t);if(o){n+=o;continue}const i=this.tryParseLeftAngleBracket();if(!i)break;n+=i}const o=Mo(r,this.clonePosition());return{val:{type:vo.literal,value:n,location:o},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(Wo(e=this.peek()||0)||47===e)?null:(this.bump(),'<');var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),'\'';case 123:case 60:case 62:case 125:break;case 35:if('plural'===e||'selectordinal'===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&('plural'===t||'selectordinal'===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Po.EXPECT_ARGUMENT_CLOSING_BRACE,Mo(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Po.EMPTY_ARGUMENT,Mo(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(Po.MALFORMED_ARGUMENT,Mo(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Po.EXPECT_ARGUMENT_CLOSING_BRACE,Mo(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:vo.argument,value:n,location:Mo(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Po.EXPECT_ARGUMENT_CLOSING_BRACE,Mo(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(Po.MALFORMED_ARGUMENT,Mo(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){var r;return Vo.lastIndex=t,null!==(r=Vo.exec(e)[1])&&void 0!==r?r:''}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Mo(e,this.clonePosition())}}parseArgumentOptions(e,t,r,o){let i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case'':return this.error(Po.EXPECT_ARGUMENT_TYPE,Mo(i,s));case'number':case'date':case'time':{var l,c;this.bumpSpace();let e=null;if(this.bumpIf(',')){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=jo(r.val);if(0===n.length)return this.error(Po.EXPECT_ARGUMENT_STYLE,Mo(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Mo(t,this.clonePosition())}}const t=this.tryParseArgumentClose(o);if(t.err)return t;const n=Mo(o,this.clonePosition());if(e&&e.style.startsWith('::')){let t=zo(e.style.slice(2));if('number'===a){const o=this.parseNumberSkeletonFromString(t,e.styleLocation);return o.err?o:{val:{type:vo.number,value:r,location:n,style:o.val},err:null}}{if(0===t.length)return this.error(Po.EXPECT_DATE_TIME_SKELETON,n);let o=t;this.locale&&(o=function(e,t){let r='';for(let n=0;n<e.length;n++){const o=e.charAt(n);if('j'===o){let i=0;for(;n+1<e.length&&e.charAt(n+1)===o;)i++,n++;let a=1+(1&i),s=i<2?1:3+(i>>1),l='a',c=Oo(t);for('H'!=c&&'k'!=c||(s=0);s-- >0;)r+=l;for(;a-- >0;)r=c+r}else r+='J'===o?'H':o}return r}(t,this.locale));const i={type:bo.dateTime,pattern:o,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?io(o):{}};return{val:{type:'date'===a?vo.date:vo.time,value:r,location:n,style:i},err:null}}}return{val:{type:'number'===a?vo.number:'date'===a?vo.date:vo.time,value:r,location:n,style:null!==(l=null===(c=e)||void 0===c?void 0:c.style)&&void 0!==l?l:null},err:null}}case'plural':case'selectordinal':case'select':{const i=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(','))return this.error(Po.EXPECT_SELECT_ARGUMENT_OPTIONS,Mo(i,n({},i)));this.bumpSpace();let s=this.parseIdentifierIfPossible(),l=0;if('select'!==a&&'offset'===s.value){if(!this.bumpIf(':'))return this.error(Po.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Mo(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(Po.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Po.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),s=this.parseIdentifierIfPossible(),l=e.val}const c=this.tryParsePluralOrSelectOptions(e,a,t,s);if(c.err)return c;const u=this.tryParseArgumentClose(o);if(u.err)return u;const d=Mo(o,this.clonePosition());return'select'===a?{val:{type:vo.select,value:r,options:Go(c.val),location:d},err:null}:{val:{type:vo.plural,value:r,options:Go(c.val),offset:l,pluralType:'plural'===a?'cardinal':'ordinal',location:d},err:null}}default:return this.error(Po.INVALID_ARGUMENT_TYPE,Mo(i,s))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(Po.EXPECT_ARGUMENT_CLOSING_BRACE,Mo(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil('\''))return this.error(Po.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Mo(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error('Number skeleton cannot be empty');const t=e.split(ao).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split('/');if(0===t.length)throw new Error('Invalid number skeleton');const[n,...o]=t;for(const e of o)if(0===e.length)throw new Error('Invalid number skeleton');r.push({stem:n,options:o})}return r}(e)}catch(e){return this.error(Po.INVALID_NUMBER_SKELETON,t)}return{val:{type:bo.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?go(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let o=!1;const i=[],a=new Set;let{value:s,location:l}=n;for(;;){if(0===s.length){const e=this.clonePosition();if('select'===t||!this.bumpIf('='))break;{const t=this.tryParseDecimalInteger(Po.EXPECT_PLURAL_ARGUMENT_SELECTOR,Po.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;l=Mo(e,this.clonePosition()),s=this.message.slice(e.offset,this.offset())}}if(a.has(s))return this.error('select'===t?Po.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Po.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);'other'===s&&(o=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf('{'))return this.error('select'===t?Po.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Po.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Mo(this.clonePosition(),this.clonePosition()));const c=this.parseMessage(e+1,t,r);if(c.err)return c;const u=this.tryParseArgumentClose(n);if(u.err)return u;i.push([s,{value:c.val,location:Mo(n,this.clonePosition())}]),a.add(s),this.bumpSpace(),({value:s,location:l}=this.parseIdentifierIfPossible())}return 0===i.length?this.error('select'===t?Po.EXPECT_SELECT_ARGUMENT_SELECTOR:Po.EXPECT_PLURAL_ARGUMENT_SELECTOR,Mo(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(Po.MISSING_OTHER_CLAUSE,Mo(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf('+')||this.bumpIf('-')&&(r=-1);let o=!1,i=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;o=!0,i=10*i+(e-48),this.bump()}const a=Mo(n,this.clonePosition());return o?(i*=r,Number.isSafeInteger(i)?{val:i,err:null}:this.error(t,a)):this.error(e,a)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error('out of bound');const t=this.message.codePointAt(e);if(void 0===t)throw Error('Offset '.concat(e,' is at invalid UTF-16 code unit boundary'));return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error('targetOffset '.concat(e,' must be greater than or equal to the current offset ').concat(this.offset()));for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error('targetOffset '.concat(e,' is at invalid UTF-16 code unit boundary'));if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Ko(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null}}function Wo(e){return e>=97&&e<=122||e>=65&&e<=90}function Xo(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Ko(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Zo(e){e.forEach(e=>{if(delete e.location,ko(e)||Co(e))for(const t in e.options)delete e.options[t].location,Zo(e.options[t].value);else Eo(e)&&Io(e.style)||(No(e)||xo(e))&&Ao(e.style)?delete e.style.location:To(e)&&Zo(e.children)})}let Yo=(e=>(e.MISSING_VALUE='MISSING_VALUE',e.INVALID_VALUE='INVALID_VALUE',e.MISSING_INTL_API='MISSING_INTL_API',e))({});class Jo extends Error{constructor(t,r,n){super(t),e(this,'code',void 0),e(this,'originalMessage',void 0),this.code=r,this.originalMessage=n}toString(){return'[formatjs Error: '.concat(this.code,'] ').concat(this.message)}}class Qo extends Jo{constructor(e,t,r,n){super('Invalid values for "'.concat(e,'": "').concat(t,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Yo.INVALID_VALUE,n)}}class $o extends Jo{constructor(e,t,r){super('Value for "'.concat(e,'" must be of type ').concat(t),Yo.INVALID_VALUE,r)}}class ei extends Jo{constructor(e,t){super('The intl string context variable "'.concat(e,'" was not provided to the string "').concat(t,'"'),Yo.MISSING_VALUE,t)}}let ti=(e=>(e[e.literal=0]='literal',e[e.object=1]='object',e))({});function ri(e){return'function'==typeof e}function ni(e,t,r,n,o,i,a){if(1===e.length&&yo(e[0]))return[{type:ti.literal,value:e[0].value}];const s=[];for(const l of e){if(yo(l)){s.push({type:ti.literal,value:l.value});continue}if(So(l)){'number'==typeof i&&s.push({type:ti.literal,value:r.getNumberFormat(t).format(i)});continue}const{value:e}=l;if(!o||!(e in o))throw new ei(e,a);let c=o[e];if(wo(l))c&&'string'!=typeof c&&'number'!=typeof c&&'bigint'!=typeof c||(c='string'==typeof c||'number'==typeof c||'bigint'==typeof c?String(c):''),s.push({type:'string'==typeof c?ti.literal:ti.object,value:c});else{if(No(l)){const e='string'==typeof l.style?n.date[l.style]:Ao(l.style)?l.style.parsedOptions:void 0;s.push({type:ti.literal,value:r.getDateTimeFormat(t,e).format(c)});continue}if(xo(l)){const e='string'==typeof l.style?n.time[l.style]:Ao(l.style)?l.style.parsedOptions:n.time.medium;s.push({type:ti.literal,value:r.getDateTimeFormat(t,e).format(c)});continue}if(Eo(l)){const e='string'==typeof l.style?n.number[l.style]:Io(l.style)?l.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if('bigint'==typeof c){if(!Number.isInteger(t))throw new TypeError('Cannot apply fractional scale '.concat(t,' to bigint value. Scale must be an integer when formatting bigint.'));c*=BigInt(t)}else c*=t}s.push({type:ti.literal,value:r.getNumberFormat(t,e).format(c)});continue}if(To(l)){const{children:e,value:c}=l,u=o[c];if(!ri(u))throw new $o(c,'function',a);let d=u(ni(e,t,r,n,o,i).map(e=>e.value));Array.isArray(d)||(d=[d]),s.push(...d.map(e=>({type:'string'==typeof e?ti.literal:ti.object,value:e})))}if(ko(l)){const e=c,i=(Object.prototype.hasOwnProperty.call(l.options,e)?l.options[e]:void 0)||l.options.other;if(!i)throw new Qo(l.value,c,Object.keys(l.options),a);s.push(...ni(i.value,t,r,n,o));continue}if(Co(l)){const e='='.concat(c);let i=Object.prototype.hasOwnProperty.call(l.options,e)?l.options[e]:void 0;if(!i){if(!Intl.PluralRules)throw new Jo('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Yo.MISSING_INTL_API,a);const e='bigint'==typeof c?Number(c):c,n=r.getPluralRules(t,{type:l.pluralType}).select(e-(l.offset||0));i=(Object.prototype.hasOwnProperty.call(l.options,n)?l.options[n]:void 0)||l.options.other}if(!i)throw new Qo(l.value,c,Object.keys(l.options),a);const u='bigint'==typeof c?Number(c):c;s.push(...ni(i.value,t,r,n,o,u-(l.offset||0)));continue}}}return(l=s).length<2?l:l.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===ti.literal&&t.type===ti.literal?r.value+=t.value:e.push(t),e},[]);var l}function oi(e,t){return t?Object.keys(e).reduce((r,o)=>{var i,a;return r[o]=(i=e[o],(a=t[o])?n(n(n({},i),a),Object.keys(i).reduce((e,t)=>(e[t]=n(n({},i[t]),a[t]),e),{})):i),r},n({},e)):e}function ii(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class ai{constructor(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ai.defaultLocale,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if(e(this,'ast',void 0),e(this,'locales',void 0),e(this,'resolvedLocale',void 0),e(this,'formatters',void 0),e(this,'formats',void 0),e(this,'message',void 0),e(this,'formatterCache',{number:{},dateTime:{},pluralRules:{}}),e(this,'format',e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===ti.literal&&'string'==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||'':r}),e(this,'formatToParts',e=>ni(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message)),e(this,'resolvedOptions',()=>{var e;return{locale:(null===(e=this.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}}),e(this,'getAst',()=>this.ast),this.locales=o,this.resolvedLocale=ai.resolveLocale(o),'string'==typeof r){if(this.message=r,!ai.__parse)throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');const e=a||{},o=t({},(function(e){if(null==e)throw new TypeError('Cannot destructure '+e)}(e),e));this.ast=ai.__parse(r,n(n({},o),{},{locale:this.resolvedLocale}))}else this.ast=r;if(!Array.isArray(this.ast))throw new TypeError('A message must be provided as a String or AST.');this.formats=oi(ai.formats,i),this.formatters=a&&a.formatters||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{number:{},dateTime:{},pluralRules:{}};return{getNumberFormat:Fr(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Intl.NumberFormat(...t)},{cache:ii(e.number),strategy:Xr.variadic}),getDateTimeFormat:Fr(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Intl.DateTimeFormat(...t)},{cache:ii(e.dateTime),strategy:Xr.variadic}),getPluralRules:Fr(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Intl.PluralRules(...t)},{cache:ii(e.pluralRules),strategy:Xr.variadic})}}(this.formatterCache)}static get defaultLocale(){return ai.memoizedDefaultLocale||(ai.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),ai.memoizedDefaultLocale}}function si(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let[o,i,a,s]=t;if(Array.isArray(i))throw new Kr(Zr.INVALID_MESSAGE,void 0);if('object'==typeof i)throw new Kr(Zr.INSUFFICIENT_PATH,void 0);if('string'==typeof i){const e=((e,t)=>t||/'[{}]/.test(e)?void 0:e)(i,a);if(e)return e}const{cache:l,formats:c,formatters:u,globalFormats:d,locale:h,timeZone:f}=s;let m;u.getMessageFormat||(u.getMessageFormat=((e,t)=>Jr(function(){return new ai(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],n({formatters:t},arguments.length<=3?void 0:arguments[3]))},e.message))(l,u));try{m=u.getMessageFormat(i,h,((e,t,r)=>{const o=ai.formats.date,i=ai.formats.time,a=n(n({},null==e?void 0:e.dateTime),null==t?void 0:t.dateTime),s={date:n(n({},o),a),time:n(n({},i),a),number:n(n({},null==e?void 0:e.number),null==t?void 0:t.number)};return r&&['date','time'].forEach(e=>{const t=s[e];for(const[e,o]of Object.entries(t))t[e]=n({timeZone:r},o)}),s})(d,c,f),{formatters:n(n({},u),{},{getDateTimeFormat:(e,t)=>{var r;return u.getDateTimeFormat(e,n(n({},t),{},{timeZone:null!==(r=null==t?void 0:t.timeZone)&&void 0!==r?r:f}))}})})}catch(e){throw new Kr(Zr.INVALID_MESSAGE,void 0)}const p=m.format(a);return ro(p)||Array.isArray(p)||'string'==typeof p?p:String(p)}e(ai,'memoizedDefaultLocale',null),e(ai,'resolveLocale',e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale('string'==typeof e?e:e[0])}),e(ai,'__parse',function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=n({shouldParseSkeletons:!0,requiresOtherClause:!0},r);const o=new qo(e,r).parse();if(o.err){const e=SyntaxError(Po[o.err.kind]);throw e.location=o.err.location,e.originalMessage=o.err.message,e}return null!==(t=r)&&void 0!==t&&t.captureLocation||Zo(o.val),o.val}),e(ai,'formats',{number:{integer:{maximumFractionDigits:0},currency:{style:'currency'},percent:{style:'percent'}},date:{short:{month:'numeric',day:'numeric',year:'2-digit'},medium:{month:'short',day:'numeric',year:'numeric'},long:{month:'long',day:'numeric',year:'numeric'},full:{weekday:'long',month:'long',day:'numeric',year:'numeric'}},time:{short:{hour:'numeric',minute:'numeric'},medium:{hour:'numeric',minute:'numeric',second:'numeric'},long:{hour:'numeric',minute:'numeric',second:'numeric',timeZoneName:'short'},full:{hour:'numeric',minute:'numeric',second:'numeric',timeZoneName:'short'}}}),si.raw=!0;const li=['formats','getMessageFallback','messages','onError'];function ci(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join('.')}function ui(e){return ci(e.namespace,e.key)}function di(e){console.error(e)}function hi(e,t,r,n){const o=ci(n,r);if(!t)throw new Error(o);let i=t;return r.split('.').forEach(t=>{const r=i[t];if(null==t||null==r)throw new Error(o+' ('.concat(e,')'));i=r}),i}function fi(e){const t=((e,t,r)=>{try{if(!t)throw new Error(void 0);const n=r?hi(e,t,r):t;if(!n)throw new Error(r);return n}catch(e){return new Kr(Zr.MISSING_MESSAGE,e.message)}})(e.locale,e.messages,e.namespace);return(e=>{let{cache:t,formats:r,formatters:n,getMessageFallback:o=ui,locale:i,messagesOrError:a,namespace:s,onError:l,timeZone:c}=e;const u=a instanceof Kr;function d(e,t,r,n){const i=new Kr(t,r);return l(i),null!=n?n:o({error:i,key:e,namespace:s})}function h(e,h,f,m){const p=m;let _;if(u){if(!p)return l(a),o({error:a,key:e,namespace:s});_=p}else{const t=a;try{_=hi(i,t,e,s)}catch(t){if(!p)return d(e,Zr.MISSING_MESSAGE,t.message,p);_=p}}try{return si(ci(s,e),_,h?(e=>{const t={};return Object.keys(e).forEach(r=>{let n=0;const o=e[r];let i;i='function'==typeof o?e=>{const t=o(e);return ro(t)?no(t,{key:r+n++}):t}:o,t[r]=i}),t})(h):h,{cache:t,formatters:n,globalFormats:r,formats:f,locale:i,timeZone:c})}catch(t){let r,n;return t instanceof Kr?(r=t.code,n=t.originalMessage):(r=Zr.FORMATTING_ERROR,n=t.message),d(e,r,n,p)}}function f(e,t,r,n){const o=h(e,t,r,n);return'string'!=typeof o?d(e,Zr.INVALID_MESSAGE,void 0):o}return f.rich=h,f.markup=(e,t,r,n)=>h(e,t,r,n),f.raw=e=>{if(u)return l(a),o({error:a,key:e,namespace:s});const t=a;try{return hi(i,t,e,s)}catch(t){return d(e,Zr.MISSING_MESSAGE,t.message)}},f.has=e=>{if(u)return!1;try{return hi(i,a,e,s),!0}catch(e){return!1}},f})(n(n({},e),{},{messagesOrError:t}))}const mi=3600,pi=86400,_i=7*pi,gi=2628e3,vi=7884e3,bi=365*pi,yi={second:1,seconds:1,minute:60,minutes:60,hour:mi,hours:mi,day:pi,days:pi,week:_i,weeks:_i,month:gi,months:gi,quarter:vi,quarters:vi,year:bi,years:bi};function wi(e){let{formats:t,getMessageFallback:r,messages:i,onError:a}=e;return n(n({},o(e,li)),{},{formats:t||void 0,messages:i||void 0,onError:a||di,getMessageFallback:r||ui})}const Ei=pr(void 0);function Ni(e){let{children:t,formats:r,getMessageFallback:o,locale:i,messages:a,now:s,onError:l,timeZone:c}=e;const u=yn(Ei),d=vn(()=>(null==u?void 0:u.cache)||Yr(),[i,null==u?void 0:u.cache]),h=vn(()=>(null==u?void 0:u.formatters)||$r(d),[d,null==u?void 0:u.formatters]),f=vn(()=>n(n({},wi({locale:i,formats:void 0===r?null==u?void 0:u.formats:r,getMessageFallback:o||(null==u?void 0:u.getMessageFallback),messages:void 0===a?null==u?void 0:u.messages:a,now:s||(null==u?void 0:u.now),onError:l||(null==u?void 0:u.onError),timeZone:c||(null==u?void 0:u.timeZone)})),{},{formatters:h,cache:d}),[d,r,h,o,i,a,s,l,u,c]);return Dr(Ei.Provider,{value:f,children:t})}function xi(){const e=yn(Ei);if(!e)throw new Error(void 0);return e}let ki=!1;const Ci='undefined'==typeof window;function Si(e){return((e,t)=>{const{cache:r,formats:n,formatters:o,getMessageFallback:i,locale:a,onError:s,timeZone:l}=xi(),c=e['!'],u=function(e,t){return e===t?void 0:e.slice((t+'.').length)}(t,'!');return l||ki||!Ci||(ki=!0,s(new Kr(Zr.ENVIRONMENT_FALLBACK,void 0))),vn(()=>fi({cache:r,formatters:o,getMessageFallback:i,messages:c,namespace:u,onError:s,formats:n,locale:a,timeZone:l}),[r,o,i,c,u,s,n,a,l])})({'!':xi().messages},e?'!.'.concat(e):'!')}function Ti(){const{formats:e,formatters:t,locale:r,now:o,onError:i,timeZone:a}=xi();return vn(()=>function(e){const{_cache:t=Yr(),_formatters:r=$r(t),formats:o,locale:i,onError:a=di,timeZone:s}=e;function l(e){var t;return null!==(t=e)&&void 0!==t&&t.timeZone||(s?e=n(n({},e),{},{timeZone:s}):a(new Kr(Zr.ENVIRONMENT_FALLBACK,void 0))),e}function c(e,t,r,o,i){let s;try{s=((e,t,r)=>{let o;if('string'==typeof t){if(o=null==e?void 0:e[t],!o){const e=new Kr(Zr.MISSING_FORMAT,void 0);throw a(e),e}}else o=t;return r&&(o=n(n({},o),r)),o})(r,e,t)}catch(e){return i()}try{return o(s)}catch(e){return a(new Kr(Zr.FORMATTING_ERROR,e.message)),i()}}function u(e,t,n){return c(t,n,null==o?void 0:o.dateTime,t=>(t=l(t),r.getDateTimeFormat(i,t).format(e)),()=>String(e))}function d(){return e.now?e.now:(a(new Kr(Zr.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:u,number:(e,t,n)=>c(t,n,null==o?void 0:o.number,t=>r.getNumberFormat(i,t).format(e),()=>String(e)),relativeTime:(e,t)=>{try{let n,o;const a={};t instanceof Date||'number'==typeof t?n=new Date(t):t&&(n=null!=t.now?new Date(t.now):d(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),n||(n=d());const s=(new Date(e).getTime()-n.getTime())/1e3;o||(o=(e=>{const t=Math.abs(e);return t<60?'second':t<mi?'minute':t<pi?'hour':t<_i?'day':t<gi?'week':t<bi?'month':'year'})(s)),a.numeric='second'===o?'auto':'always';const l=((e,t)=>Math.round(e/yi[t]))(s,o);return r.getRelativeTimeFormat(i,a).format(l,o)}catch(t){return a(new Kr(Zr.FORMATTING_ERROR,t.message)),String(e)}},list:(e,t,n)=>{const a=[],s=new Map;let l=0;for(const t of e){let e;'object'==typeof t?(e=String(l),s.set(e,t)):e=String(t),a.push(e),l++}return c(t,n,null==o?void 0:o.list,e=>{const t=r.getListFormat(i,e).formatToParts(a).map(e=>'literal'===e.type?e.value:s.get(e.value)||e.value);return s.size>0?t:t.join('')},()=>String(e))},dateTimeRange:(e,t,n,a)=>c(n,a,null==o?void 0:o.dateTime,n=>(n=l(n),r.getDateTimeFormat(i,n).formatRange(e,t)),()=>[u(e),u(t)].join(' – '))}}({formats:e,locale:r,now:o,onError:i,timeZone:a,_formatters:t}),[e,t,o,r,i,a])}const Ii=(e,t)=>{const[r,n]=pn(e);return{value:r,set:e=>{if(!t)return n(e);n(r=>{const n=function(e,t){return'function'==typeof e?e(t):e}(e,r);return t(n),n})}}},Ai=(e,t)=>{const r=pn(!1),n=gn(!1);return _n(()=>{n.current||e(()=>{r[1](!0),n.current=!0})},t),r},Pi=pr({}),Ri=()=>{const e=yn(Pi);if(!e)throw new Error('useWidgetContext must be used within a WidgetContextProvider');return e};var Hi={back:async(e,t,r)=>{var n;const o=new URL('/'.concat(e),br);t&&(o.pathname+='/'.concat(t));const i=null!==(n=Ke().get('from'))&&void 0!==n?n:r;if(i){const e=i.split('/').at(-1);e&&(o.pathname+='/'.concat(e),o.searchParams.append('step','-1'))}await ot(),Je(),window.location.href=o.toString()},continue:(e,t)=>{const r=new URL('/'.concat(e,'/').concat(t,'/confirmation'),br),n=encodeURIComponent(window.location.pathname);r.searchParams.append('from',n),window.location.href=r.toString()},exit:async function(){if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])try{await ot()}catch(e){Ve.error('Failed to clear cart on exit',e)}Je(),window.location.reload()}};const Oi=pr({}),Li=()=>{const e=yn(Oi);if(!e)throw new Error('useReturnContext must be used within a ReturnContextProvider');return e},Bi=['src','className'],Mi=e=>{let{src:t,className:r}=e,i=o(e,Bi);return Dr('img',n({src:t||'https://cdn.shopify.com/s/files/1/0849/6526/1638/files/RF-SO-Placeholder2.png?v=1735826638',className:qe('rf-image',r)},i))},Di=e=>{let{pending:t=!1,skeleton:r,children:n}=e;return!0===t?r:n},Fi=['class','className'],Ui=e=>'boolean'==typeof e?''.concat(e):0===e?'0':e,Gi=u,zi=(e,t)=>r=>{var i;if(null==(null==t?void 0:t.variants))return Gi(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:s}=t,l=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;const o=Ui(t)||Ui(n);return a[e][o]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),u=null==t||null===(i=t.compoundVariants)||void 0===i?void 0:i.reduce((e,t)=>{let{class:r,className:i}=t,a=o(t,Fi);return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes(n(n({},s),c)[t]):n(n({},s),c)[t]===r})?[...e,r,i]:e},[]);return Gi(e,l,u,null==r?void 0:r.class,null==r?void 0:r.className)},ji=['children','className','variant'],Vi=zi('rf-avatar size-[26px] rounded-full border overflow-hidden',{variants:{variant:{light:'bg-white text-black border-[#E1E1E1]',dark:'bg-[#555555] text-white border-black'}},defaultVariants:{variant:'light'}});var qi=An(e=>{let{children:t,className:r,variant:i}=e,a=o(e,ji);return Dr('div',n(n({className:qe(Vi({variant:i}),r)},a),{},{children:t}))});const Wi=['className'],Xi=e=>{let{className:t}=e,r=o(e,Wi);return Dr('div',n(n({className:qe('rf-skeleton bg-neutral-2 animate-pulse rounded-md h-[1.5em]',t)},r),{},{role:'status',children:Dr('span',{className:'rf-skeleton__sr-text sr-only',children:'Loading...'})}))},Ki=()=>Dr('div',{className:'rf-avatar-stack-skeleton flex -space-x-1',children:[Dr('div',{className:'rf-avatar-stack-skeleton__item relative bg-neutral-2 rounded-full z-[1]',children:Dr(Xi,{className:'size-[26px] rounded-full'})}),Dr('div',{className:'rf-avatar-stack-skeleton__item relative bg-neutral-2 rounded-full z-[2]',children:Dr(Xi,{className:'size-[26px] rounded-full'})}),Dr('div',{className:'rf-avatar-stack-skeleton__item relative bg-neutral-2 rounded-full z-[3]',children:Dr(Xi,{className:'size-[26px] rounded-full'})})]}),Zi=['images','variant','maxVisibleAvatars','className','pending'],Yi=e=>{let{images:t,variant:r,maxVisibleAvatars:i=2,className:a,pending:s=!1}=e,l=o(e,Zi);const c=null!=i?i:t.length;return Dr(Di,{skeleton:Dr(Ki,{}),pending:s,children:t.length>0&&Dr('div',n(n({className:qe('rf-avatar-stack flex -space-x-1',a)},l),{},{children:[t.slice(0,c).map((e,t)=>{let{src:n,alt:o}=e;return Dr(qi,{className:'relative',style:{zIndex:t+1},variant:r,children:Dr(Mi,{className:'rf-avatar-stack__image size-full object-cover',src:n,alt:o})},t)}),c<t.length&&Dr(qi,{variant:r,style:{zIndex:c+1},className:'flex items-center justify-center',children:Dr('span',{className:'rf-avatar-stack__count text-[10px]',children:['+',t.length-c]})})]}))})},Ji=()=>{var e;const{orderState:t}=Li(),r=vn(()=>{var e,r;return(null!==(e=null===(r=t.value.data)||void 0===r?void 0:r.orderData.productsToExchange)&&void 0!==e?e:[]).reduce((e,t)=>{for(let r=0;r<t.quantity;r++)e.push({src:t.image,alt:t.title});return e},[])},[null===(e=t.value.data)||void 0===e?void 0:e.orderData.productsToExchange]);return Dr(Yi,{pending:t.value.pending,variant:'light',images:r})},Qi=pr(null),$i=()=>{const[e,t]=pn(!1);return _n(()=>{t(!0)},[]),e},ea=pr(null),ta=['onClick','className','children','isVisible'],ra=e=>{let{onClick:t,className:r,children:i,isVisible:a=!0}=e,s=o(e,ta);const l=gn(null);return Dr('aside',n(n({onClick:function(e){t&&e.target===l.current&&t()},ref:l,className:qe('rf-dialog__backdrop fixed inset-0 size-full z-50 flex items-center justify-center p-6',a&&'rf-dialog__backdrop--visible bg-black/50',r)},s),{},{children:i}))},na=['isOpen','onClose','fadeIn','showBackdrop','dismissOnBackdropClick','dismissOnEscape','className'],oa=['className'],ia=['className'],aa=['className'],sa=e=>{let{className:t}=e,r=o(e,aa);return Dr('svg',n(n({width:11,height:9,viewBox:'0 0 11 9',fill:'currentColor',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--arrow-right '.concat(t||'')},r),{},{children:Dr('path',{d:'M10.273 4.427 6.66.954a.55.55 0 0 0-.387-.153.56.56 0 0 0-.387.153l-.328.316a.52.52 0 0 0 0 .749l2.107 2.03H.973a.524.524 0 0 0-.54.517v.446c0 .29.238.54.54.54H7.69L5.56 7.594a.505.505 0 0 0 0 .74l.327.314c.103.099.24.153.387.153a.56.56 0 0 0 .387-.154l3.612-3.473a.513.513 0 0 0 0-.747'})}))},la=['className'],ca=e=>{let{className:t}=e,r=o(e,la);return Dr('svg',n(n({width:11,height:11,viewBox:'0 0 11 11',fill:'currentColor',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--x '.concat(t||'')},r),{},{children:[Dr('path',{d:'M1.45 10.572a.92.92 0 0 1-.655-.221.92.92 0 0 1 0-1.299l7.82-7.82a.921.921 0 0 1 1.344 1.253l-7.865 7.866a.92.92 0 0 1-.645.22'}),Dr('path',{d:'M9.26 10.572a.92.92 0 0 1-.645-.267l-7.82-7.82a.921.921 0 0 1 1.299-1.298l7.865 7.82a.92.92 0 0 1 0 1.344.92.92 0 0 1-.7.22'})]}))},ua=['className'],da=e=>{let{className:t}=e,r=o(e,ua);return Dr('svg',n(n({width:'1.5em',height:'1.5em',viewBox:'0 0 24 24',xmlns:'http://www.w3.org/2000/svg',fill:'currentColor',className:'rf-icon rf-icon--spinner '.concat(t||'')},r),{},{children:Dr('g',{children:[Dr('path',{opacity:.14,d:'M11 1h2v5h-2z'}),Dr('path',{opacity:.29,d:'m16.634 1.974 1.732 1-2.5 4.33-1.732-1z'}),Dr('path',{opacity:.43,d:'m21.026 5.634 1 1.732-4.33 2.5-1-1.732z'}),Dr('path',{opacity:.57,d:'M23 11v2h-5v-2z'}),Dr('path',{opacity:.71,d:'m22.026 16.634-1 1.732-4.33-2.5 1-1.732z'}),Dr('path',{opacity:.86,d:'m18.366 21.026-1.732 1-2.5-4.33 1.732-1z'}),Dr('path',{d:'M13 23h-2v-5h2z'}),Dr('animateTransform',{attributeName:'transform',type:'rotate',calcMode:'discrete',dur:'0.75s',values:'0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12',repeatCount:'indefinite'})]})}))},ha=['children','className','icon','variant','pending','disabled','iconPosition'],fa=zi('disabled:cursor-not-allowed h-12 rounded-md text-base font-medium flex items-center justify-center whitespace-nowrap gap-2 px-8 relative transition-all duration-300 ease-in-out [--icon-width:auto] [--icon-height:0.65em] desktop:[--icon-height:0.75em]',{variants:{variant:{primary:'bg-button-background text-button-foreground disabled:!bg-button-background-disabled disabled:!text-button-foreground-disabled desktop:hover:opacity-80',outline:'border border-neutral-2 text-black bg-transparent disabled:!text-button-foreground-disabled desktop:hover:opacity-80',ghost:'text-neutral-3 font-normal gap-1 disabled:!opacity-50 disabled:cursor-not-allowed desktop:hover:opacity-80'}}});var ma=An(e=>{let{children:t,className:r,icon:i,variant:a='primary',pending:s=!1,disabled:l=!1,iconPosition:c='right'}=e,u=o(e,ha);return Dr('button',n(n({'aria-busy':s,disabled:l||s,type:'button',className:qe(fa({variant:a}),'rf-button','rf-button--'.concat(a),r)},u),{},{children:[s&&Dr(da,{className:'absolute inset-0 m-auto'}),Dr('span',{className:'rf-button__text',style:{visibility:s?'hidden':'visible'},children:t}),!!i&&Dr(i,{style:{visibility:s?'hidden':'visible'},className:qe('rf-button__icon w-[var(--icon-width)] h-[var(--icon-height)]','left'===c?'-order-1':'order-1')})]}))});const pa=['className'],_a=['className'];var ga={Accept:e=>{let{className:t}=e,r=o(e,pa);return Dr(ma,n({className:qe('rf-dialog__button rf-dialog__button--accept w-full',t),icon:sa},r))},Reject:e=>{let{className:t}=e,r=o(e,_a);return Dr(ma,n({className:qe('rf-dialog__button rf-dialog__button--reject w-full',t),variant:'outline',icon:ca,iconPosition:'left'},r))}};const va={Modal:e=>{let{isOpen:t,onClose:r,fadeIn:i=!0,showBackdrop:a=!0,dismissOnBackdropClick:s=!0,dismissOnEscape:l,className:c}=e,u=o(e,na);const d=(()=>{const e=yn(ea);if(!e)throw new Error('useRoot must be used within a RootProvider');return()=>e.current||document.getElementById(Nr)})(),h=$i();if(_n(()=>{const e=e=>{'Escape'===e.key&&(e.preventDefault(),null==r||r())};return l&&(t?document.addEventListener('keydown',e):document.removeEventListener('keydown',e)),()=>{l&&document.removeEventListener('keydown',e)}},[l,r,t]),!t||!h)return null;const f=d();if(!f)return Ve.error('Root element not found'),null;const m={isOpen:t,onClose:r};return function(e,t){var r=jt(Gn,{__v:e,h:t});return r.containerInfo=t,r}(Dr(ra,{className:i?'animate-fade-in':void 0,isVisible:a,onClick:s?r:void 0,children:Dr(Qi.Provider,{value:m,children:Dr('div',n({className:qe('rf-dialog m-auto w-full p-8 rounded-lg bg-white shadow-lg max-w-2xl',c)},u))})}),f)},Title:e=>{let{className:t}=e,r=o(e,oa);return Dr('h2',n({className:qe('rf-dialog__title text-2xl font-medium leading-tight',t)},r))},Subtitle:e=>{let{className:t}=e,r=o(e,ia);return Dr('p',n({className:qe('rf-dialog__subtitle text-neutral-3 py-2.5 leading-tight',t)},r))},Accept:ga.Accept,Reject:ga.Reject},ba=()=>{const{config:{isFirstLoad:e}}=Ri(),[t,r]=pn(null);return Ai(t=>{if(t(),function(){const e=window.location.pathname;return e.includes('/cart')||e.includes('/checkout')}())r('cart_detection');else if(!e){const e=De(Re);e&&Date.now()>e&&(Fe(Re),r('cookie_detection'))}},[]),t?Dr(ya,{decisionState:t}):null};function ya(e){let{decisionState:t}=e;const r=Si('dialog.return_decision.'.concat(t)),{widgetViewState:o}=Ri(),a=function(){const e=Ii(arguments.length>0&&void 0!==arguments[0]&&arguments[0]),t=()=>e.set(!1);return{register:()=>({isOpen:e.value,onClose:t}),state:e}}(!0),s=a.register();return Dr(va.Modal,n(n({className:'text-center flex flex-col gap-2 items-center'},s),{},{children:[Dr(Ji,{}),Dr(va.Title,{children:r('title')}),Dr(va.Subtitle,{children:r('subtext')}),Dr(va.Accept,{onClick:function(){s.onClose(),'cart_detection'===t&&o.set(i.Open)},children:r('confirm')}),Dr(va.Reject,{onClick:function(){Hi.exit()},children:r('reject')})]}))}const wa=()=>Dr(qt,{children:Dr(ba,{})}),Ea=5e3,Na=pr({}),xa=()=>{const e=yn(Na);if(!e)throw new Error('useToast must be used within a ToastProvider');return e},ka=()=>{const{widgetViewState:e,config:t}=Ri(),r=Li(),n=xa();_n(()=>(function(e){let{widgetViewState:t,returnContext:r,toastContext:n,config:o}=e;mt.widgetViewState=t,mt.returnContext=r,mt.toastContext=n,mt.config=o,mt.isInitialized=!0,wt('ready')}({widgetViewState:e,returnContext:r,toastContext:n,config:t}),()=>{pt()}),[e,r,n,t]),_n(()=>{e.value===i.Open?wt('drawer:open'):wt('drawer:close')},[e.value]),_n(()=>{var e;const t=null===(e=r.cartState.value.data)||void 0===e?void 0:e.original;t&&wt('cart:updated',t)},[r.cartState.value.data]),_n(()=>{const e=r.calculationState.value.data;e&&wt('calculation:updated',e)},[r.calculationState.value.data])};var Ca;(e=>{e.Unknown='unknown_error',e.NetworkError='network_error',e.ProductLimit='product_limit'})(Ca||(Ca={}));const Sa={422:Ca.ProductLimit};function Ta(e){return null!==e&&e in Sa?Sa[e]:Ca.Unknown}function Ia(e){var t;Ve.info('Initializing fetch interceptor');const r=window.fetch;null!==(t=window.__rf_original_fetch)&&void 0!==t||(window.__rf_original_fetch=r),window.fetch.rf_interception=!0;const n=new Proxy(r,{apply:async(t,r,n)=>{const o=n[0],i=await Reflect.apply(t,r,n),a=null==i?void 0:i.clone();return null==e||e({response:a,requestUrl:o}),i}});return window.fetch=n,e=>{window.__rf_original_fetch&&(Ve.info('Resetting fetch interceptor'),window.fetch=window.__rf_original_fetch,window.fetch.rf_interception=!1,e&&clearInterval(e))}}function Aa(e){var t;Ve.info('Initializing XHR interceptor');const r=window.XMLHttpRequest;null!==(t=window.__rf_original_xhr)&&void 0!==t||(window.__rf_original_xhr=r);const n=new Proxy(r,{construct:function(t,r){const n=new t(...r),o=n.open,i=n.send;let a='';return n.open=function(e,t,r,n,i){return a=t,o.call(this,e,t,null!=r&&r,n,i)},n.send=function(t){const r=n.onreadystatechange;n.onreadystatechange=function(t){if(r&&r.call(this,t),n.readyState===XMLHttpRequest.DONE)try{null==e||e(Pa(n,a))}catch(e){Ve.error('Error in XHR interception callback:',e)}};const o=n.onload;return n.onload=function(t){if(o&&o.call(this,t),n.readyState===XMLHttpRequest.DONE)try{null==e||e(Pa(n,a))}catch(e){Ve.error('Error in XHR interception callback:',e)}},i.call(this,t)},n}});return window.XMLHttpRequest.rf_interception=!0,window.XMLHttpRequest=n,e=>{window.__rf_original_xhr&&(Ve.info('Resetting XHR interceptor'),window.XMLHttpRequest=window.__rf_original_xhr,window.XMLHttpRequest.rf_interception=!1,e&&clearInterval(e))}}function Pa(e,t){var r;let n;const o='text'===e.responseType,i='json'===e.responseType||(null===(r=e.getResponseHeader('Content-Type'))||void 0===r?void 0:r.includes('application/json'));if(o)try{n=JSON.parse(e.response)}catch(e){}else i&&(n=e.response);return{response:n,requestUrl:t}}const Ra=['/cart/add','/cart/add.js'],Ha=['/cart/update','/cart/update.js'],Oa=['/cart/change','/cart/change.js'],La={add:Ra,update:Ha,change:Oa},Ba=[...Ra,...Ha,...Oa,'/cart/clear','/cart/clear.js','/?section_id=cart-drawer','/api/unstable/graphql.json?operation_name=cartQuery'];const Ma=pr({}),Da=()=>{const e=yn(Ma);if(!e)throw new Error('useErrors must be used within an ErrorProvider');return e},Fa=()=>{const e=Si(),{add:t}=xa(),{cartState:r,orderState:o,calculationState:i}=Li(),{config:{data:{returnData:a}}}=Ri(),s=Da(),l=vn(()=>{var e;return null!==(e=null==a?void 0:a.items)&&void 0!==e?e:[]},[null==a?void 0:a.items]),c=bn((e,t)=>{const r=null==t?void 0:t.items.find(t=>t.variant_id===e.variant_id);return!r||r.quantity!==e.quantity},[]),u=bn((r,n)=>{const o=r.excludedItems.filter(e=>c(e,n)),i=r.bundleItems.filter(e=>c(e,n));o.length>0&&t({tone:'error',message:e.rich('toast.product_exchange_error',{product_name:o[0].title,b:e=>Dr('span',{className:'text-neutral-3 inline-block',children:e})})}),i.length>0&&t({tone:'error',message:e.rich('toast.bundle_exchange_error',{product_name:i[0].title,b:e=>Dr('span',{className:'text-neutral-3 inline-block',children:e})})})},[c,e,t]);return{fetchAndUpdateCart:bn(async()=>{var e,t;const i=o.value.data;if(!i)return null;const a=null!==(e=null===(t=r.value.data)||void 0===t?void 0:t.original)&&void 0!==e?e:null;let s;try{s=await nt(!1)}catch(e){return r.set(t=>n(n({},t),{},{pending:!1,error:e})),null}const l=i.orderData.productRules,c=tt(s,l);u(c,a);const d=!a||!rt({cart1:a,cart2:s,rules:l});return r.set({data:{original:s,transformed:c.cart},pending:!1,error:null}),st(s),{order:i,originalCart:a,freshCart:s,transformedCart:c.cart,productRules:l,hasChanged:d}},[o,r,u]),processCartUpdate:bn(async e=>{var t,n;const a=o.value.data;if(!a)return null;const s=null!==(t=null===(n=r.value.data)||void 0===n?void 0:n.original)&&void 0!==t?t:null,c=a.orderData.productRules,d=tt(e,c);return u(d,s),r.set({data:{original:e,transformed:d.cart},pending:!1,error:null}),st(e),await i.query({cart:d.cart,orderId:a.orderData.id,lineItems:l}),{transformedCart:d.cart,productRules:c}},[o,r,i,l,u]),handleResponseErrors:bn(async t=>{const r=await async function(e){if(e){if(e instanceof Response)return await e.json().catch(()=>{});if('string'==typeof e)try{return JSON.parse(e)}catch(e){return}return e}}(t);if(r){let t;if('status'in r){const e=r.status;t='number'==typeof e?e:void 0}if(t&&!s.has(t)){const r=Ta(t);s.push({id:r,message:e('product.error.'.concat(r))})}}},[e,s]),triggerCalculation:bn((e,t)=>{i.query({cart:e,orderId:t,lineItems:l})},[i,l])}},Ua=()=>{const{widgetViewState:e,returnViewState:t,config:{options:{autoOpen:r,autoOpenTriggerEndpoint:n,autoOpenTriggerMethod:o,monitorNetworkOverwrites:s,networkInterceptionMethod:l}}}=Ri(),{fetchAndUpdateCart:c,handleResponseErrors:u,triggerCalculation:d}=Fa(),[h,f]=pn(!1);_n(()=>{if('none'!==l){let e;try{e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{monitor:r=!1,method:n}=t;if('none'===n)return Ve.warn('Network interception method set to \'none\'; skipping interceptor initialization.'),()=>{};let o,i,a,s;switch(n){case'fetch':a='fetch',o=Ia(e);break;case'xhr':a='xhr',i=Aa(e);break;default:a='both',o=Ia(e),i=Aa(e)}return Ve.info('Using network interception method: '.concat(a)),r&&(Ve.info('Monitoring network interceptors'),s=setInterval(()=>{o&&!window.fetch.rf_interception&&(Ve.info('Re-initializing fetch interceptor'),o(s),o=Ia(e)),i&&!window.XMLHttpRequest.rf_interception&&(Ve.info('Re-initializing XHR interceptor'),i(s),i=Aa(e))},200)),()=>{var e,t;null===(e=o)||void 0===e||e(s),null===(t=i)||void 0===t||t(s)}}(e=>Sr.publish(kr.FetchInterception,e),{monitor:s,method:l}),f(!0)}catch(e){Ve.error('Error initializing fetch interceptor:',e)}return()=>{var t;null===(t=e)||void 0===t||t()}}f(!1)},[s,l]);const m=bn(async s=>{let{detail:{response:l,requestUrl:h}}=s;const f=h instanceof URL?h.toString():h,m=function(e,t){const r=La[null!=t?t:'add'];if(!e||'string'!=typeof e)return{isValid:!1,isForbidden:!1,isTriggerEndpoint:!1,triggerEndpointPaths:r};const n=['?_','rf=true'].some(t=>e.includes(t)),o=Ba.some(t=>e.includes(t)),i=r.some(t=>e.includes(t));return!n&&o?{isValid:!0,isForbidden:!1,isTriggerEndpoint:i,triggerEndpointPaths:r}:{isValid:!1,isForbidden:n,isTriggerEndpoint:i,triggerEndpointPaths:r}}(f,n),{isValid:p,isForbidden:_,isTriggerEndpoint:g}=m;if(!p||_)return void Ve.info('Intercepted request to '.concat(f,' is invalid or forbidden.'),m);Ve.info('Intercepted request to '.concat(f),m);const v=await c();if(!v)return;const{transformedCart:b,hasChanged:y}=v;switch(await u(l),y&&d(b,v.order.orderData.id),o){case'change':if(!y)return;break;case'endpoint':if(!g)return;break;default:if(!g||!y)return}t.set(a.Collapsed),!1!==r&&e.set(i.Open)},[c,u,d,e,t,r,n,o]);return _n(()=>{const e=Sr.subscribe(kr.FetchInterception,m);return()=>{e()}},[m]),{initialized:h}},Ga=()=>{const{widgetViewState:e,config:{options:{overrideScrollBlocking:t}}}=Ri();_n(()=>{if(!t)return;Ve.info('Overriding scroll blocking behavior');const e=Event.prototype.preventDefault;return Event.prototype.preventDefault=function(){'wheel'!==this.type&&'mousewheel'!==this.type&&'DOMMouseScroll'!==this.type&&'touchmove'!==this.type&&e.call(this)},()=>{Event.prototype.preventDefault=e}},[t,e.value])};const za=()=>{const{widgetViewState:e,config:{options:{cartActivatorSelector:t}}}=Ri();_n(()=>{if(!t)return;const r=new AbortController,n=new WeakSet,o=t=>{Ve.info('Cart activator clicked',t),t.preventDefault(),t.stopPropagation(),e.set(i.Open)},a=()=>{try{const e=document.querySelectorAll(t);e.length>0&&(Ve.info('Attaching click listeners to cart activators',e),(e=>{e.forEach(e=>{if(!n.has(e))try{const t=(e=>{const t=e.parentNode;if(t){const r=e.cloneNode(!0);return t.replaceChild(r,e),r}return e})(e);t.removeAttribute('onclick'),t.addEventListener('click',o,{signal:r.signal}),n.add(t)}catch(e){Ve.error('Failed to attach listener to cart activator',e)}})})(e))}catch(e){Ve.error('Failed to set cart activator selector',e)}};a();const s=new MutationObserver(e=>{let r=!1;e.forEach(e=>{e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){var n,o;const i=e;null!==(n=i.matches)&&void 0!==n&&n.call(i,t)&&(r=!0),(null===(o=i.querySelectorAll)||void 0===o?void 0:o.call(i,t).length)>0&&(r=!0)}}),e.removedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){var r,n;const o=e;null!==(r=o.matches)&&void 0!==r&&r.call(o,t)||null===(n=o.querySelectorAll)||void 0===n||n.call(o,t).length}})}),r&&(Ve.info('Reinitializing cart activators'),setTimeout(()=>{a()},0))});return s.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),()=>{r.abort(),s.disconnect()}},[t,e])},ja=()=>(Ua(),za(),Ga(),(()=>{const{widgetViewState:e}=Ri(),{fetchAndUpdateCart:t,triggerCalculation:r}=Fa(),n=bn(()=>{e.set(i.Open)},[e]),o=bn(()=>{e.set(i.Collapsed)},[e]),a=bn(()=>{let t;t=e.value===i.Open?i.Collapsed:i.Open,e.set(t)},[e]),s=bn(async()=>{const e=await t();null!=e&&e.hasChanged&&r(e.transformedCart,e.order.orderData.id)},[t,r]),l=bn(async()=>{await t()},[t]),c=bn(async()=>{const e=await t();null!=e&&e.hasChanged&&r(e.transformedCart,e.order.orderData.id)},[t,r]),u=bn(async()=>{const e=await t();null!=e&&e.hasChanged&&(n(),r(e.transformedCart,e.order.orderData.id))},[t,n,r]);_n(()=>{const e=Sr.subscribe(Cr.DrawerOpen,n),t=Sr.subscribe(Cr.DrawerClose,o),r=Sr.subscribe(Cr.DrawerToggle,a),i=Sr.subscribe(Cr.CalculationRefetch,s),d=Sr.subscribe(Cr.CartRefetch,l),h=Sr.subscribe(Cr.CartAndCalculationRefetch,c),f=Sr.subscribe(Cr.DrawerOpenAndRefetch,u);return()=>{e(),t(),r(),i(),d(),h(),f()}},[n,o,a,s,l,c,u])})(),ka(),null),Va=e=>{let{children:t}=e;return $i()?t:null},qa=['array'],Wa=e=>{var t,r,i,a;let{children:s}=e;const l=Si(),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const[t,r]=pn(e),n=bn(e=>{r(e)},[]),o=bn(e=>{r(t=>{if(Array.isArray(e)){const r=e.filter(e=>!t.some(t=>t.id===e.id));return[...t,...r]}return t.some(t=>t.id===e.id)?t:[...t,e]})},[]),i=bn(e=>{r(t=>t.filter(t=>t.id!==e))},[]),a=bn(()=>{r([])},[]),s=bn(e=>t.some(t=>t.id===e),[t]);return{array:t,set:n,push:o,remove:i,clear:a,has:s}}(),{array:u}=c,d=o(c,qa),{cartState:h,orderState:f,calculationState:m}=Li(),p=null===(t=f.value.data)||void 0===t?void 0:t.orderData,_=null===(r=m.value.data)||void 0===r?void 0:r.lineItems,g=null!==(i=null===(a=h.value.data)||void 0===a?void 0:a.transformed.item_count)&&void 0!==i?i:0,v=vn(()=>{const e=[];if(p&&_&&Array.isArray(_)){var t;const{refundReturnWindow:r=!0}=null!==(t=p.returnWindows)&&void 0!==t?t:{},n='refund-window-expired';if(!r&&0===g){const t=l('product.error.refund_expired');e.push({id:n,message:t,blocking:!0})}const o=et(p.productRules,'NO_REFUND'),i=_.filter(e=>{const t=Qe(e.productId);return!!t&&o.includes(Number(t))});if(i.length>0&&0===g){const t=i.map(e=>{const t=p.productsToExchange.find(t=>t.id===e.id);if(!t)return null;let r=t.title;return t.variantTitle&&(r+=' ('.concat(t.variantTitle,')')),r}).filter(Boolean).join(', '),r=l.rich('product.error.no_refund',{product_name:t,b:e=>{if(!e)return null;const t=e.toString().split(', ');return t.map((e,r)=>{let n=null;return r===t.length-2?n=' '.concat(l('common.and'),' '):r<t.length-1&&(n=', '),Dr(qt,{children:[Dr('span',{className:'text-neutral-3',children:e}),n]},r)})}});e.push({id:n,message:r,blocking:!0})}}return e.concat(u)},[u,p,_,g,l]),b=n({errors:v},d);return Dr(Ma.Provider,{value:b,children:s})},Xa=e=>{const{id:t,initialValue:r=null,queryFn:o,queryOnInit:i=!0,onError:a,startCount:s=0}=e,[l,c]=pn({data:r,pending:i,error:null}),u=gn(!0),[d,h]=pn(s),f=gn(d),m=bn(function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];const s=r[0],l=f.current+1;f.current=l,h(l),c(e=>n(n({},e),{},{pending:!0,error:null}));return(async()=>{try{Ve.info('AsyncState Query Started (Count: '.concat(l,')'),t?' (ID: '.concat(t,')'):'');const e=await(0===r.length?o(l):o(l,s));return f.current!==l?(Ve.info('AsyncState Query Stale - Ignoring (Count: '.concat(l,', Current: ').concat(f.current,')'),t?' (ID: '.concat(t,')'):''),null):(c({data:e,pending:!1,error:null}),Ve.info('AsyncState Query Resolved (Count: '.concat(l,')'),t?' (ID: '.concat(t,')'):'',e),e)}catch(e){if(f.current!==l)return null;const r=e;let n='AsyncState Query Failed (Count: '.concat(l,')');return t&&(n+=' (ID: '.concat(t,')')),Ve.error(''.concat(n,':'),'['.concat(r,']'),s),c({data:null,pending:!1,error:r}),null==a||a(r),null}})()},[o,t,a]);_n(()=>{if(u.current&&i){u.current=!1;void 0!==e&&'initialParams'in e?m(e.initialParams):m()}},[m,i,e]);const p=l.pending&&null===l.data;return{value:l,set:c,query:m,count:d,initialFetch:p}},Ka=e=>{var t;let{children:r}=e;const{returnViewState:n,config:o}=Ri(),i=o.isFirstLoad,s=Xa({id:'cart',queryOnInit:!1,queryFn:async(e,t)=>{const r=window.location.pathname.startsWith('/cart'),o=1===e,i=!o||r,s=await nt(!i);0!==s.item_count&&o&&n.set(a.Collapsed);const{cart:l}=tt(s,t.orderData.productRules);return{transformed:l,original:s}}}),l=Xa({id:'order',queryFn:async()=>{const e=await Pr(o);if(e.updatedCart&&i){const{cart:t}=tt(e.updatedCart,e.orderData.productRules);s.set({data:{original:e.updatedCart,transformed:t},pending:!1,error:null})}else s.query(e);return e}}),c=Xa({id:'calculation',queryOnInit:!1,queryFn:async(e,t)=>{var r,n,i;const a=o.id,s=(null===(r=t.cart)||void 0===r?void 0:r.items)||[];if(a){const{origin:e,pathname:t,search:r}=window.location,n=new URLSearchParams(r);n.set(wr,a);!async function(e,t){try{Ve.info('Setting session cache for internalId:',e,t);const r=await Ar('/shop-overlay/session/'.concat(e),{method:'PATCH',body:{data:t}});return Ve.info('Session cache set successfully:',r),r}catch(e){throw Ve.error('Error setting session cache:',e),e}}(a,{lastPath:''.concat(e).concat(t,'?').concat(n.toString()),returnItems:Array.isArray(s)?s.map(e=>{var t,r;return{variantId:e.variant_id,handle:e.handle,price:(r=e.price,We(r)?0:r/100),title:e.product_title,variantTitle:null!==(t=e.variant_title)&&void 0!==t?t:'',image:e.image,quantity:e.quantity||1}}):[]})}return async function(e,t){let{orderId:r,cart:n,lineItems:o}=e;const i=(o||[]).map(e=>{var t,r;let n=null!==(t=null===(r=e.action)||void 0===r?void 0:r.toUpperCase())&&void 0!==t?t:'EXCHANGE';return'SWAP'===n&&(n='EXCHANGE'),{id:e.id,returnOrderLineId:e.id,lineItemId:e.lineItemId,quantity:1,action:n}}),a=(n.items||[]).map(e=>({variantId:'gid://shopify/ProductVariant/'.concat(e.variant_id),quantity:e.quantity}));return Ar('/calculation/'.concat(r),{method:'POST',body:{lineItems:i,exchangeTo:a,numOfLabels:t}})}(t,null!==(n=null===(i=o.data.returnData)||void 0===i?void 0:i.numOfLabels)&&void 0!==n?n:1)}}),[u]=Ai(e=>{var t;const r=l.value.data,n=null===(t=s.value.data)||void 0===t?void 0:t.transformed;if(r&&n){var i,a;e();const t=null!==(i=null===(a=o.data.returnData)||void 0===a?void 0:a.items)&&void 0!==i?i:[];c.query({cart:n,orderId:r.orderData.id,lineItems:t})}},[l.value.data,s.value.data,c.query,null===(t=o.data.returnData)||void 0===t?void 0:t.items]),d=!u||s.value.pending||c.value.pending,h=vn(()=>l.value.error||s.value.error||c.value.error,[l.value.error,s.value.error,c.value.error]),f=Boolean(h),m=vn(()=>({orderState:l,cartState:s,calculationState:c,isPending:d,hasFailed:f}),[l,s,c,d,f]);return Dr(Oi.Provider,{value:m,children:r})},Za=()=>{const{config:{theme:e}}=Ri(),t=vn(()=>{if(e)return Object.entries(e).reduce((e,t)=>{let[r,n]=t;const o=function(e){e=e.replace('#','');const t=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=Math.max(t,r,n),i=Math.min(t,r,n),a=o-i,s=(o+i)/2;let l=0,c=0;if(0!==a)switch(c=s>.5?a/(2-o-i):a/(o+i),o){case t:l=((r-n)/a+(r<n?6:0))/6;break;case r:l=((n-t)/a+2)/6;break;case n:l=((t-r)/a+4)/6}const u=Math.round(360*l),d=Math.round(100*c),h=Math.round(100*s);return''.concat(u,', ').concat(d,'%, ').concat(h,'%')}(n);return e['--'.concat(r)]=o,e},{})},[e]);return{theme:e,cssVariables:t}},Ya=e=>{const t=gn(null),{cssVariables:r}=Za();return Dr(ea.Provider,{value:t,children:Dr('div',n({onTouchStart:e=>e.stopPropagation(),className:'rf-root',ref:t,id:Nr,style:r},e))})},Ja=['children'],Qa=e=>{let{children:t}=e,r=o(e,Ja);const n=Ii(i.Collapsed,e=>{Sr.publish(kr.DrawerStateChange,{state:e}),document.querySelectorAll('[inert]').forEach(e=>{e.removeAttribute('inert')})}),s=Ii(a.Open),l=vn(()=>({widgetViewState:n,returnViewState:s,config:r}),[n,s,r]);return Dr(Pi.Provider,{value:l,children:t})},$a=['duration'],es=e=>{let{children:t}=e;const[r,i]=pn([]),a=bn(e=>{i(t=>t.map(t=>{var r;t.id===e&&(null===(r=t.onClose)||void 0===r||r.call(t));return t.id===e?n(n({},t),{},{isVisible:!1}):t})),setTimeout(()=>{i(t=>t.filter(t=>t.id!==e))},300)},[]),s=bn(e=>{let{duration:t=Ea}=e,r=o(e,$a);const s=r.id||'toast-'.concat(Math.random().toString(36).substr(2,9));return i(e=>[...e,n(n({},r),{},{id:s,duration:t,isVisible:!0})]),setTimeout(()=>a(s),t),s},[a]),l=bn(()=>{i(e=>e.map(e=>{var t;return null===(t=e.onClose)||void 0===t||t.call(e),n(n({},e),{},{isVisible:!1})})),setTimeout(()=>{i([])},300)},[]),c={queue:r,add:s,remove:a,clear:l};return Dr(Na.Provider,{value:c,children:t})};const ts=['className'],rs=e=>{let{className:t}=e,r=o(e,ts);return Dr('svg',n(n({width:21,height:21,viewBox:'0 0 21 21',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--action '.concat(t||'')},r),{},{children:[Dr('rect',{x:.5,y:.679,width:20,height:20,rx:10,className:'fill-[var(--icon-fill-1,_#000)]'}),Dr('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M11.517 6.04q.088.055.127.157c.025.066.03.14.013.209l-.775 3.13h2.826q.088 0 .16.052a.3.3 0 0 1 .108.14.35.35 0 0 1-.055.348l-4.083 4.822a.3.3 0 0 1-.168.098.27.27 0 0 1-.187-.037.3.3 0 0 1-.127-.156.35.35 0 0 1-.013-.21l.775-3.129H7.292a.27.27 0 0 1-.16-.053.3.3 0 0 1-.108-.14.35.35 0 0 1 .055-.348l4.083-4.821a.3.3 0 0 1 .168-.098.27.27 0 0 1 .187.037',className:'fill-[var(--icon-fill-2,_#fff)]'})]}))},ns=['className'],os=e=>{let{className:t}=e,r=o(e,ns);return Dr('svg',n(n({width:21,height:21,viewBox:'0 0 21 21',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--info '.concat(t||'')},r),{},{children:[Dr('path',{className:'fill-[var(--icon-fill-2,_#fff)]',d:'M6.856 4.628h7.288v12.226H6.856z'}),Dr('path',{className:'fill-[var(--icon-fill-1,_#000)]',d:'M17.572 3.67C13.666-.235 7.335-.236 3.429 3.67c-3.905 3.905-3.905 10.237 0 14.143 3.905 3.904 10.237 3.904 14.143 0 3.905-3.906 3.904-10.238 0-14.143m-5.768 11.419a1.304 1.304 0 1 1-2.609 0V9.87a1.304 1.304 0 1 1 2.61 0zm-1.327-7.447c-.752 0-1.252-.532-1.237-1.19-.015-.688.485-1.204 1.252-1.204s1.252.516 1.268 1.205c0 .657-.5 1.189-1.283 1.189'})]}))},is=['className'],as=e=>{let{className:t}=e,r=o(e,is);return Dr('svg',n(n({width:20,height:15,viewBox:'0 0 20 15',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--giftcard fill-[var(--icon-fill-1,_currentColor)] '.concat(t||'')},r),{},{children:[Dr('path',{d:'M8.23 3.129c-.288 0-.602.11-.82.37-.284.342-.373 1.362-.363 1.877.48.012 1.4-.001 1.771-.395.39-.411.496-1.13.082-1.568a.9.9 0 0 0-.67-.284m-3.666 0c.288 0 .603.11.82.37.284.342.373 1.362.363 1.877-.48.012-1.399-.001-1.77-.395-.39-.411-.496-1.13-.083-1.568a.9.9 0 0 1 .67-.284'}),Dr('path',{d:'M9.806 2.447c.73.773.828 1.99.328 2.929H20V1.948C20 .872 19.178 0 18.165 0H7.038v2.103c.9-.54 2.036-.43 2.768.344.417.44-.732-.775 0 0M4.347 9.21l-.91-.962L4.85 6.74H0v6.312C0 14.128.821 15 1.835 15h3.919V7.71zm3.589-2.47L9.33 8.236l-.912.959-1.38-1.48V15h11.126C19.18 15 20 14.128 20 13.052V6.74zM2.659 5.376c-.5-.939-.403-2.157.327-2.929.732-.775 1.869-.883 2.768-.344V0h-3.92C.822 0 0 .872 0 1.948v3.428z'})]}))},ss=['className'],ls=e=>{let{className:t}=e,r=o(e,ss);return Dr('svg',n(n({width:30,height:27,viewBox:'0 0 30 27',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--warning fill-[var(--icon-fill-1,_#000)] '.concat(t||'')},r),{},{children:[Dr('path',{d:'M15 18.904c-.81 0-1.49.68-1.49 1.49s.68 1.489 1.49 1.489c.78 0 1.489-.68 1.453-1.454A1.454 1.454 0 0 0 15 18.904'}),Dr('path',{d:'M28.784 24.182a5.09 5.09 0 0 0 .012-5.147L19.467 2.88A5.07 5.07 0 0 0 15.006.289c-1.87 0-3.539.97-4.462 2.585l-9.34 16.173a5.13 5.13 0 0 0 .017 5.177 5.1 5.1 0 0 0 4.45 2.555h18.633c1.865 0 3.539-.97 4.48-2.597m-2.025-1.167a2.82 2.82 0 0 1-2.46 1.423H5.665a2.78 2.78 0 0 1-2.43-1.394 2.82 2.82 0 0 1-.006-2.841l9.34-16.167a2.76 2.76 0 0 1 2.437-1.412c1.018 0 1.93.53 2.436 1.417l9.335 16.168c.5.87.494 1.918-.018 2.806'}),Dr('path',{d:'M14.63 8.45c-.709.202-1.15.846-1.15 1.626.036.47.066.947.102 1.418l.303 5.343A1.09 1.09 0 0 0 15 17.886c.608 0 1.085-.471 1.114-1.085 0-.369 0-.708.036-1.084.066-1.15.137-2.3.203-3.449.035-.744.101-1.49.137-2.234a1.8 1.8 0 0 0-.137-.744 1.49 1.49 0 0 0-1.722-.84'})]}))},cs=()=>Dr(Xi,{className:'h-12 rounded-lg'}),us=['className','children','tone','border','icon','pending'],ds=zi('rf-banner text-black rounded-lg flex items-center gap-2.5 p-3 min-h-12 font-medium leading-tight',{variants:{tone:{info:'rf-banner--info bg-banner-info-background [--icon-fill-1:hsl(var(--rf-c-banner-info-foreground))]',tip:'rf-banner--tip bg-banner-tip-background [--icon-fill-1:hsl(var(--rf-c-banner-tip-foreground))]',action:'rf-banner--action bg-banner-action-background [--icon-fill-1:hsl(var(--rf-c-banner-action-foreground))]',error:'rf-banner--error bg-banner-error-background [--icon-fill-1:hsl(var(--rf-c-banner-error-foreground))]',giftcard:'rf-banner--giftcard bg-[#F1F3FE] [--icon-fill-1:hsl(var(--rf-c-primary))]'},border:{dashed:'border border-dashed border-[color:var(--icon-fill-1)]'}},defaultVariants:{tone:'info'}}),hs={className:'rf-banner__icon',width:20,height:20};function fs(e){switch(e){case'action':return Dr(rs,n({},hs));case'error':return Dr(ls,n({},hs));case'giftcard':return Dr(as,n({},hs));default:return Dr(os,n({},hs))}}var ms=An(e=>{var t;let{className:r,children:i,tone:a,border:s,icon:l,pending:c=!1}=e,u=o(e,us);return Dr(Di,{skeleton:Dr(cs,{}),pending:c,children:Dr('aside',n(n({className:qe(ds({tone:a,border:s}),r)},u),{},{children:[fs(null!==(t=null!=l?l:a)&&void 0!==t?t:'info'),Dr('span',{className:'rf-banner__text flex-1',children:i})]}))})});const ps=()=>{var e,t,r,n;const o=Si('banner'),{orderState:i,calculationState:a}=Li(),s=null!==(e=null===(t=i.value.data)||void 0===t?void 0:t.orderData.instantExchange)&&void 0!==e&&e,l=null!==(r=null===(n=a.value.data)||void 0===n?void 0:n.returnLabelPrice)&&void 0!==r?r:0;return i.value.data&&a.value.data?Dr(ms,s?{className:'rf-exchange-banner',tone:'action',children:o('fast_exchange')}:0===l?{className:'rf-exchange-banner',tone:'tip',children:o('free_shipping_label')}:{children:o('exchange_info')}):Dr(cs,{})},_s=['fractionDigits'],gs=['currencyDisplay'],vs=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{config:i}=Ri(),{calculationState:a,cartState:s}=Li(),l=null===(e=s.value.data)||void 0===e?void 0:e.transformed.currency,c=null===(t=a.value.data)||void 0===t?void 0:t.currency.localCurrency,u=r.currency||c||i.currency||l||'DKK',d=Ti(),h=bn(e=>{var t;const r=null===(t=a.value.data)||void 0===t?void 0:t.currency;return e*Xe(null==r?void 0:r.exchangeRate,1)},[a.value.data]);return{format:bn((e,t)=>{'string'==typeof e&&(e=parseFloat(e));const i=n(n({},r),t),{fractionDigits:a=2}=i,s=o(i,_s),l=n({currency:u,minimumFractionDigits:a,maximumFractionDigits:a},s),{currencyDisplay:c}=l,h=o(l,gs);return'none'===c?d.number(e,h):d.number(e,n({style:'currency',currencyDisplay:c},h))},[d,r,u]),applyExchangeRate:h,currency:u}},bs=()=>{var e,t;const{applyExchangeRate:r}=vs(),{calculationState:o,cartState:i}=Li(),a=i.value.data,s=o.value.data;return n({itemCount:null!==(e=null===(t=i.value.data)||void 0===t?void 0:t.transformed.item_count)&&void 0!==e?e:0},vn(()=>{var e;if(!s||!a)return{orderTotal:0,cartTotal:0,returnTotal:0,giftcardValue:0,totalPriceDiscount:0,giftCardBonusAmount:0,returnLabelPrice:0,isRefunding:!1};const{orderSubtotal:t,returnSubtotal:n,total:o,refundMethods:i,discountSummary:l,giftCardBonusAmount:c,returnLabelPrice:u}=s,d=r(null!==(e=null==l?void 0:l.appliedToReturnSubtotal)&&void 0!==e?e:0),h=Xe(r(null==i?void 0:i.giftcard)),f=r(n)-h,m=Math.abs(r(o));return{orderTotal:r(t),cartTotal:f,returnTotal:m,giftcardValue:h,totalPriceDiscount:d,giftCardBonusAmount:r(c),returnLabelPrice:r(u),isRefunding:o>0}},[s,a,r]))},ys=['className'],ws=e=>{let{className:t}=e,r=o(e,ys);return Dr('svg',n(n({width:12,height:12,viewBox:'0 0 13 13',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--star '.concat(t||'')},r),{},{children:Dr('path',{d:'m6.11 1.06 1.7 3.62 3.8.584-2.75 2.817.65 3.979-3.4-1.88-3.398 1.88.649-3.98L.61 5.265l3.8-.584z',fill:'currentColor',stroke:'currentColor',strokeWidth:1.111,strokeLinecap:'round',strokeLinejoin:'round'})}))},Es=['value','compareAtValue','pending','className'];var Ns=An(e=>{let{value:t=0,compareAtValue:r,pending:i,className:a}=e,s=o(e,Es);const{format:l}=vs();return Dr(Di,{skeleton:Dr(Xi,{className:'w-20'}),pending:i,children:Dr('span',n(n({className:qe('rf-price font-medium text-base inline-flex flex-col items-end',a)},s),{},{children:[Dr('span',{className:'rf-price__value',children:l(t)}),!We(r)&&r>t&&Dr('span',{className:'rf-price__compare-at text-affirmative line-through text-xs',children:l(r)})]}))})});const xs=()=>Dr('div',{className:'rf-adjustments-table-skeleton space-y-2',children:[Dr(Xi,{className:'h-5 w-full'}),Dr(Xi,{className:'h-5 w-full'})]}),ks=()=>{const e=Si(),{format:t}=vs(),{calculationState:r}=Li(),{cartTotal:n,giftcardValue:o,giftCardBonusAmount:i,returnLabelPrice:a,totalPriceDiscount:s}=bs(),l=s>0,c=o>0,u=a>0;return r.value.data?Dr('div',{className:'rf-adjustments-table p-base border-t border-neutral-2',children:Dr('table',{className:'rf-adjustments-table__table w-full',children:Dr('tbody',{className:'rf-adjustments-table__body',children:[l&&Dr(Cs,{value:-1*s,className:'text-affirmative',children:e('price_details.price_change')}),u&&Dr(Cs,{value:a,className:'text-neutral-3',children:e('price_details.return_label')}),n>0&&Dr(Cs,{value:n,children:e('price_details.products')}),c&&Dr(Cs,{className:'text-primary',value:o,children:[Dr('span',{className:'align-middle',children:[Dr(as,{className:'inline -mt-1 w-4 h-auto'}),' ',e('price_details.giftcard')]}),i>0&&Dr('span',{className:'text-sm text-reward align-middle',children:['+',t(i),' ',Dr(ws,{className:'inline -mt-0.5'})]})]})]})})}):Dr('div',{className:'rf-adjustments-table-loading p-base border-t border-neutral-2',children:Dr(xs,{})})};function Cs(e){let{value:t,children:r,className:n}=e;return Dr('tr',{className:qe('rf-adjustments-table__row h-6 group/row',n),children:[Dr('th',{scope:'row',className:'rf-adjustments-table__label space-x-2 font-normal text-left group-first/row:pt-0 group-last/row:pb-0 py-0.5',children:r}),Dr('td',{className:'rf-adjustments-table__value text-right',children:Dr(Ns,{value:t})})]})}const Ss=['className'],Ts=e=>{let{className:t}=e,r=o(e,Ss);return Dr('div',n(n({className:qe('rf-exchange-adjustments border-t border-neutral-2',t)},r),{},{children:[Dr('div',{className:'rf-exchange-adjustments__banner p-base',children:Dr(ps,{})}),Dr(ks,{})]}))},Is=()=>{var e;const t=Si('announcement'),{cartState:r}=Li(),n=null===(e=r.value.data)||void 0===e?void 0:e.transformed.item_count,o=0===(null!=n?n:0)?'step_1':'step_2';return Dr('div',{className:'rf-announcement-bar h-14 bg-announcement-background text-announcement-foreground px-base flex items-center justify-between text-sm',children:[Dr(Ji,{}),Dr('div',{className:'rf-announcement-bar__content space-x-1',children:[Dr('span',{className:'rf-announcement-bar__step-label text-neutral-3',children:t('this_step')}),Dr('span',{className:'rf-announcement-bar__step-text',children:t(o)})]})]})},As=['className','errorMessage','instructionMessage'],Ps=e=>{let{className:t,errorMessage:r='Der skete en fejl!',instructionMessage:i='Opdater siden og prøv igen.'}=e,a=o(e,As);return Dr('div',n(n({className:qe('rf-error-screen p-base flex-1',t),role:'alert','aria-live':'assertive'},a),{},{children:Dr('div',{className:'rf-error-screen__content bg-[#FEF2F2] rounded-lg p-base flex flex-col items-center justify-center gap-1 text-center size-full',children:[Dr(ls,{className:'mb-2 fill-destructive','aria-hidden':'true'}),Dr('p',{className:'rf-error-screen__message text-neutral-3',id:'error-heading',children:r}),Dr('p',{className:'rf-error-screen__instruction',children:i})]})}))},Rs=()=>{const e=xi().locale,{config:{data:{slug:t}}}=Ri();if(!t)throw new Error('useNavigation must be used within a WidgetContextProvider with a valid slug');return{back:r=>Hi.back(e,t,r),continue:()=>Hi.continue(e,t),exit:Hi.exit}},Hs=()=>{const e=Si('confirmation'),t=Rs(),{calculationState:r,isPending:n,hasFailed:o}=Li(),{isRefunding:i,returnTotal:a}=bs(),{errors:s}=Da(),l=s.filter(e=>e.blocking),c=!o&&!n&&0===l.length;return Dr('div',{className:'rf-exchange-confirmation rounded-t-2xl bg-neutral-1 p-base pb-safe-offset-base space-y-2',children:[Dr('div',{className:'rf-exchange-confirmation__header flex justify-between items-center pb-2',children:[Dr('h3',{className:'rf-exchange-confirmation__title font-medium',children:e(i?'title_refund':'title_checkout')}),Dr(Ns,{value:a,pending:r.value.pending})]}),Dr(ma,{disabled:!c,onClick:function(){c&&t.continue()},className:'w-full',icon:sa,children:Dr('span',{children:e('confirm')})}),Dr('p',{className:'rf-exchange-confirmation__disclaimer text-sm text-neutral-3 text-center mx-auto font-normal',children:e('disclaimer')})]})},Os=['icon','variant','size','className','children'],Ls=zi('rf-icon size-8 rounded-full flex items-center justify-center text-2xl p-[9px]',{variants:{variant:{primary:'rf-icon--primary border border-neutral-2 text-black',solid:'rf-icon--solid bg-black text-white','solid-inverse':'rf-icon--solid-inverse bg-neutral-1 text-neutral-3'},size:{sm:'size-7 p-[8px]',md:'size-8 p-[9px]'}},defaultVariants:{variant:'primary',size:'md'}}),Bs=e=>{let{icon:t,variant:r,size:i,className:a,children:s}=e,l=o(e,Os);return Dr('div',n(n({className:qe(Ls({variant:r,size:i}),a)},l),{},{children:[t&&Dr(t,{className:'size-full'}),s]}))},Ms=()=>{const e=Si('common'),{widgetViewState:t}=Ri();return Dr('div',{className:'rf-exchange-header border-t border-neutral-3 p-base flex items-center justify-between',children:[Dr('h2',{className:'rf-exchange-header__title text-xl font-semibold',children:e('title')}),Dr('button',{className:'rf-exchange-header__close-button flex items-center gap-2 group',onClick:()=>t.set(i.Collapsed),type:'button',children:[Dr('span',{className:'rf-exchange-header__close-text',children:e('close')}),Dr(Bs,{className:'group-hover:bg-neutral-2 transition-colors',icon:ca})]})]})},Ds=['className'],Fs=e=>{let{className:t}=e,r=o(e,Ds);return Dr('svg',n(n({width:28,height:27,viewBox:'0 0 28 27',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--cart '.concat(t||'')},r),{},{children:Dr('path',{d:'M8.094 20.443c-1.223-.066-1.2-1.856 0-1.919 3.4.013 12.367.004 15.875.006.96 0 1.78-.68 1.996-1.652l1.992-8.979a1.77 1.77 0 0 0-.316-1.46 1.62 1.62 0 0 0-1.293-.653c-1.41 0-13.39-.057-19.525-.082L5.85 1.947C5.617 1.05 4.83.423 3.936.423H.821C.367.423 0 .805 0 1.277s.367.854.82.854h3.116c.154 0 .29.108.33.262L8 16.818a2.5 2.5 0 0 0-1.732.793 2.7 2.7 0 0 0-.738 1.919c.025 1.445 1.174 2.621 2.563 2.621H9.29a3.1 3.1 0 0 0-.278 1.282c0 1.648 1.289 2.99 2.873 2.99s2.872-1.341 2.872-2.99c0-.459-.1-.893-.277-1.282h5.182a3.1 3.1 0 0 0-.277 1.281c0 1.649 1.288 2.99 2.872 2.99s2.873-1.341 2.873-2.99a3.1 3.1 0 0 0-.299-1.326.85.85 0 0 0 .56-.81c0-.47-.368-.853-.822-.853zm5.023 2.99c0 .706-.552 1.281-1.231 1.281-.68 0-1.232-.575-1.232-1.281 0-.707.552-1.281 1.23-1.282h.003c.678 0 1.23.575 1.23 1.282m9.141 1.28c-.678 0-1.23-.574-1.23-1.28 0-.7.54-1.27 1.21-1.282h.04c.67.011 1.212.582 1.212 1.281 0 .707-.553 1.282-1.232 1.282M26.355 7.5q.005.009.003.015l-.84 3.783h-2.842l.484-3.817 3.182.013q.006-.002.013.006m-8.462 9.322v-3.815h2.91l-.483 3.815zm-4.07 0-.488-3.815h2.916v3.815zm-3.779 0h-.002a.45.45 0 0 1-.428-.341l-.9-3.475h2.965l.488 3.816zm3.073-5.524-.494-3.861 3.628.015v3.846zm4.776 0v-3.84l3.612.016-.485 3.824zM10.966 7.43l.495 3.868H8.27L7.267 7.414zm13.003 9.392h-1.993l.483-3.815h2.68l-.773 3.486a.41.41 0 0 1-.397.329',fill:'currentColor'})}))},Us=()=>{const e=Si('exchange_placeholder'),{widgetViewState:t}=Ri();return Dr('div',{className:'rf-exchange-placeholder px-base pb-base',children:Dr('div',{className:'rf-exchange-placeholder__content border border-dashed border-[#DDDDDD] h-36 rounded-md flex items-center justify-center flex-col gap-2 font-medium text-base p-base',children:[Dr(Fs,{className:'text-neutral-3'}),Dr('span',{className:'rf-exchange-placeholder__text',children:e('prompt_text')}),Dr('button',{onClick:()=>t.set(i.Collapsed),className:'rf-exchange-placeholder__continue text-button-background decoration-[color:hsla(var(--rf-c-button-background),_0.25)] underline-offset-4 underline text-sm cursor-pointer',type:'button',children:e('continue')})]})})},Gs=()=>{const{errors:e}=Da();return 0===e.length?null:Dr('div',{className:'rf-product-view__error-list px-base pb-base space-y-base',children:e.map(e=>{let{id:t,message:r}=e;return Dr(ms,{className:'rf-product-view__error animate-slide-up-and-fade-in',tone:'error',children:r},t)})})},zs=['coverage'],js={min:{limit:1,disabled:!1},max:{limit:99,disabled:!0}};function Vs(e,t){const r='/products/'.concat(t.handle);if(!e)return r;try{const n=e(t);return'string'==typeof n&&n?n:r}catch(e){return r}}const qs=['onIncrement','onDecrement','constraints','quantity','pending','disabled','className'],Ws=e=>{let{onIncrement:t,onDecrement:r,constraints:i=js,quantity:a,pending:s=!1,disabled:l=!1,className:c}=e,u=o(e,qs);const d=s||l,h=a===i.min.limit,f=a===i.max.limit,m=i.max.disabled&&f||d,p=i.min.disabled&&h||d,_=bn(async()=>{if(!m)try{await t(f)}catch(e){Ve.error('Increment failed:',e)}},[m,t,f]),g=bn(async()=>{if(!p)try{await r(h)}catch(e){Ve.error('decrement failed:',e)}},[p,r,h]),v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:js;return Math.max(t.min.limit,Math.min(e,t.max.limit))}(a,i);return Dr('div',n(n({className:qe('rf-quantity-picker rounded-full p-1 border border-neutral-1 flex items-center h-min gap-2 transition-opacity',d&&'rf-quantity-picker--disabled opacity-50 cursor-not-allowed',c)},u),{},{children:[Dr('button',{type:'button',className:'rf-quantity-picker__decrement-button disabled:!opacity-50 desktop:hover:opacity-80 disabled:cursor-not-allowed transition-opacity',disabled:p,onClick:g,children:Dr(Bs,{variant:'solid-inverse',size:'sm',children:Dr('span',{className:'rf-quantity-picker__decrement-icon text-base leading-none -mt-0.5',children:'-'})})}),Dr('div',{className:'rf-quantity-picker__quantity px-1.5 flex-1 text-base',children:v}),Dr('button',{type:'button',className:'rf-quantity-picker__increment-button disabled:!opacity-50 desktop:hover:opacity-80 disabled:cursor-not-allowed transition-opacity',disabled:m,onClick:_,children:Dr(Bs,{variant:'solid-inverse',size:'sm',children:Dr('span',{className:'rf-quantity-picker__increment-icon text-base leading-none -mt-0.5',children:'+'})})})]}))};var Xs=An(e=>{let{variantId:t,quantity:r,quantityRule:o}=e;const i=Si('product'),[a,s]=pn(!1),{cartState:l,isPending:c}=Li(),u=Da(),{processCartUpdate:d}=Fa(),h=bn(async e=>{s(!0);const r=Ca.ProductLimit;try{l.set(e=>n(n({},e),{},{pending:!0,error:null}));const o=await it({variantId:t,quantity:e});await d(o),u.has(r)&&u.remove(r)}catch(e){const t=parseInt(e.message),o=isNaN(t)?null:t;l.set(e=>n(n({},e),{},{pending:!1})),u.push({id:r,message:i('error.'.concat(Ta(o)))})}finally{s(!1)}},[l,t,u,i,d]);if(We(r))return null;const{increment:f,constraints:m}=function(e){var t,r,n;const o=null!==(t=null==e?void 0:e.min)&&void 0!==t?t:1,i=null!==(r=null==e?void 0:e.max)&&void 0!==r?r:99;return{min:o,max:i,increment:null!==(n=null==e?void 0:e.increment)&&void 0!==n?n:1,constraints:{min:{limit:o,disabled:!1},max:{limit:i,disabled:!0}}}}(o);return Dr('div',{className:'rf-product-actions flex items-center',children:[Dr(Ws,{pending:c||a,constraints:m,onDecrement:e=>{h(e?0:r-f)},onIncrement:()=>{h(r+f)},quantity:r}),Dr('button',{disabled:c||a,className:'rf-product-actions__remove-button underline ml-auto text-sm disabled:cursor-not-allowed disabled:opacity-50 transition-opacity cursor-pointer',onClick:()=>h(0),type:'button',children:i('remove')})]})});const Ks=['className','href','unstyled','onClick','onDisabledClick','disabled'],Zs=e=>{let{className:t,href:r,unstyled:i=!1,onClick:a,onDisabledClick:s,disabled:l=!1}=e,c=o(e,Ks);const u=l||!r;return Dr('a',n({onClick:function(e){if(l)return e.preventDefault(),void(null==s||s(e));null==a||a(e)},href:u?void 0:r,'aria-disabled':u,className:qe('block',!i&&'transition-opacity',u?i?'cursor-default':'cursor-not-allowed opacity-50':'cursor-pointer',t)},c))},Ys=['title','variantTitle','pending','price','compareAtPrice','className','quantity','href','showQuantity'];var Js=An(e=>{let{title:t,variantTitle:r,pending:i=!1,price:a,compareAtPrice:s,className:l,quantity:c=1,href:u,showQuantity:d=!0}=e,h=o(e,Ys);const f=Si(),{applyExchangeRate:m}=vs(),p=c>1&&d,_=We(s)?void 0:m(s),g=m(Xe(a));return Dr('div',n(n({className:qe('rf-product-attributes flex justify-between gap-4 text-sm leading-tight',l)},h),{},{children:[Dr('div',{className:'rf-product-attributes__info flex-1 min-w-0',children:[u?Dr(Zs,{unstyled:!0,href:u,className:'rf-product-attributes__link',children:Dr('h3',{className:'rf-product-attributes__title text-base font-medium line-clamp-1',children:t})}):Dr('h3',{className:'rf-product-attributes__title text-base font-medium line-clamp-1',children:t}),(r||p)&&Dr('h4',{className:'rf-product-attributes__variant text-neutral-3',children:[r,' ',p&&Dr('span',{className:'rf-product-attributes__quantity',children:['(',f('piece',{count:c}),')']})]})]}),Dr(Ns,{pending:i,value:g,compareAtValue:_})]}))});var Qs=An(e=>{let{imageSource:t,title:r,href:n}=e;const{widgetViewState:o}=Ri();return Dr('a',{className:'rf-product-image',href:n,onClick:()=>o.set(i.Collapsed),children:Dr(Mi,{className:'rf-product-image__img w-[70px] h-24 rounded-lg border border-neutral-1 object-cover',src:t,alt:r})})});const $s=['calculation'],el=['product','className'],tl=e=>{let{product:{calculation:t},className:r}=e,i=o(e.product,$s),a=o(e,el);const{config:{options:s}}=Ri(),l=Vs(s.getProductUrl,i);return Dr('li',n(n({className:qe('rf-product flex gap-4 p-base first:pt-0',r)},a),{},{children:[Dr(Qs,{imageSource:i.image,title:i.product_title,href:l}),Dr('div',{className:'rf-product__content space-y-2 flex-1',children:[Dr(Js,{className:'flex-1',href:l,title:i.product_title,variantTitle:i.variant_title,pending:!t,price:null==t?void 0:t.price,compareAtPrice:null==t?void 0:t.compareAtPrice,quantity:i.quantity,showQuantity:!1}),Dr(Xs,{variantId:i.variant_id,quantity:i.quantity,quantityRule:i.quantity_rule})]})]}))},rl=()=>{const{cartItems:e}=(()=>{var e,t;const{cartState:r,calculationState:i}=Li(),a=null===(e=r.value.data)||void 0===e?void 0:e.transformed,s=null===(t=i.value.data)||void 0===t||null===(t=t.exchange)||void 0===t?void 0:t.exchangeDetails;return{cartItems:vn(()=>{const e=null==a?void 0:a.items;return e?e.map(e=>{let t;const r=null==s?void 0:s.filter(t=>t.variantId?Number(Qe(t.variantId))===e.variant_id:Number(Qe(t.productId))===e.product_id);return r&&r.length>0&&(t=r.reduce((e,t)=>{var r,i,a;let{coverage:s}=t,l=o(t,zs);const c=null!==(r=null==s?void 0:s.originalUnitPrice)&&void 0!==r?r:l.price,u=null!==(i=null!==(a=null==s?void 0:s.exchangeUnitPrice)&&void 0!==a?a:l.compareAtPrice)&&void 0!==i?i:null;return u&&(e.compareAtPrice?e.compareAtPrice+=u:e.compareAtPrice=u),e.price+=c,n(n({},l),e)},{price:0,compareAtPrice:null})),n(n({},e),{},{calculation:t})}):[]},[a,s])}})();return Dr('ul',{className:'rf-product-list border-neutral-2 divide-y divide-neutral-2',children:e.map((e,t)=>{const r=''.concat(e.id,'-').concat(t);return Dr(tl,{product:e},r)})})},nl=['className'],ol=e=>{let{className:t}=e,r=o(e,nl);return Dr('svg',n(n({width:9,height:11,viewBox:'0 0 9 11',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--arrow-down '.concat(t||'')},r),{},{children:Dr('path',{d:'m4.92 10.824 3.907-3.972A.6.6 0 0 0 9 6.426.6.6 0 0 0 8.827 6l-.355-.36a.594.594 0 0 0-.842 0L5.346 7.957V.594A.583.583 0 0 0 4.764 0h-.502a.605.605 0 0 0-.608.594v7.39L1.357 5.64a.58.58 0 0 0-.831 0L.172 6A.6.6 0 0 0 0 6.426c0 .161.062.312.173.426l3.907 3.972A.58.58 0 0 0 4.5 11a.58.58 0 0 0 .42-.176',fill:'currentColor'})}))},il=['className'],al=e=>{let{className:t}=e,r=o(e,il);return Dr('svg',n(n({width:11,height:7,viewBox:'0 0 11 7',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--chevron '.concat(t||'')},r),{},{children:Dr('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M10.632 6.183a.95.95 0 0 1-.673.24.97.97 0 0 1-.652-.288l-3.375-3.49-3.375 3.49a.96.96 0 0 1-.652.287.96.96 0 0 1-.673-.24.9.9 0 0 1-.299-.625.88.88 0 0 1 .25-.646L5.244.71a.97.97 0 0 1 1.375 0l4.062 4.2a.9.9 0 0 1 .25.646.9.9 0 0 1-.3.626',fill:'currentColor'})}))},sl=['isOpen','className','style','children','collapseDelay','autoCloseAfter','onToggle'],ll=e=>{let{isOpen:t,className:r,style:i,children:a,collapseDelay:s=300,autoCloseAfter:l,onToggle:c}=e,u=o(e,sl);const[d,h]=pn(t),[f,m]=pn(t?void 0:0),p=gn(null),_=gn(),g=gn(),v=()=>{const e=p.current;e&&m(e.scrollHeight)};return _n(()=>(_.current&&clearTimeout(_.current),g.current&&clearTimeout(g.current),t?(h(!0),l&&c&&(g.current=setTimeout(()=>{c(!1)},l))):(m(0),_.current=setTimeout(()=>{h(!1)},s)),()=>{_.current&&clearTimeout(_.current),g.current&&clearTimeout(g.current)}),[t,s,l,c]),_n(()=>{if(d&&t){const e=requestAnimationFrame(()=>{v()});return()=>cancelAnimationFrame(e)}},[d,t,a]),_n(()=>{t&&d&&v()},[a,t,d]),d?Dr('div',n(n({className:qe('overflow-hidden transition-all duration-300 ease-in-out',r),style:n({height:void 0!==f?''.concat(f,'px'):'auto'},'object'==typeof i?i:{})},u),{},{children:Dr('div',{ref:p,children:a})})):null},cl=['className','type'],ul=e=>{let{className:t,type:r}=e,i=o(e,cl);const a=Si('product.badge');return'giftcard'===r?Dr('div',n(n({className:qe('rf-return-product__badge rf-return-product__badge--giftcard text-base text-primary',t)},i),{},{children:[Dr(as,{className:'inline -mt-1 w-4 h-auto'}),' ',a('giftcard')]})):null},dl=['pending','deleted','href','onDeletedClick','handleAnchorClick'],hl=e=>{let{pending:t=!1,deleted:r=!1,href:i,onDeletedClick:a,handleAnchorClick:s}=e,l=o(e,dl);const c=Si('product');return Dr('div',{className:'rf-return-product__actions flex justify-between items-center',children:[Dr(Zs,{onDisabledClick:function(){r&&(null==a||a())},disabled:t||r,onClick:s,className:'rf-return-product__link text-sm underline block',href:i,children:c('go_to_product')}),Dr(ul,n({},l))]})},fl=['calculation'],ml=['product','allProducts','className'],pl=e=>{var t,r,a,s;let{product:{calculation:l},allProducts:c,className:u}=e,d=o(e.product,fl),h=o(e,ml);const f=Si('product.error'),[m,p]=pn(null),{widgetViewState:_,config:{options:g,data:{returnData:v}}}=Ri(),b=Vs(g.getProductUrl,d);function y(){_.set(i.Collapsed)}const w=null!==(t=null==d?void 0:d.quantity)&&void 0!==t?t:1,E=(null!==(r=null!==(a=null==l?void 0:l.discountedPrice)&&void 0!==a?a:null==l?void 0:l.price)&&void 0!==r?r:0)*w,N=(null!==(s=null==l?void 0:l.originalPrice)&&void 0!==s?s:0)*w,x=vn(()=>{const e=c.flatMap(e=>{if(e.id!==d.id)return null;const t=null==v?void 0:v.items.filter(t=>t.lineItemId===e.shopifyLineId);return t&&0!==t.length?t.map(e=>e.action):null}).filter(e=>!We(e)),t=new Set(e).size>1,r=null==l?void 0:l.action;return t||!r?null:'GIFTCARD'===r?'giftcard':null},[null==l?void 0:l.action,c,d.id,null==v?void 0:v.items]),k=!(null!=l&&l.variantId);function C(){k&&p(f('product_unavailable'))}return Dr('li',n(n({className:qe('rf-return-product grid grid-cols-[max-content_1fr] gap-x-4 p-base',u)},h),{},{children:[Dr(Zs,{disabled:k,onDisabledClick:C,className:'rf-return-product__image-link',onClick:y,href:b,unstyled:!0,children:Dr(Mi,{className:'rf-return-product__image size-[70px] rounded-lg border border-neutral-1 object-cover',src:d.image,alt:d.title})}),Dr('div',{className:'rf-return-product__content flex-1 space-y-1 flex flex-col justify-between',children:[Dr(Js,{className:'text-neutral-3',href:b,title:d.title,variantTitle:d.variantTitle,pending:!l,price:E,compareAtPrice:N,quantity:d.quantity}),Dr(hl,{pending:!l,deleted:k,href:b,onDeletedClick:C,handleAnchorClick:y,type:x})]}),Dr(ll,{className:'col-span-full',isOpen:!!m,autoCloseAfter:5e3,onToggle:e=>p(e?m:null),children:Dr('div',{className:'pt-4',children:Dr(ms,{tone:'error',children:m})})})]}))},_l=['className'],gl=e=>{let{className:t}=e,r=o(e,_l);return Dr('li',n(n({className:qe('rf-return-product-skeleton flex gap-4 p-base text-sm',t)},r),{},{children:[Dr(Xi,{className:'size-[70px] rounded-lg'}),Dr('div',{className:'rf-return-product-skeleton__content flex-1 space-y-1 flex flex-col justify-between',children:[Dr('div',{className:'rf-return-product-skeleton__info space-y-1',children:[Dr(Xi,{className:'w-[16ch]'}),Dr(Xi,{className:'text-xs w-[12ch]'})]}),Dr(Xi,{className:'text-xs w-[16ch]'})]}),Dr(Xi,{className:'w-[8ch]'})]}))},vl=()=>{var e,t;const r=Si('return_products'),{returnViewState:o}=Ri(),{orderState:i,calculationState:s}=Li(),{orderTotal:l}=bs(),c=s.initialFetch,u=null===(e=s.value.data)||void 0===e?void 0:e.lineItems,d=null===(t=i.value.data)||void 0===t?void 0:t.orderData.productsToExchange,h=vn(()=>u&&d?d.map(e=>{const t=u.find(t=>t.lineItemId===e.shopifyLineId);return n(n({},e),{},{calculation:t})}):[],[u,d]),f=Boolean(null==h?void 0:h.some(e=>{var t;return'GIFTCARD'===(null===(t=e.calculation)||void 0===t?void 0:t.action)}));return Dr('div',{className:'rf-return-product-list border-b border-neutral-2 relative mb-base group [&[data-state=\'OPEN\']]:mb-[calc(var(--rf-base-spacing)*2)]','data-state':o.value,children:[Dr('div',{className:'rf-return-product-list__header flex justify-between items-center p-base',children:[Dr('button',{className:'rf-return-product-list__toggle-button flex items-center gap-2 font-medium',onClick:function(){o.set(e=>e===a.Collapsed?a.Open:a.Collapsed)},type:'button',children:[Dr('span',{className:'rf-return-product-list__toggle-text',children:r('action')}),Dr(al,{className:'transition-transform will-change-transform '.concat(o.value===a.Open?'rotate-180':'rotate-0')})]}),Dr(Ns,{value:l,pending:c})]}),Dr('div',{className:'rf-return-product-list__content pb-base group-[&[data-state=\'COLLAPSED\']]:hidden',children:[f&&Dr('div',{className:'rf-return-product-list__container p-base pt-0',children:Dr(ms,{className:'rf-return-product-list__banner',tone:'giftcard',children:r('banner.giftcard')})}),Dr('ul',{className:'rf-return-product-list__items divide-y divide-neutral-2',children:Dr(Di,{pending:c,skeleton:Dr(qt,{children:[Dr(gl,{}),Dr(gl,{})]}),children:h.map(e=>Dr(pl,{className:'first:pt-0',product:e,allProducts:h},e.id))})}),Dr(Bs,{className:'absolute inset-x-0 mx-auto bottom-0 translate-y-1/2',variant:'solid',icon:ol})]})]})},bl=e=>{let{containerRef:t}=e;const{isYScrollable:r,isDirty:n}=(e=>{const[t,r]=pn(!1),[{isScrolling:n,isDirty:o},i]=pn({isDirty:!1,isScrolling:!1});return _n(()=>{const t=e.current;if(!t)return;const n=()=>{const e=t.scrollHeight>t.clientHeight;r(e)},o=()=>{const e=t.scrollTop>0;i(t=>({isDirty:!!e||t.isDirty,isScrolling:e}))};n(),o();const a=new ResizeObserver(()=>{n()});a.observe(t);const s=new MutationObserver(()=>{n()});return s.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:['style','class']}),t.addEventListener('scroll',o,{passive:!0}),()=>{a.disconnect(),s.disconnect(),t.removeEventListener('scroll',o)}},[e]),{isYScrollable:t,isScrolling:n,isDirty:o}})(t),o=!n&&r;return Dr('div',{className:'rf-scroll-indicator w-full h-36 bg-gradient-to-t from-white to-transparent absolute bottom-full inset-x-0 flex items-end justify-center p-base transition-all pointer-events-none',style:{opacity:o?1:0,visibility:o?'visible':'hidden'},children:Dr('div',{className:'rf-scroll-indicator__content rounded-full py-2.5 w-24 bg-neutral-1 text-center space-x-1 align-middle',children:[Dr('span',{className:'rf-scroll-indicator__text',children:'Scroll'}),' ',Dr(ol,{className:'inline text-neutral-3 -mt-0.5'})]})})},yl=e=>{let{state:t}=e;const{widgetViewState:r}=Ri(),{cartState:n,hasFailed:o}=Li(),a=gn(null),s=n.value.data&&!n.value.error&&0!==n.value.data.transformed.item_count;return Dr(qt,{children:[Dr('div',{'aria-hidden':!0,onClick:()=>r.set(i.Collapsed),className:qe('max-desktop:hidden transition-[background-color,visibility] inset-0 size-full fixed z-10 duration-300 ease-in-out',t?'bg-black/30 visible':'bg-black/0 pointer-events-none invisible')}),Dr('div',{className:qe('rf-drawer bg-background text-foreground transition-[transform,visibility] duration-300 ease-in-out z-20 fixed max-desktop:inset-0 desktop:right-0 desktop:inset-y-0 size-full pt-safe flex flex-col desktop:max-w-[var(--rf-desktop-widget-width)]',t?'max-desktop:translate-y-0 desktop:translate-x-0 visible':'max-desktop:translate-y-full desktop:translate-x-full pointer-events-none invisible'),'aria-hidden':!t,inert:!t,tabIndex:t?void 0:-1,children:[Dr(Ms,{}),Dr(Is,{}),Dr('div',{className:'rf-drawer__content flex-1 min-h-0 overflow-y-auto flex flex-col',ref:a,children:[o?Dr(Ps,{}):Dr(qt,{children:[Dr(vl,{}),Dr(s?rl:Us,{}),Dr(Gs,{})]}),Dr(Ts,{className:'rf-drawer__adjustments mt-auto'})]}),Dr('div',{className:'rf-drawer__footer relative mt-auto',children:[Dr(bl,{containerRef:a}),Dr(Hs,{})]})]})]})},wl=['className'],El=e=>{let{className:t}=e,r=o(e,wl);return Dr('svg',n(n({width:14,height:17,viewBox:'0 0 14 17',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--bag '.concat(t||'')},r),{},{children:Dr('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M3.175 4.146H2.103c-.74 0-1.355.589-1.408 1.348l-.691 9.952c-.028.401.107.797.374 1.092A1.4 1.4 0 0 0 1.412 17h11.176a1.4 1.4 0 0 0 1.034-.462c.267-.295.402-.69.374-1.093l-.691-9.95c-.053-.76-.668-1.349-1.408-1.349h-1.065V3.94C10.832 1.763 9.117 0 7 0 4.96 0 3.076 1.67 3.168 3.939zm7.657 1.244V8.5a.614.614 0 0 1-.605.622.614.614 0 0 1-.605-.622V5.39H4.378V8.5a.614.614 0 0 1-.605.622.614.614 0 0 1-.605-.622s.052-1.453.035-3.11h-1.1a.204.204 0 0 0-.2.193l-.692 9.95a.2.2 0 0 0 .053.157.2.2 0 0 0 .148.066h11.176a.2.2 0 0 0 .148-.066.2.2 0 0 0 .053-.156l-.691-9.951a.204.204 0 0 0-.201-.193zm-1.21-1.244V3.94c0-1.49-1.174-2.696-2.622-2.696S4.378 2.45 4.378 3.939v.207z',fill:'currentColor'})}))},Nl=['options','className','style'],xl=e=>{let{options:{id:t,tone:r='info',message:i,isVisible:a},className:s,style:l}=e,c=o(e,Nl);const{remove:u}=xa();return Dr('div',n(n({onClick:()=>u(t),className:qe('rf-toast animate-slide-up-and-fade-in overflow-hidden shadow-sm max-w-screen-lg mx-auto','rf-toast--'.concat(r),s)},c),{},{style:n({visibility:a?'visible':'hidden',opacity:a?1:0,transform:a?void 0:'translateY(-20px)',transition:'all '.concat(300,'ms ease-in-out')},'object'==typeof l?l:void 0),children:Dr(ms,{tone:r,className:'font-medium',border:'dashed',children:i})}))},kl=()=>{const{queue:e}=yn(Na);return 0===e.length?null:Dr('div',{className:'rf-toast__container p-base space-y-base',children:e.map(e=>Dr(xl,{options:e},e.id))})},Cl=['className'],Sl=e=>{let{className:t}=e,r=o(e,Cl);return Dr('svg',n(n({width:11,height:9,viewBox:'0 0 11 9',fill:'currentColor',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--arrow-left '.concat(t||'')},r),{},{children:Dr('path',{d:'m.66 5.202 3.61 3.473c.103.1.24.154.387.154a.56.56 0 0 0 .387-.154l.328-.315a.52.52 0 0 0 0-.749l-2.107-2.03H9.96c.301 0 .54-.228.54-.518v-.446c0-.29-.239-.54-.54-.54H3.242l2.131-2.042a.505.505 0 0 0 0-.739L5.045.982a.55.55 0 0 0-.387-.153.56.56 0 0 0-.387.153L.66 4.455a.513.513 0 0 0 0 .747'})}))},Tl=['className'],Il=e=>{let{className:t}=e,r=o(e,Tl);const i=Si('summary'),{orderState:a}=Li(),s=Rs(),l=a.value.pending;return Dr(ma,n(n({variant:'ghost',icon:Sl,iconPosition:'left',onClick:async function(){var e;if(l)return;const t=null===(e=a.value.data)||void 0===e||null===(e=e.orderData.productsToExchange)||void 0===e||null===(e=e.at(-1))||void 0===e?void 0:e.id;s.back(t)},disabled:l,className:qe('rf-back-button desktop:text-black desktop:bg-neutral-2 desktop:hover:opacity-50 desktop:font-semibold max-desktop:text-sm max-desktop:px-0 max-desktop:h-auto',t),type:'button'},r),{},{children:Dr('span',{className:'rf-back-button__text',children:i('back')})}))},Al=()=>Dr('div',{className:'rf-exchange-total-skeleton max-desktop:max-w-48 w-full desktop:w-48 space-y-1 text-xs',children:[Dr(Xi,{className:'w-full rounded-md'}),Dr(Xi,{className:'w-full rounded-md'})]}),Pl=['className'],Rl=e=>{var t;let{className:r}=e,i=o(e,Pl);const a=Si('summary'),{orderState:s,isPending:l}=Li(),{orderTotal:c,cartTotal:u}=bs();return Dr(Di,{skeleton:Dr(Al,{}),pending:l,children:Dr('div',n(n({className:qe('rf-exchange-total font-normal text-sm max-desktop:max-w-48 w-full desktop:w-48 flex-1',r)},i),{},{children:[Dr('div',{className:'rf-exchange-total__row flex justify-between',children:[Dr('span',{className:'rf-exchange-total__label text-neutral-3',children:[a('order'),' ',null===(t=s.value.data)||void 0===t?void 0:t.orderData.orderName,':']}),Dr(Ns,{className:'text-sm font-normal',value:c})]}),Dr('div',{className:'rf-exchange-total__row flex justify-between',children:[Dr('span',{className:'rf-exchange-total__label text-neutral-3',children:[a('cart_contents'),':']}),Dr(Ns,{className:'text-sm font-normal',value:Math.max(0,u)})]})]}))})},Hl=['className'],Ol=()=>{const e=Si('summary'),{widgetViewState:t}=Ri();return Dr('div',{className:'rf-summary__container fixed bottom-0 inset-x-0 pb-safe animate-slide-up',children:[Dr(kl,{}),Dr('div',{className:'rf-summary h-[var(--rf-summary-height,_auto)] bg-widget-background text-widget-foreground max-desktop:rounded-t-3xl flex max-desktop:flex-col desktop:justify-between desktop:px-5',children:[Dr('div',{className:'rf-summary__header flex items-center max-desktop:px-5 max-desktop:flex-1 gap-2 desktop:gap-4 text-sm desktop:text-base',children:[Dr(Il,{className:'rf-summary__back max-desktop:mr-auto'}),Dr(Ll,{className:'max-desktop:hidden'}),Dr('div',{className:'flex items-center gap-2 desktop:flex-row-reverse',children:[Dr(Ji,{}),Dr('span',{className:'rf-summary__title font-medium',children:e('title')})]})]}),Dr(Ll,{className:'desktop:hidden'}),Dr('div',{className:'rf-summary__actions max-desktop:px-5 max-desktop:py-3 gap-4 flex desktop:flex-row-reverse items-end desktop:items-center justify-between',children:[Dr(ma,{className:'rf-summary__button ![--icon-height:initial]',onClick:()=>t.set(e=>e===i.Collapsed?i.Open:i.Collapsed),icon:El,children:e('view_cart')}),Dr(Ll,{className:'max-desktop:hidden'}),Dr(Rl,{})]})]})]})},Ll=e=>{let{className:t}=e,r=o(e,Hl);return Dr('div',n({className:qe('rf-summary__divider max-desktop:h-px w-full desktop:w-px desktop:self-stretch bg-neutral-2 shrink-0',t)},r))},Bl=()=>{const{widgetViewState:e}=Ri();return Dr(qt,{children:[Dr(Ol,{}),Dr(yl,{state:e.value===i.Open})]})};var Ml=Object.freeze({__proto__:null,default:e=>{const{locale:t,messages:r}=e;return Dr(Va,{children:Dr(Ni,{messages:r,locale:t,children:Dr(Qa,n(n({},e),{},{children:Dr(Ka,{children:Dr(Wa,{children:Dr(Ya,{children:Dr(es,{children:[Dr(Bl,{}),Dr(wa,{}),Dr(ja,{})]})})})})}))})})}});export{Nt as Returnflows,Nt as default};
1
+ function e(e,t,r){return(t=function(e){var t=function(e,t){if('object'!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if('object'!=typeof n)return n;throw new TypeError('@@toPrimitive must return a primitive value.')}return('string'===t?String:Number)(e)}(e,'string');return'symbol'==typeof t?t:t+''}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function t(){return t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t.apply(null,arguments)}function r(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)),r.push.apply(r,n)}return r}function n(t){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?r(Object(o),!0).forEach(r=>{e(t,r,o[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):r(Object(o)).forEach(e=>{Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))})}return t}function o(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var i,a;function s(){var e,t;return'undefined'==typeof window?null:null!==(e=null===(t=window.Returnflows)||void 0===t?void 0:t._cartProvider)&&void 0!==e?e:null}function l(){var e;return'undefined'!=typeof window&&null!=(null===(e=window.Returnflows)||void 0===e?void 0:e._cartProvider)}function c(e){var t,r,n='';if('string'==typeof e||'number'==typeof e)n+=e;else if('object'==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=c(e[t]))&&(n&&(n+=' '),n+=r)}else for(r in e)e[r]&&(n&&(n+=' '),n+=r);return n}function u(){for(var e,t,r=0,n='',o=arguments.length;r<o;r++)(e=arguments[r])&&(t=c(e))&&(n&&(n+=' '),n+=t);return n}(()=>{const e={VITE_WIDGET_BASE_URL:'https://static.returnflows.com/dist/production',VITE_API_URL:'https://app.returnflows.com/api/proxy',VITE_PLATFORM_URL:'https://returnflows.com'};try{if(process)return process.env=Object.assign({},process.env),void Object.assign(process.env,e)}catch(e){}globalThis.process={env:e}})(),(e=>{e.Collapsed='COLLAPSED',e.Open='OPEN'})(i||(i={})),(e=>{e.Collapsed='COLLAPSED',e.Open='OPEN'})(a||(a={}));const d=function(){return{nextPart:arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Map,validators:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,classGroupId:arguments.length>2?arguments[2]:void 0}},h='-',f=[],m=e=>{const t=_(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{if(e.startsWith('[')&&e.endsWith(']'))return g(e);const r=e.split(h),n=''===r[0]&&r.length>1?1:0;return p(r,n,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=n[e],o=r[e];return t?o?((e,t)=>{const r=new Array(e.length+t.length);for(let t=0;t<e.length;t++)r[t]=e[t];for(let n=0;n<t.length;n++)r[e.length+n]=t[n];return r})(o,t):t:o||f}return r[e]||f}}},p=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const n=e[t],o=r.nextPart.get(n);if(o){const r=p(e,t+1,o);if(r)return r}const i=r.validators;if(null===i)return;const a=0===t?e.join(h):e.slice(t).join(h),s=i.length;for(let e=0;e<s;e++){const t=i[e];if(t.validator(a))return t.classGroupId}},g=e=>-1===e.slice(1,-1).indexOf(':')?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(':'),n=t.slice(0,r);return n?'arbitrary..'+n:void 0})(),_=e=>{const{theme:t,classGroups:r}=e;return v(r,t)},v=(e,t)=>{const r=d();for(const n in e){const o=e[n];b(o,r,n,t)}return r},b=(e,t,r,n)=>{const o=e.length;for(let i=0;i<o;i++){const o=e[i];y(o,t,r,n)}},y=(e,t,r,n)=>{'string'!=typeof e?'function'!=typeof e?N(e,t,r,n):E(e,t,r,n):w(e,t,r)},w=(e,t,r)=>{(''===e?t:x(t,e)).classGroupId=r},E=(e,t,r,n)=>{k(e)?b(e(n),t,r,n):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},N=(e,t,r,n)=>{const o=Object.entries(e),i=o.length;for(let e=0;e<i;e++){const[i,a]=o[e];b(a,x(t,i),r,n)}},x=(e,t)=>{let r=e;const n=t.split(h),o=n.length;for(let e=0;e<o;e++){const t=n[e];let o=r.nextPart.get(t);o||(o=d(),r.nextPart.set(t,o)),r=o}return r},k=e=>'isThemeGetter'in e&&!0===e.isThemeGetter,C=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=Object.create(null),n=Object.create(null);const o=(o,i)=>{r[o]=i,t++,t>e&&(t=0,n=r,r=Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=n[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}},S=[],T=(e,t,r,n,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:n,isExternal:o}),I=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=e=>{const t=[];let r,n=0,o=0,i=0;const a=e.length;for(let s=0;s<a;s++){const a=e[s];if(0===n&&0===o){if(':'===a){t.push(e.slice(i,s)),i=s+1;continue}if('/'===a){r=s;continue}}'['===a?n++:']'===a?n--:'('===a?o++:')'===a&&o--}const s=0===t.length?e:e.slice(i);let l=s,c=!1;s.endsWith('!')?(l=s.slice(0,-1),c=!0):s.startsWith('!')&&(l=s.slice(1),c=!0);return T(t,c,l,r&&r>i?r-i:void 0)};if(t){const e=t+':',r=n;n=t=>t.startsWith(e)?r(t.slice(e.length)):T(S,!1,t,void 0,!0)}if(r){const e=n;n=t=>r({className:t,parseClassName:e})}return n},A=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let n=[];for(let o=0;o<e.length;o++){const i=e[o],a='['===i[0],s=t.has(i);a||s?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},P=/\s+/,R=e=>{if('string'==typeof e)return e;let t,r='';for(let n=0;n<e.length;n++)e[n]&&(t=R(e[n]))&&(r&&(r+=' '),r+=t);return r},H=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),o=1;o<t;o++)r[o-1]=arguments[o];let i,a,s,l;const c=e=>{const t=a(e);if(t)return t;const r=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o,sortModifiers:i}=t,a=[],s=e.trim().split(P);let l='';for(let e=s.length-1;e>=0;e-=1){const t=s[e],{isExternal:c,modifiers:u,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}=r(t);if(c){l=t+(l.length>0?' '+l:l);continue}let m=!!f,p=n(m?h.substring(0,f):h);if(!p){if(!m){l=t+(l.length>0?' '+l:l);continue}if(p=n(h),!p){l=t+(l.length>0?' '+l:l);continue}m=!1}const g=0===u.length?'':1===u.length?u[0]:i(u).join(':'),_=d?g+'!':g,v=_+p;if(a.indexOf(v)>-1)continue;a.push(v);const b=o(p,m);for(let e=0;e<b.length;++e){const t=b[e];a.push(_+t)}l=t+(l.length>0?' '+l:l)}return l})(e,i);return s(e,r),r};return l=t=>{const o=r.reduce((e,t)=>t(e),e());return i=(e=>n({cache:C(e.cacheSize),parseClassName:I(e),sortModifiers:A(e)},m(e)))(o),a=i.cache.get,s=i.cache.set,l=c,c(t)},function(){return l(function(){let e,t,r=0,n='';for(;r<arguments.length;){var o;(e=(o=r++)<0||arguments.length<=o?void 0:arguments[o])&&(t=R(e))&&(n&&(n+=' '),n+=t)}return n}(...arguments))}},O=[],L=e=>{const t=t=>t[e]||O;return t.isThemeGetter=!0,t},B=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,M=/^\((?:(\w[\w-]*):)?(.+)\)$/i,D=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,F=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,U=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,G=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,z=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,j=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,V=e=>D.test(e),q=e=>!!e&&!Number.isNaN(Number(e)),W=e=>!!e&&Number.isInteger(Number(e)),X=e=>e.endsWith('%')&&q(e.slice(0,-1)),K=e=>F.test(e),Z=()=>!0,Y=e=>U.test(e)&&!G.test(e),J=()=>!1,Q=e=>z.test(e),$=e=>j.test(e),ee=e=>!re(e)&&!ue(e),te=e=>ve(e,Ee,J),re=e=>B.test(e),ne=e=>ve(e,Ne,Y),oe=e=>ve(e,xe,q),ie=e=>ve(e,Ce,Z),ae=e=>ve(e,ke,J),se=e=>ve(e,ye,J),le=e=>ve(e,we,$),ce=e=>ve(e,Se,Q),ue=e=>M.test(e),de=e=>be(e,Ne),he=e=>be(e,ke),fe=e=>be(e,ye),me=e=>be(e,Ee),pe=e=>be(e,we),ge=e=>be(e,Se,!0),_e=e=>be(e,Ce,!0),ve=(e,t,r)=>{const n=B.exec(e);return!!n&&(n[1]?t(n[1]):r(n[2]))},be=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=M.exec(e);return!!n&&(n[1]?t(n[1]):r)},ye=e=>'position'===e||'percentage'===e,we=e=>'image'===e||'url'===e,Ee=e=>'length'===e||'size'===e||'bg-size'===e,Ne=e=>'length'===e,xe=e=>'number'===e,ke=e=>'family-name'===e,Ce=e=>'number'===e||'weight'===e,Se=e=>'shadow'===e,Te=H(()=>{const e=L('color'),t=L('font'),r=L('text'),n=L('font-weight'),o=L('tracking'),i=L('leading'),a=L('breakpoint'),s=L('container'),l=L('spacing'),c=L('radius'),u=L('shadow'),d=L('inset-shadow'),h=L('text-shadow'),f=L('drop-shadow'),m=L('blur'),p=L('perspective'),g=L('aspect'),_=L('ease'),v=L('animate'),b=()=>['center','top','bottom','left','right','top-left','left-top','top-right','right-top','bottom-right','right-bottom','bottom-left','left-bottom',ue,re],y=()=>[ue,re,l],w=()=>[V,'full','auto',...y()],E=()=>[W,'none','subgrid',ue,re],N=()=>['auto',{span:['full',W,ue,re]},W,ue,re],x=()=>[W,'auto',ue,re],k=()=>['auto','min','max','fr',ue,re],C=()=>['auto',...y()],S=()=>[V,'auto','full','dvw','dvh','lvw','lvh','svw','svh','min','max','fit',...y()],T=()=>[V,'screen','full','dvw','lvw','svw','min','max','fit',...y()],I=()=>[V,'screen','full','lh','dvh','lvh','svh','min','max','fit',...y()],A=()=>[e,ue,re],P=()=>['center','top','bottom','left','right','top-left','left-top','top-right','right-top','bottom-right','right-bottom','bottom-left','left-bottom',fe,se,{position:[ue,re]}],R=()=>['auto','cover','contain',me,te,{size:[ue,re]}],H=()=>[X,de,ne],O=()=>['','none','full',c,ue,re],B=()=>['',q,de,ne],M=()=>[q,X,fe,se],D=()=>['','none',m,ue,re],F=()=>['none',q,ue,re],U=()=>['none',q,ue,re],G=()=>[q,ue,re],z=()=>[V,'full',...y()];return{cacheSize:500,theme:{animate:['spin','ping','pulse','bounce'],aspect:['video'],blur:[K],breakpoint:[K],color:[Z],container:[K],'drop-shadow':[K],ease:['in','out','in-out'],font:[ee],'font-weight':['thin','extralight','light','normal','medium','semibold','bold','extrabold','black'],'inset-shadow':[K],leading:['none','tight','snug','normal','relaxed','loose'],perspective:['dramatic','near','normal','midrange','distant','none'],radius:[K],shadow:[K],spacing:['px',q],text:[K],'text-shadow':[K],tracking:['tighter','tight','normal','wide','wider','widest']},classGroups:{aspect:[{aspect:['auto','square',V,re,ue,g]}],container:['container'],columns:[{columns:[q,re,ue,s]}],'break-after':[{'break-after':['auto','avoid','all','avoid-page','page','left','right','column']}],'break-before':[{'break-before':['auto','avoid','all','avoid-page','page','left','right','column']}],'break-inside':[{'break-inside':['auto','avoid','avoid-page','avoid-column']}],'box-decoration':[{'box-decoration':['slice','clone']}],box:[{box:['border','content']}],display:['block','inline-block','inline','flex','inline-flex','table','inline-table','table-caption','table-cell','table-column','table-column-group','table-footer-group','table-header-group','table-row-group','table-row','flow-root','grid','inline-grid','contents','list-item','hidden'],sr:['sr-only','not-sr-only'],float:[{float:['right','left','none','start','end']}],clear:[{clear:['left','right','both','none','start','end']}],isolation:['isolate','isolation-auto'],'object-fit':[{object:['contain','cover','fill','none','scale-down']}],'object-position':[{object:b()}],overflow:[{overflow:['auto','hidden','clip','visible','scroll']}],'overflow-x':[{'overflow-x':['auto','hidden','clip','visible','scroll']}],'overflow-y':[{'overflow-y':['auto','hidden','clip','visible','scroll']}],overscroll:[{overscroll:['auto','contain','none']}],'overscroll-x':[{'overscroll-x':['auto','contain','none']}],'overscroll-y':[{'overscroll-y':['auto','contain','none']}],position:['static','fixed','absolute','relative','sticky'],inset:[{inset:w()}],'inset-x':[{'inset-x':w()}],'inset-y':[{'inset-y':w()}],start:[{'inset-s':w(),start:w()}],end:[{'inset-e':w(),end:w()}],'inset-bs':[{'inset-bs':w()}],'inset-be':[{'inset-be':w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:['visible','invisible','collapse'],z:[{z:[W,'auto',ue,re]}],basis:[{basis:[V,'full','auto',s,...y()]}],'flex-direction':[{flex:['row','row-reverse','col','col-reverse']}],'flex-wrap':[{flex:['nowrap','wrap','wrap-reverse']}],flex:[{flex:[q,V,'auto','initial','none',re]}],grow:[{grow:['',q,ue,re]}],shrink:[{shrink:['',q,ue,re]}],order:[{order:[W,'first','last','none',ue,re]}],'grid-cols':[{'grid-cols':E()}],'col-start-end':[{col:N()}],'col-start':[{'col-start':x()}],'col-end':[{'col-end':x()}],'grid-rows':[{'grid-rows':E()}],'row-start-end':[{row:N()}],'row-start':[{'row-start':x()}],'row-end':[{'row-end':x()}],'grid-flow':[{'grid-flow':['row','col','dense','row-dense','col-dense']}],'auto-cols':[{'auto-cols':k()}],'auto-rows':[{'auto-rows':k()}],gap:[{gap:y()}],'gap-x':[{'gap-x':y()}],'gap-y':[{'gap-y':y()}],'justify-content':[{justify:['start','end','center','between','around','evenly','stretch','baseline','center-safe','end-safe','normal']}],'justify-items':[{'justify-items':['start','end','center','stretch','center-safe','end-safe','normal']}],'justify-self':[{'justify-self':['auto','start','end','center','stretch','center-safe','end-safe']}],'align-content':[{content:['normal','start','end','center','between','around','evenly','stretch','baseline','center-safe','end-safe']}],'align-items':[{items:['start','end','center','stretch','center-safe','end-safe',{baseline:['','last']}]}],'align-self':[{self:['auto','start','end','center','stretch','center-safe','end-safe',{baseline:['','last']}]}],'place-content':[{'place-content':['start','end','center','between','around','evenly','stretch','baseline','center-safe','end-safe']}],'place-items':[{'place-items':['start','end','center','stretch','center-safe','end-safe','baseline']}],'place-self':[{'place-self':['auto','start','end','center','stretch','center-safe','end-safe']}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pbs:[{pbs:y()}],pbe:[{pbe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:C()}],mx:[{mx:C()}],my:[{my:C()}],ms:[{ms:C()}],me:[{me:C()}],mbs:[{mbs:C()}],mbe:[{mbe:C()}],mt:[{mt:C()}],mr:[{mr:C()}],mb:[{mb:C()}],ml:[{ml:C()}],'space-x':[{'space-x':y()}],'space-x-reverse':['space-x-reverse'],'space-y':[{'space-y':y()}],'space-y-reverse':['space-y-reverse'],size:[{size:S()}],'inline-size':[{inline:['auto',...T()]}],'min-inline-size':[{'min-inline':['auto',...T()]}],'max-inline-size':[{'max-inline':['none',...T()]}],'block-size':[{block:['auto',...I()]}],'min-block-size':[{'min-block':['auto',...I()]}],'max-block-size':[{'max-block':['none',...I()]}],w:[{w:[s,'screen',...S()]}],'min-w':[{'min-w':[s,'screen','none',...S()]}],'max-w':[{'max-w':[s,'screen','none','prose',{screen:[a]},...S()]}],h:[{h:['screen','lh',...S()]}],'min-h':[{'min-h':['screen','lh','none',...S()]}],'max-h':[{'max-h':['screen','lh',...S()]}],'font-size':[{text:['base',r,de,ne]}],'font-smoothing':['antialiased','subpixel-antialiased'],'font-style':['italic','not-italic'],'font-weight':[{font:[n,_e,ie]}],'font-stretch':[{'font-stretch':['ultra-condensed','extra-condensed','condensed','semi-condensed','normal','semi-expanded','expanded','extra-expanded','ultra-expanded',X,re]}],'font-family':[{font:[he,ae,t]}],'font-features':[{'font-features':[re]}],'fvn-normal':['normal-nums'],'fvn-ordinal':['ordinal'],'fvn-slashed-zero':['slashed-zero'],'fvn-figure':['lining-nums','oldstyle-nums'],'fvn-spacing':['proportional-nums','tabular-nums'],'fvn-fraction':['diagonal-fractions','stacked-fractions'],tracking:[{tracking:[o,ue,re]}],'line-clamp':[{'line-clamp':[q,'none',ue,oe]}],leading:[{leading:[i,...y()]}],'list-image':[{'list-image':['none',ue,re]}],'list-style-position':[{list:['inside','outside']}],'list-style-type':[{list:['disc','decimal','none',ue,re]}],'text-alignment':[{text:['left','center','right','justify','start','end']}],'placeholder-color':[{placeholder:A()}],'text-color':[{text:A()}],'text-decoration':['underline','overline','line-through','no-underline'],'text-decoration-style':[{decoration:['solid','dashed','dotted','double','wavy']}],'text-decoration-thickness':[{decoration:[q,'from-font','auto',ue,ne]}],'text-decoration-color':[{decoration:A()}],'underline-offset':[{'underline-offset':[q,'auto',ue,re]}],'text-transform':['uppercase','lowercase','capitalize','normal-case'],'text-overflow':['truncate','text-ellipsis','text-clip'],'text-wrap':[{text:['wrap','nowrap','balance','pretty']}],indent:[{indent:y()}],'vertical-align':[{align:['baseline','top','middle','bottom','text-top','text-bottom','sub','super',ue,re]}],whitespace:[{whitespace:['normal','nowrap','pre','pre-line','pre-wrap','break-spaces']}],break:[{break:['normal','words','all','keep']}],wrap:[{wrap:['break-word','anywhere','normal']}],hyphens:[{hyphens:['none','manual','auto']}],content:[{content:['none',ue,re]}],'bg-attachment':[{bg:['fixed','local','scroll']}],'bg-clip':[{'bg-clip':['border','padding','content','text']}],'bg-origin':[{'bg-origin':['border','padding','content']}],'bg-position':[{bg:P()}],'bg-repeat':[{bg:['no-repeat',{repeat:['','x','y','space','round']}]}],'bg-size':[{bg:R()}],'bg-image':[{bg:['none',{linear:[{to:['t','tr','r','br','b','bl','l','tl']},W,ue,re],radial:['',ue,re],conic:[W,ue,re]},pe,le]}],'bg-color':[{bg:A()}],'gradient-from-pos':[{from:H()}],'gradient-via-pos':[{via:H()}],'gradient-to-pos':[{to:H()}],'gradient-from':[{from:A()}],'gradient-via':[{via:A()}],'gradient-to':[{to:A()}],rounded:[{rounded:O()}],'rounded-s':[{'rounded-s':O()}],'rounded-e':[{'rounded-e':O()}],'rounded-t':[{'rounded-t':O()}],'rounded-r':[{'rounded-r':O()}],'rounded-b':[{'rounded-b':O()}],'rounded-l':[{'rounded-l':O()}],'rounded-ss':[{'rounded-ss':O()}],'rounded-se':[{'rounded-se':O()}],'rounded-ee':[{'rounded-ee':O()}],'rounded-es':[{'rounded-es':O()}],'rounded-tl':[{'rounded-tl':O()}],'rounded-tr':[{'rounded-tr':O()}],'rounded-br':[{'rounded-br':O()}],'rounded-bl':[{'rounded-bl':O()}],'border-w':[{border:B()}],'border-w-x':[{'border-x':B()}],'border-w-y':[{'border-y':B()}],'border-w-s':[{'border-s':B()}],'border-w-e':[{'border-e':B()}],'border-w-bs':[{'border-bs':B()}],'border-w-be':[{'border-be':B()}],'border-w-t':[{'border-t':B()}],'border-w-r':[{'border-r':B()}],'border-w-b':[{'border-b':B()}],'border-w-l':[{'border-l':B()}],'divide-x':[{'divide-x':B()}],'divide-x-reverse':['divide-x-reverse'],'divide-y':[{'divide-y':B()}],'divide-y-reverse':['divide-y-reverse'],'border-style':[{border:['solid','dashed','dotted','double','hidden','none']}],'divide-style':[{divide:['solid','dashed','dotted','double','hidden','none']}],'border-color':[{border:A()}],'border-color-x':[{'border-x':A()}],'border-color-y':[{'border-y':A()}],'border-color-s':[{'border-s':A()}],'border-color-e':[{'border-e':A()}],'border-color-bs':[{'border-bs':A()}],'border-color-be':[{'border-be':A()}],'border-color-t':[{'border-t':A()}],'border-color-r':[{'border-r':A()}],'border-color-b':[{'border-b':A()}],'border-color-l':[{'border-l':A()}],'divide-color':[{divide:A()}],'outline-style':[{outline:['solid','dashed','dotted','double','none','hidden']}],'outline-offset':[{'outline-offset':[q,ue,re]}],'outline-w':[{outline:['',q,de,ne]}],'outline-color':[{outline:A()}],shadow:[{shadow:['','none',u,ge,ce]}],'shadow-color':[{shadow:A()}],'inset-shadow':[{'inset-shadow':['none',d,ge,ce]}],'inset-shadow-color':[{'inset-shadow':A()}],'ring-w':[{ring:B()}],'ring-w-inset':['ring-inset'],'ring-color':[{ring:A()}],'ring-offset-w':[{'ring-offset':[q,ne]}],'ring-offset-color':[{'ring-offset':A()}],'inset-ring-w':[{'inset-ring':B()}],'inset-ring-color':[{'inset-ring':A()}],'text-shadow':[{'text-shadow':['none',h,ge,ce]}],'text-shadow-color':[{'text-shadow':A()}],opacity:[{opacity:[q,ue,re]}],'mix-blend':[{'mix-blend':['normal','multiply','screen','overlay','darken','lighten','color-dodge','color-burn','hard-light','soft-light','difference','exclusion','hue','saturation','color','luminosity','plus-darker','plus-lighter']}],'bg-blend':[{'bg-blend':['normal','multiply','screen','overlay','darken','lighten','color-dodge','color-burn','hard-light','soft-light','difference','exclusion','hue','saturation','color','luminosity']}],'mask-clip':[{'mask-clip':['border','padding','content','fill','stroke','view']},'mask-no-clip'],'mask-composite':[{mask:['add','subtract','intersect','exclude']}],'mask-image-linear-pos':[{'mask-linear':[q]}],'mask-image-linear-from-pos':[{'mask-linear-from':M()}],'mask-image-linear-to-pos':[{'mask-linear-to':M()}],'mask-image-linear-from-color':[{'mask-linear-from':A()}],'mask-image-linear-to-color':[{'mask-linear-to':A()}],'mask-image-t-from-pos':[{'mask-t-from':M()}],'mask-image-t-to-pos':[{'mask-t-to':M()}],'mask-image-t-from-color':[{'mask-t-from':A()}],'mask-image-t-to-color':[{'mask-t-to':A()}],'mask-image-r-from-pos':[{'mask-r-from':M()}],'mask-image-r-to-pos':[{'mask-r-to':M()}],'mask-image-r-from-color':[{'mask-r-from':A()}],'mask-image-r-to-color':[{'mask-r-to':A()}],'mask-image-b-from-pos':[{'mask-b-from':M()}],'mask-image-b-to-pos':[{'mask-b-to':M()}],'mask-image-b-from-color':[{'mask-b-from':A()}],'mask-image-b-to-color':[{'mask-b-to':A()}],'mask-image-l-from-pos':[{'mask-l-from':M()}],'mask-image-l-to-pos':[{'mask-l-to':M()}],'mask-image-l-from-color':[{'mask-l-from':A()}],'mask-image-l-to-color':[{'mask-l-to':A()}],'mask-image-x-from-pos':[{'mask-x-from':M()}],'mask-image-x-to-pos':[{'mask-x-to':M()}],'mask-image-x-from-color':[{'mask-x-from':A()}],'mask-image-x-to-color':[{'mask-x-to':A()}],'mask-image-y-from-pos':[{'mask-y-from':M()}],'mask-image-y-to-pos':[{'mask-y-to':M()}],'mask-image-y-from-color':[{'mask-y-from':A()}],'mask-image-y-to-color':[{'mask-y-to':A()}],'mask-image-radial':[{'mask-radial':[ue,re]}],'mask-image-radial-from-pos':[{'mask-radial-from':M()}],'mask-image-radial-to-pos':[{'mask-radial-to':M()}],'mask-image-radial-from-color':[{'mask-radial-from':A()}],'mask-image-radial-to-color':[{'mask-radial-to':A()}],'mask-image-radial-shape':[{'mask-radial':['circle','ellipse']}],'mask-image-radial-size':[{'mask-radial':[{closest:['side','corner'],farthest:['side','corner']}]}],'mask-image-radial-pos':[{'mask-radial-at':['center','top','bottom','left','right','top-left','left-top','top-right','right-top','bottom-right','right-bottom','bottom-left','left-bottom']}],'mask-image-conic-pos':[{'mask-conic':[q]}],'mask-image-conic-from-pos':[{'mask-conic-from':M()}],'mask-image-conic-to-pos':[{'mask-conic-to':M()}],'mask-image-conic-from-color':[{'mask-conic-from':A()}],'mask-image-conic-to-color':[{'mask-conic-to':A()}],'mask-mode':[{mask:['alpha','luminance','match']}],'mask-origin':[{'mask-origin':['border','padding','content','fill','stroke','view']}],'mask-position':[{mask:P()}],'mask-repeat':[{mask:['no-repeat',{repeat:['','x','y','space','round']}]}],'mask-size':[{mask:R()}],'mask-type':[{'mask-type':['alpha','luminance']}],'mask-image':[{mask:['none',ue,re]}],filter:[{filter:['','none',ue,re]}],blur:[{blur:D()}],brightness:[{brightness:[q,ue,re]}],contrast:[{contrast:[q,ue,re]}],'drop-shadow':[{'drop-shadow':['','none',f,ge,ce]}],'drop-shadow-color':[{'drop-shadow':A()}],grayscale:[{grayscale:['',q,ue,re]}],'hue-rotate':[{'hue-rotate':[q,ue,re]}],invert:[{invert:['',q,ue,re]}],saturate:[{saturate:[q,ue,re]}],sepia:[{sepia:['',q,ue,re]}],'backdrop-filter':[{'backdrop-filter':['','none',ue,re]}],'backdrop-blur':[{'backdrop-blur':D()}],'backdrop-brightness':[{'backdrop-brightness':[q,ue,re]}],'backdrop-contrast':[{'backdrop-contrast':[q,ue,re]}],'backdrop-grayscale':[{'backdrop-grayscale':['',q,ue,re]}],'backdrop-hue-rotate':[{'backdrop-hue-rotate':[q,ue,re]}],'backdrop-invert':[{'backdrop-invert':['',q,ue,re]}],'backdrop-opacity':[{'backdrop-opacity':[q,ue,re]}],'backdrop-saturate':[{'backdrop-saturate':[q,ue,re]}],'backdrop-sepia':[{'backdrop-sepia':['',q,ue,re]}],'border-collapse':[{border:['collapse','separate']}],'border-spacing':[{'border-spacing':y()}],'border-spacing-x':[{'border-spacing-x':y()}],'border-spacing-y':[{'border-spacing-y':y()}],'table-layout':[{table:['auto','fixed']}],caption:[{caption:['top','bottom']}],transition:[{transition:['','all','colors','opacity','shadow','transform','none',ue,re]}],'transition-behavior':[{transition:['normal','discrete']}],duration:[{duration:[q,'initial',ue,re]}],ease:[{ease:['linear','initial',_,ue,re]}],delay:[{delay:[q,ue,re]}],animate:[{animate:['none',v,ue,re]}],backface:[{backface:['hidden','visible']}],perspective:[{perspective:[p,ue,re]}],'perspective-origin':[{'perspective-origin':b()}],rotate:[{rotate:F()}],'rotate-x':[{'rotate-x':F()}],'rotate-y':[{'rotate-y':F()}],'rotate-z':[{'rotate-z':F()}],scale:[{scale:U()}],'scale-x':[{'scale-x':U()}],'scale-y':[{'scale-y':U()}],'scale-z':[{'scale-z':U()}],'scale-3d':['scale-3d'],skew:[{skew:G()}],'skew-x':[{'skew-x':G()}],'skew-y':[{'skew-y':G()}],transform:[{transform:[ue,re,'','none','gpu','cpu']}],'transform-origin':[{origin:b()}],'transform-style':[{transform:['3d','flat']}],translate:[{translate:z()}],'translate-x':[{'translate-x':z()}],'translate-y':[{'translate-y':z()}],'translate-z':[{'translate-z':z()}],'translate-none':['translate-none'],accent:[{accent:A()}],appearance:[{appearance:['none','auto']}],'caret-color':[{caret:A()}],'color-scheme':[{scheme:['normal','dark','light','light-dark','only-dark','only-light']}],cursor:[{cursor:['auto','default','pointer','wait','text','move','help','not-allowed','none','context-menu','progress','cell','crosshair','vertical-text','alias','copy','no-drop','grab','grabbing','all-scroll','col-resize','row-resize','n-resize','e-resize','s-resize','w-resize','ne-resize','nw-resize','se-resize','sw-resize','ew-resize','ns-resize','nesw-resize','nwse-resize','zoom-in','zoom-out',ue,re]}],'field-sizing':[{'field-sizing':['fixed','content']}],'pointer-events':[{'pointer-events':['auto','none']}],resize:[{resize:['none','','y','x']}],'scroll-behavior':[{scroll:['auto','smooth']}],'scroll-m':[{'scroll-m':y()}],'scroll-mx':[{'scroll-mx':y()}],'scroll-my':[{'scroll-my':y()}],'scroll-ms':[{'scroll-ms':y()}],'scroll-me':[{'scroll-me':y()}],'scroll-mbs':[{'scroll-mbs':y()}],'scroll-mbe':[{'scroll-mbe':y()}],'scroll-mt':[{'scroll-mt':y()}],'scroll-mr':[{'scroll-mr':y()}],'scroll-mb':[{'scroll-mb':y()}],'scroll-ml':[{'scroll-ml':y()}],'scroll-p':[{'scroll-p':y()}],'scroll-px':[{'scroll-px':y()}],'scroll-py':[{'scroll-py':y()}],'scroll-ps':[{'scroll-ps':y()}],'scroll-pe':[{'scroll-pe':y()}],'scroll-pbs':[{'scroll-pbs':y()}],'scroll-pbe':[{'scroll-pbe':y()}],'scroll-pt':[{'scroll-pt':y()}],'scroll-pr':[{'scroll-pr':y()}],'scroll-pb':[{'scroll-pb':y()}],'scroll-pl':[{'scroll-pl':y()}],'snap-align':[{snap:['start','end','center','align-none']}],'snap-stop':[{snap:['normal','always']}],'snap-type':[{snap:['none','x','y','both']}],'snap-strictness':[{snap:['mandatory','proximity']}],touch:[{touch:['auto','none','manipulation']}],'touch-x':[{'touch-pan':['x','left','right']}],'touch-y':[{'touch-pan':['y','up','down']}],'touch-pz':['touch-pinch-zoom'],select:[{select:['none','text','all','auto']}],'will-change':[{'will-change':['auto','scroll','contents','transform',ue,re]}],fill:[{fill:['none',...A()]}],'stroke-w':[{stroke:[q,de,ne,oe]}],stroke:[{stroke:['none',...A()]}],'forced-color-adjust':[{'forced-color-adjust':['auto','none']}]},conflictingClassGroups:{overflow:['overflow-x','overflow-y'],overscroll:['overscroll-x','overscroll-y'],inset:['inset-x','inset-y','inset-bs','inset-be','start','end','top','right','bottom','left'],'inset-x':['right','left'],'inset-y':['top','bottom'],flex:['basis','grow','shrink'],gap:['gap-x','gap-y'],p:['px','py','ps','pe','pbs','pbe','pt','pr','pb','pl'],px:['pr','pl'],py:['pt','pb'],m:['mx','my','ms','me','mbs','mbe','mt','mr','mb','ml'],mx:['mr','ml'],my:['mt','mb'],size:['w','h'],'font-size':['leading'],'fvn-normal':['fvn-ordinal','fvn-slashed-zero','fvn-figure','fvn-spacing','fvn-fraction'],'fvn-ordinal':['fvn-normal'],'fvn-slashed-zero':['fvn-normal'],'fvn-figure':['fvn-normal'],'fvn-spacing':['fvn-normal'],'fvn-fraction':['fvn-normal'],'line-clamp':['display','overflow'],rounded:['rounded-s','rounded-e','rounded-t','rounded-r','rounded-b','rounded-l','rounded-ss','rounded-se','rounded-ee','rounded-es','rounded-tl','rounded-tr','rounded-br','rounded-bl'],'rounded-s':['rounded-ss','rounded-es'],'rounded-e':['rounded-se','rounded-ee'],'rounded-t':['rounded-tl','rounded-tr'],'rounded-r':['rounded-tr','rounded-br'],'rounded-b':['rounded-br','rounded-bl'],'rounded-l':['rounded-tl','rounded-bl'],'border-spacing':['border-spacing-x','border-spacing-y'],'border-w':['border-w-x','border-w-y','border-w-s','border-w-e','border-w-bs','border-w-be','border-w-t','border-w-r','border-w-b','border-w-l'],'border-w-x':['border-w-r','border-w-l'],'border-w-y':['border-w-t','border-w-b'],'border-color':['border-color-x','border-color-y','border-color-s','border-color-e','border-color-bs','border-color-be','border-color-t','border-color-r','border-color-b','border-color-l'],'border-color-x':['border-color-r','border-color-l'],'border-color-y':['border-color-t','border-color-b'],translate:['translate-x','translate-y','translate-none'],'translate-none':['translate','translate-x','translate-y','translate-z'],'scroll-m':['scroll-mx','scroll-my','scroll-ms','scroll-me','scroll-mbs','scroll-mbe','scroll-mt','scroll-mr','scroll-mb','scroll-ml'],'scroll-mx':['scroll-mr','scroll-ml'],'scroll-my':['scroll-mt','scroll-mb'],'scroll-p':['scroll-px','scroll-py','scroll-ps','scroll-pe','scroll-pbs','scroll-pbe','scroll-pt','scroll-pr','scroll-pb','scroll-pl'],'scroll-px':['scroll-pr','scroll-pl'],'scroll-py':['scroll-pt','scroll-pb'],touch:['touch-x','touch-y','touch-pz'],'touch-x':['touch'],'touch-y':['touch'],'touch-pz':['touch']},conflictingClassGroupModifiers:{'font-size':['leading']},orderSensitiveModifiers:['*','**','after','backdrop','before','details-content','file','first-letter','first-line','marker','placeholder','selection']}});function Ie(e){return 60*e*1e3}const Ae={key:'session_id',type:'sessionStorage',expiration:(Pe=1,60*Pe*60*1e3)};var Pe;const Re={key:'dialog_expiration',type:'sessionStorage'},He=Ie(10),Oe={key:'cart',type:'sessionStorage',expiration:Ie(5)},Le={key:'debug_mode',type:'sessionStorage'};function Be(e){return''.concat('rflows_').concat(e)}var Me=(e,t)=>{let{key:r,type:n,expiration:o}=e;const i={value:t,expiration:o?Date.now()+o:void 0};Ue(n).setItem(Be(r),JSON.stringify(i))},De=e=>{let{key:t,type:r}=e;const n=Ue(r),o=n.getItem(Be(t));if(!o)return null;try{const e=JSON.parse(o);return e.expiration&&Date.now()>e.expiration?(n.removeItem(Be(t)),null):e.value}catch(e){return null}},Fe=e=>{let{key:t,type:r}=e;Ue(r).removeItem(Be(t))};function Ue(e){if('sessionStorage'===e)return sessionStorage;if('localStorage'===e)return localStorage;throw new Error('Invalid storage type: '.concat(e))}const Ge='[RF]';var ze;(e=>{e[e.DEBUG=0]='DEBUG',e[e.INFO=1]='INFO',e[e.WARN=2]='WARN',e[e.ERROR=3]='ERROR'})(ze||(ze={}));class je{constructor(){}static getInstance(){return je.instance||(je.instance=new je),je.instance}checkDebugMode(){const e=De(Le);return Boolean(e)}log(e,t){if(this.checkDebugMode()){for(var r=arguments.length,n=new Array(r>2?r-2:0),o=2;o<r;o++)n[o-2]=arguments[o];switch(e){case ze.DEBUG:console.debug(''.concat(Ge,' ').concat(t),...n);break;case ze.INFO:console.info(''.concat(Ge,' ').concat(t),...n);break;case ze.WARN:console.warn(''.concat(Ge,' ').concat(t),...n);break;case ze.ERROR:console.error(''.concat(Ge,' ').concat(t),...n)}}}debug(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.DEBUG,e,...r)}info(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.INFO,e,...r)}warn(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.WARN,e,...r)}error(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log(ze.ERROR,e,...r)}}const Ve=je.getInstance();function qe(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Te(u(t))}function We(e){return null==e}function Xe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return We(e)||''===e?t:('number'!=typeof e&&(e=parseFloat(e)),isNaN(e)||'Infinity'===e.toString()?t:e)}function Ke(){var e;const t=null!==(e=window.__rf_original_search)&&void 0!==e?e:window.location.search;return new URLSearchParams(t)}function Ze(e,t){const r=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.startsWith('http://')||e.startsWith('https://')?e:t?'https://'.concat(e):'http://'.concat(e)}(window.location.host);!function(e,t){if(We(e)||''===e)throw new Error(t)}(r,'Shopify root URL is not defined');const n=new URLSearchParams;t&&Object.entries(t).forEach(e=>{let[t,r]=e;n.set(t,r)});let o=r;return e.startsWith('/')||(o+='/'),o+=e,n.toString()&&(o+='?'.concat(n.toString())),o}async function Ye(e,t){var r;const o=Ze(e,{rf:'true'}),i=await fetch(o,n({method:null!==(r=null==t?void 0:t.method)&&void 0!==r?r:null!=t&&t.body?'POST':'GET',cache:'no-cache',headers:{'Content-Type':'application/json'}},t));if(!i.ok){const e=await i.json();if(e&&'message'in e)throw e;throw new Error('Unknown error')}return await i.json()}function Je(){Fe(Oe),Fe(Ae),Fe(Re),Fe(Le)}function Qe(e){if(!e)return'';const t=e.toString().split('/').pop();return t||''}function $e(e){return r='ProductVariant','string'==typeof(t=e)&&t.startsWith('gid://')?t:'gid://shopify/'.concat(r,'/').concat(t);var t,r}function et(e,t){return e.filter(e=>e.type===t).flatMap(e=>e.products.map(e=>Number(Qe(e.shopifyProductId))))}function tt(e,t){const r=et(t,'NO_EXCHANGE_TO'),o=[],i=[],{items:a,itemCount:s}=(e.items||[]).reduce((e,t)=>{if(r.includes(t.product_id))return o.push(t),e;if(t.has_components)return i.push(t),e;const a=e.items.find(e=>e.variant_id===t.variant_id);return e.itemCount+=t.quantity||0,a?(a.quantity+=t.quantity,e):(e.items.push(n({},t)),e)},{items:[],itemCount:0});return{cart:n(n({},e),{},{items:a,item_count:s}),excludedItems:o,bundleItems:i}}function rt(e){let{cart1:t,cart2:r,rules:n}=e;const{cart:o}=tt(t,n),{cart:i}=tt(r,n),a=o.items||[],s=i.items||[];if(a.length!==s.length)return!1;const l=new Map(a.map(e=>[e.variant_id,e.quantity]));for(const e of s)if(l.get(e.variant_id)!==e.quantity)return!1;return!0}async function nt(){let e,t=!1,r=!1;if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0]){const r=De(Oe);r&&(t=!0,e=r)}if(!e){if(l()){const t=s();t&&(Ve.info('[CartProvider] Using provider.getCart()'),e=await t.getCart(),r=!0)}e||(Ve.info('[CartProvider] No provider, falling back to /cart.js'),e=await Ye('/cart.js')),st(e)}const n=t?'Storage':r?'Provider':'API';return Ve.info('Fetched cart ('.concat(n,')'),e),e}async function ot(){if(l()){const e=s();if(null!=e&&e.clearCart){Ve.info('[CartProvider] Using provider.clearCart()');const t=await e.clearCart();return st(t),t}Ve.info('[CartProvider] Provider exists but clearCart not implemented, falling back to /cart/clear.js')}const e=await Ye('/cart/clear.js',{method:'POST'});return st(e),e}async function it(e){let{variantId:t,quantity:r,isRetry:n=!1}=e;try{if(We(r))throw new Error('Quantity cannot be null or undefined');if(l()){const e=s();if(e){const o=(await nt(!n)).items.find(e=>e.variant_id===t);if(!o)return Ve.warn('[CartProvider] Item with variantId '.concat(t,' not found in cart')),n?(await at(t,r),nt(!1)):(Ve.info('[CartProvider] Retrying with fresh cart data...'),it({variantId:t,quantity:r,isRetry:!0}));const i=o.line_id,a=o.merchandise_id||$e(t);if(!i)return Ve.warn('[CartProvider] No line_id on cart item'),n?(Ve.warn('[CartProvider] Still no line_id after retry, falling back to /cart/change.js'),await at(t,r),nt(!1)):(Ve.info('[CartProvider] Retrying with fresh cart data...'),it({variantId:t,quantity:r,isRetry:!0}));if(0===r&&e.removeItems)Ve.info('[CartProvider] Using provider.removeItems(['.concat(i,'])')),await e.removeItems([i]);else if(e.updateItems){const t={id:i,merchandiseId:a,quantity:r};Ve.info('[CartProvider] Using provider.updateItems()',t),await e.updateItems([t])}else Ve.info('[CartProvider] Provider exists but removeItems/updateItems not implemented, falling back to /cart/change.js'),await at(t,r);return nt(!1)}}return await at(t,r),nt(!1)}catch(e){const t=e;if(Ve.error('Error updating cart item quantity:',t),'status'in t)throw new Error(t.status.toString());throw new Error(t.message)}}async function at(e,t){var r;if(0===t)return void await Ye('/cart/change.js',{body:JSON.stringify({id:String(e),quantity:t})});const n=(await nt()).items||[],o=n.filter(t=>t.variant_id===e).reduce((e,t)=>e+(t.quantity||0),0),i=n.findIndex(t=>t.variant_id===e),a=t-o,s=Xe(null===(r=n[i])||void 0===r?void 0:r.quantity)+a;if(-1!==i){const e={line:String(i+1),quantity:s};await Ye('/cart/change.js',{body:JSON.stringify(e)})}}function st(e){e?Me(Oe,e):Fe(Oe)}function lt(e){return'edges'in e?e.edges.map(e=>e.node):e.map(e=>'node'in e?e.node:e)}function ct(e){const t=parseFloat(e);return Number.isNaN(t)?0:Math.round(100*t)}function ut(e){var t,r,n;if(null!==(t=e.merchandise.image)&&void 0!==t&&t.url)return e.merchandise.image.url;if(null!==(r=e.merchandise.product.featuredImage)&&void 0!==r&&r.url)return e.merchandise.product.featuredImage.url;const o=lt(null!==(n=e.merchandise.product.images)&&void 0!==n?n:[]);return o.length>0?o[0].url:''}function dt(e){var t;const{merchandise:r,quantity:n}=e,{product:o}=r,i=Number(Qe(r.id)),a=Number(Qe(o.id));let s,l;null!==(t=e.cost)&&void 0!==t&&t.amountPerQuantity?(s=ct(e.cost.amountPerQuantity.amount),l=e.cost.totalAmount?ct(e.cost.totalAmount.amount):s*n):r.price?(s=ct(r.price.amount),l=s*n):(s=0,l=0);const c=r.title,u=o.title,d=!c||'Default Title'===c||'Default'===c;return{variant_id:i,quantity:n,title:d?u:''.concat(u,' - ').concat(c),price:s,product_id:a,product_title:u,handle:o.handle,image:ut(e),grams:0,line_price:l,final_price:s,final_line_price:l,line_id:e.id,merchandise_id:r.id,variant_title:d?void 0:c,sku:r.sku,vendor:o.vendor,product_type:o.productType,requires_shipping:r.requiresShipping}}function ht(e){return function(e){if(!('lines'in e))return!1;const t=e.lines;return Array.isArray(t)||null!=t&&'object'==typeof t&&'edges'in t}(e)?function(e){var t,r;const n=lt(e.lines).map(dt),o=null!==(t=e.totalQuantity)&&void 0!==t?t:n.reduce((e,t)=>e+t.quantity,0);return{items:n,item_count:o,token:e.id,note:null!==(r=e.note)&&void 0!==r?r:''}}(e):e}function ft(e){const t=ht(e);return st(t),t}const mt={widgetViewState:null,config:null,returnContext:null,toastContext:null,cartProvider:null,isInitialized:!1,eventListeners:new Map};function pt(){mt.widgetViewState=null,mt.returnContext=null,mt.toastContext=null,mt.config=null,mt.cartProvider=null,mt.isInitialized=!1,mt.eventListeners.clear()}function gt(e){const t=e?function(e){return{async getCart(){const t=await e.getCart();return t?ft(t):void 0},clearCart:async()=>ft(await e.clearCart()),addItems:async t=>ft(await e.addItems(t)),updateItems:async t=>ft(await e.updateItems(t)),removeItems:async t=>ft(await e.removeItems(t))}}(e):null;if(mt.cartProvider=t,'undefined'!=typeof window){const e=window.Returnflows;e&&(e._cartProvider=t)}e?console.info('[RF] Cart provider registered.'):console.info('[RF] Cart provider cleared.')}function _t(){return mt.isInitialized}function vt(e){mt.widgetViewState?mt.widgetViewState.set(e):console.warn('[RF] Widget not initialized. Call init() first.')}async function bt(e){var t,r,n,o,i;const a=null===(t=mt.returnContext)||void 0===t?void 0:t.cartState,s=null===(r=mt.returnContext)||void 0===r?void 0:r.orderState,l=null===(n=mt.returnContext)||void 0===n?void 0:n.calculationState,c=null===(o=mt.config)||void 0===o?void 0:o.data.returnData;if(!a||null==s||!s.value.data)return console.warn('[RF] Widget not initialized or order not loaded.'),{cart:null,calculation:null,hasChanged:!1};const u=s.value.data,d=ht(e),h=u.orderData.productRules||[],f=null===(i=a.value.data)||void 0===i?void 0:i.original;var m;if(f&&rt({cart1:f,cart2:d,rules:h}))return{cart:f,calculation:null!==(m=null==l?void 0:l.value.data)&&void 0!==m?m:null,hasChanged:!1};const{cart:p}=tt(d,h);a.set({data:{original:d,transformed:p},pending:!1,error:null}),st(d),wt('cart:updated',d);const g=await(null==l?void 0:l.query({cart:p,orderId:u.orderData.id,lineItems:(null==c?void 0:c.items)||[]}));return{cart:p,calculation:null!=g?g:null,hasChanged:!0}}function yt(e,t){var r;null===(r=mt.eventListeners.get(e))||void 0===r||r.delete(t)}function wt(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];const o=mt.eventListeners.get(e);o&&o.forEach(t=>{try{t(...r)}catch(t){console.error('[RF] Error in '.concat(e,' event handler:'),t)}})}const Et=['onReady','onError','cartProvider'];const Nt=new class{constructor(){Object.defineProperty(this,'_initPromise',{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,'_cartProvider',{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,'version',{enumerable:!0,configurable:!0,writable:!0,value:'1.0.4'}),Object.defineProperty(this,'drawer',{enumerable:!0,configurable:!0,writable:!0,value:{open:()=>{this._ensureInitialized(),vt(i.Open)},close:()=>{this._ensureInitialized(),vt(i.Collapsed)},toggle:()=>{this._ensureInitialized();var e,t;vt((null!==(e=null===(t=mt.widgetViewState)||void 0===t?void 0:t.value)&&void 0!==e?e:null)===i.Open?i.Collapsed:i.Open)},isOpen:()=>{return this._ensureInitialized(),(null===(e=mt.widgetViewState)||void 0===e?void 0:e.value)===i.Open;var e}}}),Object.defineProperty(this,'data',{enumerable:!0,configurable:!0,writable:!0,value:{getCart:()=>function(){var e;const t=null===(e=mt.returnContext)||void 0===e?void 0:e.cartState;return null!=t&&t.value.data?t.value.data.original:null}(),getCalculation:()=>{return null!==(e=null===(t=mt.returnContext)||void 0===t?void 0:t.calculationState.value.data)&&void 0!==e?e:null;var e,t},getOrder:()=>function(){var e;const t=null===(e=mt.returnContext)||void 0===e||null===(e=e.orderState.value.data)||void 0===e?void 0:e.orderData;return t?{id:t.id,orderId:t.orderId,orderName:t.orderName,instantExchange:t.instantExchange,freeExchangeLabel:t.freeExchangeLabel,productsToExchange:t.productsToExchange,totalPrice:t.totalPrice}:null}(),isLoading:()=>{return null===(e=null===(t=mt.returnContext)||void 0===t?void 0:t.isPending)||void 0===e||e;var e,t}}}),Object.defineProperty(this,'cart',{enumerable:!0,configurable:!0,writable:!0,value:{setCart:async e=>(this._ensureInitialized(),bt(e)),refetch:async()=>{this._ensureInitialized(),await async function(){var e,t;const r=null===(e=mt.returnContext)||void 0===e?void 0:e.cartState,n=null===(t=mt.returnContext)||void 0===t?void 0:t.orderState;if(r&&null!=n&&n.value.data){if(mt.cartProvider)try{const e=await mt.cartProvider.getCart();if(!e)return;return bt(e)}catch(e){return console.error('[RF] Cart provider getCart failed:',e),void wt('error',e instanceof Error?e:new Error(String(e)))}await r.query(n.value.data)}else console.warn('[RF] Widget not initialized or order not loaded.')}()},clear:async()=>{this._ensureInitialized(),await async function(){var e;if(mt.isInitialized){if(null!==(e=mt.cartProvider)&&void 0!==e&&e.clearCart)try{return bt(await mt.cartProvider.clearCart())}catch(e){return console.error('[RF] Cart provider clearCart failed:',e),void wt('error',e instanceof Error?e:new Error(String(e)))}document.dispatchEvent(new CustomEvent('RF_CART_AND_CALCULATION_REFETCH'))}else console.warn('[RF] Widget not initialized. Call init() first.')}()}}}),Object.defineProperty(this,'toast',{enumerable:!0,configurable:!0,writable:!0,value:{show:e=>(this._ensureInitialized(),function(e){return mt.toastContext?mt.toastContext.add({message:e.message,tone:e.tone,duration:e.duration,onClose:e.onClose}):(console.warn('[RF] Widget not initialized. Call init() first.'),'')}(e)),dismiss:e=>{this._ensureInitialized(),function(e){mt.toastContext?mt.toastContext.remove(e):console.warn('[RF] Widget not initialized.')}(e)},clear:()=>{this._ensureInitialized(),mt.toastContext?mt.toastContext.clear():console.warn('[RF] Widget not initialized.')}}})}async init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._initPromise?(console.warn('[RF] Already initializing. Returning existing promise.'),this._initPromise):_t()?void console.warn('[RF] Already initialized. Call destroy() first to reinitialize.'):(this._initPromise=new Promise((t,r)=>{(async()=>{try{var i;const{onReady:r,onError:s,cartProvider:l}=e,c=o(e,Et);l&&gt(l);const{default:u}=await Promise.resolve().then(()=>Dr),{default:d}=await Promise.resolve().then(()=>Ml),{h}=await Promise.resolve().then(()=>gr),f=await u(e=>h(d,e),n({networkInterceptionMethod:'none'},c));if(!f.success){var a;if('CONTAINER_EXISTS'===f.reason)return await this._waitForBridge(),null===(a=e.onReady)||void 0===a||a.call(e),t();if('MISSING_SESSION_ID'===f.reason)return this._initPromise=null,t();throw new Error('Widget initialization failed: '.concat(f.message,' (').concat(f.reason,')'))}await this._waitForBridge(),null===(i=e.onReady)||void 0===i||i.call(e),t()}catch(t){var s;const n=t instanceof Error?t:new Error(String(t));null===(s=e.onError)||void 0===s||s.call(e,n),gt(null),this._initPromise=null,r(n)}})()}),this._initPromise)}destroy(){if(gt(null),pt(),'undefined'!=typeof document){const e=document.getElementById('rf-overlay-widget');e&&e.remove()}this._initPromise=null}isInitialized(){return _t()}on(e,t){return function(e,t){mt.eventListeners.has(e)||mt.eventListeners.set(e,new Set),mt.eventListeners.get(e).add(t)}(e,t),()=>yt(e,t)}off(e,t){yt(e,t)}_ensureInitialized(){if(!_t())throw new Error('[RF] Widget not initialized. Call init() first.')}async _waitForBridge(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1e4;const t=Date.now();for(;!_t();){if(Date.now()-t>e)throw new Error('[RF] Initialization timeout');await new Promise(e=>setTimeout(e,50))}}};'undefined'!=typeof window&&(window.Returnflows=Nt);var xt,kt,Ct,St,Tt,It,At,Pt,Rt,Ht,Ot,Lt,Bt,Mt={},Dt=[],Ft=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ut=Array.isArray;function Gt(e,t){for(var r in t)e[r]=t[r];return e}function zt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function jt(e,t,r){var n,o,i,a={};for(i in t)'key'==i?n=t[i]:'ref'==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?xt.call(arguments,2):r),'function'==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return Vt(e,a,n,o,null)}function Vt(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++Ct,__i:-1,__u:0};return null==o&&null!=kt.vnode&&kt.vnode(i),i}function qt(e){return e.children}function Wt(e,t){this.props=e,this.context=t}function Xt(e,t){if(null==t)return e.__?Xt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return'function'==typeof e.type?Xt(e):null}function Kt(e){if(e.__P&&e.__d){var t=e.__v,r=t.__e,n=[],o=[],i=Gt({},t);i.__v=t.__v+1,kt.vnode&&kt.vnode(i),ir(e.__P,i,t,e.__n,e.__P.namespaceURI,32&t.__u?[r]:null,n,r??Xt(t),!!(32&t.__u),o),i.__v=t.__v,i.__.__k[i.__i]=i,sr(n,i,o),t.__e=t.__=null,i.__e!=r&&Zt(i)}}function Zt(e){if(null!=(e=e.__)&&null!=e.__c)return e.__e=e.__c.base=null,e.__k.some(t=>{if(null!=t&&null!=t.__e)return e.__e=e.__c.base=t.__e}),Zt(e)}function Yt(e){(!e.__d&&(e.__d=!0)&&Tt.push(e)&&!Jt.__r++||It!=kt.debounceRendering)&&((It=kt.debounceRendering)||At)(Jt)}function Jt(){try{for(var e,t=1;Tt.length;)Tt.length>t&&Tt.sort(Pt),e=Tt.shift(),t=Tt.length,Kt(e)}finally{Tt.length=Jt.__r=0}}function Qt(e,t,r,n,o,i,a,s,l,c,u){var d,h,f,m,p,g,_,v=n&&n.__k||Dt,b=t.length;for(l=function(e,t,r,n,o){var i,a,s,l,c,u=r.length,d=u,h=0;for(e.__k=new Array(o),i=0;i<o;i++)null!=(a=t[i])&&'boolean'!=typeof a&&'function'!=typeof a?('string'==typeof a||'number'==typeof a||'bigint'==typeof a||a.constructor==String?a=e.__k[i]=Vt(null,a,null,null,null):Ut(a)?a=e.__k[i]=Vt(qt,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?a=e.__k[i]=Vt(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):e.__k[i]=a,l=i+h,a.__=e,a.__b=e.__b+1,s=null,-1!=(c=a.__i=tr(a,r,l,d))&&(d--,(s=r[c])&&(s.__u|=2)),null==s||null==s.__v?(-1==c&&(o>u?h--:o<u&&h++),'function'!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<u;i++)null!=(s=r[i])&&!(2&s.__u)&&(s.__e==n&&(n=Xt(s)),dr(s,s));return n}(r,t,v,l,b),d=0;d<b;d++)null!=(f=r.__k[d])&&(h=-1!=f.__i&&v[f.__i]||Mt,f.__i=d,g=ir(e,f,h,o,i,a,s,l,c,u),m=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&ur(h.ref,null,f),u.push(f.ref,f.__c||m,f)),null==p&&null!=m&&(p=m),(_=!!(4&f.__u))||h.__k===f.__k?l=$t(f,l,e,_):'function'==typeof f.type&&void 0!==g?l=g:m&&(l=m.nextSibling),f.__u&=-7);return r.__e=p,l}function $t(e,t,r,n){var o,i;if('function'==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=$t(o[i],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=Xt(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function er(e,t){return t=t||[],null==e||'boolean'==typeof e||(Ut(e)?e.some(e=>{er(e,t)}):t.push(e)),t}function tr(e,t,r,n){var o,i,a,s=e.key,l=e.type,c=t[r],u=null!=c&&!(2&c.__u);if(null===c&&null==s||u&&s==c.key&&l==c.type)return r;if(n>(u?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;)if(null!=(c=t[a=o>=0?o--:i++])&&!(2&c.__u)&&s==c.key&&l==c.type)return a;return-1}function rr(e,t,r){'-'==t[0]?e.setProperty(t,r??''):e[t]=null==r?'':'number'!=typeof r||Ft.test(t)?r:r+'px'}function nr(e,t,r,n,o){var i,a;e:if('style'==t)if('string'==typeof r)e.style.cssText=r;else{if('string'==typeof n&&(e.style.cssText=n=''),n)for(t in n)r&&t in r||rr(e.style,t,'');if(r)for(t in r)n&&r[t]==n[t]||rr(e.style,t,r[t])}else if('o'==t[0]&&'n'==t[1])i=t!=(t=t.replace(Rt,'$1')),a=t.toLowerCase(),t=a in e||'onFocusOut'==t||'onFocusIn'==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.u=n.u:(r.u=Ht,e.addEventListener(t,i?Lt:Ot,i)):e.removeEventListener(t,i?Lt:Ot,i);else{if('http://www.w3.org/2000/svg'==o)t=t.replace(/xlink(H|:h)/,'h').replace(/sName$/,'s');else if('width'!=t&&'height'!=t&&'href'!=t&&'list'!=t&&'form'!=t&&'tabIndex'!=t&&'download'!=t&&'rowSpan'!=t&&'colSpan'!=t&&'role'!=t&&'popover'!=t&&t in e)try{e[t]=r??'';break e}catch(e){}'function'==typeof r||(null==r||!1===r&&'-'!=t[4]?e.removeAttribute(t):e.setAttribute(t,'popover'==t&&1==r?'':r))}}function or(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=Ht++;else if(t.t<r.u)return;return r(kt.event?kt.event(t):t)}}}function ir(e,t,r,n,o,i,a,s,l,c){var u,d,h,f,m,p,g,_,v,b,y,w,E,N,x,k=t.type;if(void 0!==t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=t.__e=r.__e]),(u=kt.__b)&&u(t);e:if('function'==typeof k)try{if(_=t.props,v=k.prototype&&k.prototype.render,b=(u=k.contextType)&&n[u.__c],y=u?b?b.props.value:u.__:n,r.__c?g=(d=t.__c=r.__c).__=d.__E:(v?t.__c=d=new k(_,y):(t.__c=d=new Wt(_,y),d.constructor=k,d.render=hr),b&&b.sub(d),d.state||(d.state={}),d.__n=n,h=d.__d=!0,d.__h=[],d._sb=[]),v&&null==d.__s&&(d.__s=d.state),v&&null!=k.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=Gt({},d.__s)),Gt(d.__s,k.getDerivedStateFromProps(_,d.__s))),f=d.props,m=d.state,d.__v=t,h)v&&null==k.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),v&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(v&&null==k.getDerivedStateFromProps&&_!==f&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(_,y),t.__v==r.__v||!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(_,d.__s,y)){t.__v!=r.__v&&(d.props=_,d.state=d.__s,d.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(e=>{e&&(e.__=t)}),Dt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(_,d.__s,y),v&&null!=d.componentDidUpdate&&d.__h.push(()=>{d.componentDidUpdate(f,m,p)})}if(d.context=y,d.props=_,d.__P=e,d.__e=!1,w=kt.__r,E=0,v)d.state=d.__s,d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),Dt.push.apply(d.__h,d._sb),d._sb=[];else do{d.__d=!1,w&&w(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++E<25);d.state=d.__s,null!=d.getChildContext&&(n=Gt(Gt({},n),d.getChildContext())),v&&!h&&null!=d.getSnapshotBeforeUpdate&&(p=d.getSnapshotBeforeUpdate(f,m)),N=null!=u&&u.type===qt&&null==u.key?lr(u.props.children):u,s=Qt(e,Ut(N)?N:[N],t,r,n,o,i,a,s,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=i)if(e.then){for(t.__u|=l?160:128;s&&8==s.nodeType&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,t.__e=s}else{for(x=i.length;x--;)zt(i[x]);ar(t)}else t.__e=r.__e,t.__k=r.__k,e.then||ar(t);kt.__e(e,t,r)}else null==i&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=cr(r.__e,t,r,n,o,i,a,l,c);return(u=kt.diffed)&&u(t),128&t.__u?void 0:s}function ar(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ar))}function sr(e,t,r){for(var n=0;n<r.length;n++)ur(r[n],r[++n],r[++n]);kt.__c&&kt.__c(t,e),e.some(t=>{try{e=t.__h,t.__h=[],e.some(e=>{e.call(t)})}catch(e){kt.__e(e,t.__v)}})}function lr(e){return'object'!=typeof e||null==e||e.__b>0?e:Ut(e)?e.map(lr):Gt({},e)}function cr(e,t,r,n,o,i,a,s,l){var c,u,d,h,f,m,p,g=r.props||Mt,_=t.props,v=t.type;if('svg'==v?o='http://www.w3.org/2000/svg':'math'==v?o='http://www.w3.org/1998/Math/MathML':o||(o='http://www.w3.org/1999/xhtml'),null!=i)for(c=0;c<i.length;c++)if((f=i[c])&&'setAttribute'in f==!!v&&(v?f.localName==v:3==f.nodeType)){e=f,i[c]=null;break}if(null==e){if(null==v)return document.createTextNode(_);e=document.createElementNS(o,v,_.is&&_),s&&(kt.__m&&kt.__m(t,i),s=!1),i=null}if(null==v)g===_||s&&e.data==_||(e.data=_);else{if(i=i&&xt.call(e.childNodes),!s&&null!=i)for(g={},c=0;c<e.attributes.length;c++)g[(f=e.attributes[c]).name]=f.value;for(c in g)f=g[c],'dangerouslySetInnerHTML'==c?d=f:'children'==c||c in _||'value'==c&&'defaultValue'in _||'checked'==c&&'defaultChecked'in _||nr(e,c,null,f,o);for(c in _)f=_[c],'children'==c?h=f:'dangerouslySetInnerHTML'==c?u=f:'value'==c?m=f:'checked'==c?p=f:s&&'function'!=typeof f||g[c]===f||nr(e,c,f,g[c],o);if(u)s||d&&(u.__html==d.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=''),Qt('template'==t.type?e.content:e,Ut(h)?h:[h],t,r,n,'foreignObject'==v?'http://www.w3.org/1999/xhtml':o,i,a,i?i[0]:r.__k&&Xt(r,0),s,l),null!=i)for(c=i.length;c--;)zt(i[c]);s||(c='value','progress'==v&&null==m?e.removeAttribute('value'):null!=m&&(m!==e[c]||'progress'==v&&!m||'option'==v&&m!=g[c])&&nr(e,c,m,g[c],o),c='checked',null!=p&&p!=e[c]&&nr(e,c,p,g[c],o))}return e}function ur(e,t,r){try{if('function'==typeof e){var n='function'==typeof e.__u;n&&e.__u(),n&&null==t||(e.__u=e(t))}else e.current=t}catch(e){kt.__e(e,r)}}function dr(e,t,r){var n,o;if(kt.unmount&&kt.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||ur(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){kt.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&dr(n[o],t,r||'function'!=typeof e.type);r||zt(e.__e),e.__c=e.__=e.__e=void 0}function hr(e,t,r){return this.constructor(e,r)}function fr(e,t,r){var n,o,i,a;t==document&&(t=document.documentElement),kt.__&&kt.__(e,t),o=(n='function'==typeof r)?null:r&&r.__k||t.__k,i=[],a=[],ir(t,e=(!n&&r||t).__k=jt(qt,null,[e]),o||Mt,Mt,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?xt.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),sr(i,e,a)}function mr(e,t,r){var n,o,i,a,s=Gt({},e.props);for(i in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)'key'==i?n=t[i]:'ref'==i?o=t[i]:s[i]=void 0===t[i]&&null!=a?a[i]:t[i];return arguments.length>2&&(s.children=arguments.length>3?xt.call(arguments,2):r),Vt(e.type,s,n||e.key,o||e.ref,null)}function pr(e){function t(e){var r,n;return this.getChildContext||(r=new Set,(n={})[t.__c]=this,this.getChildContext=()=>n,this.componentWillUnmount=()=>{r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach(e=>{e.__e=!0,Yt(e)})},this.sub=e=>{r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=()=>{r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c='__cC'+Bt++,t.__=e,t.Provider=t.__l=(t.Consumer=(e,t)=>e.children(t)).contextType=t,t}xt=Dt.slice,kt={__e:(e,t,r,n)=>{for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},Ct=0,St=e=>null!=e&&void 0===e.constructor,Wt.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=Gt({},this.state),'function'==typeof e&&(e=e(Gt({},r),this.props)),e&&Gt(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),Yt(this))},Wt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Yt(this))},Wt.prototype.render=qt,Tt=[],At='function'==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Pt=(e,t)=>e.__v.__b-t.__v.__b,Jt.__r=0,Rt=/(PointerCapture)$|Capture$/i,Ht=0,Ot=or(!1),Lt=or(!0),Bt=0;var gr=Object.freeze({__proto__:null,Component:Wt,Fragment:qt,cloneElement:mr,createContext:pr,createElement:jt,createRef:function(){return{current:null}},h:jt,hydrate:function e(t,r){fr(t,r,e)},get isValidElement(){return St},get options(){return kt},render:fr,toChildArray:er});function _r(e,t){let r;try{var n;r=null===(n=process.env)||void 0===n?void 0:n[e]}catch(t){var o;r=null===(o=import.meta.env)||void 0===o?void 0:o[e]}return null!=r||(r=t),r}const vr=_r('VITE_API_URL','http://localhost:8080'),br=_r('VITE_PLATFORM_URL','http://localhost:3000'),yr=_r('VITE_WIDGET_BASE_URL','http://localhost:3334'),wr='rflowsId',Er=['lineItems','slug','locale','currency'],Nr='root',xr='rf-overlay-widget',kr='rf-settings-json';var Cr,Sr;(e=>{e.FetchInterception='RF_FETCH_INTERCEPTION',e.XHRInterception='RF_XHR_INTERCEPTION',e.DrawerStateChange='RF_DRAWER_STATE_CHANGE',e.WidgetInitialization='RF_WIDGET_INITIALIZATION'})(Cr||(Cr={})),(e=>{e.DrawerOpen='RF_DRAWER_OPEN',e.DrawerClose='RF_DRAWER_CLOSE',e.DrawerToggle='RF_DRAWER_TOGGLE',e.CalculationRefetch='RF_CALCULATION_REFETCH',e.CartRefetch='RF_CART_REFETCH',e.CartAndCalculationRefetch='RF_CART_AND_CALCULATION_REFETCH',e.DrawerOpenAndRefetch='RF_DRAWER_OPEN_AND_REFETCH'})(Sr||(Sr={}));const Tr={subscribe:function(e,t){const r=e=>t(e);return document.addEventListener(e,r),()=>{document.removeEventListener(e,r)}},publish:function(e){const t=new CustomEvent(e,{detail:arguments.length<=1?void 0:arguments[1]});document.dispatchEvent(t)},unsubscribe:function(e,t){document.removeEventListener(e,t)}},Ir='en';const Ar=['clientStorage'];async function Pr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{clientStorage:r}=t,i=o(t,Ar);const a=!!r;if(a&&!1!==r.shouldUseCachedResult){const{key:e,type:t,logging:n}=r,o=De({key:e,type:t});if(o)return!1!==n&&Ve.info('Using cached data for '.concat(e,' from ').concat(t)),o}const s=new URL(''.concat(vr).concat(e));null!=i&&i.params&&(i.params instanceof URLSearchParams?s.search=i.params.toString():Object.entries(i.params).forEach(e=>{let[t,r]=e;s.searchParams.set(t,String(r))}));const l=await fetch(s.toString(),n(n({},i),{},{body:null!=i&&i.body?JSON.stringify(i.body):void 0,headers:n({'Content-Type':'application/json'},null==i?void 0:i.headers)})),c=await async function(e){try{return await e.json()}catch(e){throw Ve.error('Error parsing JSON response:',e),new Error('Failed to parse JSON response')}}(l);if(!c||c.error||!1===c.success){const e=(null==c?void 0:c.error)||(null==c?void 0:c.message)||'Error fetching calculation data';throw new Error(e)}if(a&&!1!==r.storeResult){const{key:e,type:t,expiration:n}=r;Me({key:e,type:t,expiration:n},c.responseObject)}return c.responseObject}async function Rr(e){var t,r;let{isFirstLoad:n,options:{clearCartOnStart:o},id:i,data:a}=e,c=null;if(n){var u;const e=null!==(u=a.returnItems)&&void 0!==u?u:[];if(e.length>0){const t=e.map(e=>({id:e.variantId,quantity:e.quantity}));Ve.info('Setting cart items from cached return items on initialization.',t),c=await async function(e){const t=await ot();if(0===e.length)return t;if(l()){const t=s();if(null!=t&&t.addItems){const r=e.map(e=>({merchandiseId:$e(e.id),quantity:e.quantity}));Ve.info('[CartProvider] Using provider.addItems() (setCartItems)',r);const n=await t.addItems(r);return st(n),n}Ve.info('[CartProvider] Provider exists but addItems not implemented, falling back to /cart/add.js')}return await Ye('/cart/add.js',{method:'POST',body:JSON.stringify({items:e})}),nt(!1)}(t)}else o&&(Ve.info('Clearing cart on initialization as per configuration.'),c=await ot());st(c);const t=(new Date).getTime()+He;Me(Re,t);const r=new URL(window.location.href);r.searchParams.delete(wr),Er.forEach(e=>{r.searchParams.delete(e)}),window.history.replaceState(null,'',r)}Me(Ae,i);const d=null!==(t=null===(r=a.returnData)||void 0===r||null===(r=r.items)||void 0===r?void 0:r.map(e=>e.id).join(','))&&void 0!==t?t:'',h=await async function(e,t,r){const n=''.concat(t,'_').concat(r);return await Pr('/shop-overlay',{params:{internalId:t,orderLines:r},clientStorage:{shouldUseCachedResult:!e,key:n,type:'sessionStorage'}})}(n,i,d);return{orderData:h,updatedCart:c}}async function Hr(e){let{locale:t,slug:r,isFirstLoad:n=!1}=e,o=function(){const e=document.getElementById(kr);if(!e)return null;try{return JSON.parse(e.innerHTML)}catch(e){return Ve.error('Failed to parse widget settings JSON',e),null}}();if(!o){const e=await async function(e){let{locale:t,slug:r,shouldUseCachedResult:n=!0}=e;if(!r)return null;try{return await Pr('/shop-overlay/config',{params:{locale:t,slug:r},clientStorage:{key:'remote_settings_'.concat(r,'_').concat(t),type:'sessionStorage',shouldUseCachedResult:n}})}catch(e){return Ve.error('Error fetching remote settings for locale '.concat(t,':'),e),null}}({locale:t,slug:r,shouldUseCachedResult:!n});e?(Ve.info('Using remote settings:',e),o=e):Ve.warn('No settings found in script or remotely')}return o}function Or(e){const t={};return Object.entries(e).forEach(e=>{let[r,n]=e;if(We(n))return n;let o=n;if('true'===n)o=!0;else if('false'===n)o=!1;else if(function(e){return'number'==typeof e||!isNaN(Number(e))&&isFinite(Number(e))}(n))o=Number(n);else if('null'===n)o=null;else if('undefined'===n)o=void 0;else try{o=JSON.parse(n)}catch(e){}t[r]=o}),t}async function Lr(e){var t,r;const o=(i=e,'undefined'!=typeof DOMStringMap&&i instanceof DOMStringMap||'[object DOMStringMap]'===Object.prototype.toString.call(i)?Or(e):e);var i;const a=Ke(),s=a.get(wr),l=Boolean(s),c=s||De(Ae);if(!c){const e='Session ID is missing from URL and storage';return Ve.warn(e),{success:!1,reason:'MISSING_SESSION_ID',message:e}}const u=await async function(e){if(!e)return null;try{return await Pr('/shop-overlay/session/'.concat(e))}catch(e){return Ve.error('Error getting session cache:',e),null}}(c);if(!u){const e='No session cache found for id: '.concat(c);return Ve.warn(e),{success:!1,reason:'SESSION_NOT_FOUND',message:e}}const d=u.data.currency||o.defaultCurrency||'DKK',h='development'===o.env||'test'===o.env,f='true'===a.get('debug'),m=De(Le);(h||f)&&Me(Le,!0);const p=Boolean(null!=m?m:h||f),g=[u.data.locale,o.defaultLocale,Ir].filter(e=>void 0!==e),{locale:_,messages:v}=await async function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];const n=t.length>0?t:[Ir];for(const e of n)try{const t=await fetch(''.concat(yr,'/messages/').concat(e,'.json'));if(t.ok)return{messages:await t.json(),locale:e}}catch(t){Ve.error('Error loading messages for locale '.concat(e,':'),t)}throw new Error('No messages found for any of the locales: '.concat(n.join(', ')))}(...g),b=await Hr({locale:_,slug:u.data.slug,isFirstLoad:l}),y=function(e){try{return'object'!=typeof e||null===e?e:structuredClone(e)}catch(t){Ve.warn('structuredClone failed, falling back to JSON clone');try{return JSON.parse(JSON.stringify(e))}catch(e){throw Ve.error('JSON clone also failed (circular reference or non-serializable value)'),e}}}(null==b||null===(t=b.translations)||void 0===t?void 0:t.messages);y&&(Ve.info('Merging custom translations into messages...'),Object.entries(y).forEach(e=>{let[t,r]=e;try{!function(e,t,r){const n=t.split('.'),o=n.pop();if(!o)throw new Error('Invalid path');n.reduce((e,r)=>{if(e&&'object'==typeof e&&r in e){const t=e[r];if(t&&'object'==typeof t)return t}throw new Error('Cannot access property \''.concat(r,'\' on path \'').concat(t,'\''))},e)[o]=r}(v,t,r)}catch(e){Ve.warn('Skipping unknown custom translation key "'.concat(t,'"'),e)}}));return{success:!0,config:n({locale:_,currency:d,debugMode:p,isFirstLoad:l,messages:v,options:o,theme:null!==(r=null==b?void 0:b.theme)&&void 0!==r?r:null},u)}}function Br(e){const t=Object.entries(e).filter(e=>{let[t,r]=e;return'string'==typeof r||'number'==typeof r}).map(e=>{let[t,r]=e;return'['.concat(t,'="').concat(r,'"]')}).join(''),r=document.querySelector('link'.concat(t));if(r)return Ve.warn('Link element with attributes '.concat(JSON.stringify(e),' already exists.')),r;const n=document.createElement('link');return Object.assign(n,e),document.head.appendChild(n),n}function Mr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.head;if(!e)return;if(!function(e){return(e.match(/{/g)||[]).length===(e.match(/}/g)||[]).length&&![/javascript:/gi,/expression\s*\(/gi,/behavior\s*:/gi,/binding\s*:/gi,/@import.*url\s*\(\s*["']?javascript:/gi].some(t=>t.test(e))}(e))throw new Error('Invalid CSS detected. Please check your CSS syntax and remove any dangerous patterns.');const r=document.createElement('style');return r.setAttribute('data-'.concat('rf-custom-css'),'true'),r.textContent=e,Ve.info('Injecting custom CSS...'),t.appendChild(r),r}var Dr=Object.freeze({__proto__:null,default:async function(e,t){try{const r=await Lr(t);if(!r.success)return r;const n=function(){if(document.getElementById(xr))return{success:!1,reason:'CONTAINER_EXISTS',message:'Container with ID "'.concat(xr,'" already exists')};const e=document.createElement('div');e.id=xr,e.style.display='block';const t=e.attachShadow({mode:'closed'}),r=document.createElement('div');return r.className='rf-container',r.id='shadow-root',r.style.display='none',t.appendChild(r),{success:!0,value:[e,r]}}();if(!n.success)return n;const[o,i]=n.value,{config:a}=r,{options:{customCssOverlay:s,customCssPage:l}}=a;return function(e){const t=document.createElement('link');t.rel='stylesheet';const r=_r('WIDGET_NAME')||'widget';t.href=''.concat(yr,'/').concat(r,'.css'),t.onload=()=>{Ve.info('Stylesheet loaded successfully')},e.appendChild(t)}(i),function(){const e=document.createElement('link');e.rel='stylesheet',e.href=''.concat(yr,'/variables.css'),e.onload=()=>{Ve.info('Public CSS variables loaded successfully')},e.onerror=()=>{Ve.warn('Failed to load public CSS variables')},document.head.appendChild(e)}(),new Promise((e,t)=>{const r=Br({rel:'preconnect',href:'https://fonts.googleapis.com'}),n=Br({rel:'preconnect',href:'https://fonts.gstatic.com',crossOrigin:'anonymous'}),o=Br({rel:'stylesheet',href:'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap'});o.onload=()=>{Ve.info('Font stylesheet loaded successfully'),e([r,n,o])},o.onerror=()=>{Ve.error('Failed to load font stylesheet'),t(new Error('Failed to load font stylesheet'))},document.head.appendChild(o)}),Mr(l),Mr(s,i),function(e,t,r){Ve.info('Injecting widget with options...',r),fr(e(r),t)}(e,i,a),document.body.appendChild(o),Tr.publish(Cr.WidgetInitialization,a),{success:!0,config:a}}catch(e){const t=e instanceof Error?e.message:String(e);return Ve.error('Initialization failed',e),{success:!1,reason:'UNKNOWN_ERROR',message:t}}}}),Fr=0;function Ur(e,t,r,n,o,i){t||(t={});var a,s,l=t;if('ref'in l)for(s in l={},t)'ref'==s?a=t[s]:l[s]=t[s];var c={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Fr,__i:-1,__u:0,__source:o,__self:i};if('function'==typeof e&&(a=e.defaultProps))for(s in a)void 0===l[s]&&(l[s]=a[s]);return kt.vnode&&kt.vnode(c),c}function Gr(e,t){const r=t&&t.cache?t.cache:Kr,n=t&&t.serializer?t.serializer:Wr;return(t&&t.strategy?t.strategy:qr)(e,{cache:r,serializer:n})}function zr(e,t,r,n){const o=null==(i=n)||'number'==typeof i||'boolean'==typeof i?n:r(n);var i;let a=t.get(o);return void 0===a&&(a=e.call(this,n),t.set(o,a)),a}function jr(e,t,r){const n=Array.prototype.slice.call(arguments,3),o=r(n);let i=t.get(o);return void 0===i&&(i=e.apply(this,n),t.set(o,i)),i}function Vr(e,t,r,n,o){return r.bind(t,e,n,o)}function qr(e,t){return Vr(e,this,1===e.length?zr:jr,t.cache.create(),t.serializer)}const Wr=function(){return JSON.stringify(arguments)};class Xr{constructor(){e(this,'cache',void 0),this.cache=Object.create(null)}get(e){return this.cache[e]}set(e,t){this.cache[e]=t}}const Kr={create:function(){return new Xr}},Zr={variadic:function(e,t){return Vr(e,this,jr,t.cache.create(),t.serializer)}};let Yr=class extends Error{constructor(e,t){let r=e;t&&(r+=': '+t),super(r),this.code=e,t&&(this.originalMessage=t)}};var Jr=(e=>(e.MISSING_MESSAGE='MISSING_MESSAGE',e.MISSING_FORMAT='MISSING_FORMAT',e.ENVIRONMENT_FALLBACK='ENVIRONMENT_FALLBACK',e.INSUFFICIENT_PATH='INSUFFICIENT_PATH',e.INVALID_MESSAGE='INVALID_MESSAGE',e.INVALID_KEY='INVALID_KEY',e.FORMATTING_ERROR='FORMATTING_ERROR',e))(Jr||{});function Qr(){return{dateTime:{},number:{},message:{},relativeTime:{},pluralRules:{},list:{},displayNames:{}}}function $r(e,t){return Gr(e,{cache:(r=t,{create:()=>({get:e=>r[e],set(e,t){r[e]=t}})}),strategy:Zr.variadic});var r}function en(e,t){return $r(function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new e(...r)},t)}function tn(e){return{getDateTimeFormat:en(Intl.DateTimeFormat,e.dateTime),getNumberFormat:en(Intl.NumberFormat,e.number),getPluralRules:en(Intl.PluralRules,e.pluralRules),getRelativeTimeFormat:en(Intl.RelativeTimeFormat,e.relativeTime),getListFormat:en(Intl.ListFormat,e.list),getDisplayNames:en(Intl.DisplayNames,e.displayNames)}}var rn,nn,on,an,sn=0,ln=[],cn=kt,un=cn.__b,dn=cn.__r,hn=cn.diffed,fn=cn.__c,mn=cn.unmount,pn=cn.__;function gn(e,t){cn.__h&&cn.__h(nn,e,sn||t),sn=0;var r=nn.__H||(nn.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function _n(e){return sn=1,function(e,t,r){var n=gn(rn++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):In(void 0,t),e=>{var t=n.__N?n.__N[0]:n.__[0],r=n.t(t,e);t!==r&&(n.__N=[r,n.__[1]],n.__c.setState({}))}],n.__c=nn,!nn.__f)){var o=function(e,t,r){if(!n.__c.__H)return!0;var o=n.__c.__H.__.filter(e=>e.__c);if(o.every(e=>!e.__N))return!i||i.call(this,e,t,r);var a=n.__c.props!==e;return o.some(e=>{if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),i&&i.call(this,e,t,r)||a};nn.__f=!0;var i=nn.shouldComponentUpdate,a=nn.componentWillUpdate;nn.componentWillUpdate=function(e,t,r){if(this.__e){var n=i;i=void 0,o(e,t,r),i=n}a&&a.call(this,e,t,r)},nn.shouldComponentUpdate=o}return n.__N||n.__}(In,e)}function vn(e,t){var r=gn(rn++,3);!cn.__s&&Tn(r.__H,t)&&(r.__=e,r.u=t,nn.__H.__h.push(r))}function bn(e){return sn=5,yn(()=>({current:e}),[])}function yn(e,t){var r=gn(rn++,7);return Tn(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function wn(e,t){return sn=8,yn(()=>e,t)}function En(e){var t=nn.context[e.__c],r=gn(rn++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(nn)),t.props.value):e.__}function Nn(){for(var e;e=ln.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Cn),t.__h.some(Sn),t.__h=[]}catch(r){t.__h=[],cn.__e(r,e.__v)}}}cn.__b=e=>{nn=null,un&&un(e)},cn.__=(e,t)=>{e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pn&&pn(e,t)},cn.__r=e=>{dn&&dn(e),rn=0;var t=(nn=e.__c).__H;t&&(on===nn?(t.__h=[],nn.__h=[],t.__.some(e=>{e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Cn),t.__h.some(Sn),t.__h=[],rn=0)),on=nn},cn.diffed=e=>{hn&&hn(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==ln.push(t)&&an===cn.requestAnimationFrame||((an=cn.requestAnimationFrame)||kn)(Nn)),t.__H.__.some(e=>{e.u&&(e.__H=e.u),e.u=void 0})),on=nn=null},cn.__c=(e,t)=>{t.some(e=>{try{e.__h.some(Cn),e.__h=e.__h.filter(e=>!e.__||Sn(e))}catch(r){t.some(e=>{e.__h&&(e.__h=[])}),t=[],cn.__e(r,e.__v)}}),fn&&fn(e,t)},cn.unmount=e=>{mn&&mn(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(e=>{try{Cn(e)}catch(e){t=e}}),r.__H=void 0,t&&cn.__e(t,r.__v))};var xn='function'==typeof requestAnimationFrame;function kn(e){var t,r=()=>{clearTimeout(n),xn&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);xn&&(t=requestAnimationFrame(r))}function Cn(e){var t=nn,r=e.__c;'function'==typeof r&&(e.__c=void 0,r()),nn=t}function Sn(e){var t=nn;e.__c=e.__(),nn=t}function Tn(e,t){return!e||e.length!==t.length||t.some((t,r)=>t!==e[r])}function In(e,t){return'function'==typeof t?t(e):t}function An(e,t){for(var r in e)if('__source'!==r&&!(r in t))return!0;for(var n in t)if('__source'!==n&&e[n]!==t[n])return!0;return!1}function Pn(e,t){this.props=e,this.context=t}function Rn(e,t){function r(e){var r=this.props.ref;return r!=e.ref&&r&&('function'==typeof r?r(null):r.current=null),t?!t(this.props,e)||r!=e.ref:An(this.props,e)}function n(t){return this.shouldComponentUpdate=r,jt(e,t)}return n.displayName='Memo('+(e.displayName||e.name)+')',n.__f=n.prototype.isReactComponent=!0,n.type=e,n}(Pn.prototype=new Wt).isPureReactComponent=!0,Pn.prototype.shouldComponentUpdate=function(e,t){return An(this.props,e)||An(this.state,t)};var Hn=kt.__b;kt.__b=e=>{e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Hn&&Hn(e)};var On=kt.__e;kt.__e=(e,t,r,n)=>{if(e.then)for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t);On(e,t,r,n)};var Ln=kt.unmount;function Bn(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(e=>{'function'==typeof e.__c&&e.__c()}),e.__c.__H=null),null!=(e=function(e,t){for(var r in t)e[r]=t[r];return e}({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map(e=>Bn(e,t,r))),e}function Mn(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(e=>Mn(e,t,r)),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Dn(){this.__u=0,this.o=null,this.__b=null}function Fn(e){var t=e.__&&e.__.__c;return t&&t.__a&&t.__a(e)}function Un(){this.i=null,this.l=null}kt.unmount=e=>{var t=e.__c;t&&(t.__z=!0),t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ln&&Ln(e)},(Dn.prototype=new Wt).__c=function(e,t){var r=t.__c,n=this;null==n.o&&(n.o=[]),n.o.push(r);var o=Fn(n.__v),i=!1,a=()=>{i||n.__z||(i=!0,r.__R=null,o?o(l):l())};r.__R=a;var s=r.__P;r.__P=null;var l=()=>{if(! --n.__u){if(n.state.__a){var e=n.state.__a;n.__v.__k[0]=Mn(e,e.__c.__P,e.__c.__O)}var t;for(n.setState({__a:n.__b=null});t=n.o.pop();)t.__P=s,t.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Dn.prototype.componentWillUnmount=function(){this.o=[]},Dn.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement('div'),n=this.__v.__k[0].__c;this.__v.__k[0]=Bn(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&jt(qt,null,e.fallback);return o&&(o.__u&=-33),[jt(qt,null,t.__a?null:e.children),o]};var Gn=(e,t,r)=>{if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&('t'!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function zn(e){return this.getChildContext=()=>e.context,e.children}function jn(e){var t=this,r=e.h;if(t.componentWillUnmount=()=>{fr(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var n=t.__v;null!==n&&!n.__m&&null!==n.__;)n=n.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:n.__m},contains:()=>!0,namespaceURI:r.namespaceURI,insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}fr(jt(zn,{context:t.context},e.__v),t.v)}(Un.prototype=new Wt).__a=function(e){var t=this,r=Fn(t.__v),n=t.l.get(e);return n[0]++,o=>{var i=()=>{t.props.revealOrder?(n.push(o),Gn(t,e,n)):o()};r?r(i):i()}},Un.prototype.render=function(e){this.i=null,this.l=new Map;var t=er(e.children);e.revealOrder&&'b'===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},Un.prototype.componentDidUpdate=Un.prototype.componentDidMount=function(){var e=this;this.l.forEach((t,r)=>{Gn(e,r,t)})};var Vn='undefined'!=typeof Symbol&&Symbol.for&&Symbol.for('react.element')||60103,qn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Wn=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xn=/[A-Z0-9]/g,Kn='undefined'!=typeof document,Zn=e=>('undefined'!=typeof Symbol&&'symbol'==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e);Wt.prototype.isReactComponent=!0,['componentWillMount','componentWillReceiveProps','componentWillUpdate'].forEach(function(e){Object.defineProperty(Wt.prototype,e,{configurable:!0,get:function(){return this['UNSAFE_'+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Yn=kt.event;kt.event=function(e){return Yn&&(e=Yn(e)),e.persist=()=>{},e.isPropagationStopped=function(){return this.cancelBubble},e.isDefaultPrevented=function(){return this.defaultPrevented},e.nativeEvent=e};var Jn={configurable:!0,get:function(){return this.class}},Qn=kt.vnode;kt.vnode=e=>{'string'==typeof e.type&&(e=>{var t=e.props,r=e.type,n={},o=-1==r.indexOf('-');for(var i in t){var a=t[i];if(!('value'===i&&'defaultValue'in t&&null==a||Kn&&'children'===i&&'noscript'===r||'class'===i||'className'===i)){var s=i.toLowerCase();'defaultValue'===i&&'value'in t&&null==t.value?i='value':'download'===i&&!0===a?a='':'translate'===s&&'no'===a?a=!1:'o'===s[0]&&'n'===s[1]?'ondoubleclick'===s?i='ondblclick':'onchange'!==s||'input'!==r&&'textarea'!==r||Zn(t.type)?'onfocus'===s?i='onfocusin':'onblur'===s?i='onfocusout':Wn.test(i)&&(i=s):s=i='oninput':o&&qn.test(i)?i=i.replace(Xn,'-$&').toLowerCase():null===a&&(a=void 0),'oninput'===s&&n[i=s]&&(i='oninputCapture'),n[i]=a}}'select'==r&&(n.multiple&&Array.isArray(n.value)&&(n.value=er(t.children).forEach(e=>{e.props.selected=-1!=n.value.indexOf(e.props.value)})),null!=n.defaultValue&&(n.value=er(t.children).forEach(e=>{e.props.selected=n.multiple?-1!=n.defaultValue.indexOf(e.props.value):n.defaultValue==e.props.value}))),t.class&&!t.className?(n.class=t.class,Object.defineProperty(n,'className',Jn)):t.className&&(n.class=n.className=t.className),e.props=n})(e),e.$$typeof=Vn,Qn&&Qn(e)};var $n=kt.__r;kt.__r=e=>{$n&&$n(e),e.__c};var eo=kt.diffed;function to(e){return!!e&&e.$$typeof===Vn}function ro(e){return to(e)?mr.apply(null,arguments):e}kt.diffed=e=>{eo&&eo(e);var t=e.props,r=e.__e;null!=r&&'textarea'===e.type&&'value'in t&&t.value!==r.value&&(r.value=null==t.value?'':t.value)};const no=/(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;function oo(e){const t={};return e.replace(no,e=>{const r=e.length;switch(e[0]){case'G':t.era=4===r?'long':5===r?'narrow':'short';break;case'y':t.year=2===r?'2-digit':'numeric';break;case'Y':case'u':case'U':case'r':throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');case'q':case'Q':throw new RangeError('`q/Q` (quarter) patterns are not supported');case'M':case'L':t.month=['numeric','2-digit','short','long','narrow'][r-1];break;case'w':case'W':throw new RangeError('`w/W` (week) patterns are not supported');case'd':t.day=['numeric','2-digit'][r-1];break;case'D':case'F':case'g':throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');case'E':t.weekday=4===r?'long':5===r?'narrow':'short';break;case'e':if(r<4)throw new RangeError('`e..eee` (weekday) patterns are not supported');t.weekday=['short','long','narrow','short'][r-4];break;case'c':if(r<4)throw new RangeError('`c..ccc` (weekday) patterns are not supported');t.weekday=['short','long','narrow','short'][r-4];break;case'a':t.hour12=!0;break;case'b':case'B':throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');case'h':t.hourCycle='h12',t.hour=['numeric','2-digit'][r-1];break;case'H':t.hourCycle='h23',t.hour=['numeric','2-digit'][r-1];break;case'K':t.hourCycle='h11',t.hour=['numeric','2-digit'][r-1];break;case'k':t.hourCycle='h24',t.hour=['numeric','2-digit'][r-1];break;case'j':case'J':case'C':throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');case'm':t.minute=['numeric','2-digit'][r-1];break;case's':t.second=['numeric','2-digit'][r-1];break;case'S':case'A':throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');case'z':t.timeZoneName=r<4?'short':'long';break;case'Z':case'O':case'v':case'V':case'X':case'x':throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead')}return''}),t}const io=/[\t-\r \x85\u200E\u200F\u2028\u2029]/i;function ao(e){return e.replace(/^(.*?)-/,'')}const so=/^\.(?:(0+)(\*)?|(#+)|(0+)(#+))$/g,lo=/^(@+)?(\+|#+)?[rs]?$/g,co=/(\*)(0+)|(#+)(0+)|(0+)/g,uo=/^(0+)$/;function ho(e){const t={};return'r'===e[e.length-1]?t.roundingPriority='morePrecision':'s'===e[e.length-1]&&(t.roundingPriority='lessPrecision'),e.replace(lo,(e,r,n)=>('string'!=typeof n?(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length):'+'===n?t.minimumSignificantDigits=r.length:'#'===r[0]?t.maximumSignificantDigits=r.length:(t.minimumSignificantDigits=r.length,t.maximumSignificantDigits=r.length+('string'==typeof n?n.length:0)),'')),t}function fo(e){switch(e){case'sign-auto':return{signDisplay:'auto'};case'sign-accounting':case'()':return{currencySign:'accounting'};case'sign-always':case'+!':return{signDisplay:'always'};case'sign-accounting-always':case'()!':return{signDisplay:'always',currencySign:'accounting'};case'sign-except-zero':case'+?':return{signDisplay:'exceptZero'};case'sign-accounting-except-zero':case'()?':return{signDisplay:'exceptZero',currencySign:'accounting'};case'sign-never':case'+_':return{signDisplay:'never'}}}function mo(e){let t;if('E'===e[0]&&'E'===e[1]?(t={notation:'engineering'},e=e.slice(2)):'E'===e[0]&&(t={notation:'scientific'},e=e.slice(1)),t){const r=e.slice(0,2);if('+!'===r?(t.signDisplay='always',e=e.slice(2)):'+?'===r&&(t.signDisplay='exceptZero',e=e.slice(2)),!uo.test(e))throw new Error('Malformed concise eng/scientific notation');t.minimumIntegerDigits=e.length}return t}function po(e){const t=fo(e);return t||{}}function go(e){let t={};for(const r of e){switch(r.stem){case'percent':case'%':t.style='percent';continue;case'%x100':t.style='percent',t.scale=100;continue;case'currency':t.style='currency',t.currency=r.options[0];continue;case'group-off':case',_':t.useGrouping=!1;continue;case'precision-integer':case'.':t.maximumFractionDigits=0;continue;case'measure-unit':case'unit':t.style='unit',t.unit=ao(r.options[0]);continue;case'compact-short':case'K':t.notation='compact',t.compactDisplay='short';continue;case'compact-long':case'KK':t.notation='compact',t.compactDisplay='long';continue;case'scientific':t=n(n({},t),{},{notation:'scientific'},r.options.reduce((e,t)=>n(n({},e),po(t)),{}));continue;case'engineering':t=n(n({},t),{},{notation:'engineering'},r.options.reduce((e,t)=>n(n({},e),po(t)),{}));continue;case'notation-simple':t.notation='standard';continue;case'unit-width-narrow':t.currencyDisplay='narrowSymbol',t.unitDisplay='narrow';continue;case'unit-width-short':t.currencyDisplay='code',t.unitDisplay='short';continue;case'unit-width-full-name':t.currencyDisplay='name',t.unitDisplay='long';continue;case'unit-width-iso-code':t.currencyDisplay='symbol';continue;case'scale':t.scale=parseFloat(r.options[0]);continue;case'rounding-mode-floor':t.roundingMode='floor';continue;case'rounding-mode-ceiling':t.roundingMode='ceil';continue;case'rounding-mode-down':t.roundingMode='trunc';continue;case'rounding-mode-up':t.roundingMode='expand';continue;case'rounding-mode-half-even':t.roundingMode='halfEven';continue;case'rounding-mode-half-down':t.roundingMode='halfTrunc';continue;case'rounding-mode-half-up':t.roundingMode='halfExpand';continue;case'integer-width':if(r.options.length>1)throw new RangeError('integer-width stems only accept a single optional option');r.options[0].replace(co,(e,r,n,o,i,a)=>{if(r)t.minimumIntegerDigits=n.length;else{if(o&&i)throw new Error('We currently do not support maximum integer digits');if(a)throw new Error('We currently do not support exact integer digits')}return''});continue}if(uo.test(r.stem)){t.minimumIntegerDigits=r.stem.length;continue}if(so.test(r.stem)){if(r.options.length>1)throw new RangeError('Fraction-precision stems only accept a single optional option');r.stem.replace(so,(e,r,n,o,i,a)=>('*'===n?t.minimumFractionDigits=r.length:o&&'#'===o[0]?t.maximumFractionDigits=o.length:i&&a?(t.minimumFractionDigits=i.length,t.maximumFractionDigits=i.length+a.length):(t.minimumFractionDigits=r.length,t.maximumFractionDigits=r.length),''));const e=r.options[0];'w'===e?t=n(n({},t),{},{trailingZeroDisplay:'stripIfInteger'}):e&&(t=n(n({},t),ho(e)));continue}if(lo.test(r.stem)){t=n(n({},t),ho(r.stem));continue}const e=fo(r.stem);e&&(t=n(n({},t),e));const o=mo(r.stem);o&&(t=n(n({},t),o))}return t}let _o=(e=>(e[e.literal=0]='literal',e[e.argument=1]='argument',e[e.number=2]='number',e[e.date=3]='date',e[e.time=4]='time',e[e.select=5]='select',e[e.plural=6]='plural',e[e.pound=7]='pound',e[e.tag=8]='tag',e))({}),vo=(e=>(e[e.number=0]='number',e[e.dateTime=1]='dateTime',e))({});function bo(e){return e.type===_o.literal}function yo(e){return e.type===_o.argument}function wo(e){return e.type===_o.number}function Eo(e){return e.type===_o.date}function No(e){return e.type===_o.time}function xo(e){return e.type===_o.select}function ko(e){return e.type===_o.plural}function Co(e){return e.type===_o.pound}function So(e){return e.type===_o.tag}function To(e){return!(!e||'object'!=typeof e||e.type!==vo.number)}function Io(e){return!(!e||'object'!=typeof e||e.type!==vo.dateTime)}let Ao=(e=>(e[e.EXPECT_ARGUMENT_CLOSING_BRACE=1]='EXPECT_ARGUMENT_CLOSING_BRACE',e[e.EMPTY_ARGUMENT=2]='EMPTY_ARGUMENT',e[e.MALFORMED_ARGUMENT=3]='MALFORMED_ARGUMENT',e[e.EXPECT_ARGUMENT_TYPE=4]='EXPECT_ARGUMENT_TYPE',e[e.INVALID_ARGUMENT_TYPE=5]='INVALID_ARGUMENT_TYPE',e[e.EXPECT_ARGUMENT_STYLE=6]='EXPECT_ARGUMENT_STYLE',e[e.INVALID_NUMBER_SKELETON=7]='INVALID_NUMBER_SKELETON',e[e.INVALID_DATE_TIME_SKELETON=8]='INVALID_DATE_TIME_SKELETON',e[e.EXPECT_NUMBER_SKELETON=9]='EXPECT_NUMBER_SKELETON',e[e.EXPECT_DATE_TIME_SKELETON=10]='EXPECT_DATE_TIME_SKELETON',e[e.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE=11]='UNCLOSED_QUOTE_IN_ARGUMENT_STYLE',e[e.EXPECT_SELECT_ARGUMENT_OPTIONS=12]='EXPECT_SELECT_ARGUMENT_OPTIONS',e[e.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE=13]='EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE',e[e.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE=14]='INVALID_PLURAL_ARGUMENT_OFFSET_VALUE',e[e.EXPECT_SELECT_ARGUMENT_SELECTOR=15]='EXPECT_SELECT_ARGUMENT_SELECTOR',e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR=16]='EXPECT_PLURAL_ARGUMENT_SELECTOR',e[e.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT=17]='EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT',e[e.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT=18]='EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT',e[e.INVALID_PLURAL_ARGUMENT_SELECTOR=19]='INVALID_PLURAL_ARGUMENT_SELECTOR',e[e.DUPLICATE_PLURAL_ARGUMENT_SELECTOR=20]='DUPLICATE_PLURAL_ARGUMENT_SELECTOR',e[e.DUPLICATE_SELECT_ARGUMENT_SELECTOR=21]='DUPLICATE_SELECT_ARGUMENT_SELECTOR',e[e.MISSING_OTHER_CLAUSE=22]='MISSING_OTHER_CLAUSE',e[e.INVALID_TAG=23]='INVALID_TAG',e[e.INVALID_TAG_NAME=25]='INVALID_TAG_NAME',e[e.UNMATCHED_CLOSING_TAG=26]='UNMATCHED_CLOSING_TAG',e[e.UNCLOSED_TAG=27]='UNCLOSED_TAG',e))({});const Po=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/,Ro={'001':['H','h'],419:['h','H','hB','hb'],AC:['H','h','hb','hB'],AD:['H','hB'],AE:['h','hB','hb','H'],AF:['H','hb','hB','h'],AG:['h','hb','H','hB'],AI:['H','h','hb','hB'],AL:['h','H','hB'],AM:['H','hB'],AO:['H','hB'],AR:['h','H','hB','hb'],AS:['h','H'],AT:['H','hB'],AU:['h','hb','H','hB'],AW:['H','hB'],AX:['H'],AZ:['H','hB','h'],BA:['H','hB','h'],BB:['h','hb','H','hB'],BD:['h','hB','H'],BE:['H','hB'],BF:['H','hB'],BG:['H','hB','h'],BH:['h','hB','hb','H'],BI:['H','h'],BJ:['H','hB'],BL:['H','hB'],BM:['h','hb','H','hB'],BN:['hb','hB','h','H'],BO:['h','H','hB','hb'],BQ:['H'],BR:['H','hB'],BS:['h','hb','H','hB'],BT:['h','H'],BW:['H','h','hb','hB'],BY:['H','h'],BZ:['H','h','hb','hB'],CA:['h','hb','H','hB'],CC:['H','h','hb','hB'],CD:['hB','H'],CF:['H','h','hB'],CG:['H','hB'],CH:['H','hB','h'],CI:['H','hB'],CK:['H','h','hb','hB'],CL:['h','H','hB','hb'],CM:['H','h','hB'],CN:['H','hB','hb','h'],CO:['h','H','hB','hb'],CP:['H'],CR:['h','H','hB','hb'],CU:['h','H','hB','hb'],CV:['H','hB'],CW:['H','hB'],CX:['H','h','hb','hB'],CY:['h','H','hb','hB'],CZ:['H'],DE:['H','hB'],DG:['H','h','hb','hB'],DJ:['h','H'],DK:['H'],DM:['h','hb','H','hB'],DO:['h','H','hB','hb'],DZ:['h','hB','hb','H'],EA:['H','h','hB','hb'],EC:['h','H','hB','hb'],EE:['H','hB'],EG:['h','hB','hb','H'],EH:['h','hB','hb','H'],ER:['h','H'],ES:['H','hB','h','hb'],ET:['hB','hb','h','H'],FI:['H'],FJ:['h','hb','H','hB'],FK:['H','h','hb','hB'],FM:['h','hb','H','hB'],FO:['H','h'],FR:['H','hB'],GA:['H','hB'],GB:['H','h','hb','hB'],GD:['h','hb','H','hB'],GE:['H','hB','h'],GF:['H','hB'],GG:['H','h','hb','hB'],GH:['h','H'],GI:['H','h','hb','hB'],GL:['H','h'],GM:['h','hb','H','hB'],GN:['H','hB'],GP:['H','hB'],GQ:['H','hB','h','hb'],GR:['h','H','hb','hB'],GS:['H','h','hb','hB'],GT:['h','H','hB','hb'],GU:['h','hb','H','hB'],GW:['H','hB'],GY:['h','hb','H','hB'],HK:['h','hB','hb','H'],HN:['h','H','hB','hb'],HR:['H','hB'],HU:['H','h'],IC:['H','h','hB','hb'],ID:['H'],IE:['H','h','hb','hB'],IL:['H','hB'],IM:['H','h','hb','hB'],IN:['h','H'],IO:['H','h','hb','hB'],IQ:['h','hB','hb','H'],IR:['hB','H'],IS:['H'],IT:['H','hB'],JE:['H','h','hb','hB'],JM:['h','hb','H','hB'],JO:['h','hB','hb','H'],JP:['H','K','h'],KE:['hB','hb','H','h'],KG:['H','h','hB','hb'],KH:['hB','h','H','hb'],KI:['h','hb','H','hB'],KM:['H','h','hB','hb'],KN:['h','hb','H','hB'],KP:['h','H','hB','hb'],KR:['h','H','hB','hb'],KW:['h','hB','hb','H'],KY:['h','hb','H','hB'],KZ:['H','hB'],LA:['H','hb','hB','h'],LB:['h','hB','hb','H'],LC:['h','hb','H','hB'],LI:['H','hB','h'],LK:['H','h','hB','hb'],LR:['h','hb','H','hB'],LS:['h','H'],LT:['H','h','hb','hB'],LU:['H','h','hB'],LV:['H','hB','hb','h'],LY:['h','hB','hb','H'],MA:['H','h','hB','hb'],MC:['H','hB'],MD:['H','hB'],ME:['H','hB','h'],MF:['H','hB'],MG:['H','h'],MH:['h','hb','H','hB'],MK:['H','h','hb','hB'],ML:['H'],MM:['hB','hb','H','h'],MN:['H','h','hb','hB'],MO:['h','hB','hb','H'],MP:['h','hb','H','hB'],MQ:['H','hB'],MR:['h','hB','hb','H'],MS:['H','h','hb','hB'],MT:['H','h'],MU:['H','h'],MV:['H','h'],MW:['h','hb','H','hB'],MX:['h','H','hB','hb'],MY:['hb','hB','h','H'],MZ:['H','hB'],NA:['h','H','hB','hb'],NC:['H','hB'],NE:['H'],NF:['H','h','hb','hB'],NG:['H','h','hb','hB'],NI:['h','H','hB','hb'],NL:['H','hB'],NO:['H','h'],NP:['H','h','hB'],NR:['H','h','hb','hB'],NU:['H','h','hb','hB'],NZ:['h','hb','H','hB'],OM:['h','hB','hb','H'],PA:['h','H','hB','hb'],PE:['h','H','hB','hb'],PF:['H','h','hB'],PG:['h','H'],PH:['h','hB','hb','H'],PK:['h','hB','H'],PL:['H','h'],PM:['H','hB'],PN:['H','h','hb','hB'],PR:['h','H','hB','hb'],PS:['h','hB','hb','H'],PT:['H','hB'],PW:['h','H'],PY:['h','H','hB','hb'],QA:['h','hB','hb','H'],RE:['H','hB'],RO:['H','hB'],RS:['H','hB','h'],RU:['H'],RW:['H','h'],SA:['h','hB','hb','H'],SB:['h','hb','H','hB'],SC:['H','h','hB'],SD:['h','hB','hb','H'],SE:['H'],SG:['h','hb','H','hB'],SH:['H','h','hb','hB'],SI:['H','hB'],SJ:['H'],SK:['H'],SL:['h','hb','H','hB'],SM:['H','h','hB'],SN:['H','h','hB'],SO:['h','H'],SR:['H','hB'],SS:['h','hb','H','hB'],ST:['H','hB'],SV:['h','H','hB','hb'],SX:['H','h','hb','hB'],SY:['h','hB','hb','H'],SZ:['h','hb','H','hB'],TA:['H','h','hb','hB'],TC:['h','hb','H','hB'],TD:['h','H','hB'],TF:['H','h','hB'],TG:['H','hB'],TH:['H','h'],TJ:['H','h'],TL:['H','hB','hb','h'],TM:['H','h'],TN:['h','hB','hb','H'],TO:['h','H'],TR:['H','hB'],TT:['h','hb','H','hB'],TW:['hB','hb','h','H'],TZ:['hB','hb','H','h'],UA:['H','hB','h'],UG:['hB','hb','H','h'],UM:['h','hb','H','hB'],US:['h','hb','H','hB'],UY:['h','H','hB','hb'],UZ:['H','hB','h'],VA:['H','h','hB'],VC:['h','hb','H','hB'],VE:['h','H','hB','hb'],VG:['h','hb','H','hB'],VI:['h','hb','H','hB'],VN:['H','h'],VU:['h','H'],WF:['H','hB'],WS:['h','H'],XK:['H','hB','h'],YE:['h','hB','hb','H'],YT:['H','hB'],ZA:['H','h','hb','hB'],ZM:['h','hb','H','hB'],ZW:['H','h'],'af-ZA':['H','h','hB','hb'],'ar-001':['h','hB','hb','H'],'ca-ES':['H','h','hB'],'en-001':['h','hb','H','hB'],'en-HK':['h','hb','H','hB'],'en-IL':['H','h','hb','hB'],'en-MY':['h','hb','H','hB'],'es-BR':['H','h','hB','hb'],'es-ES':['H','h','hB','hb'],'es-GQ':['H','h','hB','hb'],'fr-CA':['H','h','hB'],'gl-ES':['H','h','hB'],'gu-IN':['hB','hb','h','H'],'hi-IN':['hB','h','H'],'it-CH':['H','h','hB'],'it-IT':['H','h','hB'],'kn-IN':['hB','h','H'],'ku-SY':['H','hB'],'ml-IN':['hB','h','H'],'mr-IN':['hB','hb','h','H'],'pa-IN':['hB','hb','h','H'],'ta-IN':['hB','h','hb','H'],'te-IN':['hB','h','H'],'zu-ZA':['H','hB','hb','h']};function Ho(e){let t=e.hourCycle;if(void 0===t&&e.hourCycles&&e.hourCycles.length&&(t=e.hourCycles[0]),t)switch(t){case'h24':return'k';case'h23':return'H';case'h12':return'h';case'h11':return'K';default:throw new Error('Invalid hourCycle')}const r=e.language;let n;'root'!==r&&(n=e.maximize().region);return(Ro[n||'']||Ro[r||'']||Ro[''.concat(r,'-001')]||Ro['001'])[0]}const Oo=new RegExp('^'.concat(Po.source,'*')),Lo=new RegExp(''.concat(Po.source,'*$'));function Bo(e,t){return{start:e,end:t}}const Mo=!!Object.fromEntries,Do=!!String.prototype.trimStart,Fo=!!String.prototype.trimEnd,Uo=Mo?Object.fromEntries:function(e){const t={};for(const[r,n]of e)t[r]=n;return t},Go=Do?function(e){return e.trimStart()}:function(e){return e.replace(Oo,'')},zo=Fo?function(e){return e.trimEnd()}:function(e){return e.replace(Lo,'')},jo=new RegExp('([^\\p{White_Space}\\p{Pattern_Syntax}]*)','yu');class Vo{constructor(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e(this,'message',void 0),e(this,'position',void 0),e(this,'locale',void 0),e(this,'ignoreTag',void 0),e(this,'requiresOtherClause',void 0),e(this,'shouldParseSkeletons',void 0),this.message=t,this.position={offset:0,line:1,column:1},this.ignoreTag=!!r.ignoreTag,this.locale=r.locale,this.requiresOtherClause=!!r.requiresOtherClause,this.shouldParseSkeletons=!!r.shouldParseSkeletons}parse(){if(0!==this.offset())throw Error('parser can only be used once');return this.parseMessage(0,'',!1)}parseMessage(e,t,r){let n=[];for(;!this.isEOF();){const o=this.char();if(123===o){const t=this.parseArgument(e,r);if(t.err)return t;n.push(t.val)}else{if(125===o&&e>0)break;if(35!==o||'plural'!==t&&'selectordinal'!==t){if(60===o&&!this.ignoreTag&&47===this.peek()){if(r)break;return this.error(Ao.UNMATCHED_CLOSING_TAG,Bo(this.clonePosition(),this.clonePosition()))}if(60===o&&!this.ignoreTag&&qo(this.peek()||0)){const r=this.parseTag(e,t);if(r.err)return r;n.push(r.val)}else{const r=this.parseLiteral(e,t);if(r.err)return r;n.push(r.val)}}else{const e=this.clonePosition();this.bump(),n.push({type:_o.pound,location:Bo(e,this.clonePosition())})}}}return{val:n,err:null}}parseTag(e,t){const r=this.clonePosition();this.bump();const n=this.parseTagName();if(this.bumpSpace(),this.bumpIf('/>'))return{val:{type:_o.literal,value:'<'.concat(n,'/>'),location:Bo(r,this.clonePosition())},err:null};if(this.bumpIf('>')){const o=this.parseMessage(e+1,t,!0);if(o.err)return o;const i=o.val,a=this.clonePosition();if(this.bumpIf('</')){if(this.isEOF()||!qo(this.char()))return this.error(Ao.INVALID_TAG,Bo(a,this.clonePosition()));const e=this.clonePosition();return n!==this.parseTagName()?this.error(Ao.UNMATCHED_CLOSING_TAG,Bo(e,this.clonePosition())):(this.bumpSpace(),this.bumpIf('>')?{val:{type:_o.tag,value:n,children:i,location:Bo(r,this.clonePosition())},err:null}:this.error(Ao.INVALID_TAG,Bo(a,this.clonePosition())))}return this.error(Ao.UNCLOSED_TAG,Bo(r,this.clonePosition()))}return this.error(Ao.INVALID_TAG,Bo(r,this.clonePosition()))}parseTagName(){const e=this.offset();for(this.bump();!this.isEOF()&&Wo(this.char());)this.bump();return this.message.slice(e,this.offset())}parseLiteral(e,t){const r=this.clonePosition();let n='';for(;;){const r=this.tryParseQuote(t);if(r){n+=r;continue}const o=this.tryParseUnquoted(e,t);if(o){n+=o;continue}const i=this.tryParseLeftAngleBracket();if(!i)break;n+=i}const o=Bo(r,this.clonePosition());return{val:{type:_o.literal,value:n,location:o},err:null}}tryParseLeftAngleBracket(){return this.isEOF()||60!==this.char()||!this.ignoreTag&&(qo(e=this.peek()||0)||47===e)?null:(this.bump(),'<');var e}tryParseQuote(e){if(this.isEOF()||39!==this.char())return null;switch(this.peek()){case 39:return this.bump(),this.bump(),'\'';case 123:case 60:case 62:case 125:break;case 35:if('plural'===e||'selectordinal'===e)break;return null;default:return null}this.bump();const t=[this.char()];for(this.bump();!this.isEOF();){const e=this.char();if(39===e){if(39!==this.peek()){this.bump();break}t.push(39),this.bump()}else t.push(e);this.bump()}return String.fromCodePoint(...t)}tryParseUnquoted(e,t){if(this.isEOF())return null;const r=this.char();return 60===r||123===r||35===r&&('plural'===t||'selectordinal'===t)||125===r&&e>0?null:(this.bump(),String.fromCodePoint(r))}parseArgument(e,t){const r=this.clonePosition();if(this.bump(),this.bumpSpace(),this.isEOF())return this.error(Ao.EXPECT_ARGUMENT_CLOSING_BRACE,Bo(r,this.clonePosition()));if(125===this.char())return this.bump(),this.error(Ao.EMPTY_ARGUMENT,Bo(r,this.clonePosition()));let n=this.parseIdentifierIfPossible().value;if(!n)return this.error(Ao.MALFORMED_ARGUMENT,Bo(r,this.clonePosition()));if(this.bumpSpace(),this.isEOF())return this.error(Ao.EXPECT_ARGUMENT_CLOSING_BRACE,Bo(r,this.clonePosition()));switch(this.char()){case 125:return this.bump(),{val:{type:_o.argument,value:n,location:Bo(r,this.clonePosition())},err:null};case 44:return this.bump(),this.bumpSpace(),this.isEOF()?this.error(Ao.EXPECT_ARGUMENT_CLOSING_BRACE,Bo(r,this.clonePosition())):this.parseArgumentOptions(e,t,n,r);default:return this.error(Ao.MALFORMED_ARGUMENT,Bo(r,this.clonePosition()))}}parseIdentifierIfPossible(){const e=this.clonePosition(),t=this.offset(),r=function(e,t){var r;return jo.lastIndex=t,null!==(r=jo.exec(e)[1])&&void 0!==r?r:''}(this.message,t),n=t+r.length;this.bumpTo(n);return{value:r,location:Bo(e,this.clonePosition())}}parseArgumentOptions(e,t,r,o){let i=this.clonePosition(),a=this.parseIdentifierIfPossible().value,s=this.clonePosition();switch(a){case'':return this.error(Ao.EXPECT_ARGUMENT_TYPE,Bo(i,s));case'number':case'date':case'time':{var l,c;this.bumpSpace();let e=null;if(this.bumpIf(',')){this.bumpSpace();const t=this.clonePosition(),r=this.parseSimpleArgStyleIfPossible();if(r.err)return r;const n=zo(r.val);if(0===n.length)return this.error(Ao.EXPECT_ARGUMENT_STYLE,Bo(this.clonePosition(),this.clonePosition()));e={style:n,styleLocation:Bo(t,this.clonePosition())}}const t=this.tryParseArgumentClose(o);if(t.err)return t;const n=Bo(o,this.clonePosition());if(e&&e.style.startsWith('::')){let t=Go(e.style.slice(2));if('number'===a){const o=this.parseNumberSkeletonFromString(t,e.styleLocation);return o.err?o:{val:{type:_o.number,value:r,location:n,style:o.val},err:null}}{if(0===t.length)return this.error(Ao.EXPECT_DATE_TIME_SKELETON,n);let o=t;this.locale&&(o=function(e,t){let r='';for(let n=0;n<e.length;n++){const o=e.charAt(n);if('j'===o){let i=0;for(;n+1<e.length&&e.charAt(n+1)===o;)i++,n++;let a=1+(1&i),s=i<2?1:3+(i>>1),l='a',c=Ho(t);for('H'!=c&&'k'!=c||(s=0);s-- >0;)r+=l;for(;a-- >0;)r=c+r}else r+='J'===o?'H':o}return r}(t,this.locale));const i={type:vo.dateTime,pattern:o,location:e.styleLocation,parsedOptions:this.shouldParseSkeletons?oo(o):{}};return{val:{type:'date'===a?_o.date:_o.time,value:r,location:n,style:i},err:null}}}return{val:{type:'number'===a?_o.number:'date'===a?_o.date:_o.time,value:r,location:n,style:null!==(l=null===(c=e)||void 0===c?void 0:c.style)&&void 0!==l?l:null},err:null}}case'plural':case'selectordinal':case'select':{const i=this.clonePosition();if(this.bumpSpace(),!this.bumpIf(','))return this.error(Ao.EXPECT_SELECT_ARGUMENT_OPTIONS,Bo(i,n({},i)));this.bumpSpace();let s=this.parseIdentifierIfPossible(),l=0;if('select'!==a&&'offset'===s.value){if(!this.bumpIf(':'))return this.error(Ao.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Bo(this.clonePosition(),this.clonePosition()));this.bumpSpace();const e=this.tryParseDecimalInteger(Ao.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE,Ao.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);if(e.err)return e;this.bumpSpace(),s=this.parseIdentifierIfPossible(),l=e.val}const c=this.tryParsePluralOrSelectOptions(e,a,t,s);if(c.err)return c;const u=this.tryParseArgumentClose(o);if(u.err)return u;const d=Bo(o,this.clonePosition());return'select'===a?{val:{type:_o.select,value:r,options:Uo(c.val),location:d},err:null}:{val:{type:_o.plural,value:r,options:Uo(c.val),offset:l,pluralType:'plural'===a?'cardinal':'ordinal',location:d},err:null}}default:return this.error(Ao.INVALID_ARGUMENT_TYPE,Bo(i,s))}}tryParseArgumentClose(e){return this.isEOF()||125!==this.char()?this.error(Ao.EXPECT_ARGUMENT_CLOSING_BRACE,Bo(e,this.clonePosition())):(this.bump(),{val:!0,err:null})}parseSimpleArgStyleIfPossible(){let e=0;const t=this.clonePosition();for(;!this.isEOF();){switch(this.char()){case 39:{this.bump();let e=this.clonePosition();if(!this.bumpUntil('\''))return this.error(Ao.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE,Bo(e,this.clonePosition()));this.bump();break}case 123:e+=1,this.bump();break;case 125:if(!(e>0))return{val:this.message.slice(t.offset,this.offset()),err:null};e-=1;break;default:this.bump()}}return{val:this.message.slice(t.offset,this.offset()),err:null}}parseNumberSkeletonFromString(e,t){let r=[];try{r=function(e){if(0===e.length)throw new Error('Number skeleton cannot be empty');const t=e.split(io).filter(e=>e.length>0),r=[];for(const e of t){let t=e.split('/');if(0===t.length)throw new Error('Invalid number skeleton');const[n,...o]=t;for(const e of o)if(0===e.length)throw new Error('Invalid number skeleton');r.push({stem:n,options:o})}return r}(e)}catch(e){return this.error(Ao.INVALID_NUMBER_SKELETON,t)}return{val:{type:vo.number,tokens:r,location:t,parsedOptions:this.shouldParseSkeletons?go(r):{}},err:null}}tryParsePluralOrSelectOptions(e,t,r,n){let o=!1;const i=[],a=new Set;let{value:s,location:l}=n;for(;;){if(0===s.length){const e=this.clonePosition();if('select'===t||!this.bumpIf('='))break;{const t=this.tryParseDecimalInteger(Ao.EXPECT_PLURAL_ARGUMENT_SELECTOR,Ao.INVALID_PLURAL_ARGUMENT_SELECTOR);if(t.err)return t;l=Bo(e,this.clonePosition()),s=this.message.slice(e.offset,this.offset())}}if(a.has(s))return this.error('select'===t?Ao.DUPLICATE_SELECT_ARGUMENT_SELECTOR:Ao.DUPLICATE_PLURAL_ARGUMENT_SELECTOR,l);'other'===s&&(o=!0),this.bumpSpace();const n=this.clonePosition();if(!this.bumpIf('{'))return this.error('select'===t?Ao.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT:Ao.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT,Bo(this.clonePosition(),this.clonePosition()));const c=this.parseMessage(e+1,t,r);if(c.err)return c;const u=this.tryParseArgumentClose(n);if(u.err)return u;i.push([s,{value:c.val,location:Bo(n,this.clonePosition())}]),a.add(s),this.bumpSpace(),({value:s,location:l}=this.parseIdentifierIfPossible())}return 0===i.length?this.error('select'===t?Ao.EXPECT_SELECT_ARGUMENT_SELECTOR:Ao.EXPECT_PLURAL_ARGUMENT_SELECTOR,Bo(this.clonePosition(),this.clonePosition())):this.requiresOtherClause&&!o?this.error(Ao.MISSING_OTHER_CLAUSE,Bo(this.clonePosition(),this.clonePosition())):{val:i,err:null}}tryParseDecimalInteger(e,t){let r=1;const n=this.clonePosition();this.bumpIf('+')||this.bumpIf('-')&&(r=-1);let o=!1,i=0;for(;!this.isEOF();){const e=this.char();if(!(e>=48&&e<=57))break;o=!0,i=10*i+(e-48),this.bump()}const a=Bo(n,this.clonePosition());return o?(i*=r,Number.isSafeInteger(i)?{val:i,err:null}:this.error(t,a)):this.error(e,a)}offset(){return this.position.offset}isEOF(){return this.offset()===this.message.length}clonePosition(){return{offset:this.position.offset,line:this.position.line,column:this.position.column}}char(){const e=this.position.offset;if(e>=this.message.length)throw Error('out of bound');const t=this.message.codePointAt(e);if(void 0===t)throw Error('Offset '.concat(e,' is at invalid UTF-16 code unit boundary'));return t}error(e,t){return{val:null,err:{kind:e,message:this.message,location:t}}}bump(){if(this.isEOF())return;const e=this.char();10===e?(this.position.line+=1,this.position.column=1,this.position.offset+=1):(this.position.column+=1,this.position.offset+=e<65536?1:2)}bumpIf(e){if(this.message.startsWith(e,this.offset())){for(let t=0;t<e.length;t++)this.bump();return!0}return!1}bumpUntil(e){const t=this.offset(),r=this.message.indexOf(e,t);return r>=0?(this.bumpTo(r),!0):(this.bumpTo(this.message.length),!1)}bumpTo(e){if(this.offset()>e)throw Error('targetOffset '.concat(e,' must be greater than or equal to the current offset ').concat(this.offset()));for(e=Math.min(e,this.message.length);;){const t=this.offset();if(t===e)break;if(t>e)throw Error('targetOffset '.concat(e,' is at invalid UTF-16 code unit boundary'));if(this.bump(),this.isEOF())break}}bumpSpace(){for(;!this.isEOF()&&Xo(this.char());)this.bump()}peek(){if(this.isEOF())return null;const e=this.char(),t=this.offset(),r=this.message.charCodeAt(t+(e>=65536?2:1));return null!=r?r:null}}function qo(e){return e>=97&&e<=122||e>=65&&e<=90}function Wo(e){return 45===e||46===e||e>=48&&e<=57||95===e||e>=97&&e<=122||e>=65&&e<=90||183==e||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8255&&e<=8256||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function Xo(e){return e>=9&&e<=13||32===e||133===e||e>=8206&&e<=8207||8232===e||8233===e}function Ko(e){e.forEach(e=>{if(delete e.location,xo(e)||ko(e))for(const t in e.options)delete e.options[t].location,Ko(e.options[t].value);else wo(e)&&To(e.style)||(Eo(e)||No(e))&&Io(e.style)?delete e.style.location:So(e)&&Ko(e.children)})}let Zo=(e=>(e.MISSING_VALUE='MISSING_VALUE',e.INVALID_VALUE='INVALID_VALUE',e.MISSING_INTL_API='MISSING_INTL_API',e))({});class Yo extends Error{constructor(t,r,n){super(t),e(this,'code',void 0),e(this,'originalMessage',void 0),this.code=r,this.originalMessage=n}toString(){return'[formatjs Error: '.concat(this.code,'] ').concat(this.message)}}class Jo extends Yo{constructor(e,t,r,n){super('Invalid values for "'.concat(e,'": "').concat(t,'". Options are "').concat(Object.keys(r).join('", "'),'"'),Zo.INVALID_VALUE,n)}}class Qo extends Yo{constructor(e,t,r){super('Value for "'.concat(e,'" must be of type ').concat(t),Zo.INVALID_VALUE,r)}}class $o extends Yo{constructor(e,t){super('The intl string context variable "'.concat(e,'" was not provided to the string "').concat(t,'"'),Zo.MISSING_VALUE,t)}}let ei=(e=>(e[e.literal=0]='literal',e[e.object=1]='object',e))({});function ti(e){return'function'==typeof e}function ri(e,t,r,n,o,i,a){if(1===e.length&&bo(e[0]))return[{type:ei.literal,value:e[0].value}];const s=[];for(const l of e){if(bo(l)){s.push({type:ei.literal,value:l.value});continue}if(Co(l)){'number'==typeof i&&s.push({type:ei.literal,value:r.getNumberFormat(t).format(i)});continue}const{value:e}=l;if(!o||!(e in o))throw new $o(e,a);let c=o[e];if(yo(l))c&&'string'!=typeof c&&'number'!=typeof c&&'bigint'!=typeof c||(c='string'==typeof c||'number'==typeof c||'bigint'==typeof c?String(c):''),s.push({type:'string'==typeof c?ei.literal:ei.object,value:c});else{if(Eo(l)){const e='string'==typeof l.style?n.date[l.style]:Io(l.style)?l.style.parsedOptions:void 0;s.push({type:ei.literal,value:r.getDateTimeFormat(t,e).format(c)});continue}if(No(l)){const e='string'==typeof l.style?n.time[l.style]:Io(l.style)?l.style.parsedOptions:n.time.medium;s.push({type:ei.literal,value:r.getDateTimeFormat(t,e).format(c)});continue}if(wo(l)){const e='string'==typeof l.style?n.number[l.style]:To(l.style)?l.style.parsedOptions:void 0;if(e&&e.scale){const t=e.scale||1;if('bigint'==typeof c){if(!Number.isInteger(t))throw new TypeError('Cannot apply fractional scale '.concat(t,' to bigint value. Scale must be an integer when formatting bigint.'));c*=BigInt(t)}else c*=t}s.push({type:ei.literal,value:r.getNumberFormat(t,e).format(c)});continue}if(So(l)){const{children:e,value:c}=l,u=o[c];if(!ti(u))throw new Qo(c,'function',a);let d=u(ri(e,t,r,n,o,i).map(e=>e.value));Array.isArray(d)||(d=[d]),s.push(...d.map(e=>({type:'string'==typeof e?ei.literal:ei.object,value:e})))}if(xo(l)){const e=c,i=(Object.prototype.hasOwnProperty.call(l.options,e)?l.options[e]:void 0)||l.options.other;if(!i)throw new Jo(l.value,c,Object.keys(l.options),a);s.push(...ri(i.value,t,r,n,o));continue}if(ko(l)){const e='='.concat(c);let i=Object.prototype.hasOwnProperty.call(l.options,e)?l.options[e]:void 0;if(!i){if(!Intl.PluralRules)throw new Yo('Intl.PluralRules is not available in this environment.\nTry polyfilling it using "@formatjs/intl-pluralrules"\n',Zo.MISSING_INTL_API,a);const e='bigint'==typeof c?Number(c):c,n=r.getPluralRules(t,{type:l.pluralType}).select(e-(l.offset||0));i=(Object.prototype.hasOwnProperty.call(l.options,n)?l.options[n]:void 0)||l.options.other}if(!i)throw new Jo(l.value,c,Object.keys(l.options),a);const u='bigint'==typeof c?Number(c):c;s.push(...ri(i.value,t,r,n,o,u-(l.offset||0)));continue}}}return(l=s).length<2?l:l.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===ei.literal&&t.type===ei.literal?r.value+=t.value:e.push(t),e},[]);var l}function ni(e,t){return t?Object.keys(e).reduce((r,o)=>{var i,a;return r[o]=(i=e[o],(a=t[o])?n(n(n({},i),a),Object.keys(i).reduce((e,t)=>(e[t]=n(n({},i[t]),a[t]),e),{})):i),r},n({},e)):e}function oi(e){return{create:()=>({get:t=>e[t],set(t,r){e[t]=r}})}}class ii{constructor(r){let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ii.defaultLocale,i=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if(e(this,'ast',void 0),e(this,'locales',void 0),e(this,'resolvedLocale',void 0),e(this,'formatters',void 0),e(this,'formats',void 0),e(this,'message',void 0),e(this,'formatterCache',{number:{},dateTime:{},pluralRules:{}}),e(this,'format',e=>{const t=this.formatToParts(e);if(1===t.length)return t[0].value;const r=t.reduce((e,t)=>(e.length&&t.type===ei.literal&&'string'==typeof e[e.length-1]?e[e.length-1]+=t.value:e.push(t.value),e),[]);return r.length<=1?r[0]||'':r}),e(this,'formatToParts',e=>ri(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message)),e(this,'resolvedOptions',()=>{var e;return{locale:(null===(e=this.resolvedLocale)||void 0===e?void 0:e.toString())||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}}),e(this,'getAst',()=>this.ast),this.locales=o,this.resolvedLocale=ii.resolveLocale(o),'string'==typeof r){if(this.message=r,!ii.__parse)throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');const e=a||{},o=t({},(function(e){if(null==e)throw new TypeError('Cannot destructure '+e)}(e),e));this.ast=ii.__parse(r,n(n({},o),{},{locale:this.resolvedLocale}))}else this.ast=r;if(!Array.isArray(this.ast))throw new TypeError('A message must be provided as a String or AST.');this.formats=ni(ii.formats,i),this.formatters=a&&a.formatters||function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{number:{},dateTime:{},pluralRules:{}};return{getNumberFormat:Gr(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Intl.NumberFormat(...t)},{cache:oi(e.number),strategy:Zr.variadic}),getDateTimeFormat:Gr(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Intl.DateTimeFormat(...t)},{cache:oi(e.dateTime),strategy:Zr.variadic}),getPluralRules:Gr(function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return new Intl.PluralRules(...t)},{cache:oi(e.pluralRules),strategy:Zr.variadic})}}(this.formatterCache)}static get defaultLocale(){return ii.memoizedDefaultLocale||(ii.memoizedDefaultLocale=(new Intl.NumberFormat).resolvedOptions().locale),ii.memoizedDefaultLocale}}function ai(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];let[o,i,a,s]=t;if(Array.isArray(i))throw new Yr(Jr.INVALID_MESSAGE,void 0);if('object'==typeof i)throw new Yr(Jr.INSUFFICIENT_PATH,void 0);if('string'==typeof i){const e=((e,t)=>t||/'[{}]/.test(e)?void 0:e)(i,a);if(e)return e}const{cache:l,formats:c,formatters:u,globalFormats:d,locale:h,timeZone:f}=s;let m;u.getMessageFormat||(u.getMessageFormat=((e,t)=>$r(function(){return new ii(arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1],arguments.length<=2?void 0:arguments[2],n({formatters:t},arguments.length<=3?void 0:arguments[3]))},e.message))(l,u));try{m=u.getMessageFormat(i,h,((e,t,r)=>{const o=ii.formats.date,i=ii.formats.time,a=n(n({},null==e?void 0:e.dateTime),null==t?void 0:t.dateTime),s={date:n(n({},o),a),time:n(n({},i),a),number:n(n({},null==e?void 0:e.number),null==t?void 0:t.number)};return r&&['date','time'].forEach(e=>{const t=s[e];for(const[e,o]of Object.entries(t))t[e]=n({timeZone:r},o)}),s})(d,c,f),{formatters:n(n({},u),{},{getDateTimeFormat:(e,t)=>{var r;return u.getDateTimeFormat(e,n(n({},t),{},{timeZone:null!==(r=null==t?void 0:t.timeZone)&&void 0!==r?r:f}))}})})}catch(e){throw new Yr(Jr.INVALID_MESSAGE,void 0)}const p=m.format(a);return to(p)||Array.isArray(p)||'string'==typeof p?p:String(p)}e(ii,'memoizedDefaultLocale',null),e(ii,'resolveLocale',e=>{if(void 0===Intl.Locale)return;const t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale('string'==typeof e?e:e[0])}),e(ii,'__parse',function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r=n({shouldParseSkeletons:!0,requiresOtherClause:!0},r);const o=new Vo(e,r).parse();if(o.err){const e=SyntaxError(Ao[o.err.kind]);throw e.location=o.err.location,e.originalMessage=o.err.message,e}return null!==(t=r)&&void 0!==t&&t.captureLocation||Ko(o.val),o.val}),e(ii,'formats',{number:{integer:{maximumFractionDigits:0},currency:{style:'currency'},percent:{style:'percent'}},date:{short:{month:'numeric',day:'numeric',year:'2-digit'},medium:{month:'short',day:'numeric',year:'numeric'},long:{month:'long',day:'numeric',year:'numeric'},full:{weekday:'long',month:'long',day:'numeric',year:'numeric'}},time:{short:{hour:'numeric',minute:'numeric'},medium:{hour:'numeric',minute:'numeric',second:'numeric'},long:{hour:'numeric',minute:'numeric',second:'numeric',timeZoneName:'short'},full:{hour:'numeric',minute:'numeric',second:'numeric',timeZoneName:'short'}}}),ai.raw=!0;const si=['formats','getMessageFallback','messages','onError'];function li(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter(Boolean).join('.')}function ci(e){return li(e.namespace,e.key)}function ui(e){console.error(e)}function di(e,t,r,n){const o=li(n,r);if(!t)throw new Error(o);let i=t;return r.split('.').forEach(t=>{const r=i[t];if(null==t||null==r)throw new Error(o+' ('.concat(e,')'));i=r}),i}function hi(e){const t=((e,t,r)=>{try{if(!t)throw new Error(void 0);const n=r?di(e,t,r):t;if(!n)throw new Error(r);return n}catch(e){return new Yr(Jr.MISSING_MESSAGE,e.message)}})(e.locale,e.messages,e.namespace);return(e=>{let{cache:t,formats:r,formatters:n,getMessageFallback:o=ci,locale:i,messagesOrError:a,namespace:s,onError:l,timeZone:c}=e;const u=a instanceof Yr;function d(e,t,r,n){const i=new Yr(t,r);return l(i),null!=n?n:o({error:i,key:e,namespace:s})}function h(e,h,f,m){const p=m;let g;if(u){if(!p)return l(a),o({error:a,key:e,namespace:s});g=p}else{const t=a;try{g=di(i,t,e,s)}catch(t){if(!p)return d(e,Jr.MISSING_MESSAGE,t.message,p);g=p}}try{return ai(li(s,e),g,h?(e=>{const t={};return Object.keys(e).forEach(r=>{let n=0;const o=e[r];let i;i='function'==typeof o?e=>{const t=o(e);return to(t)?ro(t,{key:r+n++}):t}:o,t[r]=i}),t})(h):h,{cache:t,formatters:n,globalFormats:r,formats:f,locale:i,timeZone:c})}catch(t){let r,n;return t instanceof Yr?(r=t.code,n=t.originalMessage):(r=Jr.FORMATTING_ERROR,n=t.message),d(e,r,n,p)}}function f(e,t,r,n){const o=h(e,t,r,n);return'string'!=typeof o?d(e,Jr.INVALID_MESSAGE,void 0):o}return f.rich=h,f.markup=(e,t,r,n)=>h(e,t,r,n),f.raw=e=>{if(u)return l(a),o({error:a,key:e,namespace:s});const t=a;try{return di(i,t,e,s)}catch(t){return d(e,Jr.MISSING_MESSAGE,t.message)}},f.has=e=>{if(u)return!1;try{return di(i,a,e,s),!0}catch(e){return!1}},f})(n(n({},e),{},{messagesOrError:t}))}const fi=3600,mi=86400,pi=7*mi,gi=2628e3,_i=7884e3,vi=365*mi,bi={second:1,seconds:1,minute:60,minutes:60,hour:fi,hours:fi,day:mi,days:mi,week:pi,weeks:pi,month:gi,months:gi,quarter:_i,quarters:_i,year:vi,years:vi};function yi(e){let{formats:t,getMessageFallback:r,messages:i,onError:a}=e;return n(n({},o(e,si)),{},{formats:t||void 0,messages:i||void 0,onError:a||ui,getMessageFallback:r||ci})}const wi=pr(void 0);function Ei(e){let{children:t,formats:r,getMessageFallback:o,locale:i,messages:a,now:s,onError:l,timeZone:c}=e;const u=En(wi),d=yn(()=>(null==u?void 0:u.cache)||Qr(),[i,null==u?void 0:u.cache]),h=yn(()=>(null==u?void 0:u.formatters)||tn(d),[d,null==u?void 0:u.formatters]),f=yn(()=>n(n({},yi({locale:i,formats:void 0===r?null==u?void 0:u.formats:r,getMessageFallback:o||(null==u?void 0:u.getMessageFallback),messages:void 0===a?null==u?void 0:u.messages:a,now:s||(null==u?void 0:u.now),onError:l||(null==u?void 0:u.onError),timeZone:c||(null==u?void 0:u.timeZone)})),{},{formatters:h,cache:d}),[d,r,h,o,i,a,s,l,u,c]);return Ur(wi.Provider,{value:f,children:t})}function Ni(){const e=En(wi);if(!e)throw new Error(void 0);return e}let xi=!1;const ki='undefined'==typeof window;function Ci(e){return((e,t)=>{const{cache:r,formats:n,formatters:o,getMessageFallback:i,locale:a,onError:s,timeZone:l}=Ni(),c=e['!'],u=function(e,t){return e===t?void 0:e.slice((t+'.').length)}(t,'!');return l||xi||!ki||(xi=!0,s(new Yr(Jr.ENVIRONMENT_FALLBACK,void 0))),yn(()=>hi({cache:r,formatters:o,getMessageFallback:i,messages:c,namespace:u,onError:s,formats:n,locale:a,timeZone:l}),[r,o,i,c,u,s,n,a,l])})({'!':Ni().messages},e?'!.'.concat(e):'!')}function Si(){const{formats:e,formatters:t,locale:r,now:o,onError:i,timeZone:a}=Ni();return yn(()=>function(e){const{_cache:t=Qr(),_formatters:r=tn(t),formats:o,locale:i,onError:a=ui,timeZone:s}=e;function l(e){var t;return null!==(t=e)&&void 0!==t&&t.timeZone||(s?e=n(n({},e),{},{timeZone:s}):a(new Yr(Jr.ENVIRONMENT_FALLBACK,void 0))),e}function c(e,t,r,o,i){let s;try{s=((e,t,r)=>{let o;if('string'==typeof t){if(o=null==e?void 0:e[t],!o){const e=new Yr(Jr.MISSING_FORMAT,void 0);throw a(e),e}}else o=t;return r&&(o=n(n({},o),r)),o})(r,e,t)}catch(e){return i()}try{return o(s)}catch(e){return a(new Yr(Jr.FORMATTING_ERROR,e.message)),i()}}function u(e,t,n){return c(t,n,null==o?void 0:o.dateTime,t=>(t=l(t),r.getDateTimeFormat(i,t).format(e)),()=>String(e))}function d(){return e.now?e.now:(a(new Yr(Jr.ENVIRONMENT_FALLBACK,void 0)),new Date)}return{dateTime:u,number:(e,t,n)=>c(t,n,null==o?void 0:o.number,t=>r.getNumberFormat(i,t).format(e),()=>String(e)),relativeTime:(e,t)=>{try{let n,o;const a={};t instanceof Date||'number'==typeof t?n=new Date(t):t&&(n=null!=t.now?new Date(t.now):d(),o=t.unit,a.style=t.style,a.numberingSystem=t.numberingSystem),n||(n=d());const s=(new Date(e).getTime()-n.getTime())/1e3;o||(o=(e=>{const t=Math.abs(e);return t<60?'second':t<fi?'minute':t<mi?'hour':t<pi?'day':t<gi?'week':t<vi?'month':'year'})(s)),a.numeric='second'===o?'auto':'always';const l=((e,t)=>Math.round(e/bi[t]))(s,o);return r.getRelativeTimeFormat(i,a).format(l,o)}catch(t){return a(new Yr(Jr.FORMATTING_ERROR,t.message)),String(e)}},list:(e,t,n)=>{const a=[],s=new Map;let l=0;for(const t of e){let e;'object'==typeof t?(e=String(l),s.set(e,t)):e=String(t),a.push(e),l++}return c(t,n,null==o?void 0:o.list,e=>{const t=r.getListFormat(i,e).formatToParts(a).map(e=>'literal'===e.type?e.value:s.get(e.value)||e.value);return s.size>0?t:t.join('')},()=>String(e))},dateTimeRange:(e,t,n,a)=>c(n,a,null==o?void 0:o.dateTime,n=>(n=l(n),r.getDateTimeFormat(i,n).formatRange(e,t)),()=>[u(e),u(t)].join(' – '))}}({formats:e,locale:r,now:o,onError:i,timeZone:a,_formatters:t}),[e,t,o,r,i,a])}const Ti=(e,t)=>{const[r,n]=_n(e);return{value:r,set:e=>{if(!t)return n(e);n(r=>{const n=function(e,t){return'function'==typeof e?e(t):e}(e,r);return t(n),n})}}},Ii=(e,t)=>{const r=_n(!1),n=bn(!1);return vn(()=>{n.current||e(()=>{r[1](!0),n.current=!0})},t),r},Ai=pr({}),Pi=()=>{const e=En(Ai);if(!e)throw new Error('useWidgetContext must be used within a WidgetContextProvider');return e};var Ri={back:async(e,t,r)=>{var n;const o=new URL('/'.concat(e),br);t&&(o.pathname+='/'.concat(t));const i=null!==(n=Ke().get('from'))&&void 0!==n?n:r;if(i){const e=i.split('/').at(-1);e&&(o.pathname+='/'.concat(e),o.searchParams.append('step','-1'))}await ot(),Je(),window.location.href=o.toString()},continue:(e,t)=>{const r=new URL('/'.concat(e,'/').concat(t,'/confirmation'),br),n=encodeURIComponent(window.location.pathname);r.searchParams.append('from',n),window.location.href=r.toString()},exit:async function(){if(!(arguments.length>0&&void 0!==arguments[0])||arguments[0])try{await ot()}catch(e){Ve.error('Failed to clear cart on exit',e)}Je(),window.location.reload()}};const Hi=pr({}),Oi=()=>{const e=En(Hi);if(!e)throw new Error('useReturnContext must be used within a ReturnContextProvider');return e},Li=['src','className'],Bi=e=>{let{src:t,className:r}=e,i=o(e,Li);return Ur('img',n({src:t||'https://cdn.shopify.com/s/files/1/0849/6526/1638/files/RF-SO-Placeholder2.png?v=1735826638',className:qe('rf-image',r)},i))},Mi=e=>{let{pending:t=!1,skeleton:r,children:n}=e;return!0===t?r:n},Di=['class','className'],Fi=e=>'boolean'==typeof e?''.concat(e):0===e?'0':e,Ui=u,Gi=(e,t)=>r=>{var i;if(null==(null==t?void 0:t.variants))return Ui(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:a,defaultVariants:s}=t,l=Object.keys(a).map(e=>{const t=null==r?void 0:r[e],n=null==s?void 0:s[e];if(null===t)return null;const o=Fi(t)||Fi(n);return a[e][o]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),u=null==t||null===(i=t.compoundVariants)||void 0===i?void 0:i.reduce((e,t)=>{let{class:r,className:i}=t,a=o(t,Di);return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes(n(n({},s),c)[t]):n(n({},s),c)[t]===r})?[...e,r,i]:e},[]);return Ui(e,l,u,null==r?void 0:r.class,null==r?void 0:r.className)},zi=['children','className','variant'],ji=Gi('rf-avatar size-[26px] rounded-full border overflow-hidden',{variants:{variant:{light:'bg-white text-black border-[#E1E1E1]',dark:'bg-[#555555] text-white border-black'}},defaultVariants:{variant:'light'}});var Vi=Rn(e=>{let{children:t,className:r,variant:i}=e,a=o(e,zi);return Ur('div',n(n({className:qe(ji({variant:i}),r)},a),{},{children:t}))});const qi=['className'],Wi=e=>{let{className:t}=e,r=o(e,qi);return Ur('div',n(n({className:qe('rf-skeleton bg-neutral-2 animate-pulse rounded-md h-[1.5em]',t)},r),{},{role:'status',children:Ur('span',{className:'rf-skeleton__sr-text sr-only',children:'Loading...'})}))},Xi=()=>Ur('div',{className:'rf-avatar-stack-skeleton flex -space-x-1',children:[Ur('div',{className:'rf-avatar-stack-skeleton__item relative bg-neutral-2 rounded-full z-[1]',children:Ur(Wi,{className:'size-[26px] rounded-full'})}),Ur('div',{className:'rf-avatar-stack-skeleton__item relative bg-neutral-2 rounded-full z-[2]',children:Ur(Wi,{className:'size-[26px] rounded-full'})}),Ur('div',{className:'rf-avatar-stack-skeleton__item relative bg-neutral-2 rounded-full z-[3]',children:Ur(Wi,{className:'size-[26px] rounded-full'})})]}),Ki=['images','variant','maxVisibleAvatars','className','pending'],Zi=e=>{let{images:t,variant:r,maxVisibleAvatars:i=2,className:a,pending:s=!1}=e,l=o(e,Ki);const c=null!=i?i:t.length;return Ur(Mi,{skeleton:Ur(Xi,{}),pending:s,children:t.length>0&&Ur('div',n(n({className:qe('rf-avatar-stack flex -space-x-1',a)},l),{},{children:[t.slice(0,c).map((e,t)=>{let{src:n,alt:o}=e;return Ur(Vi,{className:'relative',style:{zIndex:t+1},variant:r,children:Ur(Bi,{className:'rf-avatar-stack__image size-full object-cover',src:n,alt:o})},t)}),c<t.length&&Ur(Vi,{variant:r,style:{zIndex:c+1},className:'flex items-center justify-center',children:Ur('span',{className:'rf-avatar-stack__count text-[10px]',children:['+',t.length-c]})})]}))})},Yi=()=>{var e;const{orderState:t}=Oi(),r=yn(()=>{var e,r;return(null!==(e=null===(r=t.value.data)||void 0===r?void 0:r.orderData.productsToExchange)&&void 0!==e?e:[]).reduce((e,t)=>{for(let r=0;r<t.quantity;r++)e.push({src:t.image,alt:t.title});return e},[])},[null===(e=t.value.data)||void 0===e?void 0:e.orderData.productsToExchange]);return Ur(Zi,{pending:t.value.pending,variant:'light',images:r})},Ji=pr(null),Qi=()=>{const[e,t]=_n(!1);return vn(()=>{t(!0)},[]),e},$i=pr(null),ea=['onClick','className','children','isVisible'],ta=e=>{let{onClick:t,className:r,children:i,isVisible:a=!0}=e,s=o(e,ea);const l=bn(null);return Ur('aside',n(n({onClick:function(e){t&&e.target===l.current&&t()},ref:l,className:qe('rf-dialog__backdrop fixed inset-0 size-full z-50 flex items-center justify-center p-6',a&&'rf-dialog__backdrop--visible bg-black/50',r)},s),{},{children:i}))},ra=['isOpen','onClose','fadeIn','showBackdrop','dismissOnBackdropClick','dismissOnEscape','className'],na=['className'],oa=['className'],ia=['className'],aa=e=>{let{className:t}=e,r=o(e,ia);return Ur('svg',n(n({width:11,height:9,viewBox:'0 0 11 9',fill:'currentColor',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--arrow-right '.concat(t||'')},r),{},{children:Ur('path',{d:'M10.273 4.427 6.66.954a.55.55 0 0 0-.387-.153.56.56 0 0 0-.387.153l-.328.316a.52.52 0 0 0 0 .749l2.107 2.03H.973a.524.524 0 0 0-.54.517v.446c0 .29.238.54.54.54H7.69L5.56 7.594a.505.505 0 0 0 0 .74l.327.314c.103.099.24.153.387.153a.56.56 0 0 0 .387-.154l3.612-3.473a.513.513 0 0 0 0-.747'})}))},sa=['className'],la=e=>{let{className:t}=e,r=o(e,sa);return Ur('svg',n(n({width:11,height:11,viewBox:'0 0 11 11',fill:'currentColor',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--x '.concat(t||'')},r),{},{children:[Ur('path',{d:'M1.45 10.572a.92.92 0 0 1-.655-.221.92.92 0 0 1 0-1.299l7.82-7.82a.921.921 0 0 1 1.344 1.253l-7.865 7.866a.92.92 0 0 1-.645.22'}),Ur('path',{d:'M9.26 10.572a.92.92 0 0 1-.645-.267l-7.82-7.82a.921.921 0 0 1 1.299-1.298l7.865 7.82a.92.92 0 0 1 0 1.344.92.92 0 0 1-.7.22'})]}))},ca=['className'],ua=e=>{let{className:t}=e,r=o(e,ca);return Ur('svg',n(n({width:'1.5em',height:'1.5em',viewBox:'0 0 24 24',xmlns:'http://www.w3.org/2000/svg',fill:'currentColor',className:'rf-icon rf-icon--spinner '.concat(t||'')},r),{},{children:Ur('g',{children:[Ur('path',{opacity:.14,d:'M11 1h2v5h-2z'}),Ur('path',{opacity:.29,d:'m16.634 1.974 1.732 1-2.5 4.33-1.732-1z'}),Ur('path',{opacity:.43,d:'m21.026 5.634 1 1.732-4.33 2.5-1-1.732z'}),Ur('path',{opacity:.57,d:'M23 11v2h-5v-2z'}),Ur('path',{opacity:.71,d:'m22.026 16.634-1 1.732-4.33-2.5 1-1.732z'}),Ur('path',{opacity:.86,d:'m18.366 21.026-1.732 1-2.5-4.33 1.732-1z'}),Ur('path',{d:'M13 23h-2v-5h2z'}),Ur('animateTransform',{attributeName:'transform',type:'rotate',calcMode:'discrete',dur:'0.75s',values:'0 12 12;30 12 12;60 12 12;90 12 12;120 12 12;150 12 12;180 12 12;210 12 12;240 12 12;270 12 12;300 12 12;330 12 12;360 12 12',repeatCount:'indefinite'})]})}))},da=['children','className','icon','variant','pending','disabled','iconPosition'],ha=Gi('disabled:cursor-not-allowed h-12 rounded-md text-base font-medium flex items-center justify-center whitespace-nowrap gap-2 px-8 relative transition-all duration-300 ease-in-out [--icon-width:auto] [--icon-height:0.65em] desktop:[--icon-height:0.75em]',{variants:{variant:{primary:'bg-button-background text-button-foreground disabled:!bg-button-background-disabled disabled:!text-button-foreground-disabled desktop:hover:opacity-80',outline:'border border-neutral-2 text-black bg-transparent disabled:!text-button-foreground-disabled desktop:hover:opacity-80',ghost:'text-neutral-3 font-normal gap-1 disabled:!opacity-50 disabled:cursor-not-allowed desktop:hover:opacity-80'}}});var fa=Rn(e=>{let{children:t,className:r,icon:i,variant:a='primary',pending:s=!1,disabled:l=!1,iconPosition:c='right'}=e,u=o(e,da);return Ur('button',n(n({'aria-busy':s,disabled:l||s,type:'button',className:qe(ha({variant:a}),'rf-button','rf-button--'.concat(a),r)},u),{},{children:[s&&Ur(ua,{className:'absolute inset-0 m-auto'}),Ur('span',{className:'rf-button__text',style:{visibility:s?'hidden':'visible'},children:t}),!!i&&Ur(i,{style:{visibility:s?'hidden':'visible'},className:qe('rf-button__icon w-[var(--icon-width)] h-[var(--icon-height)]','left'===c?'-order-1':'order-1')})]}))});const ma=['className'],pa=['className'];var ga={Accept:e=>{let{className:t}=e,r=o(e,ma);return Ur(fa,n({className:qe('rf-dialog-button rf-dialog__button rf-dialog__button--accept w-full',t),icon:aa},r))},Reject:e=>{let{className:t}=e,r=o(e,pa);return Ur(fa,n({className:qe('rf-dialog-button rf-dialog__button rf-dialog__button--reject w-full',t),variant:'outline',icon:la,iconPosition:'left'},r))}};const _a={Modal:e=>{let{isOpen:t,onClose:r,fadeIn:i=!0,showBackdrop:a=!0,dismissOnBackdropClick:s=!0,dismissOnEscape:l,className:c}=e,u=o(e,ra);const d=(()=>{const e=En($i);if(!e)throw new Error('useRoot must be used within a RootProvider');return()=>e.current||document.getElementById(Nr)})(),h=Qi();if(vn(()=>{const e=e=>{'Escape'===e.key&&(e.preventDefault(),null==r||r())};return l&&(t?document.addEventListener('keydown',e):document.removeEventListener('keydown',e)),()=>{l&&document.removeEventListener('keydown',e)}},[l,r,t]),!t||!h)return null;const f=d();if(!f)return Ve.error('Root element not found'),null;const m={isOpen:t,onClose:r};return function(e,t){var r=jt(jn,{__v:e,h:t});return r.containerInfo=t,r}(Ur(ta,{className:i?'animate-fade-in':void 0,isVisible:a,onClick:s?r:void 0,children:Ur(Ji.Provider,{value:m,children:Ur('div',n({className:qe('rf-dialog m-auto w-full p-8 rounded-lg bg-white shadow-lg max-w-2xl',c)},u))})}),f)},Title:e=>{let{className:t}=e,r=o(e,na);return Ur('h2',n({className:qe('rf-dialog__title text-2xl font-medium leading-tight',t)},r))},Subtitle:e=>{let{className:t}=e,r=o(e,oa);return Ur('p',n({className:qe('rf-dialog__subtitle text-neutral-3 py-2.5 leading-tight',t)},r))},Accept:ga.Accept,Reject:ga.Reject},va=()=>{const{config:{isFirstLoad:e}}=Pi(),[t,r]=_n(null);return Ii(t=>{if(t(),function(){const e=window.location.pathname;return e.includes('/cart')||e.includes('/checkout')}())r('cart_detection');else if(!e){const e=De(Re);e&&Date.now()>e&&(Fe(Re),r('cookie_detection'))}},[]),t?Ur(ba,{decisionState:t}):null};function ba(e){let{decisionState:t}=e;const r=Ci('dialog.return_decision.'.concat(t)),{widgetViewState:o}=Pi(),a=function(){const e=Ti(arguments.length>0&&void 0!==arguments[0]&&arguments[0]),t=()=>e.set(!1);return{register:()=>({isOpen:e.value,onClose:t}),state:e}}(!0),s=a.register();return Ur(_a.Modal,n(n({className:'text-center flex flex-col gap-2 items-center'},s),{},{children:[Ur(Yi,{}),Ur(_a.Title,{children:r('title')}),Ur(_a.Subtitle,{children:r('subtext')}),Ur(_a.Accept,{onClick:function(){s.onClose(),'cart_detection'===t&&o.set(i.Open)},children:r('confirm')}),Ur(_a.Reject,{onClick:function(){Ri.exit()},children:r('reject')})]}))}const ya=()=>Ur(qt,{children:Ur(va,{})}),wa=5e3,Ea=pr({}),Na=()=>{const e=En(Ea);if(!e)throw new Error('useToast must be used within a ToastProvider');return e},xa=()=>{const{widgetViewState:e,config:t}=Pi(),r=Oi(),n=Na();vn(()=>(function(e){let{widgetViewState:t,returnContext:r,toastContext:n,config:o}=e;mt.widgetViewState=t,mt.returnContext=r,mt.toastContext=n,mt.config=o,mt.isInitialized=!0,wt('ready')}({widgetViewState:e,returnContext:r,toastContext:n,config:t}),()=>{pt()}),[e,r,n,t]),vn(()=>{e.value===i.Open?wt('drawer:open'):wt('drawer:close')},[e.value]),vn(()=>{var e;const t=null===(e=r.cartState.value.data)||void 0===e?void 0:e.original;t&&wt('cart:updated',t)},[r.cartState.value.data]),vn(()=>{const e=r.calculationState.value.data;e&&wt('calculation:updated',e)},[r.calculationState.value.data])};var ka;(e=>{e.Unknown='unknown_error',e.NetworkError='network_error',e.ProductLimit='product_limit'})(ka||(ka={}));const Ca={422:ka.ProductLimit};function Sa(e){return null!==e&&e in Ca?Ca[e]:ka.Unknown}function Ta(e){var t;Ve.info('Initializing fetch interceptor');const r=window.fetch;null!==(t=window.__rf_original_fetch)&&void 0!==t||(window.__rf_original_fetch=r),window.fetch.rf_interception=!0;const n=new Proxy(r,{apply:async(t,r,n)=>{const o=n[0],i=await Reflect.apply(t,r,n),a=null==i?void 0:i.clone();return null==e||e({response:a,requestUrl:o}),i}});return window.fetch=n,e=>{window.__rf_original_fetch&&(Ve.info('Resetting fetch interceptor'),window.fetch=window.__rf_original_fetch,window.fetch.rf_interception=!1,e&&clearInterval(e))}}function Ia(e){var t;Ve.info('Initializing XHR interceptor');const r=window.XMLHttpRequest;null!==(t=window.__rf_original_xhr)&&void 0!==t||(window.__rf_original_xhr=r);const n=new Proxy(r,{construct:function(t,r){const n=new t(...r),o=n.open,i=n.send;let a='';return n.open=function(e,t,r,n,i){return a=t,o.call(this,e,t,null!=r&&r,n,i)},n.send=function(t){const r=n.onreadystatechange;n.onreadystatechange=function(t){if(r&&r.call(this,t),n.readyState===XMLHttpRequest.DONE)try{null==e||e(Aa(n,a))}catch(e){Ve.error('Error in XHR interception callback:',e)}};const o=n.onload;return n.onload=function(t){if(o&&o.call(this,t),n.readyState===XMLHttpRequest.DONE)try{null==e||e(Aa(n,a))}catch(e){Ve.error('Error in XHR interception callback:',e)}},i.call(this,t)},n}});return window.XMLHttpRequest.rf_interception=!0,window.XMLHttpRequest=n,e=>{window.__rf_original_xhr&&(Ve.info('Resetting XHR interceptor'),window.XMLHttpRequest=window.__rf_original_xhr,window.XMLHttpRequest.rf_interception=!1,e&&clearInterval(e))}}function Aa(e,t){var r;let n;const o='text'===e.responseType,i='json'===e.responseType||(null===(r=e.getResponseHeader('Content-Type'))||void 0===r?void 0:r.includes('application/json'));if(o)try{n=JSON.parse(e.response)}catch(e){}else i&&(n=e.response);return{response:n,requestUrl:t}}const Pa=['/cart/add','/cart/add.js'],Ra=['/cart/update','/cart/update.js'],Ha=['/cart/change','/cart/change.js'],Oa={add:Pa,update:Ra,change:Ha},La=[...Pa,...Ra,...Ha,'/cart/clear','/cart/clear.js','/?section_id=cart-drawer','/api/unstable/graphql.json?operation_name=cartQuery'];const Ba=pr({}),Ma=()=>{const e=En(Ba);if(!e)throw new Error('useErrors must be used within an ErrorProvider');return e},Da=()=>{const e=Ci(),{add:t}=Na(),{cartState:r,orderState:o,calculationState:i}=Oi(),{config:{data:{returnData:a}}}=Pi(),s=Ma(),l=yn(()=>{var e;return null!==(e=null==a?void 0:a.items)&&void 0!==e?e:[]},[null==a?void 0:a.items]),c=wn((e,t)=>{const r=null==t?void 0:t.items.find(t=>t.variant_id===e.variant_id);return!r||r.quantity!==e.quantity},[]),u=wn((r,n)=>{const o=r.excludedItems.filter(e=>c(e,n)),i=r.bundleItems.filter(e=>c(e,n));o.length>0&&t({tone:'error',message:e.rich('toast.product_exchange_error',{product_name:o[0].title,b:e=>Ur('span',{className:'text-neutral-3 inline-block',children:e})})}),i.length>0&&t({tone:'error',message:e.rich('toast.bundle_exchange_error',{product_name:i[0].title,b:e=>Ur('span',{className:'text-neutral-3 inline-block',children:e})})})},[c,e,t]);return{fetchAndUpdateCart:wn(async()=>{var e,t;const i=o.value.data;if(!i)return null;const a=null!==(e=null===(t=r.value.data)||void 0===t?void 0:t.original)&&void 0!==e?e:null;let s;try{s=await nt(!1)}catch(e){return r.set(t=>n(n({},t),{},{pending:!1,error:e})),null}const l=i.orderData.productRules,c=tt(s,l);u(c,a);const d=!a||!rt({cart1:a,cart2:s,rules:l});return r.set({data:{original:s,transformed:c.cart},pending:!1,error:null}),st(s),{order:i,originalCart:a,freshCart:s,transformedCart:c.cart,productRules:l,hasChanged:d}},[o,r,u]),processCartUpdate:wn(async e=>{var t,n;const a=o.value.data;if(!a)return null;const s=null!==(t=null===(n=r.value.data)||void 0===n?void 0:n.original)&&void 0!==t?t:null,c=a.orderData.productRules,d=tt(e,c);return u(d,s),r.set({data:{original:e,transformed:d.cart},pending:!1,error:null}),st(e),await i.query({cart:d.cart,orderId:a.orderData.id,lineItems:l}),{transformedCart:d.cart,productRules:c}},[o,r,i,l,u]),handleResponseErrors:wn(async t=>{const r=await async function(e){if(e){if(e instanceof Response)return await e.json().catch(()=>{});if('string'==typeof e)try{return JSON.parse(e)}catch(e){return}return e}}(t);if(r){let t;if('status'in r){const e=r.status;t='number'==typeof e?e:void 0}if(t&&!s.has(t)){const r=Sa(t);s.push({id:r,message:e('product.error.'.concat(r))})}}},[e,s]),triggerCalculation:wn((e,t)=>{i.query({cart:e,orderId:t,lineItems:l})},[i,l])}},Fa=()=>{const{widgetViewState:e,returnViewState:t,config:{options:{autoOpen:r,autoOpenTriggerEndpoint:n,autoOpenTriggerMethod:o,monitorNetworkOverwrites:s,networkInterceptionMethod:l}}}=Pi(),{fetchAndUpdateCart:c,handleResponseErrors:u,triggerCalculation:d}=Da(),[h,f]=_n(!1);vn(()=>{if('none'!==l){let e;try{e=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{monitor:r=!1,method:n}=t;if('none'===n)return Ve.warn('Network interception method set to \'none\'; skipping interceptor initialization.'),()=>{};let o,i,a,s;switch(n){case'fetch':a='fetch',o=Ta(e);break;case'xhr':a='xhr',i=Ia(e);break;default:a='both',o=Ta(e),i=Ia(e)}return Ve.info('Using network interception method: '.concat(a)),r&&(Ve.info('Monitoring network interceptors'),s=setInterval(()=>{o&&!window.fetch.rf_interception&&(Ve.info('Re-initializing fetch interceptor'),o(s),o=Ta(e)),i&&!window.XMLHttpRequest.rf_interception&&(Ve.info('Re-initializing XHR interceptor'),i(s),i=Ia(e))},200)),()=>{var e,t;null===(e=o)||void 0===e||e(s),null===(t=i)||void 0===t||t(s)}}(e=>Tr.publish(Cr.FetchInterception,e),{monitor:s,method:l}),f(!0)}catch(e){Ve.error('Error initializing fetch interceptor:',e)}return()=>{var t;null===(t=e)||void 0===t||t()}}f(!1)},[s,l]);const m=wn(async s=>{let{detail:{response:l,requestUrl:h}}=s;const f=h instanceof URL?h.toString():h,m=function(e,t){const r=Oa[null!=t?t:'add'];if(!e||'string'!=typeof e)return{isValid:!1,isForbidden:!1,isTriggerEndpoint:!1,triggerEndpointPaths:r};const n=['?_','rf=true'].some(t=>e.includes(t)),o=La.some(t=>e.includes(t)),i=r.some(t=>e.includes(t));return!n&&o?{isValid:!0,isForbidden:!1,isTriggerEndpoint:i,triggerEndpointPaths:r}:{isValid:!1,isForbidden:n,isTriggerEndpoint:i,triggerEndpointPaths:r}}(f,n),{isValid:p,isForbidden:g,isTriggerEndpoint:_}=m;if(!p||g)return void Ve.info('Intercepted request to '.concat(f,' is invalid or forbidden.'),m);Ve.info('Intercepted request to '.concat(f),m);const v=await c();if(!v)return;const{transformedCart:b,hasChanged:y}=v;switch(await u(l),y&&d(b,v.order.orderData.id),o){case'change':if(!y)return;break;case'endpoint':if(!_)return;break;default:if(!_||!y)return}t.set(a.Collapsed),!1!==r&&e.set(i.Open)},[c,u,d,e,t,r,n,o]);return vn(()=>{const e=Tr.subscribe(Cr.FetchInterception,m);return()=>{e()}},[m]),{initialized:h}},Ua=()=>{const{widgetViewState:e,config:{options:{overrideScrollBlocking:t}}}=Pi();vn(()=>{if(!t)return;Ve.info('Overriding scroll blocking behavior');const e=Event.prototype.preventDefault;return Event.prototype.preventDefault=function(){'wheel'!==this.type&&'mousewheel'!==this.type&&'DOMMouseScroll'!==this.type&&'touchmove'!==this.type&&e.call(this)},()=>{Event.prototype.preventDefault=e}},[t,e.value])};const Ga=()=>{const{widgetViewState:e,config:{options:{cartActivatorSelector:t}}}=Pi();vn(()=>{if(!t)return;const r=new AbortController,n=new WeakSet,o=t=>{Ve.info('Cart activator clicked',t),t.preventDefault(),t.stopPropagation(),e.set(i.Open)},a=()=>{try{const e=document.querySelectorAll(t);e.length>0&&(Ve.info('Attaching click listeners to cart activators',e),(e=>{e.forEach(e=>{if(!n.has(e))try{const t=(e=>{const t=e.parentNode;if(t){const r=e.cloneNode(!0);return t.replaceChild(r,e),r}return e})(e);t.removeAttribute('onclick'),t.addEventListener('click',o,{signal:r.signal}),n.add(t)}catch(e){Ve.error('Failed to attach listener to cart activator',e)}})})(e))}catch(e){Ve.error('Failed to set cart activator selector',e)}};a();const s=new MutationObserver(e=>{let r=!1;e.forEach(e=>{e.addedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){var n,o;const i=e;null!==(n=i.matches)&&void 0!==n&&n.call(i,t)&&(r=!0),(null===(o=i.querySelectorAll)||void 0===o?void 0:o.call(i,t).length)>0&&(r=!0)}}),e.removedNodes.forEach(e=>{if(e.nodeType===Node.ELEMENT_NODE){var r,n;const o=e;null!==(r=o.matches)&&void 0!==r&&r.call(o,t)||null===(n=o.querySelectorAll)||void 0===n||n.call(o,t).length}})}),r&&(Ve.info('Reinitializing cart activators'),setTimeout(()=>{a()},0))});return s.observe(document.body,{childList:!0,subtree:!0,attributes:!1,characterData:!1}),()=>{r.abort(),s.disconnect()}},[t,e])},za=()=>(Fa(),Ga(),Ua(),(()=>{const{widgetViewState:e}=Pi(),{fetchAndUpdateCart:t,triggerCalculation:r}=Da(),n=wn(()=>{e.set(i.Open)},[e]),o=wn(()=>{e.set(i.Collapsed)},[e]),a=wn(()=>{let t;t=e.value===i.Open?i.Collapsed:i.Open,e.set(t)},[e]),s=wn(async()=>{const e=await t();null!=e&&e.hasChanged&&r(e.transformedCart,e.order.orderData.id)},[t,r]),l=wn(async()=>{await t()},[t]),c=wn(async()=>{const e=await t();null!=e&&e.hasChanged&&r(e.transformedCart,e.order.orderData.id)},[t,r]),u=wn(async()=>{const e=await t();null!=e&&e.hasChanged&&(n(),r(e.transformedCart,e.order.orderData.id))},[t,n,r]);vn(()=>{const e=Tr.subscribe(Sr.DrawerOpen,n),t=Tr.subscribe(Sr.DrawerClose,o),r=Tr.subscribe(Sr.DrawerToggle,a),i=Tr.subscribe(Sr.CalculationRefetch,s),d=Tr.subscribe(Sr.CartRefetch,l),h=Tr.subscribe(Sr.CartAndCalculationRefetch,c),f=Tr.subscribe(Sr.DrawerOpenAndRefetch,u);return()=>{e(),t(),r(),i(),d(),h(),f()}},[n,o,a,s,l,c,u])})(),xa(),null),ja=e=>{let{children:t}=e;return Qi()?t:null},Va=['array'],qa=e=>{var t,r,i,a;let{children:s}=e;const l=Ci(),c=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const[t,r]=_n(e),n=wn(e=>{r(e)},[]),o=wn(e=>{r(t=>{if(Array.isArray(e)){const r=e.filter(e=>!t.some(t=>t.id===e.id));return[...t,...r]}return t.some(t=>t.id===e.id)?t:[...t,e]})},[]),i=wn(e=>{r(t=>t.filter(t=>t.id!==e))},[]),a=wn(()=>{r([])},[]),s=wn(e=>t.some(t=>t.id===e),[t]);return{array:t,set:n,push:o,remove:i,clear:a,has:s}}(),{array:u}=c,d=o(c,Va),{cartState:h,orderState:f,calculationState:m}=Oi(),p=null===(t=f.value.data)||void 0===t?void 0:t.orderData,g=null===(r=m.value.data)||void 0===r?void 0:r.lineItems,_=null!==(i=null===(a=h.value.data)||void 0===a?void 0:a.transformed.item_count)&&void 0!==i?i:0,v=yn(()=>{const e=[];if(p&&g&&Array.isArray(g)){var t;const{refundReturnWindow:r=!0}=null!==(t=p.returnWindows)&&void 0!==t?t:{},n='refund-window-expired';if(!r&&0===_){const t=l('product.error.refund_expired');e.push({id:n,message:t,blocking:!0})}const o=et(p.productRules,'NO_REFUND'),i=g.filter(e=>{const t=Qe(e.productId);return!!t&&o.includes(Number(t))});if(i.length>0&&0===_){const t=i.map(e=>{const t=p.productsToExchange.find(t=>t.id===e.id);if(!t)return null;let r=t.title;return t.variantTitle&&(r+=' ('.concat(t.variantTitle,')')),r}).filter(Boolean).join(', '),r=l.rich('product.error.no_refund',{product_name:t,b:e=>{if(!e)return null;const t=e.toString().split(', ');return t.map((e,r)=>{let n=null;return r===t.length-2?n=' '.concat(l('common.and'),' '):r<t.length-1&&(n=', '),Ur(qt,{children:[Ur('span',{className:'text-neutral-3',children:e}),n]},r)})}});e.push({id:n,message:r,blocking:!0})}}return e.concat(u)},[u,p,g,_,l]),b=n({errors:v},d);return Ur(Ba.Provider,{value:b,children:s})},Wa=e=>{const{id:t,initialValue:r=null,queryFn:o,queryOnInit:i=!0,onError:a,startCount:s=0}=e,[l,c]=_n({data:r,pending:i,error:null}),u=bn(!0),[d,h]=_n(s),f=bn(d),m=wn(function(){for(var e=arguments.length,r=new Array(e),i=0;i<e;i++)r[i]=arguments[i];const s=r[0],l=f.current+1;f.current=l,h(l),c(e=>n(n({},e),{},{pending:!0,error:null}));return(async()=>{try{Ve.info('AsyncState Query Started (Count: '.concat(l,')'),t?' (ID: '.concat(t,')'):'');const e=await(0===r.length?o(l):o(l,s));return f.current!==l?(Ve.info('AsyncState Query Stale - Ignoring (Count: '.concat(l,', Current: ').concat(f.current,')'),t?' (ID: '.concat(t,')'):''),null):(c({data:e,pending:!1,error:null}),Ve.info('AsyncState Query Resolved (Count: '.concat(l,')'),t?' (ID: '.concat(t,')'):'',e),e)}catch(e){if(f.current!==l)return null;const r=e;let n='AsyncState Query Failed (Count: '.concat(l,')');return t&&(n+=' (ID: '.concat(t,')')),Ve.error(''.concat(n,':'),'['.concat(r,']'),s),c({data:null,pending:!1,error:r}),null==a||a(r),null}})()},[o,t,a]);vn(()=>{if(u.current&&i){u.current=!1;void 0!==e&&'initialParams'in e?m(e.initialParams):m()}},[m,i,e]);const p=l.pending&&null===l.data;return{value:l,set:c,query:m,count:d,initialFetch:p}},Xa=e=>{var t;let{children:r}=e;const{returnViewState:n,config:o}=Pi(),i=o.isFirstLoad,s=Wa({id:'cart',queryOnInit:!1,queryFn:async(e,t)=>{const r=window.location.pathname.startsWith('/cart'),o=1===e,i=!o||r,s=await nt(!i);0!==s.item_count&&o&&n.set(a.Collapsed);const{cart:l}=tt(s,t.orderData.productRules);return{transformed:l,original:s}}}),l=Wa({id:'order',queryFn:async()=>{const e=await Rr(o);if(e.updatedCart&&i){const{cart:t}=tt(e.updatedCart,e.orderData.productRules);s.set({data:{original:e.updatedCart,transformed:t},pending:!1,error:null})}else s.query(e);return e}}),c=Wa({id:'calculation',queryOnInit:!1,queryFn:async(e,t)=>{var r,n,i;const a=o.id,s=(null===(r=t.cart)||void 0===r?void 0:r.items)||[];if(a){const{origin:e,pathname:t,search:r}=window.location,n=new URLSearchParams(r);n.set(wr,a);!async function(e,t){try{Ve.info('Setting session cache for internalId:',e,t);const r=await Pr('/shop-overlay/session/'.concat(e),{method:'PATCH',body:{data:t}});return Ve.info('Session cache set successfully:',r),r}catch(e){throw Ve.error('Error setting session cache:',e),e}}(a,{lastPath:''.concat(e).concat(t,'?').concat(n.toString()),returnItems:Array.isArray(s)?s.map(e=>{var t,r;return{variantId:e.variant_id,handle:e.handle,price:(r=e.price,We(r)?0:r/100),title:e.product_title,variantTitle:null!==(t=e.variant_title)&&void 0!==t?t:'',image:e.image,quantity:e.quantity||1}}):[]})}return async function(e,t){let{orderId:r,cart:n,lineItems:o}=e;const i=(o||[]).map(e=>{var t,r;let n=null!==(t=null===(r=e.action)||void 0===r?void 0:r.toUpperCase())&&void 0!==t?t:'EXCHANGE';return'SWAP'===n&&(n='EXCHANGE'),{id:e.id,returnOrderLineId:e.id,lineItemId:e.lineItemId,quantity:1,action:n}}),a=(n.items||[]).map(e=>({variantId:'gid://shopify/ProductVariant/'.concat(e.variant_id),quantity:e.quantity}));return Pr('/calculation/'.concat(r),{method:'POST',body:{lineItems:i,exchangeTo:a,numOfLabels:t}})}(t,null!==(n=null===(i=o.data.returnData)||void 0===i?void 0:i.numOfLabels)&&void 0!==n?n:1)}}),[u]=Ii(e=>{var t;const r=l.value.data,n=null===(t=s.value.data)||void 0===t?void 0:t.transformed;if(r&&n){var i,a;e();const t=null!==(i=null===(a=o.data.returnData)||void 0===a?void 0:a.items)&&void 0!==i?i:[];c.query({cart:n,orderId:r.orderData.id,lineItems:t})}},[l.value.data,s.value.data,c.query,null===(t=o.data.returnData)||void 0===t?void 0:t.items]),d=!u||s.value.pending||c.value.pending,h=yn(()=>l.value.error||s.value.error||c.value.error,[l.value.error,s.value.error,c.value.error]),f=Boolean(h),m=yn(()=>({orderState:l,cartState:s,calculationState:c,isPending:d,hasFailed:f}),[l,s,c,d,f]);return Ur(Hi.Provider,{value:m,children:r})},Ka=()=>{const{config:{theme:e}}=Pi(),t=yn(()=>{if(e)return Object.entries(e).reduce((e,t)=>{let[r,n]=t;const o=function(e){e=e.replace('#','');const t=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,n=parseInt(e.substring(4,6),16)/255,o=Math.max(t,r,n),i=Math.min(t,r,n),a=o-i,s=(o+i)/2;let l=0,c=0;if(0!==a)switch(c=s>.5?a/(2-o-i):a/(o+i),o){case t:l=((r-n)/a+(r<n?6:0))/6;break;case r:l=((n-t)/a+2)/6;break;case n:l=((t-r)/a+4)/6}const u=Math.round(360*l),d=Math.round(100*c),h=Math.round(100*s);return''.concat(u,', ').concat(d,'%, ').concat(h,'%')}(n);return e['--'.concat(r)]=o,e},{})},[e]);return{theme:e,cssVariables:t}},Za=e=>{const t=bn(null),{cssVariables:r}=Ka();return Ur($i.Provider,{value:t,children:Ur('div',n({onTouchStart:e=>e.stopPropagation(),className:'rf-root',ref:t,id:Nr,style:r},e))})},Ya=['children'],Ja=e=>{let{children:t}=e,r=o(e,Ya);const n=Ti(i.Collapsed,e=>{Tr.publish(Cr.DrawerStateChange,{state:e}),document.querySelectorAll('[inert]').forEach(e=>{e.removeAttribute('inert')})}),s=Ti(a.Open),l=yn(()=>({widgetViewState:n,returnViewState:s,config:r}),[n,s,r]);return Ur(Ai.Provider,{value:l,children:t})},Qa=['duration'],$a=e=>{let{children:t}=e;const[r,i]=_n([]),a=wn(e=>{i(t=>t.map(t=>{var r;t.id===e&&(null===(r=t.onClose)||void 0===r||r.call(t));return t.id===e?n(n({},t),{},{isVisible:!1}):t})),setTimeout(()=>{i(t=>t.filter(t=>t.id!==e))},300)},[]),s=wn(e=>{let{duration:t=wa}=e,r=o(e,Qa);const s=r.id||'toast-'.concat(Math.random().toString(36).substr(2,9));return i(e=>[...e,n(n({},r),{},{id:s,duration:t,isVisible:!0})]),setTimeout(()=>a(s),t),s},[a]),l=wn(()=>{i(e=>e.map(e=>{var t;return null===(t=e.onClose)||void 0===t||t.call(e),n(n({},e),{},{isVisible:!1})})),setTimeout(()=>{i([])},300)},[]),c={queue:r,add:s,remove:a,clear:l};return Ur(Ea.Provider,{value:c,children:t})};const es=['className'],ts=e=>{let{className:t}=e,r=o(e,es);return Ur('svg',n(n({width:21,height:21,viewBox:'0 0 21 21',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--action '.concat(t||'')},r),{},{children:[Ur('rect',{x:.5,y:.679,width:20,height:20,rx:10,className:'fill-[var(--icon-fill-1,_#000)]'}),Ur('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M11.517 6.04q.088.055.127.157c.025.066.03.14.013.209l-.775 3.13h2.826q.088 0 .16.052a.3.3 0 0 1 .108.14.35.35 0 0 1-.055.348l-4.083 4.822a.3.3 0 0 1-.168.098.27.27 0 0 1-.187-.037.3.3 0 0 1-.127-.156.35.35 0 0 1-.013-.21l.775-3.129H7.292a.27.27 0 0 1-.16-.053.3.3 0 0 1-.108-.14.35.35 0 0 1 .055-.348l4.083-4.821a.3.3 0 0 1 .168-.098.27.27 0 0 1 .187.037',className:'fill-[var(--icon-fill-2,_#fff)]'})]}))},rs=['className'],ns=e=>{let{className:t}=e,r=o(e,rs);return Ur('svg',n(n({width:21,height:21,viewBox:'0 0 21 21',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--info '.concat(t||'')},r),{},{children:[Ur('path',{className:'fill-[var(--icon-fill-2,_#fff)]',d:'M6.856 4.628h7.288v12.226H6.856z'}),Ur('path',{className:'fill-[var(--icon-fill-1,_#000)]',d:'M17.572 3.67C13.666-.235 7.335-.236 3.429 3.67c-3.905 3.905-3.905 10.237 0 14.143 3.905 3.904 10.237 3.904 14.143 0 3.905-3.906 3.904-10.238 0-14.143m-5.768 11.419a1.304 1.304 0 1 1-2.609 0V9.87a1.304 1.304 0 1 1 2.61 0zm-1.327-7.447c-.752 0-1.252-.532-1.237-1.19-.015-.688.485-1.204 1.252-1.204s1.252.516 1.268 1.205c0 .657-.5 1.189-1.283 1.189'})]}))},os=['className'],is=e=>{let{className:t}=e,r=o(e,os);return Ur('svg',n(n({width:20,height:15,viewBox:'0 0 20 15',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--giftcard fill-[var(--icon-fill-1,_currentColor)] '.concat(t||'')},r),{},{children:[Ur('path',{d:'M8.23 3.129c-.288 0-.602.11-.82.37-.284.342-.373 1.362-.363 1.877.48.012 1.4-.001 1.771-.395.39-.411.496-1.13.082-1.568a.9.9 0 0 0-.67-.284m-3.666 0c.288 0 .603.11.82.37.284.342.373 1.362.363 1.877-.48.012-1.399-.001-1.77-.395-.39-.411-.496-1.13-.083-1.568a.9.9 0 0 1 .67-.284'}),Ur('path',{d:'M9.806 2.447c.73.773.828 1.99.328 2.929H20V1.948C20 .872 19.178 0 18.165 0H7.038v2.103c.9-.54 2.036-.43 2.768.344.417.44-.732-.775 0 0M4.347 9.21l-.91-.962L4.85 6.74H0v6.312C0 14.128.821 15 1.835 15h3.919V7.71zm3.589-2.47L9.33 8.236l-.912.959-1.38-1.48V15h11.126C19.18 15 20 14.128 20 13.052V6.74zM2.659 5.376c-.5-.939-.403-2.157.327-2.929.732-.775 1.869-.883 2.768-.344V0h-3.92C.822 0 0 .872 0 1.948v3.428z'})]}))},as=['className'],ss=e=>{let{className:t}=e,r=o(e,as);return Ur('svg',n(n({width:30,height:27,viewBox:'0 0 30 27',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--warning fill-[var(--icon-fill-1,_#000)] '.concat(t||'')},r),{},{children:[Ur('path',{d:'M15 18.904c-.81 0-1.49.68-1.49 1.49s.68 1.489 1.49 1.489c.78 0 1.489-.68 1.453-1.454A1.454 1.454 0 0 0 15 18.904'}),Ur('path',{d:'M28.784 24.182a5.09 5.09 0 0 0 .012-5.147L19.467 2.88A5.07 5.07 0 0 0 15.006.289c-1.87 0-3.539.97-4.462 2.585l-9.34 16.173a5.13 5.13 0 0 0 .017 5.177 5.1 5.1 0 0 0 4.45 2.555h18.633c1.865 0 3.539-.97 4.48-2.597m-2.025-1.167a2.82 2.82 0 0 1-2.46 1.423H5.665a2.78 2.78 0 0 1-2.43-1.394 2.82 2.82 0 0 1-.006-2.841l9.34-16.167a2.76 2.76 0 0 1 2.437-1.412c1.018 0 1.93.53 2.436 1.417l9.335 16.168c.5.87.494 1.918-.018 2.806'}),Ur('path',{d:'M14.63 8.45c-.709.202-1.15.846-1.15 1.626.036.47.066.947.102 1.418l.303 5.343A1.09 1.09 0 0 0 15 17.886c.608 0 1.085-.471 1.114-1.085 0-.369 0-.708.036-1.084.066-1.15.137-2.3.203-3.449.035-.744.101-1.49.137-2.234a1.8 1.8 0 0 0-.137-.744 1.49 1.49 0 0 0-1.722-.84'})]}))},ls=()=>Ur(Wi,{className:'rf-banner-skeleton h-12 rounded-lg'}),cs=['className','children','tone','border','icon','pending'],us=Gi('rf-banner text-black rounded-lg flex items-center gap-2.5 p-3 min-h-12 font-medium leading-tight',{variants:{tone:{info:'rf-banner--info bg-banner-info-background [--icon-fill-1:hsl(var(--rf-c-banner-info-foreground))]',tip:'rf-banner--tip bg-banner-tip-background [--icon-fill-1:hsl(var(--rf-c-banner-tip-foreground))]',action:'rf-banner--action bg-banner-action-background [--icon-fill-1:hsl(var(--rf-c-banner-action-foreground))]',error:'rf-banner--error bg-banner-error-background [--icon-fill-1:hsl(var(--rf-c-banner-error-foreground))]',giftcard:'rf-banner--giftcard bg-[#F1F3FE] [--icon-fill-1:hsl(var(--rf-c-primary))]'},border:{dashed:'border border-dashed border-[color:var(--icon-fill-1)]'}},defaultVariants:{tone:'info'}}),ds={className:'rf-banner__icon',width:20,height:20};function hs(e){switch(e){case'action':return Ur(ts,n({},ds));case'error':return Ur(ss,n({},ds));case'giftcard':return Ur(is,n({},ds));default:return Ur(ns,n({},ds))}}var fs=Rn(e=>{var t;let{className:r,children:i,tone:a,border:s,icon:l,pending:c=!1}=e,u=o(e,cs);return Ur(Mi,{skeleton:Ur(ls,{}),pending:c,children:Ur('aside',n(n({className:qe(us({tone:a,border:s}),r)},u),{},{children:[hs(null!==(t=null!=l?l:a)&&void 0!==t?t:'info'),Ur('span',{className:'rf-banner__text flex-1',children:i})]}))})});const ms=()=>{var e,t,r,n;const o=Ci('banner'),{orderState:i,calculationState:a}=Oi(),s=null!==(e=null===(t=i.value.data)||void 0===t?void 0:t.orderData.instantExchange)&&void 0!==e&&e,l=null!==(r=null===(n=a.value.data)||void 0===n?void 0:n.returnLabelPrice)&&void 0!==r?r:0;return i.value.data&&a.value.data?Ur(fs,s?{className:'rf-exchange-banner',tone:'action',children:o('fast_exchange')}:0===l?{className:'rf-exchange-banner',tone:'tip',children:o('free_shipping_label')}:{className:'rf-exchange-banner',children:o('exchange_info')}):Ur(ls,{})},ps=['fractionDigits'],gs=['currencyDisplay'],_s=function(){var e,t;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{config:i}=Pi(),{calculationState:a,cartState:s}=Oi(),l=null===(e=s.value.data)||void 0===e?void 0:e.transformed.currency,c=null===(t=a.value.data)||void 0===t?void 0:t.currency.localCurrency,u=r.currency||c||i.currency||l||'DKK',d=Si(),h=wn((e,t)=>{var r;const n=null===(r=a.value.data)||void 0===r?void 0:r.currency;return e*(null!=t?t:Xe(null==n?void 0:n.exchangeRate,1))},[a.value.data]);return{format:wn((e,t)=>{'string'==typeof e&&(e=parseFloat(e));const i=n(n({},r),t),{fractionDigits:a=2}=i,s=o(i,ps),l=n({currency:u,minimumFractionDigits:a,maximumFractionDigits:a},s),{currencyDisplay:c}=l,h=o(l,gs);return'none'===c?d.number(e,h):d.number(e,n({style:'currency',currencyDisplay:c},h))},[d,r,u]),applyExchangeRate:h,currency:u}},vs=()=>{var e,t;const{applyExchangeRate:r}=_s(),{calculationState:o,cartState:i}=Oi(),a=i.value.data,s=o.value.data;return n({itemCount:null!==(e=null===(t=i.value.data)||void 0===t?void 0:t.transformed.item_count)&&void 0!==e?e:0},yn(()=>{var e;if(!s||!a)return{orderTotal:0,cartTotal:0,returnTotal:0,giftcardValue:0,totalPriceDiscount:0,giftCardBonusAmount:0,returnLabelPrice:0,isRefunding:!1};const{orderSubtotal:t,returnSubtotal:n,total:o,refundMethods:i,discountSummary:l,giftCardBonusAmount:c,returnLabelPrice:u}=s,d=r(null!==(e=null==l?void 0:l.appliedToReturnSubtotal)&&void 0!==e?e:0),h=Xe(r(null==i?void 0:i.giftcard)),f=r(n)-h,m=Math.abs(r(o));return{orderTotal:r(t),cartTotal:f,returnTotal:m,giftcardValue:h,totalPriceDiscount:d,giftCardBonusAmount:r(c),returnLabelPrice:r(u),isRefunding:o>0}},[s,a,r]))},bs=['className'],ys=e=>{let{className:t}=e,r=o(e,bs);return Ur('svg',n(n({width:12,height:12,viewBox:'0 0 13 13',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--star '.concat(t||'')},r),{},{children:Ur('path',{d:'m6.11 1.06 1.7 3.62 3.8.584-2.75 2.817.65 3.979-3.4-1.88-3.398 1.88.649-3.98L.61 5.265l3.8-.584z',fill:'currentColor',stroke:'currentColor',strokeWidth:1.111,strokeLinecap:'round',strokeLinejoin:'round'})}))},ws=['value','compareAtValue','pending','className'];function Es(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return Number(e.toFixed(t))}var Ns=Rn(e=>{let{value:t=0,compareAtValue:r,pending:i,className:a}=e,s=o(e,ws);const{format:l}=_s(),c=!We(r)&&Es(r)>Es(t);return Ur(Mi,{skeleton:Ur(Wi,{className:'w-20'}),pending:i,children:Ur('span',n(n({className:qe('rf-price font-medium text-base inline-flex flex-col items-end',a)},s),{},{children:[Ur('span',{className:'rf-price__value',children:l(t)}),c&&Ur('span',{className:'rf-price__compare-at text-affirmative line-through text-xs',children:l(r)})]}))})});const xs=()=>Ur('div',{className:'rf-adjustments-table-skeleton space-y-2',children:[Ur(Wi,{className:'h-5 w-full'}),Ur(Wi,{className:'h-5 w-full'})]}),ks=()=>{const e=Ci(),{format:t}=_s(),{calculationState:r}=Oi(),{cartTotal:n,giftcardValue:o,giftCardBonusAmount:i,returnLabelPrice:a,totalPriceDiscount:s}=vs(),l=s>0,c=o>0,u=a>0;return r.value.data?Ur('div',{className:'rf-adjustments-table p-base border-t border-neutral-2',children:Ur('table',{className:'rf-adjustments-table__table w-full',children:Ur('tbody',{className:'rf-adjustments-table__body',children:[l&&Ur(Cs,{value:-1*s,className:'text-affirmative',children:e('price_details.price_change')}),u&&Ur(Cs,{value:a,className:'text-neutral-3',children:e('price_details.return_label')}),n>0&&Ur(Cs,{value:n,children:e('price_details.products')}),c&&Ur(Cs,{className:'text-primary',value:o,children:[Ur('span',{className:'align-middle',children:[Ur(is,{className:'inline -mt-1 w-4 h-auto'}),' ',e('price_details.giftcard')]}),i>0&&Ur('span',{className:'text-sm text-reward align-middle',children:['+',t(i),' ',Ur(ys,{className:'inline -mt-0.5'})]})]})]})})}):Ur('div',{className:'rf-adjustments-table-loading p-base border-t border-neutral-2',children:Ur(xs,{})})};function Cs(e){let{value:t,children:r,className:n}=e;return Ur('tr',{className:qe('rf-adjustments-table__row h-6 group/row',n),children:[Ur('th',{scope:'row',className:'rf-adjustments-table__label space-x-2 font-normal text-left group-first/row:pt-0 group-last/row:pb-0 py-0.5',children:r}),Ur('td',{className:'rf-adjustments-table__value text-right',children:Ur(Ns,{value:t})})]})}const Ss=['className'],Ts=e=>{let{className:t}=e,r=o(e,Ss);return Ur('div',n(n({className:qe('rf-exchange-adjustments border-t border-neutral-2',t)},r),{},{children:[Ur('div',{className:'rf-exchange-adjustments__banner p-base',children:Ur(ms,{})}),Ur(ks,{})]}))},Is=()=>{var e;const t=Ci('announcement'),{cartState:r}=Oi(),n=null===(e=r.value.data)||void 0===e?void 0:e.transformed.item_count,o=0===(null!=n?n:0)?'step_1':'step_2';return Ur('div',{className:'rf-announcement-bar h-14 bg-announcement-background text-announcement-foreground px-base flex items-center justify-between text-sm',children:[Ur(Yi,{}),Ur('div',{className:'rf-announcement-bar__content space-x-1',children:[Ur('span',{className:'rf-announcement-bar__step-label text-neutral-3',children:t('this_step')}),Ur('span',{className:'rf-announcement-bar__step-text',children:t(o)})]})]})},As=['className','errorMessage','instructionMessage'],Ps=e=>{let{className:t,errorMessage:r='Der skete en fejl!',instructionMessage:i='Opdater siden og prøv igen.'}=e,a=o(e,As);return Ur('div',n(n({className:qe('rf-error-screen p-base flex-1',t),role:'alert','aria-live':'assertive'},a),{},{children:Ur('div',{className:'rf-error-screen__content bg-[#FEF2F2] rounded-lg p-base flex flex-col items-center justify-center gap-1 text-center size-full',children:[Ur(ss,{className:'mb-2 fill-destructive','aria-hidden':'true'}),Ur('p',{className:'rf-error-screen__message text-neutral-3',id:'error-heading',children:r}),Ur('p',{className:'rf-error-screen__instruction',children:i})]})}))},Rs=()=>{const e=Ni().locale,{config:{data:{slug:t}}}=Pi();if(!t)throw new Error('useNavigation must be used within a WidgetContextProvider with a valid slug');return{back:r=>Ri.back(e,t,r),continue:()=>Ri.continue(e,t),exit:Ri.exit}},Hs=()=>{const e=Ci('confirmation'),t=Rs(),{calculationState:r,isPending:n,hasFailed:o}=Oi(),{isRefunding:i,returnTotal:a}=vs(),{errors:s}=Ma(),l=s.filter(e=>e.blocking),c=!o&&!n&&0===l.length;return Ur('div',{className:'rf-exchange-confirmation rounded-t-2xl bg-neutral-1 p-base pb-safe-offset-base space-y-2',children:[Ur('div',{className:'rf-exchange-confirmation__header flex justify-between items-center pb-2',children:[Ur('h3',{className:'rf-exchange-confirmation__title font-medium',children:e(i?'title_refund':'title_checkout')}),Ur(Ns,{value:a,pending:r.value.pending})]}),Ur(fa,{disabled:!c,onClick:function(){c&&t.continue()},className:'w-full',icon:aa,children:Ur('span',{children:e('confirm')})}),Ur('p',{className:'rf-exchange-confirmation__disclaimer text-sm text-neutral-3 text-center mx-auto font-normal',children:e('disclaimer')})]})},Os=['icon','variant','size','className','children'],Ls=Gi('rf-icon size-8 rounded-full flex items-center justify-center text-2xl p-[9px]',{variants:{variant:{primary:'rf-icon--primary border border-neutral-2 text-black',solid:'rf-icon--solid bg-black text-white','solid-inverse':'rf-icon--solid-inverse bg-neutral-1 text-neutral-3'},size:{sm:'size-7 p-[8px]',md:'size-8 p-[9px]'}},defaultVariants:{variant:'primary',size:'md'}}),Bs=e=>{let{icon:t,variant:r,size:i,className:a,children:s}=e,l=o(e,Os);return Ur('div',n(n({className:qe(Ls({variant:r,size:i}),a)},l),{},{children:[t&&Ur(t,{className:'size-full'}),s]}))},Ms=()=>{const e=Ci('common'),{widgetViewState:t}=Pi();return Ur('div',{className:'rf-exchange-header border-t border-neutral-3 p-base flex items-center justify-between',children:[Ur('h2',{className:'rf-exchange-header__title text-xl font-semibold',children:e('title')}),Ur('button',{className:'rf-exchange-header__close-button flex items-center gap-2 group',onClick:()=>t.set(i.Collapsed),type:'button',children:[Ur('span',{className:'rf-exchange-header__close-text',children:e('close')}),Ur(Bs,{className:'group-hover:bg-neutral-2 transition-colors',icon:la})]})]})},Ds=['className'],Fs=e=>{let{className:t}=e,r=o(e,Ds);return Ur('svg',n(n({width:28,height:27,viewBox:'0 0 28 27',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--cart '.concat(t||'')},r),{},{children:Ur('path',{d:'M8.094 20.443c-1.223-.066-1.2-1.856 0-1.919 3.4.013 12.367.004 15.875.006.96 0 1.78-.68 1.996-1.652l1.992-8.979a1.77 1.77 0 0 0-.316-1.46 1.62 1.62 0 0 0-1.293-.653c-1.41 0-13.39-.057-19.525-.082L5.85 1.947C5.617 1.05 4.83.423 3.936.423H.821C.367.423 0 .805 0 1.277s.367.854.82.854h3.116c.154 0 .29.108.33.262L8 16.818a2.5 2.5 0 0 0-1.732.793 2.7 2.7 0 0 0-.738 1.919c.025 1.445 1.174 2.621 2.563 2.621H9.29a3.1 3.1 0 0 0-.278 1.282c0 1.648 1.289 2.99 2.873 2.99s2.872-1.341 2.872-2.99c0-.459-.1-.893-.277-1.282h5.182a3.1 3.1 0 0 0-.277 1.281c0 1.649 1.288 2.99 2.872 2.99s2.873-1.341 2.873-2.99a3.1 3.1 0 0 0-.299-1.326.85.85 0 0 0 .56-.81c0-.47-.368-.853-.822-.853zm5.023 2.99c0 .706-.552 1.281-1.231 1.281-.68 0-1.232-.575-1.232-1.281 0-.707.552-1.281 1.23-1.282h.003c.678 0 1.23.575 1.23 1.282m9.141 1.28c-.678 0-1.23-.574-1.23-1.28 0-.7.54-1.27 1.21-1.282h.04c.67.011 1.212.582 1.212 1.281 0 .707-.553 1.282-1.232 1.282M26.355 7.5q.005.009.003.015l-.84 3.783h-2.842l.484-3.817 3.182.013q.006-.002.013.006m-8.462 9.322v-3.815h2.91l-.483 3.815zm-4.07 0-.488-3.815h2.916v3.815zm-3.779 0h-.002a.45.45 0 0 1-.428-.341l-.9-3.475h2.965l.488 3.816zm3.073-5.524-.494-3.861 3.628.015v3.846zm4.776 0v-3.84l3.612.016-.485 3.824zM10.966 7.43l.495 3.868H8.27L7.267 7.414zm13.003 9.392h-1.993l.483-3.815h2.68l-.773 3.486a.41.41 0 0 1-.397.329',fill:'currentColor'})}))},Us=()=>{const e=Ci('exchange_placeholder'),{widgetViewState:t}=Pi();return Ur('div',{className:'rf-exchange-placeholder px-base pb-base',children:Ur('div',{className:'rf-exchange-placeholder__content border border-dashed border-[#DDDDDD] h-36 rounded-md flex items-center justify-center flex-col gap-2 font-medium text-base p-base',children:[Ur(Fs,{className:'text-neutral-3'}),Ur('span',{className:'rf-exchange-placeholder__text',children:e('prompt_text')}),Ur('button',{onClick:()=>t.set(i.Collapsed),className:'rf-exchange-placeholder__continue text-button-background decoration-[color:hsla(var(--rf-c-button-background),_0.25)] underline-offset-4 underline text-sm cursor-pointer',type:'button',children:e('continue')})]})})},Gs=()=>{const{errors:e}=Ma();return 0===e.length?null:Ur('div',{className:'rf-product-errors rf-product-view__error-list px-base pb-base space-y-base',children:e.map(e=>{let{id:t,message:r}=e;return Ur(fs,{className:'rf-product-view__error animate-slide-up-and-fade-in',tone:'error',children:r},t)})})},zs=['coverage'],js={min:{limit:1,disabled:!1},max:{limit:99,disabled:!0}};function Vs(e,t){const r='/products/'.concat(t.handle);if(!e)return r;try{const n=e(t);return'string'==typeof n&&n?n:r}catch(e){return r}}const qs=['onIncrement','onDecrement','constraints','quantity','pending','disabled','className'],Ws=e=>{let{onIncrement:t,onDecrement:r,constraints:i=js,quantity:a,pending:s=!1,disabled:l=!1,className:c}=e,u=o(e,qs);const d=s||l,h=a===i.min.limit,f=a===i.max.limit,m=i.max.disabled&&f||d,p=i.min.disabled&&h||d,g=wn(async()=>{if(!m)try{await t(f)}catch(e){Ve.error('Increment failed:',e)}},[m,t,f]),_=wn(async()=>{if(!p)try{await r(h)}catch(e){Ve.error('decrement failed:',e)}},[p,r,h]),v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:js;return Math.max(t.min.limit,Math.min(e,t.max.limit))}(a,i);return Ur('div',n(n({className:qe('rf-quantity-picker rounded-full p-1 border border-neutral-1 flex items-center h-min gap-2 transition-opacity',d&&'rf-quantity-picker--disabled opacity-50 cursor-not-allowed',c)},u),{},{children:[Ur('button',{type:'button',className:'rf-quantity-picker__decrement-button disabled:!opacity-50 desktop:hover:opacity-80 disabled:cursor-not-allowed transition-opacity',disabled:p,onClick:_,children:Ur(Bs,{variant:'solid-inverse',size:'sm',children:Ur('span',{className:'rf-quantity-picker__decrement-icon text-base leading-none -mt-0.5',children:'-'})})}),Ur('div',{className:'rf-quantity-picker__quantity px-1.5 flex-1 text-base',children:v}),Ur('button',{type:'button',className:'rf-quantity-picker__increment-button disabled:!opacity-50 desktop:hover:opacity-80 disabled:cursor-not-allowed transition-opacity',disabled:m,onClick:g,children:Ur(Bs,{variant:'solid-inverse',size:'sm',children:Ur('span',{className:'rf-quantity-picker__increment-icon text-base leading-none -mt-0.5',children:'+'})})})]}))};var Xs=Rn(e=>{let{variantId:t,quantity:r,quantityRule:o}=e;const i=Ci('product'),[a,s]=_n(!1),{cartState:l,isPending:c}=Oi(),u=Ma(),{processCartUpdate:d}=Da(),h=wn(async e=>{s(!0);const r=ka.ProductLimit;try{l.set(e=>n(n({},e),{},{pending:!0,error:null}));const o=await it({variantId:t,quantity:e});await d(o),u.has(r)&&u.remove(r)}catch(e){const t=parseInt(e.message),o=isNaN(t)?null:t;l.set(e=>n(n({},e),{},{pending:!1})),u.push({id:r,message:i('error.'.concat(Sa(o)))})}finally{s(!1)}},[l,t,u,i,d]);if(We(r))return null;const{increment:f,constraints:m}=function(e){var t,r,n;const o=null!==(t=null==e?void 0:e.min)&&void 0!==t?t:1,i=null!==(r=null==e?void 0:e.max)&&void 0!==r?r:99;return{min:o,max:i,increment:null!==(n=null==e?void 0:e.increment)&&void 0!==n?n:1,constraints:{min:{limit:o,disabled:!1},max:{limit:i,disabled:!0}}}}(o);return Ur('div',{className:'rf-product-actions flex items-center',children:[Ur(Ws,{pending:c||a,constraints:m,onDecrement:e=>{h(e?0:r-f)},onIncrement:()=>{h(r+f)},quantity:r}),Ur('button',{disabled:c||a,className:'rf-product-actions__remove-button underline ml-auto text-sm disabled:cursor-not-allowed disabled:opacity-50 transition-opacity cursor-pointer',onClick:()=>h(0),type:'button',children:i('remove')})]})});const Ks=['className','href','unstyled','onClick','onDisabledClick','disabled'],Zs=e=>{let{className:t,href:r,unstyled:i=!1,onClick:a,onDisabledClick:s,disabled:l=!1}=e,c=o(e,Ks);const u=l||!r;return Ur('a',n({onClick:function(e){if(l)return e.preventDefault(),void(null==s||s(e));null==a||a(e)},href:u?void 0:r,'aria-disabled':u,className:qe('rf-link block',!i&&'transition-opacity',u?i?'cursor-default':'cursor-not-allowed opacity-50':'cursor-pointer',t)},c))},Ys=['title','variantTitle','pending','price','compareAtPrice','className','quantity','href','showQuantity','exchangeRate'];var Js=Rn(e=>{let{title:t,variantTitle:r,pending:i=!1,price:a,compareAtPrice:s,className:l,quantity:c=1,href:u,showQuantity:d=!0,exchangeRate:h}=e,f=o(e,Ys);const m=Ci(),{applyExchangeRate:p}=_s(),g=c>1&&d,_=We(s)?void 0:p(Xe(s),h),v=p(Xe(a),h);return Ur('div',n(n({className:qe('rf-product-attributes flex justify-between gap-4 text-sm leading-tight',l)},f),{},{children:[Ur('div',{className:'rf-product-attributes__info flex-1 min-w-0',children:[u?Ur(Zs,{unstyled:!0,href:u,className:'rf-product-attributes__link',children:Ur('h3',{className:'rf-product-attributes__title text-base font-medium line-clamp-1',children:t})}):Ur('h3',{className:'rf-product-attributes__title text-base font-medium line-clamp-1',children:t}),(r||g)&&Ur('h4',{className:'rf-product-attributes__variant text-neutral-3',children:[r,' ',g&&Ur('span',{className:'rf-product-attributes__quantity',children:['(',m('piece',{count:c}),')']})]})]}),Ur(Ns,{pending:i,value:v,compareAtValue:_})]}))});var Qs=Rn(e=>{let{imageSource:t,title:r,href:n}=e;const{widgetViewState:o}=Pi();return Ur('a',{className:'rf-product-image',href:n,onClick:()=>o.set(i.Collapsed),children:Ur(Bi,{className:'rf-product-image__img w-[70px] h-24 rounded-lg border border-neutral-1 object-cover',src:t,alt:r})})});const $s=['calculation'],el=['product','className'],tl=e=>{let{product:{calculation:t},className:r}=e,i=o(e.product,$s),a=o(e,el);const{config:{options:s}}=Pi(),l=Vs(s.getProductUrl,i);return Ur('li',n(n({className:qe('rf-product flex gap-4 p-base first:pt-0',r)},a),{},{children:[Ur(Qs,{imageSource:i.image,title:i.product_title,href:l}),Ur('div',{className:'rf-product__content space-y-2 flex-1',children:[Ur(Js,{className:'flex-1',href:l,title:i.product_title,variantTitle:i.variant_title,pending:!t,price:null==t?void 0:t.price,compareAtPrice:null==t?void 0:t.compareAtPrice,quantity:i.quantity,showQuantity:!1}),Ur(Xs,{variantId:i.variant_id,quantity:i.quantity,quantityRule:i.quantity_rule})]})]}))},rl=()=>{const{cartItems:e}=(()=>{var e,t;const{cartState:r,calculationState:i}=Oi(),a=null===(e=r.value.data)||void 0===e?void 0:e.transformed,s=null===(t=i.value.data)||void 0===t||null===(t=t.exchange)||void 0===t?void 0:t.exchangeDetails;return{cartItems:yn(()=>{const e=null==a?void 0:a.items;return e?e.map(e=>{let t;const r=null==s?void 0:s.filter(t=>t.variantId?Number(Qe(t.variantId))===e.variant_id:Number(Qe(t.productId))===e.product_id);return r&&r.length>0&&(t=r.reduce((e,t)=>{var r,i,a;let{coverage:s}=t,l=o(t,zs);const c=null!==(r=null==s?void 0:s.originalUnitPrice)&&void 0!==r?r:l.price,u=null!==(i=null!==(a=null==s?void 0:s.exchangeUnitPrice)&&void 0!==a?a:l.compareAtPrice)&&void 0!==i?i:null;return u&&(e.compareAtPrice?e.compareAtPrice+=u:e.compareAtPrice=u),e.price+=c,n(n({},l),e)},{price:0,compareAtPrice:null})),n(n({},e),{},{calculation:t})}):[]},[a,s])}})();return Ur('ul',{className:'rf-product-list border-neutral-2 divide-y divide-neutral-2',children:e.map((e,t)=>{const r=''.concat(e.id,'-').concat(t);return Ur(tl,{product:e},r)})})},nl=['className'],ol=e=>{let{className:t}=e,r=o(e,nl);return Ur('svg',n(n({width:9,height:11,viewBox:'0 0 9 11',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--arrow-down '.concat(t||'')},r),{},{children:Ur('path',{d:'m4.92 10.824 3.907-3.972A.6.6 0 0 0 9 6.426.6.6 0 0 0 8.827 6l-.355-.36a.594.594 0 0 0-.842 0L5.346 7.957V.594A.583.583 0 0 0 4.764 0h-.502a.605.605 0 0 0-.608.594v7.39L1.357 5.64a.58.58 0 0 0-.831 0L.172 6A.6.6 0 0 0 0 6.426c0 .161.062.312.173.426l3.907 3.972A.58.58 0 0 0 4.5 11a.58.58 0 0 0 .42-.176',fill:'currentColor'})}))},il=['className'],al=e=>{let{className:t}=e,r=o(e,il);return Ur('svg',n(n({width:11,height:7,viewBox:'0 0 11 7',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--chevron '.concat(t||'')},r),{},{children:Ur('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M10.632 6.183a.95.95 0 0 1-.673.24.97.97 0 0 1-.652-.288l-3.375-3.49-3.375 3.49a.96.96 0 0 1-.652.287.96.96 0 0 1-.673-.24.9.9 0 0 1-.299-.625.88.88 0 0 1 .25-.646L5.244.71a.97.97 0 0 1 1.375 0l4.062 4.2a.9.9 0 0 1 .25.646.9.9 0 0 1-.3.626',fill:'currentColor'})}))},sl=['isOpen','className','style','children','collapseDelay','autoCloseAfter','onToggle'],ll=e=>{let{isOpen:t,className:r,style:i,children:a,collapseDelay:s=300,autoCloseAfter:l,onToggle:c}=e,u=o(e,sl);const[d,h]=_n(t),[f,m]=_n(t?void 0:0),p=bn(null),g=bn(),_=bn(),v=()=>{const e=p.current;e&&m(e.scrollHeight)};return vn(()=>(g.current&&clearTimeout(g.current),_.current&&clearTimeout(_.current),t?(h(!0),l&&c&&(_.current=setTimeout(()=>{c(!1)},l))):(m(0),g.current=setTimeout(()=>{h(!1)},s)),()=>{g.current&&clearTimeout(g.current),_.current&&clearTimeout(_.current)}),[t,s,l,c]),vn(()=>{if(d&&t){const e=requestAnimationFrame(()=>{v()});return()=>cancelAnimationFrame(e)}},[d,t,a]),vn(()=>{t&&d&&v()},[a,t,d]),d?Ur('div',n(n({className:qe('rf-expander overflow-hidden transition-all duration-300 ease-in-out',r),style:n({height:void 0!==f?''.concat(f,'px'):'auto'},'object'==typeof i?i:{})},u),{},{children:Ur('div',{ref:p,children:a})})):null},cl=['className','type'],ul=e=>{let{className:t,type:r}=e,i=o(e,cl);const a=Ci('product.badge');return'giftcard'===r?Ur('div',n(n({className:qe('rf-return-product-badge rf-return-product__badge rf-return-product__badge--giftcard text-base text-primary',t)},i),{},{children:[Ur(is,{className:'inline -mt-1 w-4 h-auto'}),' ',a('giftcard')]})):null},dl=['pending','deleted','href','onDeletedClick','handleAnchorClick'],hl=e=>{let{pending:t=!1,deleted:r=!1,href:i,onDeletedClick:a,handleAnchorClick:s}=e,l=o(e,dl);const c=Ci('product');return Ur('div',{className:'rf-return-product-actions rf-return-product__actions flex justify-between items-center',children:[Ur(Zs,{onDisabledClick:function(){r&&(null==a||a())},disabled:t||r,onClick:s,className:'rf-return-product__link text-sm underline block',href:i,children:c('go_to_product')}),Ur(ul,n({},l))]})},fl=['calculation'],ml=['product','allProducts','className'],pl=e=>{var t,r,a,s;let{product:{calculation:l},allProducts:c,className:u}=e,d=o(e.product,fl),h=o(e,ml);const f=Ci('product.error'),[m,p]=_n(null),{widgetViewState:g,config:{options:_,data:{returnData:v}}}=Pi(),b=Vs(_.getProductUrl,d);function y(){g.set(i.Collapsed)}const w=null!==(t=null==d?void 0:d.quantity)&&void 0!==t?t:1,E=(null!==(r=null==l?void 0:l.price)&&void 0!==r?r:0)*w,N=(null!==(a=null==l?void 0:l.originalPrice)&&void 0!==a?a:0)*w,x=yn(()=>{const e=c.flatMap(e=>{if(e.id!==d.id)return null;const t=null==v?void 0:v.items.filter(t=>t.lineItemId===e.shopifyLineId);return t&&0!==t.length?t.map(e=>e.action):null}).filter(e=>!We(e)),t=new Set(e).size>1,r=null==l?void 0:l.action;return t||!r?null:'GIFTCARD'===r?'giftcard':null},[null==l?void 0:l.action,c,d.id,null==v?void 0:v.items]),k=!(null!=l&&l.variantId);function C(){k&&p(f('product_unavailable'))}return Ur('li',n(n({className:qe('rf-return-product grid grid-cols-[max-content_1fr] gap-x-4 p-base',u)},h),{},{children:[Ur(Zs,{disabled:k,onDisabledClick:C,className:'rf-return-product__image-link',onClick:y,href:b,unstyled:!0,children:Ur(Bi,{className:'rf-return-product__image size-[70px] rounded-lg border border-neutral-1 object-cover',src:d.image,alt:d.title})}),Ur('div',{className:'rf-return-product__content flex-1 space-y-1 flex flex-col justify-between',children:[Ur(Js,{className:'text-neutral-3',href:b,title:d.title,variantTitle:d.variantTitle,pending:!l,price:E,compareAtPrice:N,quantity:d.quantity,exchangeRate:null!==(s=null==l?void 0:l.exchangeRate)&&void 0!==s?s:1}),Ur(hl,{pending:!l,deleted:k,href:b,onDeletedClick:C,handleAnchorClick:y,type:x})]}),Ur(ll,{className:'col-span-full',isOpen:!!m,autoCloseAfter:5e3,onToggle:e=>p(e?m:null),children:Ur('div',{className:'pt-4',children:Ur(fs,{tone:'error',children:m})})})]}))},gl=['className'],_l=e=>{let{className:t}=e,r=o(e,gl);return Ur('li',n(n({className:qe('rf-return-product-skeleton flex gap-4 p-base text-sm',t)},r),{},{children:[Ur(Wi,{className:'size-[70px] rounded-lg'}),Ur('div',{className:'rf-return-product-skeleton__content flex-1 space-y-1 flex flex-col justify-between',children:[Ur('div',{className:'rf-return-product-skeleton__info space-y-1',children:[Ur(Wi,{className:'w-[16ch]'}),Ur(Wi,{className:'text-xs w-[12ch]'})]}),Ur(Wi,{className:'text-xs w-[16ch]'})]}),Ur(Wi,{className:'w-[8ch]'})]}))},vl=()=>{var e,t;const r=Ci('return_products'),{returnViewState:o}=Pi(),{orderState:i,calculationState:s}=Oi(),{orderTotal:l}=vs(),c=s.initialFetch,u=null===(e=s.value.data)||void 0===e?void 0:e.lineItems,d=null===(t=i.value.data)||void 0===t?void 0:t.orderData.productsToExchange,h=yn(()=>u&&d?d.map(e=>{const t=u.find(t=>t.lineItemId===e.shopifyLineId);return n(n({},e),{},{calculation:t})}):[],[u,d]),f=Boolean(null==h?void 0:h.some(e=>{var t;return'GIFTCARD'===(null===(t=e.calculation)||void 0===t?void 0:t.action)}));return Ur('div',{className:'rf-return-product-list border-b border-neutral-2 relative mb-base group [&[data-state=\'OPEN\']]:mb-[calc(var(--rf-base-spacing)*2)]','data-state':o.value,children:[Ur('div',{className:'rf-return-product-list__header flex justify-between items-center p-base',children:[Ur('button',{className:'rf-return-product-list__toggle-button flex items-center gap-2 font-medium',onClick:function(){o.set(e=>e===a.Collapsed?a.Open:a.Collapsed)},type:'button',children:[Ur('span',{className:'rf-return-product-list__toggle-text',children:r('action')}),Ur(al,{className:'transition-transform will-change-transform '.concat(o.value===a.Open?'rotate-180':'rotate-0')})]}),Ur(Ns,{value:l,pending:c})]}),Ur('div',{className:'rf-return-product-list__content pb-base group-[&[data-state=\'COLLAPSED\']]:hidden',children:[f&&Ur('div',{className:'rf-return-product-list__container p-base pt-0',children:Ur(fs,{className:'rf-return-product-list__banner',tone:'giftcard',children:r('banner.giftcard')})}),Ur('ul',{className:'rf-return-product-list__items divide-y divide-neutral-2',children:Ur(Mi,{pending:c,skeleton:Ur(qt,{children:[Ur(_l,{}),Ur(_l,{})]}),children:h.map(e=>Ur(pl,{className:'first:pt-0',product:e,allProducts:h},e.id))})}),Ur(Bs,{className:'absolute inset-x-0 mx-auto bottom-0 translate-y-1/2',variant:'solid',icon:ol})]})]})},bl=e=>{let{containerRef:t}=e;const{isYScrollable:r,isDirty:n}=(e=>{const[t,r]=_n(!1),[{isScrolling:n,isDirty:o},i]=_n({isDirty:!1,isScrolling:!1});return vn(()=>{const t=e.current;if(!t)return;const n=()=>{const e=t.scrollHeight>t.clientHeight;r(e)},o=()=>{const e=t.scrollTop>0;i(t=>({isDirty:!!e||t.isDirty,isScrolling:e}))};n(),o();const a=new ResizeObserver(()=>{n()});a.observe(t);const s=new MutationObserver(()=>{n()});return s.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:['style','class']}),t.addEventListener('scroll',o,{passive:!0}),()=>{a.disconnect(),s.disconnect(),t.removeEventListener('scroll',o)}},[e]),{isYScrollable:t,isScrolling:n,isDirty:o}})(t),o=!n&&r;return Ur('div',{className:'rf-scroll-indicator w-full h-36 bg-gradient-to-t from-white to-transparent absolute bottom-full inset-x-0 flex items-end justify-center p-base transition-all pointer-events-none',style:{opacity:o?1:0,visibility:o?'visible':'hidden'},children:Ur('div',{className:'rf-scroll-indicator__content rounded-full py-2.5 w-24 bg-neutral-1 text-center space-x-1 align-middle',children:[Ur('span',{className:'rf-scroll-indicator__text',children:'Scroll'}),' ',Ur(ol,{className:'inline text-neutral-3 -mt-0.5'})]})})},yl=e=>{let{state:t}=e;const{widgetViewState:r}=Pi(),{cartState:n,hasFailed:o}=Oi(),a=bn(null),s=n.value.data&&!n.value.error&&0!==n.value.data.transformed.item_count;return Ur(qt,{children:[Ur('div',{'aria-hidden':!0,onClick:()=>r.set(i.Collapsed),className:qe('max-desktop:hidden transition-[background-color,visibility] inset-0 size-full fixed z-10 duration-300 ease-in-out',t?'bg-black/30 visible':'bg-black/0 pointer-events-none invisible')}),Ur('div',{className:qe('rf-drawer bg-background text-foreground transition-[transform,visibility] duration-300 ease-in-out z-20 fixed max-desktop:inset-0 desktop:right-0 desktop:inset-y-0 size-full pt-safe flex flex-col desktop:max-w-[var(--rf-desktop-widget-width)]',t?'max-desktop:translate-y-0 desktop:translate-x-0 visible':'max-desktop:translate-y-full desktop:translate-x-full pointer-events-none invisible'),'aria-hidden':!t,inert:!t,tabIndex:t?void 0:-1,children:[Ur(Ms,{}),Ur(Is,{}),Ur('div',{className:'rf-drawer__content flex-1 min-h-0 overflow-y-auto flex flex-col',ref:a,children:[o?Ur(Ps,{}):Ur(qt,{children:[Ur(vl,{}),Ur(s?rl:Us,{}),Ur(Gs,{})]}),Ur(Ts,{className:'rf-drawer__adjustments mt-auto'})]}),Ur('div',{className:'rf-drawer__footer relative mt-auto',children:[Ur(bl,{containerRef:a}),Ur(Hs,{})]})]})]})},wl=['className'],El=e=>{let{className:t}=e,r=o(e,wl);return Ur('svg',n(n({width:14,height:17,viewBox:'0 0 14 17',fill:'none',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--bag '.concat(t||'')},r),{},{children:Ur('path',{fillRule:'evenodd',clipRule:'evenodd',d:'M3.175 4.146H2.103c-.74 0-1.355.589-1.408 1.348l-.691 9.952c-.028.401.107.797.374 1.092A1.4 1.4 0 0 0 1.412 17h11.176a1.4 1.4 0 0 0 1.034-.462c.267-.295.402-.69.374-1.093l-.691-9.95c-.053-.76-.668-1.349-1.408-1.349h-1.065V3.94C10.832 1.763 9.117 0 7 0 4.96 0 3.076 1.67 3.168 3.939zm7.657 1.244V8.5a.614.614 0 0 1-.605.622.614.614 0 0 1-.605-.622V5.39H4.378V8.5a.614.614 0 0 1-.605.622.614.614 0 0 1-.605-.622s.052-1.453.035-3.11h-1.1a.204.204 0 0 0-.2.193l-.692 9.95a.2.2 0 0 0 .053.157.2.2 0 0 0 .148.066h11.176a.2.2 0 0 0 .148-.066.2.2 0 0 0 .053-.156l-.691-9.951a.204.204 0 0 0-.201-.193zm-1.21-1.244V3.94c0-1.49-1.174-2.696-2.622-2.696S4.378 2.45 4.378 3.939v.207z',fill:'currentColor'})}))},Nl=['options','className','style'],xl=e=>{let{options:{id:t,tone:r='info',message:i,isVisible:a},className:s,style:l}=e,c=o(e,Nl);const{remove:u}=Na();return Ur('div',n(n({onClick:()=>u(t),className:qe('rf-toast animate-slide-up-and-fade-in overflow-hidden shadow-sm max-w-screen-lg mx-auto','rf-toast--'.concat(r),s)},c),{},{style:n({visibility:a?'visible':'hidden',opacity:a?1:0,transform:a?void 0:'translateY(-20px)',transition:'all '.concat(300,'ms ease-in-out')},'object'==typeof l?l:void 0),children:Ur(fs,{tone:r,className:'font-medium',border:'dashed',children:i})}))},kl=()=>{const{queue:e}=En(Ea);return 0===e.length?null:Ur('div',{className:'rf-toast__container p-base space-y-base',children:e.map(e=>Ur(xl,{options:e},e.id))})},Cl=['className'],Sl=e=>{let{className:t}=e,r=o(e,Cl);return Ur('svg',n(n({width:11,height:9,viewBox:'0 0 11 9',fill:'currentColor',xmlns:'http://www.w3.org/2000/svg',className:'rf-icon rf-icon--arrow-left '.concat(t||'')},r),{},{children:Ur('path',{d:'m.66 5.202 3.61 3.473c.103.1.24.154.387.154a.56.56 0 0 0 .387-.154l.328-.315a.52.52 0 0 0 0-.749l-2.107-2.03H9.96c.301 0 .54-.228.54-.518v-.446c0-.29-.239-.54-.54-.54H3.242l2.131-2.042a.505.505 0 0 0 0-.739L5.045.982a.55.55 0 0 0-.387-.153.56.56 0 0 0-.387.153L.66 4.455a.513.513 0 0 0 0 .747'})}))},Tl=['className'],Il=e=>{let{className:t}=e,r=o(e,Tl);const i=Ci('summary'),{orderState:a}=Oi(),s=Rs(),l=a.value.pending;return Ur(fa,n(n({variant:'ghost',icon:Sl,iconPosition:'left',onClick:async function(){var e;if(l)return;const t=null===(e=a.value.data)||void 0===e||null===(e=e.orderData.productsToExchange)||void 0===e||null===(e=e.at(-1))||void 0===e?void 0:e.id;s.back(t)},disabled:l,className:qe('rf-back-button desktop:text-black desktop:bg-neutral-2 desktop:hover:opacity-50 desktop:font-semibold max-desktop:text-sm max-desktop:px-0 max-desktop:h-auto',t),type:'button'},r),{},{children:Ur('span',{className:'rf-back-button__text',children:i('back')})}))},Al=()=>Ur('div',{className:'rf-exchange-total-skeleton max-desktop:max-w-48 w-full desktop:w-48 space-y-1 text-xs',children:[Ur(Wi,{className:'w-full rounded-md'}),Ur(Wi,{className:'w-full rounded-md'})]}),Pl=['className'],Rl=e=>{var t;let{className:r}=e,i=o(e,Pl);const a=Ci('summary'),{orderState:s,isPending:l}=Oi(),{orderTotal:c,cartTotal:u}=vs();return Ur(Mi,{skeleton:Ur(Al,{}),pending:l,children:Ur('div',n(n({className:qe('rf-exchange-total font-normal text-sm max-desktop:max-w-48 w-full desktop:w-48 flex-1',r)},i),{},{children:[Ur('div',{className:'rf-exchange-total__row flex justify-between',children:[Ur('span',{className:'rf-exchange-total__label text-neutral-3',children:[a('order'),' ',null===(t=s.value.data)||void 0===t?void 0:t.orderData.orderName,':']}),Ur(Ns,{className:'text-sm font-normal',value:c})]}),Ur('div',{className:'rf-exchange-total__row flex justify-between',children:[Ur('span',{className:'rf-exchange-total__label text-neutral-3',children:[a('cart_contents'),':']}),Ur(Ns,{className:'text-sm font-normal',value:Math.max(0,u)})]})]}))})},Hl=['className'],Ol=()=>{const e=Ci('summary'),{widgetViewState:t}=Pi();return Ur('div',{className:'rf-exchange-summary rf-summary__container fixed bottom-0 inset-x-0 pb-safe animate-slide-up',children:[Ur(kl,{}),Ur('div',{className:'rf-summary h-[var(--rf-summary-height,_auto)] bg-widget-background text-widget-foreground max-desktop:rounded-t-3xl flex max-desktop:flex-col desktop:justify-between desktop:px-5',children:[Ur('div',{className:'rf-summary__header flex items-center max-desktop:px-5 max-desktop:flex-1 gap-2 desktop:gap-4 text-sm desktop:text-base',children:[Ur(Il,{className:'rf-summary__back max-desktop:mr-auto'}),Ur(Ll,{className:'max-desktop:hidden'}),Ur('div',{className:'flex items-center gap-2 desktop:flex-row-reverse',children:[Ur(Yi,{}),Ur('span',{className:'rf-summary__title font-medium',children:e('title')})]})]}),Ur(Ll,{className:'desktop:hidden'}),Ur('div',{className:'rf-summary__actions max-desktop:px-5 max-desktop:py-3 gap-4 flex desktop:flex-row-reverse items-end desktop:items-center justify-between',children:[Ur(fa,{className:'rf-summary__button ![--icon-height:initial]',onClick:()=>t.set(e=>e===i.Collapsed?i.Open:i.Collapsed),icon:El,children:e('view_cart')}),Ur(Ll,{className:'max-desktop:hidden'}),Ur(Rl,{})]})]})]})},Ll=e=>{let{className:t}=e,r=o(e,Hl);return Ur('div',n({className:qe('rf-summary__divider max-desktop:h-px w-full desktop:w-px desktop:self-stretch bg-neutral-2 shrink-0',t)},r))},Bl=()=>{const{widgetViewState:e}=Pi();return Ur(qt,{children:[Ur(Ol,{}),Ur(yl,{state:e.value===i.Open})]})};var Ml=Object.freeze({__proto__:null,default:e=>{const{locale:t,messages:r}=e;return Ur(ja,{children:Ur(Ei,{messages:r,locale:t,children:Ur(Ja,n(n({},e),{},{children:Ur(Xa,{children:Ur(qa,{children:Ur(Za,{children:Ur($a,{children:[Ur(Bl,{}),Ur(ya,{}),Ur(za,{})]})})})})}))})})}});export{Nt as Returnflows,Nt as default};
2
2
  //# sourceMappingURL=index.esm.js.map