;var synalio=(function(){var a="1.12";var b="_rslgvry"; ; ;var g="left: auto;right: 0px;"; ; ;var c="z-index: 999999998;position:fixed; bottom: 0px;border: 0px;background: none;"+g;var i="height: 550px;";var e="height:52px;";var f="width:420px;"; ;var j;var k="4975b680348e40feab34ba50c4e478c1";var l=false;var m=false;var n=1;var o= 30;var p;var q=[];var r="カスタマーサポート";var s="https://s3-ap-northeast-1.amazonaws.com/rebot-line-resized/37/1e51347917024408bb4e567790711c3d.png/origin";var t=[];var u;var v;var w;var x;var y;var z;var A;var B;var C;var D=1;var E;var F;var G=[];var H=0;var I="";var J="メニューに戻る";var K={};var L="None";var M=(L!=='None')?JSON.parse(L.replace(/'/g,'"')):[]; ; ;var N='
  • User Avatar

    @1

  • ';var O='
  • @1

  • ';var P='

    @1

    ';var Q='
    ';var R='
  • @1
  • ';var S='
    ';var T='
  • @1
  • ';var U='
    ご利用ありがとうございます。
    よろしければ、今後の改善のため、オペレータに対する評価をお願いいたします。
    ';;var V=[];var W=11;var X=30;var Y= 0;var Z='';var ab= -1;function ac(a){var b=document.createElement('template');b.innerHTML=a;if(b.content)return b.content;else return b.firstElementChild;}function ad(a,b,c,d,e,f){if(!b){ay(ac(O.replace(/@1/g,a.replace(/\r?\n/g,'
    '))));aA(1);}if(F)clearTimeout(F);xhr=new XMLHttpRequest();xhr.onreadystatechange=ap;xhr.onerror=ar;xhr.ontimeout=ar;xhr.open('POST','https://rebot.resola.ai/api/web');xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(as(a,c,d,e,f));}function ae(a,b){if(!a.match(/^https?:\/\//i))a='//'+a;window.open(a,b);}function af(){xhr_page=new XMLHttpRequest();xhr_page.onreadystatechange=al;xhr_page.open('POST','https://rebot.resola.ai/api/web/4975b680348e40feab34ba50c4e478c1/move_page');xhr_page.setRequestHeader('Content-Type','application/json');var a={s:Z,title:x.title,url:location.href};if(Object.keys(K).length>0)a.ext=K;xhr_page.send(JSON.stringify(a));}function ag(a){if(Y!=1){var b=new XMLHttpRequest();b.open('POST','https://rebot.resola.ai/analytics/event');b.setRequestHeader('Content-Type','application/json');b.send(JSON.stringify(a));}}function ah(a){var b='268'!='-1';if(!b)return;E=new XMLHttpRequest();E.onreadystatechange=ak;E.open('POST','https://rebot.resola.ai/api/web/4975b680348e40feab34ba50c4e478c1/chat_logs');E.setRequestHeader('Content-Type','application/json');E.send(JSON.stringify({s:a}));}function ai(a,b,c,d,e,f){xhr_state=new XMLHttpRequest();xhr_state.open('POST','https://rebot.resola.ai/api/web/4975b680348e40feab34ba50c4e478c1/auto_message');xhr_state.setRequestHeader('Content-Type','application/json');xhr_state.send(JSON.stringify({s:a,state:b,response:c,reply:d,node:e,scenario_response:f}));}function aj(a){xhr_state=new XMLHttpRequest();xhr_state.open('POST','https://rebot.resola.ai/api/web/4975b680348e40feab34ba50c4e478c1/satisfaction_survey');xhr_state.setRequestHeader('Content-Type','application/json');xhr_state.send(JSON.stringify(a));}function ak(){switch(E.readyState){case 4:if(((200<=E.status&&E.status<300)||(E.status==304))&&E.responseText){var a=JSON.parse(E.responseText);Z=a.s;q=a.logs;if(a.is_rtchat)aF();aP(a.is_rtchat);var c=2*365*24*60*60;x.cookie=aM(b+'='+Z+';max-age='+c+';path=/;');if(q.length>0&&ab<0){l=true;if(H>0)ax();q.forEach(function(a){an(a);});var d=q[q.length-1];if((d.type==='bot'||d.type==='admin_user'||d.type==='end_user')&&d.buttons)aq(d); ;var e=aN('r_window');if(e==='on')synalio.toggle(0);else if(t.length>0)aO(); ;setTimeout(function(){ ;synalio.resize(u.offsetHeight); ;aA(1);},300);}else{ ;var f={'event_type':'page_start','event_data':{'unique_id':k,'user_id':Z}};ag(f);}af(); ;if(H==0){} ;H=0;}break;}}function al(){switch(xhr_page.readyState){case 4:if(((200<=xhr_page.status&&xhr_page.status<300)||(xhr_page.status==304))&&xhr_page.responseText){var a=JSON.parse(xhr_page.responseText);Z=a.s;if(a.reserve)F=setTimeout(function(){var b={'event_type':'chat_opened','event_data':{'unique_id':k,'user_id':Z}};ag(b);am(a.reserve,Z);},a.reserve.time*1000);}break;}}function am(a,b){au(); ;av(); ;for(var d=0;d');if(a.type==='end_user')ay(ac(O.replace(/@1/g,msg)));else if(a.type==='bot')if(b){ay(ac(T.replace(/@1/g,a.text).replace(/@2/g,'input')));V.push('input');}else ay(ac(N.replace(/@2/g,r).replace(/@3/g,s).replace(/@1/g,msg)));else if(a.type==='admin_user'){var c=a.sender?a.sender:r;var d=a.sender_image?a.sender_image:s;ay(ac(N.replace(/@2/g,c).replace(/@3/g,d).replace(/@1/g,msg)));if(!a.is_read)t.push(a.msg_id);}}function ao(a){var b={};var c=a.elements;for(var d=0;d=2){ay(ac(T.replace('@1',f.replace(g[0],'')).replace(/@2/g,g[1])));V.push(g[1]);}else ay(ac(N.replace(/@2/g,r).replace(/@3/g,s).replace(/@1/g,f)));if(c==b.length)aA(1);b.shift();d=0;}if(b.length==0){aq(a);synalio.onCompleteWriteMessage(JSON.parse(xhr.responseText));return;}setTimeout(function(){j();},e);}}break;}}function aq(a){var b=0;if(a.buttons&&a.buttons.length>0){var c=[];var d=a.reply_deco||[];var e=0;for(var f=0;fe)g=d[e];e++;var h=a.buttons[f].img?a.buttons[f].img:a.buttons[f].label.replace(/"/g,'"');var i=a.buttons[f].img?Q:P;var j=a.buttons[f].url?a.buttons[f].url:a.buttons[f].msg.replace(/"/g,'"');var k=a.buttons[f].url&&a.buttons[f].url_target?a.buttons[f].url_target:'';c.push(i.replace(/@1/g,h).replace(/@2/g,j).replace(/@3/g,g).replace(/@4/g,k));}ay(ac(R.replace(/@1/g,c.join(''))));b=c.length;}else if(!a.no_button){var l=P.replace(/@1/g,J).replace(/@2/g,J).replace(/@3/g,'');if(V.length==0){b++;ay(ac(R.replace(/@1/g,l)));}} ;}function ar(){var a="
  • 送信に失敗しました。
    ネットワーク接続をご確認いただくか、お時間おいて再度お試しください。
  • ";ay(ac(a));}function as(a,b,c,d,e){if(!Z)Z=new Date().getTime().toString(16)+Math.floor(1000*Math.random()).toString(16);var f=[];var g=null;f.push("appid="+k);f.push("content="+encodeURIComponent(a));f.push("mode=web");f.push("s="+Z);if(Y==1)f.push("demo=1");if(b)f.push("button=1");if(c)f.push("init=1");if(d)f.push("image="+d);if(d)f.push("mime_type="+e);if(Object.keys(K).length>0)f.push("ext="+JSON.stringify(K));if(ab!="")f.push("scenario_id="+ab);for(var h=0;h0)while(b.length>0)a.removeChild(b[0]);}function av(){do{var a=V.shift();if(a!=undefined)aw(a);}while(a!=undefined);}function aw(a){var b=w.getElementsByName(a);for(var c=0;c0){var c=loader[0].parentNode.parentNode;c.parentNode.removeChild(c);}b.appendChild(a);if(b.childElementCount>X)b.removeChild(b.children[0]);}function az(a){au();var b=w.getElementsByClassName('synalio-chat-footer')[0];b.appendChild(a);}function aA(a){var b=w.getElementsByClassName("chat-message-body");if(b.length-a>=0){var c=b[b.length-a];var d=w.getElementsByClassName("synalio-chat-header")[0];var e=w.getElementsByClassName("synalio-chat-body")[0];smoothScr.stopShow();smoothScr.anim(c,e,d);}}var aB=function(a){a.preventDefault();};function aC(a){if(a===true)x.body.setAttribute('style',"position:fixed;overflow:hidden;width:100%;");else x.body.setAttribute("style","");}function aD(a){if(a.target.scrollHeight>=a.target.offsetHeight)if(a.target.scrollHeight<2*o)a.target.style.height=a.target.scrollHeight+"px";else a.target.style.height=2*o+"px";else{var b;for(var e=0;e<=10;e++){b=Number(a.target.style.height.split("px")[0]);a.target.style.height=b-o+"px";if(a.target.scrollHeight>a.target.offsetHeight){if(a.target.scrollHeight>o)a.target.style.height=a.target.scrollHeight+"px";else a.target.style.height=o+"px";break;}}} ;synalio.resize(u.offsetHeight); ;}function aE(a,b){return a.lastIndexOf(b,0)===0;}function aF(){if(p&&p.readyState==WebSocket.OPEN)return;var a="https:"==x.location.protocol?"wss":"ws";var b="//rebot.resola.ai";if(aE(b,"http"))p=new WebSocket("//rebot.resola.ai/chat/enduser/".replace(/https?/g,a)+k+"/"+Z);else p=new WebSocket(a+"://rebot.resola.ai/chat/enduser/"+k+"/"+Z);p.onmessage=aG;p.onopen=aH;p.onclose=aI;}function aG(a){var b=JSON.parse(a.data);if(b.disconnect){ ; ; ;aq({buttons:[{'label':'メニューへ戻る','msg':'メニューに戻る'}]});aA(1);aP(false);}else{l=true;var c=b.sender_image?b.sender_image:s;ay(ac(N.replace(/@2/g,b.sender).replace(/@3/g,c).replace(/@1/g,b.text.replace(/\r?\n/g,'
    '))));aA(1);t.push(b.msg_id);if(x.hasFocus())aK();aO();aP(true);}G.forEach(function(a){clearTimeout(a);});}function aH(){console.log('WS connected');if(H>0)ah(Z);aK();}function aI(){H++;if(H<50)setTimeout(function(){aF();},(H-1)*5000);}function aJ(a){var b=typeof document.createElement('input').checkValidity=='function';if(b)for(var c=0;c0){var a=w.getElementById('synalio-chat-window-notice-badge');a.innerHTML=t.length;a.style.display='block';} ;}function aP(a){if(a){w.getElementById('synalio-chat-footer-rtchat').style.display='block'; ;}else{w.getElementById('synalio-chat-footer-rtchat').style.display='none'; ;} ;}function aQ(a){if(a!==undefined&&a!=null){var b='http://';var c='https://';var d=a.replace(/\[.+\]/g,'');if((d.length>b.length&&d.substr(0,b.length)==b)||(d.length>c.length&&d.substr(0,c.length)==c))return true;}return false;}smoothScr={iterr:20,tm:null,step:null,lastScrollTop:null,stopShow:function(){clearTimeout(this.tm);this.iterr=30;},anim:function(a,b,c){var d=(a.offsetTop-c.offsetHeight-b.scrollTop)/5.0;b.scrollTop+=d;if(this.iterr>1)this.iterr-=1;else this.itter=0;if(this.lastScrollTop!=b.scrollTop&&d>1&&b.scrollTop';ad('画像受信',true,false,false,b,c);ay(ac(O.replace(/@1/g,d)));},onPressGoHome:function(){ad(J,false,true);},onCompleteWriteMessage:function(a){},onCompleteToggle:function(a){},onCompleteLoad:function(){},resize:function aR(a){A.style.height=(a-z.offsetHeight-B.offsetHeight)+"px";},onFormChanged:function(a){if(!a||a.nodeName!=="FORM")return;var b,c,d=[],e={},f={},g={};for(b=a.elements.length-1;b>=0;b=b-1){if(a.elements[b].name==="")continue;if(a.elements[b].nodeName=='INPUT'){var h=a.elements[b].getAttribute('type');if(h=='checkbox'){if(!(a.elements[b].name in e))e[a.elements[b].name]=[];if(a.elements[b].checked)e[a.elements[b].name].push(a.elements[b].value);}else if(h=='radio'){if(!(a.elements[b].name in g))g[a.elements[b].name]='';if(a.elements[b].checked)g[a.elements[b].name]=a.elements[b].value;}else d.push(a.elements[b].name+"="+a.elements[b].value);}else if(a.elements[b].nodeName=='TEXTAREA')d.push(a.elements[b].name+"="+a.elements[b].value);else if(a.elements[b].nodeName=='SELECT'){if(a.elements[b].type=='select-one')d.push(a.elements[b].name+"="+a.elements[b].value);else if(a.elements[b].type=='select-multiple'){if(!(a.elements[b].name in f))f[a.elements[b].name]=[];for(c=a.elements[b].options.length-1;c>=0;c=c-1)if(a.elements[b].options[c].selected)f[a.elements[b].name].push(a.elements[b].value);}}else if(a.elements[b].nodeName=='BUTTON'){var h=a.elements[b].getAttribute('type');if(h=='button')d.push(a.elements[b].name+"="+a.elements[b].value);}}for(var i in e)d.push("checkbox_"+i+"="+JSON.stringify(e[i]));for(var j in f)d.push("selectbox_"+j+"="+JSON.stringify(f[j]));for(var k in g)d.push(k+"="+g[k]);var l=d.join("&");w.getElementById(a.getAttribute('name')+'-form-data').value=l;},onSubmitForm:function(a){var b=a.getAttribute("form-name");var c=w.getElementById(b);if(!c||!c.checkValidity())return aJ(c);var d=a.getAttribute("form-data-id");var e=w.getElementById(d).value;if(!e||e===''){synalio.onFormChanged(c);e=w.getElementById(d).value;}if(e){var f='##form:'+b+'##'+e;ad(f,true);av();}au();return false;},onFocusEvent:function(){aK();},showCSForm:function(){var a=w.getElementsByClassName("cs-rating");for(var b=0;b0)g[g.length-1].style.display='none';var h=w.getElementsByClassName("cs-rating-done");if(h.length>0)h[h.length-1].style.display='block';aj(c);return false;},addExtVal:function(a,b){K[a]=b;}};})();var synalioWindow=window.parent?window.parent:window;if(document.readyState=='complete')synalio.onLoadEvent();else synalioWindow.addEventListener('load',synalio.onLoadEvent,true);synalioWindow.addEventListener('focus',synalio.onFocusEvent);