import{k as e}from"./4.C_rgEAoe.chunk.js";import{g as t,z as n,w as r,u as a,q as i,n as o,k as s,r as u,c as l,A as c,e as d,p,f as h,B as f,v as g,C as m,t as _,D as b,E as v,s as D,F as y,l as w,i as C,G as E,a as k,_ as A,H as F,I as x,j as I,b as S,J as T,h as B}from"./5.D_uKc_ak.chunk.js";import{a as z,g as M,c as P,b as O,h as j,d as R,t as $}from"./6.D_CKFAbE.chunk.js";var q="__test_storage_support__",U=function(e){void 0===e&&(e="local");try{var t="session"===e?window.sessionStorage:window.localStorage;return t.setItem(q,"@@test"),"@@test"!==t.getItem(q)?!1:(t.removeItem(q),!0)}catch(n){return!1}},L=function(){var e=Object.create(null);return{getItem:function(t){var n=e[t];return"string"==typeof n?n:null},setItem:function(t,n){e[t]=n},removeItem:function(t){delete e[t]},clear:function(){e=Object.create(null)}}}();const N=t(e=>(t,n)=>{if(0!==t)return;if("function"!=typeof e)return n(0,()=>{}),void n(2);let r,a=!1;n(0,e=>{a||(a=2===e,a&&"function"==typeof r&&r())}),a||(r=e(e=>{a||n(1,e)},e=>{a||void 0===e||(a=!0,n(2,e))},()=>{a||(a=!0,n(2))}))});var V,H=function(e,t){return e===t};function Z(e){return void 0===e&&(e=H),function(t){return function(n,r){if(0===n){var a,i,o=!1;t(0,(function(t,n){0===t&&(i=n),1===t?o&&e(a,n)?i(1):(o=!0,a=n,r(1,n)):r(t,n)}))}}}}function G(e){return function(t){return function(n,r){if(0===n){var a,i=null,o=function(e,t){if(0!==e)return 1===e?(r(1,t),void i(1)):void(2===e&&(i=null));(i=t)(1)},s=function(e,t){2===e&&null!==i&&i(2,t),a(e,t)};t(0,(function(t,n){if(0===t)return a=n,void r(0,s);if(1!==t){if(2===t){if(r(2,n),null===i)return;i(2,n)}}else{if(null!==i)return;e(n)(0,o)}}))}}}}V="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof module?module:Function("return this")();var Y,W,J=("function"==typeof(W=V.Symbol)?W.observable?Y=W.observable:(Y=W("observable"),W.observable=Y):Y="@@observable",Y);const Q=n(Object.freeze(Object.defineProperty({__proto__:null,default:J},Symbol.toStringTag,{value:"Module"}))).default;const X=t(e=>(t,n)=>{if(0!==t)return;let r;n(0,e=>{2===e&&r&&(r.unsubscribe?r.unsubscribe():r())}),e=e[Q]?e[Q]():e,r=e.subscribe({next:e=>n(1,e),error:e=>n(2,e),complete:()=>n(2)})}),K=e=>(t,n)=>{if(0!==t)return;let r=!1;e.then(e=>{r||(n(1,e),r||n(2))},e=>{r||n(2,e)}),n(0,e=>{2===e&&(r=!0)})};const ee=t((function(...e){let t=e[0];for(let n=1,r=e.length;nt=>(n,r)=>{if(0!==n)return;let a;t(0,(t,n)=>{0===t?(a=n,r(0,(e,t)=>{0!==e&&a(e,t)}),r(1,e)):r(t,n)})});const ne=t(e=>t=>(n,r)=>{0===n&&t(0,(t,n)=>{r(t,1===t?e(n):n)})});function re(e){return t=>r(ne(e)(t))}var ae=function(){},ie={};function oe(e){var t,n,r=[],a=!1,i=ie;return function(o,s){if(0===o){if(i!==ie)return s(0,ae),a&&s(1,n),void s(2,i);r.push(s);var u=function(e,n){if(2!==e)i===ie&&t(e,n);else{var a=r.indexOf(s);-1!==a&&r.splice(a,1)}};1!==r.length?(s(0,u),a&&i===ie&&s(1,n)):e(0,(function(e,o){if(0===e)return t=o,void s(0,u);1===e&&(a=!0,n=o);var l=r.slice(0);2===e&&(i=o,r=null),l.forEach((function(t){t(e,o)}))}))}}}const se=t((function(){let e=[];return(t,n)=>{if(0===t){const t=n;e.push(t),t(0,n=>{if(2===n){const n=e.indexOf(t);n>-1&&e.splice(n,1)}})}else{const r=e.slice(0);for(let a,i=0,o=r.length;i-1&&a(t,n)}}})),ue={},le=e=>t=>(n,r)=>{if(0!==n)return;let a,i,o=!1,s=ue;t(0,(t,n)=>{if(0===t)return a=n,e(0,(e,t)=>0===e?(i=t,void i(1)):1===e?(s=void 0,i(2),a(2),void(o&&r(2))):void(2===e&&(i=null,t&&(s=t,a(2),o&&r(e,t))))),o=!0,r(0,(e,t)=>{s===ue&&(2===e&&i&&i(2),a(e,t))}),void(s!==ue&&r(2,s));2===t&&i(2),r(t,n)})},ce=(e,t,n)=>t=>(n,r)=>{0===n&&t(0,(t,n)=>{1===t&&void 0!==n&&e&&e(n),r(t,n)})};function de(e){const t=function(e){try{return window.localStorage}catch(t){return"SecurityError"===t.name&&e?e:U()?window.localStorage:L}}(e);return{setItem:(e,n)=>new Promise(r=>r(t.setItem(e,n))),getItem:e=>new Promise(n=>n(t.getItem(e))),removeItem:e=>new Promise(n=>n(t.removeItem(e)))}}function pe(e,t){return[].concat(...t.map(e))}function he(e){return"object"==typeof e&&null!==e&&!a(e)}function fe(t,n){return e(n).reduce((e,r)=>(e[r]=t(n[r]),e),{})}function ge(e){let t=e.trim();if(0===t.length)return"";if(1===t.length)return t.toLowerCase();if(/^[a-z\d]+$/.test(t))return t;return t!==t.toLowerCase()&&(t=function(e){let t=e,n=!1,r=!1,a=!1;for(let i=0;it.toUpperCase()),t}function me(e){return a(e)?e:[e]}function _e(e,t){for(let n=0;n=0;n--)if(e(t[n]))return t[n]}function De(e,t,n){for(let r=t;r>=0;r--)if(e(n[r]))return r;return-1}function ye(e,t){return De(e,t.length-1,t)}function we(e,t){if(e<=0)return[];const n=[];for(;e--;)n.push(t);return n}function Ce(t,n){return e(n).forEach(e=>{t(n[e],e)})}function Ee(){return Math.random().toString(36).substring(2)}function ke(e){const t=Ee();return i(t,e)?ke(e):t}function Ae(e,t){const n="string"==typeof e?e.split("."):e;let r=0,a=t;for(;a&&r(t[n[e]]=n,t),{})}function Se(e){return e.length>0?e[e.length-1]:void 0}function Te(t,n){return e(n).reduce((e,r)=>(Object.defineProperty(e,t(r),{value:n[r],enumerable:!0}),e),{})}function Be(t,n){return e(n).reduce((e,r)=>(e[r]=t(n[r],r),e),{})}function ze(e,t){if(xe(t))return e;const n={};return Ce((r,o)=>{if(i(o,t))if(he(e[o])&&he(t[o]))n[o]=ze(e[o],t[o]);else if(a(e[o])&&a(t[o])){const r=Math.max(e[o].length,t[o].length);n[o]=new Array(r);for(let a=0;a{i(r,n)||(n[r]=t[r])},t),n}function Me(t){return e(t).map(e=>t[e])}function Pe(e,t){const n="function"==typeof e?e:t=>Ae(e,t);return(a(t)?[...t]:Me(t)).sort((e,t)=>n(e)-n(t))}function Oe(t,n){return e(n).reduce((e,r)=>(t(n[r],r)||(e[r]=n[r]),e),{})}function je(e,t){return Oe((t,n)=>-1!==e.indexOf(n),t)}function Re(e,t){return e.reduce((e,n)=>(e[n]=t[n],e),{})}function $e(t,n){return e(n).reduce((e,r)=>(t(n[r])&&(e[r]=n[r]),e),{})}function qe(e,t){return e.reduce((e,n)=>(i(n,t)&&(e[n]=t[n]),e),{})}function Ue(e,t){return t.filter(t=>!e(t))}function Le(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Ne(e,t){if(Le(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let a=0;ae)break;a+=i.length+1,r.push(i)}return r.join(" ")+"..."}function He(e,t,n){const r=De(t=>!e(t),t,n);return r===t?[]:n.slice(r+1,t+1)}function Ze(e,t){return e===t?0:e{const r=e(t);return-1===n.indexOf(r)&&(n.push(r),!0)})}function Je(e,t,n){return[...n.slice(0,e),t,...n.slice(e+1,n.length)]}const Qe=/(?:[^:]+:\/\/)?([^/\s]+)/;function Xe(e){const t=e.match(Qe);return t&&t[1]}const Ke=(e,t)=>z(t)[e],et=/^(?:https?:)?\/\/[^/]+\/([^?#]+)/,tt=e=>{const t=e.match(et);return"/"+(t&&t[1]||"")},nt=/^((http(s)?:)?\/\/)/,rt=e=>e.replace(nt,""),at=/^((http(s)?:)?\/\/)/,it=e=>{const t=e.match(at);return t?t[2]:null},ot=(e,t)=>{if(0===Object.keys(t).length)return e;const n=M(e),r=tt(e),a=P(e)?z(e):{},i=O({...a,...t});return e.indexOf("#")>-1?""+n+r+"?"+i+"#"+e.split("#")[1]:""+n+r+"?"+i},st=(e,t)=>{if(-1===e.indexOf("?"))return e;const n=z(e);if(xe(n))return e;if(Object.keys(n).every(e=>!t.includes(e)))return e;t.forEach(e=>delete n[e]);const[r]=e.split("?"),a=ot(r,n);return e.indexOf("#")>-1?a+"#"+e.split("#")[1]:a},ut=e=>"https://"+rt(e);function lt(e,t){return t=t||{},new Promise((function(n,r){var a=new XMLHttpRequest,i=[],o=[],s={},u=function(){return{ok:2==(a.status/100|0),statusText:a.statusText,status:a.status,url:a.responseURL,text:function(){return Promise.resolve(a.responseText)},json:function(){return Promise.resolve(a.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([a.response]))},clone:u,headers:{keys:function(){return i},entries:function(){return o},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in a.open(t.method||"get",e,!0),a.onload=function(){a.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,n){i.push(t=t.toLowerCase()),o.push([t,n]),s[t]=s[t]?s[t]+","+n:n})),n(u())},a.onerror=r,a.withCredentials="include"==t.credentials,t.headers)a.setRequestHeader(l,t.headers[l]);a.send(t.body||null)}))}const ct="accept_greeting",dt="cancel_greeting",pt="check_goals",ht="deactivate_chat",ft="delete_chat_properties",gt="delete_event_properties",mt="delete_thread_properties",_t="get_chat",bt="get_customer",vt="get_form",Dt="get_predicted_agent",yt="get_url_info",wt="list_chats",Ct="list_group_statuses",Et="list_threads",kt="login",At="mark_events_as_seen",Ft="resume_chat",xt="send_event",It="send_rich_message_postback",St="send_sneak_peek",Tt="set_customer_session_fields",Bt="start_chat",zt="update_chat_properties",Mt="update_customer",Pt="update_customer_page",Ot="update_event_properties",jt="update_thread_properties",Rt="upload_file",$t="file",qt="filled_form",Ut="message",Lt="system_message",Nt="custom",Vt="chat_deactivated",Ht="customer_disconnected",Zt="customer_side_storage_updated",Gt="groups_status_updated",Yt="incoming_chat",Wt="incoming_event",Jt="incoming_typing_indicator",Qt="queue_position_updated",Xt="thread_properties_updated",Kt="user_added_to_chat",en=Object.freeze(Object.defineProperty({__proto__:null,CHAT_DEACTIVATED:"chat_deactivated",CHAT_PROPERTIES_DELETED:"chat_properties_deleted",CHAT_PROPERTIES_UPDATED:"chat_properties_updated",CHAT_TRANSFERRED:"chat_transferred",CUSTOMER_DISCONNECTED:"customer_disconnected",CUSTOMER_SIDE_STORAGE_UPDATED:"customer_side_storage_updated",CUSTOMER_UPDATED:"customer_updated",EVENTS_MARKED_AS_SEEN:"events_marked_as_seen",EVENT_PROPERTIES_DELETED:"event_properties_deleted",EVENT_PROPERTIES_UPDATED:"event_properties_updated",EVENT_UPDATED:"event_updated",GREETING_ACCEPTED:"greeting_accepted",GREETING_CANCELED:"greeting_canceled",GROUPS_STATUS_UPDATED:"groups_status_updated",INCOMING_CHAT:"incoming_chat",INCOMING_EVENT:"incoming_event",INCOMING_GREETING:"incoming_greeting",INCOMING_MULTICAST:"incoming_multicast",INCOMING_RICH_MESSAGE_POSTBACK:"incoming_rich_message_postback",INCOMING_TYPING_INDICATOR:"incoming_typing_indicator",QUEUE_POSITION_UPDATED:"queue_position_updated",THREAD_PROPERTIES_DELETED:"thread_properties_deleted",THREAD_PROPERTIES_UPDATED:"thread_properties_updated",USER_ADDED_TO_CHAT:"user_added_to_chat",USER_REMOVED_FROM_CHAT:"user_removed_from_chat"},Symbol.toStringTag,{value:"Module"})),tn="customer";function nn(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const rn=(e,t)=>{const n=function(n){const r=Object.create(n);r.action=(t,r)=>{const a={type:e,payload:t};r&&(a.meta=r),n.dispatch(a)};for(var a=arguments.length,i=new Array(a>1?a-1:0),o=1;oe,n},an=(e,t)=>{const n="REQUEST_"+e,r=rn(e,t),a=function(e){for(var a=arguments.length,i=new Array(a>1?a-1:0),s=1;s{const{promise:s,resolve:u,reject:c}=nn();e.dispatch({type:n,payload:{...t,meta:a,resolve:u,reject:c}}),l=s,l.then(()=>{r(e,...i)},o)},t(u,...i),void 0===l)throw new Error("You forgot to call `action` handler in "+n+" creator.");return l};return a.toString=()=>n,{actionMethod:r,requestActionMethod:a}},on=(e,t)=>{if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("bindActionMethods expects a plain object with actionMethods as values.");return fe(e=>((e,t)=>function(){for(var n=arguments.length,r=new Array(n),a=0;a(t[void 0]&&console.warn(["Reducer contains an 'undefined' action type.","Have you misspelled a constant?"].join("\n")),function(n,r){return void 0===n&&(n=e),i(r.type,t)?t[r.type](n,r.payload):n}),un=(e,t)=>{if("object"!=typeof e||null===e||Array.isArray(e))throw new Error("bindSelectors expects a plain object with selectors as values.");return fe(e=>((e,t)=>function(){for(var n=arguments.length,r=new Array(n),a=0;at.reduce((e,t)=>t(e,n),e)},cn=Object.freeze({success:!0}),dn=(e,t)=>{const n={id:t.id,authorId:t.author_id,createdAt:t.created_at,threadId:e,properties:t.properties||{}};return void 0!==t.custom_id&&(n.customId=t.custom_id),n},pn=(e,t)=>{let n,r,a,i;t.height>t.width?(n="height",r="width",a=t.height,i=t.width):(n="width",r="height",a=t.width,i=t.height);const o=e/a;return{[n]:Math.ceil(Math.min(a,e)),[r]:Math.ceil(Math.min(o*i,i))}},hn=(e,t)=>void 0!==t.width&&void 0!==t.height?((e,t)=>({...dn(e,t),type:"file",contentType:t.content_type,url:t.url,name:t.name,width:t.width,height:t.height,thumbnails:{default:{url:t.thumbnail_url,...pn(300,t)},high:{url:t.thumbnail2x_url,...pn(600,t)}},...t.alternative_text&&{alternativeText:t.alternative_text}}))(e,t):{...dn(e,t),type:"file",contentType:t.content_type,url:t.url,name:t.name},fn=e=>{const t={};if("string"==typeof e.title&&(t.title=e.title),"string"==typeof e.subtitle&&(t.subtitle=e.subtitle),e.image){const{image:n}=e;t.image={url:n.url,name:n.name,...n.alternative_text&&{alternativeText:n.alternative_text}}}return e.buttons&&(t.buttons=e.buttons.map(e=>{switch(e.type){case"message":case"copy":case"phone":return{type:e.type,text:e.text,postbackId:e.postback_id,userIds:e.user_ids,value:e.value,role:e.role||"default"};case"cancel":return{type:e.type,text:e.text,postbackId:e.postback_id,userIds:e.user_ids,role:e.role||"default"};case"url":{const t={type:e.type,text:e.text,postbackId:e.postback_id,userIds:e.user_ids,value:e.value,role:e.role||"default"};return e.target&&(t.target=e.target),t}case"webview":return{type:e.type,text:e.text,postbackId:e.postback_id,userIds:e.user_ids,value:e.value,role:e.role||"default"};default:return{text:e.text,postbackId:e.postback_id,userIds:e.user_ids,role:e.role||"default"}}})),t},gn=(e,t)=>{switch(t.type){case"file":return hn(e,t);case"form":return((e,t)=>({...dn(e,t),authorId:"system",type:"form",formId:t.form_id,fields:t.fields}))(e,t);case"filled_form":return((e,t)=>({...dn(e,t),type:"filled_form",formId:t.form_id,fields:t.fields.map(e=>{switch(e.type){case"group_chooser":{if(!e.answer)return e;const{group_id:t,...n}=e.answer;return{...e,answer:{...n,groupId:t}}}default:return e}})}))(e,t);case"message":return((e,t)=>({...dn(e,t),type:"message",text:t.text}))(e,t);case"rich_message":return((e,t)=>{switch(t.template_id){case"cards":case"quick_replies":case"sticker":return{...dn(e,t),type:"rich_message",template:t.template_id,elements:t.elements.map(fn)};default:return null}})(e,t);case"system_message":return((e,t)=>{const n={...dn(e,{...t,author_id:"system"}),type:"system_message",text:t.text,systemMessageType:t.system_message_type};return t.text_vars&&(n.textVars=t.text_vars),n})(e,t);case"custom":return((e,t)=>({...dn(e,t),type:"custom",...t.content&&{content:t.content}}))(e,t);default:return null}},mn=e=>({id:e.id,addon:e.addon||null,uniqueId:e.unique_id,displayedFirstTime:e.displayed_first_time,isExitIntent:e.is_exit_intent,accepted:e.accepted||!1,subtype:e.subtype||"greeting",event:gn(null,e.event),agent:{id:e.agent.id,name:e.agent.name,avatar:e.agent.avatar,jobTitle:e.agent.job_title,isBot:e.agent.is_bot||!1}}),_n=function(e){return void 0===e&&(e={}),e.group_ids?{groupIds:e.group_ids}:{}},bn=e=>fe(e=>e.events_seen_up_to?e.events_seen_up_to:null,Ie("id",e)),vn=(e,t)=>{const n=t.properties||{};return{id:t.id,chatId:e,active:t.active,access:_n(t.access),createdAt:t.created_at,userIds:t.user_ids,events:t.events.map(e=>gn(t.id,e)).filter(Boolean),properties:n,previousThreadId:t.previous_thread_id||null,nextThreadId:t.next_thread_id||null,queue:t.queue?An(t.queue):null}},Dn=e=>({id:e.id,access:_n(e.access),users:e.users.map(Fn),properties:e.properties||{},eventsSeenUpToMap:bn(e.users)}),yn=e=>{const t=qe(["avatar","email","name"],e);return e.session_fields&&(t.sessionFields=e.session_fields.reduce((e,t)=>{const[n]=Object.keys(t);return e[n]=t[n],e},{})),t},wn=e=>{const t=yn(e);return{id:e.id,type:"customer",...t,sessionFields:t.sessionFields||{}}},Cn=e=>{const{statistics:t}=e;return{...wn(e),statistics:{chatsCount:t.chats_count,threadsCount:t.threads_count,visitsCount:t.visits_count,pageViewsCount:t.page_views_count,greetingsShownCount:t.greetings_shown_count,greetingsAcceptedCount:t.greetings_accepted_count}}},En=e=>{const{agent:t,queue:n}=e;return{agent:{id:t.id,type:"agent",name:t.name,avatar:t.avatar,jobTitle:t.job_title,isBot:t.is_bot},queue:n}},kn=e=>({position:e.position,waitTime:e.wait_time}),An=e=>({...kn(e),queuedAt:e.queued_at}),Fn=e=>{return"customer"===e.type?{...wn(n=e),present:n.present}:{id:(t=e).id,type:"agent",name:t.name,avatar:t.avatar,jobTitle:t.job_title,present:t.present};var t,n},xn=e=>"offline"===e?"offline":"online",In=e=>({chatId:e.chat_id,properties:e.properties}),Sn=e=>{const t={chatId:e.chat_id,threadId:e.thread_id,transferredTo:{...e.transferred_to.agent_ids&&{agentIds:e.transferred_to.agent_ids},...e.transferred_to.group_ids&&{groupIds:e.transferred_to.group_ids}},queue:e.queue?An(e.queue):null};return"manual"===e.reason?{...t,reason:e.reason,requesterId:e.requester_id}:{...t,reason:e.reason}},Tn=e=>({id:e.id,...yn(e)}),Bn=e=>({chatId:e.chat_id,threadId:e.thread_id,eventId:e.event_id,properties:e.properties}),zn=e=>({chatId:e.chat_id,threadId:e.thread_id,eventId:e.event_id,properties:e.properties}),Mn=e=>{const t=e.thread_id;return{chatId:e.chat_id,threadId:t,event:gn(t,e.event)}},Pn=e=>({chatId:e.chat_id,userId:e.user_id,seenUpTo:e.seen_up_to}),On=e=>({uniqueId:e.unique_id}),jn=e=>{const{chat:t}=e;return{chat:{...Dn(t),thread:vn(t.id,t.thread)}}},Rn=e=>({chatId:e.chat_id,event:gn(e.thread_id,e.event)}),$n=e=>mn(e),qn=e=>({userId:e.user_id,chatId:e.chat_id,threadId:e.thread_id,eventId:e.event_id,postback:e.postback}),Un=e=>{const{chat_id:t,typing_indicator:n}=e;return{chatId:t,typingIndicator:{authorId:n.author_id,isTyping:n.is_typing}}},Ln=e=>({chatId:e.chat_id,threadId:e.thread_id,queue:kn(e.queue)}),Nn=e=>({chatId:e.chat_id,threadId:e.thread_id,properties:e.properties}),Vn=e=>({chatId:e.chat_id,threadId:e.thread_id,properties:e.properties}),Hn=e=>({chatId:e.chat_id,user:Fn(e.user),present:e.user.present}),Zn=e=>({chatId:e.chat_id,userId:e.user_id}),Gn=e=>e.map(e=>{switch(e.type){case"group_chooser":return{...e,options:e.options.map(e=>{let{group_id:t,...n}=e;return{...n,groupId:t}})};case"rating":{const{comment_label:t,...n}=e;return{...n,commentLabel:t}}default:return e}}),Yn=e=>{const t=e.map((e,t)=>({...e,id:String(t)}));return Gn(t)},Wn=e=>{const t=!("id"in e.fields[0]);return{id:e.id,fields:t?Yn(e.fields):Gn(e.fields)}},Jn=e=>e.enabled?{...e,form:Wn(e.form)}:e,Qn=e=>{const t={url:e.url};return e.title&&(t.title=e.title),e.description&&(t.description=e.description),e.image_url&&(t.imageUrl="https://"+rt(e.image_url),e.image_width&&e.image_height&&(t.imageWidth=e.image_width,t.imageHeight=e.image_height)),t},Xn=e=>{let{online_groups_ids:t,customer_groups:n}=e;if(!t)return"offline";return Fe(n.monitoring.id,t)?"online":"offline"},Kn=e=>{const t=e.chats_summary.map(e=>{let{id:t,active:n,access:r,last_thread_created_at:a,last_thread_id:i,last_event_per_type:o,properties:s={},users:u}=e;const l={id:t,active:n,access:_n(r),properties:s,users:u.map(Fn),lastThreadId:i||null,lastThreadCreatedAt:a||null,eventsSeenUpToMap:bn(u)};if(!o)return l;l.lastEventsPerType=fe(e=>gn(e.thread_id,e.event),o);const c=o,d=Se(Object.keys(c).map(e=>c[e]).sort((e,t)=>e.thread_id===t.thread_id?Ze(e.event.created_at,t.event.created_at):Ze(e.thread_created_at,t.thread_created_at)));return d&&l.lastEventsPerType&&(l.lastEvent=l.lastEventsPerType[d.event.type]),l});return{chatsSummary:Pe(e=>{var t;let{lastEvent:n,order:r}=e;return-1*(null!=(t=void 0!==n?n.timestamp:r)?t:0)},t),totalChats:e.total_chats,users:We(e=>e.id,pe(e=>e.users,t)),previousPageId:e.previous_page_id||null,nextPageId:e.next_page_id||null}},er=e=>e.groups_status,tr=(e,t)=>({threads:t.threads.map(t=>vn(e.payload.chat_id,t)),previousPageId:t.previous_page_id||null,nextPageId:t.next_page_id||null}),nr=e=>{const{__priv_dynamic_config:t,chats:n,greeting:r}=e;return{dynamicConfig:t,customer:Cn(e.customer),availability:Xn(t),chats:n.map(t=>({id:t.chat_id,active:"has_active_thread"in t?t.has_active_thread:e.has_active_thread,hasUnreadEvents:t.has_unread_events})),...r&&{greeting:mn(r)}}},rr=e=>{switch(e.action){case"chat_deactivated":return{action:e.action,payload:{chatId:e.payload.chat_id}};case"chat_properties_deleted":return{action:e.action,payload:(t=e.payload,{chatId:t.chat_id,properties:t.properties})};case"chat_properties_updated":return{action:e.action,payload:In(e.payload)};case"chat_transferred":return{action:e.action,payload:Sn(e.payload)};case"customer_side_storage_updated":case"customer_disconnected":return{action:e.action,payload:e.payload};case"customer_updated":return{action:e.action,payload:Tn(e.payload)};case"event_properties_deleted":return{action:e.action,payload:Bn(e.payload)};case"event_properties_updated":return{action:e.action,payload:zn(e.payload)};case"event_updated":return{action:e.action,payload:Mn(e.payload)};case"events_marked_as_seen":return{action:e.action,payload:Pn(e.payload)};case"greeting_accepted":case"greeting_canceled":return{action:e.action,payload:On(e.payload)};case"groups_status_updated":return{action:e.action,payload:e.payload};case"incoming_chat":return{action:e.action,payload:jn(e.payload)};case"incoming_event":return{action:e.action,payload:Rn(e.payload)};case"incoming_greeting":return{action:e.action,payload:$n(e.payload)};case"incoming_multicast":return{action:e.action,payload:e.payload};case"incoming_rich_message_postback":return{action:e.action,payload:qn(e.payload)};case"incoming_typing_indicator":return{action:e.action,payload:Un(e.payload)};case"queue_position_updated":return{action:e.action,payload:Ln(e.payload)};case"thread_properties_deleted":return{action:e.action,payload:Nn(e.payload)};case"thread_properties_updated":return{action:e.action,payload:Vn(e.payload)};case"user_added_to_chat":return{action:e.action,payload:Hn(e.payload)};case"user_removed_from_chat":return{action:e.action,payload:Zn(e.payload)}}var t},ar=e=>{let{request:t,response:n}=e;switch(n.action){case"accept_greeting":case"cancel_greeting":case"delete_chat_properties":case"delete_event_properties":case"delete_thread_properties":return{action:n.action,payload:cn};case"get_chat":return{action:n.action,payload:(r=n.payload,{...Dn(r),thread:r.thread?vn(r.id,r.thread):null})};case"get_customer":return{action:n.action,payload:Cn(n.payload)};case"get_form":return{action:n.action,payload:Jn(n.payload)};case"get_predicted_agent":return{action:n.action,payload:En(n.payload)};case"get_url_info":return{action:n.action,payload:Qn(n.payload)};case"list_chats":return{action:n.action,payload:Kn(n.payload)};case"list_group_statuses":return{action:n.action,payload:er(n.payload)};case"list_threads":return{action:n.action,payload:tr(t,n.payload)};case"login":return{action:n.action,payload:nr(n.payload)};case"mark_events_as_seen":case"send_sneak_peek":case"set_customer_session_fields":case"send_rich_message_postback":case"update_chat_properties":case"update_customer":case"update_customer_page":case"update_event_properties":case"update_thread_properties":return{action:n.action,payload:cn}}var r},ir=e=>({code:e.type.toUpperCase(),message:e.message});var or,sr,ur,lr,cr,dr,pr,hr,fr,gr;function mr(){return gr?fr:(gr=1,fr=function(e){var t={};t.src_Any=(sr?or:(sr=1,or=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)).source,t.src_Cc=(lr?ur:(lr=1,ur=/[\0-\x1F\x7F-\x9F]/)).source,t.src_Z=(dr?cr:(dr=1,cr=/[ \xA0\u1680\u2000-\u200A\u202F\u205F\u3000]/)).source,t.src_P=(hr?pr:(hr=1,pr=/[!-#%-\*,-/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E49\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/)).source,t.src_ZPCc=[t.src_Z,t.src_P,t.src_Cc].join("|"),t.src_ZCc=[t.src_Z,t.src_Cc].join("|");return t.src_pseudo_letter="(?:(?![><|]|"+t.src_ZPCc+")"+t.src_Any+")",t.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",t.src_auth="(?:(?:(?!"+t.src_ZCc+"|[@/\\[\\]()]).)+@)?",t.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",t.src_host_terminator="(?=$|[><|]|"+t.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+t.src_ZPCc+"))",t.src_path="(?:[/?#](?:(?!"+t.src_ZCc+"|[><|]|[()[\\]{}.,\"'?!\\-]).|\\[(?:(?!"+t.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+t.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+t.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+t.src_ZCc+'|["]).)+\\"|\\\'(?:(?!'+t.src_ZCc+"|[']).)+\\'|\\'(?="+t.src_pseudo_letter+"|[-]).|\\.{2,3}[a-zA-Z0-9%/]|\\.(?!"+t.src_ZCc+"|[.]).|"+(e&&e["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+"\\,(?!"+t.src_ZCc+").|\\!(?!"+t.src_ZCc+"|[!]).|\\?(?!"+t.src_ZCc+"|[?]).)+|\\/)?",t.src_email_name='[\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]+',t.src_xn="xn--[a-z0-9\\-]{1,59}",t.src_domain_root="(?:"+t.src_xn+"|"+t.src_pseudo_letter+"{1,63})",t.src_domain="(?:"+t.src_xn+"|(?:"+t.src_pseudo_letter+")|(?:"+t.src_pseudo_letter+"(?:-|"+t.src_pseudo_letter+"){0,61}"+t.src_pseudo_letter+"))",t.src_host="(?:(?:(?:(?:"+t.src_domain+")\\.)*"+t.src_domain+"))",t.tpl_host_fuzzy="(?:"+t.src_ip4+"|(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%)))",t.tpl_host_no_ip_fuzzy="(?:(?:(?:"+t.src_domain+")\\.)+(?:%TLDS%))",t.src_host_strict=t.src_host+t.src_host_terminator,t.tpl_host_fuzzy_strict=t.tpl_host_fuzzy+t.src_host_terminator,t.src_host_port_strict=t.src_host+t.src_port+t.src_host_terminator,t.tpl_host_port_fuzzy_strict=t.tpl_host_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_port_no_ip_fuzzy_strict=t.tpl_host_no_ip_fuzzy+t.src_port+t.src_host_terminator,t.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+t.src_ZPCc+"|>|$))",t.tpl_email_fuzzy="(^|[><|]|\\(|"+t.src_ZCc+")("+t.src_email_name+"@"+t.tpl_host_fuzzy_strict+")",t.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_fuzzy_strict+t.src_path+")",t.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+t.src_ZPCc+"))((?![$+<=>^`||])"+t.tpl_host_port_no_ip_fuzzy_strict+t.src_path+")",t})}function _r(e){var t=Array.prototype.slice.call(arguments,1);return t.forEach((function(t){t&&Object.keys(t).forEach((function(n){e[n]=t[n]}))})),e}function br(e){return Object.prototype.toString.call(e)}function vr(e){return"[object Function]"===br(e)}function Dr(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var yr={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};var wr={"http:":{validate:function(e,t,n){var r=e.slice(t);return n.re.http||(n.re.http=new RegExp("^\\/\\/"+n.re.src_auth+n.re.src_host_port_strict+n.re.src_path,"i")),n.re.http.test(r)?r.match(n.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(e,t,n){var r=e.slice(t);return n.re.no_http||(n.re.no_http=new RegExp("^"+n.re.src_auth+"(?:localhost|(?:(?:"+n.re.src_domain+")\\.)+"+n.re.src_domain_root+")"+n.re.src_port+n.re.src_host_terminator+n.re.src_path,"i")),n.re.no_http.test(r)?t>=3&&":"===e[t-3]||t>=3&&"/"===e[t-3]?0:r.match(n.re.no_http)[0].length:0}},"mailto:":{validate:function(e,t,n){var r=e.slice(t);return n.re.mailto||(n.re.mailto=new RegExp("^"+n.re.src_email_name+"@"+n.re.src_host_strict,"i")),n.re.mailto.test(r)?r.match(n.re.mailto)[0].length:0}}},Cr="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function Er(e){var t=e.re=mr()(e.__opts__),n=e.__tlds__.slice();function r(e){return e.replace("%TLDS%",t.src_tlds)}e.onCompile(),e.__tlds_replaced__||n.push("a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]"),n.push(t.src_xn),t.src_tlds=n.join("|"),t.email_fuzzy=RegExp(r(t.tpl_email_fuzzy),"i"),t.link_fuzzy=RegExp(r(t.tpl_link_fuzzy),"i"),t.link_no_ip_fuzzy=RegExp(r(t.tpl_link_no_ip_fuzzy),"i"),t.host_fuzzy_test=RegExp(r(t.tpl_host_fuzzy_test),"i");var a=[];function i(e,t){throw new Error('(LinkifyIt) Invalid schema "'+e+'": '+t)}e.__compiled__={},Object.keys(e.__schemas__).forEach((function(t){var n=e.__schemas__[t];if(null!==n){var r={validate:null,link:null};if(e.__compiled__[t]=r,"[object Object]"===br(n))return!function(e){return"[object RegExp]"===br(e)}(n.validate)?vr(n.validate)?r.validate=n.validate:i(t,n):r.validate=function(e){return function(t,n){var r=t.slice(n);return e.test(r)?r.match(e)[0].length:0}}(n.validate),void(vr(n.normalize)?r.normalize=n.normalize:n.normalize?i(t,n):r.normalize=function(e,t){t.normalize(e)});!function(e){return"[object String]"===br(e)}(n)?i(t,n):a.push(t)}})),a.forEach((function(t){e.__compiled__[e.__schemas__[t]]&&(e.__compiled__[t].validate=e.__compiled__[e.__schemas__[t]].validate,e.__compiled__[t].normalize=e.__compiled__[e.__schemas__[t]].normalize)})),e.__compiled__[""]={validate:null,normalize:function(e,t){t.normalize(e)}};var o=Object.keys(e.__compiled__).filter((function(t){return t.length>0&&e.__compiled__[t]})).map(Dr).join("|");e.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","i"),e.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+t.src_ZPCc+"))("+o+")","ig"),e.re.pretest=RegExp("("+e.re.schema_test.source+")|("+e.re.host_fuzzy_test.source+")|@","i"),function(e){e.__index__=-1,e.__text_cache__=""}(e)}function kr(e,t){var n=e.__index__,r=e.__last_index__,a=e.__text_cache__.slice(n,r);this.schema=e.__schema__.toLowerCase(),this.index=n+t,this.lastIndex=r+t,this.raw=a,this.text=a,this.url=a}function Ar(e,t){var n=new kr(e,t);return e.__compiled__[n.schema].normalize(n,e),n}function Fr(e,t){if(!(this instanceof Fr))return new Fr(e,t);var n;t||(n=e,Object.keys(n||{}).reduce((function(e,t){return e||yr.hasOwnProperty(t)}),!1)&&(t=e,e={})),this.__opts__=_r({},yr,t),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=_r({},wr,e),this.__compiled__={},this.__tlds__=Cr,this.__tlds_replaced__=!1,this.re={},Er(this)}Fr.prototype.add=function(e,t){return this.__schemas__[e]=t,Er(this),this},Fr.prototype.set=function(e){return this.__opts__=_r(this.__opts__,e),this},Fr.prototype.test=function(e){if(this.__text_cache__=e,this.__index__=-1,!e.length)return!1;var t,n,r,a,i,o,s,u;if(this.re.schema_test.test(e))for((s=this.re.schema_search).lastIndex=0;null!==(t=s.exec(e));)if(a=this.testSchemaAt(e,t[2],s.lastIndex)){this.__schema__=t[2],this.__index__=t.index+t[1].length,this.__last_index__=t.index+t[0].length+a;break}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(u=e.search(this.re.host_fuzzy_test))>=0&&(this.__index__<0||u=0&&null!==(r=e.match(this.re.email_fuzzy))&&(i=r.index+r[1].length,o=r.index+r[0].length,(this.__index__<0||ithis.__last_index__)&&(this.__schema__="mailto:",this.__index__=i,this.__last_index__=o)),this.__index__>=0},Fr.prototype.pretest=function(e){return this.re.pretest.test(e)},Fr.prototype.testSchemaAt=function(e,t,n){return this.__compiled__[t.toLowerCase()]?this.__compiled__[t.toLowerCase()].validate(e,n,this):0},Fr.prototype.match=function(e){var t=0,n=[];this.__index__>=0&&this.__text_cache__===e&&(n.push(Ar(this,t)),t=this.__last_index__);for(var r=t?e.slice(t):e;this.test(r);)n.push(Ar(this,t)),r=r.slice(this.__last_index__),t+=this.__last_index__;return n.length?n:null},Fr.prototype.tlds=function(e,t){return e=Array.isArray(e)?e:[e],t?(this.__tlds__=this.__tlds__.concat(e).sort().filter((function(e,t,n){return e!==n[t-1]})).reverse(),Er(this),this):(this.__tlds__=e.slice(),this.__tlds_replaced__=!0,Er(this),this)},Fr.prototype.normalize=function(e){e.schema||(e.url="http://"+e.url),"mailto:"!==e.schema||/^mailto:/i.test(e.url)||(e.url="mailto:"+e.url)},Fr.prototype.onCompile=function(){};var xr=Fr;const Ir=t(xr);var Sr={exports:{}},Tr=Sr.exports=function(){function e(e,t,n){return n&&function(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r={exports:{}};function a(){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}}r.exports={defaults:{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},getDefaults:a,changeDefaults:function(e){r.exports.defaults=e}};var i=/[&<>"']/,o=/[&<>"']/g,s=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,l={"&":"&","<":"<",">":">",'"':""","'":"'"},c=function(e){return l[e]},d=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function p(e){return e.replace(d,(function(e,t){return"colon"===(t=t.toLowerCase())?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""}))}var h=/(^|[^\[])\^/g,f=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i,m={},_=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,v=/^([^:]+:\/*[^/]*)[\s\S]*$/;function D(e,t){m[" "+e]||(_.test(e)?m[" "+e]=e+"/":m[" "+e]=y(e,"/",!0));var n=-1===(e=m[" "+e]).indexOf(":");return"//"===t.substring(0,2)?n?t:e.replace(b,"$1")+t:"/"===t.charAt(0)?n?t:e.replace(v,"$1")+t:e+t}function y(e,t,n){var r=e.length;if(0===r)return"";for(var a=0;a=0&&"\\"===n[a];)r=!r;return r?"|":" |"})).split(/ \|/),r=0;if(n.length>t)n.splice(t);else for(;n.length1;)1&t&&(n+=e),t>>=1,e+=e;return n+e},z=r.exports.defaults,M=I,P=x,O=w,j=S;function R(e,t,n){var r=t.href,a=t.title?O(t.title):null,i=e[1].replace(/\\([\[\]])/g,"$1");return"!"!==e[0].charAt(0)?{type:"link",raw:n,href:r,title:a,text:i}:{type:"image",raw:n,href:r,title:a,text:O(i)}}var $=function(){function e(e){this.options=e||z}var t=e.prototype;return t.space=function(e){var t=this.rules.block.newline.exec(e);if(t)return t[0].length>1?{type:"space",raw:t[0]}:{raw:"\n"}},t.code=function(e){var t=this.rules.block.code.exec(e);if(t){var n=t[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:M(n,"\n")}}},t.fences=function(e){var t=this.rules.block.fences.exec(e);if(t){var n=t[0],r=function(e,t){var n=e.match(/^(\s+)(?:```)/);if(null===n)return t;var r=n[1];return t.split("\n").map((function(e){var t=e.match(/^\s+/);return null===t?e:t[0].length>=r.length?e.slice(r.length):e})).join("\n")}(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim():t[2],text:r}}},t.heading=function(e){var t=this.rules.block.heading.exec(e);if(t){var n=t[2].trim();if(/#$/.test(n)){var r=M(n,"#");this.options.pedantic?n=r.trim():r&&!/ $/.test(r)||(n=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n}}},t.nptable=function(e){var t=this.rules.block.nptable.exec(e);if(t){var n={type:"table",header:P(t[1].replace(/^ *| *\| *$/g,"")),align:t[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:t[3]?t[3].replace(/\n$/,"").split("\n"):[],raw:t[0]};if(n.header.length===n.align.length){var r,a=n.align.length;for(r=0;r ?/gm,"");return{type:"blockquote",raw:t[0],text:n}}},t.list=function(e){var t=this.rules.block.list.exec(e);if(t){var n,r,a,i,o,s,u,l,c,d=t[0],p=t[2],h=p.length>1,f={type:"list",raw:d,ordered:h,start:h?+p.slice(0,-1):"",loose:!1,items:[]},g=t[0].match(this.rules.block.item),m=!1,_=g.length;a=this.rules.block.listItemStart.exec(g[0]);for(var b=0;b<_;b++){if(d=n=g[b],this.options.pedantic||(c=n.match(new RegExp("\\n\\s*\\n {0,"+(a[0].length-1)+"}\\S")))&&(o=n.length-c.index+g.slice(b+1).join("\n").length,f.raw=f.raw.substring(0,f.raw.length-o),d=n=n.substring(0,c.index),_=b+1),b!==_-1){if(i=this.rules.block.listItemStart.exec(g[b+1]),this.options.pedantic?i[1].length>a[1].length:i[1].length>=a[0].length||i[1].length>3){g.splice(b,2,g[b]+(!this.options.pedantic&&i[1].length/i.test(r[0])&&(t=!1),!n&&/^<(pre|code|kbd|script)(\s|>)/i.test(r[0])?n=!0:n&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(r[0])&&(n=!1),{type:this.options.sanitize?"text":"html",raw:r[0],inLink:t,inRawBlock:n,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(r[0]):O(r[0]):r[0]}},t.link=function(e){var t=this.rules.inline.link.exec(e);if(t){var n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;var r=M(n.slice(0,-1),"\\");if((n.length-r.length)%2==0)return}else{var a=j(t[2],"()");if(a>-1){var i=(0===t[0].indexOf("!")?5:4)+t[1].length+a;t[2]=t[2].substring(0,a),t[0]=t[0].substring(0,i).trim(),t[3]=""}}var o=t[2],s="";if(this.options.pedantic){var u=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(o);u&&(o=u[1],s=u[3])}else s=t[3]?t[3].slice(1,-1):"";return o=o.trim(),/^$/.test(n)?o.slice(1):o.slice(1,-1)),R(t,{href:o?o.replace(this.rules.inline._escapes,"$1"):o,title:s?s.replace(this.rules.inline._escapes,"$1"):s},t[0])}},t.reflink=function(e,t){var n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){var r=(n[2]||n[1]).replace(/\s+/g," ");if(!(r=t[r.toLowerCase()])||!r.href){var a=n[0].charAt(0);return{type:"text",raw:a,text:a}}return R(n,r,n[0])}},t.emStrong=function(e,t,n){void 0===n&&(n="");var r=this.rules.inline.emStrong.lDelim.exec(e);if(r&&(!r[3]||!n.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var a=r[1]||r[2]||"";if(!a||a&&(""===n||this.rules.inline.punctuation.exec(n))){var i,o,s=r[0].length-1,u=s,l=0,c="*"===r[0][0]?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+s);null!=(r=c.exec(t));)if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6])if(o=i.length,r[3]||r[4])u+=o;else if(!((r[5]||r[6])&&s%3)||(s+o)%3){if(!((u-=o)>0))return o=Math.min(o,o+u+l),Math.min(s,o)%2?{type:"em",raw:e.slice(0,s+r.index+o+1),text:e.slice(1,s+r.index+o)}:{type:"strong",raw:e.slice(0,s+r.index+o+1),text:e.slice(2,s+r.index+o-1)}}else l+=o}}},t.codespan=function(e){var t=this.rules.inline.code.exec(e);if(t){var n=t[2].replace(/\n/g," "),r=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return r&&a&&(n=n.substring(1,n.length-1)),n=O(n,!0),{type:"codespan",raw:t[0],text:n}}},t.br=function(e){var t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}},t.del=function(e){var t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2]}},t.autolink=function(e,t){var n,r,a=this.rules.inline.autolink.exec(e);if(a)return r="@"===a[2]?"mailto:"+(n=O(this.options.mangle?t(a[1]):a[1])):n=O(a[1]),{type:"link",raw:a[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}},t.url=function(e,t){var n;if(n=this.rules.inline.url.exec(e)){var r,a;if("@"===n[2])a="mailto:"+(r=O(this.options.mangle?t(n[0]):n[0]));else{var i;do{i=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])[0]}while(i!==n[0]);r=O(n[0]),a="www."===n[1]?"http://"+r:r}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}},t.inlineText=function(e,t,n){var r,a=this.rules.inline.text.exec(e);if(a)return r=t?this.options.sanitize?this.options.sanitizer?this.options.sanitizer(a[0]):O(a[0]):a[0]:O(this.options.smartypants?n(a[0]):a[0]),{type:"text",raw:a[0],text:r}},e}(),q=A,U=E,L=F,N={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}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:q,table:q,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/,_label:/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,_title:/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/};N.def=U(N.def).replace("label",N._label).replace("title",N._title).getRegex(),N.bullet=/(?:[*+-]|\d{1,9}[.)])/,N.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,N.item=U(N.item,"gm").replace(/bull/g,N.bullet).getRegex(),N.listItemStart=U(/^( *)(bull) */).replace("bull",N.bullet).getRegex(),N.list=U(N.list).replace(/bull/g,N.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+N.def.source+")").getRegex(),N._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",N._comment=/|$)/,N.html=U(N.html,"i").replace("comment",N._comment).replace("tag",N._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),N.paragraph=U(N._paragraph).replace("hr",N.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",N._tag).getRegex(),N.blockquote=U(N.blockquote).replace("paragraph",N.paragraph).getRegex(),N.normal=L({},N),N.gfm=L({},N.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),N.gfm.nptable=U(N.gfm.nptable).replace("hr",N.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",")|<(?:script|pre|style|textarea|!--)").replace("tag",N._tag).getRegex(),N.gfm.table=U(N.gfm.table).replace("hr",N.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",")|<(?:script|pre|style|textarea|!--)").replace("tag",N._tag).getRegex(),N.pedantic=L({},N.normal,{html:U("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",N._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:q,paragraph:U(N.normal._paragraph).replace("hr",N.hr).replace("heading"," *#{1,6} *[^\n]").replace("lheading",N.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var V={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:q,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,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:q,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~"};V.punctuation=U(V.punctuation).replace(/punctuation/g,V._punctuation).getRegex(),V.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,V.escapedEmSt=/\\\*|\\_/g,V._comment=U(N._comment).replace("(?:--\x3e|$)","--\x3e").getRegex(),V.emStrong.lDelim=U(V.emStrong.lDelim).replace(/punct/g,V._punctuation).getRegex(),V.emStrong.rDelimAst=U(V.emStrong.rDelimAst,"g").replace(/punct/g,V._punctuation).getRegex(),V.emStrong.rDelimUnd=U(V.emStrong.rDelimUnd,"g").replace(/punct/g,V._punctuation).getRegex(),V._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,V._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,V._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])?)+(?![-_])/,V.autolink=U(V.autolink).replace("scheme",V._scheme).replace("email",V._email).getRegex(),V._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,V.tag=U(V.tag).replace("comment",V._comment).replace("attribute",V._attribute).getRegex(),V._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,V._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,V._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,V.link=U(V.link).replace("label",V._label).replace("href",V._href).replace("title",V._title).getRegex(),V.reflink=U(V.reflink).replace("label",V._label).getRegex(),V.reflinkSearch=U(V.reflinkSearch,"g").replace("reflink",V.reflink).replace("nolink",V.nolink).getRegex(),V.normal=L({},V),V.pedantic=L({},V.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:U(/^!?\[(label)\]\((.*?)\)/).replace("label",V._label).getRegex(),reflink:U(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",V._label).getRegex()}),V.gfm=L({},V.normal,{escape:U(V.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]*?(?:(?=[\\.5&&(n="x"+n.toString(16)),r+="&#"+n+";";return r}var K=function(){function t(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||G,this.options.tokenizer=this.options.tokenizer||new Z,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var t={block:Y.normal,inline:W.normal};this.options.pedantic?(t.block=Y.pedantic,t.inline=W.pedantic):this.options.gfm&&(t.block=Y.gfm,this.options.breaks?t.inline=W.breaks:t.inline=W.gfm),this.tokenizer.rules=t}t.lex=function(e,n){return new t(n).lex(e)},t.lexInline=function(e,n){return new t(n).inlineTokens(e)};var n=t.prototype;return n.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," "),this.blockTokens(e,this.tokens,!0),this.inline(this.tokens),this.tokens},n.blockTokens=function(e,t,n){var r,a,i,o,s,u,l=this;for(void 0===t&&(t=[]),void 0===n&&(n=!0),this.options.pedantic&&(e=e.replace(/^ +$/gm,""));e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some((function(n){return!!(r=n.call(l,e,t))&&(e=e.substring(r.raw.length),t.push(r),!0)}))))if(r=this.tokenizer.space(e))e=e.substring(r.raw.length),r.type&&t.push(r);else if(r=this.tokenizer.code(e))e=e.substring(r.raw.length),(o=t[t.length-1])&&"paragraph"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r);else if(r=this.tokenizer.fences(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.heading(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.nptable(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.hr(e))e=e.substring(r.raw.length),t.push(r);else if(r=this.tokenizer.blockquote(e))e=e.substring(r.raw.length),r.tokens=this.blockTokens(r.text,[],n),t.push(r);else if(r=this.tokenizer.list(e)){for(e=e.substring(r.raw.length),i=r.items.length,a=0;a=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(s=e.substring(0,t+1))}(),n&&(r=this.tokenizer.paragraph(s)))o=t[t.length-1],u&&"paragraph"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r),u=s.length!==e.length,e=e.substring(r.raw.length);else if(r=this.tokenizer.text(e))e=e.substring(r.raw.length),(o=t[t.length-1])&&"text"===o.type?(o.raw+="\n"+r.raw,o.text+="\n"+r.text):t.push(r);else if(e){var c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}throw new Error(c)}return t},n.inline=function(e){var t,n,r,a,i,o,s=e.length;for(t=0;t0)for(;null!=(u=this.tokenizer.rules.inline.reflinkSearch.exec(d));)p.includes(u[0].slice(u[0].lastIndexOf("[")+1,-1))&&(d=d.slice(0,u.index)+"["+J("a",u[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(u=this.tokenizer.rules.inline.blockSkip.exec(d));)d=d.slice(0,u.index)+"["+J("a",u[0].length-2)+"]"+d.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;null!=(u=this.tokenizer.rules.inline.escapedEmSt.exec(d));)d=d.slice(0,u.index)+"++"+d.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;e;)if(l||(c=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some((function(n){return!!(a=n.call(s,e,t))&&(e=e.substring(a.raw.length),t.push(a),!0)}))))if(a=this.tokenizer.escape(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.tag(e,n,r))e=e.substring(a.raw.length),n=a.inLink,r=a.inRawBlock,(i=t[t.length-1])&&"text"===a.type&&"text"===i.type?(i.raw+=a.raw,i.text+=a.text):t.push(a);else if(a=this.tokenizer.link(e))e=e.substring(a.raw.length),"link"===a.type&&(a.tokens=this.inlineTokens(a.text,[],!0,r)),t.push(a);else if(a=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(a.raw.length),i=t[t.length-1],"link"===a.type?(a.tokens=this.inlineTokens(a.text,[],!0,r),t.push(a)):i&&"text"===a.type&&"text"===i.type?(i.raw+=a.raw,i.text+=a.text):t.push(a);else if(a=this.tokenizer.emStrong(e,d,c))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.codespan(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.br(e))e=e.substring(a.raw.length),t.push(a);else if(a=this.tokenizer.del(e))e=e.substring(a.raw.length),a.tokens=this.inlineTokens(a.text,[],n,r),t.push(a);else if(a=this.tokenizer.autolink(e,X))e=e.substring(a.raw.length),t.push(a);else if(n||!(a=this.tokenizer.url(e,X))){if(o=e,this.options.extensions&&this.options.extensions.startInline&&function(){var t=1/0,n=e.slice(1),r=void 0;s.options.extensions.startInline.forEach((function(e){"number"==typeof(r=e.call(this,n))&&r>=0&&(t=Math.min(t,r))})),t<1/0&&t>=0&&(o=e.substring(0,t+1))}(),a=this.tokenizer.inlineText(o,r,Q))e=e.substring(a.raw.length),"_"!==a.raw.slice(-1)&&(c=a.raw.slice(-1)),l=!0,(i=t[t.length-1])&&"text"===i.type?(i.raw+=a.raw,i.text+=a.text):t.push(a);else if(e){var h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(h);break}throw new Error(h)}}else e=e.substring(a.raw.length),t.push(a);return t},e(t,0,[{key:"rules",get:function(){return{block:Y,inline:W}}}]),t}(),ee=r.exports.defaults,te=k,ne=w,re=function(){function e(e){this.options=e||ee}var t=e.prototype;return t.code=function(e,t,n){var r=(t||"").match(/\S*/)[0];if(this.options.highlight){var a=this.options.highlight(e,r);null!=a&&a!==e&&(n=!0,e=a)}return e=e.replace(/\n$/,"")+"\n",r?'
'+(n?e:ne(e,!0))+"
\n":"
"+(n?e:ne(e,!0))+"
\n"},t.blockquote=function(e){return"
\n"+e+"
\n"},t.html=function(e){return e},t.heading=function(e,t,n,r){return this.options.headerIds?"'+e+"\n":""+e+"\n"},t.hr=function(){return this.options.xhtml?"
\n":"
\n"},t.list=function(e,t,n){var r=t?"ol":"ul";return"<"+r+(t&&1!==n?' start="'+n+'"':"")+">\n"+e+"\n"},t.listitem=function(e){return"
  • "+e+"
  • \n"},t.checkbox=function(e){return" "},t.paragraph=function(e){return"

    "+e+"

    \n"},t.table=function(e,t){return t&&(t=""+t+""),"\n\n"+e+"\n"+t+"
    \n"},t.tablerow=function(e){return"\n"+e+"\n"},t.tablecell=function(e,t){var n=t.header?"th":"td";return(t.align?"<"+n+' align="'+t.align+'">':"<"+n+">")+e+"\n"},t.strong=function(e){return""+e+""},t.em=function(e){return""+e+""},t.codespan=function(e){return""+e+""},t.br=function(){return this.options.xhtml?"
    ":"
    "},t.del=function(e){return""+e+""},t.link=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var r='"},t.image=function(e,t,n){if(null===(e=te(this.options.sanitize,this.options.baseUrl,e)))return n;var r=''+n+'":">"},t.text=function(e){return e},e}(),ae=function(){function e(){}var t=e.prototype;return t.strong=function(e){return e},t.em=function(e){return e},t.codespan=function(e){return e},t.del=function(e){return e},t.html=function(e){return e},t.text=function(e){return e},t.link=function(e,t,n){return""+n},t.image=function(e,t,n){return""+n},t.br=function(){return""},e}(),ie=function(){function e(){this.seen={}}var t=e.prototype;return t.serialize=function(e){return e.toLowerCase().trim().replace(/<[!\/a-z].*?>/gi,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},t.getNextSafeSlug=function(e,t){var n=e,r=0;if(this.seen.hasOwnProperty(n)){r=this.seen[e];do{n=e+"-"+ ++r}while(this.seen.hasOwnProperty(n))}return t||(this.seen[e]=r,this.seen[n]=0),n},t.slug=function(e,t){void 0===t&&(t={});var n=this.serialize(e);return this.getNextSafeSlug(n,t.dryrun)},e}(),oe=re,se=ae,ue=ie,le=r.exports.defaults,ce=C,de=K,pe=function(){function e(e){this.options=e||le,this.options.renderer=this.options.renderer||new oe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new se,this.slugger=new ue}e.parse=function(t,n){return new e(n).parse(t)},e.parseInline=function(t,n){return new e(n).parseInline(t)};var t=e.prototype;return t.parse=function(e,t){void 0===t&&(t=!0);var n,r,a,i,o,s,u,l,c,d,p,h,f,g,m,_,b,v,D,y="",w=e.length;for(n=0;n0&&"text"===m.tokens[0].type?(m.tokens[0].text=v+" "+m.tokens[0].text,m.tokens[0].tokens&&m.tokens[0].tokens.length>0&&"text"===m.tokens[0].tokens[0].type&&(m.tokens[0].tokens[0].text=v+" "+m.tokens[0].tokens[0].text)):m.tokens.unshift({type:"text",text:v}):g+=v),g+=this.parse(m.tokens,f),c+=this.renderer.listitem(g,b,_);y+=this.renderer.list(c,p,h);continue;case"html":y+=this.renderer.html(d.text);continue;case"paragraph":y+=this.renderer.paragraph(this.parseInline(d.tokens));continue;case"text":for(c=d.tokens?this.parseInline(d.tokens):d.text;n+1An error occurred:

    "+ve(u.message+"",!0)+"
    ";throw u}}return Ce.options=Ce.setOptions=function(e){return _e(Ce.defaults,e),ye(Ce.defaults),Ce},Ce.getDefaults=De,Ce.defaults=we,Ce.use=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;rAn error occurred:

    "+ve(r.message+"",!0)+"
    ";throw r}},Ce.Parser=pe,Ce.parser=pe.parse,Ce.Renderer=fe,Ce.TextRenderer=ge,Ce.Lexer=de,Ce.lexer=de.lex,Ce.Tokenizer=he,Ce.Slugger=me,Ce.parse=Ce,Ce}();const Br=t(Tr),zr=new Ir,{map:Mr}=Array.prototype,Pr=["A","UL","OL","LI","STRONG","EM","BR","DEL","CODE","PRE"],Or=new Tr.Renderer;Or.link=function(e,t,n){const r=zr.match(n);return r&&r.length>1?n:'
    '+n+""};const jr=new Tr.Renderer;Object.assign(jr,Or),jr.list=function(e,t,n){let r=n;return e.replace(Rr,()=>t?r+++". ":"- ")},jr.listitem=function(e){return""+Rr+e};const Rr="%list-item%",$r=e=>e.replace(/\n+$/,"");function qr(e,t,n){if(function(e,t){let n=e.parentNode;for(;n;){if(n.nodeName===t)return!0;n=n.parentNode}return!1}(e,"A"))return e.textContent;if(null===e.textContent)return null;const r=zr.match(e.textContent);if(!r||0===r.length)return e.textContent;const[a]=Array.from(r).reduce((t,a,i)=>{let[o,s]=t;return o.push(e.textContent.slice(s,a.index),u.createElement(null!=n?n:"a",{href:a.url,target:"_blank",rel:"nofollow noopener"},a.text)),i===r.length-1&&o.push(e.textContent.slice(a.lastIndex)),[o,a.lastIndex]},[[],0]);return u.createElement(u.Fragment,{key:t},...a)}function Ur(e){const t=Br(e,{renderer:jr}),n=new DOMParser,{body:r}=n.parseFromString(t,"text/html");return r?$r(r.textContent||""):""}const Lr=e=>{var t,n;let{template:r,root:a,preserveLists:i,limit:o,linkComponent:s=null}=e;const l=null!=(t=null==a?void 0:a.props)?t:{},c=null!=(n=null==a?void 0:a.component)?n:u.Fragment,d=u.useMemo(()=>{try{const e=new DOMParser,t=$r(Br(r,i?{renderer:jr}:{renderer:Or})),{body:n}=e.parseFromString(t,"text/html");return n?function(e,t,n){let r=0,a=!1;const i=e=>Mr.call(e,(e,o)=>{if("#text"===e.nodeName)return n?a?null:e.textContent&&e.textContent.length+r{let{id:t,serverId:n=null,active:r=!0,participants:a=[],properties:i}=e;if("string"!=typeof t)throw new Error("Chat ID has to be a string.");if(null!==n&&t!==n)throw new Error('If serverId is given ("'+n+'") it should match id ("'+t+'").');return{id:t,serverId:n,active:r,participants:a,properties:i}},Hr=e=>{let{id:t,type:n,author:r,timestamp:a,own:i,serverId:o=null,thread:s=null,serverTimestamp:u=null,delivered:l=!0,seen:c=!1,failed:d=!1,properties:p={}}=e;if("string"!=typeof t)throw new Error("Event ID has to be a string.");if("string"!=typeof n)throw new Error("Event has to have string `type` property.");if(null!==o&&t!==o)throw new Error('If serverId is given ("'+o+'") it should match id ("'+t+'").');return{id:t,serverId:o,type:n,thread:s,author:r,own:i,timestamp:a,serverTimestamp:u,delivered:l,seen:c,failed:d,properties:p}},Zr=e=>{let{id:t,serverId:n=t,type:r=null,name:a=null,email:i=null,avatar:o=null,properties:s={}}=e;if("string"!=typeof t)throw new Error("User ID has to be a string.");return{id:t,serverId:n,type:r,name:a,email:i,avatar:o,properties:s}};function Gr(e,t){return e===t}function Yr(e,t,n){if(null===t||null===n||t.length!==n.length)return!1;for(var r=t.length,a=0;a1&&void 0!==arguments[1]?arguments[1]:Gr,n=null,r=null;return function(){return Yr(t,n,arguments)||(r=e.apply(null,arguments)),n=arguments,r}}function Jr(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){return typeof e})).join(", ");throw new Error("Selector creators expect all input-selectors to be functions, instead received the following types: ["+n+"]")}return t}var Qr=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r1&&void 0!==arguments[1]?arguments[1]:{},a=void 0,i=void 0;"function"==typeof n?(console.warn('[re-reselect] Deprecation warning: "selectorCreator" argument is discouraged and will be removed in the upcoming major release. Please use "options.selectorCreator" instead.'),a=new r,i=n):(a=n.cacheObject||new r,i=n.selectorCreator||Qr);var o=function(){var n=e.apply(void 0,arguments);if("string"==typeof n||"number"==typeof n){var r=a.get(n);return void 0===r&&(r=i.apply(void 0,t),a.set(n,r)),r.apply(void 0,arguments)}};return o.getMatchingSelector=function(){var t=e.apply(void 0,arguments);return a.get(t)},o.removeMatchingSelector=function(){var t=e.apply(void 0,arguments);a.remove(t)},o.clearCache=function(){a.clear()},o.resultFunc=t[t.length-1],o}}const ea=(e,t)=>t,ta=(e,t)=>Ae(t.replace(/\//gi,"."),e.views),na=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;re.views.current,aa=e=>e.session.connectionState,ia=e=>e.entities.chats.byIds,oa=(e,t)=>ia(e)[t],sa=(e,t,n)=>oa(e,t).events.byIds[n],ua=(e,t,n)=>sa(e,t,oa(e,t).events.serverIdsMapping[n]),la=(e,t,n)=>!!sa(e,t,n),ca=(e,t)=>oa(e,t).events.byIds,da=Kr([(e,t)=>oa(e,t).events.orderedIds,ca],(e,t)=>e.map(e=>t[e]))(ea),pa=Kr([oa,da],(e,t)=>({...e,events:t}))(ea),ha=(e,t)=>!!oa(e,t),fa=e=>fe(t=>{let{id:n}=t;return pa(e,n)},ia(e)),ga=e=>e.entities.users.byIds,ma=e=>ga(e)[(e=>e.session.id)(e)],_a=(e,t)=>ga(e)[t],ba=(e,t)=>!!_a(e,t),va=(e,t)=>{var n;return null==(n=e.views)?void 0:n.Chat[t].timeline},Da=e=>ma(e).id,ya=Kr([da,Da],(e,t)=>ve(e=>{let{delivered:n,author:r}=e;return n&&r===t},e))(ea),wa=Kr([da,Da],(e,t)=>ve(e=>{let{seen:n,author:r}=e;return n&&r===t},e))(ea),Ca={boosters:!0,form:!0,system_message:!0},Ea=Qr([da,e=>ma(e).id],(e,t)=>ye(e=>{const n=e.author===t&&"message"===e.type,r=!!e.properties&&"file"===e.properties.serverType,a=!0===e.seen&&!Ca[e.type]&&Boolean(e.serverId);return n&&!r||a},e)),ka=(e,t)=>e.author!==t&&!e.seen&&!Ca[e.type],Aa=(e,t)=>{const n=Ea(e,t),r=ma(e).id;return da(e,t).slice(n+1).filter(e=>ka(e,r))},Fa=(e,t)=>Se(Aa(e,t)),xa=Kr([(e,t)=>oa(e,t).participants,ga],(e,t)=>e.map(e=>t[e]))(ea);function Ia(e,t){if(void 0===t)return e.application;const n=t;return e.application[n]}const Sa=Object.freeze(Object.defineProperty({__proto__:null,getApplicationState:Ia,getChat:pa,getChatByServerId:(e,t)=>pa(e,e.entities.chats.serverIdsMapping[t]),getChatList:e=>{var t;return null==(t=e.views)?void 0:t.ChatList},getChats:fa,getConnectionState:aa,getCurrentView:ra,getDefaultView:na,getEvent:sa,getEventByServerId:ua,getEvents:da,getIndexedEvents:ca,getLastDeliveredEvent:ya,getLastEvent:(e,t)=>Se(da(e,t)),getLastSeenAgentEvent:(e,t)=>{const n=Ea(e,t);if(-1===n)return null;const r=ma(e).id;return _e(e=>ka(e,r),da(e,t).slice(n+1))},getLastSeenEvent:wa,getLastUnseenEvent:Fa,getParticipants:xa,getSessionUser:ma,getSessionUserId:Da,getTimeline:va,getUnseenCount:(e,t)=>Aa(e,t).length,getUser:_a,getUserByServerId:(e,t)=>_a(e,e.entities.users.serverIdsMapping[t]),getUsers:ga,getView:ta,hasChat:ha,hasEvent:la,hasEventByServerId:(e,t,n)=>!!ua(e,t,n),hasUser:ba,localize:(e,t,n,r)=>{let a=e.localization[t];const i=e.application.language;if(void 0===a)return"";if("object"==typeof a&&i){const e=new Intl.PluralRules(i);if(void 0===r)return a[e.select(1)];const t=e.select(r);if(!(t in a))return"";a=a[t]}return n?Object.keys(n).reduce((e,t)=>e.replace(new RegExp("%"+t+"%","g"),n[t]),a):a}},Symbol.toStringTag,{value:"Module"})),Ta=["delivered","failed","properties","seen","serverTimestamp","thread"],Ba=(e,t)=>e.forEach(e=>{if(i(e,t))throw new Error("Updating `"+e+"` property is not possible.")}),za=rn("ADD_VIEW",(function(e,t,n){let{action:r,getState:a}=e;if(void 0===n&&(n={}),ta(a(),t))throw new Error('There is already the "'+t+'" view. It has to be unique.');return r({name:t,data:n}),ta(a(),t)})),Ma=rn("SET_CURRENT_VIEW",(e,t)=>{let{action:n,getState:r}=e;if(!ta(r(),t)){const e=na(r());if(!e)throw new Error('Given view "'+t+"\" doesn't exist.");return n({name:e}),ra(r())}return n({name:t}),ra(r())}),Pa=rn("UPDATE_VIEW",(e,t,n)=>{let{action:r,getState:a}=e;if(!ta(a(),t))throw new Error('There is no "'+t+'" view. You should add it first.');return r({name:t,data:n}),ta(a(),t)}),Oa=rn("SET_DEFAULT_VIEW",(e,t,n)=>{let{action:r,getState:a}=e;return r({name:n,path:t}),ta(a(),t+"/"+n)}),ja=rn("ADD_CHAT",(e,t)=>{let{action:n,getState:r}=e;const{events:a=[],...i}=t;if(i.id&&ha(r(),i.id))throw new Error('There is already a chat with "'+i.id+'" ID. It has to be unique.');const o=_e(e=>!ba(r(),e),a.map(e=>e.author).concat(i.participants||[]));if(o)throw new Error('Given user ("'+o+"\") doesn't exist. You should add it first.");const s=i.id||ke(fa(r()));return n({id:s,chat:Vr({...i,id:s}),events:a.map(Hr)}),pa(r(),s)}),Ra=rn("ADD_EVENT",(e,t,n)=>{var r;let{action:a,getState:i}=e;const{id:o,serverId:s}=n,u=i();if(o&&s&&o!==s)throw new Error('Specified ID ("'+o+'") differs from specified serverId ("'+s+'"). You either should use only ID or both should be the same.');if(!ha(u,t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(la(u,t,o))throw new Error('There is already an event with "'+o+'" ID in this chat ("'+t+'"). It has to be unique.');if(!ba(u,n.author))throw new Error('Specified author ("'+n.author+"\") doesn't exist. You should add it first.");return a({id:o,chat:t,event:Hr({...n,timestamp:null!=(r=n.timestamp)?r:Date.now(),own:n.author===Da(u)})}),sa(i(),t,o)}),$a=rn("REMOVE_EVENT",(e,t,n)=>{let{action:r,getState:a}=e;const i=a();if(!ha(i,t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(!la(i,t,n))throw new Error('There is no event with "'+n+'" ID in this chat ("'+t+'").');r({id:n,chat:t})}),qa=rn("ADD_HISTORY_EVENTS",(e,t,n)=>{let{action:r,getState:a}=e;const i=a();if(!ha(i,t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');n.forEach(e=>{if(la(i,t,e.id))throw new Error('There is already an event with "'+e.id+'" ID in this chat ("'+t+'"). It has to be unique.');if(!ba(i,e.author))throw new Error('Specified author ("'+e.author+"\") doesn't exist. You should add it first.")});const o=Da(i);r({chat:t,events:n.map(e=>Hr({...e,serverId:e.id,own:e.author===o}))})}),Ua=rn("ADD_PARTICIPANT",(e,t,n)=>{let{action:r,getState:a}=e;if(!ha(a(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(!ba(a(),n))throw new Error('Given user ("'+n+"\") doesn't exist. You should add it first.");return r({chat:t,user:n}),xa(a(),t)}),La=rn("ADD_USER",(e,t)=>{let{action:n,getState:r}=e;const{id:a}=t;if(ba(r(),a))throw new Error('There is already a user with "'+a+'" ID. It has to be unique.');return n({id:a,user:Zr(t)}),_a(r(),a)}),Na=rn("FLUSH_CHAT",(e,t)=>{let{action:n,getState:r}=e;if(!ha(r(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');return n({id:t}),pa(r(),t)}),Va=rn("RECALCULATE_TIMELINE",(e,t)=>{let{action:n,getState:r}=e;if(!ha(r(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');return n({id:t}),va(r(),t)}),Ha=rn("REMOVE_PARTICIPANT",(e,t,n)=>{let{action:r,getState:a}=e;if(!ha(a(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(!ba(a(),n))throw new Error('Given user ("'+n+"\") doesn't exist. You should add it first.");return r({chat:t,user:n}),xa(a(),t)}),Za=rn("SEND_EVENT",(e,t,n,r)=>{let{action:a,getState:i}=e;if(!ha(i(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(la(i(),t,n.id))throw new Error('There is already an event with "'+n.id+'" ID in this chat ("'+t+'"). It has to be unique.');const o=n.id||ke(ca(i(),t));return a({id:o,chat:t,event:Hr({...n,author:ma(i()).id,own:!0,id:o,timestamp:Date.now(),delivered:!1})},r),sa(i(),t,o)}),Ga=rn("SET_APPLICATION_STATE",(e,t)=>{let{action:n,getApplicationState:r}=e;if(!t||xe(t))throw new Error("Given data object is empty.");return n(t),r()}),Ya=rn("UPDATE_FEATURE",(e,t,n)=>{let{action:r,getApplicationState:a}=e;if(!n||!t||xe(n))throw new Error("Given data object is empty.");return r({feature:t,data:n}),a()}),Wa=rn("SET_CONNECTION_STATE",(e,t)=>{let{action:n,getState:r}=e;return n({connectionState:t}),aa(r())}),Ja=rn("SET_CHAT_SERVER_ID",(e,t,n)=>{let{action:r,getState:a}=e;if(!ha(a(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(null!==pa(a(),t).serverId)throw new Error('Chat with "'+t+'" ID has already serverId.');return r({id:t,serverId:n}),pa(a(),t)}),Qa=rn("SET_EVENT_DATA",(e,t,n,r)=>{let{action:a,getState:i}=e;if(!ha(i(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(!la(i(),t,n))throw new Error('There is no "'+n+'" event in "'+t+'" chat. You should add it first.');return Ba(["id","type","own"],r),a({chat:t,id:n,data:{...qe(Ta.concat("author","serverId","timestamp"),r),own:r.author===Da(i())}}),sa(i(),t,n)}),Xa=rn("SET_EVENT_SERVER_ID",(e,t,n,r)=>{let{action:a,getState:i}=e;if(!ha(i(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(!la(i(),t,n))throw new Error('There is no "'+n+'" event in "'+t+'" chat. You should add it first.');if(null!==sa(i(),t,n).serverId)throw new Error('Event with "'+n+'" ID has already serverId.');return a({chat:t,id:n,serverId:r}),sa(i(),t,n)}),Ka=rn("SET_LOCALIZATION",(e,t)=>{let{action:n}=e;n(t)}),ei=rn("SET_USER_SERVER_ID",(e,t,n)=>{let{action:r,getState:a}=e;if(!ba(a(),t))throw new Error('There is no "'+t+'" user. You should add it first.');if(null!==_a(a(),t).serverId)throw new Error('User with "'+t+'" ID has already serverId.');return r({id:t,serverId:n}),_a(a(),t)}),{actionMethod:ti,requestActionMethod:ni}=an("SET_USER_PROPERTIES",(e,t,n)=>{let{action:r,getState:a}=e;if(!ba(a(),t))throw new Error('There is no user with "'+t+'" ID. You should add it first.');return r({id:t,properties:n}),_a(a(),t)}),{actionMethod:ri,requestActionMethod:ai}=an("UPDATE_CHAT",(e,t,n,r)=>{let{action:a,getState:i}=e;if(!ha(i(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');return Ba(["id","participants","events"],n),a({id:t,data:qe(["active","properties"],n)},r),pa(i(),t)}),{actionMethod:ii,requestActionMethod:oi}=an("UPDATE_EVENT",(e,t,n,r)=>{let{action:a,getState:i}=e;if(!ha(i(),t))throw new Error('There is no chat with "'+t+'" ID. You should add it first.');if(!la(i(),t,n))throw new Error('There is no "'+n+'" event in "'+t+'" chat. You should add it first.');return Ba(["id","type","author","own","timestamp"],r),a({chat:t,id:n,data:qe(Ta,r)}),sa(i(),t,n)}),{actionMethod:si,requestActionMethod:ui}=an("UPDATE_USER",(e,t,n)=>{let{action:r,getState:a}=e;if(!ba(a(),t))throw new Error('There is no user with "'+t+'" ID. You should add it first.');return Ba(["id","type"],n),r({id:t,data:qe(["name","email","avatar","properties"],n)}),_a(a(),t)}),li=Object.freeze(Object.defineProperty({__proto__:null,addChat:ja,addEvent:Ra,addHistoryEvents:qa,addParticipant:Ua,addUser:La,addView:za,flushChat:Na,recalculateTimeline:Va,removeEvent:$a,removeParticipant:Ha,requestSetUserProperties:ni,requestUpdateChat:ai,requestUpdateEvent:oi,requestUpdateUser:ui,sendEvent:Za,setApplicationState:Ga,setChatServerId:Ja,setConnectionState:Wa,setCurrentView:Ma,setDefaultView:Oa,setEventData:Qa,setEventServerId:Xa,setLocalization:Ka,setUserProperties:ti,setUserServerId:ei,updateChat:ri,updateEvent:ii,updateFeature:Ya,updateUser:si,updateView:Pa},Symbol.toStringTag,{value:"Module"}));function ci(){}function di(){}di.resetWarningCache=ci;!function(){function e(e,t,n,r,a,i){if("SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"!==i){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:di,resetWarningCache:ci};n.PropTypes=n}();var pi=function(e){e()},hi=function(){return pi},fi={exports:{}},gi={}; /** @license React v16.7.0 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ Object.defineProperty(gi,"__esModule",{value:!0});var mi="function"==typeof Symbol&&Symbol.for,_i=mi?Symbol.for("react.element"):60103,bi=mi?Symbol.for("react.portal"):60106,vi=mi?Symbol.for("react.fragment"):60107,Di=mi?Symbol.for("react.strict_mode"):60108,yi=mi?Symbol.for("react.profiler"):60114,wi=mi?Symbol.for("react.provider"):60109,Ci=mi?Symbol.for("react.context"):60110,Ei=mi?Symbol.for("react.async_mode"):60111,ki=mi?Symbol.for("react.concurrent_mode"):60111,Ai=mi?Symbol.for("react.forward_ref"):60112,Fi=mi?Symbol.for("react.suspense"):60113,xi=mi?Symbol.for("react.memo"):60115,Ii=mi?Symbol.for("react.lazy"):60116;function Si(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case _i:switch(e=e.type){case Ei:case ki:case vi:case yi:case Di:case Fi:return e;default:switch(e=e&&e.$$typeof){case Ci:case Ai:case wi:return e;default:return t}}case Ii:case xi:case bi:return t}}}function Ti(e){return Si(e)===ki}gi.typeOf=Si,gi.AsyncMode=Ei,gi.ConcurrentMode=ki,gi.ContextConsumer=Ci,gi.ContextProvider=wi,gi.Element=_i,gi.ForwardRef=Ai,gi.Fragment=vi,gi.Lazy=Ii,gi.Memo=xi,gi.Portal=bi,gi.Profiler=yi,gi.StrictMode=Di,gi.Suspense=Fi,gi.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===vi||e===ki||e===yi||e===Di||e===Fi||"object"==typeof e&&null!==e&&(e.$$typeof===Ii||e.$$typeof===xi||e.$$typeof===wi||e.$$typeof===Ci||e.$$typeof===Ai)},gi.isAsyncMode=function(e){return Ti(e)||Si(e)===Ei},gi.isConcurrentMode=Ti,gi.isContextConsumer=function(e){return Si(e)===Ci},gi.isContextProvider=function(e){return Si(e)===wi},gi.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===_i},gi.isForwardRef=function(e){return Si(e)===Ai},gi.isFragment=function(e){return Si(e)===vi},gi.isLazy=function(e){return Si(e)===Ii},gi.isMemo=function(e){return Si(e)===xi},gi.isPortal=function(e){return Si(e)===bi},gi.isProfiler=function(e){return Si(e)===yi},gi.isStrictMode=function(e){return Si(e)===Di},gi.isSuspense=function(e){return Si(e)===Fi},fi.exports=gi;var Bi=fi.exports,zi={};zi[Bi.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},zi[Bi.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};var Mi,Pi={},Oi="function"==typeof Symbol&&Symbol.for,ji=Oi?Symbol.for("react.element"):60103,Ri=Oi?Symbol.for("react.portal"):60106,$i=Oi?Symbol.for("react.fragment"):60107,qi=Oi?Symbol.for("react.strict_mode"):60108,Ui=Oi?Symbol.for("react.profiler"):60114,Li=Oi?Symbol.for("react.provider"):60109,Ni=Oi?Symbol.for("react.context"):60110,Vi=Oi?Symbol.for("react.async_mode"):60111,Hi=Oi?Symbol.for("react.concurrent_mode"):60111,Zi=Oi?Symbol.for("react.forward_ref"):60112,Gi=Oi?Symbol.for("react.suspense"):60113,Yi=Oi?Symbol.for("react.suspense_list"):60120,Wi=Oi?Symbol.for("react.memo"):60115,Ji=Oi?Symbol.for("react.lazy"):60116,Qi=Oi?Symbol.for("react.block"):60121,Xi=Oi?Symbol.for("react.fundamental"):60117,Ki=Oi?Symbol.for("react.responder"):60118,eo=Oi?Symbol.for("react.scope"):60119; /** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */function to(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case ji:switch(e=e.type){case Vi:case Hi:case $i:case Ui:case qi:case Gi:return e;default:switch(e=e&&e.$$typeof){case Ni:case Zi:case Ji:case Wi:case Li:return e;default:return t}}case Ri:return t}}}function no(e){return to(e)===Hi}Pi.AsyncMode=Vi,Pi.ConcurrentMode=Hi,Pi.ContextConsumer=Ni,Pi.ContextProvider=Li,Pi.Element=ji,Pi.ForwardRef=Zi,Pi.Fragment=$i,Pi.Lazy=Ji,Pi.Memo=Wi,Pi.Portal=Ri,Pi.Profiler=Ui,Pi.StrictMode=qi,Pi.Suspense=Gi,Pi.isAsyncMode=function(e){return no(e)||to(e)===Vi},Pi.isConcurrentMode=no,Pi.isContextConsumer=function(e){return to(e)===Ni},Pi.isContextProvider=function(e){return to(e)===Li},Pi.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===ji},Pi.isForwardRef=function(e){return to(e)===Zi},Pi.isFragment=function(e){return to(e)===$i},Pi.isLazy=function(e){return to(e)===Ji},Pi.isMemo=function(e){return to(e)===Wi},Pi.isPortal=function(e){return to(e)===Ri},Pi.isProfiler=function(e){return to(e)===Ui},Pi.isStrictMode=function(e){return to(e)===qi},Pi.isSuspense=function(e){return to(e)===Gi},Pi.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===$i||e===Hi||e===Ui||e===qi||e===Gi||e===Yi||"object"==typeof e&&null!==e&&(e.$$typeof===Ji||e.$$typeof===Wi||e.$$typeof===Li||e.$$typeof===Ni||e.$$typeof===Zi||e.$$typeof===Xi||e.$$typeof===Ki||e.$$typeof===eo||e.$$typeof===Qi)},Pi.typeOf=to,Mi=l.unstable_batchedUpdates,pi=Mi;const ro="connected",ao="disconnected",io="fakely_connected",oo="reconnecting",so="scheduled_reconnecting",uo="liveChatChatId",lo="openAIChatId",co="email_prompt",po="message_draft",ho=100,fo=20,go="Invalid `chat.id`",mo="Move chat to mobile",_o={labs:"https://mobile-chat.labs.livechat.com/chat-widget-moment/",staging:"https://mobile-chat.staging.livechat.com/chat-widget-moment/",production:"https://mobile-chat.livechat.com/chat-widget-moment/"},bo=1500,vo=100,Do="before_send_message",yo=/^\s+$/,wo=/^(?:\s+|[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0]|\ud83c[\udffb-\udfff])?)*/;function Co(e){let t=null,n=0;for(;t=wo.exec(e);){const r=t[0];if(e=e.slice(r.length),yo.test(r)||n++,n>3)return!1}return!e}const Eo=["xS94WbAZR","pJw7AxJZg"],ko=["DfltarqcrRoA5ZoZ","UsDoxZQESkzF0qds"];function Ao(e){return Eo.includes(e)}function Fo(e){return ko.includes(e)}const xo="not_ready",Io="ready",So="bootstrapped",To="chatbotChatId",Bo="chatbot-agent",zo=18e5,Mo=1e3,Po=["failed","cancelled","expired"],Oo="openai_bot",jo="https://cdn.files-text.com/api/ow/img/integrations/openai/orb.gif",Ro=6;function $o(){return($o=Object.assign||function(e){for(var t=1;t=0&&a<1?(s=i,u=o):a>=1&&a<2?(s=o,u=i):a>=2&&a<3?(u=i,l=o):a>=3&&a<4?(u=o,l=i):a>=4&&a<5?(s=o,l=i):a>=5&&a<6&&(s=i,l=o);var c=n-i/2;return r(s+c,u+c,l+c)}var Qo={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};var Xo=/^#[a-fA-F0-9]{6}$/,Ko=/^#[a-fA-F0-9]{8}$/,es=/^#[a-fA-F0-9]{3}$/,ts=/^#[a-fA-F0-9]{4}$/,ns=/^rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)$/i,rs=/^rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i,as=/^hsl\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/i,is=/^hsla\(\s*(\d{0,3}[.]?[0-9]+)\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*,\s*([-+]?[0-9]*[.]?[0-9]+)\s*\)$/i;function os(e){if("string"!=typeof e)throw new Go(3);var t=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return Qo[t]?"#"+Qo[t]:e}(e);if(t.match(Xo))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(Ko)){var n=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:n}}if(t.match(es))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(ts)){var r=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:r}}var a=ns.exec(t);if(a)return{red:parseInt(""+a[1],10),green:parseInt(""+a[2],10),blue:parseInt(""+a[3],10)};var i=rs.exec(t);if(i)return{red:parseInt(""+i[1],10),green:parseInt(""+i[2],10),blue:parseInt(""+i[3],10),alpha:parseFloat(""+i[4])};var o=as.exec(t);if(o){var s="rgb("+Jo(parseInt(""+o[1],10),parseInt(""+o[2],10)/100,parseInt(""+o[3],10)/100)+")",u=ns.exec(s);if(!u)throw new Go(4,t,s);return{red:parseInt(""+u[1],10),green:parseInt(""+u[2],10),blue:parseInt(""+u[3],10)}}var l=is.exec(t);if(l){var c="rgb("+Jo(parseInt(""+l[1],10),parseInt(""+l[2],10)/100,parseInt(""+l[3],10)/100)+")",d=ns.exec(c);if(!d)throw new Go(4,t,c);return{red:parseInt(""+d[1],10),green:parseInt(""+d[2],10),blue:parseInt(""+d[3],10),alpha:parseFloat(""+l[4])}}throw new Go(5)}function ss(e){return function(e){var t,n=e.red/255,r=e.green/255,a=e.blue/255,i=Math.max(n,r,a),o=Math.min(n,r,a),s=(i+o)/2;if(i===o)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var u=i-o,l=s>.5?u/(2-i-o):u/(i+o);switch(i){case n:t=(r-a)/u+(r=1?hs(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new Go(7)}function gs(e){if("object"!=typeof e)throw new Go(8);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha}(e))return fs(e);if(function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return hs(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha}(e))return function(e,t,n,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n&&"number"==typeof r)return"rgba("+Jo(e,t,n)+","+r+")";if("object"==typeof e&&void 0===t&&void 0===n&&void 0===r)return e.alpha>=1?ps(e.hue,e.saturation,e.lightness):"rgba("+Jo(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new Go(2)}(e);if(function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)}(e))return function(e,t,n){if("number"==typeof e&&"number"==typeof t&&"number"==typeof n)return ps(e,t,n);if("object"==typeof e&&void 0===t&&void 0===n)return ps(e.hue,e.saturation,e.lightness);throw new Go(1)}(e);throw new Go(8)}function ms(e){return function e(t,n,r){return function(){var a=r.concat(Array.prototype.slice.call(arguments));return a.length>=n?t.apply(this,a):e(t,n,a)}}(e,e.length,[])}function _s(e,t){if("transparent"===t)return t;var n=ss(t);return gs($o({},n,{hue:n.hue+parseFloat(e)}))}var bs=ms(_s);function vs(e,t,n){return Math.max(e,Math.min(t,n))}function Ds(e,t){if("transparent"===t)return t;var n=ss(t);return gs($o({},n,{lightness:vs(0,1,n.lightness-parseFloat(e))}))}var ys=ms(Ds);function ws(e,t){if("transparent"===t)return t;var n=ss(t);return gs($o({},n,{saturation:vs(0,1,n.saturation-parseFloat(e))}))}var Cs=ms(ws);function Es(e){if("transparent"===e)return 0;var t=os(e),n=Object.keys(t).map((function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)})),r=n[0],a=n[1],i=n[2];return parseFloat((.2126*r+.7152*a+.0722*i).toFixed(3))}function ks(e,t){var n=Es(e),r=Es(t);return parseFloat((n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)).toFixed(2))}function As(e,t){if("transparent"===t)return t;var n=ss(t);return gs($o({},n,{lightness:vs(0,1,n.lightness+parseFloat(e))}))}var Fs=ms(As);function xs(e,t,n){if("transparent"===t)return n;if("transparent"===n)return t;var r=os(t),a=$o({},r,{alpha:"number"==typeof r.alpha?r.alpha:1}),i=os(n),o=$o({},i,{alpha:"number"==typeof i.alpha?i.alpha:1}),s=a.alpha-o.alpha,u=2*parseFloat(e)-1,l=((u*s==-1?u:u+s)/(1+u*s)+1)/2,c=1-l;return fs({red:Math.floor(a.red*l+o.red*c),green:Math.floor(a.green*l+o.green*c),blue:Math.floor(a.blue*l+o.blue*c),alpha:a.alpha+(o.alpha-a.alpha)*(parseFloat(e)/1)})}var Is=ms(xs);function Ss(e,t){return"transparent"===t?t:Is(parseFloat(e),"rgb(0, 0, 0)",t)}var Ts=ms(Ss);function Bs(e,t){return"transparent"===t?t:Is(parseFloat(e),"rgb(255, 255, 255)",t)}var zs=ms(Bs);function Ms(e,t){if("transparent"===t)return t;var n=os(t);return fs($o({},n,{alpha:vs(0,1,(100*("number"==typeof n.alpha?n.alpha:1)-100*parseFloat(e))/100)}))}var Ps=ms(Ms);function Os(e){return void 0===e&&(e=-1),function(t){return function(n,r){if(0===n){var a,i=!1,o=e,s=function(e,t){a(e,t)};!function e(){t(0,(function(t,n){return 0===t?(a=n,i?void s(1):(i=!0,void r(0,s))):2===t&&n&&0!==o?(o--,void e()):void r(t,n)}))}()}}}}function js(){const e=se();return[e,()=>{const t=new Error("Destroyed.");t.code="DESTROYED",e(2,t)}]}const Rs=Ee();let $s=0;const qs=e=>{const t=document.createElement("a");if(t.href=e,t.origin)return"null"===t.origin?"*":t.origin;const n=t.protocol.length>4?t.protocol:window.location.protocol;let r;return r=t.host.length?"80"===t.port||"443"===t.port?t.hostname:t.host:window.location.host,n+"//"+r};function Us(e,t){let{frame:n,targetOrigin:r=qs(n.src),handshakeRetry:a={}}=e;void 0===t&&(t={});const[i,o]=c(t),[s,u]=js(),l=$s++,I=n.contentWindow,S=d(),T=(e,t)=>A(Rs,l,e,t),B=e=>{I.postMessage(e,r)},z=p(f(),h(e=>e.owner===Rs&&e.instance===l),le(s),g),M=m(S,z,T,B),P=p(v(z,B,T(x,o),null),b(a.interval||500),Os(a.count||5),_(1),D(e=>y in e?p(v(z,B,T(F)),C(()=>e.data)):w(()=>e)),le(s),g),O=E(M,S.emit,B,i);return p(P,D(()=>z),k(O)),{api:M,destroy:u,handshake$:P}}function Ls(){return new Promise(e=>{const t=()=>{document.body?e(document.body):setTimeout(t,100)};t()})}function Ns(e){const{parentNode:t}=e;t&&t.removeChild(e)}const Vs=(e,t)=>{const n=document.createElement("iframe");return e.appendChild(n),n.src=t,n};function Hs(e,t){let{onConnected:n,...r}=e;const a=!r.frame,i=(e=>{if(e.frame)return e.frame;const{container:t,url:n}=e;return Vs(t,n)})(r),[o,s]=js();let u;const l=()=>{a&&Ns(i),u?u.destroy():s()};return p(S(i,"load"),D(()=>N((e,n)=>{let a=function(e,t){const{api:n,destroy:r,handshake$:a}=Us(e,t);return{destroy:r,promise:p(a,C(e=>(n.data=e,n.destroy=r,n)),I)}}({...r,frame:i},t);return a.promise.then(e,n),u=a,a.destroy})),Os(),le(o),k(e=>{e.destroy=l,e.frame=i,n(e)})),{destroy:l,frame:i}}function Zs(){return(Zs=Object.assign?Object.assign.bind():function(e){for(var t=1;tn)throw new Error(e+" can not be empty and can only be "+n+" characters long.")},Qs=function(e){if("string"!=typeof(e=Ws(e)))throw new Error("`text` must be a string or a number.");e=e.trim(),Js("`text`",e,1024)},Xs=function(e,t){return new Error('Attribute with key "'+e+'" is invalid. '+t)},Ks=o,eu=Object.freeze({sendMessage:function(e){var t=e.text,n=e.postback;if(Qs(t),void 0!==n){if("string"!=typeof n)throw new Error("`postback` must be a string.");Js("`postback`",n,1024)}},sendSystemMessage:function(e){var t=e.text,n=e.recipients;if(Qs(t),void 0!==n&&-1===Ys.indexOf(n))throw new Error("`recipients` can only be one of: "+Ys+".")},setAttributes:function(e){if(!e||"object"!=typeof e)throw new Error("`attributes` must be a plain object (with shape such as `{ key: 'value' }`).");var t=Object.keys(e);if(t.length>99)throw new Error("The maximum number of attributes is 99.");t.forEach((function(t){var n=Ws(e[t]);if(t=Ws(t),!/^[\w-]{1,128}$/.test(t))throw Xs(t,"Key must be between 1-128 characters long and can only contain alpha-numeric, underscore and dash characters.");if("string"!=typeof n)throw Xs(t,"Value must be a string or a number.");Js("Value",n,1024)}))},setExternalLink:function(e){if("string"==typeof e){if(!/^https:\/\//.test(e))throw new Error("`externalLink` has to be a HTTPS URL.")}else if(null!==e)throw new Error("`externalLink` has to be a string or null.")},setIsFragile:function(e){if("boolean"!=typeof e)throw new Error("`setIsFragile` argument value can not be empty and must be a boolean.")},getIdentityTransferToken:function(){},updateCustomerData:function(e){if(!e)throw new Error("`updateUserData` arguments values can not be empty.");if(e.email&&"string"!=typeof e.email)throw new Error("`updateUserData` argument `email` has to be a string.");if(e.name&&"string"!=typeof e.name)throw new Error("`updateUserData` argument `name` has to be a string.")},close:Ks,setTitle:function(e){if("string"!=typeof e)throw new Error("`setTitle` argument value has to be a string.");Js("`title`",e,1024)}}),tu=function(e){var t=M(e);if(!/chatbot\.com$/.test(t))return e;var n=R($(P(e)));if(!n.p)return e;try{var r=JSON.parse(atob(n.p));return r.url?decodeURIComponent(r.url):e}catch(a){return e}};function nu(e,t){var n,r=tu(e.url),a=T((function(e){return"function"==typeof e}),t),i=a[0],o=a[1],s=Be((function(e,t){return function(){return eu[t].apply(eu,arguments),e.apply(void 0,arguments)}}),i),u=Hs(Zs({},e,{targetOrigin:"*"}),Zs({},o,s,{supportedMethods:Object.keys(s)})),l=u.destroy,c=u.frame;return c.sandbox=Gs,{destroy:l,frame:c,title:(n=r,Ke("moment-title",n)||Xe(n))}}const ru=()=>"feade1d6c3f17748ae4c8d917a1e1068",au=()=>"bb9e5b2f1ab480e4a715977b7b1b4279";var iu=["aaa","aarp","abarth","abb","abbott","abbvie","abc","able","abogado","abudhabi","ac","academy","accenture","accountant","accountants","aco","active","actor","ad","adac","ads","adult","ae","aeg","aero","aetna","af","afamilycompany","afl","africa","ag","agakhan","agency","ai","aig","aigo","airbus","airforce","airtel","akdn","al","alfaromeo","alibaba","alipay","allfinanz","allstate","ally","alsace","alstom","am","americanexpress","americanfamily","amex","amfam","amica","amsterdam","analytics","android","anquan","anz","ao","aol","apartments","app","apple","aq","aquarelle","ar","arab","aramco","archi","army","arpa","art","arte","as","asda","asia","associates","at","athleta","attorney","au","auction","audi","audible","audio","auspost","author","auto","autos","avianca","aw","aws","ax","axa","az","azure","ba","baby","baidu","banamex","bananarepublic","band","bank","bar","barcelona","barclaycard","barclays","barefoot","bargains","baseball","basketball","bauhaus","bayern","bb","bbc","bbt","bbva","bcg","bcn","bd","be","beats","beauty","beer","bentley","berlin","best","bestbuy","bet","bf","bg","bh","bharti","bi","bible","bid","bike","bing","bingo","bio","biz","bj","black","blackfriday","blanco","blockbuster","blog","bloomberg","blue","bm","bms","bmw","bn","bnl","bnpparibas","bo","boats","boehringer","bofa","bom","bond","boo","book","booking","bosch","bostik","boston","bot","boutique","box","br","bradesco","bridgestone","broadway","broker","brother","brussels","bs","bt","budapest","bugatti","build","builders","business","buy","buzz","bv","bw","by","bz","bzh","ca","cab","cafe","cal","call","calvinklein","cam","camera","camp","cancerresearch","canon","capetown","capital","capitalone","car","caravan","cards","care","career","careers","cars","cartier","casa","case","caseih","cash","casino","cat","catering","catholic","cba","cbn","cbre","cbs","cc","cd","ceb","center","ceo","cern","cf","cfa","cfd","cg","ch","chanel","channel","chase","chat","cheap","chintai","christmas","chrome","chrysler","church","ci","cipriani","circle","cisco","citadel","citi","citic","city","cityeats","ck","cl","claims","cleaning","click","clinic","clinique","clothing","cloud","club","clubmed","cm","cn","co","coach","codes","coffee","college","cologne","com","comcast","commbank","community","company","compare","computer","comsec","condos","construction","consulting","contact","contractors","cooking","cookingchannel","cool","coop","corsica","country","coupon","coupons","courses","cr","credit","creditcard","creditunion","cricket","crown","crs","cruise","cruises","csc","cu","cuisinella","cv","cw","cx","cy","cymru","cyou","cz","dabur","dad","dance","data","date","dating","datsun","day","dclk","dds","de","deal","dealer","deals","degree","delivery","dell","deloitte","delta","democrat","dental","dentist","desi","design","dev","dhl","diamonds","diet","digital","direct","directory","discount","discover","dish","diy","dj","dk","dm","dnp","do","docs","doctor","dodge","dog","doha","domains","dot","download","drive","dtv","dubai","duck","dunlop","duns","dupont","durban","dvag","dvr","dz","earth","eat","ec","eco","edeka","edu","education","ee","eg","email","emerck","energy","engineer","engineering","enterprises","epost","epson","equipment","er","ericsson","erni","es","esq","estate","esurance","et","etisalat","eu","eurovision","eus","events","everbank","exchange","expert","exposed","express","extraspace","fage","fail","fairwinds","faith","family","fan","fans","farm","farmers","fashion","fast","fedex","feedback","ferrari","ferrero","fi","fiat","fidelity","fido","film","final","finance","financial","fire","firestone","firmdale","fish","fishing","fit","fitness","fj","fk","flickr","flights","flir","florist","flowers","fly","fm","fo","foo","food","foodnetwork","football","ford","forex","forsale","forum","foundation","fox","fr","free","fresenius","frl","frogans","frontdoor","frontier","ftr","fujitsu","fujixerox","fun","fund","furniture","futbol","fyi","ga","gal","gallery","gallo","gallup","game","games","gap","garden","gb","gbiz","gd","gdn","ge","gea","gent","genting","george","gf","gg","ggee","gh","gi","gift","gifts","gives","giving","gl","glade","glass","gle","global","globo","gm","gmail","gmbh","gmo","gmx","gn","godaddy","gold","goldpoint","golf","goo","goodhands","goodyear","goog","google","gop","got","gov","gp","gq","gr","grainger","graphics","gratis","green","gripe","grocery","group","gs","gt","gu","guardian","gucci","guge","guide","guitars","guru","gw","gy","hair","hamburg","hangout","haus","hbo","hdfc","hdfcbank","health","healthcare","help","helsinki","here","hermes","hgtv","hiphop","hisamitsu","hitachi","hiv","hk","hkt","hm","hn","hockey","holdings","holiday","homedepot","homegoods","homes","homesense","honda","honeywell","horse","hospital","host","hosting","hot","hoteles","hotels","hotmail","house","how","hr","hsbc","ht","hu","hughes","hyatt","hyundai","ibm","icbc","ice","icu","id","ie","ieee","ifm","ikano","il","im","imamat","imdb","immo","immobilien","in","industries","infiniti","info","ing","ink","institute","insurance","insure","int","intel","international","intuit","investments","io","ipiranga","iq","ir","irish","is","iselect","ismaili","ist","istanbul","it","itau","itv","iveco","iwc","jaguar","java","jcb","jcp","je","jeep","jetzt","jewelry","jio","jlc","jll","jm","jmp","jnj","jo","jobs","joburg","jot","joy","jp","jpmorgan","jprs","juegos","juniper","kaufen","kddi","ke","kerryhotels","kerrylogistics","kerryproperties","kfh","kg","kh","ki","kia","kim","kinder","kindle","kitchen","kiwi","km","kn","koeln","komatsu","kosher","kp","kpmg","kpn","kr","krd","kred","kuokgroup","kw","ky","kyoto","kz","la","lacaixa","ladbrokes","lamborghini","lamer","lancaster","lancia","lancome","land","landrover","lanxess","lasalle","lat","latino","latrobe","law","lawyer","lb","lc","lds","lease","leclerc","lefrak","legal","lego","lexus","lgbt","li","liaison","lidl","life","lifeinsurance","lifestyle","lighting","like","lilly","limited","limo","lincoln","linde","link","lipsy","live","living","lixil","lk","llc","loan","loans","locker","locus","loft","lol","london","lotte","lotto","love","lpl","lplfinancial","lr","ls","lt","ltd","ltda","lu","lundbeck","lupin","luxe","luxury","lv","ly","ma","macys","madrid","maif","maison","makeup","man","management","mango","map","market","marketing","markets","marriott","marshalls","maserati","mattel","mba","mc","mckinsey","md","me","med","media","meet","melbourne","meme","memorial","men","menu","meo","merckmsd","metlife","mg","mh","miami","microsoft","mil","mini","mint","mit","mitsubishi","mk","ml","mlb","mls","mm","mma","mn","mo","mobi","mobile","mobily","moda","moe","moi","mom","monash","money","monster","mopar","mormon","mortgage","moscow","moto","motorcycles","mov","movie","movistar","mp","mq","mr","ms","msd","mt","mtn","mtr","mu","museum","mutual","mv","mw","mx","my","mz","na","nab","nadex","nagoya","name","nationwide","natura","navy","nba","nc","ne","nec","net","netbank","netflix","network","neustar","new","newholland","news","next","nextdirect","nexus","nf","nfl","ng","ngo","nhk","ni","nico","nike","nikon","ninja","nissan","nissay","nl","no","nokia","northwesternmutual","norton","now","nowruz","nowtv","np","nr","nra","nrw","ntt","nu","nyc","nz","obi","observer","off","office","okinawa","olayan","olayangroup","oldnavy","ollo","om","omega","one","ong","onl","online","onyourside","ooo","open","oracle","orange","org","organic","origins","osaka","otsuka","ott","ovh","pa","page","panasonic","panerai","paris","pars","partners","parts","party","passagens","pay","pccw","pe","pet","pf","pfizer","pg","ph","pharmacy","phd","philips","phone","photo","photography","photos","physio","piaget","pics","pictet","pictures","pid","pin","ping","pink","pioneer","pizza","pk","pl","place","play","playstation","plumbing","plus","pm","pn","pnc","pohl","poker","politie","porn","post","pr","pramerica","praxi","press","prime","pro","prod","productions","prof","progressive","promo","properties","property","protection","pru","prudential","ps","pt","pub","pw","pwc","py","qa","qpon","quebec","quest","qvc","racing","radio","raid","re","read","realestate","realtor","realty","recipes","red","redstone","redumbrella","rehab","reise","reisen","reit","reliance","ren","rent","rentals","repair","report","republican","rest","restaurant","review","reviews","rexroth","rich","richardli","ricoh","rightathome","ril","rio","rip","rmit","ro","rocher","rocks","rodeo","rogers","room","rs","rsvp","ru","rugby","ruhr","run","rw","rwe","ryukyu","sa","saarland","safe","safety","sakura","sale","salon","samsclub","samsung","sandvik","sandvikcoromant","sanofi","sap","sapo","sarl","sas","save","saxo","sb","sbi","sbs","sc","sca","scb","schaeffler","schmidt","scholarships","school","schule","schwarz","science","scjohnson","scor","scot","sd","se","search","seat","secure","security","seek","select","sener","services","ses","seven","sew","sex","sexy","sfr","sg","sh","shangrila","sharp","shaw","shell","shia","shiksha","shoes","shop","shopping","shouji","show","showtime","shriram","si","silk","sina","singles","site","sj","sk","ski","skin","sky","skype","sl","sling","sm","smart","smile","sn","sncf","so","soccer","social","softbank","software","sohu","solar","solutions","song","sony","soy","space","spiegel","sport","spot","spreadbetting","sr","srl","srt","st","stada","staples","star","starhub","statebank","statefarm","statoil","stc","stcgroup","stockholm","storage","store","stream","studio","study","style","su","sucks","supplies","supply","support","surf","surgery","suzuki","sv","swatch","swiftcover","swiss","sx","sy","sydney","symantec","systems","sz","tab","taipei","talk","taobao","target","tatamotors","tatar","tattoo","tax","taxi","tc","tci","td","tdk","team","tech","technology","tel","telecity","telefonica","temasek","tennis","teva","tf","tg","th","thd","theater","theatre","tiaa","tickets","tienda","tiffany","tips","tires","tirol","tj","tjmaxx","tjx","tk","tkmaxx","tl","tm","tmall","tn","to","today","tokyo","tools","top","toray","toshiba","total","tours","town","toyota","toys","tr","trade","trading","training","travel","travelchannel","travelers","travelersinsurance","trust","trv","tt","tube","tui","tunes","tushu","tv","tvs","tw","tz","ua","ubank","ubs","uconnect","ug","uk","unicom","university","uno","uol","ups","us","uy","uz","va","vacations","vana","vanguard","vc","ve","vegas","ventures","verisign","versicherung","vet","vg","vi","viajes","video","vig","viking","villas","vin","vip","virgin","visa","vision","vista","vistaprint","viva","vivo","vlaanderen","vn","vodka","volkswagen","volvo","vote","voting","voto","voyage","vu","vuelos","wales","walmart","walter","wang","wanggou","warman","watch","watches","weather","weatherchannel","webcam","weber","website","wed","wedding","weibo","weir","wf","whoswho","wien","wiki","williamhill","win","windows","wine","winners","wme","wolterskluwer","woodside","work","works","world","wow","ws","wtc","wtf","xbox","xerox","xfinity","xihuan","xin","कॉम","セール","佛山","ಭಾರತ","慈善","集团","在线","한국","ଭାରତ","大众汽车","点看","คอม","ভাৰত","ভারত","八卦","موقع","বাংলা","公益","公司","香格里拉","网站","移动","我爱你","москва","қаз","католик","онлайн","сайт","联通","срб","бг","бел","קום","时尚","微博","淡马锡","ファッション","орг","नेट","ストア","삼성","சிங்கப்பூர்","商标","商店","商城","дети","мкд","ею","ポイント","新闻","工行","家電","كوم","中文网","中信","中国","中國","娱乐","谷歌","భారత్","ලංකා","電訊盈科","购物","クラウド","ભારત","通販","भारतम्","भारत","भारोत","网店","संगठन","餐厅","网络","ком","укр","香港","诺基亚","食品","飞利浦","台湾","台灣","手表","手机","мон","الجزائر","عمان","ارامكو","ایران","العليان","اتصالات","امارات","بازار","پاکستان","الاردن","موبايلي","بارت","بھارت","المغرب","ابوظبي","السعودية","ڀارت","كاثوليك","سودان","همراه","عراق","مليسيا","澳門","닷컴","政府","شبكة","بيتك","عرب","გე","机构","组织机构","健康","ไทย","سورية","招聘","рус","рф","珠宝","تونس","大拿","みんな","グーグル","ελ","世界","書籍","ഭാരതം","ਭਾਰਤ","网址","닷넷","コム","天主教","游戏","vermögensberater","vermögensberatung","企业","信息","嘉里大酒店","嘉里","مصر","قطر","广东","இலங்கை","இந்தியா","հայ","新加坡","فلسطين","政务","xperia","xxx","xyz","yachts","yahoo","yamaxun","yandex","ye","yodobashi","yoga","yokohama","you","youtube","yt","yun","za","zappos","zara","zero","zip","zippo","zm","zone","zuerich","zw"];const ou=t(iu),su=e=>{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)},uu=e=>{navigator.clipboard?navigator.clipboard.writeText(e).catch(su):su(e)},lu=e=>{var t,n;const r="feade1d6c3f17748ae4c8d917a1e1068",a=Boolean(null==(t=e.properties.group[r])?void 0:t.forwardTicketFormToHelpdesk),i=!!e.__unsafeProperties.license&&e.__unsafeProperties.license.licenseinboundForwardingToHelpdeskEnabled,o=null==(n=e.properties.license[r])?void 0:n.hdLicenseID;return"number"==typeof o&&o>-1&&(a||i)?"helpdesk":e.__unsafeProperties.group.offlineMessagesEnabled?"offline_message":"livechat"},cu=e=>fetch("https://api.helpdesk.com/v1/externalTickets",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).then(e=>e.ok?e.json():Promise.reject()).then(e=>{let{ID:t}=e;return{id:t}}),du=600,pu=300,hu=304,fu=338,gu=321,mu=Object.freeze(Object.defineProperty({__proto__:null,def:"6px",lg:"8px",md:"6px",none:"0px",round:"50%",sm:"4px",xl:"12px",xs:"2px",xxl:"16px"},Symbol.toStringTag,{value:"Module"})),_u={50:"#FFFAE5",100:"#F7C56E",500:"#FFD000",800:"#3A352C"},bu={100:"#FF7C6B",500:"#D93311"},vu={100:"#77Cf9D",500:"#268750"},Du={100:"#FA6681",500:"#E30D34"},yu="#2000F0",wu={0:"#FFFFFF",15:"#F6F6F7",25:"#F0F0F0",50:"#F8F8F8",75:"#EDEDED",100:"#E3E3E3",200:"#D5D5D5",300:"#C0C0C0",400:"#B3B3B3",425:"#A6A4A4",450:"#949494",500:"#757575",525:"#707070",550:"#6E6E6E",600:"#575757",625:"#474747",650:"#333333",700:"#2E2E2E",800:"#252525",900:"#111111"},Cu=Object.freeze(Object.defineProperty({__proto__:null,accent:"#2000F0",brand:{orange:"#FF5100",black:"#1B1B20"},grayscale:wu,green:vu,red:bu,ruby:Du,webkitOutline:"#3B99FC",yellow:_u},Symbol.toStringTag,{value:"Module"})),Eu={...Cu,border:wu[500],borderSubtle:wu[100],divider:wu[100],error:bu[500],errorContrast:wu[0],subtleFeedback:_u[50],subtleFeedbackContrast:wu[900],caution:"#FFAE21",cautionDimmed:"#FFF3D6",cautionContrast:wu[900],success:vu[500],successContrast:wu[0],primaryTextColor:wu[900],secondaryTextColor:wu[550],tertiaryTextColor:wu[400],surface:wu[0],surfaceVariant:wu[25],surfaceVariantHover:"#E6E6E6",surfaceInteractive:wu[50],surfaceInteractivePressed:wu[600],surfaceDecorative:wu[100],surfaceDimmed:"#E6E4E1",surfaceFade:wu[15],hintSurface:wu[800],floatSurface:wu[0],pressedElement:wu[300],notification:Du[500],notificationContrast:wu[0],widgetBackground:wu[50],disabled:wu[100],disabledContrast:wu[600],inactiveElement:wu[450],formIconColor:wu[50],trademarkFooterText:wu[600],itemHover:wu[625],successHover:"#2FA763",inactiveElementHover:wu[425],secondaryButtonBackground:wu[100],secondaryButtonBackgroundHover:wu[200],primaryTimelineSurface:wu[0],decorations:{decorOne:"#FFDAB9",decorTwo:"#D9CCFA",decorThree:"#FACCCC",decorFour:"#F4F791",decorFive:"#F1C9FC"}},ku={...Cu,border:wu[600],borderSubtle:wu[650],divider:wu[700],error:bu[100],errorContrast:wu[900],subtleFeedback:_u[800],subtleFeedbackContrast:_u[100],caution:_u[100],cautionDimmed:"#322B24",cautionContrast:wu[900],success:vu[100],successContrast:wu[900],primaryTextColor:wu[0],secondaryTextColor:wu[400],tertiaryTextColor:wu[600],surface:wu[800],surfaceVariant:wu[700],surfaceVariantHover:"#333333",surfaceInteractive:wu[700],surfaceInteractivePressed:wu[400],surfaceDecorative:wu[700],surfaceDimmed:"#1F1E1D",surfaceFade:wu[700],hintSurface:wu[550],floatSurface:wu[700],pressedElement:wu[600],notification:Du[100],notificationContrast:wu[900],widgetBackground:wu[900],disabled:wu[700],disabledContrast:wu[400],inactiveElement:wu[600],formIconColor:wu[900],trademarkFooterText:wu[400],itemHover:wu[525],successHover:"#99DBB5",inactiveElementHover:wu[800],secondaryButtonBackground:wu[650],secondaryButtonBackgroundHover:wu[625],primaryTimelineSurface:wu[800],decorations:{decorOne:"#D7650F",decorTwo:"#400CC6",decorThree:"#AF3C3C",decorFour:"#ACB125",decorFive:"#831AA2"}},Au=Object.freeze(Object.defineProperty({__proto__:null,dark:ku,light:Eu},Symbol.toStringTag,{value:"Module"})),Fu=15e3,xu=1e3,Iu=600,Su=15e3,Tu=200,Bu=60,zu=360,Mu=130,Pu="16px",Ou=15e3,ju=1e3,Ru=600,$u=15e3,qu=200,Uu=60,Lu=360,Nu=95,Vu="16px",Hu=2;function Zu(e,t){return ee(X(e),te(e.getState()),ne(t),Z(Ne))}const Gu=(e,t)=>ee(Zu(e,e=>e.application.readyState),h(e=>e===t),_(1),oe),Yu=()=>{if((e=window.matchMedia)&&/native code/.test(String(e))){return!window.matchMedia("(hover: none)").matches}var e;return!0},Wu=()=>/mobile/gi.test(navigator.userAgent)&&!("MacIntel"===navigator.platform&&Fe("iPad",navigator.userAgent)),Ju=()=>Wu()||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>0,Qu=()=>Fe("Chrome",navigator.userAgent),Xu=()=>{const e=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);return e?parseInt(e[2],10):0},Ku=()=>/Firefox/.test(navigator.userAgent),el=()=>!Qu()&&/Safari/.test(navigator.userAgent),tl=200,nl=8,rl=8,al=8,il=360,ol=8,sl=20,ul={recommendations:{width:"392px",height:"286px"},mobileRecommendations:{width:"100%",height:"286px"}},ll=(e,t)=>{e.getApplicationState("recommendations").products.length>0||ee(Zu(e,e=>e.application.page),ce(t=>Nc(e,t.url)),ne(()=>zp(e)),h(e=>e.length>=3),G(e=>{return K(Promise.all([Promise.resolve(e),(n=t.call,r=e,n("/v1.0/recommendations/match","POST",{pages:r}))]));var n,r}),_(1),re(t=>{let[n,r]=t;return ee(Gu(e,"ready"),ne(()=>[n,r]))}),k(t=>{let[n,r]=t;return function(e,t,n){let{products:r,id:a}=t;void 0===n&&(n=!0);const{recommendations:i}=e.getApplicationState(),o=null==i?void 0:i.hiddenIds.includes(a),s={...i,id:a,products:r};if(e.setApplicationState({recommendations:s}),!o){const t=!n;e.setApplicationState({recommendations:{...s,hasSeen:t,isVisible:t}}),Rc(e,{},{scheduleRerender:t}),dl(e,"recommendations")}}(e,{products:r,id:"h="+n.join(",")+"&t="+(new Date).getTime()})}))},cl={visitorCounter:-1,recommendations:-1,googleReviews:-1,contactInvitation:-1,chatBotGreeting:-1},dl=(e,t)=>{var n;if("recommendations"===t)return Rc(e,{eventsQueue:[t]},{scheduleRerender:!1}),qc(e,{transitionState:"hidden",hidden:!0}),$c(e,{transitionState:"hidden",hidden:!0}),Uc(e,{transitionState:"hidden",hidden:!0}),void Lc(e,{transitionState:"hidden",hidden:!0});const r=null!=(n=e.getView("minimized").eventsQueue)?n:[];Rc(e,{eventsQueue:[].concat(r,[t])},{scheduleRerender:!1})},pl=(e,t)=>{var n;const r=null!=(n=e.getView("minimized").eventsQueue)?n:[];Rc(e,{eventsQueue:r.filter(e=>e!==t)},{scheduleRerender:!1})},hl=()=>{Object.values(cl).forEach(e=>window.clearTimeout(e))},fl=(e,t)=>{function n(t){return()=>{e.emit("resize-to-theme-size"),e.once("resize-to-theme-size-done",t)}}hl();const r="visitorCounter"===t&&Boolean(e.getApplicationState("googleReviews")),a=e.getApplicationState("contactInvitation").hasSeen;switch(t){case"visitorCounter":cl.visitorCounter=window.setTimeout(n(()=>{$c(e,{transitionState:"shown"}),cl.visitorCounter=window.setTimeout(()=>{$c(e,{transitionState:"hidden"})},15600)}),r?0:4e3);break;case"recommendations":(e=>{const t=Wu(),n=t?ul.mobileRecommendations:ul.recommendations,r=e.getApplicationState("recommendations");if(r.hidden)return;Rc(e,{resizeBubbleAnimation:"shrink"}),e.emit("resize-request",{...n,maximized:!1,ignoreHorizontalOffset:t}),e.once("resize-request-done",()=>e.setApplicationState({recommendations:{...r,isVisible:!0,hasSeen:!0,animation:"show"}}))})(e);break;case"googleReviews":cl.googleReviews=window.setTimeout(n(()=>{qc(e,{transitionState:"shown"}),cl.googleReviews=window.setTimeout(()=>{qc(e,{transitionState:"hidden"})},15600)}),4e3);break;case"contactInvitation":cl.contactInvitation=window.setTimeout(n(()=>{Uc(e,{transitionState:"shown"})}),a?0:5e3);break;case"chatBotGreeting":cl.chatBotGreeting=window.setTimeout(n(()=>{Lc(e,{transitionState:"shown"})}),0);break;default:return}},gl=e=>{ee(Gu(e,"bootstrapped"),re(()=>Zu(e,()=>(e=>{const t=e.getView("minimized").eventsQueue;return null!=t&&t.length?t[0]:null})(e))),h(t=>{if(!t||!Ep(e,"minimized"))return!1;const n=e.getApplicationState(t);return!!n&&!n.isVisible}),k(t=>{fl(e,t)})),ee(Zu(e,e=>e.application.visibility.state),h(e=>"maximized"===e),k(hl)),ee(Zu(e,()=>{var t;return null==(t=e.getApplicationState("visitorCounter"))?void 0:t.transitionState}),h(e=>"hidden"===e),k(()=>{pl(e,"visitorCounter")})),ee(Zu(e,()=>{var t;return null==(t=e.getApplicationState("googleReviews"))?void 0:t.transitionState}),h(e=>"hidden"===e),k(()=>{pl(e,"googleReviews")})),ee(Zu(e,e=>{var t,n;return null!=(t=null==(n=e.application.recommendations)?void 0:n.hiddenIds)?t:[]}),h(t=>{const n=e.getApplicationState("recommendations");return n&&t.includes(n.id)}),k(()=>{pl(e,"recommendations")})),ee(Zu(e,()=>{var t;return null==(t=e.getApplicationState("contactInvitation"))?void 0:t.transitionState}),h(e=>"hidden"===e),k(()=>{pl(e,"contactInvitation")})),ee(Zu(e,()=>{var t;return null==(t=e.getApplicationState("chatBotGreeting"))?void 0:t.transitionState}),h(e=>"hidden"===e),k(()=>{pl(e,"chatBotGreeting")}))},ml=U()?window.localStorage:L,_l=[/sendURLToGuardwareProxy/i,/safari-extension:\/\//],bl=!("true"===ml.getItem("_livechat_has_visited"));ml.setItem("_livechat_has_visited","true");const vl=(e,t,n,r)=>{const{timeZone:a}=(new Intl.DateTimeFormat).resolvedOptions(),i=(null==r?void 0:r.license)||Vc(),s=Hc(),u={type:e+"_"+n,...i?{license:i}:{},...s?{organizationId:s}:{},userAgent:navigator.userAgent,mobile:Wu(),timeZone:String(a),logVersion:"2024-11-07",firstTimeVisitor:bl,severity:t,lc_env:"production",...r};if(a){const[e]=a.split("/");e!==a&&(u.timeZoneArea=String(e))}return(e=>{let{type:t,license:n,organizationId:r,...a}=e;if(window.location.href.includes("openwidget.com"))return Promise.resolve();const i={...n?{licence_id:n.toString()}:{},...r?{organization_id:r}:{},event_id:t,message:JSON.stringify(a)};return lt("https://queue.livechatinc.com/logs",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/x-www-form-urlencoded"},body:O(i)}).then(()=>Promise.resolve()).catch(o)})(u)},Dl=function(e,t,n,r){void 0===r&&(r="chat_widget");const a={};var i;if(t instanceof Error?(a.errorMessage=t.message,a.stack=t.stack,a.code=t.code):a.errorMessage=JSON.stringify({error:t}),i=a,!_l.some(e=>e.test(i.errorMessage+" "+i.stack)))return he(n)||(n={meta:JSON.stringify({info:n})}),vl(r,"Error",e,{...n,...a})},yl=function(e,t,n){return void 0===n&&(n="chat_widget"),vl(n,"Informational",e,t)},wl=e=>vl("chat_widget","Notice",e),Cl=e=>yl("chat_started",e),El=e=>yl("chat_rated",e),kl=e=>yl("widget_opened",e),Al=(e,t)=>yl("potential_connection_problem_"+e,t),Fl=()=>Ae("webkit.messageHandlers.iosMobileWidget.postMessage",window)?"ios":!!Ae("androidMobileWidget.postMessage",window)&&"android",xl=e=>window.androidMobileWidget.postMessage(JSON.stringify(e)),Il=e=>window.webkit.messageHandlers.iosMobileWidget.postMessage(e),Sl=(()=>{const e=Fl();return"android"===e?xl:"ios"===e?Il:null})(),Tl=()=>Boolean(Fl()),Bl=e=>{Sl&&(Sl({messageType:"uiReady"}),e.on("add_event",t=>{let{event:n}=t;if("message"!==n.type)return;const r=e.getUser(n.author).name;Sl({messageType:"newMessage",text:n.properties.text,id:n.id,timestamp:n.timestamp,author:{name:r}})}),e.on("mobile_wrapper_minimize_intent",()=>{Sl({messageType:"hideChatWindow"})}))},zl={light:{maxModifier:.7},dark:{maxModifier:.5}};function Ml(e,t,n){return ks(e,n)>ks(t,n)?e:t}const Pl=function(e,t,n){void 0===n&&(n=0);const r=ks(e,t),a=Xc(t),{maxModifier:i}=zl[a?"light":"dark"];if(n>=5)return e;const o=i-r/4.5*.5;if(r>=4.5)return e;const s=a?ys(o,e):Fs(o,e);return ks(s,t)>=4.5?s:Pl(s,t,n+1)},Ol=e=>{const t=e.variant||"light",n=Au[t],r=e.customJson||{},a=Kc(e.titlebarBackgroundColor)?"rgba(255, 255, 255, 0.1)":"rgba(0, 0, 0, 0.065)",i=Kc(e.agentbarBackgroundColor)?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.05)",o=Kc(e.agentbarBackgroundColor)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.2)",s=Kc(e.agentbarBackgroundColor)?"rgba(255, 255, 255, 0.3)":"rgba(0, 0, 0, 0.1)",u=Ml(ku.primaryTextColor,Eu.primaryTextColor,e.ctaColor),l=Pl(e.ctaColor,n.surface),c=ad(e.agentMessageColorBackground);return ze({name:e.name,variant:t,iconTheme:e.name,showMessageAvatar:"modern"!==e.name,colors:{agentBarText:e.agentbarText,agentBarBackground:e.agentbarBackgroundColor,cta:e.ctaColor,ctaText:u,minimizedIcon:e.minimizedColorIcon,minimizedBackground:e.minimizedColorBackground,background:e.backgroundColor,visitorMessageText:e.visitorMessageColorText,visitorMessageBackground:e.visitorMessageColorBackground,systemMessage:e.systemMessageColor,agentMessageBackground:e.agentMessageColorBackground,agentMessageText:e.agentMessageColorText,minimizedText:e.minimizedColorText,titleBarText:e.titlebarText,titleBarBackgroundColor:e.titlebarBackgroundColor,quickRepliesColor:l,lighterOppositeTitleBarColor:a,decorativeOppositeAgentBarColor:i,lighterOppositeAgentBarColor:o,codeBlockBackgroundColor:c},AgentBar:{css:{background:e.agentbarBackgroundColor,color:e.agentbarText},IconButton:{css:{background:{default:"transparent",active:o}}}},Form:{IconButton:{css:{background:{default:"rgba(0, 0, 0, 0.05)",active:e.ctaColor},color:{default:n.formIconColor,active:u}}}},ChatSummary:{Icon:{color:e.minimizedColorIcon}},Maximized:{css:{background:e.backgroundColor}},Message:{own:{Bubble:{css:{background:"modern"===e.name?"transparent":e.visitorMessageColorBackground,color:e.visitorMessageColorText}}},system:{Bubble:{css:{color:e.systemMessageColor}}},Bubble:{css:{background:"modern"===e.name?"transparent":e.agentMessageColorBackground,color:e.agentMessageColorText}},css:{color:e.systemMessageColor}},TypingIndicator:{css:{color:e.systemMessageColor}},Minimized:{MinimizedBubble:{css:{color:e.minimizedColorText,backgroundColor:{default:e.minimizedColorBackground,hasAvatar:"transparent"}},Icon:{color:e.minimizedColorIcon}},MinimizedBar:{css:{color:e.minimizedColorText,backgroundColor:e.minimizedColorBackground},Icon:{color:e.minimizedColorIcon}}},TitleBar:{css:{background:"modern"===e.name?e.titlebarBackgroundColor:e.agentbarBackgroundColor,color:"modern"===e.name?e.titlebarText:e.agentbarText},HourGlassLabel:{css:{backgroundColor:i}}},DividerLabel:{css:{color:e.systemMessageColor,borderColor:s}},TextComposer:{css:{background:n.surface},IconButton:{css:{background:{active:e.ctaColor}},active:{Icon:{color:u}}}}},r)},jl=[0,2,4,6,8,1,3,5,7,9],Rl=e=>e.replace(/\b(?:\d[ -]*?){8,15}((?:\d[ -]*?){4})\b/g,(e,t)=>{const n=e.replace(/(-|\s)/g,"");return(e=>{if(/[^0-9-\s]+/.test(e))return!1;const t=e.replace(/\D/g,"");let n,r=t.length,a=1,i=0;for(;r;)n=parseInt(t.charAt(--r),10),i+=(a^=1)?jl[n]:n;return i&&i%10==0})(n)?""+(e=>{const t=e%4,n=t?4-t:0,r=Math.floor(e/4)+(t?1:0)-n-1,a=we(n,"XXX"),i=we(r,"XXXX");return a.concat(i).join("-").concat("-")})(n.length)+t:e}),$l=e=>{let t=0;return e.split("").forEach(e=>{const n=e.charCodeAt(0);t=(t<<5)-t+n,t&=t}),t},ql=(e,t)=>$l(e)%(1/t)==0;(new Ir).tlds(ou);const Ul=(e,t,n)=>{const r=be(t=>t.name===e,n);return-1!==r?Je(r,{...n[r],defaultValue:t},n):n},Ll=(e,t,n)=>{e.addEvent(t,{...n,serverId:n.serverId||null})},Nl=(e,t,n)=>{let{systemMessageType:r,textVariables:a,text:i}=n;Ll(e,t,{id:ke(e.getIndexedEvents("liveChatChatId")),serverId:null,type:"system_message",author:"system",seen:!0,properties:B({systemMessageType:r,textVariables:a,defaultText:i})})},Vl=e=>{e.updateChat("liveChatChatId",{active:!1,properties:{ended:!0,queued:!1,agentIsTyping:!1}}),e.setApplicationState({greetingsMuted:!1})},Hl=e=>{e.setApplicationState({eyeCatcher:{...e.getApplicationState().eyeCatcher,hidden:!0}})},Zl=e=>{const t=cp(e);if(!t||!t.properties.uniqueId||dp(e,t))return;const{invitation:n}=e.getApplicationState();var r;e.setApplicationState({invitation:{...n,hiddenIds:[].concat(n.hiddenIds,[t.properties.uniqueId])}}),ql(e.getSessionUser().serverId,.01)&&(r={minimizedType:Cd(e),greetingId:t.properties.id,greetingUniqueId:t.properties.uniqueId,greetingType:t.properties.type,greetingSubtype:t.properties.subtype,greetingAddon:t.properties.addon||"none"},yl("greeting_dismissed",r)),e.emit("render-minimized")},Gl=e=>{const t=cp(e);if(!t||!t.properties.uniqueId||pp(e))return;const{invitation:n}=e.getApplicationState();e.setApplicationState({invitation:{...n,displayedIds:[].concat(n.displayedIds,[t.properties.uniqueId])}})},Yl=function(e,t){let{shouldMaintainModality:n=!0}=void 0===t?{}:t;Ep(e,"maximized")||e.setApplicationState({visibility:{...e.getApplicationState("visibility"),state:"maximized",...!n&&{interactionModality:"virtual"}}})},Wl=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const{visibility:r,destroyed:a,isMinimizedForcefullyDisabled:i}=e.getApplicationState();!t&&"hidden"===r.state&&r.forced||"minimized"===r.state||(!Cp(e)||Sd("liveChatChatId",e)||a||i?e.setApplicationState({visibility:{...e.getApplicationState("visibility"),state:"hidden"}}):n||!e.getView("Moment").show?(e.setApplicationState({visibility:{...e.getApplicationState("visibility"),state:"minimized"}}),Rc(e,{bubbleHoverState:!1})):e.emit("request_close_moment"))},Jl=e=>{Ep(e,"minimized")&&e.setApplicationState({visibility:{state:"hidden"}})},Ql=(e,t)=>{let{id:n,active:r=!0,thread:a,group:i,agent:o,queued:s=!1,timestamp:u}=t;null===e.getChat("liveChatChatId").serverId&&e.setChatServerId("liveChatChatId",n);const l={ended:!1,queued:s,fakeAgentMessageId:null,lastThread:a,currentAgent:o,timestamp:u};"number"==typeof i&&(l.group=i),Hl(e),e.updateChat("liveChatChatId",{active:r,properties:l}),xc(e),e.setApplicationState({hidden:!1});const{readyState:c}=e.getApplicationState();"not_ready"===c||Ep(e,"maximized")||(e.setCurrentView("Chat"),Yl(e,{shouldMaintainModality:!1}))},Xl=function(e,t,n){void 0===n&&(n={});const r=fd("creditCardMasking",e).enabled?(e=>Rl(e.replaceAll(/\/\/(\S*):(\S*)@/g,"//****:****@")))(t):t;return{type:Co(r)?"emoji":"message",thread:Tp(e),properties:B({text:r,...n})}},Kl=function(e,t,n,r){void 0===r&&(r=void 0),e.sendEvent(t,Xl(e,n,{triggeredBy:r}))},ec=(e,t,n)=>{e.setApplicationState({messageDraft:n,initialMessageDraft:null})},tc=(e,t,n,r)=>{const{quickReplies:a}=n.properties,i=a[r];n.properties.invitation?zc(e,n.id,i):Kl(e,t,i.text,{type:"quick_reply",event:n.id,button:i})},nc=(e,t,n)=>{const r=bp(e,t);Ll(e,t,{...n,seen:!0,type:"message_draft",author:e.getSessionUserId(),id:ke(e.getIndexedEvents("liveChatChatId"))}),r||uc(e),e.setCurrentView("Chat")},rc=(e,t)=>{const n=e.getChat(t).active,r=qd(e);return Boolean(r&&!n)},ac=function(e,t,n,r){void 0===r&&(r=void 0);const a=e.getApplicationState("invitation").current,i=e.getEvent(t,a),o=Xl(e,n,{triggeredBy:r,...i&&{fromGreeting:{...Re(["id","uniqueId"],i.properties)}}});if(!(fd("preChatAfterGreeting",e).enabled&&rc(e,t)))return e.setCurrentView("Chat"),void e.sendEvent(t,o);nc(e,t,o)},ic=(e,t,n)=>{if(Rp(e)&&!gd(e))return;if(!rc(e,t))return void e.setApplicationState({initialMessageDraft:n});const r=Xl(e,n);nc(e,t,r)},oc=(e,t,n)=>{let{text:r,recipients:a="all"}=n;e.sendEvent(t,{type:"custom_system_message",thread:Tp(e),properties:{text:r.trim(),recipients:a}})},sc=(e,t)=>{e.updateChat("liveChatChatId",{properties:{currentAgent:t}})},uc=e=>{if(!Ld(e,"prechat")){const t=e.getView("Chat/prechat");wc(e,t)}},lc=(e,t)=>{const{properties:{rate:n,rateComment:r}}=e.getChat("liveChatChatId");let{fields:a,...i}=t;n&&(a=Ul("rating",n,a)),r&&(a=Ul("rateComment",r,a)),wc(e,{...i,fields:a})},cc=e=>{const t=pd(e);e.updateChat(t,{properties:{startChatAgainPending:!0}})},dc=function(e,t,n){let{chatId:r,forced:a}=void 0===n?{}:n;e.updateChat("liveChatChatId",{properties:{startChatAgainPending:!1}}),Ec(e);const{properties:{lastThread:i},serverId:o}=e.getChat("liveChatChatId");if(a||!md(e)||o&&r!==o)e.flushChat(t),r&&e.setChatServerId("liveChatChatId",r);else{Fc(e);const t=Ad(e,"liveChatChatId");t&&e.removeEvent("liveChatChatId",t.id)}e.updateChat(t,{properties:{agentIsTyping:!1,ended:!1,fakeAgentMessageId:null,lastThread:i,loadingHistory:!1,queued:!1,rate:null,rateComment:null,transcriptSentTo:null}}),e.setApplicationState({greetingsMuted:!1})},pc=e=>{e.updateChat("liveChatChatId",{properties:{rate:null,rateComment:null,transcriptSentTo:null}})},hc=(e,t)=>{const n=t.getApplicationState("config");t.setApplicationState({config:{...n,features:{...n.features,homeScreen:{enabled:td(e)},fileSharing:{enabled:"1"===e.properties.license.core["attachments.enable_for_visitors"]},agentAvatar:{enabled:e.__unsafeProperties.group.hasAgentAvatarsEnabled},continuousChat:{enabled:"1"===e.properties.license.core.continuous_chat_widget_enabled},chatHistory:{enabled:"1"===e.properties.license.core.customer_history_enabled},rating:{enabled:e.__unsafeProperties.group.ratingEnabled},emailTranscript:{enabled:e.__unsafeProperties.group.transcriptButtonEnabled},logo:e.__unsafeProperties.group.logo.enabled?{enabled:!0,path:e.__unsafeProperties.group.logo.src}:{enabled:!1,path:void 0},linksPreview:{enabled:e.__unsafeProperties.group.linksUnfurlingEnabled},ticketForm:{enabled:"ticketForm"in e,mode:e.__unsafeProperties.ticketFormMode||lu(e)},queue:{writingInQueueEnabled:ed(e)},preChatForm:{enabled:"prechatForm"in e},preChatAfterGreeting:{enabled:e.__unsafeProperties.group.prechatFormAfterGreetingEnabled},creditCardMasking:{enabled:!!e.__unsafeProperties.license&&e.__unsafeProperties.license.creditCardMaskingEnabled},hideTrademark:{enabled:e.__unsafeProperties.group.hasHiddenTrademark||!1===e.isPoweredByEnabled},disableSounds:{enabled:!e.__unsafeProperties.group.hasSoundsEnabled},minimized:{enabled:!e.__unsafeProperties.group.disabledMinimized},mobileMinimized:{enabled:e.__unsafeProperties.group.hasCustomMobileSettings?!e.__unsafeProperties.group.disabledMinimizedOnMobile:!e.__unsafeProperties.group.disabledMinimized},hideOnInit:{enabled:e.__unsafeProperties.group.hideOnInit}},minimizedType:e.__unsafeProperties.group.minimizedType,mobileMinimizedType:e.__unsafeProperties.group.minimizedTypeOnMobile,theme:ze(n.theme,Ol(e.__unsafeProperties.group.theme)),screenPosition:e.__unsafeProperties.group.screenPosition,mobileScreenPosition:e.__unsafeProperties.group.hasCustomMobileSettings?e.__unsafeProperties.group.screenPositionOnMobile:e.__unsafeProperties.group.screenPosition,nonProfitLicense:!!e.__unsafeProperties.license&&e.__unsafeProperties.license.nonProfit,properties:e.properties,screenOffset:{x:e.__unsafeProperties.group.offsetX,y:e.__unsafeProperties.group.offsetY}}}),t.getApplicationState("config").features.disableSounds.enabled&&t.setApplicationState({muted:!0})},fc=(e,t,n)=>{const r=e.getApplicationState("config");e.setApplicationState({config:{...r,features:ze(r.features,{[t]:n})}})},gc=(e,t)=>{fc(e,t,{enabled:!1})},mc=(e,t,n)=>{fc(e,t,{enabled:!0,...n})},_c=(e,t)=>{try{const n=JSON.parse(t).filter(e=>{let{template_id:t}=e;return"moment"===t||"links"===t});if(xe(n))return;mc(e,"boosters",{items:n.map(e=>{if("links"===e.template_id)return{id:e.id,template:e.template_id,links:e.links};const t={type:e.action.type,label:e.action.label,url:e.action.url};return{id:e.id,template:e.template_id,title:e.title,description:e.description,icon:e.icon,action:t}})})}catch(n){}},bc=(e,t,n)=>{const r={answered:!0};n&&(r.fields=n.properties.fields,n.id&&e.setEventServerId("liveChatChatId",t,n.id)),e.updateEvent("liveChatChatId",t,{properties:r})},vc=(e,t)=>{var n;t.properties.receivedFirstTime&&ql(e.getSessionUser().serverId,.01)&&(n={minimizedType:Cd(e),greetingId:t.properties.id,greetingUniqueId:t.properties.uniqueId,greetingType:t.properties.type,greetingSubtype:t.properties.subtype,greetingAddon:t.properties.addon||"none"},yl("greeting_displayed",n))},Dc=(e,t)=>{const{defaultWidget:n,embedded:r,actingAsDirectLink:a,availability:i,greetingsMuted:o}=e.getApplicationState(),s=Ld(e,"prechat");sc(e,t.author),"openwidget"===n&&(e=>{const t=e.getApplicationState("recommendations");hl(),Rc(e,{eventsQueue:[]},{scheduleRerender:!1}),qc(e,{transitionState:"hidden",hidden:!0}),$c(e,{transitionState:"hidden",hidden:!0}),Uc(e,{transitionState:"hidden",hidden:!0}),e.setApplicationState({recommendations:{...t,isVisible:!1,hiddenIds:[].concat(t.hiddenIds,[t.id]),hidden:!0}})})(e),"bar"!==Cd(e)&&Hl(e),xc(e),Sc(e);const u=cp(e);var l,c,d,p,h,f;u&&(f={minimizedType:Cd(e),greetingId:null==(l=u.properties)?void 0:l.id,greetingUniqueId:null==(c=u.properties)?void 0:c.uniqueId,greetingType:null==(d=u.properties)?void 0:d.type,greetingSubtype:null==(p=u.properties)?void 0:p.subtype,greetingAddon:(null==(h=u.properties)?void 0:h.addon)||"none"},yl("greeting_not_canceled",f),e.removeEvent("liveChatChatId",u.id));me(t.properties.cards||t.properties.card).filter(Boolean).forEach(t=>{t.title&&(t.title=Qc(e,t.title)),t.subtitle&&(t.subtitle=Qc(e,t.subtitle)),t.buttons&&(t.buttons.forEach(e=>e.invitation=!0),r&&!a||t.buttons.filter(e=>"url"===e.type&&"target"in e).forEach(e=>e.target="new"))});const g=ke(e.getIndexedEvents("liveChatChatId"));Ll(e,"liveChatChatId",{...t,seen:!o,id:g,properties:{...t.properties,...t.properties.text&&{text:Qc(e,t.properties.text)}}}),e.updateChat("liveChatChatId",{properties:{fakeAgentMessageId:g}}),e.setApplicationState({invitation:{...e.getApplicationState("invitation"),current:g}}),t.properties.receivedFirstTime&&e.setCurrentView("Chat"),Ep(e,"maximized")||(dp(e,t)&&t.properties.receivedFirstTime&&!o?Yl(e,{shouldMaintainModality:!1}):dp(e,t)||Wl(e,!0)),gd(e)&&"offline"===i&&s&&uc(e),o||vc(e,t),e.emit("render-minimized")},yc=(e,t)=>{const n=(new Date).toISOString();e.setApplicationState({config:{...e.getApplicationState("config"),features:{...e.getApplicationState("config").features,ticketForm:{...e.getApplicationState("config").features.ticketForm,additionalInfo:{lastDisplayedReason:t,lastDisplayedAt:n}}}}}),wc(e,e.getView("Chat/ticketForm"))},wc=(e,t)=>{const n={formType:t.type,formId:t.id,fields:t.fields};if(Ld(e)){const{id:t}=e.getLastEvent("liveChatChatId");return e.updateEvent("liveChatChatId",t,{properties:n})}const r=ke(e.getIndexedEvents("liveChatChatId"));return Ll(e,"liveChatChatId",{id:r,type:"form",author:"system",properties:n})},Cc=(e,t)=>{const n=e.getView("Moment");if(n.show&&!t.wasTriggeredByGreeting)return n.data.url===t.url?void e.emit("request_expand_moment"):void e.emit("request_expand_moment",{nextMoment:t});ld(t.url)?(e.updateView("Moment",{show:!0,data:t}),n.show&&e.emit("request_expand_moment")):Nl(e,"liveChatChatId",{text:"Link attached to the button is invalid."})},Ec=function(e,t){void 0===t&&(t=!1),e.updateView("Moment",{show:!1,data:{}}),t&&Wl(e)},kc=(e,t)=>{e.requestUpdateUser(e.getSessionUser().id,t)},Ac=(e,t)=>{var n;e.setUserServerId(e.getSessionUser().id,t),e.setApplicationState({testGroup:(n=t,$l(n)%2?"A":"B")})},Fc=function(e,t){if(void 0===t&&(t=void 0),Ld(e,t)){const{id:t}=e.getLastEvent("liveChatChatId");e.removeEvent("liveChatChatId",t)}},xc=e=>{Fc(e,"prechat")},Ic=e=>{Fc(e,"postchat")},Sc=e=>{Fc(e,"ticket")},Tc=(e,t,n)=>{const r=Ae("error.details.errors",e);if(!r)return void n();const a=r.reduce((e,n)=>"requester.email"===n.field?{...e,email:t("invalid_email")}:"requester.name"===n.field?{...e,name:n.message}:e,{});xe(a)?n():n(a)},Bc=e=>{const t="email_prompt",{properties:{lastThread:n}}=e.getChat("liveChatChatId");e.hasEvent("liveChatChatId",t)&&e.removeEvent("liveChatChatId",t);!!ip(e).find(e=>"form"===e.type&&"ask_for_email"===e.properties.formId)||e.addEvent("liveChatChatId",{id:t,serverId:null,seen:!0,type:"email_prompt",author:"system",thread:n})},zc=function(e,t,n,r){void 0===r&&(r=!1),Fe(n.type,["message","webview"])&&Yl(e);const a=pd(e);switch(e.emit("rich_greeting_button_clicked",{button:n,event:e.getEvent(a,t)}),n.type){case"message":ac(e,a,n.text,{event:t,button:n});break;case"webview":Cc(e,{url:n.value,wasTriggeredByGreeting:r,source:r?"targeted_message":"rich_message"});break;case"cancel":jc(e,a,t);break;case"copy":return void uu(n.value)}},Mc=e=>{e.emit("start_thread")},Pc=function(e,t,n){void 0===n&&(n="button");const r=e.getChat("liveChatChatId"),a=Fe("image",t.type);(Fe(["clipboard","drag"],n)||Math.random()<.1)&&yl("file_upload_added",{uploadSource:n}),e.sendEvent("liveChatChatId",{type:"file",thread:r.properties.lastThread,properties:{name:t.name.substring(0,255),progress:0,finished:!1,failed:!1,failReason:null,fileType:a?"image":"other",url:a?URL.createObjectURL(t):null,uploadSource:n}},{file:t})},Oc=(e,t)=>{pp(e)&&lp(e)&&e.setApplicationState({greetingsMuted:!0}),e.removeEvent("liveChatChatId",t),setTimeout(()=>e.emit("render-minimized"),0)},jc=(e,t,n)=>{const r=e.getChat(t),{mobile:a}=e.getApplicationState(),i=e.getEvent(t,n);var o;!r.active&&i&&(ql(e.getSessionUser().serverId,.01)&&(o={mobile:a,greetingId:i.properties.id,greetingUniqueId:i.properties.uniqueId,greetingType:i.properties.type,greetingSubtype:i.properties.subtype,greetingAddon:i.properties.addon||"none",minimizedType:Cd(e)},yl("greeting_canceled",o)),e.emit("request_cancel_greeting",i))},Rc=function(e,t,n){let{scheduleRerender:r=!0}=void 0===n?{}:n;const a=e.getView("minimized"),i={...a,...t};JSON.stringify(a)!==JSON.stringify(i)&&(e.updateView("minimized",i),r&&setTimeout(()=>e.emit("render-minimized"),0))},$c=(e,t)=>{const{session:n,transitionState:r}=t,a={...e.getApplicationState("visitorCounter")||{},...n&&{session:n},transitionState:r,...void 0!==t.hidden?{hidden:t.hidden}:{},isVisible:!!r&&"hidden"!==r};e.setApplicationState({visitorCounter:a}),e.emit("render-minimized")},qc=(e,t)=>{const{transitionState:n}=t,r={...e.getApplicationState("googleReviews"),transitionState:n,...void 0!==t.hidden?{hidden:t.hidden}:{},isVisible:!!n&&"hidden"!==n};e.setApplicationState({googleReviews:r}),e.emit("render-minimized")},Uc=(e,t)=>{var n;const r=e.getApplicationState("contactInvitation"),a=null!=(n=t.transitionState)?n:r.transitionState,i={...r,transitionState:a,...void 0!==t.hidden?{hidden:t.hidden}:{},isVisible:!!a&&"hidden"!==a,hasSeen:void 0!==t.hasSeen?t.hasSeen:r.hasSeen};e.setApplicationState({contactInvitation:i}),t.transitionState&&e.emit("render-minimized")},Lc=(e,t)=>{var n;const r=e.getApplicationState("chatBotGreeting"),a=null!=(n=t.transitionState)?n:r.transitionState,i={...r,transitionState:a,isVisible:!!a&&"hidden"!==a,text:void 0!==t.text?t.text:r.text,hidden:void 0!==t.hidden?t.hidden:r.hidden,hasSeen:void 0!==t.hasSeen?t.hasSeen:r.hasSeen};e.setApplicationState({chatBotGreeting:i}),t.transitionState&&e.emit("render-minimized")},Nc=(e,t)=>{const{history:n}=e.getApplicationState("locationHistory"),r=(new Date).getTime();if(n.length&&Se(n)===t)return void e.setApplicationState({locationHistory:{history:n,updatedAt:r}});const a=[].concat(n.slice(-10),[t]);e.setApplicationState({locationHistory:{history:a,updatedAt:r}})},Vc=()=>{const e=z(window.location.search);return parseInt((()=>{const e=String(window.location).match(/licen(?:s|c)e\/g?(\d+)/);return e?e[1]:null})()||e.license_id,10)},Hc=()=>z(window.location.search).organizationId||"",Zc=e=>{const t=parseInt(e,10);return t>-1?t:null},Gc=e=>"group"in e?Zc(e.group):"groups"in e?Zc(e.groups):null,Yc=()=>"1"===Ke("unique_groups",window.location.search)||"1"===Ke("unique_group",window.location.search),Wc=e=>{const{name:t}=e.getSessionUser();return t||e.localize("client")},Jc=e=>{const t=hd("liveChatChatId",e);if(!t)throw new Error("Current chat agent is undefined");if(!t.name)throw new Error("Current chat agent name is undefined");return t.name},Qc=function(e,t,n){void 0===n&&(n={});const{name:r=Wc(e),agent:a=Jc(e)}=n;return t.replace(/%name%/g,r).replace(/%agent%/g,a)},Xc=e=>Es(e)>.7,Kc=e=>Es(e)<=.179,ed=e=>{var t;return Boolean(null==(t=e.properties.license.bb9e5b2f1ab480e4a715977b7b1b4279)?void 0:t.messaging_in_queue_enabled)},td=e=>{var t;return Boolean(null==(t=e.properties.group.bb9e5b2f1ab480e4a715977b7b1b4279)?void 0:t.homescreen_enabled)},nd=e=>"https://"+e+"."+("api"===e?"livechatinc":"livechat")+".com",rd=()=>{const e=document.createElement("video"),t=document.createElement("canvas");return navigator.mediaDevices&&navigator.mediaDevices.getDisplayMedia?navigator.mediaDevices.getDisplayMedia({video:{cursor:"always",displaySurface:"browser"},audio:!1}).then(t=>(e.srcObject=t,e.play())).then(()=>new Promise(e=>{setTimeout(e,150)})).then(()=>{t.width=e.videoWidth,t.height=e.videoHeight;t.getContext("2d").drawImage(e,0,0,e.videoWidth,e.videoHeight);const n=((e,t)=>{const[n,r]=e.split(","),a=n.match(/:(.*?);/)[1],i=atob(r);let o=i.length;const s=new Uint8Array(o);for(;o--;)s[o]=i.charCodeAt(o);return new File([s],t,{type:a})})(t.toDataURL("image/png"),"screenshot.png");return e.srcObject.getTracks().forEach(e=>e.stop()),n}):Promise.reject(new Error("Screen sharing is not supported"))},ad=e=>Kc(e)?Cs(.1,Fs(.1,e)):Cs(.2,ys(.15,e));function id(e,t,n){if(e.startsWith(n))return e;const r=[e,t],a=JSON.stringify(r),i=btoa(a),o=new URL("/v1.0/t/link",n);return o.searchParams.set("d",i),o.toString()}function od(e){return"https://cdn.livechat-files.com/api/file/lc/main/default/logo/sz2tt7jpJ6VJwBo.png"===ut(e)}const sd=e=>{const{x:t,y:n,width:r,height:a}=e.target.getBoundingClientRect();return{x:t,y:n,width:r,height:a}},ud=(e,t)=>{const{name:n,email:r}=fe(e=>"string"==typeof e?Ye(e):e,Re(["email","name"],e));return n===t("client")?{email:r}:{email:r,name:n}},ld=e=>!!e&&(e=>{const t=it(e);return!t||"https:"===t||!1})(tu(e)),cd=e=>{var t;return{id:e.id,name:null!=(t=e.title)?t:"",text:e.description,icon:e.icon,action:{label:e.action.label,type:"button",value:e.action.url},properties:{}}},dd=(e,t)=>{var n,r,a,i;const o=fd("logo",e),s=o.enabled?ut(o.path):"",u=fd("boosters",e),l=null==(n=u.items)?void 0:n.find(e=>Fo(e.id)),c=null==(r=u.items)?void 0:r.find(e=>Ao(e.id)),d=null==(a=u.items)?void 0:a.find(e=>"links"===e.id),p=null==(i=e.getApplicationState("config").properties.license.feade1d6c3f17748ae4c8d917a1e1068)?void 0:i.hdLicenseID,h="number"==typeof p&&p>-1,f={apps:[]};l&&f.apps.push({...cd(l),trademarkLink:"https://www.knowledgebase.com/?utm_source=chat_window&utm_medium=referral&utm_campaign=home_screen",trademarkLinkAnchor:"Powered by KnowledgeBase"}),c&&h&&(f.apps.push(cd(c)),e.on("send_helpdesk_form",n=>{t(n).then(t=>e.emit("send_helpdesk_form_success",t)).catch(t=>e.emit("send_helpdesk_form_error",t))}),e.addView("HelpdeskTicketForm",{isLoading:!0,hasFetchingError:!1})),e.addView("Homescreen",f),mc(e,"livechatIntegration",{name:"livechat_integration",enabled:!0,properties:{licenseId:e.getApplicationState().license}}),d&&mc(e,"links",{enabled:!0,name:"links",properties:{links:d.links}}),e.setApplicationState({header:{text:"",logo:s,backgroundType:"gradient"}})},pd=e=>{const{currentChat:t}=e.getApplicationState();if(!t)throw new Error("Current chat is not set");return t},hd=(e,t)=>{const n=t.getChat(e).properties.currentAgent;return n?qp(t,n):null},fd=(e,t)=>t.getApplicationState("config").features[e],gd=e=>fd("continuousChat",e).enabled,md=e=>fd("chatHistory",e).enabled,_d=e=>!!e.getView("Chat").liveChatChatId.hasDividers,bd=e=>Ud(e)&&!gd(e),vd=(e,t,n)=>{let{authorPredicate:r,lastSeenPredicate:a}=t;const i=n.getEvents(e),o=He(e=>r(e)||!e.seen,ye(a,i),i);return Ue(r,o)},Dd=(e,t,n)=>{const r=n.getSessionUserId();return vd(e,{authorPredicate:e=>e.author!==r,lastSeenPredicate:e=>(e.serverTimestamp||e.timestamp)<=t},n)},yd=(e,t,n)=>{const r=n.getSessionUserId();return vd(e,{authorPredicate:e=>e.author===r,lastSeenPredicate:e=>e.timestamp<=t},n)},wd=(e,t,n)=>{const r=e.getEvent(t,n);if("message_draft"===r.type&&null===r.serverId){const n=ve(e=>"message_draft"===e.type,e.getEvents(t));return r.id===(null==n?void 0:n.id)?e.localize("not_sent_yet"):null}if(!r.own)return null;if(r.failed)return"Message not sent";if(r.seen){const r=e.getLastSeenEvent(t);return r&&n===r.id?e.localize("message_read"):null}const a=e.getLastDeliveredEvent(t);return a&&n===a.id?e.localize("message_delivered"):null},Cd=e=>{const t=e.getApplicationState("config");return!0===e.getApplicationState("mobile")?t.mobileMinimizedType:t.minimizedType},Ed=e=>{const{config:t}=e.getApplicationState();return!0===e.getApplicationState("mobile")?t.mobileScreenPosition:t.screenPosition},kd=(e,t)=>md(e)&&e.getChat(t).properties.hasMoreHistory,Ad=(e,t)=>{const{fakeAgentMessageId:n}=e.getChat(t).properties;return n?e.getEvent(t,n):null},Fd=(e,t)=>!!Ad(e,t),xd=e=>{const{embedded:t,actingAsDirectLink:n,isInCustomContainer:r,isMinimizedForcefullyDisabled:a}=e.getApplicationState();return!(!t||n||r||a)},Id=(e,t)=>{const{active:n,properties:{queued:r}}=t.getChat("liveChatChatId");if(n||r)return!1;const{availability:a,readyState:i}=t.getApplicationState();return"online"===a&&("not_ready"===i||(!Ep(t,"maximized")||xe(t.getEvents(e))))},Sd=(e,t)=>{if(md(t))return!1;const{availability:n,embedded:r,actingAsDirectLink:a,isInCustomContainer:i,defaultWidget:o}=t.getApplicationState(),s=t.getChat(e);return"livechat"===o&&r&&!a&&!i&&!s.active&&!s.properties.ended&&"offline"===n&&!Ud(t)},Td=e=>"connected"===e.getConnectionState(),Bd=e=>"disconnected"===e.getConnectionState(),zd=e=>"reconnecting"===e.getConnectionState()||Bd(e),Md=(e,t)=>{if(t<0)return null;const n=e[t];return n.own&&"message"===n.type?null:"system_message"===n.type||"rich_message_postback"===n.type?Md(e,t-1):n.properties.quickReplies?n:null},Pd=(e,t)=>{const n=t.getEvents(e),r=Md(n,n.length-1);return r&&(r.properties.invitation||t.getChat(e).active)?r:null},Od=(e,t)=>{const{availability:n}=t.getApplicationState(),{active:r,properties:{queued:a,ended:i}}=t.getChat(e);if(a)return t.localize("embedded_waiting_for_operator");const o=hd(e,t);return r&&o?t.localize("embedded_chat_with",{operator:o.name}):i?t.localize("embedded_chat_ended"):"online"===n?t.localize("embedded_chat_now"):Ud(t)||gd(t)?t.localize("embedded_leave_message"):t.localize("agents_not_available")},jd=(e,t)=>{var n;const r=e.getChat(t),a=gd(e);if(e.getApplicationState().limitReached)return null;if(Kd(e)&&!ep(e))return null;if("chatbotChatId"===t&&!r.properties.ended&&!1===(null==(n=fd("chatbotIntegration",e))?void 0:n.properties.showTextField))return r.properties.isAnsweringQuestion?"text":null;if(r.active){var i;const n=sp(e),r=e.getChat(t).properties.currentAgent;return null!=n&&null!=(i=n.properties)&&i.useFixedAnswers&&(null==n?void 0:n.author)===r?null:"text"}return bp(e,t)||Ld(e)?null:!r.properties.ended||a&&!qd(e)&&"chatbotChatId"!==t?a||"offline"!==e.getApplicationState().availability?Fd(e,"liveChatChatId")?qd(e)&&fd("preChatAfterGreeting",e).enabled?a&&"offline"===e.getApplicationState().availability?null:"requestPrechat":null!=(o=hd(t,e))&&o.properties.isBot&&!r.properties.starting||Nd(e)?"startChat":"text":a?qd(e)?"offline"===e.getApplicationState().availability?null:"requestPrechat":"text":a&&r.properties.ended?"text":null:null:"startChatAgain";var o},Rd=(e,t)=>!!t.getChat(e).properties.starting,$d=e=>e.getApplicationState("config").theme.name,qd=e=>e.getApplicationState().config.features.preChatForm.enabled,Ud=e=>e.getApplicationState().config.features.ticketForm.enabled,Ld=function(e,t){void 0===t&&(t=void 0);const n=ve(e=>"form"===e.type,e.getEvents("liveChatChatId"));if(!n)return!1;const{properties:r}=n;return!r.answered&&"ask_for_email"!==r.formId&&("string"!=typeof t||r.formType===t)},Nd=e=>{const{properties:{groupHasProbableQueue:t}}=e.getChat("liveChatChatId");return!!t},Vd=e=>{const{active:t,properties:{queued:n,ended:r,startChatAgainPending:a,currentAgent:i}}=e.getChat("liveChatChatId"),{availability:o,limitReached:s}=e.getApplicationState(),u=gd(e),l=Ud(e);return!(!s||l&&!u)||"offline"===o&&(!(r&&!a)&&(u?!i&&!n:!t&&!n&&!l))},Hd=e=>{const t=pd(e);return Boolean(hd(t,e))&&!("modern"===$d(e)&&Ld(e))&&!((e,t)=>!!t.getChat(e).properties.queued)(t,e)&&!Vd(e)},Zd=e=>{var t;return Boolean(null==(t=e.getView("Homescreen"))||null==(t=t.apps)?void 0:t.find(e=>Ao(e.id)))},Gd=e=>{const t=e.getApplicationState().defaultWidget,n=pd(e);return"openAIChatId"===n||"chatbotChatId"===n?!e.getChat(n).properties.agentIsTyping&&("Chat"===e.getCurrentView()&&gp(e)):("openwidget"!==t||"Chat"===e.getCurrentView())&&(!(!Kd(e)||e.getView("Chat/queue"))||!_p(e)&&gp(e))},Yd=e=>{const t=e.getLastEvent("liveChatChatId");return!!t&&("form"===t.type&&"ticket"===t.properties.formType&&t.properties.answered)},Wd=e=>{const{nonProfitLicense:t}=e.getApplicationState("config");return t},Jd=e=>{const{actingAsDirectLink:t,isInCustomContainer:n,mobileWrapper:r,embedded:a}=e.getApplicationState();return!t&&!n&&(r||a)},Qd=e=>Boolean(e.getApplicationState("invitation").current),Xd=e=>{const{lastThread:t,currentAgent:n,queued:r}=e.getChat("liveChatChatId").properties;if(!gd(e)||n||r)return!1;return!!!ve(e=>{let{type:n,thread:r}=e;return"email_prompt"===n&&r===t},e.getEvents("liveChatChatId"))},Kd=e=>e.getChat("liveChatChatId").properties.queued,ep=e=>{var t;return Boolean(null==(t=fd("queue",e))?void 0:t.writingInQueueEnabled)},tp=e=>fd("fileSharing",e).enabled,np=e=>{const{active:t}=e.getChat("liveChatChatId");return t&&!zd(e)},rp=e=>!zd(e)&&!e.getApplicationState("disableSendingMessage"),ap=Qr([e=>da(e,"liveChatChatId"),e=>pa(e,"liveChatChatId").properties.lastThread],(e,t)=>{return He(e=>e.thread===t,(n=e).length-1,n);var n}),ip=e=>ap(e.getState()),op=Qr([e=>ap(e),e=>Da(e)],(e,t)=>ve(e=>"system"!==e.author&&e.author!==t,e)),sp=e=>op(e.getState()),up=(e,t)=>{if(e.hasEvent("liveChatChatId",t)){const{properties:n}=e.getEvent("liveChatChatId",t);return n.invitation}return!1},lp=e=>!e.getApplicationState().mobile&&"bar"===Cd(e),cp=e=>{const t=Ad(e,"liveChatChatId");return t&&t.properties.invitation?t:null},dp=function(e,t){void 0===t&&(t=cp(e));const{availability:n,invitation:r}=e.getApplicationState();return!("offline"!==n&&!lp(e))||(!t||Boolean(t&&Fe(t.properties.uniqueId,r.hiddenIds)))},pp=function(e,t){void 0===t&&(t=cp(e));const{invitation:n}=e.getApplicationState();return Boolean(t&&Fe(t.properties.uniqueId,n.displayedIds))},hp=e=>!ip(e).some(e=>{let{author:t,own:n}=e;return!n&&"system"!==t}),fp=e=>{const{formType:t,fields:n,answered:r}=e.properties,a=n.filter(e=>e.answer&&e.label);return"ticket"!==t&&r&&xe(a)},gp=e=>{const t=pd(e),n=e.getEvents(t);return xe(n)||n.every(e=>"form"===e.type&&fp(e))},mp=e=>{const t=e.getEvents("liveChatChatId");return xe(t)||t.every(e=>"form"===e.type&&fp(e)||e.properties.invitation||e.properties.welcomeMessage)},_p=e=>Hd(e)||Vd(e)||Kd(e),bp=(e,t)=>e.getEvents(t).some(e=>"message_draft"===e.type&&null===e.serverId),vp=e=>{const{embedded:t,actingAsDirectLink:n}=e.getApplicationState();return!t||n?"direct_link":"code"},Dp=Qr([e=>ap(e)],e=>e.filter(e=>"file"===e.type&&!e.delivered&&!e.properties.canceled)),yp=e=>Dp(e.getState()),wp=e=>e.getChat("liveChatChatId").serverId,Cp=e=>{const{mobile:t}=e.getApplicationState();return fd(t?"mobileMinimized":"minimized",e).enabled},Ep=(e,t)=>e.getApplicationState("visibility").state===t,kp=(e,t)=>{const n=e.getApplicationState("config").properties.license;return Object.keys(n).some(e=>n[e][t])},Ap=e=>fd("hideTrademark",e).enabled,Fp=(e,t)=>e.getApplicationState("config").properties.license[t],xp=e=>{const{language:t,isPreview:n}=e.getApplicationState();if("en"!==t||n)return!1;const r=Fp(e,"a9f288b2883da20306d30e179067406f");return Boolean(null==r?void 0:r.transfer_identity_enabled)},Ip=e=>{const t=Fp(e,"632cead4b282481a422dd4e1d1567449");return{url:null==t?void 0:t.widget_message_box_moment_url,height:null==t?void 0:t.widget_message_box_moment_height}},Sp=e=>{var t;const{url:n}=Ip(e);return{disabled:!e.getChat("liveChatChatId").active||!hd("liveChatChatId",e),visible:ld(n)&&(null==(t=e.getView("Moment"))||null==(t=t.data)?void 0:t.url)!==n}},Tp=e=>e.getChat("liveChatChatId").active?e.getChat("liveChatChatId").properties.lastThread:null,Bp=e=>e.getView("minimized"),zp=e=>{const{history:t,updatedAt:n}=e.getApplicationState("locationHistory");return n-(new Date).getTime()>18e5?[]:t},Mp=e=>{var t;return Boolean(null==(t=e.getApplicationState("recommendations"))?void 0:t.isVisible)},Pp=e=>e.localize(e.getApplicationState("limitReached")||!gd(e)?"agents_not_available":"agents_not_available_continuous"),Op=e=>{const t=e.getView("Chat/queue"),n=t&&t.numberInQueue,r=t&&t.waitingTime;return(e=>{const t=e.localize("user_in_queue"),{fields:n}=e.getView("Chat/prechat");if(!n||xe(n))return t;const r=n.find(e=>{let{meta:t}=e;return t&&"groupSelect"===t});if(!r||!r.options||xe(r.options))return t;const a=r.options.find(t=>{let{groupNumber:n}=t;return n===e.getApplicationState("group")});return a&&a.queueTemplate?a.queueTemplate:t})(e).replace(/%number%/g,"**"+n+"**").replace(/%minutes%/g,"**"+Math.floor(r/60)+"**")},jp=e=>{if(e.getApplicationState("isPreview"))return!1;if(!fd("rating",e).enabled)return!1;if(zd(e))return!1;const{active:t,properties:{rate:n}}=e.getChat("liveChatChatId");if(!t||n)return!1;return(e=>{const{properties:{timestamp:t}}=e.getChat("liveChatChatId");if(!t)return 0;const n=ip(e);if(!n||0===(null==n?void 0:n.length))return 0;const r=ve(e=>"system_message"!==e.type,n);return r?r.timestamp-t:0})(e)/1e3/60>2&&(e=>ip(e).some(e=>{let{author:t,own:n,properties:r}=e;return!n&&"system"!==t&&!r.invitation&&!r.welcomeMessage}))(e)},Rp=e=>"offline"===e.getApplicationState("availability"),$p=e=>{if(!fd("homeScreen",e).enabled)return!1;return!("modern"===$d(e))},qp=(e,t)=>{const n=e.getUser(t);var r;return"openai_bot"===n.id?{...n,avatar:null!=(r=n.avatar)?r:"https://cdn.files-text.com/api/ow/img/integrations/openai/orb.gif"}:n},Up=(e,t)=>{if(!t)return"_blank";if("chatbotChatId"!==pd(e))return"_blank";const{page:n}=e.getApplicationState();return Xe(t)===Xe(n.url)?"_parent":"_blank"},Lp=e=>{const t=cp(e);return t&&t.properties.quickReplies?t:null},Np={};function Vp(e,t){let{query:n={},jsonpParam:r="jsonp",callbackName:a}=void 0===t?{}:t;return new Promise((t,i)=>{Ls().then(o=>{const s=document.createElement("script"),u=a||ke(Np);Np[u]=!0;const l="__"+u;window[l]=e=>{delete Np[u],delete window[l],Ns(s),t(e)},s.src=e+"?"+O({...n,[r]:l}),s.addEventListener("error",()=>{setTimeout(()=>i(new Error("JSONP request failed.")),100)}),o.appendChild(s)})})}const Hp=/\.([a-z]{1,})$/i,Zp=e=>{let{__priv:t}=e;const n={enabled:!0,x:parseInt(t.group["embedded_chat.eye_grabber.x"])+15,y:parseInt(t.group["embedded_chat.eye_grabber.y"]),src:ut(t.group["embedded_chat.eye_grabber.path"])};if(-1!==n.src.indexOf("/default/eyeCatchers/")){const e=n.src.match(Hp)[1];n.srcset={"1x":n.src,"2x":n.src.replace(new RegExp("\\."+e,"i"),"-2x."+e)}}return n},Gp=(e,t)=>{const n="get_dynamic_configuration"===e?"v3.6":"v3.4";return(e=>{let{region:t}=e;return"https://api"+(e=>e&&"dal"!==e?"-"+e:"")(t)+".livechatinc.com"})(t)+"/"+n+"/customer/action/"+e},Yp=e=>{let{licenseId:t,organizationId:n,region:r}=e;return Promise.resolve(r)},Wp=function(e,t){let{validateDefaultWidget:n=!0}=void 0===t?{}:t;return Vp(Gp("get_dynamic_configuration",e),{query:{...e.organizationId?{organization_id:e.organizationId}:{},...e.licenseId?{license_id:e.licenseId}:{},client_id:null!="c5e4f61e1a6c3b1521b541bc5c5a2ac5"?"c5e4f61e1a6c3b1521b541bc5c5a2ac5":"",url:st(e.url,["cw_configurator"]),..."number"==typeof e.groupId&&{group_id:e.groupId},...e.channelType&&{channel_type:e.channelType},...e.skipCodeInstallationTracking&&{test:1},...e.productName&&{origin:e.productName},...e.integrationName&&{implementation_type:e.integrationName}}}).then(t=>{if(t.error)switch(t.error.type){case"misdirected_request":return Wp({...e,region:t.error.data.region});case"license_not_found":{if("direct_link"===e.channelType){const t=O({utm_source:"expired_chat_link",utm_medium:"referral",utm_campaign:"lc_"+e.licenseId});window.location.replace("https://www.livechat.com/expired-chat-link/?"+t)}const t=new Error("License not found");throw t.code="LICENSE_NOT_FOUND",t}default:{const e=new Error(t.error.message);throw e.code=t.error.type.toUpperCase(),e}}if(1520!==e.licenseId&&"feaf6c0e-9f43-48ff-9ad0-8e24e0350932"!==e.organizationId||(t.default_widget="livechat"),n&&"livechat"!==t.default_widget){const e=new Error("The 'default_widget' is not 'livechat', but instead: '"+t.default_widget+"'");throw e.code="DEFAULT_WIDGET_NOT_LIVECHAT",e.organizationId=t.organization_id,e.defaultWidget=t.default_widget,e}if(!t.livechat_active){if("direct_link"===e.channelType){const t=O({utm_source:"expired_chat_link",utm_medium:"referral",utm_campaign:"lc_"+e.licenseId});window.location.replace("https://www.livechat.com/expired-chat-link/?"+t)}const t=new Error("License expired");throw t.code="LICENSE_EXPIRED",t}if(!t.livechat.domain_allowed){const e=new Error("Current domain is not added to the allowlist.");throw e.code="DOMAIN_NOT_ALLOWED",e}return r=t,a=e.region,{organizationId:r.organization_id,groupId:r.livechat.group_id,clientLimitExceeded:r.livechat.client_limit_exceeded,configVersion:r.livechat.config_version,localizationVersion:r.livechat.localization_version,onlineGroupIds:r.livechat.online_group_ids||[],region:a||null,language:r.livechat.language};var r,a})},Jp=e=>{var t,n;const r="feade1d6c3f17748ae4c8d917a1e1068",a=Boolean(null==(t=e.properties.group[r])?void 0:t.forwardTicketFormToHelpdesk),i="1"===e.__priv.license["helpdesk.inbound_forwarding"],o=null==(n=e.properties.license[r])?void 0:n.hdLicenseID;return"number"==typeof o&&o>-1&&(a||i)},Qp=(e,t)=>t.includes(e)?e:t[0],Xp=e=>Vp(Gp("get_configuration",e),{callbackName:"lc_static_config",query:{organization_id:e.organizationId,version:e.version,..."number"==typeof e.groupId&&{group_id:e.groupId}}}).then(e=>(e=>{const{buttons:t,allowed_domains:n,prechat_form:r,ticket_form:a,__priv:i,properties:o,...s}=e,u="0"===i.group.tickets_enabled,l=!Boolean(i.disable_native_tickets)&&Boolean(a),c=Jp(e),d=u||c||l;return{...s,...r&&{prechatForm:Wn(r)},...d&&a&&{ticketForm:Wn(a)},properties:o,buttons:t.map(e=>"image"===e.type?{id:e.id,type:e.type,onlineValue:ut(e.online_value),offlineValue:ut(e.offline_value)}:{id:e.id,type:e.type,onlineValue:e.online_value,offlineValue:e.offline_value}),...n&&{allowedDomains:n},__unsafeProperties:{...i.s&&{s:!0},group:{chatBoosters:i.group.chat_boosters,disabledMinimized:"1"===i.group["chat_window.disable_minimized"],disabledMinimizedOnMobile:"1"===i.group["chat_window.mobile_disable_minimized"],disabledOnMobile:"1"===i.group["chat_window.hide_on_mobile"],eyeCatcher:"1"===i.group["embedded_chat.display_eye_catcher"]?Zp(e):{enabled:!1},hasAgentAvatarsEnabled:"1"===i.group["chat_window.display_avatar"],hasCustomMobileSettings:"1"===i.group["chat_window.custom_mobile_settings"],hasHiddenTrademark:"1"===i.group["chat_window.hide_trademark"],hasSoundsEnabled:"0"===i.group["chat_window.disable_sounds"],initiallyHidden:"1"===i.group["chat_window.hide_on_init"]||"1"===i.group["chat_window.disable_minimized"],initiallyHiddenOnMobile:"1"===i.group["chat_window.mobile_hide_on_init"]||"1"===i.group["chat_window.mobile_disable_minimized"],hideOnInit:"1"===i.group["chat_window.hide_on_init"],language:i.group.language,linksUnfurlingEnabled:"1"===i.group.links_unfurling,logo:"1"===i.group["chat_window.display_logo"]?{enabled:!0,src:i.group["chat_window.logo_path"]}:{enabled:!1},minimizedType:Qp(i.group["chat_window.theme.minimized"],["circle","bar"]),minimizedTypeOnMobile:i.group["chat_window.mobile_minimized_theme"],offlineMessagesEnabled:u,offsetX:parseInt(i.group["chat_window.offset_x"]),offsetXOnMobile:parseInt(i.group["chat_window.mobile_offset_x"]),offsetY:parseInt(i.group["chat_window.offset_y"]),offsetYOnMobile:parseInt(i.group["chat_window.mobile_offset_y"]),prechatFormAfterGreetingEnabled:"1"===i.group.pre_chat_survey_after_greeting,ratingEnabled:"1"===i.group["rate_me.enabled"],screenPosition:Qp(i.group["chat_window.screen_position"],["right","left"]),screenPositionOnMobile:Qp(i.group["chat_window.mobile_screen_position"],["right","left"]),transcriptButtonEnabled:"1"===i.group["chat_window.display_transcript_button"],theme:{name:Qp(i.group["chat_window.new_theme.name"],["smooth","modern"]),variant:Qp(i.group["chat_window.new_theme.variant"],["light","dark"]),customJson:i.group["chat_window.new_theme.custom_json"],agentbarBackgroundColor:i.group["chat_window.new_theme.agentbar_background_color"],agentbarText:i.group["chat_window.new_theme.agentbar_text"],agentMessageColorBackground:i.group["chat_window.new_theme.agent_message_color_background"],agentMessageColorText:i.group["chat_window.new_theme.agent_message_color_text"],backgroundColor:i.group["chat_window.new_theme.background_color"],ctaColor:i.group["chat_window.new_theme.cta_color"],minimizedColorBackground:i.group["chat_window.new_theme.minimized_color_background"],minimizedColorIcon:i.group["chat_window.new_theme.minimized_color_icon"],minimizedColorText:i.group["chat_window.new_theme.minimized_color_text"],systemMessageColor:i.group["chat_window.new_theme.system_message_color"],titlebarBackgroundColor:i.group["chat_window.new_theme.titlebar_background_color"],titlebarText:i.group["chat_window.new_theme.titlebar_text"],visitorMessageColorBackground:i.group["chat_window.new_theme.visitor_message_color_background"],visitorMessageColorText:i.group["chat_window.new_theme.visitor_message_color_text"]}},license:{creditCardMaskingEnabled:"1"===i.license.mask_credit_cards,nonProfit:"1"===i.license.non_profit,licenseinboundForwardingToHelpdeskEnabled:"1"===i.license["helpdesk.inbound_forwarding"]},helpdeskIntegrationEnabled:c,ticketFormMode:(p=e,Jp(p)?"helpdesk":"0"===p.__priv.group.tickets_enabled?"offline_message":"livechat")}};var p})(e)),Kp=e=>Vp(Gp("get_localization",e),{callbackName:"lc_localization",query:{organization_id:e.organizationId,version:e.version,language:e.language,..."number"==typeof e.groupId&&{group_id:e.groupId}}}).then(e=>Te(e=>e.toLowerCase(),e));export{oe as $,de as A,Do as B,ro as C,Gu as D,pa as E,Ia as F,kl as G,gd as H,Qd as I,Cd as J,Fl as K,uo as L,Hu as M,Yc as N,md as O,kd as P,ip as Q,oo as R,so as S,Se as T,$p as U,Cl as V,xe as W,_e as X,Ee as Y,fe as Z,Dl as _,ot as a,ta as a$,Z as a0,me as a1,xo as a2,Bl as a3,Ju as a4,Tl as a5,qe as a6,ke as a7,ul as a8,dp as a9,Lr as aA,Yl as aB,Wl as aC,ze as aD,Ol as aE,ut as aF,Qc as aG,Ls as aH,_c as aI,dd as aJ,Zd as aK,ru as aL,nn as aM,N as aN,he as aO,J as aP,ja as aQ,Ra as aR,La as aS,Na as aT,ai as aU,oi as aV,Za as aW,Ga as aX,Wa as aY,aa as aZ,Ma as a_,Qu as aa,vo as ab,Fa as ac,ic as ad,ha as ae,lo as af,Zl as ag,Hl as ah,Fe as ai,Cp as aj,yl as ak,wl as al,Vc as am,Gc as an,So as ao,Vs as ap,Ns as aq,Us as ar,yu as as,Te as at,Ce as au,Ne as av,Au as aw,Ml as ax,Fs as ay,Ae as az,Uc as b,mu as b$,Oa as b0,ri as b1,ii as b2,si as b3,ti as b4,ui as b5,ni as b6,Ja as b7,sa as b8,_a as b9,Be as bA,un as bB,Sa as bC,on as bD,li as bE,hi as bF,ml as bG,Oe as bH,Wu as bI,Ke as bJ,$o as bK,se as bL,$e as bM,Uo as bN,qo as bO,ys as bP,Ye as bQ,xr as bR,iu as bS,Ts as bT,zs as bU,Is as bV,wu as bW,Es as bX,Xc as bY,Ps as bZ,Up as b_,ra as ba,na as bb,sn as bc,Ya as bd,Ie as be,Zr as bf,Me as bg,$a as bh,qa as bi,Ua as bj,be as bk,Ha as bl,Xa as bm,Qa as bn,ei as bo,Ka as bp,Nr as bq,Pa as br,Va as bs,za as bt,fa as bu,Je as bv,ma as bw,Pe as bx,ve as by,ln as bz,ge as c,il as c$,Xu as c0,Ku as c1,$d as c2,xp as c3,mo as c4,sd as c5,Cc as c6,tu as c7,_o as c8,nd as c9,xu as cA,Su as cB,Mu as cC,Fu as cD,Re as cE,Xe as cF,ac as cG,Bp as cH,Rc as cI,Gl as cJ,zc as cK,pp as cL,Ve as cM,Ed as cN,Uu as cO,Lu as cP,Vu as cQ,Nu as cR,Ou as cS,ju as cT,Ru as cU,qu as cV,$u as cW,Mp as cX,sl as cY,tl as cZ,rl as c_,nu as ca,tt as cb,Ec as cc,kc as cd,Kl as ce,kp as cf,oc as cg,pd as ch,wp as ci,Ap as cj,Jd as ck,Ur as cl,Yu as cm,Lc as cn,id as co,fd as cp,gu as cq,hu as cr,fu as cs,pu as ct,du as cu,Bu as cv,zu as cw,Pu as cx,Tu as cy,Iu as cz,dl as d,jo as d$,ol as d0,al as d1,nl as d2,cp as d3,hd as d4,Od as d5,tp as d6,np as d7,cu as d8,Qr as d9,fs as dA,To as dB,od as dC,Hd as dD,Kd as dE,Pp as dF,Op as dG,mp as dH,rt as dI,Wd as dJ,Gd as dK,Ao as dL,Ue as dM,el as dN,it as dO,Fo as dP,bd as dQ,Ld as dR,Lp as dS,bs as dT,os as dU,ud as dV,fp as dW,bp as dX,wd as dY,rd as dZ,sp as d_,U as da,yp as db,yd as dc,Pc as dd,ec as de,Ip as df,Nl as dg,zd as dh,rp as di,Sp as dj,cc as dk,Mc as dl,jd as dm,jp as dn,Kr as dp,qp as dq,tc as dr,uc as ds,Tp as dt,up as du,uu as dv,po as dw,_d as dx,Pd as dy,Vd as dz,mc as e,dc as e$,Nt as e0,Lt as e1,qt as e2,$t as e3,Ut as e4,xt as e5,tn as e6,pt as e7,kt as e8,Pt as e9,ht as eA,ft as eB,gt as eC,mt as eD,bt as eE,vt as eF,Dt as eG,yt as eH,Ct as eI,At as eJ,It as eK,St as eL,zt as eM,Ot as eN,jt as eO,xd as eP,ce as eQ,le as eR,Bd as eS,Al as eT,io as eU,ao as eV,sc as eW,Oc as eX,Sd as eY,Jl as eZ,Fd as e_,Ht as ea,wt as eb,Yt as ec,Vt as ed,en as ee,Kt as ef,Jt as eg,Wt as eh,Gt as ei,xn as ej,Zt as ek,Xt as el,Qt as em,_t as en,cn as eo,Bt as ep,Ft as eq,ir as er,ar as es,rr as et,Rt as eu,Et as ev,Tt as ew,Mt as ex,ct as ey,dt as ez,Zu as f,lc as f0,qd as f1,Ac as f2,Td as f3,Dd as f4,Ic as f5,Rd as f6,El as f7,bc as f8,gc as f9,ye as fA,lu as fB,Oo as fC,Po as fD,Ro as fE,Bo as fF,zo as fG,Mo as fH,go as fa,pc as fb,Ud as fc,Yd as fd,Sc as fe,xc as ff,yc as fg,G as fh,pe as fi,Ad as fj,vp as fk,fo as fl,Ql as fm,hp as fn,Vl as fo,vc as fp,Ll as fq,co as fr,Dc as fs,Id as ft,ho as fu,Tc as fv,Xd as fw,Bc as fx,bo as fy,Co as fz,qc as g,Yp as h,Ep as i,Wp as j,Xp as k,Kp as l,ne as m,au as n,je as o,ee as p,fc as q,$c as r,hc as s,gl as t,lt as u,ll as v,Io as w,re as x,te as y,K as z};