enqueueScripts([function(){ !function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=15)}([function(e,t){e.exports=React},function(e,t,n){!function(t){"use strict";var n={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:b,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,nptable:b,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|\\n*|\\n*|)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,table:b,lheading:/^([^\n]+)\n {0,3}(=|-){2,} *(?:\n+|$)/,paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading| {0,3}>|<\/?(?:tag)(?: +|\n|\/?>)|<(?:script|pre|style|!--))[^\n]+)*)/,text:/^[^\n]+/};function r(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||k.defaults,this.rules=n.normal,this.options.pedantic?this.rules=n.pedantic:this.options.gfm&&(this.options.tables?this.rules=n.tables:this.rules=n.gfm)}n._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,n._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,n.def=p(n.def).replace("label",n._label).replace("title",n._title).getRegex(),n.bullet=/(?:[*+-]|\d{1,9}\.)/,n.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,n.item=p(n.item,"gm").replace(/bull/g,n.bullet).getRegex(),n.list=p(n.list).replace(/bull/g,n.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+n.def.source+")").getRegex(),n._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",n._comment=//,n.html=p(n.html,"i").replace("comment",n._comment).replace("tag",n._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),n.paragraph=p(n.paragraph).replace("hr",n.hr).replace("heading",n.heading).replace("lheading",n.lheading).replace("tag",n._tag).getRegex(),n.blockquote=p(n.blockquote).replace("paragraph",n.paragraph).getRegex(),n.normal=m({},n),n.gfm=m({},n.normal,{fences:/^ {0,3}(`{3,}|~{3,})([^`\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),n.gfm.paragraph=p(n.paragraph).replace("(?!","(?!"+n.gfm.fences.source.replace("\\1","\\2")+"|"+n.list.source.replace("\\1","\\3")+"|").getRegex(),n.tables=m({},n.gfm,{nptable:/^ *([^|\n ].*\|.*)\n *([-:]+ *\|[-| :]*)(?:\n((?:.*[^>\n ].*(?:\n|$))*)\n*|$)/,table:/^ *\|(.+)\n *\|?( *[-:]+[-| :]*)(?:\n((?: *[^>\n ].*(?:\n|$))*)\n*|$)/}),n.pedantic=m({},n.normal,{html:p("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",n._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/}),r.rules=n,r.lex=function(e,t){return new r(t).lex(e)},r.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},r.prototype.token=function(e,t){var r,i,s,a,o,l,c,u,h,p,g,d,f,b,m,v;for(e=e.replace(/^ +$/gm,"");e;)if((s=this.rules.newline.exec(e))&&(e=e.substring(s[0].length),s[0].length>1&&this.tokens.push({type:"space"})),s=this.rules.code.exec(e)){var k=this.tokens[this.tokens.length-1];e=e.substring(s[0].length),k&&"paragraph"===k.type?k.text+="\n"+s[0].trimRight():(s=s[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",codeBlockStyle:"indented",text:this.options.pedantic?s:_(s,"\n")}))}else if(s=this.rules.fences.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"code",lang:s[2]?s[2].trim():s[2],text:s[3]||""});else if(s=this.rules.heading.exec(e))e=e.substring(s[0].length),this.tokens.push({type:"heading",depth:s[1].length,text:s[2]});else if((s=this.rules.nptable.exec(e))&&(l={type:"table",header:x(s[1].replace(/^ *| *\| *$/g,"")),align:s[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:s[3]?s[3].replace(/\n$/,"").split("\n"):[]}).header.length===l.align.length){for(e=e.substring(s[0].length),g=0;g ?/gm,""),this.token(s,t),this.tokens.push({type:"blockquote_end"});else if(s=this.rules.list.exec(e)){for(e=e.substring(s[0].length),c={type:"list_start",ordered:b=(a=s[2]).length>1,start:b?+a:"",loose:!1},this.tokens.push(c),u=[],r=!1,f=(s=s[0].match(this.rules.item)).length,g=0;g1?1===o.length:o.length>1||this.options.smartLists&&o!==a)&&(e=s.slice(g+1).join("\n")+e,g=f-1)),i=r||/\n\n(?!\s*$)/.test(l),g!==f-1&&(r="\n"===l.charAt(l.length-1),i||(i=r)),i&&(c.loose=!0),v=void 0,(m=/^\[[ xX]\] /.test(l))&&(v=" "!==l[1],l=l.replace(/^\[[ xX]\] +/,"")),h={type:"list_item_start",task:m,checked:v,loose:i},u.push(h),this.tokens.push(h),this.token(l,!1),this.tokens.push({type:"list_item_end"});if(c.loose)for(f=u.length,g=0;g?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:b,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(href(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,strong:/^__([^\s_])__(?!_)|^\*\*([^\s*])\*\*(?!\*)|^__([^\s][\s\S]*?[^\s])__(?!_)|^\*\*([^\s][\s\S]*?[^\s])\*\*(?!\*)/,em:/^_([^\s_])_(?!_)|^\*([^\s*<\[])\*(?!\*)|^_([^\s<][\s\S]*?[^\s_])_(?!_|[^\spunctuation])|^_([^\s_<][\s\S]*?[^\s])_(?!_|[^\spunctuation])|^\*([^\s<"][\s\S]*?[^\s\*])\*(?!\*|[^\spunctuation])|^\*([^\s*"<\[][\s\S]*?[^\s])\*(?!\*)/,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:b,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[^_{|}~",i.em=p(i.em).replace(/punctuation/g,i._punctuation).getRegex(),i._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,i._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,i._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,i.autolink=p(i.autolink).replace("scheme",i._scheme).replace("email",i._email).getRegex(),i._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,i.tag=p(i.tag).replace("comment",n._comment).replace("attribute",i._attribute).getRegex(),i._label=/(?:\[[^\[\]]*\]|\\[\[\]]?|`[^`]*`|`(?!`)|[^\[\]\\`])*?/,i._href=/\s*(<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*)/,i._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,i.link=p(i.link).replace("label",i._label).replace("href",i._href).replace("title",i._title).getRegex(),i.reflink=p(i.reflink).replace("label",i._label).getRegex(),i.normal=m({},i),i.pedantic=m({},i.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/,link:p(/^!?\[(label)\]\((.*?)\)/).replace("label",i._label).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",i._label).getRegex()}),i.gfm=m({},i.normal,{escape:p(i.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\/i.test(a[0])&&(this.inLink=!1),!this.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(a[0])?this.inRawBlock=!0:this.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(a[0])&&(this.inRawBlock=!1),e=e.substring(a[0].length),l+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):u(a[0]):a[0];else if(a=this.rules.link.exec(e)){var c=v(a[2],"()");if(c>-1){var h=a[0].length-(a[2].length-c)-(a[3]||"").length;a[2]=a[2].substring(0,c),a[0]=a[0].substring(0,h).trim(),a[3]=""}e=e.substring(a[0].length),this.inLink=!0,r=a[2],this.options.pedantic?(t=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(r))?(r=t[1],i=t[3]):i="":i=a[3]?a[3].slice(1,-1):"",r=r.trim().replace(/^<([\s\S]*)>$/,"$1"),l+=this.outputLink(a,{href:s.escapes(r),title:s.escapes(i)}),this.inLink=!1}else if((a=this.rules.reflink.exec(e))||(a=this.rules.nolink.exec(e))){if(e=e.substring(a[0].length),t=(a[2]||a[1]).replace(/\s+/g," "),!(t=this.links[t.toLowerCase()])||!t.href){l+=a[0].charAt(0),e=a[0].substring(1)+e;continue}this.inLink=!0,l+=this.outputLink(a,t),this.inLink=!1}else if(a=this.rules.strong.exec(e))e=e.substring(a[0].length),l+=this.renderer.strong(this.output(a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.em.exec(e))e=e.substring(a[0].length),l+=this.renderer.em(this.output(a[6]||a[5]||a[4]||a[3]||a[2]||a[1]));else if(a=this.rules.code.exec(e))e=e.substring(a[0].length),l+=this.renderer.codespan(u(a[2].trim(),!0));else if(a=this.rules.br.exec(e))e=e.substring(a[0].length),l+=this.renderer.br();else if(a=this.rules.del.exec(e))e=e.substring(a[0].length),l+=this.renderer.del(this.output(a[1]));else if(a=this.rules.autolink.exec(e))e=e.substring(a[0].length),r="@"===a[2]?"mailto:"+(n=u(this.mangle(a[1]))):n=u(a[1]),l+=this.renderer.link(r,null,n);else if(this.inLink||!(a=this.rules.url.exec(e))){if(a=this.rules.text.exec(e))e=e.substring(a[0].length),this.inRawBlock?l+=this.renderer.text(a[0]):l+=this.renderer.text(u(this.smartypants(a[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else{if("@"===a[2])r="mailto:"+(n=u(a[0]));else{do{o=a[0],a[0]=this.rules._backpedal.exec(a[0])[0]}while(o!==a[0]);n=u(a[0]),r="www."===a[1]?"http://"+n:n}e=e.substring(a[0].length),l+=this.renderer.link(r,null,n)}return l},s.escapes=function(e){return e?e.replace(s.rules._escapes,"$1"):e},s.prototype.outputLink=function(e,t){var n=t.href,r=t.title?u(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,u(e[1]))},s.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},s.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;i.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},a.prototype.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var i=this.options.highlight(e,r);null!=i&&i!==e&&(n=!0,e=i)}return r?'
'+(n?e:u(e,!0))+"
\n":"
"+(n?e:u(e,!0))+"
"},a.prototype.blockquote=function(e){return"
\n"+e+"
\n"},a.prototype.html=function(e){return e},a.prototype.heading=function(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"},a.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},a.prototype.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},a.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},a.prototype.checkbox=function(e){return" "},a.prototype.paragraph=function(e){return"

    "+e+"

    \n"},a.prototype.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},a.prototype.tablerow=function(e){return"\n"+e+"\n"},a.prototype.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},a.prototype.strong=function(e){return""+e+""},a.prototype.em=function(e){return""+e+""},a.prototype.codespan=function(e){return""+e+""},a.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},a.prototype.del=function(e){return""+e+""},a.prototype.link=function(e,t,n){if(null===(e=g(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"},a.prototype.image=function(e,t,n){if(null===(e=g(this.options.sanitize,this.options.baseUrl,e)))return n;var r=''+n+'":">"},a.prototype.text=function(e){return e},o.prototype.strong=o.prototype.em=o.prototype.codespan=o.prototype.del=o.prototype.text=function(e){return e},o.prototype.link=o.prototype.image=function(e,t,n){return""+n},o.prototype.br=function(){return""},l.parse=function(e,t){return new l(t).parse(e)},l.prototype.parse=function(e){this.inline=new s(e.links,this.options),this.inlineText=new s(e.links,m({},this.options,{renderer:new o})),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},l.prototype.next=function(){return this.token=this.tokens.pop(),this.token},l.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},l.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},l.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,h(this.inlineText.output(this.token.text)),this.slugger);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i="",s="";for(n="",e=0;e?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(t)){var n=t;do{this.seen[n]++,t=n+"-"+this.seen[n]}while(this.seen.hasOwnProperty(t))}return this.seen[t]=0,t},u.escapeTest=/[&<>"']/,u.escapeReplace=/[&<>"']/g,u.replacements={"&":"&","<":"<",">":">",'"':""","'":"'"},u.escapeTestNoEncode=/[<>"']|&(?!#?\w+;)/,u.escapeReplaceNoEncode=/[<>"']|&(?!#?\w+;)/g;var d={},f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function b(){}function m(e){for(var t,n,r=1;r=0&&"\\"===n[i];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.lengthAn error occurred:

    "+u(e.message+"",!0)+"
    ";throw e}}b.exec=b,k.options=k.setOptions=function(e){return m(k.defaults,e),k},k.getDefaults=function(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:new a,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tables:!0,xhtml:!1}},k.defaults=k.getDefaults(),k.Parser=l,k.parser=l.parse,k.Renderer=a,k.TextRenderer=o,k.Lexer=r,k.lexer=r.lex,k.InlineLexer=s,k.inlineLexer=s.output,k.Slugger=c,k.parse=k,e.exports=k}(this||("undefined"!=typeof window?window:global))},function(e,t,n){"use strict";var r={"&":"&","<":"<",">":">",'"':""","'":"'"},i={"&":"&","<":"<",">":">",""":'"',"'":"'"},s=/(&|<|>|"|')/g,a=/[&<>"']/g;function o(e){return r[e]}function l(e){return i[e]}function c(e){return null==e?"":String(e).replace(a,o)}function u(e){return null==e?"":String(e).replace(s,l)}c.options=u.options={},e.exports={encode:c,escape:c,decode:u,unescape:u,version:"1.0.0-browser"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getPublicPath=t.register=void 0;var r="__RENDER_8_RUNTIME__",i="__RENDER_8_COMPONENTS__",s=!("undefined"==typeof window||!window.document);s&&!window.global&&(window.global=window),window[i]=window[i]||{},t.register=function(e,t,n,s,a){var o="".concat(n,"/").concat(a),l="".concat(s,"/").concat(a),c=function(){return function(e,t){try{var n=e();return n.__esModule?n.default:n.default||n}catch(e){throw new Error("An error happened while requiring the app ".concat(t,", please check your app's code.\\n").concat(e.stack))}}(e,o)};if(window[r]&&window[r].registerComponent){var u=!!window.__RENDER_LAZY__;window[r].registerComponent(t,u?c:c(),n,a,u)}else{var h=c();window[r]&&window[r].withHMR?window[i][o]=window[i][l]=window[r].withHMR(t,h):window[i][o]=window[i][l]=h}return{}},t.getPublicPath=function(e){var t=window.__hostname__,n="/_v/public/assets/v1/published/";return s&&window.__RUNTIME__&&(t=__RUNTIME__.assetServerPublishedHost||window.location.hostname,n=__RUNTIME__.assetServerPublishedPath||"/_v/public/assets/v1/published/"),"https://"+t+n+"".concat(e,"/public/react/")}},function(e,t,n){"use strict";e.exports=function(e){return"string"==typeof e?e.toLowerCase():e}},function(e,t,n){"use strict";var r=n(6);e.exports={uris:r(["background","base","cite","href","longdesc","src","usemap"])}},function(e,t,n){"use strict";function r(e,t){return e[t]=!0,e}e.exports=function(e){return e.reduce(r,{})}},function(e,t,n){"use strict";var r=n(6);e.exports={voids:r(["area","br","col","hr","img","wbr","input","base","basefont","link","meta"])}},function(e,t){e.exports=ReactIntl},function(e,t,n){"use strict";var r=/["'&<>]/;e.exports=function(e){var t,n=""+e,i=r.exec(n);if(!i)return n;var s="",a=0,o=0;for(a=i.index;a\s]+))?)*)\s*(\/?)\s*>/,o=/^<\s*\/\s*([\w:-]+)[^>]*>/,l=/([\w:-]+)(?:\s*=\s*(?:(?:"((?:[^"])*)")|(?:'((?:[^'])*)')|([^>\s]+)))?/g,c=/^/i,h=/^<\s*\//;e.exports=function(e,t){for(var n,p=function(){var e=[];return e.lastItem=function(){return e[e.length-1]},e}(),g=e;e;)d();function d(){n=!0,function(){"\x3c!--"===e.substr(0,4)?(i=e.indexOf("--\x3e"))>=0&&(t.comment&&t.comment(e.substring(4,i)),e=e.substring(i+3),n=!1):u.test(e)?(r=e.match(u),n=!1,e=e.substring(r[0].length)):h.test(e)?f(o,m):c.test(e)&&f(a,b);var r;var i;!function(){if(!n)return;var r,i=e.indexOf("<");i>=0?(r=e.substring(0,i),e=e.substring(i)):(r=e,e="");t.chars&&t.chars(r)}()}();var r=e===g;g=e,r&&(e="")}function f(t,r){var i=e.match(t);i&&(e=e.substring(i[0].length),i[0].replace(t,r),n=!1)}function b(e,n,a,o){var c={},u=i(n),h=s.voids[u]||!!o;a.replace(l,(function(e,t,n,i,s){c[t]=void 0===n&&void 0===i&&void 0===s?void 0:r.decode(n||i||s||"")})),h||p.push(u),t.start&&t.start(u,c,h)}function m(e,n){var r,s=0,a=i(n);if(a)for(s=p.length-1;s>=0&&p[s]!==a;s--);if(s>=0){for(r=p.length-1;r>=s;r--)t.end&&t.end(p[r]);p.length=s}}m()}},function(e,t,n){"use strict";var r=n(2),i=n(4),s=n(5),a=n(7);e.exports=function(e,t){var n,o=t||{};return h(),{start:function(e,t,a){var u=i(e);if(n.ignoring)return void c(u);if(-1===(o.allowedTags||[]).indexOf(u))return void c(u);if(o.filter&&!o.filter({tag:u,attrs:t}))return void c(u);l("<"),l(u),Object.keys(t).forEach((function(e){var n=t[e],a=(o.allowedClasses||{})[u]||[],c=(o.allowedAttributes||{})[u]||[];c=c.concat((o.allowedAttributes||{})["*"]||[]);var h=i(e);("class"===h&&-1===c.indexOf(h)?(n=n.split(" ").filter((function(e){return a&&-1!==a.indexOf(e)})).join(" ").trim()).length:-1!==c.indexOf(h)&&(!0!==s.uris[h]||function(e){var t=e[0];if("#"===t||"/"===t)return!0;var n=e.indexOf(":");if(-1===n)return!0;var r=e.indexOf("?");if(-1!==r&&n>r)return!0;var i=e.indexOf("#");if(-1!==i&&n>i)return!0;return o.allowedSchemes.some((function(t){return 0===e.indexOf(t+":")}))}(n)))&&(l(" "),l(e),"string"==typeof n&&(l('="'),l(r.encode(n)),l('"')))})),l(a?"/>":">")},end:function(e){var t=i(e);-1!==(o.allowedTags||[]).indexOf(t)&&!1===n.ignoring?(l("")):u(t)},chars:function(e){!1===n.ignoring&&l(o.transformText?o.transformText(e):e)}};function l(t){e.push(t)}function c(e){a.voids[e]||(!1===n.ignoring?n={ignoring:e,depth:1}:n.ignoring===e&&n.depth++)}function u(e){n.ignoring===e&&--n.depth<=0&&h()}function h(){n={ignoring:!1,depth:0}}}},function(e,t,n){"use strict";e.exports={allowedAttributes:{"*":["title","accesskey"],a:["href","name","target","aria-label"],iframe:["allowfullscreen","frameborder","src"],img:["src","alt","title","aria-label"]},allowedClasses:{},allowedSchemes:["http","https","mailto"],allowedTags:["a","abbr","article","b","blockquote","br","caption","code","del","details","div","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","main","mark","ol","p","pre","section","span","strike","strong","sub","summary","sup","table","tbody","td","th","thead","tr","u","ul"],filter:null}},function(e,t,n){"use strict";function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n').concat(e,"

    ")},I.current.strong=function(e){return'').concat(e,"")},I.current.em=function(e){return'').concat(e,"")},I.current.heading=function(e){return function(t,n){var r=function(e){return e>0&&e<=6?e:6}(n),i="".concat(e.heading," t-heading-").concat(r," ").concat(function(e,t){return 1===t?e.headingLevel1:2===t?e.headingLevel2:3===t?e.headingLevel3:4===t?e.headingLevel4:5===t?e.headingLevel5:6===t?e.headingLevel6:""}(e,r)," ").concat(A.a["heading-level-".concat(r)]);return"').concat(t,"")}}(E),I.current.link=function(e,t,n){var r,s=(r=e.split("?")).length<2?"":i(r,2)[1].includes("target=_blank")?"target=_blank":"",a=(s?e.replace(/target=_blank/,"").replace(/\?&/,"?"):e).replace(/(\?|&)$/,""),o=t?'title="'.concat(t,'"'):"",l='
    ")},I.current.html=function(e){return d()(e)},I.current.table=function(e,t){return'\n \n \n ').concat(e,'\n \n \n ').concat(t,"\n \n
    ")},I.current.tablerow=function(e){return"\n").concat(e,"\n")},I.current.tablecell=function(e,t){var n=t.header?"th":"td",r="<".concat(n,' class="').concat("th"===n?E.tableTh:E.tableTd,'"\n ').concat(t.align?' align="'.concat(t.align,'"'):"",">");return"".concat(r+e,"\n")},I.current.image=function(e,t,n){return'').concat(n,'")},I.current.list=function(e,t){var n=t?"ol":"ul";return"<".concat(n,' class="').concat(E.list," ").concat(t?E.listOrdered:"",'">').concat(e,"")},I.current.listitem=function(e){return'
  • ').concat(e,"
  • ")});var H=C(N,f,"textAlignment"),F=C(P,o,"textPosition"),G=C(L,o,"textPosition"),D=Object(l.useMemo)((function(){return p.a.setOptions({gfm:!0,breaks:!0,sanitize:!1,smartLists:!0,renderer:I.current}),b()(p()(y()({id:s,intl:T})),z)}),[s,T]);return c.a.createElement("div",{id:k,className:"".concat(E.container," flex ").concat(H," ").concat(F," ").concat(G," ").concat(M(q)," ").concat(Z(_))},c.a.createElement("div",{className:E.wrapper,dangerouslySetInnerHTML:{__html:D}}))}var H=Object(l.memo)(q);H.schema={title:"admin/editor.rich-text.title"};t.default=H}]); },function(){ !function(t){function e(e){for(var r,u,c=e[0],a=e[1],f=e[2],s=0,p=[];st.length)&&(e=t.length);for(var n=0,r=new Array(e);n-1?"submenu.accordion":"submenu"},b=n(9),h={x:null,y:null},O={x:null,y:null},g=0,k=0,j=0,E=function(e){if(O.x=e.pageX,O.y=e.pageY,null!=h.x&&null!=h.y){var t=e.timeStamp,n=Math.sqrt(Math.pow(O.x-h.x,2)+Math.pow(O.y-h.y,2)),i=t-k;j=Math.round(n/i*1e3),k=t}h.x=O.x,h.y=O.y},x=function(e,t){var n=t.delay,i=void 0===n?200:n,a=t.maxSpeed,o=void 0===a?450:a,l=Object(r.useRef)(null),c=(Object(r.useEffect)((function(){return 0===g&&window.addEventListener("mousemove",E),g+=1,function(){(g-=1)>0||(h.x=null,h.y=null,O.x=null,O.y=null,window.removeEventListener("mousemove",E))}}),[]),{getMouseSpeed:function(){return j||0}}).getMouseSpeed;return function(){for(var t=arguments.length,n=new Array(t),a=0;ao?e.apply(void 0,n):null!=r&&r===a||(l.current=window.setTimeout(t,i)),r=a}),i)}},w=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a0;){var c=l;l=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(i[e]||new Set).forEach((function(e){l.add(e)})))}))}return o.forEach((function(t){var i=a(e,t);i&&n.definitions.push(i)})),n}(n,"category")},8:function(e,t,n){"use strict";var i=n(4),a=n(6),r=n.n(a),o=n(0),l=n.n(o),c=n(1),u=n.n(c),s=n(2),d=n(16),m=n.n(d),f=n(11),p=n(9),v=function(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(e);a0;){var l=o;o=new Set,l.forEach((function(e){d.has(e)||(d.add(e),(t[e]||new Set).forEach((function(e){o.add(e)})))}))}return d.forEach((function(n){var t=a(e,n);t&&i.definitions.push(t)})),i}(i,"categoryWithChildren")},,,,,,,,,,function(e,n,i){"use strict";i.r(n),function(e){var n=i(3);i.p=Object(n.getPublicPath)("vtex.menu@2.35.3");var t=Object(n.register)((function(){return i(35)}),e,"vtex.menu@2.35.3","vtex.menu@2.x","Menu");t.renderHotReload,t.setupHMR}.call(this,i(7)(e))},,,function(e,n,i){"use strict";i.r(n);var t,a=i(4),r=i(0),d=i.n(r),o=i(6),l=i.n(o),c=i(5),m=i(1),u=i.n(m),s=i(2),v=i(10),f=i(22),g=i.n(f),h=i(8),p=function(e){var n=e.href,i=e.titleTag,t=e.isTitle,a=e.name;return d.a.createElement(h.a,{title:i,to:n,isTitle:t},a)},k=function(e){var n=e.categoryId;return null==n?null:d.a.createElement(v.Query,{query:g.a,variables:{id:n}},(function(e){var n=e.data,i=e.loading;if(e.error||i)return null;var t=n.category,r=n.category.children;return d.a.createElement(d.a.Fragment,null,d.a.createElement(p,Object(a.a)({},t,{isTitle:!0})),null==r?void 0:r.map((function(e){return d.a.createElement("li",{key:e.id},d.a.createElement(p,e))})))}))},y=i(13),b=i(11),_=i(9),N=i(17),x=function(e,n){var i={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&n.indexOf(t)<0&&(i[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(t=Object.getOwnPropertySymbols(e);ae.length)&&(t=e.length);for(var n=0,r=new Array(t);nvoid 0===e,a=e=>null===e||s(e),c=e=>Array.isArray(e);const u=e=>"object"==typeof e;var o=e=>!a(e)&&!c(e)&&u(e),l=e=>o(e)&&e.nodeType===Node.ELEMENT_NODE;const d={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit"},m="blur",f="change",p="input",g="max",b="min",h="maxLength",v="minLength",O="pattern",y="required",j="validate",S=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/,_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,w=/\\(\\)?/g;var V=e=>!c(e)&&(x.test(e)||!S.test(e)),E=e=>{const t=[];return e.replace(_,(e,r,n,i)=>{t.push(n?i.replace(w,"$1"):r||e)}),t};function k(e,t,r){let n=-1;const i=V(t)?[t]:E(t),s=i.length,a=s-1;for(;++nObject.entries(e).reduce((e,[t,r])=>V(t)?Object.assign(Object.assign({},e),{[t]:r}):(k(e,t,r),e),{}),L=(e,t,r)=>{const n=t.split(/[,[\].]+?/).filter(Boolean).reduce((e,t)=>a(e)?e:e[t],e);return s(n)||n===e?e[t]||r:n},P=(e,t)=>{l(e)&&e.removeEventListener&&(e.removeEventListener(p,t),e.removeEventListener(f,t),e.removeEventListener(m,t))},N=e=>!!e&&"radio"===e.type,I=e=>!!e&&"checkbox"===e.type;function q(e){return!e||e instanceof HTMLElement&&e.nodeType!==Node.DOCUMENT_NODE&&q(e.parentNode)}var F=e=>o(e)&&!Object.keys(e).length;function C(e){return c(e)?e:E(e)}function M(e,t){return 1==t.length?e:function(e,t){const r=V(t)?[t]:C(t),n=t.length;let i=0;for(;ii?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t;const s=Array(i);for(;++n{!function(e,t){const r=V(t)?[t]:C(t),n=M(e,r),i=r[r.length-1],s=!(null!=n)||delete n[i];let a=void 0;for(let t=0;t0&&(a=e);++no(e)&&!F(e)).length&&delete a[t]),a=i}}}(e,t)}),e}const $={isValid:!1,value:""};var A=e=>c(e)?e.reduce((e,{ref:{checked:t,value:r}})=>t?{isValid:!0,value:r}:e,$):$,D=e=>!!e&&"file"===e.type,J=e=>!!e&&"select-multiple"===e.type,W=e=>""===e;const T={value:!1,isValid:!1},z={value:!0,isValid:!0};var U=e=>{if(c(e)){if(e.length>1){const t=e.filter(({ref:{checked:e}})=>e).map(({ref:{value:e}})=>e);return{value:t,isValid:!!t.length}}const{checked:t,value:r,attributes:n}=e[0].ref;return t?n&&!s(n.value)?s(r)||W(r)?z:{value:r,isValid:!0}:z:T}return T};function H(e,t){const{name:r,value:n}=t,i=e[r];return D(t)?t.files:N(t)?i?A(i.options).value:"":J(t)?(s=t.options,[...s].filter(({selected:e})=>e).map(({value:e})=>e)):I(t)?!!i&&U(i.options).value:n;var s}var G=e=>"string"==typeof e,K=(e,t)=>{const r={},n=G(t),i=c(t),a=t&&t.nest;for(const c in e)(s(t)||a||n&&c.startsWith(t)||i&&t.find(e=>c.startsWith(e)))&&(r[c]=H(e,e[c].ref));return r},Q=(e,{type:t,types:r,message:n})=>o(e)&&e.type===t&&e.message===n&&((e={},t={})=>Object.entries(e).reduce((e,[r,n])=>!!e&&(t[r]&&t[r]===n),!0))(e.types,r);var X=e=>e instanceof RegExp,Y=e=>{const t=o(e)&&!X(e);return{value:t?e.value:e,message:t?e.message:""}},Z=e=>"function"==typeof e,ee=e=>"boolean"==typeof e;function te(e,t,r="validate"){const n=G(e);if(n||ee(e)&&!e){return{type:r,message:n?e:"",ref:t}}}var re=(e,t,r,n,i)=>{if(!t)return{};const s=r[e];return Object.assign(Object.assign({},s),{types:Object.assign(Object.assign({},s&&s.types?s.types:{}),{[n]:i||!0})})},ne=async(e,t,{ref:r,ref:{type:n,value:i,name:s},options:c,required:u,maxLength:l,minLength:d,min:m,max:f,pattern:p,validate:S})=>{const x=e.current,_={},w=N(r),V=I(r),E=w||V,k=W(i),R=re.bind(null,s,t,_),L=(e,n,i,a=h,c=v)=>{const u=e?n:i;if(_[s]=Object.assign({type:e?a:c,message:u,ref:r},R(e?a:c,u)),!t)return _};if(u&&(!w&&!V&&(k||a(i))||ee(i)&&!i||V&&!U(c).isValid||w&&!A(c).isValid)){const{value:e,message:n}=G(u)?{value:!!u,message:u}:Y(u);if(e&&(_[s]=Object.assign({type:y,message:n,ref:E?x[s].options[0].ref:r},R(y,n)),!t))return _}if(!a(m)||!a(f)){let e,s;const{value:c,message:u}=Y(f),{value:o,message:l}=Y(m);if("number"===n||!n&&!isNaN(i)){const t=r.valueAsNumber||parseFloat(i);a(c)||(e=t>c),a(o)||(s=tnew Date(c)),G(o)&&(s=te,u=d&&a{r.reduce(async(a,[c,u],o)=>{if(!F(await a)&&!t||!Z(u))return i(a);let l;const d=te(await u(e),n,c);return d?(l=Object.assign(Object.assign({},d),R(c,d.message)),t&&(_[s]=l)):l=a,r.length-1===o?i(l):l},{})});if(!F(i)&&(_[s]=Object.assign({ref:n},i),!t))return _}}return _};const ie=(e,t)=>c(e.inner)?e.inner.reduce((e,{path:r,message:n,type:i})=>Object.assign(Object.assign({},e),e[r]&&t?{[r]:re(r,t,e,i,n)}:{[r]:e[r]||Object.assign({message:n,type:i},t?{types:{[i]:n||!0}}:{})}),{}):{[e.path]:{message:e.message,type:e.type}};async function se(e,t,r,n,i){if(n)return n(r,i);try{return{values:await e.validate(r,{abortEarly:!1,context:i}),errors:{}}}catch(e){return{values:{},errors:R(ie(e,t))}}}var ae=(e,t,r)=>s(e[t])?L(e,t,r):e[t];var ce=e=>a(e)||!u(e);const ue=(e,t)=>{const r=(t,r,n)=>{const i=n?`${e}.${r}`:`${e}[${r}]`;return ce(t)?i:ue(i,t)};return c(t)?t.map((e,t)=>r(e,t)):Object.entries(t).map(([e,t])=>r(t,e,!0))};var oe=(e,t)=>function e(t){return t.reduce((t,r)=>t.concat(c(r)?e(r):r),[])}(ue(e,t)),le=(e,t,r,n,i)=>{let a;return r.add(t),F(e)?a=i||void 0:s(e[t])?(a=L(R(e),t),c(i)&&c(a)&&a.length!==i.length&&(a=i),s(a)||oe(t,a).forEach(e=>r.add(e))):(a=e[t],r.add(t)),s(a)?o(n)?ae(n,t):n:a},de=({hasError:e,isBlurEvent:t,isOnSubmit:r,isReValidateOnSubmit:n,isOnBlur:i,isReValidateOnBlur:s,isSubmitted:a})=>r&&n||r&&!a||i&&!t&&!e||s&&!t&&e||n&&a,me=(e,t)=>{const r=R(K(e));return t?L(r,t,r):r};function fe(e,t){let r=!1;if(!c(e)||!c(t)||e.length!==t.length)return!0;for(let n=0;ne.startsWith(t+"[");var ge=(e,t)=>[...e].reduce((e,r)=>!!pe(t,r)||e,!1);var be=e=>({isOnSubmit:!e||e===d.onSubmit,isOnBlur:e===d.onBlur,isOnChange:e===d.onChange});const{useRef:he,useState:ve,useCallback:Oe,useEffect:ye}=n;function je({mode:e=d.onSubmit,reValidateMode:t=d.onChange,validationSchema:r,validationResolver:n,validationContext:i,defaultValues:u={},submitFocusError:g=!0,validateCriteriaMode:b}={}){const h=he({}),v="all"===b,O=he({}),y=he({}),j=he({}),S=he(new Set),x=he(new Set),_=he(new Set),w=he(new Set),E=he(!0),C=he({}),M=he(u),$=he(!1),A=he(!1),T=he(!1),z=he(!1),U=he(0),X=he(!1),Y=he(),te=he({}),re=he(i),ie=he(new Set),[,ue]=ve(),{isOnBlur:oe,isOnSubmit:pe}=he(be(e)).current,je="undefined"==typeof window,Se=!(!r&&!n),xe="undefined"!=typeof document&&!je&&!s(window.HTMLElement),_e=xe&&"Proxy"in window,we=he({dirty:!_e,dirtyFields:!_e,isSubmitted:pe,submitCount:!_e,touched:!_e,isSubmitting:!_e,isValid:!_e}),{isOnBlur:Ve,isOnSubmit:Ee}=he(be(t)).current,ke=Oe(()=>{$.current||ue({})},[]),Re=Oe((e,t,r,n)=>{let i=r||function({errors:e,name:t,error:r,validFields:n,fieldsWithValidation:i}){const s=F(r),a=F(e),c=L(r,t),u=L(e,t);return!(s&&n.has(t)||u&&u.isManual)&&(!!(a!==s||!a&&!u||s&&i.has(t)&&!n.has(t))||c&&!Q(u,c))}({errors:O.current,error:t,name:e,validFields:w.current,fieldsWithValidation:_.current});if(F(t)?((_.current.has(e)||Se)&&(w.current.add(e),i=i||L(O.current,e)),O.current=B(O.current,[e])):(w.current.delete(e),i=i||!L(O.current,e),k(O.current,e,t[e])),i&&!n)return ke(),!0},[ke,Se]),Le=Oe((e,t)=>{const r=e.ref,n=e.options,{type:i}=r,s=xe&&l(r)&&a(t)?"":t;var c;return N(r)&&n?n.forEach(({ref:e})=>e.checked=e.value===s):D(r)?W(s)||(c=s,"undefined"!=typeof FileList&&c instanceof FileList)?r.files=s:r.value=s:J(r)?[...r.options].forEach(e=>e.selected=s.includes(e.value)):I(r)&&n?n.length>1?n.forEach(({ref:e})=>e.checked=s.includes(e.value)):n[0].ref.checked=!!s:r.value=s,!!i},[xe]),Pe=e=>{if(!h.current[e]||!we.current.dirty&&!we.current.dirtyFields)return!1;const t=ge(ie.current,e),r=x.current.size;let n=C.current[e]!==H(h.current,h.current[e].ref);if(t){const t=e.substring(0,e.indexOf("["));n=fe(me(h.current,t),L(M.current,t))}const i=(t?z.current:x.current.has(e))!==n;return n?x.current.add(e):x.current.delete(e),z.current=t?n:!!x.current.size,we.current.dirty?i:r!==x.current.size},Ne=Oe(e=>{if(Pe(e)||!L(y.current,e)&&we.current.touched)return!!k(y.current,e,!0)},[]),Ie=Oe((e,t,r)=>{const n=c(t);for(const i in t){const s=`${r||e}${n?`[${i}]`:"."+i}`;o(t[i])&&Ie(e,t[i],s);const a=h.current[s];a&&(Le(a,t[i]),Ne(s))}},[Le,Ne]),qe=Oe((e,t)=>{const r=h.current[e];if(r){Le(r,t);const n=Ne(e);if(ee(n))return n}else ce(t)||Ie(e,t)},[Ne,Le,Ie]),Fe=Oe(async(e,t)=>{const r=h.current[e];if(!r)return!1;const n=await ne(h,v,r);return Re(e,n,!1,t),F(n)},[Re,v]),Ce=Oe(async e=>{const{errors:t}=await se(r,v,me(h.current),n,re.current),i=E.current;return E.current=F(t),c(e)?(e.forEach(e=>{const r=L(t,e);r?k(O.current,e,r):B(O.current,[e])}),ke()):Re(e,L(t,e)?{[e]:L(t,e)}:{},i!==E.current),F(O.current)},[ke,Re,v,n,r]),Me=Oe(async e=>{const t=e||Object.keys(h.current);if(Se)return Ce(t);if(c(t)){const e=await Promise.all(t.map(async e=>await Fe(e,!0)));return ke(),e.every(Boolean)}return await Fe(t)},[Ce,Fe,ke,Se]),Be=e=>{const t=(e.match(/\w+/)||[])[0];return A.current||S.current.has(e)||S.current.has(t)&&!V(e)&&ie.current.has(t)};function $e(e,t,r){let n=!1;const i=c(e);(i?e:[e]).forEach(e=>{const r=G(e);n=!(!qe(r?e:Object.keys(e)[0],r?t:Object.values(e)[0])&&!i)||Be(e)}),(n||i)&&ke(),(r||i&&t)&&Me(i?void 0:e)}Y.current=Y.current?Y.current:async({type:e,target:t})=>{const i=t?t.name:"",s=h.current,a=O.current,c=s[i],u=L(a,i);let o;if(!c)return;const l=e===m,d=de({hasError:!!u,isBlurEvent:l,isOnSubmit:pe,isReValidateOnSubmit:Ee,isOnBlur:oe,isReValidateOnBlur:Ve,isSubmitted:T.current}),f=Pe(i);let p=Be(i)||f;if(l&&!L(y.current,i)&&we.current.touched&&(k(y.current,i,!0),p=!0),d)return p&&ke();if(Se){const{errors:e}=await se(r,v,me(s),n,re.current),t=E.current;E.current=F(e),o=L(e,i)?{[i]:L(e,i)}:{},t!==E.current&&(p=!0)}else o=await ne(h,v,c);!Re(i,o)&&p&&ke()};const Ae=Oe((e={})=>{const t=F(M.current)?K(h.current):M.current;se(r,v,R(Object.assign(Object.assign({},t),e)),n,re.current).then(({errors:e})=>{const t=E.current;E.current=F(e),t!==E.current&&ke()})},[ke,v,n]),De=(e,t)=>{!s(Y.current)&&e&&function(e,t,r,n){if(!r)return;const{ref:i,ref:{name:s,type:a},mutationWatcher:u}=r;if(!a)return void delete e[s];const o=e[s];if((N(i)||I(i))&&o){const{options:r}=o;c(r)&&r.length?(r.forEach(({ref:e,mutationWatcher:i},s)=>{(e&&q(e)||n)&&(P(e,t),i&&i.disconnect(),B(r,[`[${s}]`]))}),r&&!r.filter(Boolean).length&&delete e[s]):delete e[s]}else(q(i)||n)&&(P(i,t),u&&u.disconnect(),delete e[s])}(h.current,Y.current,e,t)},Je=Oe((e,t)=>{if(!e||e&&ge(ie.current,e.ref.name)&&!t)return;De(e,t);const{name:r}=e.ref;O.current=B(O.current,[r]),y.current=B(y.current,[r]),C.current=B(C.current,[r]),[x,_,w,S].forEach(e=>e.current.delete(r)),(we.current.isValid||we.current.touched)&&(ke(),Se&&Ae())},[ke,Se,Ae]);const We=({name:e,type:t,types:r,message:n,preventRender:i})=>{const s=h.current[e];Q(O.current[e],{type:t,message:n,types:r})||(k(O.current,e,{type:t,types:r,message:n,ref:s?s.ref:{},isManual:!0}),i||ke())};function Te(e){F(h.current)||(c(e)?e:[e]).forEach(e=>Je(h.current[e],!0))}function ze(e,t={}){if(!e.name)return console.warn("Missing name @",e);const{name:r,type:n,value:i}=e,a=Object.assign({ref:e},t),u=h.current,o=N(e)||I(e);let d,g=u[r],b=!0,O=!1;if(o?g&&c(g.options)&&g.options.find(({ref:e})=>i===e.value):g)return void(u[r]=Object.assign(Object.assign({},g),t));if(n){const i=function(e,t){const r=new MutationObserver(()=>{q(e)&&(r.disconnect(),t())});return r.observe(window.document,{childList:!0,subtree:!0}),r}(e,()=>Je(a));g=o?Object.assign({options:[...g&&g.options||[],{ref:e,mutationWatcher:i}],ref:{type:n,name:r}},t):Object.assign(Object.assign({},a),{mutationWatcher:i})}else g=a;if(u[r]=g,F(M.current)||(d=ae(M.current,r),b=s(d),O=ge(ie.current,r),b||O||Le(g,d)),Se&&!O&&we.current.isValid?Ae():F(t)||(_.current.add(r),!pe&&we.current.isValid&&ne(h,v,g).then(e=>{const t=E.current;F(e)?w.current.add(r):E.current=!1,t!==E.current&&ke()})),C.current[r]||O&&b||(C.current[r]=b?H(u,g.ref):d),!n)return;!function({field:e,handleChange:t,isRadioOrCheckbox:r}){const{ref:n}=e;l(n)&&n.addEventListener&&t&&(n.addEventListener(r?f:p,t),n.addEventListener(m,t))}({field:o&&g.options?g.options[g.options.length-1]:g,isRadioOrCheckbox:o,handleChange:Y.current})}function Ue(e,t){if(!je)if(G(e))ze({name:e},t);else{if(!o(e)||!("name"in e))return t=>t&&ze(t,e);ze(e,t)}}const He=Oe(e=>async t=>{let i,s;t&&(t.preventDefault(),t.persist());const a=h.current;we.current.isSubmitting&&(X.current=!0,ke());try{if(Se){s=K(a);const{errors:e,values:t}=await se(r,v,R(s),n,re.current);O.current=e,i=e,s=t}else{const{errors:e,values:t}=await Object.values(a).reduce(async(e,t)=>{if(!t)return e;const r=await e,{ref:n,ref:{name:i}}=t;if(!a[i])return Promise.resolve(r);const s=await ne(h,v,t);return s[i]?(k(r.errors,i,s[i]),w.current.delete(i),Promise.resolve(r)):(_.current.has(i)&&w.current.add(i),r.values[i]=H(a,n),Promise.resolve(r))},Promise.resolve({errors:{},values:{}}));i=e,s=t}F(i)?(O.current={},await e(R(s),t)):(g&&xe&&((e,t)=>{for(const r in e)if(L(t,r)){const t=e[r];if(t){if(l(t.ref)&&t.ref.focus){t.ref.focus();break}if(t.options){t.options[0].ref.focus();break}}}})(a,i),O.current=i)}finally{T.current=!0,X.current=!1,U.current=U.current+1,ke()}},[xe,ke,Se,g,v,n,r]),Ge=e=>{const t=K(h.current),r=F(t)?M.current:t;return e&&e.nest?R(r):r};ye(()=>()=>{$.current=!0,h.current&&Object.values(h.current).forEach(e=>Je(e,!0))},[Je]),Se||(E.current=w.current.size>=_.current.size&&F(O.current));const Ke={dirty:z.current,dirtyFields:x.current,isSubmitted:T.current,submitCount:U.current,touched:y.current,isSubmitting:X.current,isValid:pe?T.current&&F(O.current):E.current};return{watch:function(e,t){const r=s(t)?s(M.current)?{}:M.current:t,n=K(h.current,e),i=S.current;if(G(e))return le(n,e,i,r,ie.current.has(e)?j.current[e]:void 0);if(c(e))return e.reduce((e,t)=>{let s;return s=F(h.current)&&o(r)?ae(r,t):le(n,t,i,r),Object.assign(Object.assign({},e),{[t]:s})},{});A.current=!0;const a=!F(n)&&n||t||M.current;return e&&e.nest?R(a):a},control:Object.assign(Object.assign({register:Ue,unregister:Te,removeFieldEventListener:De,getValues:Ge,setValue:$e,reRender:ke,triggerValidation:Me},Se?{validateSchemaIsValid:Ae}:{}),{formState:Ke,mode:{isOnBlur:oe,isOnSubmit:pe},reValidateMode:{isReValidateOnBlur:Ve,isReValidateOnSubmit:Ee},errorsRef:O,touchedFieldsRef:y,fieldsRef:h,resetFieldArrayFunctionRef:te,validFieldsRef:w,fieldsWithValidationRef:_,watchFieldArrayRef:j,fieldArrayNamesRef:ie,isDirtyRef:z,readFormStateRef:we,defaultValuesRef:M}),handleSubmit:He,setValue:Oe($e,[ke,qe,Me]),triggerValidation:Me,getValues:Oe(Ge,[]),reset:Oe(e=>{if(xe)for(const e of Object.values(h.current))if(e&&l(e.ref)&&e.ref.closest)try{e.ref.closest("form").reset();break}catch(e){}e&&(M.current=e),Object.values(te.current).forEach(e=>Z(e)&&e()),O.current={},h.current={},y.current={},w.current=new Set,_.current=new Set,C.current={},S.current=new Set,x.current=new Set,A.current=!1,T.current=!1,z.current=!1,E.current=!0,U.current=0,ke()},[]),register:Oe(Ue,[M.current,C.current,j.current]),unregister:Oe(Te,[]),clearError:Oe((function(e){s(e)?O.current={}:B(O.current,c(e)?e:[e]),ke()}),[]),setError:Oe((function(e,t="",r){G(e)?We(Object.assign({name:e},o(t)?{types:t,type:""}:{type:t,message:r})):c(e)&&(e.forEach(e=>We(Object.assign(Object.assign({},e),{preventRender:!0}))),ke())}),[]),errors:O.current,formState:_e?new Proxy(Ke,{get:(e,t)=>t in e?(we.current[t]=!0,e[t]):{}}):Ke}}function Se(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i{var{name:t,rules:r,as:i,onBlur:a,onChange:c,onChangeName:u=d.onChange,onBlurName:l=d.onBlur,valueName:m,defaultValue:f,control:p}=e,g=Se(e,["name","rules","as","onBlur","onChange","onChangeName","onBlurName","valueName","defaultValue","control"]);const b=_e(),{defaultValuesRef:h,setValue:v,register:O,unregister:y,errorsRef:j,removeFieldEventListener:S,triggerValidation:x,mode:{isOnSubmit:_,isOnBlur:w},reValidateMode:{isReValidateOnBlur:V,isReValidateOnSubmit:E},formState:{isSubmitted:k},fieldsRef:R,fieldArrayNamesRef:P}=p||b.control,[N,I]=Object(n.useState)(s(f)?L(h.current,t):f),q=Object(n.useRef)(N),F=ee(N),C=()=>!de({hasError:!!L(j.current,t),isOnBlur:w,isOnSubmit:_,isReValidateOnBlur:V,isReValidateOnSubmit:E,isSubmitted:k}),M=e=>{const t=((e,t)=>ce(e)||!o(e.target)||o(e.target)&&!e.type?e:t||s(e.target.value)?e.target.checked:e.target.value)(e,F);return I(t),q.current=t,t},B=()=>{ge(P.current,t)&&R.current[t]&&S(R.current[t],!0),O(Object.defineProperty({name:t},"value",{set(e){I(e),q.current=e},get:()=>q.current}),Object.assign({},r))};Object(n.useEffect)(()=>{R.current[t]||(B(),I(s(f)?L(h.current,t):f))}),Object(n.useEffect)(()=>(B(),()=>{ge(P.current,t)||y(t)}),[t]);const $=w||V,A=Object.assign(Object.assign(Object.assign(Object.assign({name:t},g),c?{[u]:(D=c,(...e)=>v(t,M(D(e)),C()))}:{[u]:e=>{const r=M(e);v(t,r,C())}}),a||$?{[l]:(...e)=>{a&&a(e),$&&x(t)}}:{}),{[m||(F?"checked":"value")]:N});var D;return Object(n.isValidElement)(i)?Object(n.cloneElement)(i,A):Object(n.createElement)(i,A)},Le=(e,t)=>e+"/"+t,Pe=e=>{const t=e.split("/");return"#"===t[0]&&t.shift(),t},Ne=/^[a-z][a-z0-9+.-]*:/i,Ie=e=>Ne.test(e),qe=/^#(\/(([^#/~])|(~[01]))*)*/i,Fe=(e,t,r)=>{if(Ie(e)){const r=new URL(e);if(r.hash)return Fe(r.hash,t,t[`${r.origin}${r.pathname}`])}else if(n=e,qe.test(n)&&r)return Pe(e).reduce((e,t)=>{if(e)return e[t]},r);var n;return t[e]},Ce=(e,t,r)=>{let n={};if(e.$ref){const i=e.$ref;if(r.indexOf(i)>-1)return n;r.push(i),n=Object.assign({},Fe(i,t))}else n=Object.assign({},e);return Object.keys(n).reduce((e,n)=>("object"!=typeof e[n]||null===e[n]||Array.isArray(e[n])||r.indexOf(e[n].$ref)>-1||(e[n]=Ce(e[n],t,r.slice())),e),n)},Me={integer:e=>parseInt(e),number:e=>parseFloat(e),boolean:e=>"true"===e},Be=(e,t)=>Object.keys(t).sort().reduce((r,n)=>{const i=Pe(n);return i&&t[n]?(i.reduce((e,r,i,s)=>{var a;return e.currentSubSchema=e.currentSubSchema?e.currentSubSchema[r]:void 0,"properties"!==r||e.insideProperties?(i===s.length-1&&e.currentSubSchema?e.currentJSON[r]=e.currentSubSchema.type&&Me[e.currentSubSchema.type]?Me[e.currentSubSchema.type](t[n]):null!==(a=e.targetData)&&void 0!==a?a:{}:!e.currentJSON[r]&&e.currentSubSchema&&(e.currentJSON[r]={}),e.currentJSON=e.currentJSON[r],Object.assign(Object.assign({},e),{insideProperties:!1})):Object.assign(Object.assign({},e),{insideProperties:!0})},{currentJSON:r,currentSubSchema:e,insideProperties:!1,targetData:t[n]}),r):r},{}),$e=(e,t,r)=>{var n;const{schema:i}=r,s=Pe(e).reduce((e,t)=>{var r;const{JSONSchema:n,currentData:i}=e;if(!(n&&"object"===n.type||e.insideProperties))return Object.assign(Object.assign({},e),{JSONSchema:void 0,invalidPointer:!0});if("properties"===t&&!e.insideProperties){const i=e.isRequired;return Object.assign(Object.assign({},e),{JSONSchema:n.properties,fatherIsRequired:i,pointer:Le(e.pointer,t),insideProperties:!0,currentRequiredField:null!==(r=n.required)&&void 0!==r?r:[]})}const s=!!i,a=i?i[t]:i,c=e.currentRequiredField.indexOf(t)>-1;return Object.assign(Object.assign({},e),{JSONSchema:n[t],currentData:a,fatherExists:s,isRequired:c,invalidPointer:!1,objectName:t,pointer:Le(e.pointer,t),insideProperties:!1})},{JSONSchema:i,currentData:t,fatherExists:!0,fatherIsRequired:!0,invalidPointer:!1,isRequired:!0,objectName:"",pointer:"#",insideProperties:!1,currentRequiredField:null!==(n=i.required)&&void 0!==n?n:[]});return{JSONSchema:s.JSONSchema,invalidPointer:s.invalidPointer,isRequired:s.fatherIsRequired&&s.isRequired||!s.fatherIsRequired&&s.isRequired&&s.fatherExists,objectName:s.objectName,pointer:s.pointer}},Ae=Object(n.createContext)(null);function De(){return Object(n.useContext)(Ae)}const Je=e=>{const{formProps:t,onChange:r,validationMode:s="onSubmit",revalidateMode:a="onChange",submitFocusError:c=!0,defaultValues:u}=e,o=je({defaultValues:u,mode:s,reValidateMode:a,submitFocusError:c}),l=i.a.useRef(!0);if("function"==typeof r){const t=o.watch();!1===l.current&&r(Be(e.schema,t))}const d=Object(n.useMemo)(()=>(e=>{const t=(e,r,n)=>Object.keys(r).reduce((i,s)=>{if("object"==typeof r[s]&&null!==r[s]&&!Array.isArray(r[s]))return Object.assign(Object.assign({},t(Le(e,s),r[s],n)),i);const a=r[s];if("$id"===s&&a&&(i[a]=r,!Ie(a)))try{i[new URL(a,n).href]=r}catch(e){if(!(e instanceof TypeError))throw e}return i},{[e]:r});let r=void 0;if(e.$id&&Ie(e.$id))try{r=new URL(e.$id)}catch(e){if(r=void 0,!(e instanceof TypeError))throw e}return r?Object.assign({[r.href]:e},t("#",e,r)):t("#",e,r)})(e.schema),[e.schema]),m=Object(n.useMemo)(()=>Ce(e.schema,d,[]),[e.schema,d]),f=Object(n.useMemo)(()=>Object.assign(Object.assign({},o),{schema:m,idMap:d,customValidators:e.customValidators}),[o,m,d,e.customValidators]),p=Object.assign({},t);return p.onSubmit=o.handleSubmit(async(t,r)=>{if(e.onSubmit)return e.onSubmit({data:Be(e.schema,t),event:r,methods:f})}),e.noNativeValidate&&(p.noValidate=e.noNativeValidate),!0===l.current&&(l.current=!1),i.a.createElement(Ae.Provider,{value:f},i.a.createElement("form",Object.assign({},p),e.children))};var We,Te,ze,Ue;(Ue=We||(We={})).generic="generic",Ue.radio="radio",Ue.select="select",Ue.input="input",Ue.textArea="textArea",Ue.checkbox="checkbox",function(e){e.default="default",e.radio="radio",e.select="select",e.input="input",e.hidden="hidden",e.password="password",e.textArea="textArea",e.checkbox="checkbox"}(Te||(Te={})),function(e){e.required="__form_error_required__",e.maxLength="__form_error_maxLength__",e.minLength="__form_error_minLength__",e.maxValue="__form_error_maxValue__",e.minValue="__form_error_minValue__",e.pattern="__form_error_pattern__",e.notInteger="__form_error_notInteger__",e.notFloat="__form_error_notFloat__",e.multipleOf="__form_error_multipleOf__",e.notInEnum="__form_error_notInEnum",e.undefinedError="__form_error_undefinedError__"}(ze||(ze={}));const He=(e,t)=>{const r=Math.pow(10,t||0);return String(Math.round(e*r)/r)},Ge=e=>{const t=void 0!==e.multipleOf?"integer"===e.type?parseInt(e.multipleOf):parseFloat(e.multipleOf):"integer"===e.type?1:"any";let r=void 0;if(e.multipleOf){const t=e.multipleOf.toString().split(".")[1];r=t?t.length:0}return[t,r]},Ke=e=>{const[t]=Ge(e);let r=void 0!==e.exclusiveMinimum?e.exclusiveMinimum:void 0!==e.minimum?e.minimum:void 0;return void 0!==r&&void 0!==e.exclusiveMinimum&&(r+=t&&"any"!=t?t:1e-4),r},Qe=e=>{const[t]=Ge(e);let r=void 0!==e.exclusiveMaximum?parseFloat(e.exclusiveMaximum):void 0!==e.maximum?parseFloat(e.maximum):void 0;return void 0!==r&&void 0!==e.exclusiveMaximum&&(r-=t&&"any"!=t?t:1e-4),r};function Xe(e,t){return Object.keys(e).reduce((r,n)=>(r[n]=r=>e[n](r,t),r),{})}const Ye=(e,t)=>{const{JSONSchema:r,isRequired:n}=e,i=Object.keys(t).length>0||r.enum,s=Object.assign({},i?{validate:Object.assign(Object.assign({},Xe(t,e)),r.enum?{enumValidator:e=>{if(!r.enum||!e)return!0;for(const t of r.enum)if(t==e)return!0;return ze.notInEnum}}:void 0)}:void 0);switch(n&&(s.required=ze.required),r.type){case"integer":case"number":return((e,t)=>{const r=Ke(e),n=Qe(e);return t.validate=Object.assign(Object.assign({},t.validate),{multipleOf:t=>"integer"!==e.type||!t||e.multipleOf&&(parseInt(t)%parseInt(e.multipleOf)==0||ze.multipleOf)}),"integer"===e.type?t.pattern={value:/^([+-]?[1-9]\d*|0)$/,message:ze.notInteger}:t.pattern={value:/^([+-]?[0-9]+([.][0-9]+))?$/,message:ze.notFloat},(r||0===r)&&(t.min={value:r,message:ze.minValue}),(n||0===n)&&(t.max={value:n,message:ze.maxValue}),t})(r,s);case"string":return c=s,(a=r).minLength&&(c.minLength={value:a.minLength,message:ze.minLength}),a.maxLength&&(c.maxLength={value:a.maxLength,message:ze.maxLength}),a.pattern&&(c.pattern={value:new RegExp(a.pattern),message:ze.pattern}),c;case"boolean":return s;default:return{}}var a,c},Ze=(e,t)=>$e(e,t,De()),et=(e,t)=>{var r;const n=Pe(e);let i=!1;return null===(r=n.reduce((e,t)=>"properties"!==t||i?(i=!1,{currentData:e.currentData?e.currentData[t]:void 0,insideProperties:!0}):(i=!0,Object.assign(Object.assign({},e),{insideProperties:!0})),{currentData:t,insideProperties:!1}).currentData)||void 0===r?void 0:r.toString()},tt=(e,t,r)=>{var n;const{JSONSchema:i,isRequired:s,objectName:a}=t;let c,u,o;if("number"===i.type||"integer"===i.type){const e=Ge(i);o=e[0],c=Ke(i),u=Qe(i)}return{name:a,pointer:r,isRequired:s,formContext:e,type:We.generic,validator:Ye(t,null!==(n=e.customValidators)&&void 0!==n?n:{}),getError:()=>((e,t,r,n,i,s,a,c)=>{if("array"===t.type){const e=n.getValues({nest:!0})[i];if(e){const r=e.filter(e=>!1!==e).length||0;if(t.minItems&&rt.maxItems)return{message:ze.maxLength,expected:t.maxItems}}}if(!e)return;const u={message:"string"==typeof e.message?e.message:ze.undefinedError,expected:void 0};switch(e.message){case ze.required:u.message=ze.required,u.expected=r;break;case ze.maxLength:u.message=ze.maxLength,u.expected=t.maxLength;break;case ze.minLength:u.message=ze.minLength,u.expected=t.minLength;break;case ze.maxValue:u.message=ze.maxValue,u.expected=a;break;case ze.minValue:u.message=ze.minValue,u.expected=s;break;case ze.multipleOf:u.message=ze.multipleOf,u.expected=c;break;case ze.pattern:u.message=ze.pattern,u.expected=t.pattern;break;case ze.notInEnum:u.message=ze.notInEnum,u.expected=t.enum}return u})(e.errors[r]?e.errors[r]:void 0,i,s,e,r,c,u,o),getObject:()=>i,getCurrentValue:()=>e.getValues()[r]}},rt=e=>{const t=De(),r=Be(t.schema,t.getValues()),n=Ze(e,r);return tt(t,n,e)},nt=e=>e?e.toString():"",it=e=>e.enum?e.enum.map(nt):[],st=(e,t,r)=>e+"-checkbox-input-"+(r[t]?r[t]:""),at=e=>{const{register:t}=e.formContext,{validator:r}=e,n=e.getObject();let i,s,a,c,u=[];if("array"===n.type){if(n.items.enum)u=it(n.items);else if("string"===n.items.type)u=it(n);else if("number"===n.items.type||"integer"===n.items.type){const e=Ge(n);if(a=e[0],c=e[1],i=Ke(n),s=Qe(n),void 0!==i&&void 0!==s&&"any"!=a)for(let e=i;e<=s;e+=a)u.push(He(e,c||0))}n.uniqueItems&&(u=[...new Set(u)])}else"boolean"===n.type&&(u=["true"]);return Object.assign(Object.assign({},e),{type:We.checkbox,isSingle:"boolean"===n.type,getItemInputProps:i=>{const s={key:""};return s.name="array"===n.type?`${e.pointer}[${i}]`:e.pointer,s.ref=t(r),s.type="checkbox",s.id=st(e.pointer,i,u),s.value=u[i],s},getItemLabelProps:t=>{const r={};return r.id=((e,t,r)=>e+"-checkbox-label-"+(r[t]?r[t]:""))(e.pointer,t,u),r.htmlFor=st(e.pointer,t,u),r},getItems:()=>u})},ct=e=>at(rt(e)),ut=(e,t)=>e+"-"+t+"-input",ot=(e,t)=>{const{register:r}=e.formContext,{validator:n}=e,i=e.getObject();let s,a,c,u;const o={key:""};if("string"===i.type)o.pattern=i.pattern,o.minLength=i.minLength,o.maxLength=i.maxLength;else if("number"===i.type||"integer"===i.type){const e=Ge(i);c=e[0],u=e[1],s=Ke(i),a=Qe(i),o.min=""+s,o.max=""+a,o.step="any"===c?"any":He(c,u||0)}return Object.assign(Object.assign({},e),{type:We.input,getLabelProps:()=>{const r={};return r.id=((e,t)=>e+"-"+t+"-label")(e.pointer,t),r.htmlFor=ut(e.pointer,t),r},getInputProps:()=>(o.name=e.pointer,o.ref=r(n),o.type=t,o.required=e.isRequired,o.id=ut(e.pointer,t),o)})},lt=()=>({}),dt=e=>Object.assign(Object.assign({},ot(e,"hidden")),{isRequired:!1,getLabelProps:lt}),mt=e=>dt(rt(e)),ft=e=>{const t=e.getObject();let r="text";if("string"===t.type)switch(t.format){case"date":r="date";break;case"date-time":r="datetime-local";break;case"email":r="email";break;case"hostname":case"uri":r="url"}else"integer"!==t.type&&"number"!==t.type||(r="number");return ot(e,r)},pt=e=>ft(rt(e)),gt=(e,t,r)=>e+"-radio-input-"+(r[t]?r[t]:""),bt=e=>{const{register:t}=e.formContext,{validator:r}=e,n=e.getObject();let i,s,a,c,u=[];if("string"===n.type)u=it(n);else if("number"===n.type||"integer"===n.type){const e=Ge(n);if(a=e[0],c=e[1],i=Ke(n),s=Qe(n),void 0!==i&&void 0!==s&&"any"!=a)for(let e=i;e<=s;e+=a)u.push(He(e,c||0))}else"boolean"===n.type&&(u=["true","false"]);return Object.assign(Object.assign({},e),{type:We.radio,getLabelProps:()=>{const t={};return t.id=e.pointer+"-label",t.htmlFor=void 0!==n.title?n.title:e.pointer,t},getItemInputProps:n=>{const i={key:""};return i.name=e.pointer,i.ref=t(r),i.type="radio",i.required=e.isRequired,i.id=gt(e.pointer,n,u),i.value=u[n],i},getItemLabelProps:t=>{const r={};return r.id=((e,t,r)=>e+"-radio-label-"+(r[t]?r[t]:""))(e.pointer,t,u),r.htmlFor=gt(e.pointer,t,u),r},getItems:()=>u})},ht=e=>bt(rt(e)),vt=e=>e+"-select",Ot=e=>{const{register:t}=e.formContext,{validator:r}=e,n=e.getObject();let i,s,a,c,u=[""];if("string"===n.type)u=u.concat(it(n));else if("number"===n.type||"integer"===n.type){const e=Ge(n);if(a=e[0],c=e[1],i=Ke(n),s=Qe(n),void 0!==i&&void 0!==s&&"any"!=a)for(let e=i;e<=s;e+=a)u.push(He(e,c||0))}else"boolean"===n.type&&(u=["true","false"]);return Object.assign(Object.assign({},e),{type:We.select,validator:r,getLabelProps:()=>{const t={};return t.id=e.pointer+"-label",t.htmlFor=vt(e.pointer),t},getSelectProps:()=>{const n={};return n.name=e.pointer,n.ref=t(r),n.required=e.isRequired,n.id=vt(e.pointer),n},getItemOptionProps:t=>{const r={};return r.id=((e,t,r)=>e+"-select-option-"+(r[t]?r[t]:""))(e.pointer,t,u),r.value=u[t],r},getItems:()=>u})},yt=e=>Ot(rt(e)),jt=e=>ot(e,"password"),St=e=>jt(rt(e)),xt=e=>e+"-textarea-input",_t=e=>{const{register:t}=e.formContext,{validator:r}=e,n=e.getObject(),i={};return"string"===n.type&&(i.minLength=n.minLength,i.maxLength=n.maxLength),Object.assign(Object.assign({},e),{type:We.textArea,getLabelProps:()=>{const t={};return t.id=e.pointer+"-textarea-label",t.htmlFor=xt(e.pointer),t},getTextAreaProps:()=>(i.name=e.pointer,i.ref=t(r),i.required=e.isRequired,i.id=xt(e.pointer),i)})},wt=e=>_t(rt(e));function Vt(e){const t=e.getObject(),r=[];switch(t.type){case"string":t.enum?r.push(Ot(e)):r.push(ft(e));break;case"integer":case"number":r.push(ft(e));break;case"array":case"boolean":r.push(at(e))}return r}const Et=e=>{const t=De(),r=Be(t.schema,t.getValues());return function e(t,r,n,i,s){let a=[];const{JSONSchema:c}=r,u=tt(t,r,n);if("object"===c.type)return Object.keys(c.properties).reduce(function(t,r,n,i){return(s,a)=>{const c=r&&r.properties?r.properties[a]:void 0,u=Le(Le(t,"properties"),a),o=$e(u,i,n),l=e(n,o,u,c,i);return s.concat(l)}}(n,i,t,s),[]);if(!i)return a.concat(Vt(u));switch(i.type){case Te.default:a=a.concat(Vt(u));break;case Te.checkbox:a.push(at(u));break;case Te.hidden:a.push(dt(u));break;case Te.input:a.push(ft(u));break;case Te.password:a.push(jt(u));break;case Te.radio:a.push(bt(u));break;case Te.select:a.push(Ot(u));break;case Te.textArea:a.push(_t(u))}return a}(t,Ze(e.pointer,r),e.pointer,e.UISchema,r)}}]]); },function(){ (window.webpackJsonpvtex_store_form_0_10_1=window.webpackJsonpvtex_store_form_0_10_1||[]).push([[1],{11:function(e,t,r){"use strict";r.d(t,"a",(function(){return s})),r.d(t,"c",(function(){return m})),r.d(t,"d",(function(){return b})),r.d(t,"b",(function(){return d}));var n=r(4),a=r(0),o=r.n(a),c=r(10),l=r.n(c),u=r(1),i=r(5),s=function(e){var t=e.pointer,r=e.value,a=Object(u.g)(t);return o.a.createElement("input",Object(n.a)({},a.getInputProps(),{value:r}))},m=function(e){var t=e.pointer,r=e.label,n=e.placeholder,a=Object(u.j)(t);return o.a.createElement(d,{inputObject:a,label:r,placeholder:n})},b=function(e){var t=e.pointer,r=e.label,n=e.placeholder,a=Object(u.h)(t);return o.a.createElement(d,{inputObject:a,label:r,placeholder:n})},d=function(e){var t,r,a=e.inputObject,c=e.placeholder,u=a.getError(),s=a.getObject(),m=null!==(r=null!==(t=e.label)&&void 0!==t?t:s.title)&&void 0!==r?r:a.name;return o.a.createElement(l.a,Object(n.a)({},a.getInputProps(),{label:m,error:!!u,errorMessage:Object(i.a)(u),placeholder:c}))}},22:function(e,t,r){"use strict";r.d(t,"b",(function(){return s})),r.d(t,"a",(function(){return m}));var n=r(4),a=r(0),o=r.n(a),c=r(18),l=r.n(c),u=r(1),i=r(5),s=function(e){var t=Object(u.m)(e.pointer);return o.a.createElement(m,{textAreaObject:t,label:e.label,placeholder:e.placeholder})},m=function(e){var t,r,a=e.textAreaObject,c=e.placeholder,u=a.getError(),s=a.getObject(),m=null!==(r=null!==(t=e.label)&&void 0!==t?t:s.title)&&void 0!==r?r:a.name;return o.a.createElement(l.a,Object(n.a)({},a.getTextAreaProps(),{label:m,error:!!u,errorMessage:Object(i.a)(u),placeholder:c}))}},23:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(0),a=r.n(n),o=r(19),c=r.n(o),l=r(1),u=r(5),i=function(e){var t=e.pointer,r=e.label,n=Object(l.k)(t);return a.a.createElement(s,{radioObject:n,label:r})},s=function(e){var t,r,n=e.radioObject,o=n.getError(),i=n.getObject(),s=null!==(r=null!==(t=e.label)&&void 0!==t?t:i.title)&&void 0!==r?r:n.name;return a.a.createElement(l.a,{name:n.pointer,control:n.formContext.control,rules:n.validator,as:a.a.createElement(c.a,{name:s,required:n.isRequired,hideBorder:!0,label:s,options:n.getItems().map((function(e){return{value:e,label:e}})),error:!!o,errorMessage:Object(u.a)(o)})})}},24:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(0),a=r.n(n),o=r(20),c=r.n(o),l=r(1),u=r(5),i=function(e){var t=Object(l.l)(e.pointer);return a.a.createElement(s,{selectObject:t,label:e.label})},s=function(e){var t,r,o=e.selectObject,i=o.getError(),s=o.getObject(),m=null!==(r=null!==(t=e.label)&&void 0!==t?t:s.title)&&void 0!==r?r:o.name,b=o.getItems(),d=Object(n.useMemo)((function(){return b.map((function(e){return{value:e,label:e}}))}),[b]);return a.a.createElement(a.a.Fragment,null,a.a.createElement(l.a,{name:o.pointer,control:o.formContext.control,rules:o.validator,as:a.a.createElement(c.a,{name:m,multi:!1,label:m,options:d,error:!!i,errorMessage:Object(u.a)(i)})}))}},25:function(e,t,r){"use strict";r.d(t,"b",(function(){return i})),r.d(t,"a",(function(){return s}));var n=r(4),a=r(0),o=r.n(a),c=r(14),l=r.n(c),u=r(1),i=function(e){var t=Object(u.f)(e.pointer);return o.a.createElement(s,{checkboxObject:t,label:e.label})},s=function(e){var t,r,a=e.checkboxObject,c=a.getObject(),u=null!==(r=null!==(t=e.label)&&void 0!==t?t:c.title)&&void 0!==r?r:a.name;if(a.isSingle){var i=a.formContext.watch(a.pointer);return o.a.createElement(o.a.Fragment,null,o.a.createElement(l.a,Object(n.a)({},a.getItemInputProps(0),{label:u,required:a.isRequired,checked:Boolean(i),value:"true",onChange:function(){var e=a.pointer;a.formContext.setValue(e,!i)}})))}return o.a.createElement(o.a.Fragment,null,a.getItems().map((function(e,t){var r=a.formContext.watch("".concat(a.pointer,"[").concat(t,"]"));return o.a.createElement(l.a,Object(n.a)({},a.getItemInputProps(t),{key:"".concat(e).concat(t),label:u,required:a.isRequired,value:e},r?{checked:!0}:{checked:!1},{onChange:function(){var e=a.pointer;a.formContext.setValue(e,!r)},checked:Boolean(r)}))})))}},28:function(e,t,r){"use strict";r.d(t,"a",(function(){return b}));var n=r(0),a=r.n(n),o=r(1),c=r(11),l=r(22),u=r(23),i=r(24),s=r(25),m=function(e){switch(e.baseObject.type){case o.d.input:var t=e.baseObject;return a.a.createElement(c.b,{inputObject:t});case o.d.radio:var r=e.baseObject;return a.a.createElement(u.a,{radioObject:r});case o.d.select:var n=e.baseObject;return a.a.createElement(i.a,{selectObject:n});case o.d.textArea:var m=e.baseObject;return a.a.createElement(l.a,{textAreaObject:m});case o.d.checkbox:var b=e.baseObject;return a.a.createElement(s.a,{checkboxObject:b});default:return a.a.createElement(a.a.Fragment,null)}},b=function(e){var t=e.pointer,r=e.uiSchema,n=Object(o.i)({pointer:t,UISchema:r});return a.a.createElement(a.a.Fragment,null,n.map((function(e){return a.a.createElement("div",{key:"".concat(e.type).concat(e.pointer)},a.a.createElement(m,{baseObject:e}))})))}},5:function(e,t,r){"use strict";r.d(t,"a",(function(){return c}));var n=r(2),a=r(1),o=Object(n.defineMessages)({required:{id:"store/form.error.required"},maxLength:{id:"store/form.error.maxLength"},minLength:{id:"store/form.error.minLength"},maxValue:{id:"store/form.error.maxValue"},minValue:{id:"store/form.error.minValue"},notFloat:{id:"store/form.error.notFloat"},notInteger:{id:"store/form.error.notInteger"},pattern:{id:"store/form.error.pattern"},notInEnum:{id:"store/form.error.notInEnum"},multipleOf:{id:"store/form.error.multipleOf"},genericError:{id:"store/form.error.undefinedError"}}),c=function(e){var t,r,c,l,u,i=Object(n.useIntl)();if(!e)return"";switch(e.message){case a.b.required:return i.formatMessage(o.required);case a.b.maxLength:return i.formatMessage(o.maxLength,{value:null===(t=e.expected)||void 0===t?void 0:t.toString()});case a.b.minLength:return i.formatMessage(o.minLength,{value:null===(r=e.expected)||void 0===r?void 0:r.toString()});case a.b.maxValue:return i.formatMessage(o.maxValue,{value:null===(c=e.expected)||void 0===c?void 0:c.toString()});case a.b.minValue:return i.formatMessage(o.minValue,{value:null===(l=e.expected)||void 0===l?void 0:l.toString()});case a.b.notFloat:return i.formatMessage(o.notFloat);case a.b.notInteger:return i.formatMessage(o.notInteger);case a.b.notInEnum:return i.formatMessage(o.notInEnum);case a.b.pattern:return i.formatMessage(o.pattern);case a.b.multipleOf:return i.formatMessage(o.multipleOf,{value:null===(u=e.expected)||void 0===u?void 0:u.toString()});default:return i.formatMessage(o.genericError)}}}}]); },function(){ (window.webpackJsonpvtex_store_form_0_10_1=window.webpackJsonpvtex_store_form_0_10_1||[]).push([["Form"],[function(e,n){e.exports=React},,function(e,n){e.exports=ReactIntl},,,,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.native-types@0.x/IOMessage"]},,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Input"]},,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Alert"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Button"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Checkbox"]},function(e,n,t){"use strict";t.d(n,"b",(function(){return o})),t.d(n,"a",(function(){return u}));var r=t(0),a={loading:!1,userInputError:null,serverError:null,success:null};function i(e,n){switch(n.type){case"SET_LOADING":return{loading:!0,userInputError:null,serverError:null,success:null};case"SET_SUCCESS":return{loading:!1,userInputError:!1,serverError:null,success:!0};case"SET_USER_INPUT_ERROR":return Object.assign(Object.assign({},e),{loading:!1,userInputError:!0,success:!1});case"SET_SERVER_INTERNAL_ERROR":return Object.assign(Object.assign({},e),{loading:!1,serverError:!0,success:!1});default:return e}}var o=function(){return Object(r.useReducer)(i,a)},u=t.n(r).a.createContext(a)},,function(e,n){e.exports=ReactApollo},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Textarea"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/RadioGroup"]},function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/Dropdown"]},,,,,,function(e,n){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@0.x/useCssHandles"]},function(e,n,t){"use strict";t.r(n),t.d(n,"default",(function(){return b}));var r=t(0),a=t.n(r),i=t(2),o=t(13),u=t.n(o),c=t(12),s=t.n(c),d=t(26),m=t.n(d),l=t(7),f=t.n(l),v=t(15),p=["formSubmitContainer","formSubmitButton","formErrorServer","formErrorUserInput"],E=Object(i.defineMessages)({submitButton:{id:"store/form.submit.buttonLabel"},userInputError:{id:"store/form.submit.error.userInputError"},serverError:{id:"store/form.submit.error.serverError"}});function b(e){var n=e.label,t=void 0===n?E.submitButton.id:n,i=Object(r.useContext)(v.a),o=i.loading,c=i.userInputError,d=i.serverError,l=m()(p);return a.a.createElement("div",{className:l.formSubmitContainer},a.a.createElement("div",{className:l.formSubmitButton},a.a.createElement(u.a,{type:"submit",isLoading:o},a.a.createElement(f.a,{id:t}))),a.a.createElement("div",{className:l.formErrorUserInput},c&&a.a.createElement(s.a,{type:"error"},a.a.createElement(f.a,{id:E.userInputError.id}))),a.a.createElement("div",{className:l.formErrorServer},d&&a.a.createElement(s.a,{type:"error"},a.a.createElement(f.a,{id:E.serverError.id}))))}},,,function(e,n){e.exports=regeneratorRuntime},function(e,n){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"getPublicSchema"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"schema"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.store-form@0.10.1",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"documentPublicSchema"},arguments:[{kind:"Argument",name:{kind:"Name",value:"dataEntity"},value:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}}},{kind:"Argument",name:{kind:"Name",value:"schema"},value:{kind:"Variable",name:{kind:"Name",value:"schema"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.store-graphql",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"f3722824087d2db9766a00227bb44916dfa425060002028aba80d740d8bb31fe",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"schema"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:334}};t.loc.source={body:'query getPublicSchema($dataEntity: String!, $schema: String!) @context(sender: "vtex.store-form@0.10.1") {\n documentPublicSchema(dataEntity: $dataEntity, schema: $schema) @context(provider: "vtex.store-graphql") @runtimeMeta(hash: "f3722824087d2db9766a00227bb44916dfa425060002028aba80d740d8bb31fe") {\n schema\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var r={};function a(e,n){for(var t=0;t0;){var c=u;u=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(r[e]||new Set).forEach((function(e){u.add(e)})))}))}return o.forEach((function(n){var r=a(e,n);r&&t.definitions.push(r)})),t}(t,"getPublicSchema")},function(e,n){e.exports=__RENDER_8_RUNTIME__},function(e,n){var t={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"createDocument"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"document"}},type:{kind:"NamedType",name:{kind:"Name",value:"DocumentInputV2"}},directives:[]},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"schema"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}},directives:[]}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"sender"},value:{kind:"StringValue",value:"vtex.store-form@0.10.1",block:!1}}]},{kind:"Directive",name:{kind:"Name",value:"runtimeMeta"},arguments:[{kind:"Argument",name:{kind:"Name",value:"hash"},value:{kind:"StringValue",value:"9a7fad14a6c8d79d3df1d4064732f32b732d3379365246f93502e86f26628f2f",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"createDocumentV2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"dataEntity"},value:{kind:"Variable",name:{kind:"Name",value:"dataEntity"}}},{kind:"Argument",name:{kind:"Name",value:"document"},value:{kind:"Variable",name:{kind:"Name",value:"document"}}},{kind:"Argument",name:{kind:"Name",value:"schema"},value:{kind:"Variable",name:{kind:"Name",value:"schema"}}}],directives:[{kind:"Directive",name:{kind:"Name",value:"context"},arguments:[{kind:"Argument",name:{kind:"Name",value:"provider"},value:{kind:"StringValue",value:"vtex.store-graphql",block:!1}}]}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cacheId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"id"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"href"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"documentId"},arguments:[],directives:[]},{kind:"Field",name:{kind:"Name",value:"__typename"},arguments:[],directives:[]}]}}]}}],loc:{start:0,end:412}};t.loc.source={body:'mutation createDocument($dataEntity: String!, $document: DocumentInputV2, $schema: String) @context(sender: "vtex.store-form@0.10.1") @runtimeMeta(hash: "9a7fad14a6c8d79d3df1d4064732f32b732d3379365246f93502e86f26628f2f") {\n createDocumentV2(dataEntity: $dataEntity, document: $document, schema: $schema) @context(provider: "vtex.store-graphql") {\n cacheId\n id\n href\n documentId\n __typename\n }\n}\n',name:"GraphQL request",locationOffset:{line:1,column:1}};var r={};function a(e,n){for(var t=0;t0;){var c=u;u=new Set,c.forEach((function(e){o.has(e)||(o.add(e),(r[e]||new Set).forEach((function(e){u.add(e)})))}))}return o.forEach((function(n){var r=a(e,n);r&&t.definitions.push(r)})),t}(t,"createDocument")},,,,,,,,,function(e,n,t){"use strict";t.r(n),function(e){var n=t(3);t.p=Object(n.getPublicPath)("vtex.store-form@0.10.1");var r=Object(n.register)((function(){return t(62)}),e,"vtex.store-form@0.10.1","vtex.store-form@0.x","Form");r.renderHotReload,r.setupHMR}.call(this,t(9)(e))},,,,,,,,,,,,,,,,,,,,function(e,n,t){"use strict";t.r(n);var r=t(0),a=t.n(r),i=t(17),o=t(2),u=t(12),c=t.n(u),s=t(28),d=t(27),m=t(31),l=t.n(m),f=t(21),v=t.n(f),p=t(29),E=t(8),b=t(1),k=t(32),h=t(33),g=t.n(h),S=function(e,n){return"".concat(e,"/").concat(n)},N=function(e,n){return n.errors?e.concat(n.errors):e},y=function(e,n){var t,r,a,i;return(null===(i=null===(a=null===(r=null===(t=null==n?void 0:n.extensions)||void 0===t?void 0:t.exception)||void 0===r?void 0:r.response)||void 0===a?void 0:a.data)||void 0===i?void 0:i.errors)?e.concat(n.extensions.exception.response.data.errors.reduce(N,[])):e},_=function(e,n,t){e[n]?e[n].push(t):e[n]=[t]},x=function(e,n){var t=S(S(e.schemaId,"properties"),n);return _(e.nodes,t,b.b.required),{nodes:e.nodes,schemaId:e.schemaId}},O=function(e,n){switch(n.ErrorType){case"required":Array.isArray(n.Value)&&(e=n.Value.reduce(x,{nodes:e,schemaId:n.SchemaId}).nodes);break;case"format":case"type":_(e,n.SchemaId,b.b.pattern);break;case"maximum":_(e,n.SchemaId,b.b.maxValue);break;case"minimum":_(e,n.SchemaId,b.b.minValue);break;case"enum":_(e,n.SchemaId,b.b.notInEnum);break;case"minLength":_(e,n.SchemaId,b.b.minLength);break;case"maxLength":_(e,n.SchemaId,b.b.maxLength)}return e},R=t(15),D=function(e){var n=e.data,t=e.properties,r=Object.assign({},n);return Object.entries(t).forEach((function(e){var n,t=Object(E.a)(e,2),a=t[0];"date-time"===(null===(n=t[1])||void 0===n?void 0:n.format)&&r[a]&&(r[a]=new Date(r[a]).toISOString())})),r};function I(e,n){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=function(e,n){if(!e)return;if("string"==typeof e)return T(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return T(e,n)}(e))||n&&e&&"number"==typeof e.length){t&&(e=t);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,u=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return o=e.done,e},e:function(e){u=!0,i=e},f:function(){try{o||null==t.return||t.return()}finally{if(u)throw i}}}}function T(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0,n=(d[e[t+0]]+d[e[t+1]]+d[e[t+2]]+d[e[t+3]]+"-"+d[e[t+4]]+d[e[t+5]]+"-"+d[e[t+6]]+d[e[t+7]]+"-"+d[e[t+8]]+d[e[t+9]]+"-"+d[e[t+10]]+d[e[t+11]]+d[e[t+12]]+d[e[t+13]]+d[e[t+14]]+d[e[t+15]]).toLowerCase();if(!l(n))throw TypeError("Stringified UUID is invalid");return n};var f=function(e,t,n){var i=(e=e||{}).random||(e.rng||s)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){n=n||0;for(var r=0;r<16;++r)t[n+r]=i[r];return t}return m(i)},v=n(12);const h=async()=>{},p=Object(r.createContext)({addItem:h,addItems:h,updateQuantity:h,removeItem:h,setManualPrice:h}),I=()=>Object(r.useContext)(p),g={queue:[]},y=e=>{var t;let n=null;try{n=JSON.parse(null!==(t=localStorage.getItem("orderQueue"))&&void 0!==t?t:"null")}catch{}if(!n)try{localStorage.setItem("orderQueue",JSON.stringify(g))}catch(t){null==e||e({type:"Error",level:"Critical",event:t,workflowType:"OrderItems",workflowInstance:"get-local-order-queue"})}return null!=n?n:g},w=(e,t)=>{try{localStorage.setItem("orderQueue",JSON.stringify(e))}catch(e){null==t||t({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"save-local-order-queue"})}},b=(e,t)=>{const n=y(),i=n.queue.push(e);return w(n,t),i},k=(e=0,t)=>{const n=y(t),i=n.queue[e];if(i)return n.queue.splice(e,1),w(n,t),i},T="available",q=(e,t,n)=>{var i,r,a;const u=(null===(i=e.id)||void 0===i?void 0:i.toString())===t.id,s=e.seller===t.seller;if(t.isGift)return!1;if(null==e.options||!(null===(r=e.options)||void 0===r?void 0:r.length))return!(null===(a=t.attachments)||void 0===a?void 0:a.length)&&(u&&s);const o=e.options.every(e=>n.find(t=>t.id===e.id));return u&&s&&o},O=e=>{var t;return{id:+(null!==(t=e.id)&&void 0!==t?t:0),index:e.index,quantity:e.quantity,seller:e.seller,options:e.options}},M=(e,t)=>{var n,i,r,a;return{id:t.id,productId:t.productId,name:t.name,skuName:t.skuName,skuSpecifications:t.skuSpecifications,imageUrls:{at1x:t.imageUrl,at2x:t.imageUrl,at3x:t.imageUrl},price:t.price,listPrice:t.listPrice,sellingPrice:t.sellingPrice,measurementUnit:t.measurementUnit,quantity:null!==(n=t.quantity)&&void 0!==n?n:1,unitMultiplier:null!==(i=t.unitMultiplier)&&void 0!==i?i:1,uniqueId:null!==(r=e.uniqueId)&&void 0!==r?r:f(),detailUrl:t.detailUrl,availability:null!==(a=t.availability)&&void 0!==a?a:T,additionalInfo:t.additionalInfo,options:t.options,seller:t.seller,attachmentOfferings:[],attachments:[],bundleItems:[],offerings:[],priceTags:[],isGift:!1}},x=e=>void 0!==e;function C({useMutateAddItems:e,useOrderForm:t,useLogger:n}){return i=>{var a;const{setOrderForm:u}=t(),s=e(),{log:o}=null!==(a=null==n?void 0:n())&&void 0!==a?a:{};return Object(r.useCallback)(({mutationInputItems:e,mutationInputMarketingData:t,orderFormItems:n,salesChannel:r,allowedOutdatedData:a})=>({execute:async()=>{var l;const{data:d,errors:c}=await s({items:e,marketingData:t,salesChannel:r,allowedOutdatedData:a});if(!d||(null!==(l=null==c?void 0:c.length)&&void 0!==l?l:0)>0)throw null==c?void 0:c[0];return n.forEach(e=>{const t=null==d?void 0:d.items.find(t=>t.id===e.id);if(!t)return;const n=e.uniqueId;(({fakeUniqueId:e,uniqueId:t},n)=>{const i=y(n);i.queue=i.queue.map(n=>{if("update_mutation"!==n.type)return n;const i=n.variables.orderItems.findIndex(t=>"uniqueId"in t&&t.uniqueId===e);return i>-1&&(n.variables.orderItems[i]={...n.variables.orderItems[i],uniqueId:t}),n}),w(i,n)})({fakeUniqueId:n,uniqueId:t.uniqueId},o),i.current[n]=t.uniqueId}),u(n=>({...n,items:n.items.map(t=>{if(-1===e.findIndex(e=>q(e,t,n.items)))return t;const i=d.items.find(e=>e.id===t.id);return i?{...t,uniqueId:i.uniqueId}:null}).filter(e=>null!=e),marketingData:null!=t?t:n.marketingData})),d},rollback:()=>{u(t=>{const n=e.map(({id:e})=>e.toString());return{...t,items:t.items.filter(e=>!n.includes(e.id))}})}}),[i,o,s,u])}}const _=({totalizers:e,currentValue:t=0,newItem:n,oldItem:i})=>{var r,a,u,s,o;if((null==i?void 0:i.availability)!==T)return{totalizers:e,value:t};const l=(null!==(r=i.price)&&void 0!==r?r:0)*(null!==(a=i.unitMultiplier)&&void 0!==a?a:1),d=null!==(u=i.quantity)&&void 0!==u?u:0,c=null!==(s=i.sellingPrice)&&void 0!==s?s:0,m=l*d,f=n.price*(null!==(o=n.unitMultiplier)&&void 0!==o?o:1),v=f*n.quantity-m,h=(c-l)*d,p=(n.sellingPrice-f)*n.quantity-h,I=t+v+p;if(!e.length)return{totalizers:[{id:"Items",name:"Items Total",value:v},{id:"Discounts",name:"Discounts Total",value:p}],value:I};return{totalizers:e.map(e=>{switch(e.id){case"Items":return{...e,value:e.value+v};case"Discounts":return{...e,value:e.value+p};default:return e}}),value:I}},D=async()=>{};function E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}){const l=C({useMutateAddItems:e,useOrderForm:i}),d=function({useMutateSetManualPrice:e}){return()=>{const t=e();return Object(r.useCallback)((e,n)=>{if(t)return{execute:async()=>{var i;const{data:r,errors:a}=await t({itemIndex:n,price:e});if(!r||(null!==(i=null==a?void 0:a.length)&&void 0!==i?i:0)>0)throw null==a?void 0:a[0];return r}}},[t])}}({useMutateSetManualPrice:n}),c=function({useMutateUpdateQuantity:e,useOrderForm:t}){return n=>{const{setOrderForm:i}=t(),a=e();return Object(r.useCallback)(({items:e,orderFormItems:t,id:r,allowedOutdatedData:u,splitItem:s})=>({id:r,execute:async()=>{var t;const i={orderItems:e.map(e=>{if("uniqueId"in e){return{uniqueId:n.current[e.uniqueId]||e.uniqueId,quantity:e.quantity}}return e}),allowedOutdatedData:u,splitItem:s},{data:r,errors:o}=await a(i);if(!r||(null!==(t=null==o?void 0:o.length)&&void 0!==t?t:0)>0)throw null==o?void 0:o[0];return r},rollback:()=>{const n=e.filter(({quantity:e})=>0===e),r=e.filter(({quantity:e})=>0!==e),a=n.map(e=>t.find((t,n)=>"uniqueId"in e?t.uniqueId===e.uniqueId:e.index===n)).filter(x);i(e=>({...e,items:e.items.map(e=>{const n=r.findIndex((t,n)=>"uniqueId"in t?e.uniqueId===t.uniqueId:n===t.index);if(-1!==n){const i=r[n],a=t.find((e,t)=>"uniqueId"in i?e.uniqueId===i.uniqueId:t===i.index);return{...e,quantity:a.quantity}}return e}).concat(a)}))}}),[n,a,i])}}({useMutateUpdateQuantity:t,useOrderForm:i});return{OrderItemsProvider:({children:e})=>{const{orderForm:t,setOrderForm:n}=i(),{log:m}=u(),h=function({useOrderQueue:e}){const t=Object(r.useRef)({}),{listen:n}=e();return Object(r.useEffect)(()=>n("Fulfilled",()=>{t.current={}}),[n]),t}({useOrderQueue:s}),I=(({useOrderForm:e,useLogger:t,useOrderQueue:n,useQueueStatus:i})=>{const{log:a}=t(),{enqueue:u}=n(),s=i(),{setOrderForm:o}=e();return Object(r.useCallback)(e=>u(e.execute,e.id).then(e=>{k(0,a),"Fulfilled"===s.current?o(e):o(t=>{var n;return{...t,messages:{...e.messages,generalMessages:null===(n=e.messages)||void 0===n?void 0:n.generalMessages}}})},e=>{if(!e||e.code!==v.a)throw k(0,a),a({type:"Error",level:"Critical",event:e,workflowType:"OrderItems",workflowInstance:"enqueue-task-error"}),e;k(e.index,a)}),[u,s,o,a])})({useOrderForm:i,useLogger:u,useOrderQueue:s,useQueueStatus:o}),g=l(h),w=c(h),T=d(),x=Object(r.useRef)(t.items);Object(r.useEffect)(()=>{x.current=t.items},[t.items]);const C=Object(r.useCallback)(async(e,t)=>{var i,r,a;let u,s="";const o=x.current;if(e.id?u=o.findIndex(t=>q(e,t,o)):e.uniqueId?(s=e.uniqueId,u=o.findIndex(t=>t.uniqueId===e.uniqueId)):u=null!==(i=null==e?void 0:e.index)&&void 0!==i?i:-1,u<0||u>=o.length)throw new Error(`Item ${null!==(r=e.id)&&void 0!==r?r:e.uniqueId} not found`);s||(s=o[u].uniqueId);const l=null!==(a=e.quantity)&&void 0!==a?a:1;let d;n(e=>{const t=e.items.slice(),n=t[u],i={...n,quantity:l};return l>0?t[u]=i:t.splice(u,1),{...e,..._({totalizers:e.totalizers,currentValue:e.value,newItem:i,oldItem:n}),items:t}});let c=f();if(l>0){const n=y(m).queue;let i=-1;const r=c;for(let e=1;ee.quantity>0)?(i=e,c=t.id):(i=-1,c=r)}const a=-1===i?void 0:n[i],o="update_mutation"===(null==a?void 0:a.type)?a.variables.orderItems:[],f=o.findIndex(e=>"uniqueId"in e?e.uniqueId===s:e.index===u);let v={uniqueId:s,quantity:l};"index"in e&&(v={index:u,quantity:l}),d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:f>-1?o.map((e,t)=>t===f?v:e):o.concat([v])}}else d={allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem,orderItems:[{uniqueId:s,quantity:l}]};return b({id:c,type:"update_mutation",variables:d,orderFormItems:o},m),I(w({items:d.orderItems,orderFormItems:o,id:c,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData,splitItem:null==t?void 0:t.splitItem}))},[I,m,n,w]),E=Object(r.useCallback)(async(e,t)=>{const{salesChannel:i,marketingData:r,allowedOutdatedData:a,splitItem:u}=null!=t?t:{},{newItems:s,updatedItems:o}=e.reduce((t,n)=>{var i;const{newItems:r,updatedItems:a}=t,u=n.options&&n.options.length>0?void 0:x.current.find(t=>q(n,t,e));return null==u?r.push(n):a.push({...n,quantity:(null!==(i=n.quantity)&&void 0!==i?i:1)+u.quantity}),t},{newItems:[],updatedItems:[]}),l=[];if(o.length&&o.forEach(e=>{const t=C(e,{allowedOutdatedData:a,splitItem:u});l.push(t)}),0===s.length)return Promise.all(l).then(D);const d=s.map(O),c=s.map((e,t)=>M(d[t],e));n(e=>{var t;return{...e,items:[...x.current,...c],totalizers:c.reduce((e,t)=>_({totalizers:e,newItem:t}).totalizers,null!==(t=e.totalizers)&&void 0!==t?t:[]),marketingData:null!=r?r:e.marketingData,value:e.value+c.reduce((e,t)=>e+t.sellingPrice*t.quantity,0)}}),b({type:"add_mutation",variables:{items:d,marketingData:r,salesChannel:i,allowedOutdatedData:a},orderFormItems:c},m);const f=I(g({mutationInputItems:d,mutationInputMarketingData:r,orderFormItems:c,salesChannel:i,allowedOutdatedData:null==t?void 0:t.allowedOutdatedData}));return Promise.all([...l,f]).then(D)},[g,I,m,n,C]),F=Object(r.useCallback)((e,t,n)=>E(e,{marketingData:t,salesChannel:n}),[E]),S=Object(r.useCallback)((e,t)=>{const n=T(e,t);n&&I(n)},[I,T]),j=Object(r.useCallback)((e,t)=>C({...e,quantity:0},t),[C]),P=Object(r.useMemo)(()=>({addItem:F,addItems:E,updateQuantity:C,removeItem:j,setManualPrice:S}),[F,E,C,j,S]);return Object(r.useEffect)(()=>{y(m).queue.forEach(e=>{"add_mutation"===e.type?I(g({mutationInputItems:e.variables.items,mutationInputMarketingData:e.variables.marketingData,orderFormItems:e.orderFormItems,salesChannel:e.variables.salesChannel,allowedOutdatedData:e.variables.allowedOutdatedData})):"update_mutation"===e.type&&I(w({items:e.variables.orderItems,orderFormItems:e.orderFormItems,allowedOutdatedData:e.variables.allowedOutdatedData,splitItem:e.variables.splitItem,id:e.id}))})},[g,I,m,w]),a.a.createElement(p.Provider,{value:P},e)}}}function F({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u}){return E({useMutateAddItems:e,useMutateUpdateQuantity:t,useMutateSetManualPrice:n,useOrderForm:i,useLogger:r,useOrderQueue:a,useQueueStatus:u})}},,,,,,,,,,,function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return d}));var i=n(0);const r={cancel:Object.create(null),timeout:Object.create(null)},a="drained",u="error",s="timeout";function o(){}class l{constructor(e){var t,n;this.queue=[],this._isClosed=!1,this.waiters=[],e||(e={}),this.defaultTimeout=e.timeout,this.name=null!==(t=e.name)&&void 0!==t?t:"SequentialTaskQueue",this.scheduler=null!==(n=e.scheduler)&&void 0!==n?n:l.defaultScheduler}get isClosed(){return this._isClosed}push(e,t){if(this._isClosed)throw new Error(this.name+" has been previously closed");const n={callback:e,args:(null==t?void 0:t.args)?Array.isArray(t.args)?t.args.slice():[t.args]:[],timeout:void 0!==(null==t?void 0:t.timeout)?t.timeout:this.defaultTimeout,cancellationToken:{cancel:e=>this.cancelTask(n,e)},resolve:void 0,reject:void 0};n.args.push(n.cancellationToken),this.queue.push(n),this.scheduler.schedule(()=>this.next());const i=new Promise((e,t)=>{n.resolve=e,n.reject=t});return i.cancel=e=>n.cancellationToken.cancel(e),i}cancel(){this.currentTask&&this.cancelTask(this.currentTask,r.cancel);const e=this.queue.splice(0);return e.length&&(e.forEach(e=>this.cancelTask(e,r.cancel)),this.emit(a)),this.wait()}indexOf(e){var t;if((null===(t=this.currentTask)||void 0===t?void 0:t.callback)===e)return 0;const n=this.queue.filter(e=>{var t;return!(null===(t=e.cancellationToken)||void 0===t?void 0:t.cancelled)}).findIndex(t=>t.callback===e);return n<0?n:n+(void 0!==this.currentTask?1:0)}close(e){return!this._isClosed&&(this._isClosed=!0,e)?this.cancel():this.wait()}async wait(){return this.currentTask||0!==this.queue.length?new Promise(e=>{this.waiters.push(e)}):Promise.resolve()}on(e,t){var n;this.events=null!==(n=this.events)&&void 0!==n?n:{},(this.events[e]||(this.events[e]=[])).push(t)}once(e,t){const n=(...i)=>{this.removeListener(e,n),t.apply(this,i)};this.on(e,n)}removeListener(e,t){if(this.events){const n=this.events[e];if(n){let e=0;for(;ee.apply(this,t))}catch(t){console.error(`${this.name}: Exception in '${e}' event handler`,t)}}next(){if(!this.currentTask){let t=this.queue.shift();for(;null==t?void 0:t.cancellationToken.cancelled;)t=this.queue.shift();if(t)try{this.currentTask=t,t.timeout&&(t.timeoutHandle=setTimeout(()=>{this.emit(s),this.cancelTask(t,r.timeout)},t.timeout));const n=t.callback.apply(void 0,t.args);n&&((e=n)&&"function"==typeof e.then)?n.then(e=>{t.result=e,this.doneTask(t)},e=>{this.doneTask(t,e)}):(t.result=n,this.doneTask(t))}catch(e){this.doneTask(t,e)}else this.callWaiters()}var e}cancelTask(e,t){e.cancellationToken.cancelled=!0,e.cancellationToken.reason=t,this.doneTask(e)}doneTask(e,t){e.timeoutHandle&&clearTimeout(e.timeoutHandle),e.cancellationToken.cancel=o,t?(this.emit(u,t),e.reject.call(void 0,t)):e.cancellationToken.cancelled?e.reject.call(void 0,e.cancellationToken.reason):e.resolve.call(void 0,e.result),this.currentTask===e&&(this.currentTask=void 0,this.queue.length?this.scheduler.schedule(()=>this.next()):(this.emit(a),this.callWaiters()))}callWaiters(){this.waiters.splice(0).forEach(e=>e())}}l.defaultScheduler={schedule:e=>setTimeout(()=>e(),0)},l.defaultScheduler={schedule:"function"==typeof e?t=>e(()=>t()):e=>setTimeout(()=>e(),0)};const d="TASK_CANCELLED",c={id:"default-order-form",items:[],value:-1,totalizers:[],marketingData:{},canEditData:!1,loggedIn:!1,paymentData:{isValid:!1,installmentOptions:[],paymentSystems:[],payments:[],availableAccounts:[]},messages:{couponMessages:[],generalMessages:[]},shipping:{isValid:!1,deliveryOptions:[],pickupOptions:[]}};Object(i.createContext)(void 0);var m,f,v,h,p;p=!("undefined"==typeof window||!window.document||!window.document.createElement)&&(null===(h=null===(v=null===(f=null===(m=window)||void 0===m?void 0:m.__RUNTIME__)||void 0===f?void 0:f.settings)||void 0===v?void 0:v["vtex.store"])||void 0===h?void 0:h.enableOrderFormOptimization),Object(i.createContext)({orderForm:c,setOrderForm:()=>{},error:void 0,loading:!1})}).call(this,n(15).setImmediate)},,,function(e,t,n){var i="undefined"!=typeof global&&global||"undefined"!=typeof self&&self||window,r=Function.prototype.apply;function a(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new a(r.call(setTimeout,i,arguments),clearTimeout)},t.setInterval=function(){return new a(r.call(setInterval,i,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},a.prototype.unref=a.prototype.ref=function(){},a.prototype.close=function(){this._clearFn.call(i,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(16),t.setImmediate="undefined"!=typeof self&&self.setImmediate||"undefined"!=typeof global&&global.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||"undefined"!=typeof global&&global.clearImmediate||this&&this.clearImmediate},function(e,t,n){(function(e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,a,u,s,o=1,l={},d=!1,c=t.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(t);m=m&&m.setTimeout?m:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick((function(){v(t)}))}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((a=new MessageChannel).port1.onmessage=function(e){v(e.data)},i=function(e){a.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(r=c.documentElement,i=function(e){var t=c.createElement("script");t.onreadystatechange=function(){v(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):i=function(e){setTimeout(v,0,e)}:(u="setImmediate$"+Math.random()+"$",s=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(u)&&v(+e.data.slice(u.length))},t.addEventListener?t.addEventListener("message",s,!1):t.attachEvent("onmessage",s),i=function(e){t.postMessage(u+e,"*")}),m.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;ne.length)&&(t=e.length);for(var r=0,n=new Array(t);rt.length)&&(n=t.length);for(var e=0,r=new Array(n);e0&&"not-empty"===c||"always"===c;return o.a.createElement(_.a,{icon:o.a.createElement("span",{className:"".concat(v.minicartIconContainer," gray relative")},o.a.createElement(i,null),g&&o.a.createElement("span",{style:{userSelect:"none"},className:"".concat(v.minicartQuantityBadge," ").concat(C.a.minicartQuantityBadgeDefault," c-on-emphasis absolute t-mini bg-emphasis br4 w1 h1 pa1 flex justify-center items-center lh-solid")},N)),variation:"tertiary",onMouseEnter:"hover"===E?function(){return h({type:"OPEN_MINICART"})}:void 0,onClick:function(){if(O)return"popupWithLink"===u&&P(w),"hover"===E?void h({type:"SET_OPEN_BEHAVIOR",value:"click"}):(h({type:"CLOSE_MINICART"}),void h({type:"SET_OPEN_BEHAVIOR",value:"hover"}));h({type:x?"CLOSE_MINICART":"OPEN_MINICART"})}})},P=function(e){var t=e.children,n=e.quantityDisplay,a=e.Icon,i=e.itemCountMode,r=e.customPixelEventId,c=e.customPixelEventName,u=e.variation,l=Object(I.useMinicartState)(),s=l.open,d=l.openBehavior,p=l.hasBeenOpened,m=l.openOnHoverProp,f=Object(I.useMinicartDispatch)(),E=y().handles;x()({eventId:r,eventName:c,handler:function(){f({type:"OPEN_MINICART"})}});return o.a.createElement("div",{onMouseLeave:"hover"===d?function(){f({type:"CLOSE_MINICART"})}:void 0},o.a.createElement(w,{variation:u,Icon:a,itemCountMode:i,quantityDisplay:n}),s&&o.a.createElement(v.a,null,"click"===d&&o.a.createElement("div",{className:"fixed top-0 left-0 w-100 h-100",onClick:function(){m&&f({type:"SET_OPEN_BEHAVIOR",value:"hover"}),f({type:"CLOSE_MINICART"})}}),o.a.createElement("div",{className:"".concat(E.popupWrapper," ").concat(C.a.popupBoxPosition," absolute z-max flex flex-column")},o.a.createElement("div",{className:"".concat(E.popupContentContainer," w-100 shadow-3 bg-base")},o.a.createElement("div",{className:"".concat(E.arrowUp," ").concat(C.a.popupArrowUp," absolute top-0 bg-base h1 w1 pa4 rotate-45")}),o.a.createElement("div",{className:"".concat(E.popupChildrenContainer," mt3 bg-base relative flex flex-column ph5 pv3")},p&&t)))))},g=n(56),R=n.n(g),j=function(e){var t=e.Icon,n=e.children,a=e.maxDrawerWidth,i=e.quantityDisplay,r=e.itemCountMode,c=e.drawerSlideDirection,u=e.backdropMode,l=void 0===u?"visible":u,s=e.customPixelEventId,d=e.customPixelEventName,p=e.onVisibilityChanged,m=y().handles;return o.a.createElement(R.a,{maxWidth:a,backdropMode:l,slideDirection:c,customPixelEventId:s,customPixelEventName:d,onVisibilityChanged:p,customIcon:o.a.createElement(w,{Icon:t,itemCountMode:r,quantityDisplay:i})},o.a.createElement("div",{className:"".concat(m.minicartSideBarContentWrapper," flex flex-column w-100 h-100"),style:{height:window.innerHeight-58}},n))},D=n(33),S=n(34),k=[].concat(Object(i.a)(["popupWrapper","popupContentContainer","arrowUp","popupChildrenContainer"]),Object(i.a)(["minicartSideBarContentWrapper"]),Object(i.a)(["minicartIconContainer","minicartQuantityBadge"]),["minicartWrapperContainer","minicartContainer"]),T=function(e){var t=e.children,n=e.backdropMode,i=e.linkVariationUrl,c=e.maxDrawerWidth,d=void 0===c?400:c,m=e.MinicartIcon,v=void 0===m?u.a:m,f=e.quantityDisplay,x=void 0===f?"not-empty":f,E=e.itemCountMode,_=void 0===E?"distinct":E,O=e.drawerSlideDirection,C=void 0===O?"rightToLeft":O,h=e.customPixelEventId,b=e.customPixelEventName,y=e.classes,M=p()(k,{classes:y}),g=M.handles,R=M.withModifiers,D=Object(l.useOrderForm)().orderForm,T=Object(I.useMinicartState)(),B=T.variation,U=T.open,A=Object(r.useState)(null!=U&&U),H=Object(a.a)(A,2),W=H[0],q=H[1],L=Object(s.useCheckoutURL)().url,V=Object(r.useCallback)((function(e){q(e)}),[q]);return Object(S.a)("drawer"===B?W:U,null==D?void 0:D.items),"link"===B?o.a.createElement("aside",{className:"".concat(g.minicartWrapperContainer," relative fr flex items-center")},o.a.createElement("div",{className:"".concat(g.minicartContainer," flex flex-column")},o.a.createElement("a",{href:null!=i?i:L},o.a.createElement(N,{handles:g,withModifiers:R},o.a.createElement(w,{variation:B,Icon:v,itemCountMode:_,quantityDisplay:x}))))):"block"===B?o.a.createElement("aside",{className:"".concat(g.minicartWrapperContainer," relative fr flex items-center")},o.a.createElement("div",{className:"".concat(g.minicartContainer," flex flex-column")},t)):o.a.createElement("aside",{className:"".concat(g.minicartWrapperContainer," relative fr flex items-center")},o.a.createElement("div",{className:"".concat(g.minicartContainer," flex flex-column")},o.a.createElement(N,{handles:g,withModifiers:R},"drawer"===B?o.a.createElement(j,{Icon:v,backdropMode:n,itemCountMode:_,maxDrawerWidth:d,quantityDisplay:x,drawerSlideDirection:C,customPixelEventId:h,customPixelEventName:b,onVisibilityChanged:V},t):o.a.createElement(P,{Icon:v,itemCountMode:_,quantityDisplay:x,customPixelEventId:h,customPixelEventName:b,variation:B},t))))},B=function(){var e=Object(l.useOrderForm)(),t=e.orderForm,n=!e.loading&&t?t.id:void 0;return Object(D.a)(n),null};t.default=function(e){return o.a.createElement(I.MinicartContextProvider,{variation:e.variation,openOnHover:e.openOnHover},o.a.createElement(B,null),o.a.createElement(T,e))}},12:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixel"]},14:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.order-manager@0.x/OrderForm"]},15:function(e,t,n){"use strict";n.r(t),n.d(t,"MinicartStateContext",(function(){return u})),n.d(t,"MinicartContextProvider",(function(){return p})),n.d(t,"useMinicartDispatch",(function(){return v})),n.d(t,"useMinicartState",(function(){return m}));var a=n(13),i=n(0),r=n.n(i),o=n(21),c=n.n(o),u=Object(i.createContext)(void 0),l=Object(i.createContext)(void 0);function s(e,t){switch(t.type){case"OPEN_MINICART":return Object.assign(Object.assign({},e),{open:!0,hasBeenOpened:!0});case"CLOSE_MINICART":return Object.assign(Object.assign({},e),{open:!1});case"SET_OPEN_BEHAVIOR":return Object.assign(Object.assign({},e),{openBehavior:t.value});default:return e}}var d=function(e){return"popup"===e||"popupWithLink"===e},p=function(e){var t=e.variation,n=void 0===t?"drawer":t,o=e.openOnHover,p=void 0!==o&&o,m=e.children,v=c()().isMobile,f=d(n)&&(v||window&&window.innerWidth<=480)?"drawer":n,x=Object(i.useReducer)(s,{variation:f,open:!1,hasBeenOpened:!1,openOnHoverProp:p,openBehavior:d(f)&&p?"hover":"click"}),E=Object(a.a)(x,2),_=E[0],O=E[1];return r.a.createElement(u.Provider,{value:_},r.a.createElement(l.Provider,{value:O},m))};function m(){var e=Object(i.useContext)(u);if(void 0===e)throw new Error("useMinicartState must be used within a MinicartContextProvider");return e}function v(){var e=Object(i.useContext)(l);if(void 0===e)throw new Error("useMinicartDispatch must be used within a MinicartContextProvider");return e}},19:function(e,t,n){e.exports={drawerStyles:"vtex-minicart-2-x-drawerStyles",popupStyles:"vtex-minicart-2-x-popupStyles",minicartEmptyStateContainerDefault:"vtex-minicart-2-x-minicartEmptyStateContainerDefault",minicartQuantityBadgeDefault:"vtex-minicart-2-x-minicartQuantityBadgeDefault",popupBoxPosition:"vtex-minicart-2-x-popupBoxPosition",popupArrowUp:"vtex-minicart-2-x-popupArrowUp"}},21:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.device-detector@0.x/useDevice"]},22:function(e,t){function n(e,t,n){var a,i,r,o,c;function u(){var l=Date.now()-o;l=0?a=setTimeout(u,t-l):(a=null,n||(c=e.apply(r,i),r=i=null))}null==t&&(t=100);var l=function(){r=this,i=arguments,o=Date.now();var l=n&&!a;return a||(a=setTimeout(u,t)),l&&(c=e.apply(r,i),r=i=null),c};return l.clear=function(){a&&(clearTimeout(a),a=null)},l.flush=function(){a&&(c=e.apply(r,i),r=i=null,clearTimeout(a),a=null)},l}n.debounce=n,e.exports=n},24:function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));var a=n(6),i=n(3);function r(){var e=Object(a.useCheckoutURL)(),t=e.url,n=e.major,r=Object(i.useRuntime)(),o=r.navigate,c=r.rootPath,u=void 0===c?"":c;return function(e){n>0&&e===t?o({to:e}):window.location.href="".concat(u).concat(e)}}},26:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-icons@0.x/IconCart"]},27:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.react-portal@0.x/Overlay"]},28:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.styleguide@9.x/ButtonWithIcon"]},3:function(e,t){e.exports=__RENDER_8_RUNTIME__},33:function(e,t,n){"use strict";var a=n(0),i=n(12),r=n.n(i);t.a=function(e){var t=r()().push;Object(a.useEffect)((function(){e&&t({event:"cartId",cartId:e})}),[t,e])}},34:function(e,t,n){"use strict";var a=n(0),i=n(12),r=n.n(i),o=n(22),c=n(8);t.a=function(e,t){var n=r()().push,i=Object(c.c)(t),u=Object(a.useCallback)(Object(o.debounce)((function(e){n({event:"viewCart",items:e})}),1e3),[n]);Object(a.useEffect)((function(){e&&u(i)}),[u,e,i])}},5:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/useCssHandles"]},54:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.pixel-manager@1.x/usePixelEventCallback"]},55:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.css-handles@1.x/createCssHandlesContext"]},56:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.store-drawer@0.x/Drawer"]},6:function(e,t){e.exports=__RENDER_8_COMPONENTS__["vtex.checkout-resources@0.x/Utils"]},77:function(e,t,n){"use strict";n.r(t),function(e){var t=n(4);n.p=Object(t.getPublicPath)("vtex.minicart@2.68.0");var a=Object(t.register)((function(){return n(103)}),e,"vtex.minicart@2.68.0","vtex.minicart@2.x","Minicart");a.renderHotReload,a.setupHMR}.call(this,n(20)(e))},8:function(e,t,n){"use strict";function a(e){var t;return{skuId:e.id,variant:e.skuName,price:e.sellingPrice,priceIsInt:!0,name:o(e),quantity:e.quantity,productId:e.productId,productRefId:e.productRefId,brand:e.additionalInfo?e.additionalInfo.brandName:"",category:c(e),detailUrl:e.detailUrl,imageUrl:e.imageUrls?r(e.imageUrls.at3x):null!==(t=e.imageUrl)&&void 0!==t?t:"",referenceId:e.refId}}function i(e){var t=e.category?e.category.slice(1,-1):"";return{skuId:e.id,variant:e.skuName,price:e.sellingPrice,priceIsInt:!0,name:e.name,quantity:e.quantity,productId:e.productId,productRefId:e.productRefId,brand:e.brand,category:t,detailUrl:e.detailUrl,imageUrl:e.imageUrl,referenceId:e.refId}}function r(e){return e&&0!==e.indexOf("http")?"https:".concat(e):e}function o(e){if((null==e?void 0:e.name)&&!e.name.includes(e.skuName)||e.name===e.skuName)return e.name;var t=1+e.skuName.length;return e.name.slice(0,e.name.length-t)}function c(e){try{return e.productCategoryIds.split("/").filter((function(e){return e.length})).map((function(t){return e.productCategories[t]})).join("/")}catch(e){return""}}function u(e){return e&&e.length?e.map((function(e){return a(e)})):[]}n.d(t,"b",(function(){return a})),n.d(t,"a",(function(){return i})),n.d(t,"c",(function(){return u}))}},[[77,"common"]]]); }], document.currentScript.dataset.index)