`),t}function DoSh(){5==ST.Mode&&(ST.Mode=1,Mode_Set(ST.Mode)),ModeChange(ST.Mode,!0)}function DataLoadStart(e){ModeST[ST.Mode].DoID+=1,setMST(ST.Mode),Load_Comp_Dsp(!1),ModeST[ST.Mode].OrderItems=new Array,ModeST[ST.Mode].DOM_ItemW.innerHTML="",ModeST[ST.Mode].DOM_ItemW.focus(),Keyword_History_Save(),DOM_ST.innerHTML=MK_ST_str(ST.Mode);let t=!1;for(let e=0;e{JSON2Item(a,getStoredProducts(SHOP[e].ST.Page),t),DataControl()},1e4),!1;if(SHOP[e].ST.Loaded_Su-SHOP[e].ST.Dsp_ID{if(!t.ok)throw LoadingIcon_Dsp(e,!1),a.total_Su=a.Dsp_ID,TotalLoadCnt(ST.Mode),DataControl(),new Error("Network response was not ok: "+t.statusText);return t.json()}).then(o=>{LoadingIcon_Dsp(e,!1),JSON2Item(a,o,t),DataControl()}).catch(t=>{SHOP[e].ST.ShST=3,a.loadErrorCnt+=1,LoadingIcon_Dsp(e,!1),a.total_Su=a.Dsp_ID,TotalLoadCnt(ST.Mode),DataControl()})}}function JSON2Item(e,t,o){if(o==ModeST[ST.Mode].DoID){let o=t.Result;if(e.total_Su=o.total_Su,"false"==t.nextP&&(e.EndPage=!0),0!=o.Items.length){e.Loaded_Su+=o.Items.length;let t=[];ModeST[ST.Mode].ST.Exclusion_Keyword&&""!==ModeST[ST.Mode].ST.Exclusion_Keyword.trim()&&(t=ModeST[ST.Mode].ST.Exclusion_Keyword.split(/\s+/)),o.Items.forEach(o=>{let n=!1;null==o.sub_title&&(o.sub_title=""),null==o.title&&(o.title=""),t.length>0&&(n=t.some(e=>o.title.includes(e)||o.sub_title.includes(e))),n?e.Loaded_Su=-1:e.Items.push(o)}),e.ShST=2}else e.ShST=4}DataControl()}function DspShopLoadCnt(e){SHOP[e].ST.Dsp_Su,SHOP[e].ST.total_Su,DspCnt=`${SHOP[e].ST.Dsp_ID-SHOP[e].ST.Dec_Su}/${SHOP[e].ST.total_Su-SHOP[e].ST.Dec_Su}`;let t=SHOP[e].ST.total_Su-SHOP[e].ST.Dec_Su,o=SHOP[e].ST.Dsp_ID-SHOP[e].ST.Dec_Su;t{DataPrint()},0),setTimeout(()=>{DataControl()},1),void updateACEndTimes_debounce())}function DataPrint(){let e,t=ST.Mode,o=[];for(let e=0;e0&&SHOP[e].ST.Dsp_ID0&&(e=o.reduce((e,t)=>e.SortKeye.SortKey===t.SortKey?e.No-t.No:e.SortKey-t.SortKey);let r=ModeST[t].OrderItems.findIndex(e=>e.ShopID===a.ShopID&&e.ItemNo===a.ItemNo&&e.SortKey===a.SortKey),i=ModeST[t].DOM_ItemW;r'+a);let r=HTML_part("div","I_Img_bk","",""),i=HTML_part("div","I_Img_W",r,"",e.url),s=ShopIconHTML(e.ShopID),S=e.shop+"";S=S.replace("楽天市場","").replace("Yahoo!ショッピング","").replace("店","").replace("楽天","").replace("Yahoo!","").replace("ヤフー","").replace("ラクテン","").replace("ヤフオク","");let l=HTML_part("div","I_Shop",s+S,"",e.url_shop),d="";e.janCode&&JANcd_check(e.janCode)&&(d=`\n この商品を探す
`);let c=HTML_part("div","I_Img_WW",i+a,""),_=0;for(let t of ModeST[ST.Mode].ST.keyword_Array_Sort)t&&t.match(/\S/g)&&(_+=1,e.title=e.title.replace(t,""+t+""),e.sub_title&&(e.sub_title=e.sub_title.replace(t,""+t+"")));let u=HTML_part("h3","I_Title",e.title,"",e.url),T=e.sub_title?HTML_part("div","I_subTitle",e.sub_title,""):"",p=HTML_part("div","I_Title_W",u+T,""),h="",M="";2==ModeST[ST.Mode].ST.sortID?(h=HTML_part("div","I_Kin",addFigure(e.kin-e.kin_Point)+"円"," "),M=e.kin_Point?HTML_part("div","I_Point"," = "+addFigure(e.kin)+"円
- "+addFigure(e.kin_Point)+"ポイント",""):HTML_part("div","I_Point"," ")):(h=HTML_part("div","I_Kin",addFigure(e.kin)+"円"," "),M=e.kin_Point?HTML_part("div","I_Point",addFigure(e.kin_Point)+"ポイント",""):HTML_part("div","I_Point"," "));let m=HTML_part("div","I_souryou",e.souryouDsp," ");e.endTime&&(M=e.endTime?e.endTime:HTML_part("div","EndTime",""));let g=e.RatingCnt?e.RatingCnt+"件":"",O=e.Rating?`${Number(e.Rating).toFixed(1)}${g}`:'',y=HTML_part("div","I_Kin_Etc_W",h+m+M+l+O+d,"");n+=c,n+=y,n+=p,n=`${n}
`;let D=createElementFromHTML(n),I=D.getElementsByTagName("a"),f=JSON.stringify(e);for(let e=0;e${o}${e}>`;return a&&(i=`${i}`),i}function ShopIconHTML(e){let t=``;return t}function checkKeywordsInTitle(e,t){let o=e.normalize("NFKC").toLowerCase(),n=t.replace(/[--]/g," "),a=n.split(/\s+/).map(e=>e.normalize("NFKC").toLowerCase()),r=a.reduce((e,t)=>e+(o.includes(t)?1:0),0),i=r/a.length;return i>=.8}function updateACEndTimes(){const e=DOM_MainS.querySelectorAll(".EndTime nobr"),t=new Date;for(var o=0;o0&&(a+=`${e}日`),t>0&&(a+=`${t}時間`),o>0&&(a+=`${o}分`),n.textContent=`残り:${a}`}}}function addProductToStorage(e){if(1==UserSet.Rireki){let t=JSON.parse(localStorage.getItem("products"))||[];for(t.unshift(e),t=t.filter((e,t,o)=>o.findIndex(t=>JSON.stringify(t)===JSON.stringify(e))===t);t.length>Rireki_Su;)t.pop();for(;t.length>0;)try{return void localStorage.setItem("products",JSON.stringify(t))}catch(e){if(!isQuotaExceeded(e))break;t.pop()}t.length}}function getStoredProducts(e){const t=localStorage.getItem("products");if(1==e){let e=t?JSON.parse(t):[],o=e.length;o||(o=-1,e="");let n={Result:{total_Su:o,Items:e}};return n}{let e={Result:{total_Su:0,Items:[]}};return e}}function UserSetting_Get(){let e=getLS("UserSet");e&&(UserSet=e),DspStyleSet(UserSet.ViewID)}function UserSetting_Save(){UserSet.ViewID=getItemDspStyleValue(),saveLS("UserSet",UserSet)}function Keyword_History_Save(){const e=DOM_keyword.value.trim();if(Get_searchHistory(),e){for(searchHistory=searchHistory.filter(t=>t!==e),searchHistory.unshift(e);searchHistory.length>25;)searchHistory.pop();localStorage.setItem("searchHistory",JSON.stringify(searchHistory))}}function Get_searchHistory(){const e=localStorage.getItem("searchHistory");e&&(searchHistory=JSON.parse(e))}function SvWord(e){let t=ModeST[e].ST.Keyword;if(svdKeyword==t||mozibakeChk(t))return!1;let o=0;JANcd_check(t)&&(o=1),t=t.trim(),t=t.split(" ").join(" "),t=t.replace(/\s\s+/g," "),t=t.split("/").join("/");var n=URL_Dom+"/bin/db/w.php";data={w:t,f:o};let a=n+param(data);var r=new XMLHttpRequest;r.open("GET",a),r.onreadystatechange=function(e){4===r.readyState&&r.status},r.send(),svdKeyword=ModeST[e].ST.Keyword}function mozibakeChk(e){return!!e&&mozibakeChkArray.some(t=>e.includes(t))}document.addEventListener("DOMContentLoaded",function(){DOM_keyword.value.includes("{{keyword")&&(DOM_keyword.value=""),TabInit(),MenuInit(),ScrollEvSet(),sortBtnInit(),log("UserSetting_Get"),UserSetting_Get(),log("ItemDspStyleBtnInit"),ItemDspStyleBtnInit(),log("Rireki_IF_Init"),Rireki_IF_Init(),log("InitURL2Set"),InitURL2Set(),log("ModeChange",ST.Mode,!0),ModeChange(ST.Mode,!0)}),"undefined"==typeof crawler_Flg&&(crawler_Flg=!1);const DataControl_debounce=debounce(DataControl,30),updateACEndTimes_debounce=debounce(updateACEndTimes,1e3);setTimeout(()=>{updateACEndTimes_debounce()},6e4);let searchHistory=[];Get_searchHistory(),DOM_keyword.addEventListener("focus",()=>{const e=localStorage.getItem("searchHistory");e&&(searchHistory=JSON.parse(e));const t=searchHistory.map(e=>`${e}
`).join("");DOM_searchHistoryDiv.innerHTML=t}),DOM_searchHistoryDiv.addEventListener("mousedown",function(e){if(e.target.classList.contains("history-item")){const t=e.target.textContent;DOM_keyword.value=t,DOM_searchHistoryDiv.innerHTML=""}});var svdKeyword="",mozibakeChkArray=["ã","ï","¼","è","¶"];