@subiz/widget-v4 4.0.73 → 4.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/compiled_src/util/campaign.js +3 -1
- package/dist/{1806f67a77b.132.js → 180b74d2f80.132.js} +0 -0
- package/dist/{1806f67a77b.178.js → 180b74d2f80.178.js} +0 -0
- package/dist/{1806f67a77b.213.js → 180b74d2f80.213.js} +0 -0
- package/dist/{1806f67a77b.335.js → 180b74d2f80.335.js} +0 -0
- package/dist/{1806f67a77b.362.js → 180b74d2f80.362.js} +0 -0
- package/dist/180b74d2f80.441.js +1 -0
- package/dist/{1806f67a77b.605.js → 180b74d2f80.605.js} +0 -0
- package/dist/{1806f67a77b.678.js → 180b74d2f80.678.js} +0 -0
- package/dist/{1806f67a77b.782.js → 180b74d2f80.782.js} +0 -0
- package/dist/180b74d2f80.app.js +1 -0
- package/dist/{1806f67a77b.index.html → 180b74d2f80.index.html} +1 -1
- package/dist/{1806f67a77b.library.html → 180b74d2f80.library.html} +1 -1
- package/dist/180b74d2f80.library.js +1 -0
- package/dist/{1806f67a77b.preview.html → 180b74d2f80.preview.html} +1 -1
- package/dist/180b74d2f80.preview.js +1 -0
- package/dist/180b74d2f80.screenshoot.js +1 -0
- package/dist/441.js +16 -11
- package/dist/HASH +1 -1
- package/dist/screenshoot.html +1 -1
- package/dist/screenshoot.js +3 -1
- package/package.json +11 -11
- package/src/util/campaign.js +4 -2
- package/dist/1806f67a77b.441.js +0 -1
- package/dist/1806f67a77b.app.js +0 -1
- package/dist/1806f67a77b.library.js +0 -1
- package/dist/1806f67a77b.preview.js +0 -1
- package/dist/1806f67a77b.screenshoot.js +0 -1
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[]).push([[441],{7441:(e,t,n)=>{function s(){return{baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}n.r(t),n.d(t,{Lexer:()=>O,Parser:()=>P,Renderer:()=>C,Slugger:()=>B,TextRenderer:()=>D,Tokenizer:()=>E,defaults:()=>r,getDefaults:()=>s,lexer:()=>V,marked:()=>Q,options:()=>U,parse:()=>X,parseInline:()=>F,parser:()=>G,setOptions:()=>j,use:()=>M,walkTokens:()=>N});let r={baseUrl:null,breaks:!1,extensions:null,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1};const i=/[&<>"']/,l=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,c={"&":"&","<":"<",">":">",'"':""","'":"'"},h=e=>c[e];function p(e,t){if(t){if(i.test(e))return e.replace(l,h)}else if(o.test(e))return e.replace(a,h);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function g(e){return e.replace(u,((e,t)=>"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""))}const k=/(^|[^\[])\^/g;function f(e,t){e="string"==typeof e?e:e.source,t=t||"";const n={replace:(t,s)=>(s=(s=s.source||s).replace(k,"$1"),e=e.replace(t,s),n),getRegex:()=>new RegExp(e,t)};return n}const d=/[^\w:]/g,x=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(e,t,n){if(e){let e;try{e=decodeURIComponent(g(n)).replace(d,"").toLowerCase()}catch(e){return null}if(0===e.indexOf("javascript:")||0===e.indexOf("vbscript:")||0===e.indexOf("data:"))return null}t&&!x.test(n)&&(n=function(e,t){b[" "+e]||(w.test(e)?b[" "+e]=e+"/":b[" "+e]=T(e,"/",!0));const n=-1===(e=b[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(_,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(y,"$1")+t:e+t}(t,n));try{n=encodeURI(n).replace(/%25/g,"%")}catch(e){return null}return n}const b={},w=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/,$={exec:function(){}};function z(e){let t,n,s=1;for(;s<arguments.length;s++)for(n in t=arguments[s],t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function S(e,t){const n=e.replace(/\|/g,((e,t,n)=>{let s=!1,r=t;for(;--r>=0&&"\\"===n[r];)s=!s;return s?"|":" |"})).split(/ \|/);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(/\\\|/g,"|");return n}function T(e,t,n){const s=e.length;if(0===s)return"";let r=0;for(;r<s;){const i=e.charAt(s-r-1);if(i!==t||n){if(i===t||!n)break;r++}else r++}return e.slice(0,s-r)}function R(e){e&&e.sanitize&&!e.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}function A(e,t){if(t<1)return"";let n="";for(;t>1;)1&t&&(n+=e),t>>=1,e+=e;return n+e}function I(e,t,n,s){const r=t.href,i=t.title?p(t.title):null,l=e[1].replace(/\\([\[\]])/g,"$1");if("!"!==e[0].charAt(0)){s.state.inLink=!0;const e={type:"link",raw:n,href:r,title:i,text:l,tokens:s.inlineTokens(l,[])};return s.state.inLink=!1,e}return{type:"image",raw:n,href:r,title:i,text:p(l)}}class E{constructor(e){this.options=e||r}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const e=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:T(e,"\n")}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const e=t[0],n=function(e,t){const n=e.match(/^(\s+)(?:```)/);if(null===n)return t;const s=n[1];return t.split("\n").map((e=>{const t=e.match(/^\s+/);if(null===t)return e;const[n]=t;return n.length>=s.length?e.slice(s.length):e})).join("\n")}(e,t[3]||"");return{type:"code",raw:e,lang:t[2]?t[2].trim():t[2],text:n}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){const t=T(e,"#");this.options.pedantic?e=t.trim():t&&!/ $/.test(t)||(e=t.trim())}const n={type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:[]};return this.lexer.inline(n.text,n.tokens),n}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:t[0]}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){const e=t[0].replace(/^ *>[ \t]?/gm,"");return{type:"blockquote",raw:t[0],tokens:this.lexer.blockTokens(e,[]),text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n,s,r,i,l,o,a,c,h,p,u,g,k=t[1].trim();const f=k.length>1,d={type:"list",raw:"",ordered:f,start:f?+k.slice(0,-1):"",loose:!1,items:[]};k=f?`\\d{1,9}\\${k.slice(-1)}`:`\\${k}`,this.options.pedantic&&(k=f?k:"[*+-]");const x=new RegExp(`^( {0,3}${k})((?:[\t ][^\\n]*)?(?:\\n|$))`);for(;e&&(g=!1,t=x.exec(e))&&!this.rules.block.hr.test(e);){if(n=t[0],e=e.substring(n.length),c=t[2].split("\n",1)[0],h=e.split("\n",1)[0],this.options.pedantic?(i=2,u=c.trimLeft()):(i=t[2].search(/[^ ]/),i=i>4?1:i,u=c.slice(i),i+=t[1].length),o=!1,!c&&/^ *$/.test(h)&&(n+=h+"\n",e=e.substring(h.length+1),g=!0),!g){const t=new RegExp(`^ {0,${Math.min(3,i-1)}}(?:[*+-]|\\d{1,9}[.)])((?: [^\\n]*)?(?:\\n|$))`),s=new RegExp(`^ {0,${Math.min(3,i-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`);for(;e&&(p=e.split("\n",1)[0],c=p,this.options.pedantic&&(c=c.replace(/^ {1,4}(?=( {4})*[^ ])/g," ")),!t.test(c))&&!s.test(e);){if(c.search(/[^ ]/)>=i||!c.trim())u+="\n"+c.slice(i);else{if(o)break;u+="\n"+c}o||c.trim()||(o=!0),n+=p+"\n",e=e.substring(p.length+1)}}d.loose||(a?d.loose=!0:/\n *\n *$/.test(n)&&(a=!0)),this.options.gfm&&(s=/^\[[ xX]\] /.exec(u),s&&(r="[ ] "!==s[0],u=u.replace(/^\[[ xX]\] +/,""))),d.items.push({type:"list_item",raw:n,task:!!s,checked:r,loose:!1,text:u}),d.raw+=n}d.items[d.items.length-1].raw=n.trimRight(),d.items[d.items.length-1].text=u.trimRight(),d.raw=d.raw.trimRight();const m=d.items.length;for(l=0;l<m;l++){this.lexer.state.top=!1,d.items[l].tokens=this.lexer.blockTokens(d.items[l].text,[]);const e=d.items[l].tokens.filter((e=>"space"===e.type)),t=e.every((e=>{const t=e.raw.split("");let n=0;for(const e of t)if("\n"===e&&(n+=1),n>1)return!0;return!1}));!d.loose&&e.length&&t&&(d.loose=!0,d.items[l].loose=!0)}return d}}html(e){const t=this.rules.block.html.exec(e);if(t){const e={type:"html",raw:t[0],pre:!this.options.sanitizer&&("pre"===t[1]||"script"===t[1]||"style"===t[1]),text:t[0]};return this.options.sanitize&&(e.type="paragraph",e.text=this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]),e.tokens=[],this.lexer.inline(e.text,e.tokens)),e}}def(e){const t=this.rules.block.def.exec(e);if(t)return t[3]&&(t[3]=t[3].substring(1,t[3].length-1)),{type:"def",tag:t[1].toLowerCase().replace(/\s+/g," "),raw:t[0],href:t[2],title:t[3]}}table(e){const t=this.rules.block.table.exec(e);if(t){const e={type:"table",header:S(t[1]).map((e=>({text:e}))),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),rows:t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split("\n"):[]};if(e.header.length===e.align.length){e.raw=t[0];let n,s,r,i,l=e.align.length;for(n=0;n<l;n++)/^ *-+: *$/.test(e.align[n])?e.align[n]="right":/^ *:-+: *$/.test(e.align[n])?e.align[n]="center":/^ *:-+ *$/.test(e.align[n])?e.align[n]="left":e.align[n]=null;for(l=e.rows.length,n=0;n<l;n++)e.rows[n]=S(e.rows[n],e.header.length).map((e=>({text:e})));for(l=e.header.length,s=0;s<l;s++)e.header[s].tokens=[],this.lexer.inlineTokens(e.header[s].text,e.header[s].tokens);for(l=e.rows.length,s=0;s<l;s++)for(i=e.rows[s],r=0;r<i.length;r++)i[r].tokens=[],this.lexer.inlineTokens(i[r].text,i[r].tokens);return e}}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t){const e={type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const e={type:"paragraph",raw:t[0],text:"\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}text(e){const t=this.rules.block.text.exec(e);if(t){const e={type:"text",raw:t[0],text:t[0],tokens:[]};return this.lexer.inline(e.text,e.tokens),e}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:p(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:this.options.sanitize?"text":"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(t[0]):p(t[0]):t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;const t=T(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{const e=function(e,t){if(-1===e.indexOf(t[1]))return-1;const n=e.length;let s=0,r=0;for(;r<n;r++)if("\\"===e[r])r++;else if(e[r]===t[0])s++;else if(e[r]===t[1]&&(s--,s<0))return r;return-1}(t[2],"()");if(e>-1){const n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],s="";if(this.options.pedantic){const e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],s=e[3])}else s=t[3]?t[3].slice(1,-1):"";return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),I(t,{href:n?n.replace(this.rules.inline._escapes,"$1"):n,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=(n[2]||n[1]).replace(/\s+/g," ");if(e=t[e.toLowerCase()],!e||!e.href){const e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return I(n,e,n[0],this.lexer)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrong.lDelim.exec(e);if(!s)return;if(s[3]&&n.match(/[\p{L}\p{N}]/u))return;const r=s[1]||s[2]||"";if(!r||r&&(""===n||this.rules.inline.punctuation.exec(n))){const n=s[0].length-1;let r,i,l=n,o=0;const a="*"===s[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+n);null!=(s=a.exec(t));){if(r=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!r)continue;if(i=r.length,s[3]||s[4]){l+=i;continue}if((s[5]||s[6])&&n%3&&!((n+i)%3)){o+=i;continue}if(l-=i,l>0)continue;if(i=Math.min(i,i+l+o),Math.min(n,i)%2){const t=e.slice(1,n+s.index+i);return{type:"em",raw:e.slice(0,n+s.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}const t=e.slice(2,n+s.index+i-1);return{type:"strong",raw:e.slice(0,n+s.index+i+1),text:t,tokens:this.lexer.inlineTokens(t,[])}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g," ");const n=/[^ ]/.test(e),s=/^ /.test(e)&&/ $/.test(e);return n&&s&&(e=e.substring(1,e.length-1)),e=p(e,!0),{type:"codespan",raw:t[0],text:e}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2],[])}}autolink(e,t){const n=this.rules.inline.autolink.exec(e);if(n){let e,s;return"@"===n[2]?(e=p(this.options.mangle?t(n[1]):n[1]),s="mailto:"+e):(e=p(n[1]),s=e),{type:"link",raw:n[0],text:e,href:s,tokens:[{type:"text",raw:e,text:e}]}}}url(e,t){let n;if(n=this.rules.inline.url.exec(e)){let e,s;if("@"===n[2])e=p(this.options.mangle?t(n[0]):n[0]),s="mailto:"+e;else{let t;do{t=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(t!==n[0]);e=p(n[0]),s="www."===n[1]?"http://"+e:e}return{type:"link",raw:n[0],text:e,href:s,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e,t){const n=this.rules.inline.text.exec(e);if(n){let e;return e=this.lexer.state.inRawBlock?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(n[0]):p(n[0]):n[0]:p(this.options.smartypants?t(n[0]):n[0]),{type:"text",raw:n[0],text:e}}}}const Z={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?=\n|$)|$)/,hr:/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *(?:\n *)?<?([^\s>]+)>?(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/,table:$,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\.|[^\[\]\\])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};Z.def=f(Z.def).replace("label",Z._label).replace("title",Z._title).getRegex(),Z.bullet=/(?:[*+-]|\d{1,9}[.)])/,Z.listItemStart=f(/^( *)(bull) */).replace("bull",Z.bullet).getRegex(),Z.list=f(Z.list).replace(/bull/g,Z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Z.def.source+")").getRegex(),Z._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",Z._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Z.html=f(Z.html,"i").replace("comment",Z._comment).replace("tag",Z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z.paragraph=f(Z._paragraph).replace("hr",Z.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Z._tag).getRegex(),Z.blockquote=f(Z.blockquote).replace("paragraph",Z.paragraph).getRegex(),Z.normal=z({},Z),Z.gfm=z({},Z.normal,{table:"^ *([^\\n ].*\\|.*)\\n {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)(?:\\| *)?(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Z.gfm.table=f(Z.gfm.table).replace("hr",Z.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Z._tag).getRegex(),Z.gfm.paragraph=f(Z._paragraph).replace("hr",Z.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("table",Z.gfm.table).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Z._tag).getRegex(),Z.pedantic=z({},Z.normal,{html:f("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Z._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:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:$,paragraph:f(Z.normal._paragraph).replace("hr",Z.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",Z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});const q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:$,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(ref)\]/,nolink:/^!?\[(ref)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/^[^_*]*?\_\_[^_*]*?\*[^_*]*?(?=\_\_)|[^*]+(?=[^*])|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/^[^_*]*?\*\*[^_*]*?\_[^_*]*?(?=\*\*)|[^_]+(?=[^_])|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:$,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};function v(e){return e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")}function L(e){let t,n,s="";const r=e.length;for(t=0;t<r;t++)n=e.charCodeAt(t),Math.random()>.5&&(n="x"+n.toString(16)),s+="&#"+n+";";return s}q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",q.punctuation=f(q.punctuation).replace(/punctuation/g,q._punctuation).getRegex(),q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,q.escapedEmSt=/\\\*|\\_/g,q._comment=f(Z._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),q.emStrong.lDelim=f(q.emStrong.lDelim).replace(/punct/g,q._punctuation).getRegex(),q.emStrong.rDelimAst=f(q.emStrong.rDelimAst,"g").replace(/punct/g,q._punctuation).getRegex(),q.emStrong.rDelimUnd=f(q.emStrong.rDelimUnd,"g").replace(/punct/g,q._punctuation).getRegex(),q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,q._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])?)+(?![-_])/,q.autolink=f(q.autolink).replace("scheme",q._scheme).replace("email",q._email).getRegex(),q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,q.tag=f(q.tag).replace("comment",q._comment).replace("attribute",q._attribute).getRegex(),q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,q.link=f(q.link).replace("label",q._label).replace("href",q._href).replace("title",q._title).getRegex(),q.reflink=f(q.reflink).replace("label",q._label).replace("ref",Z._label).getRegex(),q.nolink=f(q.nolink).replace("ref",Z._label).getRegex(),q.reflinkSearch=f(q.reflinkSearch,"g").replace("reflink",q.reflink).replace("nolink",q.nolink).getRegex(),q.normal=z({},q),q.pedantic=z({},q.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:f(/^!?\[(label)\]\((.*?)\)/).replace("label",q._label).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",q._label).getRegex()}),q.gfm=z({},q.normal,{escape:f(q.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),q.gfm.url=f(q.gfm.url,"i").replace("email",q.gfm._extended_email).getRegex(),q.breaks=z({},q.gfm,{br:f(q.br).replace("{2,}","*").getRegex(),text:f(q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});class O{constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||r,this.options.tokenizer=this.options.tokenizer||new E,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={block:Z.normal,inline:q.normal};this.options.pedantic?(t.block=Z.pedantic,t.inline=q.pedantic):this.options.gfm&&(t.block=Z.gfm,this.options.breaks?t.inline=q.breaks:t.inline=q.gfm),this.tokenizer.rules=t}static get rules(){return{block:Z,inline:q}}static lex(e,t){return new O(t).lex(e)}static lexInline(e,t){return new O(t).inlineTokens(e)}lex(e){let t;for(e=e.replace(/\r\n|\r/g,"\n"),this.blockTokens(e,this.tokens);t=this.inlineQueue.shift();)this.inlineTokens(t.src,t.tokens);return this.tokens}blockTokens(e,t=[]){let n,s,r,i;for(e=this.options.pedantic?e.replace(/\t/g," ").replace(/^ +$/gm,""):e.replace(/^( *)(\t+)/gm,((e,t,n)=>t+" ".repeat(n.length)));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),1===n.raw.length&&t.length>0?t[t.length-1].raw+="\n":t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?t.push(n):(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.fences(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.heading(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.hr(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.blockquote(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.list(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.html(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.def(e))e=e.substring(n.raw.length),s=t[t.length-1],!s||"paragraph"!==s.type&&"text"!==s.type?this.tokens.links[n.tag]||(this.tokens.links[n.tag]={href:n.href,title:n.title}):(s.raw+="\n"+n.raw,s.text+="\n"+n.raw,this.inlineQueue[this.inlineQueue.length-1].src=s.text);else if(n=this.tokenizer.table(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.lheading(e))e=e.substring(n.raw.length),t.push(n);else{if(r=e,this.options.extensions&&this.options.extensions.startBlock){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startBlock.forEach((function(e){s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(this.state.top&&(n=this.tokenizer.paragraph(r)))s=t[t.length-1],i&&"paragraph"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n),i=r.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===s.type?(s.raw+="\n"+n.raw,s.text+="\n"+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=s.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t){this.inlineQueue.push({src:e,tokens:t})}inlineTokens(e,t=[]){let n,s,r,i,l,o,a=e;if(this.tokens.links){const e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(i=this.tokenizer.rules.inline.reflinkSearch.exec(a));)e.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,i.index)+"["+A("a",i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(i=this.tokenizer.rules.inline.blockSkip.exec(a));)a=a.slice(0,i.index)+"["+A("a",i[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(i=this.tokenizer.rules.inline.escapedEmSt.exec(a));)a=a.slice(0,i.index)+"++"+a.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(o=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((s=>!!(n=s.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))))if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),s=t[t.length-1],s&&"text"===n.type&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,o))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e,L))e=e.substring(n.raw.length),t.push(n);else if(this.state.inLink||!(n=this.tokenizer.url(e,L))){if(r=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0;const n=e.slice(1);let s;this.options.extensions.startInline.forEach((function(e){s=e.call({lexer:this},n),"number"==typeof s&&s>=0&&(t=Math.min(t,s))})),t<1/0&&t>=0&&(r=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(r,v))e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(o=n.raw.slice(-1)),l=!0,s=t[t.length-1],s&&"text"===s.type?(s.raw+=n.raw,s.text+=n.text):t.push(n);else if(e){const t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}else e=e.substring(n.raw.length),t.push(n);return t}}class C{constructor(e){this.options=e||r}code(e,t,n){const s=(t||"").match(/\S*/)[0];if(this.options.highlight){const t=this.options.highlight(e,s);null!=t&&t!==e&&(n=!0,e=t)}return e=e.replace(/\n$/,"")+"\n",s?'<pre><code class="'+this.options.langPrefix+p(s,!0)+'">'+(n?e:p(e,!0))+"</code></pre>\n":"<pre><code>"+(n?e:p(e,!0))+"</code></pre>\n"}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e){return e}heading(e,t,n,s){return this.options.headerIds?`<h${t} id="${this.options.headerPrefix+s.slug(n)}">${e}</h${t}>\n`:`<h${t}>${e}</h${t}>\n`}hr(){return this.options.xhtml?"<hr/>\n":"<hr>\n"}list(e,t,n){const s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"</"+s+">\n"}listitem(e){return`<li>${e}</li>\n`}checkbox(e){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "}paragraph(e){return`<p>${e}</p>\n`}table(e,t){return t&&(t=`<tbody>${t}</tbody>`),"<table>\n<thead>\n"+e+"</thead>\n"+t+"</table>\n"}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){const n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return this.options.xhtml?"<br/>":"<br>"}del(e){return`<del>${e}</del>`}link(e,t,n){if(null===(e=m(this.options.sanitize,this.options.baseUrl,e)))return n;let s='<a href="'+p(e)+'"';return t&&(s+=' title="'+t+'"'),s+=">"+n+"</a>",s}image(e,t,n){if(null===(e=m(this.options.sanitize,this.options.baseUrl,e)))return n;let s=`<img src="${e}" alt="${n}"`;return t&&(s+=` title="${t}"`),s+=this.options.xhtml?"/>":">",s}text(e){return e}}class D{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return""+n}image(e,t,n){return""+n}br(){return""}}class B{constructor(){this.seen={}}serialize(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")}getNextSafeSlug(e,t){let n=e,s=0;if(this.seen.hasOwnProperty(n)){s=this.seen[e];do{s++,n=e+"-"+s}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=s,this.seen[n]=0),n}slug(e,t={}){const n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)}}class P{constructor(e){this.options=e||r,this.options.renderer=this.options.renderer||new C,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new D,this.slugger=new B}static parse(e,t){return new P(t).parse(e)}static parseInline(e,t){return new P(t).parseInline(e)}parse(e,t=!0){let n,s,r,i,l,o,a,c,h,p,u,k,f,d,x,m,b,w,_,y="";const $=e.length;for(n=0;n<$;n++)if(p=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[p.type]&&(_=this.options.extensions.renderers[p.type].call({parser:this},p),!1!==_||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(p.type)))y+=_||"";else switch(p.type){case"space":continue;case"hr":y+=this.renderer.hr();continue;case"heading":y+=this.renderer.heading(this.parseInline(p.tokens),p.depth,g(this.parseInline(p.tokens,this.textRenderer)),this.slugger);continue;case"code":y+=this.renderer.code(p.text,p.lang,p.escaped);continue;case"table":for(c="",a="",i=p.header.length,s=0;s<i;s++)a+=this.renderer.tablecell(this.parseInline(p.header[s].tokens),{header:!0,align:p.align[s]});for(c+=this.renderer.tablerow(a),h="",i=p.rows.length,s=0;s<i;s++){for(o=p.rows[s],a="",l=o.length,r=0;r<l;r++)a+=this.renderer.tablecell(this.parseInline(o[r].tokens),{header:!1,align:p.align[r]});h+=this.renderer.tablerow(a)}y+=this.renderer.table(c,h);continue;case"blockquote":h=this.parse(p.tokens),y+=this.renderer.blockquote(h);continue;case"list":for(u=p.ordered,k=p.start,f=p.loose,i=p.items.length,h="",s=0;s<i;s++)x=p.items[s],m=x.checked,b=x.task,d="",x.task&&(w=this.renderer.checkbox(m),f?x.tokens.length>0&&"paragraph"===x.tokens[0].type?(x.tokens[0].text=w+" "+x.tokens[0].text,x.tokens[0].tokens&&x.tokens[0].tokens.length>0&&"text"===x.tokens[0].tokens[0].type&&(x.tokens[0].tokens[0].text=w+" "+x.tokens[0].tokens[0].text)):x.tokens.unshift({type:"text",text:w}):d+=w),d+=this.parse(x.tokens,f),h+=this.renderer.listitem(d,b,m);y+=this.renderer.list(h,u,k);continue;case"html":y+=this.renderer.html(p.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(p.tokens));continue;case"text":for(h=p.tokens?this.parseInline(p.tokens):p.text;n+1<$&&"text"===e[n+1].type;)p=e[++n],h+="\n"+(p.tokens?this.parseInline(p.tokens):p.text);y+=t?this.renderer.paragraph(h):h;continue;default:{const e='Token with "'+p.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return y}parseInline(e,t){t=t||this.renderer;let n,s,r,i="";const l=e.length;for(n=0;n<l;n++)if(s=e[n],this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[s.type]&&(r=this.options.extensions.renderers[s.type].call({parser:this},s),!1!==r||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)))i+=r||"";else switch(s.type){case"escape":case"text":i+=t.text(s.text);break;case"html":i+=t.html(s.text);break;case"link":i+=t.link(s.href,s.title,this.parseInline(s.tokens,t));break;case"image":i+=t.image(s.href,s.title,s.text);break;case"strong":i+=t.strong(this.parseInline(s.tokens,t));break;case"em":i+=t.em(this.parseInline(s.tokens,t));break;case"codespan":i+=t.codespan(s.text);break;case"br":i+=t.br();break;case"del":i+=t.del(this.parseInline(s.tokens,t));break;default:{const e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return void console.error(e);throw new Error(e)}}return i}}function Q(e,t,n){if(null==e)throw new Error("marked(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");if("function"==typeof t&&(n=t,t=null),R(t=z({},Q.defaults,t||{})),n){const s=t.highlight;let r;try{r=O.lex(e,t)}catch(e){return n(e)}const i=function(e){let i;if(!e)try{t.walkTokens&&Q.walkTokens(r,t.walkTokens),i=P.parse(r,t)}catch(t){e=t}return t.highlight=s,e?n(e):n(null,i)};if(!s||s.length<3)return i();if(delete t.highlight,!r.length)return i();let l=0;return Q.walkTokens(r,(function(e){"code"===e.type&&(l++,setTimeout((()=>{s(e.text,e.lang,(function(t,n){if(t)return i(t);null!=n&&n!==e.text&&(e.text=n,e.escaped=!0),l--,0===l&&i()}))}),0))})),void(0===l&&i())}try{const n=O.lex(e,t);return t.walkTokens&&Q.walkTokens(n,t.walkTokens),P.parse(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}}Q.options=Q.setOptions=function(e){var t;return z(Q.defaults,e),t=Q.defaults,r=t,Q},Q.getDefaults=s,Q.defaults=r,Q.use=function(...e){const t=z({},...e),n=Q.defaults.extensions||{renderers:{},childTokens:{}};let s;e.forEach((e=>{if(e.extensions&&(s=!0,e.extensions.forEach((e=>{if(!e.name)throw new Error("extension name required");if(e.renderer){const t=n.renderers?n.renderers[e.name]:null;n.renderers[e.name]=t?function(...n){let s=e.renderer.apply(this,n);return!1===s&&(s=t.apply(this,n)),s}:e.renderer}if(e.tokenizer){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");n[e.level]?n[e.level].unshift(e.tokenizer):n[e.level]=[e.tokenizer],e.start&&("block"===e.level?n.startBlock?n.startBlock.push(e.start):n.startBlock=[e.start]:"inline"===e.level&&(n.startInline?n.startInline.push(e.start):n.startInline=[e.start]))}e.childTokens&&(n.childTokens[e.name]=e.childTokens)}))),e.renderer){const n=Q.defaults.renderer||new C;for(const t in e.renderer){const s=n[t];n[t]=(...r)=>{let i=e.renderer[t].apply(n,r);return!1===i&&(i=s.apply(n,r)),i}}t.renderer=n}if(e.tokenizer){const n=Q.defaults.tokenizer||new E;for(const t in e.tokenizer){const s=n[t];n[t]=(...r)=>{let i=e.tokenizer[t].apply(n,r);return!1===i&&(i=s.apply(n,r)),i}}t.tokenizer=n}if(e.walkTokens){const n=Q.defaults.walkTokens;t.walkTokens=function(t){e.walkTokens.call(this,t),n&&n.call(this,t)}}s&&(t.extensions=n),Q.setOptions(t)}))},Q.walkTokens=function(e,t){for(const n of e)switch(t.call(Q,n),n.type){case"table":for(const e of n.header)Q.walkTokens(e.tokens,t);for(const e of n.rows)for(const n of e)Q.walkTokens(n.tokens,t);break;case"list":Q.walkTokens(n.items,t);break;default:Q.defaults.extensions&&Q.defaults.extensions.childTokens&&Q.defaults.extensions.childTokens[n.type]?Q.defaults.extensions.childTokens[n.type].forEach((function(e){Q.walkTokens(n[e],t)})):n.tokens&&Q.walkTokens(n.tokens,t)}},Q.parseInline=function(e,t){if(null==e)throw new Error("marked.parseInline(): input parameter is undefined or null");if("string"!=typeof e)throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected");R(t=z({},Q.defaults,t||{}));try{const n=O.lexInline(e,t);return t.walkTokens&&Q.walkTokens(n,t.walkTokens),P.parseInline(n,t)}catch(e){if(e.message+="\nPlease report this to https://github.com/markedjs/marked.",t.silent)return"<p>An error occurred:</p><pre>"+p(e.message+"",!0)+"</pre>";throw e}},Q.Parser=P,Q.parser=P.parse,Q.Renderer=C,Q.TextRenderer=D,Q.Lexer=O,Q.lexer=O.lex,Q.Tokenizer=E,Q.Slugger=B,Q.parse=Q;const U=Q.options,j=Q.setOptions,M=Q.use,N=Q.walkTokens,F=Q.parseInline,X=Q,G=P.parse,V=O.lex}}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{var e,t,i={7460:e=>{var t="Content-Type",i="application/x-www-form-urlencoded",n="application/json; charset=utf-8";function s(e,t){return Object.assign(e.clone(),t)}function r(e){return(e||"").trim()}function o(e){return e&&"[object Function]"==={}.toString.call(e)}function a(e,t,i){if(!e||0===e.length)return i(t);var n=e.shift();if(!o(n))return a(e,t,i);n(t,(function(n){return!1===n?i(t):a(e,t,i)}))}function c(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}function u(e){if(!e)return"";for(var t=Object.keys(e),i=[],n=0;n<t.length;n++){var s=t[n],r="",o=e[s];if(void 0!==o){if(null===o)r=c(s);else if(Array.isArray(o)){for(var a=[],u=0;u<o.length;u++)void 0!==o[u]&&(a.push(l(s,o[u],a.length)),a.push(i));r=a.join("&")}else r=c(s)+"="+c(o);r.length>0&&i.push(r)}}return i.join("&")}function l(e,t){return null===t?c(e):[c(e),"=",c(t)].join("")}var h,d=(h={parser:"",beforehooks:[],afterhooks:[],baseurl:"",query:{},meta:{},clone:function(){return Object.assign({},this,{query:Object.assign({},this.query),meta:Object.assign({},this.meta)})},addQuery:function(e,t){var i=this.clone();return i.query[e]=t,i},removeQuery:function(e){var t=this.clone();return void 0!==t.query[e]&&(t.query[e]=void 0),t},withCredentials:function(e){return s(this,{_withCredentials:e})},setQuery:function(e){return s(this,{query:e})},clearHooks:function(){return s(this,{beforehooks:[],afterhooks:[]})},beforeHook:function(e){var t=this.beforehooks.slice();return t.push(e),s(this,{beforehooks:t})},afterHook:function(e){var t=this.afterhooks.slice();return t.push(e),s(this,{afterhooks:t})},setHeader:function(e){return(e=Object.assign({},this.headers,e))[t]=void 0,s(this,{headers:e})}},["put","head","patch","delete","post","get"].map((function(e){h[e]=function(c,l,h){return function(e,s,r){r=r||function(){},o(s)&&(r=s,s=void 0);var c,l=new Promise((function(e){c=function(t){try{r(t.error,t.body,t.code)}catch(e){}e(t)}}));return s&&((e=e.clone()).body=s,e.content_type===n&&(e.body=p.Jsonify(s)),e.content_type===i&&(e.body=u(s))),a(e.beforehooks.slice(),{request:e},(function(i){if(i.error)return c({body:void 0,code:0,error:i.error});!function(e,i){let n=u(e.query);if(n&&(n="?"+n),!p.XMLHttpRequest)return function(e,i,n){var s=Object.assign({},e.headers);e.content_type&&(s[t]=e.content_type),fetch(e.baseurl+n,{method:e.method,headers:s,credentials:e._withCredentials,body:e.body}).then((e=>e.text().then((t=>i(void 0,t,e.status))))).catch((e=>i("network_error",e,-1)))}(e,i,n);var s=new p.XMLHttpRequest;for(var r in s.onreadystatechange=function(e){4===s.readyState&&(0===s.status?i("network_error",s.responseText,s.status):i(void 0,s.responseText,s.status))},s.open(e.method,e.baseurl+n),s.withCredentials=e._withCredentials,e.headers)s.setRequestHeader(r,e.headers[r]);e.content_type&&s.setRequestHeader(t,e.content_type),s.send(e.body)}(i.request,(function(t,i,n){a(e.afterhooks.slice(),{request:e,code:n,body:i,err:t},(function(t){var i=t.body;if("json"==e.parser&&t.body)try{i=p.ParseJson(t.body)}catch(e){t.err=t.err||"invalid json"}var s=t.err;(n<200||n>299)&&(s="not 200"),c({body:i,code:t.code,error:s})}))}))})),l}(s(this,{method:e,baseurl:(d=this.baseurl,f=c,d=r(d),(f=r(f))&&d?f.startsWith("http://")||f.startsWith("https://")||f.startsWith("//")?f:(d.endsWith("/")||(d+="/"),f.startsWith("/")&&(f=f.substring(1)),d+f):d+f)}),l,h);var d,f}})),h.setBaseUrl=function(e){return s(this,{baseurl:e})},h.contentTypeJson=function(){return s(this,{content_type:n})},h.contentTypeForm=function(){return s(this,{content_type:i})},h.setContentType=function(e){return s(this,{content_type:r(e)})},h.setParser=function(e){return s(this,{parser:r(e)})},h.setBody=function(e){return s(this,{body:e})},h.setMeta=function(e,t){var i=this.clone();return i.meta[e]=t,i},h),p={Jsonify:JSON.stringify,ParseJson:JSON.parse};d.env=p,d.waterfall=a,e.exports=d},5530:(e,t,i)=>{var n=i(8368);e.exports=function(e,t,i){var s=[],r="idle",o=function(e){var t=e.map((function(e){return e.payload})),n=i(t);n&&n.then||(n=Promise.resolve(n));var s=e.map((function(e){return e.rs}));return new Promise((function(e){n.then((function(t){s.map((function(e,i){e(t&&t[i])})),e()}))}))},a=function(){"executing"!==r&&(r="executing",n((function(){if(s.length<=e)return Promise.resolve(!1);var t=s.splice(0,e);return o(t).then((function(){return!0}))})).then((function(){if(0!==s.length){var e=t-(Date.now()-s[0].created);if(e>=1){if(r="idle",s[0].settedTimeout)return;return s[0].settedTimeout=!0,void setTimeout(a,e)}var i=s;s=[],o(i).then((function(){r="idle",a()}))}else r="idle"})))};return this.push=function(e,t){return new Promise((function(i){s.push({payload:e,priority:t,created:Date.now(),rs:i}),a()}))},this}},3538:e=>{e.exports={map:function(e,t){if(!e)return[];t||(t=function(e){return e});var i=[];if(Array.isArray(e)){for(var n=0;n<e.length;n++)i.push(t(e[n],n));return i}if("object"==typeof e){var s=Object.keys(e);for(n=0;n<s.length;n++){var r=s[n];i.push(t(e[r],r))}return i}return i}}},3165:(e,t,i)=>{var n=i(2349),s=i(8368),r=i(8874),o=i(5530);e.exports={sleep:n,loop:s,map:r,batch:o}},8368:e=>{e.exports=function e(t){var i=t();if(!i||!i.then){var n=i;i={then:function(e){e(n)}}}return i.then((function(i){return i?e(t):Promise.resolve()}))}},8874:(e,t,i)=>{var n=i(3538);e.exports=function(e,t,i){if("number"==typeof t){let e=i;i=t,t=e}t||(t=function(){}),("number"!=typeof i||i<=0)&&(i=1);var s={};if(n.map(e,(function(e,t){s[t]=e})),i<=0&&(i=1),0===Object.keys(s).length)return Promise.resolve([]);Object.keys(s).length<i&&(i=Object.keys(s).length);var r={};return new Promise((function(e){let o=Object.keys(s).length;for(var a=function(){var i=Object.keys(s);if(0!==i.length){var c=i.pop(),u=s[c];delete s[c];var l=t(u,c);l&&l.then||(l=Promise.resolve(l)),l.then((function(t){if(r[c]=t,Object.keys(r).length===o)return e(n.map(r));a()}))}},c=0;c<i;c++)setTimeout(a,1)}))}},2349:e=>{e.exports=function(e){return new Promise((function(t){setTimeout(t,e)}))}},8454:(e,t,i)=>{e.exports=i(608)},608:(e,t,i)=>{var n=i(3165);function s(e,t,i,s,a){a=a||r,t=t||{};var d=!1,p="";this.kill=function(){d=!0};var f=function(t){d||a("get",e+"poll?token="+p,void 0,(function(n,r){if(!d){if(u(r))return setTimeout(f,c(t),t+1);if(200!==r)return d=!0,i("poll");(n=o(n)||{}).host&&(e=h(n.host));var a=n.sequential_token;return a?(p=a,s(n.events||[]),f(0)):setTimeout(f,c(t),t+1)}}))},g=n.batch(50,100,(function(s){if(d)return["dead"];if(s.length<=0)return[];var r=[];return n.loop((function(){return new Promise((function(n){var c="?token="+p;t.getAccessToken().then((function(g){t.user_mask?c+="&user-mask="+encodeURIComponent(t.user_mask):g&&(c+="&access-token="+g),a("post",e+"subs"+c,JSON.stringify({events:s}),(function(t,a){if(d)return r=l("dead",s.length),n(!1);if(u(a))return setTimeout(n,3e3,!0);if(200!==a)return d=!0,i("subscribe",t,a),r=l("dead",s.length),n(!1);if(p)return n(!1);var c=(t=o(t)||{}).initial_token;return c?(t.host&&(e=h(t.host)),p=c,f(0),n(!1)):setTimeout(n,3e3,!0)}))}))}))})).then((function(){return r}))}));this.subscribe=g.push.bind(g)}var r=function(e,t,i,n){if("undefined"==typeof XMLHttpRequest)return function(e,t,i,n){let s={};i&&(s["content-type"]="text/plain"),fetch(t,{method:e,headers:s,body:i}).then((e=>e.text().then((t=>n&&n(t,e.status))))).catch((e=>n&&n(e,-1)))}(e,t,i,n);var s=new XMLHttpRequest;s.onreadystatechange=function(e){4===s.readyState&&(n&&n(s.responseText,s.status),n=void 0)},s.onerror=function(){n&&n(s.responseText,-1),n=void 0},s.open(e,t),i&&s.setRequestHeader("content-type","text/plain"),s.send(i)};function o(e){try{return JSON.parse(e)}catch(e){}}function a(){var e={};this.emit=function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var s=e[t];if(s)for(n=0;n<s.length;n++)s[n].apply(void 0,i)},this.on=function(t,i){e[t]||(e[t]=[]),e[t].push(i)}}function c(e){if(!e||-1===e)return 0;var t=1e3*Math.pow(1.5,e);return Math.min(1e4,t)}function u(e){return e>=500&&e<600||0===e||-1===e||429===e}function l(e,t){for(var i=[],n=0;n<t;n++)i.push(e);return i}function h(e){return(e=e||"").startsWith("//")?"https:"+e:e}e.exports=function(e,t,i){("string"==typeof e||e instanceof String)&&(e=[e]),(t=t||{}).getAccessToken||(t.getAccessToken=function(){return Promise.resolve("")});var n,r=new a,o={},c=!1;this.stop=function(){c||(c=!0,n.kill())},this.onEvent=function(e){return r.on("event",e)},this.onInterrupted=function(e){return r.on("interrupted",e)},this.subscribe=function(e){if(c)return Promise.resolve({});if("string"==typeof e&&(e=[e]),!Array.isArray(e))return Promise.resolve({error:"param should be an array or string"});for(var t=[],i=0;i<e.length;i++){var s=e[i];s&&(o[s]||t.push(n.subscribe(s)))}return 0===t.length?Promise.resolve({}):Promise.all(t).then((function(t){for(var i=0;i<t.length;i++)if(t[i])return{error:t[i]};for(var n=0;n<e.length;n++)o[e[n]]=!0;return{}}))};var u=function(){if(!c){for(var a=Object.keys(o),l=0;l<a.length;l++)o[a[l]]=!1;var h=e[Math.floor(Math.random()*e.length)];n=new s(h,t,(function(e,t,i){c||(r.emit("interrupted",e,t,i),setTimeout(u,2e3))}),(function(e){if(!c)for(var t=0;t<e.length;t++)r.emit("event",e[t])}),i);var d=Object.keys(o);for(l=0;l<d.length;l++)n.subscribe(d[l])}};u()}},4636:e=>{e.exports={ApiURL:"https://api.sbz.vn/4.0",RealtimeURL:"https://api.sbz.vn/rt/0/",FileURL:"https://vcdn.subiz-cdn.com/file/",BaseURL:"https://widget.sbz.vn"}},4878:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{constructor(e,t,i){this.schema=t+"_chain",this.dead=!1,this.db=e,this.anchorCache={},this.cache={},this.init()}init(){let e={};this.db.all("items").map((t=>{e[t.chain]=e[t.chain]||{},e[t.chain][t.id]={id:t.id,chain:t.chain,full_id:t.full_id,index:t.index,value:t.value}})),r(e,((t,i)=>{if(((n=t)?void 0!==n.length?n.length:Object.keys(n).length:0)<50)return;var n;let s=(o=r(t),a=["index"],"desc",c=[],r(o,(e=>c.push(e))),c.sort(((e,t)=>{if(e[a]===t[a])return 0;var i=e[a]<t[a]?-1:1;return-i})),c);var o,a,c;let u=[];for(var l=50;l<s.length;l++)u.push(s[l].full_id),delete t[s[l].id];this.db.removes("items",u),e[i]=t})),this.cache=e}destroy(){this.db.clear("items"),this.dead=!0,this.cache={},this.anchorCache={},this.db=void 0}put(e,t,i,n){if(this.dead)return;let r=this.cache[e]||{},o=(s(r)||{}).index||"z",a={id:t,index:i,value:n,chain:e,full_id:e+":"+t};delete r[a.id],o>a.index+""||(r[a.id]=a,this.cache[e]=r,this.db.put("items",a.full_id,a))}listM(e){if(this.dead)return{};let t=this.cache[e]||{},i={};return r(t,((e,t)=>{i[t]=e.value})),i}async fetchMore(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,i=arguments.length>2?arguments[2]:void 0;if(this.dead)return{error:"dead"};if(!i)return{error:"no api"};let n=this.anchorCache[e]||"";var[s,r,o]=await i(e,n,t);if(o)return{error:o};if(this.dead)return{error:"dead"};let a=this.cache[e]||{};return 0===s.length?{end:!0}:(s.forEach((t=>{t.chain=e,t.full_id=e+":"+t.id,a[t.id]=t,this.db.put("items",t.full_id,t)})),this.anchorCache[e]=r,this.cache[e]=a,{})}del(e,t){if(this.dead)return;let i=e+":"+t;delete(this.cache[e]||{})[t],this.db.removes("items",[i])}match(e,t){return this.listM(e)[t]}async reload(e,t){if(this.dead)return;let i=function(e){if(!e)return;let t=Object.keys(e);if(!t.length)return;let i=-1/0,n=Object.keys(e)[0];for(var s=0;s<t.length;s++){let r=e[t[s]]&&e[t[s]].index||-1/0;r>i&&(i=r,n=t[s])}return e[t[n]]}(this.listM(e))||{},n=i.index;n||(n=Date.now());for(var o="",a={};;){if(this.dead)return;let[i,c,u]=await t(e,o,50);if(u)return;if(this.dead)return;if(i.map((t=>{a[t.id]=Object.assign({},t,{chain:e,full_id:e+":"+t.id})})),0===i.length||c===o)break;if(a.length>=200){let t=this.cache[e]||{},i=[];r(t,(t=>{t.chain===e&&i.push(t.full_id)})),this.db.removes("items",i),this.cache[e]={};break}if((s(a)||{}).index<=n){o=this.anchorCache[e]||c;break}o=c}for(var c=0;c<Object.keys(a).length;c++){let e=a[Object.keys(a)[c]];this.db.put("items",e.full_id,e),this.cache[e.chain]=this.cache[e.chain]||{},this.cache[e.chain][e.id]=e}this.anchorCache[e]=o}}function s(e){if(!e)return;let t=Object.keys(e);if(!t.length)return;let i=1/0,n=Object.keys(e)[0];for(var s=0;s<t.length;s++){let r=e[t[s]]&&e[t[s]].index||1/0;r<i&&(i=r,n=t[s])}return e[n]}function r(e,t){if(!e)return[];if(!t)return e;var i=[];if(Array.isArray(e)){for(let n=0;n<e.length;n++)i.push(t(e[n],n));return i}if("object"==typeof e){var n=Object.keys(e);for(let r=0;r<n.length;r++){var s=n[r];i.push(t(e[s],s))}return i}return i}},9489:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var n={},s={};n.length=0,n.getItem=function(e){return e in s?s[e]:null},n.setItem=function(e,t){void 0===t?n.removeItem(e):s[e]=""+t,n.length=Object.keys(s).length},n.removeItem=function(e){Object.prototype.hasOwnProperty.call(s,e)&&(delete s[e],n.length=Object.keys(s).length)},n.key=function(e){return Object.keys(s)[e]||null},n.clear=function(){s={},n.length=0};const r=n},1606:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});const n=class{constructor(e,t){this.name=t,t+="_kv",this.dead=!1,this.db=e,this.cache={},this.initialized=!1,this.init()}refreshCache(){if(this.dead)return;let e={};this.db.all("items").forEach((function(t){e[t.key]=t.value})),this.cache=e}init(){if(this.initialized)return;let e={};console.time("KV"+this.name),this.db.all("items").forEach((function(t){e[t.key]=t.value})),this.cache=e;let t=Object.keys(this.cache);if(t.length>500){let e=250/t.lenth,n=[];for(var i=0;i<500;i++){if(Math.random()<=e)continue;let s=t[i];delete this.cache[s],n.push(s)}this.db.removes("items",[n])}this.initialized=!0,console.timeEnd("KV"+this.name)}all(){return this.dead?[]:this.initialized?this.cache:[]}match(e){if(!this.dead&&this.initialized&&e)return this.cache[e]}put(e,t){if(e){if(this.dead)return[];if(!this.initialized)throw new Error("uninitialized");this.cache[e]=t,this.db.put("items",e,{key:e,value:t})}}del(e){if(!this.dead){if(!this.initialized)throw new Error("uninitialized");delete this.cache[e],this.db.removes("items",[e])}}destroy(){this.db.clear("items"),this.dead=!0,this.db=void 0,this.cache=void 0,this.initialized=!1}}},6929:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});let n=i(9489).Z,s=window.requestIdleCallback||(e=>e());const r=class{constructor(e,t){if(this.localStorage=n,this.allkeys={},!t)try{window.localStorage.setItem("sbzstore1029","?"),window.localStorage.removeItem("sbzstore1029"),this.localStorage=window.localStorage}catch(e){}this.schema=e}all(e){let t=[];for(var i=0;i<this.localStorage.length;i++){let n=this.localStorage.key(i);n.startsWith(this.schema+"#"+e+"#")&&(this.allkeys[n]=!0,t.push(JSON.parse(this.localStorage.getItem(n))))}return t}removes(e,t){for(var i=0;i<t.length;i++)delete this.allkeys[this.schema+"#"+e+"#"+t[i]],this.localStorage.removeItem(this.schema+"#"+e+"#"+t[i])}clear(e){let t=[];for(var i=0;i<this.localStorage.length;i++){let n=this.localStorage.key(i);n.startsWith(this.schema+"#"+e+"#")&&t.push(n)}for(i=0;i<t.length;i++)this.localStorage.removeItem(t[i]);this.allkeys={}}put(e,t,i){this.allkeys[this.schema+"#"+e+"#"+t]=!0,Object.keys(this.allkeys).length>80&&this.clear(e),s((()=>{try{this.localStorage.setItem(this.schema+"#"+e+"#"+t,void 0===(n=i)?"null":JSON.stringify(n))}catch(t){this.clear(e)}var n}))}}},2493:(e,t,i)=>{"use strict";i.d(t,{Kd:()=>a,Rs:()=>c,WW:()=>l,u$:()=>o,up:()=>r});var n=i(6400),s=i(819);class r extends n.wA{constructor(e){super(e),this._isMounted=!0,setTimeout((()=>{if(this.componentWillUnmount){let e=this.componentWillUnmount.bind(this);this.componentWillUnmount=()=>{e(),this._isMounted=!1}}}),10)}}class o extends r{constructor(e){super(e),this.setWrapperRef=this.setWrapperRef.bind(this),this.onClick=this.onClick.bind(this)}componentDidMount(){document.addEventListener("mousedown",this.onClick)}componentWillUnmount(){document.removeEventListener("mousedown",this.onClick)}setWrapperRef(e){this.wrapperRef=e}onClick(e){this.wrapperRef&&!this.wrapperRef.contains(e.target)&&this.props.onClickaway&&this.props.onClickaway()}render(){return(0,n.h)("div",{ref:this.setWrapperRef},this.props.children)}}const a=(e,t)=>{t||(t="");let i=s.Z.find(e.locales,(e=>e.toLowerCase().trim()===t.toLowerCase().trim()));return i||(i=s.Z.find(e.locales,(e=>(e=e.replace("-","_").split("_")[0].trim().toLowerCase())==t.replace("-","_").split("_")[0].trim().toLowerCase())),i||e.locale||"en-US")};let c={},u=!1;function l(e,t,i){if(u)return new Promise((n=>setTimeout((()=>l(e,t,i).then(n)),100)));let n;return u=!0,"debug"===t||c[t]&&!i?(u=!1,Promise.resolve()):e.getLocaleContent(t).then((e=>{u=!1,n=s.Z.get(e,"body.messages",[]),c[t]=n}))}},8733:(e,t,i)=>{"use strict";i.r(t),i.d(t,{DEFVAL:()=>ee,DEF_CHAT_BUTTON_BACKGROUND_IMAGE_URL:()=>K,Date:()=>c,agentsOfConvo:()=>z,checkRunConditions:()=>ne,cloneDeep:()=>v,convoOfEv:()=>d,convoToEv:()=>p,detectLang:()=>ge,diffDay:()=>ue,diffYear:()=>le,each:()=>x,filter:()=>b,find:()=>T,formatCurrency:()=>ve,getAgentDisplayName:()=>$,getDayName:()=>se,getIntegrationId:()=>U,getMs:()=>fe,getMsgField:()=>g,getUrlParameter:()=>me,getUserAttr:()=>H,includes:()=>w,isConvoSeen:()=>C,isEmail:()=>D,isNumber:()=>R,isPhone:()=>q,isURL:()=>I,isUserBanned:()=>G,js2css:()=>te,last:()=>W,map:()=>k,merge:()=>_,noop:()=>B,norm:()=>N,offsetToMin:()=>ce,orderBy:()=>E,parseJSON:()=>s,preloadImg:()=>ae,preloadWebfonts:()=>oe,randomString:()=>y,replaceAll:()=>O,replaceCssVariable:()=>J,replaceCssVariablePlugin:()=>Q,requestAnimationFrame:()=>u,sameDay:()=>he,scrollIntoViewIfNeeded:()=>be,setCss:()=>Y,setInterval:()=>h,setMsgField:()=>f,setTimeout:()=>l,setUserAttr:()=>F,shortTime:()=>de,size:()=>S,sleep:()=>_e,startsWith:()=>A,stringify:()=>o,throttle:()=>j,tokenize:()=>X,trim:()=>M,trimStart:()=>P,unicodeToAscii:()=>ye,unixSec:()=>pe,usersOfConvo:()=>Z});var n=i(6877);function s(e){try{return a(e)}catch(e){}}var r=document.createElement("iframe");r.style.display="none",document.documentElement.appendChild(r);var o=r.contentWindow.JSON.stringify,a=r.contentWindow.JSON.parse,c=r.contentWindow.Date,u=r.contentWindow.requestAnimationFrame,l=r.contentWindow.setTimeout,h=r.contentWindow.setInterval;function d(e){if(!e)return"";switch(e.type){case"conversation_state_updated":case"conversation_joined":case"conversation_invited":case"conversation_left":case"conversation_tagged":case"conversation_untagged":case"conversation_typing":case"conversation_rating_requested":case"conversation_rated":return n.get(e,"data.conversation.id");case"message_sent":case"message_updated":case"message_pong":return n.get(e,"data.message.conversation_id");case"ticket_updated":return n.get(e,"data.ticket.conversation_id");default:return""}}function p(e,t){if(!t)return"";switch(t.type){case"conversation_state_updated":case"conversation_joined":case"conversation_invited":case"conversation_left":case"conversation_tagged":case"conversation_untagged":case"conversation_typing":case"conversation_rating_requested":case"conversation_rated":return n.set(t,"data.conversation.id",e);case"message_sent":case"message_updated":case"message_pong":return n.set(t,"data.message.conversation_id",e);case"ticket_updated":return n.set(t,"data.ticket.conversation_id",e);default:return""}}function f(e,t,i){var s=n.get(e,"data.message.fields")||[];(s=b(s,(e=>e.key!==t))).push({key:t,value:o(i)}),n.set(e,"data.message.fields",s)}function g(e,t){var i=n.get(e,"data.message.fields");if(0===S(i))return;let s=i.find((e=>e.key===t));try{return s?a(s.value):void 0}catch(e){}}function m(e){return e&&"object"==typeof e&&!Array.isArray(e)}function _(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),n=1;n<t;n++)i[n-1]=arguments[n];if(!i.length)return e;const s=i.shift();if(m(e)&&m(s))for(const t in s)m(s[t])?(e[t]||Object.assign(e,{[t]:{}}),_(e[t],s[t])):Object.assign(e,{[t]:s[t]});return _(e,...i)}function v(e){if(e!==Object(e))return e;var t=o(e);return void 0!==t?a(t):void 0}function y(e){var t,i="";(!e||e<1)&&(e=10);for(var n=0;n<e;n++)t=Math.floor(25*Math.random()+97),i+=String.fromCharCode(t);return i}function b(e,t){if(!e)return[];if(!t)return e;var i=[];if(Array.isArray(e)){for(let n=0;n<e.length;n++)t(e[n],n)&&i.push(e[n]);return i}if("object"==typeof e){var n=Object.keys(e);for(let r=0;r<n.length;r++){var s=n[r];t(e[s],s)&&i.push(e[s])}return i}return i}function w(e,t){if(!e)return!1;var i="string"==typeof e||e instanceof String;return!(!Array.isArray(e)&&!i)&&e.includes(t)}function k(e,t){if(!e)return[];t||(t=e=>e);var i=[];if(Array.isArray(e)){for(let n=0;n<e.length;n++)i.push(t(e[n],n));return i}if("object"==typeof e){var n=Object.keys(e);for(let r=0;r<n.length;r++){var s=n[r];i.push(t(e[s],s))}return i}return i}function x(e,t){return k(e,t)}function Z(e){return e?k(b(e.members,(e=>"user"===e.type)),(e=>e.id)):[]}function C(e,t){if("ended"===e.state)return!0;let i=e.last_message_sent;if(!i)return!0;if(n.get(i,"by.id")===t)return!0;let s=T(e.members,(e=>e.id===t));return!s||fe(i.created)<fe(s.seen_at)}function z(e,t){return e?k(b(e.members,(e=>t?"agent"===e.type||"bot"===e.type:"agent"===e.type)),(e=>e.id)):[]}function A(e,t){return((e||"")+"").startsWith(t)}function S(e){return e?void 0!==e.length?e.length:Object.keys(e).length:0}function O(e,t,i){return(e||"").split(t).join(i)}function M(e,t){return((e||"")+"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function P(e,t){for(e=(e||"")+"";e.charAt(0)===t;)e=e.substr(1);return e}function j(e,t,i){var n,s,r,o=null,a=0;i||(i={});var u=function(){a=!1===i.leading?0:(new c).getTime(),o=null,r=e.apply(n,s),o||(n=s=null)};return function(){var h=(new c).getTime();a||!1!==i.leading||(a=h);var d=t-(h-a);return n=this,s=arguments,d<=0||d>t?(o&&(clearTimeout(o),o=null),a=h,r=e.apply(n,s),o||(n=s=null)):o||!1===i.trailing||(o=l(u,d)),r}}function T(e,t){if(e)return e[L(e,t)]}function L(e,t){if(!e)return-1;if(!t)return-1;if(Array.isArray(e)){for(let i=0;i<e.length;i++)if(t(e[i],i))return i;return-1}if("object"==typeof e){var i=Object.keys(e);for(let s=0;s<i.length;s++){var n=i[s];if(t(e[n],n))return n}}return-1}function E(e,t,i){var n=[];return x(e,(e=>n.push(e))),n.sort(((e,n)=>{if(e[t]===n[t])return 0;var s=e[t]<n[t]?-1:1;return"desc"===i?-s:s})),n}function U(e){return`${e}.subizv4.subikon`}function q(e){return/^[\+]?[(]?[0-9]{3}[)]?[-\s\.]?[0-9]{3}[-\s\.]?[0-9]{4,6}$/im.test(String(e))}function I(e){return/[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)/gi.test(String(e).toLowerCase())}function R(e){return/^\d+$/.test(String(e))}function D(e){return/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())}function W(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}function $(e,t){return n.get(t,"fullname")||n.get(t,"email")||n.get(e,"name")||"Agent"}function G(e){return H(e,"is_ban","boolean")}function F(e,t){if(e&&n.get(t,"key")){e.attributes=e.attributes||[];var i=L(e.attributes,(e=>e.key===t.key));-1!==i?e.attributes[i]=t:e.attributes.push(t)}}function H(e,t,i){if(!e||!e.attributes)return;let n;return x(e.attributes,(e=>{e&&e.key===t&&("datetime"===i&&(n=e.datetime),"boolean"===i&&(n=e.boolean),"number"===i&&(n=e.number),"text"===i&&(n=e.text),"list"===i&&(n=e.list))})),n}function N(e){return(e=e||"").trim().toLowerCase()}function B(){}function V(e){return("string"==typeof e||e instanceof String)&&(e=e.trim().replace(/;+$/,"")),e}function Q(e,t){var i=[e];let s=t.spacer||10;t=Object.assign({},t,{spacer:s+"px",spacer0:s/2+"px",spacer2:2*s+"px",spacer3:3*s+"px"}),i=X(i,"'@font_family'"),i=X(i,"'@font_size'"),i=X(i,"'@text_color'"),i=X(i,"'@faded_text_color'"),i=X(i,"'@primary_color'"),i=X(i,"'@background'"),i=X(i,"'@spacer'"),i=X(i,"'@spacer0'"),i=X(i,"'@spacer2'"),i=X(i,"'@spacer3'");for(var r=[],o=0;o<i.length;o++){var a=i[o];if("string"!=typeof a){var c=a.type.substr(2,a.type.length-3),u=n.get(t,c)||n.get(ee,c)||"";r.push(u)}else r.push(a)}return r.join("")}function J(e,t){var i=[e];i=X(i,"'@primary_color'"),i=X(i,"@esc-primary-color-esc"),i=X(i,"'@secondary_color'"),i=X(i,"'@background'"),i=X(i,"'@text_color'"),i=X(i,"'@width'"),i=X(i,"'@height'"),i=X(i,"'@desktop_button.width'"),i=X(i,"'@desktop_button.height'"),i=X(i,"'@desktop_button.background'"),i=X(i,"'@desktop_button.border_radius'"),i=X(i,"'@desktop_button.margin_x'"),i=X(i,"'@desktop_button.margin_y'"),i=X(i,"'@mobile_button.width'"),i=X(i,"'@mobile_button.height'"),i=X(i,"'@mobile_button.background'"),i=X(i,"'@mobile_button.border_radius'"),i=X(i,"'@mobile_button.margin_x'"),i=X(i,"'@mobile_button.margin_y'"),i=X(i,"'@widget_position'"),i=X(i,"'@z_index'"),i=X(i,"'@z_index_2'"),i=X(i,"'@z_index_3'"),i=X(i,"'@z_index_4'"),i=X(i,"'@z_index_5'");for(var s=[],r=0;r<i.length;r++){var o=i[r];if("string"!=typeof o)if("@esc-primary-color-esc"!==o.type)if("'@z_index_2'"!==o.type)if("'@z_index_3'"!==o.type)if("'@z_index_4'"!==o.type)if("'@z_index_5'"!==o.type){var a=o.type.substr(2,o.type.length-3);c=V(c=n.get(t,a)||n.get(ee,a)||""),["mobile_button.width","mobile_button.height","mobile_button.margin_x","mobile_button.margin_y","desktop_button.width","desktop_button.height","desktop_button.margin_x","desktop_button.margin_y","width","height"].includes(a)&&(c+="px"),"height"!==a||"full"!==n.get(t,"window_mode")?s.push(c):s.push("100%")}else c=n.get(t,"z_index")||n.get(ee,"z_index"),s.push(c+5);else c=n.get(t,"z_index")||n.get(ee,"z_index"),s.push(c+4);else{var c=n.get(t,"z_index")||n.get(ee,"z_index");s.push(c+3)}else{c=n.get(t,"z_index")||n.get(ee,"z_index");s.push(c+2)}else{c=n.get(t,"primary_color")||n.get(ee,"primary_color");s.push(encodeURIComponent(V(c)))}else s.push(o)}return s.join("")}function X(e,t){if(!e||!e.length)return[];var i=[];for(let r=0;r<e.length;r++){var n=e[r];if("string"==typeof n){var s=n.split(t);for(let e=0;e<s.length;e++)i.push(s[e]),i.push({type:t});i.pop()}else i.push(n)}return i}function Y(e,t,i){i=O(i,"#sbz92","#"+e),t.styleSheet?t.styleSheet.cssText=i:(t.innerHTML="",t.appendChild(document.createTextNode(i)))}const K="https://file-subiz.com/bubble_11.svg",ee={primary_color:"#0265FF",secondary_color:"#555555",background:"linear-gradient(280.16deg, #0053d3 22.03%, #0265ff 78.2%)",text_color:"white",width:375,height:705,window_mode:"mini",desktop_button:{width:.3,height:.3,border_radius:"100%",background_mask_url:K,margin_x:.3,margin_y:.3},mobile_button:{width:.3,height:.3,border_radius:"100%",background_mask_url:K,margin_x:.3,margin_y:.3},widget_position:"fixed",z_index:2e9};function te(e,t,i){var n={};for(var s in e)e.hasOwnProperty(s)&&(t&&t.length>0&&-1===t.indexOf(s)||("string"==typeof e[s]?n[s]=M(e[s]):n[s]=e[s]));e=n;let r="";for(var s in e)if(e.hasOwnProperty(s)){var o="";if(e.blur&&(o+="blur("+e.blur+") "),e.grayscale&&(o+="grayscale("+e+") "),o&&(r+="filter: "+o+"!important;"),void 0!==e.rotate&&(r+="transform:rotate("+e.rotate+") !important;"),void 0!==e[s]){let t=e[s]+"";k(i,((e,i)=>{-1!==t.indexOf(i)&&(t=O(t,i,e))})),r+=O(s,"_","-")+":"+t+" !important;","color"===s&&(r+="-webkit-text-fill-color: "+t+" !important;")}}return r}function ie(){var e=!!window.opr&&!!opr.addons||!!window.opera||navigator.userAgent.indexOf(" OPR/")>=0,t="undefined"!=typeof InstallTrigger,i=(/constructor/i.test(window.HTMLElement)||(!window.safari||"undefined"!=typeof safari&&window.safari.pushNotification).toString(),!!document.documentMode),n=!i&&!!window.StyleMedia,s=!(!window.chrome||!window.chrome.webstore&&!window.chrome.runtime);s||(s=navigator.userAgent.indexOf("Chrome"));var r=s&&-1!=navigator.userAgent.indexOf("Edg"),o=(s||e)&&!!window.CSS;return e?"opera":t?"firefox":i?"ie":n||r?"edge":s?"chrome":o?"blink":"unknown"}function ne(e,t,i,r){var o=r.matchAccount()||{},a=r.matchSession()||{};if(!function(e,t,i){if(!t)return!0;if(n.get(e,"once_per_user"))return!1;var s=i.matchSession()||{};return!(n.get(e,"once_per_session")&&t.session_id===s.id||n.get(e,"interval_sec")&&n.get(e,"interval_sec")>(c.now()-t.created)/1e3)}(e,i,r))return!1;for(var u=0;u<S(t);u++){var l=t[u];switch(l.key){case"url":let e=b(l.exclude_urls,(e=>N(e)));if(S(e)>0&&T(e,(e=>N(window.location.href).indexOf(N(e))>-1)))return!1;let t=b(l.urls,(e=>N(e)));if(S(t)>0&&!T(t,(e=>N(window.location.href).indexOf(N(e))>-1)))return!1;break;case"browser":if(S(l.browsers)>0){var h=ie();if(!T(l.browsers,(e=>N(e)===N(h))))return!1}break;case"location":if(S(l.exclude_locations)>0&&T(l.exclude_locations,(e=>!(!e.city_name||!e.country_code||e.city_name!==a.city_name||e.country_code!==a.country_code)||!(!e.city_name||e.country_code||e.city_name!==a.city_name)||!(e.city_name||!e.country_code||e.country_code!==a.country_code)||void 0)))return!1;if(S(l.locations)>0&&!T(l.locations,(e=>!(!e.city_name||!e.country_code||e.city_name!==a.city_name||e.country_code!==a.country_code)||!(!e.city_name||e.country_code||e.city_name!==a.city_name)||!(e.city_name||!e.country_code||e.country_code!==a.country_code)||void 0)))return!1;break;case"returning_visitor":if(l.returning_visitor&&r.new_visitor)return!1;if(!l.returning_visitor&&!r.new_visitor)return!1;break;case"user_is_a_contact":let i=n.get(r.matchUser(),"attributes",[]),f=T(i,(e=>"emails"===e.key)),g=T(i,(e=>"phones"===e.key)),m=f||g;if(l.user_is_a_contact&&!m)return!1;if(!l.user_is_a_contact&&m)return!1;break;case"device_type":if(S(l.device_types)>0){let e="desktop";if(r.isMobile()&&(e="mobile"),r.isTablet()&&(e="tablet"),!T(l.device_types,(t=>N(t)===N(e))))return!1}break;case"referer":if(S(l.exclude_referers)>0&&T(l.exclude_referers,(e=>N(document.referrer).indexOf(N(e))>-1)))return!1;if(S(l.urls)>0&&!T(l.referers,(e=>N(document.referrer).indexOf(N(e))>-1)))return!1;break;case"source":if(S(l.sources)>0&&!T(l.sources,(e=>N(e)===N(a.source))))return!1;break;case"user_attribute":let _,v=n.get(r.matchUser(),"attributes",[]),y=n.get(l,"user.operator");x(v,(e=>{e&&e.key===n.get(l,"user.key")&&(_=e.datetime||e.boolean||e.number||e.text||e.list)}));let w=!0;switch(y){case"cons":let e=s(l.value)||[];if(0===S(e))return!1;w=!!T(e,(e=>N(_).indexOf(N(e))>-1));break;case"notEmpty":w=!!_;break;case"empty":w=!_;break;case"true":w=!0===_||"true"===_;break;case"false":w=!_||!1===_||"false"===_}if(!w)return!1;break;case"timming":if("in"===l.business_hour&&!o.is_in_business_hour)return!1;if("notIn"===l.business_hour&&o.is_in_business_hour)return!1;if(S(l.days_of_week)>0&&!T(l.days_of_week,(e=>N(se((new c).getDay()))===N(e))))return!1;if(S(l.minute_of_days)>0&&S(l.minute_of_days)%2==0){var d=new c,p=d.getMinutes()+60*d.getHours();let e=!1;for(u=0;u<l.minute_of_days.length;u+=2)if(l.minute_of_days[u]<=p&&p<=l.minute_of_days[u+1]){e=!0;break}if(!e)return!1}break;case"offline":if(!o.is_online!=!!l.offline)return!1}}return!0}function se(e){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e]}let re={};function oe(e,t){for(var i=0;i<e.length;i++){let t=e[i];if(t&&!re[t]){re[t]=!0;for(var n=0;n<2;n++){let e=[400,500][n],i=document.createElement("div");i.innerHTML="@!-/#Chào mỪng1",i.style.position="absolute",i.style.display="block",i.style.opacity="0.1",i.style.color="transparent",i.style.fontSize="20px",i.style.height="0px",i.style.top="0px",i.style.width="0px",i.style.fontWeight=e,i.setAttribute("subiz-preload",t+":"+e),document.body.appendChild(i),i.style.fontFamily=t,l((()=>i.remove()),3e3)}}}}function ae(e,t){if(t||(t=()=>{}),!e)return t(),Promise.resolve(!0);let i=new Image;return e=function(e){let t="https://vcdn.subiz-cdn.com/file/";return e?A(e,"/")||A(e,"data:")?e:(A(e,"http://")||A(e,"https://")||A(e,"//")||(e=M(t)+"/"+P(e,"/")),(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace("https://file-subiz.com/",t)).replace("http://file-subiz.com/",t)).replace("https://file-v4.subiz.com/",t)).replace("http://file-v4.subiz.com/",t)).replace("https://filev4.subiz.com/",t)).replace("http://filev4.subiz.com/",t)).replace("https://filev4-1.subiz.com/",t)).replace("http://filev4-1.subiz.com/",t)).replace("https://file.subiz.com/",t)).replace("http://file.subiz.com/",t)).replace("https://file.mysubiz.com/",t)).replace("http://file.mysubiz.com/",t)):""}(e),i.src=e,new Promise((e=>{i.onload=()=>{t(),e()}}))}function ce(e){if(!e)return 0;e.length<=2&&(e+=":00");let t=e.split(":");if(2!==t.length)return 0;let i=parseInt(t[0]);if(i<0||i>23)return 0;let n=parseInt(t[1]);return n<0||n>59?0:60*i+n}function ue(e,t,i){var n=-(new c).getTimezoneOffset();i&&(n=ce(i));var s=new c(e).getTime(),r=new c(t).getTime(),o=Math.ceil((s/60/1e3+n)/60/24),a=Math.ceil((r/60/1e3+n)/60/24);return Math.abs(o-a)}function le(e,t,i){var n=-(new c).getTimezoneOffset(),s=-(new c).getTimezoneOffset();i&&(s=ce(i));var r=new c(e).getTime()+60*(s-n)*1e3,o=new c(t).getTime()+60*(s-n)*1e3;return Math.abs(new c(r).getYear()-new c(o).getYear())}function he(e,t,i){return 0===ue(e,t,i)}function de(e,t,i){var s=-(new c).getTimezoneOffset(),r=s;t&&(r=ce(t));var o=new c(fe(e));let a=new c(o);a.setMinutes(o.getMinutes()+r-s),i||(i=new c);let u=a.getHours(),l=a.getMinutes(),h=n.get(navigator,"languages.0","en-US"),d=a.toLocaleDateString(h,{weekday:"long"}),p=a.getFullYear(),f=a.getMonth()+1,g=a.toLocaleDateString(h,{month:"long"}),m=a.getDate();return u<10&&(u="0"+u),l<10&&(l="0"+l),he(o,i,t)?u+":"+l:ue(o,i,t)<=5?d+", "+u+":"+l:0===le(o,i,t)?g+" "+m+", "+u+":"+l:p+"/"+f+"/"+m+", "+u+":"+l}function pe(e){return Math.floor(fe(e)/1e3)}function fe(e){return e?"number"!=typeof e&&(e=new c(e).getTime()):e=0,e>1e18?Math.floor(e/1e6):e>1e15?Math.floor(e/1e3):e>1e12?e:1e3*e}function ge(){let e=me(),t=document.getElementsByTagName("html")[0].getAttribute("xml:lang")||document.getElementsByTagName("html")[0].getAttribute("lang"),i=navigator.language;return e||t||i}function me(){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+name+"=([^&#]*)").exec(location.search);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))}var _e=e=>new Promise((t=>l(t,e)));function ve(e){return e?(e=Math.round(e)).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")+" đ":"0 đ"}function ye(e){return(e=(e+="").replace("đ","d").replace("Đ","D")).normalize("NFD").replace(/[\u0300-\u036f]/g,"")}function be(e){centerIfNeeded=0===arguments.length||!!centerIfNeeded;var t=e.parentNode,i=window.getComputedStyle(t,null),n=parseInt(i.getPropertyValue("border-top-width")),s=parseInt(i.getPropertyValue("border-left-width")),r=e.offsetTop-t.offsetTop<t.scrollTop,o=e.offsetTop-t.offsetTop+e.clientHeight-n>t.scrollTop+t.clientHeight,a=e.offsetLeft-t.offsetLeft<t.scrollLeft,c=e.offsetLeft-t.offsetLeft+e.clientWidth-s>t.scrollLeft+t.clientWidth,u=r&&!o;(r||o)&¢erIfNeeded&&(t.scrollTop=e.offsetTop-t.offsetTop-t.clientHeight/2-n+e.clientHeight/2),(a||c)&¢erIfNeeded&&(t.scrollLeft=e.offsetLeft-t.offsetLeft-t.clientWidth/2-s+e.clientWidth/2),(r||o||a||c)&&!centerIfNeeded&&e.scrollIntoView(u)}},2302:(e,t,i)=>{"use strict";i.d(t,{Z:()=>n});class n{constructor(e){this.isOpen=!0===e,this.cbs=[]}open(){this.isOpen=!0;let e=[];this.cbs.forEach((t=>{this.isOpen?t():e.push(t)})),this.cbs=e}close(){this.isOpen=!1}entry(e,t){return this.isOpen?(t&&(this.isOpen=!1),e&&e(),Promise.resolve()):new Promise((i=>{this.cbs.push((()=>{t&&(this.isOpen=!1),e&&e(),i()}))}))}}},819:(e,t,i)=>{"use strict";i.d(t,{Z:()=>Z});var n={};i.r(n),i.d(n,{extract:()=>d,extractEmails:()=>l,extractEmojis:()=>c,extractLinks:()=>u,extractPhones:()=>h,extractText:()=>f,pipeExtracts:()=>p});var s={};i.r(s),i.d(s,{trackAreaClicked:()=>v,trackExitIntent:()=>m,trackInactivity:()=>y,trackScrollingPercentage:()=>_,trackTimeOnPage:()=>w});var r=i(8733),o=i(8733);let a=["like","unlike","wink","tongue-out","tired","surprised","smiling","sleepy","sad","neutral","heart-eyes","grinning","crying","confused","angry","cry","heart_eyes","neutral_face","emoji--disappointed","smile","open_mouth","tired_face","stuck_out_tongue","moyai","thumbsdown","dislike","thumbsup","ok_hand","octopus","pig2","wave","mouse","mouse2","rat"];function c(e){for(var t=[],i=0;i<e.length;i++)for(var n=0;n<a.length;n++)if(e.indexOf(a[n],i)===i){t.push({index:i,length:a[n].length}),i+=a[n].length-1;break}return t}function u(e){e=e||"";for(var t,i=/(https?:\/\/)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.,~#?&//=]*)/gim,n=[];t=i.exec(e);)n.push({index:t.index,length:i.lastIndex-t.index});return n}function l(e){e=e||"";for(var t,i=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/gim,n=[];t=i.exec(e);)n.push({index:t.index,length:i.lastIndex-t.index});return n}function h(e){e=e||"";for(var t="",i={},n=0;n<e.length;n++){var s=e.charAt(n);if("."===s||"-"===s||" "===s){var r=n>0?e.charAt(n-1):"-",o=n<e.length-1?e.charAt(n+1):"-";-1!=="0123456789".indexOf(r)&&-1!=="0123456789".indexOf(o)||(i[(t+=s).length-1]=n)}else i[(t+=s).length-1]=n}for(var a,c=/([0-9]{8,13})/gim,u=[];a=c.exec(t);)u.push({index:i[a.index],length:i[c.lastIndex-1]-i[a.index]+1});return u}function d(e,t,i){if(!e)return[];var n=[],s=0,r=t(e);if(0===o.size(r))return[{type:"text",text:e}];o.each(r,(t=>{n.push({type:"text",text:e.substr(s,t.index-s)}),n.push({type:i,text:e.substr(t.index,t.length)}),s=t.index+t.length}));var a=o.last(r);return n.push({type:"text",text:e.substr(a.index+a.length,e.length-a.index+a.length)}),o.filter(n,(e=>""!==e.text))}function p(e,t){var i=[];if(0===o.size(t))return[{type:"text",text:e}];var n=t.shift(),s=d(e,n,n.type);return o.each(s,(e=>{if("text"!==e.type)return i.push(e);i=i.concat(p(e.text,t.slice()))})),i}function f(e){var t=u;t.type="link";var i=l;i.type="email";var n=h;n.type="phone";var s=c;return s.type="emoji",p(e,[i,t,n,s])}a=o.map(a,(e=>":"+e+":"));var g=i(8733);function m(e){let t=i=>{i.clientY>10||(e&&e(),document.removeEventListener("mouseout",t))};document.addEventListener("mouseout",t)}function _(e,t){let i=n=>{let s=n.srcElement.scrollingElement?n.srcElement.scrollingElement.scrollTop:n.srcElement.scrollTop,r=n.srcElement.scrollingElement?n.srcElement.scrollingElement.scrollHeight:n.srcElement.scrollHeight;s>0&&r>0&&(s+window.innerHeight)/r>=e&&(t&&t(),window.removeEventListener("scroll",i,!1))};window.addEventListener("scroll",i,!1)}function v(e,t){e&&(e=e||"",g.map(e.split("\n"),(e=>{if(!(e=g.trim(e)))return;let i=[];try{i=document.querySelectorAll(e)}catch(e){}g.map(i,(e=>{e&&e.addEventListener("click",t,!1)}))})))}function y(e,t){let i=["scroll","keyup","keydown","mousemove","mousewheel","mouseenter","mouseover","mousedown","touchstart","touchmove","touchenter"],n=0,s=()=>{n=0},r=setInterval((()=>{if(n++,!(n<e)){t&&t();for(let e of i)document.removeEventListener(e,s,!1);clearInterval(r)}}),1e3);for(let e of i)document.addEventListener(e,s,!1)}let b=0;function w(e,t){if(e<1)return setTimeout((function(){t(e)}),100);let i=setInterval((()=>{b<e||(t&&t(b),clearInterval(i))}),1e3)}setInterval((()=>{b+=5}),5e3);var k={};(k=Object.assign(k,r)).Gate=i(2302).Z;var x=i(6877);k.get=x.get,k.set=x.set,k.Pubsub=i(2851).Z,k=Object.assign(k,n);const Z=k=Object.assign(k,s)},6877:(e,t,i)=>{"use strict";i.r(t),i.d(t,{get:()=>a,set:()=>c});var n=Object.prototype.toString,s=Array.isArray||function(e){return"[object Array]"===n.call(e)};function r(e){var t=parseInt(e);return t.toString()===e?t:e}function o(e,t){if(function(e,t){return"number"==typeof t&&s(e)||function(e,t){return null!=e&&Object.prototype.hasOwnProperty.call(e,t)}(e,t)}(e,t))return e[t]}function a(e,t,i){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if(null==e)return i;if("string"==typeof t)return a(e,t.split("."),i);var n=r(t[0]),s=o(e,n);return void 0===s?i:1===t.length?s:a(e[n],t.slice(1),i)}function c(e,t,i){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if("string"==typeof t)return c(e,t.split(".").map(r),i);var n=t[0],s=o(e,n);return 1===t.length?(e[n]=i,s):(void 0===s&&(e[n]="number"==typeof t[1]?[]:{}),c(e[n],t.slice(1),i))}},2851:(e,t,i)=>{"use strict";i.d(t,{Z:()=>r});var{filter:n,map:s}=i(8733);class r{constructor(){this.listeners={}}publish(e,t,i,r){this.listeners[e]=n(this.listeners[e],(e=>e.obj._isMounted)),s(this.listeners[e],(e=>{let{cb:n}=e;return n(t,i,r)}))}on2(e,t,i){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push({obj:e,cb:i})}}},9554:function(e){e.exports=function(){"use strict";var e=function(){return e.get.apply(e,arguments)},t=e.utils={isArray:Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},isPlainObject:function(e){return!!e&&"[object Object]"===Object.prototype.toString.call(e)},toArray:function(e){return Array.prototype.slice.call(e)},getKeys:Object.keys||function(e){var t=[],i="";for(i in e)e.hasOwnProperty(i)&&t.push(i);return t},encode:function(e){return String(e).replace(/[,;"\\=\s%]/g,(function(e){return encodeURIComponent(e)}))},decode:function(e){return decodeURIComponent(e)},retrieve:function(e,t){return null==e?t:e}};return e.defaults={},e.expiresMultiplier=86400,e.set=function(e,i,n){if(t.isPlainObject(e))for(var s in e)e.hasOwnProperty(s)&&this.set(s,e[s],i);else{var r=void 0!==(n=t.isPlainObject(n)?n:{expires:n}).expires?n.expires:this.defaults.expires||"",o=typeof r;"string"===o&&""!==r?r=new Date(r):"number"===o&&(r=new Date(+new Date+1e3*this.expiresMultiplier*r)),""!==r&&"toUTCString"in r&&(r=";expires="+r.toUTCString());var a=n.path||this.defaults.path;a=a?";path="+a:"";var c=n.domain||this.defaults.domain;c=c?";domain="+c:"";var u=n.secure||this.defaults.secure?";secure":"";!1===n.secure&&(u="");var l=n.sameSite||this.defaults.sameSite;l=l?";SameSite="+l:"",null===n.sameSite&&(l=""),document.cookie=t.encode(e)+"="+t.encode(i)+r+a+c+u+l}return this},e.setDefault=function(i,n,s){if(t.isPlainObject(i)){for(var r in i)void 0===this.get(r)&&this.set(r,i[r],n);return e}if(void 0===this.get(i))return this.set.apply(this,arguments)},e.remove=function(e){for(var i=0,n=(e=t.isArray(e)?e:t.toArray(arguments)).length;i<n;i++)this.set(e[i],"",-1);return this},e.removeSpecific=function(e,i){if(!i)return this.remove(e);e=t.isArray(e)?e:[e],i.expires=-1;for(var n=0,s=e.length;n<s;n++)this.set(e[n],"",i);return this},e.empty=function(){return this.remove(t.getKeys(this.all()))},e.get=function(e,i){var n=this.all();if(t.isArray(e)){for(var s={},r=0,o=e.length;r<o;r++){var a=e[r];s[a]=t.retrieve(n[a],i)}return s}return t.retrieve(n[e],i)},e.all=function(){if(""===document.cookie)return{};for(var e=document.cookie.split("; "),i={},n=0,s=e.length;n<s;n++){var r=e[n].split("="),o=t.decode(r.shift()),a=t.decode(r.join("="));i[o]=a}return i},e.enabled=function(){if(navigator.cookieEnabled)return!0;var t="_"===e.set("_","_").get("_");return e.remove("_"),t},e}()},6400:(e,t,i)=>{"use strict";i.d(t,{HY:()=>_,Vf:()=>m,h:()=>f,sY:()=>U,wA:()=>v});var n,s,r,o,a,c,u={},l=[],h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function d(e,t){for(var i in t)e[i]=t[i];return e}function p(e){var t=e.parentNode;t&&t.removeChild(e)}function f(e,t,i){var s,r,o,a={};for(o in t)"key"==o?s=t[o]:"ref"==o?r=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return g(e,a,s,r,null)}function g(e,t,i,n,o){var a={type:e,props:t,key:i,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++r:o};return null==o&&null!=s.vnode&&s.vnode(a),a}function m(){return{current:null}}function _(e){return e.children}function v(e,t){this.props=e,this.context=t}function y(e,t){if(null==t)return e.__?y(e.__,e.__.__k.indexOf(e)+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?y(e):null}function b(e){var t,i;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e){e.__e=e.__c.base=i.__e;break}return b(e)}}function w(e){(!e.__d&&(e.__d=!0)&&o.push(e)&&!k.__r++||c!==s.debounceRendering)&&((c=s.debounceRendering)||a)(k)}function k(){for(var e;k.__r=o.length;)e=o.sort((function(e,t){return e.__v.__b-t.__v.__b})),o=[],e.some((function(e){var t,i,n,s,r,o;e.__d&&(r=(s=(t=e).__v).__e,(o=t.__P)&&(i=[],(n=d({},s)).__v=s.__v+1,M(o,s,n,t.__n,void 0!==o.ownerSVGElement,null!=s.__h?[r]:null,i,null==r?y(s):r,s.__h),P(i,s),s.__e!=r&&b(s)))}))}function x(e,t,i,n,s,r,o,a,c,h){var d,p,f,m,v,b,w,k=n&&n.__k||l,x=k.length;for(i.__k=[],d=0;d<t.length;d++)if(null!=(m=i.__k[d]=null==(m=t[d])||"boolean"==typeof m?null:"string"==typeof m||"number"==typeof m||"bigint"==typeof m?g(null,m,null,null,m):Array.isArray(m)?g(_,{children:m},null,null,null):m.__b>0?g(m.type,m.props,m.key,null,m.__v):m)){if(m.__=i,m.__b=i.__b+1,null===(f=k[d])||f&&m.key==f.key&&m.type===f.type)k[d]=void 0;else for(p=0;p<x;p++){if((f=k[p])&&m.key==f.key&&m.type===f.type){k[p]=void 0;break}f=null}M(e,m,f=f||u,s,r,o,a,c,h),v=m.__e,(p=m.ref)&&f.ref!=p&&(w||(w=[]),f.ref&&w.push(f.ref,null,m),w.push(p,m.__c||v,m)),null!=v?(null==b&&(b=v),"function"==typeof m.type&&m.__k===f.__k?m.__d=c=Z(m,c,e):c=C(e,m,f,k,v,c),"function"==typeof i.type&&(i.__d=c)):c&&f.__e==c&&c.parentNode!=e&&(c=y(f))}for(i.__e=b,d=x;d--;)null!=k[d]&&("function"==typeof i.type&&null!=k[d].__e&&k[d].__e==i.__d&&(i.__d=y(n,d+1)),L(k[d],k[d]));if(w)for(d=0;d<w.length;d++)T(w[d],w[++d],w[++d])}function Z(e,t,i){for(var n,s=e.__k,r=0;s&&r<s.length;r++)(n=s[r])&&(n.__=e,t="function"==typeof n.type?Z(n,t,i):C(i,n,n,s,n.__e,t));return t}function C(e,t,i,n,s,r){var o,a,c;if(void 0!==t.__d)o=t.__d,t.__d=void 0;else if(null==i||s!=r||null==s.parentNode)e:if(null==r||r.parentNode!==e)e.appendChild(s),o=null;else{for(a=r,c=0;(a=a.nextSibling)&&c<n.length;c+=2)if(a==s)break e;e.insertBefore(s,r),o=r}return void 0!==o?o:s.nextSibling}function z(e,t,i){"-"===t[0]?e.setProperty(t,i):e[t]=null==i?"":"number"!=typeof i||h.test(t)?i:i+"px"}function A(e,t,i,n,s){var r;e:if("style"===t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof n&&(e.style.cssText=n=""),n)for(t in n)i&&t in i||z(e.style,t,"");if(i)for(t in i)n&&i[t]===n[t]||z(e.style,t,i[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?n||e.addEventListener(t,r?O:S,r):e.removeEventListener(t,r?O:S,r);else if("dangerouslySetInnerHTML"!==t){if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==i?"":i;break e}catch(e){}"function"==typeof i||(null!=i&&(!1!==i||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,i):e.removeAttribute(t))}}function S(e){this.l[e.type+!1](s.event?s.event(e):e)}function O(e){this.l[e.type+!0](s.event?s.event(e):e)}function M(e,t,i,n,r,o,a,c,u){var l,h,p,f,g,m,y,b,w,k,Z,C=t.type;if(void 0!==t.constructor)return null;null!=i.__h&&(u=i.__h,c=t.__e=i.__e,t.__h=null,o=[c]),(l=s.__b)&&l(t);try{e:if("function"==typeof C){if(b=t.props,w=(l=C.contextType)&&n[l.__c],k=l?w?w.props.value:l.__:n,i.__c?y=(h=t.__c=i.__c).__=h.__E:("prototype"in C&&C.prototype.render?t.__c=h=new C(b,k):(t.__c=h=new v(b,k),h.constructor=C,h.render=E),w&&w.sub(h),h.props=b,h.state||(h.state={}),h.context=k,h.__n=n,p=h.__d=!0,h.__h=[]),null==h.__s&&(h.__s=h.state),null!=C.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=d({},h.__s)),d(h.__s,C.getDerivedStateFromProps(b,h.__s))),f=h.props,g=h.state,p)null==C.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(null==C.getDerivedStateFromProps&&b!==f&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,k),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,k)||t.__v===i.__v){h.props=b,h.state=h.__s,t.__v!==i.__v&&(h.__d=!1),h.__v=t,t.__e=i.__e,t.__k=i.__k,t.__k.forEach((function(e){e&&(e.__=t)})),h.__h.length&&a.push(h);break e}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,k),null!=h.componentDidUpdate&&h.__h.push((function(){h.componentDidUpdate(f,g,m)}))}h.context=k,h.props=b,h.state=h.__s,(l=s.__r)&&l(t),h.__d=!1,h.__v=t,h.__P=e,l=h.render(h.props,h.state,h.context),h.state=h.__s,null!=h.getChildContext&&(n=d(d({},n),h.getChildContext())),p||null==h.getSnapshotBeforeUpdate||(m=h.getSnapshotBeforeUpdate(f,g)),Z=null!=l&&l.type===_&&null==l.key?l.props.children:l,x(e,Array.isArray(Z)?Z:[Z],t,i,n,r,o,a,c,u),h.base=t.__e,t.__h=null,h.__h.length&&a.push(h),y&&(h.__E=h.__=null),h.__e=!1}else null==o&&t.__v===i.__v?(t.__k=i.__k,t.__e=i.__e):t.__e=j(i.__e,t,i,n,r,o,a,u);(l=s.diffed)&&l(t)}catch(e){t.__v=null,(u||null!=o)&&(t.__e=c,t.__h=!!u,o[o.indexOf(c)]=null),s.__e(e,t,i)}}function P(e,t){s.__c&&s.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){s.__e(e,t.__v)}}))}function j(e,t,i,s,r,o,a,c){var l,h,d,f=i.props,g=t.props,m=t.type,_=0;if("svg"===m&&(r=!0),null!=o)for(;_<o.length;_++)if((l=o[_])&&"setAttribute"in l==!!m&&(m?l.localName===m:3===l.nodeType)){e=l,o[_]=null;break}if(null==e){if(null===m)return document.createTextNode(g);e=r?document.createElementNS("http://www.w3.org/2000/svg",m):document.createElement(m,g.is&&g),o=null,c=!1}if(null===m)f===g||c&&e.data===g||(e.data=g);else{if(o=o&&n.call(e.childNodes),h=(f=i.props||u).dangerouslySetInnerHTML,d=g.dangerouslySetInnerHTML,!c){if(null!=o)for(f={},_=0;_<e.attributes.length;_++)f[e.attributes[_].name]=e.attributes[_].value;(d||h)&&(d&&(h&&d.__html==h.__html||d.__html===e.innerHTML)||(e.innerHTML=d&&d.__html||""))}if(function(e,t,i,n,s){var r;for(r in i)"children"===r||"key"===r||r in t||A(e,r,null,i[r],n);for(r in t)s&&"function"!=typeof t[r]||"children"===r||"key"===r||"value"===r||"checked"===r||i[r]===t[r]||A(e,r,t[r],i[r],n)}(e,g,f,r,c),d)t.__k=[];else if(_=t.props.children,x(e,Array.isArray(_)?_:[_],t,i,s,r&&"foreignObject"!==m,o,a,o?o[0]:i.__k&&y(i,0),c),null!=o)for(_=o.length;_--;)null!=o[_]&&p(o[_]);c||("value"in g&&void 0!==(_=g.value)&&(_!==e.value||"progress"===m&&!_||"option"===m&&_!==f.value)&&A(e,"value",_,f.value,!1),"checked"in g&&void 0!==(_=g.checked)&&_!==e.checked&&A(e,"checked",_,f.checked,!1))}return e}function T(e,t,i){try{"function"==typeof e?e(t):e.current=t}catch(e){s.__e(e,i)}}function L(e,t,i){var n,r;if(s.unmount&&s.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||T(n,null,t)),null!=(n=e.__c)){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(e){s.__e(e,t)}n.base=n.__P=null}if(n=e.__k)for(r=0;r<n.length;r++)n[r]&&L(n[r],t,"function"!=typeof e.type);i||null==e.__e||p(e.__e),e.__e=e.__d=void 0}function E(e,t,i){return this.constructor(e,i)}function U(e,t,i){var r,o,a;s.__&&s.__(e,t),o=(r="function"==typeof i)?null:i&&i.__k||t.__k,a=[],M(t,e=(!r&&i||t).__k=f(_,null,[e]),o||u,u,void 0!==t.ownerSVGElement,!r&&i?[i]:o?null:t.firstChild?n.call(t.childNodes):null,a,!r&&i?i:o?o.__e:t.firstChild,r),P(a,e)}n=l.slice,s={__e:function(e,t,i,n){for(var s,r,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((r=s.constructor)&&null!=r.getDerivedStateFromError&&(s.setState(r.getDerivedStateFromError(e)),o=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,n||{}),o=s.__d),o)return s.__E=s}catch(t){e=t}throw e}},r=0,v.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=d({},this.state),"function"==typeof e&&(e=e(d({},i),this.props)),e&&d(i,e),null!=e&&this.__v&&(t&&this.__h.push(t),w(this))},v.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),w(this))},v.prototype.render=_,o=[],a="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,k.__r=0}},n={};function s(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={id:e,exports:{}};return i[e].call(r.exports,r,r.exports,s),r.exports}s.m=i,s.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return s.d(t,{a:t}),t},s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.f={},s.e=e=>Promise.all(Object.keys(s.f).reduce(((t,i)=>(s.f[i](e,t),t)),[])),s.u=e=>"180b74d2f80."+e+".js",s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="@subiz/widget-v4:",s.l=(i,n,r,o)=>{if(e[i])e[i].push(n);else{var a,c;if(void 0!==r)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var h=u[l];if(h.getAttribute("src")==i||h.getAttribute("data-webpack")==t+r){a=h;break}}a||(c=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,s.nc&&a.setAttribute("nonce",s.nc),a.setAttribute("data-webpack",t+r),a.src=i),e[i]=[n];var d=(t,n)=>{a.onerror=a.onload=null,clearTimeout(p);var s=e[i];if(delete e[i],a.parentNode&&a.parentNode.removeChild(a),s&&s.forEach((e=>e(n))),t)return t(n)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),c&&document.head.appendChild(a)}},s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.p="https://vcdn.subiz-cdn.com/widget-v4/public/",(()=>{var e={143:0};s.f.j=(t,i)=>{var n=s.o(e,t)?e[t]:void 0;if(0!==n)if(n)i.push(n[2]);else{var r=new Promise(((i,s)=>n=e[t]=[i,s]));i.push(n[2]=r);var o=s.p+s.u(t),a=new Error;s.l(o,(i=>{if(s.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=i&&("load"===i.type?"missing":i.type),o=i&&i.target&&i.target.src;a.message="Loading chunk "+t+" failed.\n("+r+": "+o+")",a.name="ChunkLoadError",a.type=r,a.request=o,n[1](a)}}),"chunk-"+t,t)}};var t=(t,i)=>{var n,r,[o,a,c]=i,u=0;if(o.some((t=>0!==e[t]))){for(n in a)s.o(a,n)&&(s.m[n]=a[n]);c&&c(s)}for(t&&t(i);u<o.length;u++)r=o[u],s.o(e,r)&&e[r]&&e[r][0](),e[r]=0},i=self.webpackChunk_subiz_widget_v4=self.webpackChunk_subiz_widget_v4||[];i.forEach(t.bind(null,0)),i.push=t.bind(null,i.push.bind(i))})(),(()=>{"use strict";var e=s(819),t=s(1606).Z,i=s(4878).Z,n=s(9489).Z;const r={kv:t,lsdb:s(6929).Z,chain:i,inmem_localstorage:n};function o(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const a=s(7460);a.env.XMLHttpRequest=window.XMLHttpRequest;const c=e=>e.answer;function u(t,i){let n=t.request;"text/plain"===n.content_type&&void 0!==n.body&&(n.body=e.Z.stringify(n.body)),i(!0)}function l(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}const h=s(7460);function d(t,i){let n=t.request;"text/plain"===n.content_type&&void 0!==n.body&&(n.body=e.Z.stringify(n.body)),i(!0)}h.env.XMLHttpRequest=window.XMLHttpRequest;const p=Promise.resolve({code:200});function f(e,t,i,n){let s=e+".subizv4.subikon";return{id:t,account_id:e,created:1610452894916,members:[{type:"user",id:i,membership:"active",invited_by:{id:i,type:"user"}},{type:"agent",id:n,conversation_id:t,membership:"active",invited_by:{id:i,type:"user"}}],ended:1610454875505,state:"ended",integration:{account_id:e,connector_id:"subikon",name:"Subiz Widget",connector_type:"subiz",state:"activated",id:s},actived:1610453070259,last_event:{id:"evqyiykaoizbwnkaecwphttwk",account_id:e,created:1616213311830,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"ok cám ơn!",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213312110}]}}},last_message_sent:{id:"evqyiykaoizbwnkaecwphttwk",account_id:e,created:1616213311830,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"ok cám ơn!",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213312110}]}}},assigned_to:{},first_message:"Xin chào",subject:"Chúc một ngày tốt lành",source:"https://subiz.com.vn/"}}function g(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var m=s(3165),_=s(8454),v=s(9554);v.defaults.path="/",v.expiresMultiplier=86400,v.defaults.expires=3650;const y=e.Z.Date.now();class b{constructor(t,i,n,s,m,_){g(this,"inmem",!1),g(this,"cookie",v),g(this,"new_visitor",!0),g(this,"matchUser",(()=>(this._touchAcc(),this.kv.match("user")))),g(this,"suggest_addresses",(e=>this.api.suggest_address(e))),g(this,"matchSession",(()=>this.kv.match("session")||{})),g(this,"matchAccount",(()=>this.cache.match("account"))),g(this,"matchPaymentMethods",(()=>this.cache.match("payment_methods"))),g(this,"matchUnread",(()=>{let t=this.matchUser(),i=this.matchConvo("*"),n=0;return e.Z.map(i,(i=>{e.Z.isConvoSeen(i,t.id)||n++})),n})),g(this,"matchPlugin",(()=>e.Z.size(this.forcePlugins)>0?e.Z.cloneDeep(this.forcePlugins):e.Z.cloneDeep(this.cache.match("plugin"))||{})),g(this,"device",{}),g(this,"browserVisibility","visible"),g(this,"matchAgent",(e=>{let t=this.cache.match("agent")||{};return"*"===e?t:t[e]})),g(this,"matchConvo",(t=>{if(t)return"*"===t?(this._touchAcc(),e.Z.filter(this.cache.all(),((e,t)=>t.startsWith("convo_")))):(this.isInsync(t)||this.fetchConvo(t),this.cache.match("convo_"+t))})),g(this,"fetchConvo",(async e=>{if(await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0),this.isInsync(e))return this.reconnectGate.open();this.markSync(e);let{body:t,error:i}=await this.api.getConversation(e);return t&&!i&&this._setConvo(t),this.reconnectGate.open()})),g(this,"list_provinces",(()=>this.api.list_provinces())),g(this,"list_districts",(e=>this.api.list_districts(e))),g(this,"list_wards",(e=>this.api.list_wards(e))),g(this,"list_provices",void 0),g(this,"listEvents",(e=>{if(e&&"*"!==e&&"string"==typeof e)return this.isInsync("events"+e)||setTimeout((async()=>(await this.readyGate.entry(),await this.reconnectGate.entry(void 0,!0),this.isInsync("events"+e)||(this.markSync("events"+e),await this.chain.reload(e,((e,t,i)=>this.listmessageapi(e,t,i))),this.pubsub.publish("account")),this.reconnectGate.open())),10),this.chain.listM(e)})),g(this,"fetchMoreEvents",(async e=>{let{error:t}=await this.chain.fetchMore(e,50,((e,t,i)=>this.listmessageapi(e,t,i)));return this.pubsub.publish("account"),{error:t}})),g(this,"matchBot",(()=>this.cache.match("bot")||{})),g(this,"readyGate",new e.Z.Gate),g(this,"convoGate",new e.Z.Gate(!0)),g(this,"reconnectGate",new e.Z.Gate(!0)),g(this,"matchLastview",(()=>this.kv.match("lastview")||{})),g(this,"matchIsOpen",(()=>!!this.kv.match("isopen"))),g(this,"matchHasManuallyClosed",(()=>!!this.kv.match("hasManuallyClosed"))),g(this,"matchClosePreviewAt",(()=>this.kv.match("close_preview_at")||0)),g(this,"sendPresence",e.Z.throttle((async()=>{if(await this.readyGate.entry(),e.Z.get(this.kv.match("user"),"id")&&!e.Z.isUserBanned(this.kv.match("user")))return this.api.sendPresence(this.device,"visible"===this.browserVisibility&&document.hasFocus())}),1e3)),g(this,"now",(()=>e.Z.Date.now()+this.timeDiff)),g(this,"seenQueue",[]),g(this,"_typing",e.Z.throttle((e=>this.api.sendTyping(e)),3e3,{trailing:!1})),g(this,"onConvoEvent",((e,t)=>this.pubsub.on2(e,"events",t))),g(this,"seenConvo",(e=>{e&&"create"!==e&&this.seenQueue.push(e)})),g(this,"onUpdate",((e,t)=>this.pubsub.on2(e,"account",t))),g(this,"onResetCSS",((e,t)=>this.pubsub.on2(e,"resetCSS",t))),g(this,"onHighlight",((e,t)=>this.pubsub.on2(e,"highlight",t))),g(this,"setHasManuallyClosed",(()=>this.kv.put("hasManuallyClosed",!0))),g(this,"setIsOpen",(e=>{let t=this.kv.match("isopen");this.kv.put("isopen",e),!t&&e&&x("SUBIZ Chat","Opened","Subiz Windows")})),g(this,"closePreview",(()=>this.kv.put("close_preview_at",(new e.Z.Date).getTime()))),g(this,"setLastview",((e,t)=>this.kv.put("lastview",{view:e,opts:t}))),g(this,"timeDiff",0),this.agent_token=_,this.g_sync={},this.forceDevice=null,this.forcePlugins={},this.forceAcc={},this.forceChatbox={},this.RealtimeURL=n,this.fake=m,this.FileURL=i,this.fake?this.api=new class{constructor(t,i){l(this,"listConversations",(e=>{let t=f(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid);return Promise.resolve({body:{anchor:"",conversations:[t]},code:200})})),l(this,"listMessages",((e,t,i)=>{let n=function(e,t,i,n){let s=e+".subizv4.subikon";return[{id:"evqyiyjmxrjsylftvnrghrfmq",account_id:e,created:1616213202264,type:"conversation_invited",by:{id:i,type:"user"},data:{conversation:{id:t,account_id:e,members:[{type:"user",id:i,last_page_view_url:"https://subiz.com.vn/",membership:"observer",invited_by:{id:i,type:"user"}}],state:"pending"}}},{id:"evqyiyjmyqdgrouswczzawuzp",account_id:e,created:1616213202559,type:"conversation_invited",by:{id:i,type:"user"},data:{conversation:{id:t,account_id:e,members:[{type:"agent",id:n,conversation_id:t,membership:"observer",invited_by:{id:i,type:"user"}}],state:"pending",source:"https://subiz.com.vn/vi/"}}},{id:"evqyiyjmyzjpyehnngvmcyauf",account_id:e,created:1616213202668,type:"conversation_state_updated",by:{id:i,type:"user"},data:{conversation:{id:t,account_id:e,state:"active"}}},{id:"evqyiyjmzaozvqgbkljbwywdl",account_id:e,created:1616213202683,type:"conversation_joined",by:{id:i,type:"user"},data:{conversation:{id:t,members:[{type:"user",id:i,last_page_view_url:"https://subiz.com.vn/",membership:"active",invited_by:{id:i,type:"user"}}]}}},{id:"evqyiyjmzatvtgpdmmpzwnwgn",account_id:e,created:1616213202685,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"Xin chào",format:"plaintext",fields:[{key:"idempotency",value:'"wrueysyjbhqrkiwhsejpqrwqrdkkyaibajdw"'}],integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213203068}]}}},{id:"evqyiyjrhsfyuxtetszmvkkke",account_id:e,created:1616213237491,type:"conversation_joined",by:{id:i,type:"user"},data:{conversation:{id:t,members:[{type:"agent",id:n,conversation_id:t,membership:"active",invited_by:{id:i,type:"user"}}]}}},{id:"evqyiyjrhtroknjyakrlrwhgr",account_id:e,created:1616213237508,type:"message_sent",by:{id:n,client_id:"dashboard",type:"agent"},data:{message:{conversation_id:t,text:"chào bạn, mình có thể giúp gì được cho bạn :grinning:",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"receive",created:1616213237742},{member_id:i,type:"seen",created:1616213240057}]}}},{id:"evqyiyjuvjinmclneroerxmrl",account_id:e,created:1616213265805,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"mình muốn hỏi giá sản phẩm IPhone X",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213267090}]}}},{id:"evqyiyjzjxzfcsexshcjbbnnf",account_id:e,created:1616213302432,type:"message_sent",by:{id:n,client_id:"dashboard",type:"agent"},data:{message:{conversation_id:t,text:"IPhone X hiện đang được bán tại cửa hàng với giá 12tr đồng nha bạn",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"receive",created:1616213302698},{member_id:i,type:"seen",created:1616213305071}]}}},{id:"evqyiykaoizbwnkaecwphttwk",account_id:e,created:1616213311830,type:"message_sent",by:{id:i,client_id:"clsubizapi",type:"user"},data:{message:{conversation_id:t,text:"ok cám ơn!",format:"plaintext",integration_id:s,pongs:[{member_id:i,type:"seen",created:1616213312110}]}}}]}(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid);return Promise.resolve({body:n,code:200})})),l(this,"ajax",h),l(this,"start",(e=>p)),l(this,"sendConvoEvent",((e,t)=>p)),l(this,"createPostback",((e,t)=>p)),l(this,"markAsReceived",((e,t)=>p)),l(this,"markAsSeen",((e,t)=>p)),l(this,"getConversation",(e=>Promise.resolve({body:f(this.accid,"csqwudlkftltnbebvq",this.uid,this.agentid),code:200}))),l(this,"getLocaleContent",(e=>this.apireq.get(`/accounts/${this.accid}/locales/${e}`))),l(this,"sendEvent",(e=>p)),l(this,"sendTyping",(e=>p)),l(this,"sendPresence",(e=>p)),l(this,"sendContent",(e=>p)),l(this,"uploadToS3",(async e=>p)),l(this,"getChallenge",(e=>p)),l(this,"createUser",(e=>Promise.resolve({account_id:e,id:"usqzgtgfake",mask:"fakemask"}))),l(this,"createAgentUser",(e=>Promise.resolve("fakemask"))),l(this,"time",(t=>Promise.resolve({code:200,body:(new e.Z.Date).toISOString()}))),l(this,"updateUser",(e=>p)),l(this,"getUser",(e=>Promise.resolve({code:200,body:{id:"-"}}))),l(this,"getAccountSetting",(()=>this.apireq.get(`/accounts/${this.accid}/settings`))),l(this,"getIsOnline",(()=>this.apireq.get(`/accounts/${this.accid}/is_online`))),l(this,"sendImpression",(e=>p)),l(this,"sendConversion",(e=>p)),this.FileURL=i,this.apireq=h.setBaseUrl(t).setContentType("text/plain").beforeHook(d).setParser("json")}setAgentId(e){this.agentid=e}setAuth(e){this.accid=e.accid,this.mask=e.mask,this.uid=e.uid}}(t,i):this.api=new class{constructor(t,i){o(this,"listConversations",(e=>this.apireq.addQuery("user_id",this.uid).addQuery("integration_id",`${this.accid}.subizv4.subikon`).get("/conversations"))),o(this,"listMessages",((e,t,i)=>this.apireq.addQuery("limit",t).addQuery("start_id",i).get(`/conversations/${e}/messages`))),o(this,"ajax",a),o(this,"start",(t=>{let i={starter_id:this.uid,starter_type:"user",integration_id:`${this.accid}.subizv4.subikon`};return e.Z.each(t,((e,t)=>{i[t]=e})),this.apireq.post("/conversations",i)})),o(this,"sendConvoEvent",((e,t)=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/events`,t))),o(this,"createPostback",((e,t)=>this.apireq.post(`/accounts/${this.accid}/conversations/${e}/postbacks`,t))),o(this,"markAsReceived",((e,t)=>this.apireq.post(`/conversations/${e}/messages/${t}/receive`))),o(this,"markAsSeen",((e,t)=>this.apireq.post(`/conversations/${e}/messages/${t}/seen`))),o(this,"getConversation",(e=>this.apireq.get(`/conversations/${e}`))),o(this,"getLocaleContent",(e=>this.apireq.get(`/accounts/${this.accid}/locales/${e}`))),o(this,"sendEvent",(e=>this.apireq.post(`/users/${this.uid}/events`,e))),o(this,"sendTyping",(e=>this.apireq.post(`/conversations/${e}/typing`))),o(this,"uploadToS3",(async e=>{let{body:t,error:i}=await this.apireq.post(`/accounts/${this.accid}/files`,{account_id:this.accid,description:"upload\n user-client: web-widget",name:e.name.replace(/\s+/g,"_"),size:e.size,type:e.type});if(i)return{error:i};let n,s=e.type||"application/octet-stream";return({error:i}=await a.setContentType(s).put(t.signed_url,e)),i?{error:i}:(({body:n,error:i}=await this.apireq.post(`/accounts/${this.accid}/files/${t.id}`,{account_id:this.accid})),i?{error:i}:{url:this.FileURL+n.url})})),o(this,"getChallenge",(e=>this.apireq.post(`/accounts/${e}/scrypt-challenges`))),o(this,"time",(e=>this.apireq.get("/time"))),o(this,"updateUser",(e=>this.apireq.post(`/users/${this.uid}`,e))),o(this,"getUser",(e=>this.apireq.get(`/accounts/${this.accid}/users/${this.uid}`))),o(this,"getAccountSetting",(()=>this.apireq.get(`/accounts/${this.accid}/settings`))),o(this,"getIsOnline",(()=>this.apireq.get(`/accounts/${this.accid}/is_online`))),o(this,"sendImpression",(e=>this.apireq.post(`/accounts/${this.accid}/campaigns/${e.campaign_id}/impressions`,e))),o(this,"sendConversion",(e=>this.apireq.post(`/accounts/${this.accid}/campaigns/${e.campaign_id}/conversions`,e))),o(this,"lookupOrder",(e=>a.setBaseUrl(this.ApiURL).setContentType("text/plain").beforeHook(u).setParser("json").addQuery("x-signed-key",e).get("/orders/123"))),o(this,"getOrder",(e=>this.apireq.get(`/accounts/${this.accid}/orders/`+e))),o(this,"updateOrder",(e=>this.apireq.post(`/accounts/${this.accid}/orders/`+e.id,e))),o(this,"fetchShippingAddresses",(()=>this.apireq.get(`/accounts/${this.accid}/users/${this.uid}/shipping-addresses`))),o(this,"createShippingAddress",(e=>this.apireq.post(`/accounts/${this.accid}/users/${this.uid}/shipping-addresses`,e))),o(this,"list_provinces",(()=>this.apireq.get(`/accounts/${this.accid}/provinces`))),o(this,"list_districts",(e=>this.apireq.setQuery(e).get(`/accounts/${this.accid}/districts`))),o(this,"list_wards",(e=>this.apireq.setQuery(e).get(`/accounts/${this.accid}/wards`))),o(this,"suggest_address",(e=>this.apireq.setQuery({keyword:e}).get(`/accounts/${this.accid}/addresses`))),this.FileURL=i,this.ApiURL=t,this.apireq=a.setBaseUrl(t).withCredentials(!0).addQuery("v","6").setContentType("text/plain").beforeHook(u).setParser("json").beforeHook(((e,t)=>(this.mask&&(e.request=e.request.addQuery("x-user-mask",this.mask)),t(!0))))}setAgentId(e){this.agentid=e}setAuth(e){this.accid=e.accid,this.mask=e.mask,this.uid=e.uid}sendPresence(t,i){return this.sendEvent({by:{id:this.uid,device:t},type:"presence_updated",data:{presence:{pinged:e.Z.Date.now(),is_focused:i}}})}sendContent(e,t,i){return this.sendEvent({by:{id:this.uid,device:e},type:"content_viewed",data:{product:{url:t,name:i,title:i}}})}async createAgentUser(t){for(var i=0;i<10;i++){let{body:i,error:n}=await a.setBaseUrl(this.ApiURL).setContentType("text/plain").beforeHook(u).setParser("json").addQuery("x-access-token",t).post("/agent-users");if(n){await e.Z.sleep(1e3);continue}let s=i&&i.id||"";return s?i.account_id+"@"+s:""}}async createUser(t){for(var i=0;i<10;i++){const{body:i}=await this.getChallenge(t),n=c(i),s={challenge_id:i.id,answer:""+n};let{body:r,error:o}=await this.apireq.post(`/accounts/${t}/scrypt-challenges/users`,s);if(!o)return r;await e.Z.sleep(1e3)}}}(t,i),s&&(this.inmem=s,this.cookie=k),this.pubsub=new e.Z.Pubsub,this.kv=new r.kv(new r.lsdb("sbz2020",this.inmem),"kv"),this.cache=new r.kv(new r.lsdb("sbz2020",!0),"kv"),this.chain=new r.chain(new r.lsdb("cbz2020",!0),"ch"),this.getLocaleContent=this.api.getLocaleContent,this.g_haveSentSeenM={},window.addEventListener("blur",(()=>this.sendPresence())),window.addEventListener("focus",(()=>this.sendPresence())),setInterval((()=>this.sendPresence()),3e4),function(e){var t="hidden";function i(i){var n="visible",s="hidden",r={focus:n,focusin:n,pageshow:n,blur:s,focusout:s,pagehide:s};(i=i||window.event).type in r?e(r[i.type]):e(this[t]?"hidden":"visible")}t in document?document.addEventListener("visibilitychange",i):(t="mozHidden")in document?document.addEventListener("mozvisibilitychange",i):(t="webkitHidden")in document?document.addEventListener("webkitvisibilitychange",i):(t="msHidden")in document?document.addEventListener("msvisibilitychange",i):"onfocusin"in document?document.onfocusin=document.onfocusout=i:window.onpageshow=window.onpagehide=window.onfocus=window.onblur=i,void 0!==document[t]&&i({type:document[t]?"blur":"focus"})}((e=>{this.browserVisibility=e,this.sendPresence()})),this.loopTime(),this.device=this.getDeviceInfo();const y=setInterval((()=>{let t=this.kv.match("user")||{};if(!t.id)return;var i=this.getDeviceInfo();if(!i.ga_tracking_ids||!i.ga_client_id)return;clearInterval(y),this.device=i;let n=i.ga_client_id;n!==e.Z.getUserAttr(t,"ga_client_id","text")&&this.setUser({attributes:[{type:"text",text:n,key:"ga_client_id"}]})}),2e3)}isInsync(t){return e.Z.Date.now()-(this.g_sync[t]||0)<3e5}async fetchShippingAddresses(){let e=await this.api.fetchShippingAddresses();if(e.error)return null;this.cache.put("shipping_address",e.body.shipping_addresses)}matchShippingAddresses(){return this.cache.match("shipping_address")}updateOrder(e){return this.api.updateOrder(e)}createShippingAddress(e){return this.api.createShippingAddress(e)}async overrideAcc(t){this.forceAcc=e.Z.cloneDeep(t),await this.readyGate.entry(),this.disconnect("account"),this.reconnect()}async overrideChatbox(e){this.forceChatbox=e,await this.readyGate.entry(),this.disconnect("account"),await this.reconnect(),setTimeout(this.pubsub.publish("resetCSS"),10)}getDeviceInfo(){let e={user_agent:window.navigator.userAgent,screen_resolution:window.screen.width+"x"+window.screen.height,source_referrer:document.referrer,platform:window.navigator.platform,referrer:document.URL,type:this.isMobile()?"mobile":"desktop",language:navigator.language},t=function(){if(!window.ga)return;if(!window.ga.getAll)return;var e=window.ga.getAll()||[];let t="";return e.forEach((function(e){t=e.get("clientId")})),t}();t&&(e.ga_client_id=t);let i=(n=[],window.ga&&window.ga.getAll?window.ga&&window.ga.getAll?((window.ga.getAll()||[]).forEach((function(e){var t=e.get("trackingId");t&&n.push(t)})),n):[]:n);var n;return i.length>0&&(e.ga_tracking_ids=i),e}highlight(e,t){this.pubsub.publish("highlight",e,t)}overrideDeviceType(e){this.forceDevice=e,this.pubsub.publish("account")}isMobile(){return"mobile"===this.forceDevice||Z}isTablet(){return"tablet"===this.forceDevice||z}isDesktop(){return"desktop"===this.forceDevice||!this.isMobile()&&!this.isTable()}disconnect(e){this.g_sync[e]=0}pageLoaded(){return y}overridePlugin(t){if(!Array.isArray(t))throw"plugins must be be an array";let i={};e.Z.map(t,(function(e){i[e.id]=e})),this.forcePlugins=i,this.pubsub.publish("account"),this.pubsub.publish("resetCSS")}markSync(t){this.g_sync[t]=e.Z.Date.now()}async _touchAcc(){this.isInsync("account")||(await this.readyGate.entry(),this.isInsync("account")||this.reconnect())}async init(e,t){if(this.readyGate.close(),e=(e||"").trim(),this.api.setAuth({accid:e}),this.g_sync={},!t)try{t=this.cookie.get("__sbmask","")}catch(e){}let i=this.kv.match("mask");!t&&i&&(t=i),t&&i&&t!==i&&this.clearBrowserData(),this.agent_token&&(t=await this.api.createAgentUser(this.agent_token));var n="";if(t){let i=t.split("@");i[0]!=e?(t="",this.clearBrowserData()):n=i[1]}if(t)this.new_visitor=!1;else{let i=await this.api.createUser(e);this.new_visitor=!0,t=i.mask,n=i.id}return this.cookie.set("__sbmask",t),this.kv.put("mask",t),this.realtime&&this.realtime.stop(),this.fake?this.realtime=new class{onEvent(){}onInterrupted(){}subscribe(){}stop(){}}:this.realtime=new _(this.RealtimeURL,{user_mask:t}),this.realtime.onEvent(this.onWs.bind(this)),this.realtime.onInterrupted((()=>this.reconnectWs(e,n))),this.api.setAuth({accid:e,uid:n,mask:t}),this.seenLoop(),await this.reconnect(),this.readyGate.open(),this.reconnectWs(e,n),t}seenLoop(){this.seenQueue=[],clearInterval(this._seenInterval),this._seenInterval=setInterval((()=>{this.seenQueue=[...new Set(this.seenQueue)];let t=this.kv.match("user")||{};e.Z.map(this.seenQueue,(i=>{var n=this.listEvents(i);if(!n)return;if(0===e.Z.size(n))return;var s=(n=e.Z.filter(n,(e=>"message_sent"===e.type)))[e.Z.size(n)-1];if(!s)return;if(this.g_haveSentSeenM[s.id])return;if(s.id===e.Z.getMsgField(s,"idempotency"))return;this.api.markAsSeen(i,s.id);let r=this.cache.match("convo_"+i)||{};e.Z.find(r.members,(e=>e.id===t.id)).seen_at=Date.now(),this._setConvo(r),this.g_haveSentSeenM[s.id]=!0})),this.seenQueue=[]}),1e3)}async reconnectWs(e,t){return await this.realtime.subscribe([`conversation_state_updated.account.${e}.user.${t}`,`conversation_joined.account.${e}.user.${t}`,`conversation_typing.account.${e}.user.${t}`,`message_sent.account.${e}.user.${t}`,`conversation_pending.account.${e}.user.${t}`,`user_info_updated.account.${e}.user.${t}`,`message_pong.account.${e}.user.${t}`,`conversation_rating_requested.account.${e}.user.${t}`,`conversation_rated.account.${e}.user.${t}`]),await this.readyGate.entry(),this.disconnect("account"),this.reconnect()}async reconnect(){if(this._die)return;if(await this.reconnectGate.entry(void 0,!0),this.isInsync("account"))return this.reconnectGate.open();this.markSync("account");let t=await Promise.all([this.api.getUser(),this.api.getAccountSetting(),this.api.getIsOnline()]),i=e.Z.find(t,(e=>e.error));if(i)return console.error(i);let n=Object.assign(t[1].body,t[2].body);n.user=t[0].body,await this._setSetting(n);let s=await this.api.listConversations();i=s.error;let r=s.body;if(!i){let t=e.Z.get(r,"conversations",[]);e.Z.map(this.cache.all(),((t,i)=>{i.startsWith("convo_")&&this.now()-e.Z.getMs(e.Z.get(t,"actived"))>12096e5&&this.cache.del(i)})),e.Z.map(t,(e=>this._setConvo(e)))}return this.reconnectGate.open()}async setUser(e){if(e)return await this.readyGate.entry(),this._setUser(e),this.api.updateUser(e)}_setUser(t){t=e.Z.cloneDeep(t);let i=this.kv.match("user")||{};var n=i.account_id||t.account_id,s=i.id||t.id;e.Z.each(t.attributes,(t=>{t&&(i.attributes=e.Z.filter(i.attributes,(e=>!!e&&e.key!==t.key)))})),i.attributes=i.attributes||[],i.attributes=i.attributes.concat(t.attributes),i.account_id=n,i.id=s,this.kv.put("user",i),this.pubsub.publish("account")}async setSetting(e){if(e)return await this.readyGate.entry(),this._setSetting(e)}async _setSetting(t){if((t=e.Z.cloneDeep(t)||{}).account=Object.assign({},t.account,this.forceAcc),t.account.logo_url||(t.account.logo_url="https://file-subiz.com/fiqpezhkmeyesdscyetk-default_logo.jpg"),t.user){t.user.account_id=t.account.id;let e=this.matchSession(),i=t.user.session;for(i?i.id===e.id&&(i._urls=e._urls):i=e,i._urls=i._urls||[],i._urls.push(location.href);i._urls.length>1e3;)i._urls.shift();this.kv.put("session",i),delete t.user.session,this._setUser(t.user)}t.account&&(t.account.is_online=t.is_online,t.account.is_in_business_hour=t.is_in_business_hour,this.cache.put("account",t.account),delete t.account);let i=e.Z.get(t,"bots",[]),n={};e.Z.map(i,(e=>{n[e.id]=e})),this.cache.put("bot",n);let s=e.Z.get(t,"plugins",[]),r={};e.Z.map(s,(t=>{"chatbox"===t.type&&(t=e.Z.merge(t,this.forceChatbox)),r[t.id]=t})),this.cache.put("plugin",r);var o=e.Z.get(t,"agents",[]);if(e.Z.size(o)>0){let t={};this.api.setAgentId(o[0].id),e.Z.map(o,(e=>{t[e.id]=e})),this.cache.put("agent",t)}let a=e.Z.get(t,"payment_methods",[]);this.cache.put("payment_methods",a),this.pubsub.publish("account")}async track(){this.kv.match("user"),await this.api.sendContent(this.device,location.href,document.title),this.sendPresence()}async onWs(t){if(!t||!t.type)return;if(t.created=e.Z.getMs(t.created),"user_info_updated"===t.type){let i=e.Z.cloneDeep(this.kv.match("user")),n=e.Z.get(t,"data.user.attributes")||[];return e.Z.map(n,(t=>e.Z.setUserAttr(i,t))),void this._setUser(i)}let i=this.kv.match("user")||{};const n=e.Z.getIntegrationId(i.account_id);let s,r=e.Z.convoOfEv(t);if(r&&(s=this.matchConvo(r),!s||!s.id)){let{body:e,error:t}=await this.api.getConversation(r);if(!e)return;s=e}if(!s)return;let o=e.Z.get(s,"integration.id","");if(o||(o=e.Z.get(t,"data.message.integration_id","")),o&&o===n){if(this.pubsub.publish("events",t),"conversation_joined"===t.type){let i=e.Z.get(t,"data.conversation.members",[]);if(e.Z.find(i,(e=>e.id===this.kv.match("user").id))){await this.chain.reload(r,((e,t,i)=>this.listmessageapi(e,t,i))),this.markSync("events"+r);let{body:e}=await this.api.getConversation(r);e&&(s=e,this._setConvo(s)),this.pubsub.publish("account")}}return"message_sent"===t.type&&e.Z.get(t,"by.id")!==i.id&&this.api.markAsReceived(r,t.id),e.Z.startsWith(t.type,"message_")||e.Z.startsWith(t.type,"conversation_")?(this.restConvoEvent(t),void("message_sent"===t.type&&e.Z.get(t,"by.id")!==i.id&&x("SUBIZ Chat","Received","User"))):void 0}}async restConvoEvent(t){let i=this.kv.match("user"),n=e.Z.convoOfEv(t),s=this.cache.match("convo_"+n)||{};if("conversation_state_updated"===t.type){if(!e.Z.get(s,"id")){let{body:e,error:t}=await this.api.getConversation(n);if(t)return}s=Object.assign(s,e.Z.get(t,"data.conversation"))}if("message_pong"===t.type){var r=e.Z.get(t,"data.message.id"),o=this.chain.match(n,r);if(!e.Z.get(o,"data.message"))return;var a=e.Z.get(o,"data.message.pongs",[]);a=a.concat(e.Z.get(t,"data.message.pongs",[])),o.data.message.pongs=a,e.Z.map(a,(t=>{t.member_id==i.id&&"seen"===t.type&&(e.Z.find(s.members,(e=>e.id===i.id)).seen_at=t.created)})),this.chain.put(n,o.id,e.Z.getMs(o.created),o)}if("message_sent"===t.type){let i=e.Z.getMsgField(t,"idempotency"),r=e.Z.find(this.listEvents(n),(e=>e.id===i));r&&(this.chain.del(n,r.id),t.created=r.created),s.last_message_sent=t}"message_pong"!==t.type&&"conversation_typing"!==t.type&&this.chain.put(n,t.id,e.Z.getMs(t.created),t),s.last_event=t,this._setConvo(s),this.pubsub.publish("account")}handleFormSubmit(t,i){if("message_sent"!==i.type)return;let n=[],s=e.Z.get(i,"data.message.attachments")||[];e.Z.each(s,(e=>{e&&"form_submit"===e.type&&n.push(e.form_submit)})),e.Z.each(n,(i=>{let n=e.Z.get(this.convoEventM,t+"."+i.form_message_id);if(!n)return;let s=e.Z.filter(e.Z.get(n,"data.message.attachments"),(e=>!!e&&("form"===e.type||"ask_info_form"===e.type)));e.Z.each(s,(t=>{t=t.form,e.Z.each(t.fields,(t=>{e.Z.each(i.fields,(e=>{t.name===e.name&&(t.default_answer||(t.default_answer=e.value))}))}))})),e.Z.size(s)>0&&this.pubsub.publish("state.convoEventM",this.convoEventM,t)}))}typing(e){e&&this._typing(e)}async startConvo(e){await this.readyGate.entry(),this.convoGate.close(),e.source||(e.source=document.location.href);let{body:t,error:i}=await this.api.start(e);return this.convoGate.open(),i?{error:i}:(this._setConvo(t),{convo:t})}fetchOrder(e){return this.api.getOrder(e)}lookupOrder(e){return this.api.lookupOrder(e)}createPostback(e,t){return this.api.createPostback(e,t)}async sendConvoEvent(t,i,n){await this.readyGate.entry();var s=e.Z.randomString(36),r={id:s,by:{id:(this.kv.match("user")||{}).id,type:"user",device:{referrer:document.URL}},data:n,type:i,created:this.now()};e.Z.convoToEv(t,r);let o=[];if("message_sent"===i&&(e.Z.setMsgField(r,"idempotency",s),r.data.message.conversation_id=t,await m.map(r.data.message.attachments,2,(async(e,t)=>{var i;"file"===e.type&&e._file&&(o.push(e),w.includes(e._file.type)&&(e.url=await(i=e._file,new Promise((e=>{var t=new window.FileReader;t.onload=t=>{e(t.target.result)},t.readAsDataURL(i)})))))}))),this.onWs(r),await this.convoGate.entry(),await m.map(o,1,(async e=>{const{url:t,error:i}=await this.api.uploadToS3(e._file);r._error=i,e.url=t})),r._error)return this.onWs(r);let{body:a,error:c}=await this.api.sendConvoEvent(t,r);return c?(r._error=c,void this.onWs(r)):(this.onWs(a),x("SUBIZ Chat","Sent","User"),this.kv.match("last_msg_sent")||(window.dataLayer||[]).push({event:"SUBIZ Chat",event_action:"Sent",event_label:"User",first_interaction:1}),this.kv.put("last_msg_sent",e.Z.Date.now()),a)}_setConvo(t){let i=this.kv.match("user");const n=e.Z.getIntegrationId(i.account_id);let s=e.Z.get(t,"integration.id","");if(!s||s!==n)return;let r={};if(e.Z.map(this.cache.all(),((e,t)=>{t.startsWith("convo_")&&(r[t]=e)})),e.Z.size(r)>18){r=e.Z.orderBy(e.Z.map(r),"created","desc");for(var o=18;o<e.Z.size(r);o++){let e=r[o];this.cache.del("convo_"+e.id)}}this.markSync(t.id),this.pubsub.publish("account"),this.cache.put("convo_"+t.id,t)}matchLastPluginRun(e){return(this.kv.match("plugin_run_logs")||{})[e]}matchLastBotRun(e){return(this.kv.match("bot_run_logs")||{})[e]}logBotRun(e){let t=this.matchSession(),i=this.kv.match("bot_run_logs")||{};i[e]={bot_id:e,created:this.now(),session_id:t.id},this.kv.put("bot_run_logs",i)}sendImpression(e){let t=this.kv.match("user")||{},i=this.kv.match("plugin_run_logs")||{},n=this.matchSession();return i[e]={web_plugin_id:e,created:this.now(),session_id:n.id},this.kv.put("plugin_run_logs",i),this.api.sendImpression({account_id:t.account_id,campaign_id:e,web_plugin_id:e,user_id:t.id,url:window.location.href,device:this.device,session_id:n.id})}sendConversion(t,i,n){let s=this.kv.match("user")||{},r={account_id:s.account_id,user_id:s.id,fields:i},o=this.kv.match("conversions")||{};return o[t]=!0,this.kv.put("conversions",o),this.api.sendConversion({account_id:s.account_id,web_plugin_id:t,campaign_id:t,user_id:e.Z.get(s,"id"),url:window.location.href,device:this.device,submission:r,impression_token:n,session_id:this.matchSession().id})}isConverted(e){return(this.kv.match("conversions")||{})[e]}async listmessageapi(t,i,n){let s=t,{body:r,code:o,error:a}=await this.api.listMessages(s,-n,i);if(a||200!==o)return[[],i,a];i=e.Z.get(e.Z.last(r),"id"),r=e.Z.map(r,(t=>(t.created=e.Z.getMs(t.created),{id:t.id,index:t.created,value:t})));let c=this.kv.match("user")||{};for(let t=0;t<r.length;t++){let i=r[t].value;if("message_sent"===i.type&&e.Z.get(i,"by.id")!==c.id){if(e.Z.find(e.Z.get(i,"data.message.pongs"),(e=>e.member_id===c.id)))break;this.api.markAsReceived(s,i.id);break}}return[r,i]}async loopTime(){let t=e.Z.Date.now();if(!e.Z.get(this.kv.match("user"),"id"))return setTimeout((()=>this.loopTime()),12e4);let{body:i,error:n}=await this.api.time();if(n)return setTimeout((()=>this.loopTime()),3e4);var s=Math.abs(e.Z.Date.now()-t)/2,r=new e.Z.Date(i).getTime()+s,o=e.Z.Date.now();this.timeDiff=Math.floor(r-o),setTimeout((()=>this.loopTime()),12e4)}replaceFileUrl(t){return t?e.Z.startsWith(t,"/")||e.Z.startsWith(t,"data:")?t:(e.Z.startsWith(t,"http://")||e.Z.startsWith(t,"https://")||e.Z.startsWith(t,"//")||(t=e.Z.trim(this.FileURL,"/")+"/"+e.Z.trimStart(t,"/")),t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("https://file-subiz.com/",this.FileURL)).replace("http://file-subiz.com/",this.FileURL)).replace("https://file-v4.subiz.com/",this.FileURL)).replace("http://file-v4.subiz.com/",this.FileURL)).replace("https://filev4.subiz.com/",this.FileURL)).replace("http://filev4.subiz.com/",this.FileURL)).replace("https://filev4-1.subiz.com/",this.FileURL)).replace("http://filev4-1.subiz.com/",this.FileURL)).replace("https://file.subiz.com/",this.FileURL)).replace("http://file.subiz.com/",this.FileURL)).replace("https://file.mysubiz.com/",this.FileURL)).replace("http://file.mysubiz.com/",this.FileURL)):""}clearBrowserData(){e.Z.each(this.cookie.all(),((e,t)=>{(t||"").startsWith("__sb")&&this.cookie.remove(t)})),this.kv.destroy(),this.kv=new r.kv(new r.lsdb("sbz2020",this.inmem),"kv"),this.chain.destroy(),this.chain=new r.chain(new r.lsdb("cbz2020",!0),"ch")}destroy(){this._die=!0,this.clearBrowserData(),this.realtime&&this.realtime.stop(),this.readyGate.close()}}const w=["image/gif","image/jpeg","image/png","image/svg+xml"],k={data:{},get(e,t){return this.data[e]||t},set(e,t){return this.data[e]=e},all(){return this.data},remove(e){delete this.data[e]}};function x(e,t,i){document.dispatchEvent(new CustomEvent("subiz",{detail:{category:e,action:t,label:i}})),function(e,t,i){console.log("SENT.",e,t,i),window.ga&&window.ga.getAll?(window.ga.getAll()||[]).forEach((function(n){const s=n.get("name");window.ga(s+".send","event",e,t,i)})):window.gtag&&window.gtag("event",e,{Action:t,Label:i})}(e,t,i),function(e,t,i){window.fbq&&window.fbq("trackCustom",e,{action:t,label:i})}(e,t,i),(window.dataLayer||[]).push({event:e,event_action:t,event_label:i})}let Z=(C=navigator.userAgent||navigator.vendor||window.opera,/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(C)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(C.substr(0,4)));var C;let z=/(ipad|tablet|(android(?!.*mobile))|(windows(?!.*phone)(.*touch))|kindle|playbook|silk|(puffin(?!.*(IP|AP|WP))))/.test(navigator.userAgent);var A=s(2493),S=s(6400);function O(t,i,n,r){if(!n)throw"$div must is a valid html node";var o=document.createElement("div");o.id=t.id,n.appendChild(o);let a=A.Kd(t,e.Z.detectLang());var c,u=new e.Z.Gate,l=0,h="hold",d=this;this.getState=()=>h;var p=async function(){if(k)return;if("hold"!==h)return;if("popup"===t.type&&i.isConverted(t.id))return;let n=i.matchLastPluginRun(t.id);"chatbox"!==t.type&&"notification"!==t.type||(n=void 0),e.Z.checkRunConditions(t.initiative_frequency,t.conditions,n,i)&&(h="running",await d.update(t))};this.forceRunPopup=async()=>{e.Z.get(f,"current")?f.current.openPopup():w()};var f=(0,S.Vf)();let g=null,m=null,_=null,v=null;var y=e=>r.showWidget(e),b=()=>{l++,w()},w=async()=>{k||o&&("chatbox"===t.type&&(g||(g=(await s.e(132).then(s.bind(s,8132))).default),(0,S.sY)((0,S.h)(g,{destroy:k,plugin:t,store:i,ref:f,t:this.t}),o)),"popup"===t.type&&(m||(m=(await s.e(213).then(s.bind(s,8213))).default),(0,S.sY)((0,S.h)(m,{destroy:k,t:this.t,highlight:c,mobile:i.isMobile(),plugin:t,store:i,ref:f,pageIndex:l,nextPage:b,showWidget:y}),o)),"notification"===t.type&&(v||(v=(await s.e(605).then(s.bind(s,9605))).default),(0,S.sY)((0,S.h)(v,{destroy:k,t:this.t,mobile:i.isMobile(),plugin:t,store:i,ref:f}),o)),"contact"===t.type&&(_||(_=(await s.e(335).then(s.bind(s,2335))).default),(0,S.sY)((0,S.h)(_,{destroy:k,t:this.t,plugin:t,store:i,ref:f}),o)),u.open())};this.call=(e,t)=>u.entry().then((()=>f.current[e](t)));var k=!1;this.destroy=()=>{k=!0,(0,S.sY)(null,o),o.parentNode.removeChild(o)},this.highlight=e=>{c=e,w()},this.update=e=>{k||(t=e,"hold"!==h&&"finished"!==h&&w())};let x=t=>{if("debug"===a)return`{{${t}}}`;let i=e.Z.get(A.Rs,a,[]),n=e.Z.find(i,(e=>e.key===t));return e.Z.get(n,"message",t)},Z=i.matchAccount();x.i18n=e=>{if(!e)return"";let i=t.locale||Z.locale||"vi-VN";return i=i.replace("-","_"),e[a.replace("-","_")]||e[i]},x.locale=()=>a,this.forceDownloadLanguage=async()=>{await A.WW(i,a,!0),this.update(t)},this.setLocale=async e=>a===e?e:(this.t=null,w(),a=A.Kd(t,e),await A.WW(i,a),this.t=x,w(),a);let C={};e.Z.map(e.Z.get(t,"popup.pages"),(t=>{t&&e.Z.map(t.components,(e=>{"image"===e.type&&e.image&&e.image.url&&e.image.url.startsWith("http")&&(C[e.image.url]=!0)}))})),e.Z.size(C)>=0&&e.Z.map(C,((t,i)=>e.Z.preloadImg(i)));let z=e.Z.get(t,"triggers")||[{type:"after_pageview",after_pageview_sec:0,disabled:!1}];for(var O=0;O<e.Z.size(z);O++){var M=z[O];M&&(M.disabled||("exit_intent"===M.type&&e.Z.trackExitIntent(p),"area_clicked"===M.type&&e.Z.trackAreaClicked(M.area_clicked_css_selector,p),"scrolling_percentage"===M.type&&e.Z.trackScrollingPercentage(M.scrolling_percentage,p),"inactivity_duration"===M.type&&e.Z.trackInactivity(M.inactivity_sec,p),"after_pageview"===M.type&&e.Z.trackTimeOnPage(M.after_pageview_sec,p)))}this.update(t),A.WW(i,a).then((()=>{this.t=x,this.update(t)}))}class M{constructor(t,i){this.refM={},this.lib=t,this.$div=i,this.pluginM={},this._destroy=!1,t.store.onHighlight({_isMounted:!0},((e,t)=>{let i=this.pluginM[e];i&&i.highlight(t)})),t.store.onUpdate({_isMounted:!0},(()=>{if(this._destroy)return;let n=this.lib.store.matchPlugin(),s=!1;e.Z.each(n,(e=>{if("chatbox"===e.type){if(s)return;s=!0}this.pluginM[e.id]?this.pluginM[e.id].update(e):this.pluginM[e.id]=new O(e,this.lib.store,i,t)})),e.Z.each(this.pluginM,((e,t)=>{n[t]||(this.pluginM[t].destroy(),delete this.pluginM[t])}))}));let n=this.lib.store.matchPlugin(),s=!1;e.Z.each(n,(e=>{if("chatbox"===e.type){if(s)return;s=!0}this.pluginM[e.id]||(this.pluginM[e.id]=new O(e,this.lib.store,i,t))}))}findChatbox(){var t=this.lib.store.matchPlugin();let i=e.Z.filter(this.pluginM,((e,i)=>"chatbox"===t[i].type));if(0===e.Z.size(i))return void console.error("no chatbox found.");let n=e.Z.find(i,(e=>"running"===e.getState()));if(n||(n=i[0]),n)return n;console.error("found no suitable chatbox to run.")}getCurrentView(){let e=this.findChatbox();if(e)return e.call("getCurrentView")}showCurrentChatbox(e){let t=this.findChatbox();t&&t.call("showWidget",e)}showCurrentGreeting(){let e=this.findChatbox();e&&e.call("showGreeting")}hideCurrentGreeting(){let e=this.findChatbox();e&&e.call("hideGreeting")}hideCurrentChatbox(){let e=this.findChatbox();e&&e.call("hideWidget")}forceUpdateLang(e){let t=this.pluginM[e];t&&t.forceDownloadLanguage()}forceRunPopup(e){let t=this.pluginM[e];t&&t.forceRunPopup(e)}setPluginLocale(e,t){let i=this.pluginM[e];if(i)return i.setLocale(t)}setCurrentChatboxLocale(e){let t=this.findChatbox();t&&t.setLocale(e)}destroy(){e.Z.map(this.pluginM,((e,t)=>{this.pluginM[t]||(this.pluginM[t].destroy(),delete this.pluginM[t])})),this._destroy=!0}}function P(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var j=document.createElement("link");j.href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500&display=swap",j.rel="stylesheet",document.head.append(j),e.Z.preloadWebfonts(["Roboto"],[400,500]);class T{constructor(t,i,n,s,r,o){P(this,"version",(()=>"4.5")),P(this,"setSetting",(e=>this.store.setSetting({account_setting:e}))),P(this,"getSetting",(t=>({account_setting:e.Z.cloneDeep(this.store.matchAccountSetting())}))),P(this,"getUser",(()=>e.Z.parseJSON(e.Z.stringify(this.store.matchUser())))),this.domGate=new e.Z.Gate,this.store=new b(t,i,n,s,r,o),window.sbz_store=this.store,this.subs=[],this.store.onConvoEvent({_isMounted:!0},(t=>e.Z.map(this.subs,(e=>e(t)))))}setLang(e){var t=new XMLHttpRequest;t.open("GET","https://api.sbz.vn/4.0/oldlang",!0),t.send()}toggleLangDebugMode(){var e=new XMLHttpRequest;e.open("GET","https://api.sbz.vn/4.0/oldlangdebug",!0),e.send()}async waitReady(e){await this.store.readyGate.entry(),e()}async setAccount(e,t,i,n){let s=await this.store.init(e,i);t||(t=document.body),this.pluginMgr=new M(this,t);let r=setInterval((()=>{t&&t.isConnected||(this.pluginMgr.destroy(),clearInterval(r))}),1e3);return this.domGate.open(),n&&n(s),s}_setAccount(e,t){return this.setAccount(e,t)}async updateUserAttributes(t){await this.store.setUser({attributes:t});var i=this.store.matchUser();return e.Z.cloneDeep(i.attributes)}async getUserAttributes(){await this.store.readyGate.entry();var t=this.store.matchUser();return e.Z.cloneDeep(e.Z.get(t,"attributes",[]))}async getWidgetCurrentView(){return await this.domGate.entry(),this.pluginMgr.getCurrentView()}expandWidget(e,t){return this.showWidget(e,t)}shrinkWidget(){return this.hideWidget()}async sendMessage(e,t){if(!e){const{convo:i,error:n}=await this.store.startConvo({message:t.text,initial_by:this.store.matchUser().id});if(n)return{error:n};e=i.id}return this.store.sendConvoEvent(e,"message_sent",{message:t})}startConvo(e){return this.store.startConvo(e)}async showGreeting(){await this.domGate.entry(),this.pluginMgr.showCurrentGreeting()}async hideGreeting(){await this.domGate.entry(),this.pluginMgr.hideCurrentGreeting()}async showWidget(e,t){await this.domGate.entry(),this.pluginMgr.showCurrentChatbox({view:e,cid:t})}async hideWidget(){await this.domGate.entry(),this.pluginMgr.hideCurrentChatbox()}async setLocale(e){return await this.domGate.entry(),this.pluginMgr.setCurrentChatboxLocale(e)}async setPluginLocale(e,t){return await this.domGate.entry(),this.pluginMgr.setPluginLocale(e,t)}_overrideDeviceType(e){this.store.overrideDeviceType(e)}_overridePlugin(e){this.store.overridePlugin(e)}_forceUpdateLang(e){this.pluginMgr.forceUpdateLang(e)}_highlight(e,t){this.store.highlight(e,t)}openPopup(e){this.pluginMgr.forceRunPopup(e)}unEvent(t){this.subs=e.Z.filter(this.subs,(e=>e!==t))}async countUnreadMessages(){return await this.domGate.entry(),this.store.matchUnread()}onEvent(t){this.subs=e.Z.filter(this.subs,(e=>e!==t)),this.subs.push(t)}overrideAccount(e){this.store.overrideAcc(e)}async overrideChatbox(t){await this.store.overrideChatbox(t),e.Z.get(t,"chatbox.greeting.greeting")&&this.pluginMgr.showCurrentGreeting()}}window.__sbz_WIDGET=T;const L=T;if(window._subiz_init_2094850928430&&!window._subiz_init_2094850928430_keep_loading)throw new Error("subiz have already initialized");window._subiz_init_2094850928430=!0,window._subiz_init_2094850928430_keep_loading=!1,s(7460);var E=s(4636),U=window._sbzaccid?"4.3":function(){if(window.sbz_v4)return!0;var e=document.getElementsByTagName("script");if("function"!=typeof window.subiz)return!1;for(var t of e)if(t&&t.src){if(-1!==t.src.indexOf(E.BaseURL))return!0;if(-1!==t.src.indexOf("https://widgetv4.subiz.com"))return!0;if(-1!==t.src.indexOf("https://widget.mysubiz.com"))return!0;if(-1!==t.src.indexOf("https://storage.googleapis.com/sbz"))return!0}return!1}()?"4.2":window.subiz_account_id&&window.subiz_account_id>0?"1":function(){var e=document.getElementsByTagName("script");if(!(window._sbzq instanceof Array))return!1;for(var t of e)if(t&&t.src){if(-1!==t.src.indexOf(E.BaseURL))return!0;if(-1!==t.src.indexOf("https://widgetv4.subiz.com"))return!0}return!1}()?"4.1":function(){if(!window._sbzq)return!1;var e=document.getElementsByTagName("script");for(var t of e)if(t&&t.src&&-1!==t.src.indexOf("static.subiz.com"))return!0;return!1}()?"2":void 0;if(!U)throw new Error("subiz cannot detect version");var q=new L(E.ApiURL,E.FileURL,E.RealtimeURL);function I(e){e=e||[];var t=[];if(Array.isArray(e))t=e;else{if("object"!=typeof e)return;for(var i=Object.keys(e),n=0;n<i.length;n++)t.push(e[i[n]])}if(!((e=t).length<1)){var s=e.shift();if("function"==typeof q[s])return q[s](...e)}}window.addEventListener("keydown",(function(e){"Escape"===e.key&&q.hideWidget()}));let R=window.document.title;!function e(t){let i;if(q.store&&q.store.matchUser()&&(i=q.store.matchUser().account_id),"acqnarufdnsdtthffcnh"==i)return;if("visible"===q.store.browserVisibility)return"dirty invisible"===t&&R===window.document.title&&(window.document.title=window.document.title.substr(4)),setTimeout(e,1e3,"visible");let n=q.store.matchUnread();return n?"dirty invisible"===t?(R===window.document.title&&(window.document.title=window.document.title.substr(4)),setTimeout(e,1e3,"dirty invisible blink")):(n>9&&(n="*"),window.document.title="("+n+") "+window.document.title,R=window.document.title,setTimeout(e,2e3,"dirty invisible")):("dirty invisible"===t&&R===window.document.title&&(window.document.title=window.document.title.substr(4)),setTimeout(e,1e3,"clean invisible"))}(),function(){if("1"!==U&&"2"!==U){if("1"===U&&q._setAccount(window.subiz_account_id),"2"===U||"4.1"===U){let e=window._sbzq||[];Array.isArray(e)||(e=[]),window._sbzq={push:I},e.forEach(I)}if("4.2"===U||"4.3"===U){let e=window.subiz&&window.subiz.q||[];window.subiz=function(){return I(arguments)},e.forEach(I)}q.store.readyGate.entry().then((function(){q.store.track(),function(t){let i=t.matchBot();0!==Object.keys(i).length&&e.Z.each(i,(i=>{let n=async()=>{if(n=()=>!0,!e.Z.checkRunConditions(i.initiative_frequency,i.conditions,t.matchLastBotRun(i.id),t))return;let{error:s}=await t.startConvo({initial_by:i.id,locale:A.Kd(i,e.Z.detectLang()),state:"active",members:[{type:"bot",id:i.id}]});if(s)return console.error(s);t.logBotRun(i.id)},s=e.Z.get(i,"triggers")||[];for(let t of s){if(!t)continue;if(t.disabled)continue;let i=n;"area_clicked"===t.type&&e.Z.trackAreaClicked(t.area_clicked_css_selector,i),"scrolling_percentage"===t.type&&e.Z.trackScrollingPercentage(t.scrolling_percentage,i),"inactivity_duration"===t.type&&e.Z.trackInactivity(t.inactivity_sec,i),"after_pageview"===t.type&&e.Z.trackTimeOnPage(t.after_pageview_sec,i)}}))}(q.store)}))}else console.error("DETECTED SUBIZ OUTDATED V3 EMBEDED CODE",v3accid,". Please visit https://subiz.com.vn for support")}()})()})();
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
window.subiz.q = []
|
|
20
20
|
// set account it in the very first call
|
|
21
21
|
window.subiz('setAccount', accid)
|
|
22
|
-
window.subiz('expandWidget')</script><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/
|
|
22
|
+
window.subiz('expandWidget')</script><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/180b74d2f80.app.js"></script></body></html>
|
|
@@ -19,4 +19,4 @@
|
|
|
19
19
|
window.subiz.q = []
|
|
20
20
|
// set account it in the very first call
|
|
21
21
|
window.subiz('setAccount', accid)
|
|
22
|
-
window.subiz('expandWidget')</script><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/
|
|
22
|
+
window.subiz('expandWidget')</script><script defer="defer" src="https://vcdn.subiz-cdn.com/widget-v4/public/180b74d2f80.library.js"></script></body></html>
|