/* inquiry.php の 直前で読み込んでください。自動送信は行いません。 */ (()=>{ 'use strict'; const prefix='aline-owner-handoff-'; function run(){ const match=location.hash.match(/^#aline-owner=([a-f0-9-]{36})$/i);if(!match)return; const key=prefix+match[1];let data; try{data=JSON.parse(localStorage.getItem(key));}catch{return;} if(!data||data.version!==1||typeof data.text!=='string'||data.text.length>500000||!Number.isFinite(data.expires)||data.expires=0&&next.length>field.maxLength){ const notice=document.createElement('p');notice.textContent='相談文が文字数上限を超えるため、自動入力できませんでした。試算画面で相談文をコピーし、必要な内容に絞って貼り付けてください。';field.before(notice);return; } field.value=next;field.dataset.alineFilled=match[1];field.dispatchEvent(new Event('input',{bubbles:true}));field.dispatchEvent(new Event('change',{bubbles:true})); const choice=Array.from(document.querySelectorAll('input[type="checkbox"][name="item1[]"]')).find(x=>x.value==='物件管理について相談をしたい'); if(choice){choice.checked=true;choice.dispatchEvent(new Event('change',{bubbles:true}));} const notice=document.createElement('div');notice.setAttribute('role','status');notice.style.cssText='padding:16px;margin:0 0 18px;border:1px solid #bad9ec;background:#e6f3f9;color:#333333;font-size:16px;line-height:1.7;';notice.textContent='賃貸経営シミュレーターの物件情報・収支比較・改善プランを引き継ぎました。お名前、メールアドレス、電話番号と内容をご確認のうえ、送信してください。';(field.closest('form')||field.parentNode).prepend(notice); try{localStorage.removeItem(key);history.replaceState(null,'',location.pathname+location.search);}catch{} } if(document.readyState==='loading')document.addEventListener('DOMContentLoaded',run,{once:true});else run(); })();