PageSourceSearch

https://www.lifenet-seimei.co.jp/shared/karte/js/contact_fw.min.js?rev=31b2128a

js lifenet-seimei.co.jp collected 2026-09-24 17:09:23 UTC 15,072 bytes, 1 lines download raw bytes

1(()=>{function t(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}let e="ContactFW.logLevel",i="silent",a={debug:10,info:20,warn:30,error:40,silent:50};function s(){try{var t=window.localStorage.getItem(e);if(!t)return i;let a=t.toLowerCase();return["debug","info","warn","error","silent"].includes(a)?a:i}catch{return i}}function n(t,e){return(...i)=>{if(function(t){let e=s();return a[t]>=a[e]}(t))try{e(...i)}catch{}}}let o={level:function(){return s()},setLevel:function(t){try{window.localStorage.setItem(e,t)}catch{}},debug:n("debug",(...t)=>console.log("[DEBUG]",...t)),info:n("info",(...t)=>console.info("[INFO ]",...t)),warn:n("warn",(...t)=>console.warn("[WARN ]",...t)),error:n("error",(...t)=>console.error("[ERROR]",...t))};function r(){let t=window.location.search.match(/refDate=(.*?)(&|$)/);if(t&&t.length>0){let e=new Date(t[1]);if("Invalid Date"!==e.toString())return e}return new Date}function l(t){for(let e=0;e<t.length;e++)t[e].style.display="block",t[e].classList.remove("is-hidden")}function d(t){for(let e=0;e<t.length;e++)t[e].style.display="none",t[e].classList.add("is-hidden")}let h="data-cc-trigger-listening";class u{onPageChange(){o.debug("View.onPageChange"),this.updateElementBindings(),this.updateElementVisibility()}updateElementBindings(){o.debug("View.updateElementBindings"),this.karteNotReadyViewList=document.getElementsByClassName("js-krt--not-ready")}async updateElementVisibility(){o.debug("View.updateElementVisibility"),this.context.karteRuntime&&this.hideKarteNotReadyView()}hideKarteNotReadyView(){o.debug("View.hideKarteNotReadyView"),d(this.karteNotReadyViewList)}registerClickHandler(t,e,i){o.debug("View.registerClickHandler",t),this.clickHandlerRegistry[t]={invoker:e,execContext:i}}registerGlobalClickHandler(){if(o.debug("View.registerGlobalClickHandler"),document.body.getAttribute(h))return;document.body.setAttribute(h,"true"),document.addEventListener("click",i=>{if(void 0!==i.isTrusted&&!1===i.isTrusted)return;let a=i.target;a&&(t(a)||e(a))},!0);let t=t=>{for(let e in o.debug("View.fireTriggerIfMatch",t),this.clickHandlerRegistry)if(o.debug("checking",e),t.classList?.contains(e)){o.debug("match",e);let t=this.clickHandlerRegistry[e];return t.invoker.call(t.execContext),!0}return o.debug("no match"),!1},e=e=>{let i=e;o.debug("searching...",i.localName);for(let e=0;e<5;e++){if(null===(i=i.parentNode)||"body"===i.localName||"html"===i.localName)return null;if(t(i))return}}}constructor(e){t(this,"context",void 0),t(this,"karteNotReadyViewList",void 0),t(this,"clickHandlerRegistry",{}),o.debug("View constructor"),this.context=e,e.view=this,setTimeout(this.onPageChange.bind(this),500),this.registerGlobalClickHandler()}}let c="ログイン完了 >";class w{start(){let t=new URLSearchParams(window.location.search);"onCFTlogin"===t.get("act")&&null===t.get("error")?this.onOAuthLogin():this.onFirstLanding()}onOAuthLogin(){o.debug("ChatAuth.onOAuthLogin"),window.addEventListener("tokenStored",this.tokenStoredHandler),void 0===window.authClient&&void 0!==window.AuthLib&&(window.authClient=new window.AuthLib.AuthClient),o.info(c),setTimeout(()=>{window.authClient.updateTokenInfo(),this.onTokenStored()},5e3)}onFirstLanding(){o.debug("ChatAuth.onFirstLanding");let{lastAuth:t,personalInfoAvailable:e,visitorId:i,bootChat:a}=this.chatAuthParams;if(t){o.debug("last_auth found: "+t);let a=t.split(",");if(a.length>1)if(a[0]===i){let t=new Date(new Date(a[1]).getTime()+72e5);o.debug("last_auth valid thru: "+t.toString()),new Date<t?"OK"===e?(window.krt("send","chat_auth",{chat_personal_info_available:"OK"}),this.isChatPersonalInfoAvailableSet=!0,o.info("valid chat_auth exists.")):o.info("valid chat_auth exists. But is not OK."):o.info("last_auth is expired.")}else o.info("visitor_id is not matched.");else o.info("last_auth date is not found.")}else o.info("last_auth is not found.");a()}onTokenStored(){o.debug("ChatAuth.onTokenStored");let{visitorId:t,customerId:e,bootChat:i}=this.chatAuthParams;if(this.isTokenStoredEventHandled)return void o.info("onTokenStored already handled.");
1if(this.isTokenStoredEventHandled=!0,window.removeEventListener("tokenStored",this.tokenStoredHandler),void 0===window.authClient)return void o.error("authClient is not defined");try{let t=window.authClient.tokens.idToken.decodedValue["custom:customerId"];window.krt("send","identify",{user_id:t})}catch(t){o.error(t)}window.krt("send","chat_auth",{last_auth:t+","+new Date().toISOString(),chat_personal_info_available:"OK",previous_customer_id:e}),setTimeout(function(){let t=new URL(window.location.href);t.searchParams.delete("act"),window.history.replaceState(null,"",t.toString())},5e3),i(),window.krt("talk","show"),window.krt("talk","sendFromUser",{text:c})}constructor(e){t(this,"isChatPersonalInfoAvailableSet",void 0),t(this,"isTokenStoredEventHandled",void 0),t(this,"chatAuthParams",void 0),t(this,"tokenStoredHandler",this.onTokenStored.bind(this)),o.debug("ChatAuth constructor"),this.chatAuthParams=e,this.isChatPersonalInfoAvailableSet=null,this.isTokenStoredEventHandled=!1}}let g="chat",m="phone",b="js-krt-start-chat",C="krt-start-chat--busy";class p{bootChat(){this.onPageChange(),this.context.view.registerClickHandler(b,this.startChat,this)}onPageChange(){o.debug("Chat.onPageChange"),this.updateElementBindings(),this.updateElementVisibility(),this.isKarteChatInitialized||(this.initKarteChat(()=>{this.updateElementBindings(),this.updateElementVisibility()}),this.isKarteChatInitialized=!0)}updateElementBindings(){o.debug("Chat.updateElementBindings"),this.startChatButtonList=document.getElementsByClassName(b),this.disabledStartChatButtonList=document.getElementsByClassName("js-krt-start-chat--disabled"),this.operatorReadyViewList=document.getElementsByClassName("js-krt-chat-operator-view--ready"),this.operatorNotReadyViewList=document.getElementsByClassName("js-krt-chat-operator-view--not-ready")}async updateElementVisibility(){o.debug("Chat.updateElementVisibility");let t=await this.context.businessHours.isBusinessHours(g),e=t&&this.isChatOperatorReady;o.debug("isChatAvailable: ",t,this.isChatOperatorReady),this.lastIsChatAvailable!==e&&(this.lastIsChatAvailable=e,e?(this.showStartChatButton(),this.showChatOperatorReadyView()):(this.hideStartChatButton(),this.hideChatOperatorReadyView()))}showStartChatButton(){o.debug("showStartChatButton"),l(this.startChatButtonList),d(this.disabledStartChatButtonList)}hideStartChatButton(){o.debug("hideStartChatButton"),d(this.startChatButtonList),l(this.disabledStartChatButtonList)}showChatOperatorReadyView(){o.debug("showChatOperatorReadyView"),l(this.operatorReadyViewList),d(this.operatorNotReadyViewList)}hideChatOperatorReadyView(){o.debug("hideChatOperatorReadyView"),d(this.operatorReadyViewList),l(this.operatorNotReadyViewList)}updateChatStartButtonBusyState(t){o.debug("updateChatStartButtonBusyState"),this.isChatStarted=t;for(let e=0;e<this.startChatButtonList.length;e++){let i=this.startChatButtonList[e];t?i.classList.add(C):i.classList.remove(C)}}initKarteChat(t){if("function"!=typeof window.krt)return void o.warn("KARTE Chat is not available. krt not found.");window.krt("talk","onChangeAssignee",({assigneeId:e})=>{o.debug("assigneeId:",e),window.krt("talk","fetchOperatorCounts",({operatorCounts:i})=>{let{all:a,available:s,online:n}=i;o.debug(`all: ${a}, available: ${s}, online: ${n}`),this.isChatOperatorReady=null!==e||n>0,t()})},{execInitialized:!0}),window.krt("talk","onShow",()=>{this.updateChatStartButtonBusyState(!0)}),window.krt("talk","onHide",()=>{this.updateChatStartButtonBusyState(!1)}),window.krt("talk","boot",this.context.karteRuntime?.chat?.option)}constructor(e){t(this,"context",void 0),t(this,"chatAuth",void 0),t(this,"isKarteChatInitialized",!1),t(this,"lastIsChatAvailable",void 0),t(this,"isChatOperatorReady",!1),t(this,"isChatStarted",!1),t(this,"startChatButtonList",void 0),t(this,"disabledStartChatButtonList",void 0),t(this,"operatorReadyViewList",void 0),t(this,"operatorNotReadyViewList",void 0),t(this,"startChat",()=>{if(o.debug("Chat.startChat"),this.isChatStarted)return void o.warn("KARTE Chat is already started.");if(void 0===window.krt)return void o.warn("KARTE Chat is not available. krt not found.");window.krt("talk","show");let t={current_url:window.location.href};try{window.krt("send","select_chat",t),window.krt("send","message_click",{type:"KarteChat"}),this.chatAuth.isChatPersonalInfoAvailableSet||window.krt("send","chat_auth",{chat_personal_info_available:"NG"})}catch(t){o.warn("Failed to send KARTE events:",t)}}),o.debug("Chat constructor"),this.context=e,e.chat=this,this.startChat=this.startChat.bind(this);let i={lastAuth:e.karteRuntime.chat.lastAuth,personalInfoAvailable:e.karteRuntime.chat.personalInfoAvailable,visitorId:e.karteRuntime.visitorId,customerId:e.karteRuntime.customerId,bootChat:this.bootChat.bind(this)};this.chatAuth=new w(i),this.chatAuth.start()}}class y{constructor(){t(this,"businessHours",void 0),t(this,"view",void 0),t(this,"chat",void 0),t(this,"phone",void 0),t(this,"customBusinessHourFilter",void 0),t(this,"karteRuntime",void 0),o.debug("Context constructor")}}class f{onPageChange(){o.debug("Phone.onPageChange"),this.updateElementBindings(),this.updateForecast(),this.updateElementVisibility()}updateElementBindings(){o.debug("Phone.updateElementBindings"),this.defaultViewList=document.getElementsByClassName("js-krt-call--default"),this.activeViewList=document.getElementsByClassName("js-krt-call--active"),this.inactiveViewList=document.getElementsByClassName("js-krt-call--inactive"),this.forecastList=d
1ocument.getElementsByClassName("js-krt-forecast"),this.forecastUpdateTimeList=document.getElementsByClassName("js-krt-forecast-update-time")}async updateElementVisibility(){o.debug("Phone.updateElementVisibility"),await this.context.businessHours.isBusinessHours(m)?this.showActiveView():this.showInactiveView()}showDefaultView(){o.debug("Phone.showDefaultView"),d(this.activeViewList),d(this.inactiveViewList),l(this.defaultViewList)}showActiveView(){o.debug("Phone.showActiveView"),d(this.defaultViewList),d(this.inactiveViewList),l(this.activeViewList)}showInactiveView(){o.debug("Phone.showInactiveView"),d(this.defaultViewList),d(this.activeViewList),l(this.inactiveViewList)}applyWaitCalls(t,e=this.forecastList){o.debug("Phone.applyWaitCalls");let i=t.waitCalls;for(let t=0;t<e.length;t++)e[t].textContent=String(i)}applyUpdateTime(t,e=this.forecastUpdateTimeList){o.debug("Phone.applyUpdateTime");let i=t.updateTime;for(let t=0;t<e.length;t++)e[t].textContent=this.getUpdateTimeText(i)}getUpdateTimeText(t){return t.getMonth()+1+"/"+t.getDate()+" "+t.getHours()+":"+("0"+t.getMinutes()).slice(-2)}async updateForecast(){o.debug("Phone.updateForecast");let t=this.context.karteRuntime.phone.queue;if(!t){this.isActionTableFailure=!0,this.onFallback();return}let e=[];e.push(new Promise(e=>{this.fetchForecast(t,t=>{this.applyWaitCalls(t),this.applyUpdateTime(t),e()})}));let i=this.context.karteRuntime.phone.queueExtra;if(i)for(let t of i)e.push(new Promise(e=>{this.fetchForecast(t.queue,i=>{let a=document.getElementsByClassName(t.waitCallsClass);this.applyWaitCalls(i,a);let s=document.getElementsByClassName(t.updateTimeClass);this.applyUpdateTime(i,s),e()})}));await Promise.all(e)}onFallback(){o.debug("Phone.onFallback"),this.showDefaultView()}fetchForecast(t,e){this.context.karteRuntime.phone.widget.collection("v2/forecast").get(t,(t,i)=>{if(t){o.error("table.get Error",t),this.isActionTableFailure=!0,this.onFallback();return}if(!this.validateForecast(i)){this.isActionTableFailure=!0,this.onFallback();return}e({waitCalls:i.wait_calls,updateTime:new Date(i.time_stamp)})})}validateForecast(t){if(!t.result)return o.warn("result is false"),!1;let e=r(),i=new Date(t.time_stamp);return"Invalid Date"===i.toString()?(o.warn("Invalid time_stamp: "+t.time_stamp),!1):e.getTime()-i.getTime()>6e4?(o.warn("Time stampが閾値を超えている: "+t.time_stamp),!1):"number"==typeof t.wait_calls&&-1!==t.wait_calls&&!(t.wait_calls>100)||(o.warn("wait_callsが不正: "+t.wait_calls),!1)}constructor(e){t(this,"context",void 0),t(this,"isActionTableFailure",!1),t(this,"defaultViewList",void 0),t(this,"activeViewList",void 0),t(this,"inactiveViewList",void 0),t(this,"forecastList",void 0),t(this,"forecastUpdateTimeList",void 0),o.debug("Phone constructor"),this.context=e,e.phone=this,this.onPageChange()}}let v={[g]:{holiday:{start:9,end:18},weekday:{start:10,end:19}},[m]:{holiday:{start:9,end:18},weekday:{start:9,end:20}}};class k{async isBusinessHours(t){if(o.debug("BusinessHours.isBusinessHours"),"undefined"==typeof window||"undefined"==typeof document)return o.warn("BusinessHours: window/document unavailable"),!1;if(void 0===window.LNIHoliday){o.debug("Loading holiday lib..."),this.loadingPromise||(this.loadingPromise=this.loadHolidayLib());let t=await this.loadingPromise;if(o.debug("isHolidayLibLoaded",t),!t||void 0===window.LNIHoliday)return o.warn("BusinessHours: Holiday lib unavailable"),!1}let e=r(),i=e.getHours(),a=window.LNIHoliday.isHoliday(e.toISOString());if(this.context.customBusinessHourFilter){let i=this.context.customBusinessHourFilter(t,a,e);if(null!==i)return i}return t===g?this.isBusinessHoursForChat(a,i):t===m?this.isBusinessHoursForPhone(a,i):(o.warn("Unknown serviceType:",t),!1)}isBusinessHoursForChat(t,e){return(o.debug("BusinessHours.isChatBusinessHours"),t)?v[g].holiday.start<=e&&e<v[g].holiday.end:v[g].weekday.start<=e&&e<v[g].weekday.end}isBusinessHoursForPhone(t,e){return(o.debug("BusinessHours.isPhoneBusinessHours"),t)?v[m].holiday.start<=e&&e<v[m].holiday.end:v[m].weekday.start<=e&&e<v[m].weekday.end}loadHolidayLib(){return(o.debug("BusinessHours.loadHolidayLib"),"undefined"==typeof document)?Promise.resolve(!1):document.getElementById("lns-lib-holiday-ext")&&window.LNIHoliday?Promise.resolve(!0):new Promise(t=>{let e=(t,e)=>new Promise(i=>{let a=document.createElement("script");a.id=t,a.src=e,a.async=!0,a.referrerPolicy="no-referrer",a.onload=()=>i(!0),a.onerror=()=>i(!1),document.head.appendChild(a)});e("lns-lib-holiday","https://www.lifenet-seimei.co.jp/libs/js/holiday_jp.min.js").then(t=>!!t&&e("lns-lib-holiday-ext","https://www.lifenet-seimei.co.jp/sh
1ared/js/holiday.min.js")).then(()=>{setTimeout(()=>{t(void 0!==window.LNIHoliday)},200)})})}constructor(e){t(this,"context",void 0),t(this,"loadingPromise",void 0),o.debug("BusinessHours constructor"),e.businessHours=this,this.context=e}}class L{start({useChat:t=!0,usePhone:e=!1,customBusinessHourFilter:i=null,karteRuntime:a}){o.debug("ContactApp start"),this.context.customBusinessHourFilter=i,this.context.karteRuntime=a,new k(this.context),t&&new p(this.context),e&&new f(this.context)}constructor(){t(this,"context",void 0),o.debug("ContactApp constructor"),this.context=new y,new u(this.context)}}function B(){o.debug("init (DOMContentLoaded or already loaded) index");let t=new L;window.contactApp=t}"loading"===document.readyState?window.addEventListener("DOMContentLoaded",B,{once:!0}):B()})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.