<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* Product/detail.twig */
class __TwigTemplate_da5ad31feda8695d41b76c2e300641cf69fccce492d7fb053b687f2a0b3adb3c extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'stylesheet' => [$this, 'block_stylesheet'],
'javascript' => [$this, 'block_javascript'],
'main' => [$this, 'block_main'],
];
}
protected function doGetParent(array $context)
{
// line 11
return "default_frame.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/detail.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/detail.twig"));
// line 13
$context["body_class"] = "product_page";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "Product/detail.twig", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 15
public function block_stylesheet($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
// line 16
echo " <style>
.slick-slider {
margin-bottom: 10px;
\t\t\tmargin-top: -20px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: \" \";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</style>
<link rel=\"stylesheet\" href=\"/html/user_data/js/style.css\">
<link rel=\"stylesheet\" href=\"/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css\">
<style>
/* Show zoom cursor on product images to hint click-to-expand */
.item_visual .slide-item a { display: block; cursor: zoom-in; }
</style>
<style>
/* ============================================
商品詳細グリッド: 画像50% / 内容50%(均等)
============================================ */
@media (min-width: 768px) {
body.product_page .ec-grid2 {
display: flex;
align-items: flex-start;
}
body.product_page .ec-grid2 .ec-grid2__cell {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
body.product_page .ec-grid2 .ec-grid2__cell2 {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
}
/* ============================================
商品説明欄内のHTMLが画面幅を突き抜けないように
============================================ */
body.product_page .ec-productRole__description {
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
}
body.product_page .ec-productRole__description img,
body.product_page .ec-productRole__description table,
body.product_page .ec-productRole__description iframe,
body.product_page .ec-productRole__description video {
max-width: 100% !important;
height: auto;
}
body.product_page .ec-productRole__description table {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
スマホ用 お見積りの詳細 ボトムシート
============================================ */
.sp-detail-sheet { display: none; }
.sp-detail-sheet.is-open {
display: block;
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 2000;
}
.sp-detail-sheet__overlay {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.45);
}
.sp-detail-sheet__panel {
position: absolute;
left: 0; right: 0; bottom: 0;
background: #fff;
border-radius: 14px 14px 0 0;
max-height: 82vh;
display: flex;
flex-direction: column;
box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
padding-bottom: env(safe-area-inset-bottom);
animation: spSheetUp 0.22s ease-out;
}
@keyframes spSheetUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.sp-detail-sheet__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__title { font-size: 16px; font-weight: bold; color: #333; }
.sp-detail-sheet__close {
background: none;
border: none;
font-size: 26px;
line-height: 1;
color: #888;
cursor: pointer;
padding: 0 4px;
}
.sp-detail-sheet__body {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 4px 0;
flex: 1 1 auto;
}
.sp-detail-sheet__body ul { list-style: none; margin: 0; padding: 0; }
.sp-detail-sheet__body li { border-bottom: 1px solid #f2f2f2; }
.sp-detail-sheet__body .nav-link {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
color: #333;
font-size: 14px;
}
.sp-detail-sheet__body .nav-link .float-right {
float: none !important;
font-weight: bold;
white-space: nowrap;
margin-left: auto;
}
.sp-detail-sheet__footer {
display: flex;
gap: 8px;
padding: 12px 16px 16px;
border-top: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__footer button {
flex: 1 1 auto;
padding: 12px;
border-radius: 8px;
font-size: 14px;
font-weight: bold;
cursor: pointer;
}
.sp-detail-sheet__invoice {
background: #fff;
border: 1px solid #17a2b8;
color: #17a2b8;
}
.sp-detail-sheet__cart {
background: #c00;
border: 1px solid #c00;
color: #fff;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.rp-section-label {
font-size: 14px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.rp-section-label span {
font-weight: normal;
color: #c00;
}
/* ---- 1. 画像付きカード ---- */
.rp-card-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
}
.rp-card {
position: relative;
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: prevent the first tap from being consumed as a text
selection (\"字だけ青くなる\" = selection highlight) which forced a
2nd tap to actually switch the option (#15). */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
width: 110px;
border: 2px solid #ddd;
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
background: #fff;
text-decoration: none;
color: #333;
display: block;
}
/* Gate :hover behind real hover-capable pointers. On iOS Safari a
:hover rule that changes appearance makes the first tap apply the
hover state and suppresses the click, so the option chip needed a
second tap to fire its onclick (is-selected + price update). */
@media (hover: hover) and (pointer: fine) {
.rp-card:hover {
border-color: #999;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
}
.rp-card.is-selected {
border-color: #1a6fcf;
box-shadow: 0 2px 10px rgba(26,111,207,0.25);
}
/* visually-hidden instead of display:none. A label wrapping a
display:none radio fires its tap unreliably on iOS Safari (first tap
often ignored -> \"2回タッチ\"). Keeping the input in the layout but
invisible makes the first tap register. */
.rp-card input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
.rp-card__image {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
display: block;
background: #f5f5f5;
}
.rp-card__placeholder {
width: 100%;
aspect-ratio: 1 / 1;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
color: #bbb;
font-size: 24px;
}
.rp-card__name {
display: block;
padding: 5px 5px;
font-size: 11px;
color: #333;
text-align: center;
line-height: 1.4;
word-break: break-all;
}
.rp-card.is-selected .rp-card__name { color: #1a6fcf; font-weight: bold; }
.rp-card.is-selected::after {
content: \"✓\";
position: absolute;
top: 3px; right: 6px;
color: #1a6fcf;
font-size: 13px;
font-weight: bold;
}
/* ---- 2. ボタン式ラジオ(画像なし・8個以内)---- */
.rp-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
max-width: 100%;
min-width: 0;
}
.rp-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 8px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.rp-btn:hover { border-color: #999; }
}
.rp-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.rp-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* iOS Safari \"2回タッチ\" fix for the type-selection link chips.
The global theme stylesheet ships an ungated `a:hover{color:#296292}`
(paired with `a{color:#337ab7;text-decoration:underline}`). Because
.rp-btn / .rp-card are real <a> links, iOS Safari applies that hover
colour on the FIRST tap — the chip text turns blue (#296292, the
reported \"字だけ青くなる\") — and treats the tap as a hover, swallowing
the navigation so a 2nd tap was needed. The local .rp-*:hover rules
are already gated behind (hover:hover), but this inherited global
rule was not. Pin the hover/active colour to the base/selected colour
so tapping produces no visual change and the first tap navigates
immediately. Higher specificity (0,2,0 / 0,3,0) overrides a:hover. */
.rp-btn:hover,
.rp-btn:active { color: #333; text-decoration: none; }
.rp-btn.is-selected:hover,
.rp-btn.is-selected:active { color: #1a6fcf; text-decoration: none; }
.rp-card:hover,
.rp-card:active { color: #333; text-decoration: none; }
.rp-card:hover .rp-card__name,
.rp-card:active .rp-card__name { color: #333; }
.rp-card.is-selected:hover .rp-card__name,
.rp-card.is-selected:active .rp-card__name { color: #1a6fcf; }
/* ---- 選択肢が多い場合: 縦3段に収めて横スクロール(顧客要望「3列くらいで横スクロール」)---- */
/* grid-auto-flow:column + 3行固定 → 選択肢が縦に最大3段、超過分は右へ伸び横スクロールで閲覧 */
.rp-btn-group.is-scroll,
.opt-btn-group.is-scroll {
display: grid;
grid-auto-flow: column;
grid-template-rows: repeat(3, auto);
grid-auto-columns: max-content;
justify-content: start;
align-items: start;
gap: 8px;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
/* 上下に余白を確保して、行の枠線が overflow クリップ/スクロールバーに
切り取られないようにする(「文字列が長いと下枠が消える」対策)。 */
padding: 2px 0 12px;
}
/* is-scroll(横スクロール)内では選択肢を折り返さず単一行に固定する。
折り返すと行高が不揃いになり overflow-y:hidden で下枠が切れるため、
長い選択肢は折り返さず横スクロールで見せる(本来の設計意図)。 */
.rp-btn-group.is-scroll .rp-btn,
.rp-btn-group.is-scroll .opt-btn,
.opt-btn-group.is-scroll .rp-btn,
.opt-btn-group.is-scroll .opt-btn {
white-space: nowrap;
word-break: normal;
overflow-wrap: normal;
}
.rp-btn-group.is-scroll::-webkit-scrollbar,
.opt-btn-group.is-scroll::-webkit-scrollbar {
height: 6px;
}
.rp-btn-group.is-scroll::-webkit-scrollbar-thumb,
.opt-btn-group.is-scroll::-webkit-scrollbar-thumb {
background: #c0c0c0;
border-radius: 3px;
}
/* ---- 3. プルダウン(画像なし・9個以上)---- */
.rp-select-wrap {
margin-bottom: 4px;
}
.rp-select {
width: 100%;
max-width: 420px;
padding: 8px 12px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
appearance: none;
background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E\");
background-repeat: no-repeat;
background-position: right 12px center;
cursor: pointer;
}
.rp-select:focus {
outline: none;
border-color: #1a6fcf;
}
/* ---- オプション選択ボタン(枠線ラジオ)---- */
.opt-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 6px 0;
max-width: 100%;
min-width: 0;
}
.opt-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 7px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.opt-btn:hover { border-color: #999; }
}
.opt-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.opt-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* opt-btn with color swatch image. The label still works as a
radio target — clicking the image checks the input. The text
label stays under the image so users can still read the name. */
.opt-btn--with-image {
padding: 4px 6px 6px;
white-space: normal;
text-align: center;
display: inline-flex;
flex-direction: column;
align-items: center;
min-width: 96px;
max-width: 140px;
}
.opt-btn--with-image .opt-btn__img {
display: block;
width: 88px;
height: 66px;
object-fit: cover;
border-radius: 6px;
margin-bottom: 4px;
background: #f5f5f5;
}
.opt-btn--with-image .opt-btn__name {
display: block;
font-size: 11px;
line-height: 1.3;
color: inherit;
}
.opt-btn--with-image.is-selected .opt-btn__img {
outline: 2px solid #1a6fcf;
outline-offset: 1px;
}
/* sale_type=2 (内窓) 補助金対象ガラスの強調表示.
補助金が出る性能区分 (真空断熱 / Low-E複層 等) のガラス選択肢に
緑枠 + 「補助金対象」バッジを付け、選択前から判別できるようにする。 */
.opt-btn--subsidy {
border-color: #2e7d32;
}
.opt-btn--subsidy.is-selected {
border-color: #1a6fcf;
}
.opt-btn__subsidy-badge {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
border-radius: 6px;
background: #2e7d32;
color: #fff;
font-size: 11px;
font-weight: bold;
white-space: nowrap;
}
/* ============================================
施工エリア案内
============================================ */
.ec-areaNotice {
margin: 16px 0;
padding: 16px 20px;
background: #f8f9fa;
border-left: 4px solid #1a6fcf;
border-radius: 0 8px 8px 0;
}
.ec-areaNotice__inner {
display: flex;
align-items: flex-start;
gap: 12px;
}
.ec-areaNotice__icon {
font-size: 22px;
line-height: 1;
flex-shrink: 0;
margin-top: 2px;
}
.ec-areaNotice__body {
flex: 1;
}
.ec-areaNotice__title {
font-size: 13px;
font-weight: bold;
color: #1a6fcf;
margin: 0 0 6px;
}
.ec-areaNotice__text {
font-size: 13px;
color: #444;
line-height: 1.7;
margin: 0;
}
.ec-areaNotice__text strong {
color: #222;
}
.ec-areaNotice__link {
display: inline-block;
margin-top: 8px;
font-size: 12px;
color: #1a6fcf;
text-decoration: underline;
}
.ec-areaNotice__link:hover {
color: #0d4fa0;
}
/* ============================================
SNSシェア + ブランド名 タイトル行
============================================ */
.ec-productRole__titleRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}
.ec-productRole__titleRow .ec-headingTitle {
margin: 0;
flex: 1;
font-size: 18px;
}
.ec-share-inline {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
@media (max-width: 767px) {
/* maker_area の float を解除して独立表示 */
#maker_area {
float: none !important;
width: auto !important;
height: auto !important;
display: block;
margin-bottom: 4px;
}
/* タイトル行: 商品名が全幅を占有しSNSは右寄せ下段 */
.ec-productRole__titleRow {
flex-wrap: wrap;
clear: both;
}
.ec-productRole__titleRow .ec-headingTitle {
flex: 1 1 100%;
font-size: 16px;
}
.ec-share-inline {
flex: 0 0 auto;
margin-left: auto;
}
}
.ec-share-inline a {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 15px;
color: #fff;
text-decoration: none;
transition: opacity 0.2s;
}
.ec-share-inline a:hover { opacity: 0.8; }
.ec-share-inline .share-twitter { background: #000; }
.ec-share-inline .share-facebook { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ec-share-inline .share-line { background: #06c755; }
/* description_detail下のシェアブロックはPC/スマホ共通で非表示(タイトル行に移動) */
.ec-productRole__share { display: none; }
/* ============================================
PC用: 現在のお見積り額カード強調
============================================ */
@media (min-width: 768px) {
.mitsumori-card-pc {
border: 2px solid #1a6fcf !important;
border-radius: 10px !important;
box-shadow: 0 4px 16px rgba(26,111,207,0.18) !important;
margin-top: 20px;
overflow: hidden;
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
}
.mitsumori-card-pc .card-header {
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
color: #fff !important;
padding: 14px 16px !important;
border-bottom: none !important;
}
.mitsumori-card-pc .card-title {
color: #fff !important;
font-size: 15px !important;
font-weight: bold !important;
margin: 0 !important;
}
.mitsumori-card-pc #mitsumori_message {
font-size: 22px !important;
font-weight: bold !important;
color: #fff !important;
}
.mitsumori-card-pc .btn-tool {
color: #fff !important;
}
/* 合計行を大きく強調 */
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: 16px !important;
font-weight: bold !important;
color: #c00 !important;
background: #fff8f8 !important;
padding: 12px 16px !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: 20px !important;
font-weight: bold !important;
color: #c00 !important;
}
/* card-body(明細リスト)を白背景に */
.mitsumori-card-pc .card-body {
background: #fff !important;
}
.mitsumori-card-pc .card-footer {
background: #f8faff !important;
border-top: 1px solid #dce8fb !important;
padding: 12px 16px !important;
}
}
@media (max-width: 767px) {
/* スマホでは現在のお見積り額カードの強調スタイルをすべてリセット */
.mitsumori-card-pc {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
margin-top: 0 !important;
overflow: visible !important;
background: none !important;
/* sticky-top(position:sticky / z-index:1020) を解除。
そのままだと最下部で #sp-mitsumori-bar(z-index:1000) の上に
重なり、合計バーと文字が被るため通常フローへ戻す。 */
position: static !important;
z-index: auto !important;
}
.mitsumori-card-pc .card-header {
background: none !important;
color: inherit !important;
padding: inherit !important;
border-bottom: inherit !important;
}
.mitsumori-card-pc .card-title { color: inherit !important; }
.mitsumori-card-pc #mitsumori_message { font-size: inherit !important; color: inherit !important; }
.mitsumori-card-pc .btn-tool { color: inherit !important; }
/* 折りたたみトグルボタン */
.btn-mitsumori-toggle {
background: none !important;
border: 1px solid #aaa !important;
border-radius: 4px !important;
padding: 2px 8px !important;
font-size: 12px !important;
color: #333 !important;
line-height: 1.4 !important;
}
.btn-mitsumori-toggle .toggle-icon {
display: inline-block;
transition: transform 0.2s;
}
/* 展開状態: ▼→▲ */
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon::before {
content: \"▲ 閉じる\";
}
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon {
display: none;
}
.card:not(.collapsed-card) .btn-mitsumori-toggle::after {
content: \"▲ 閉じる\";
font-size: 12px;
}
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: inherit !important;
color: inherit !important;
background: none !important;
padding: inherit !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: inherit !important;
color: inherit !important;
}
.mitsumori-card-pc .card-footer {
background: none !important;
border-top: inherit !important;
padding: inherit !important;
}
/* 横スクロール禁止 */
body, html {
overflow-x: hidden;
max-width: 100vw;
}
/* ボタンの折り返しを許可(nowrapが原因で横スクロール発生するため) */
.opt-btn,
.rp-btn {
white-space: normal;
word-break: break-all;
}
/* エリア案内: スマホでコンパクト */
.ec-areaNotice {
margin: 8px 0;
padding: 8px 10px;
border-left-width: 3px;
cursor: pointer;
}
.ec-areaNotice__inner {
flex-direction: row;
gap: 8px;
align-items: flex-start;
}
.ec-areaNotice__icon { font-size: 15px; }
/* タイトル行: 展開トグル */
.ec-areaNotice__title {
font-size: 11px;
margin-bottom: 3px;
display: flex;
justify-content: space-between;
align-items: center;
}
.ec-areaNotice__title::after {
content: \"▼\";
font-size: 9px;
color: #888;
margin-left: 6px;
transition: transform 0.2s;
}
.ec-areaNotice.is-open .ec-areaNotice__title::after {
transform: rotate(180deg);
}
/* 折りたたみ対象: 閉じた状態では非表示 */
.ec-areaNotice__detail {
display: none;
}
.ec-areaNotice.is-open .ec-areaNotice__detail {
display: block;
}
.ec-areaNotice__text { font-size: 11px; line-height: 1.5; }
.ec-areaNotice__text br { display: none; }
.ec-areaNotice__link { font-size: 11px; margin-top: 3px; }
.rp-card { width: calc(33.333% - 6px); min-width: 80px; }
#sp-mitsumori-bar {
display: flex;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
background: #fff;
border-top: 2px solid #e0e0e0;
box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
align-items: center;
padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
gap: 8px;
}
#sp-mitsumori-bar .sp-bar__label {
font-size: 11px;
color: #666;
white-space: nowrap;
}
/* 価格ラッパ: 合計金額は最重要のため常に全桁表示する(縮小・省略しない)。
幅が足りない場合は下のボタン側を縮める(flex 配分でボタンが先に縮む)。 */
#sp-mitsumori-bar .sp-bar__pricewrap {
flex: 0 0 auto;
min-width: 0;
}
#sp-mitsumori-bar .sp-bar__price {
font-size: 18px;
font-weight: bold;
color: #c00;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__btn {
font-size: 12px;
padding: 8px 12px;
background: #333;
color: #fff;
border: none;
border-radius: 6px;
white-space: nowrap;
cursor: pointer;
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
flex: 1 1 auto;
min-width: 0;
justify-content: center;
}
#sp-mitsumori-bar .sp-bar__btn i {
font-size: 14px;
flex: 0 0 auto;
}
/* お見積りの詳細(内訳)を開くボタン。価格・カートボタンを圧迫しないよう
最小幅のアイコン+短ラベルにし、幅不足時も縮まない固定幅で維持する。 */
#sp-mitsumori-bar .sp-bar__detail-btn {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
flex: 0 0 auto;
padding: 4px 8px;
background: #fff;
color: #c00;
border: 1px solid #c00;
border-radius: 6px;
font-size: 10px;
font-weight: bold;
line-height: 1.1;
white-space: nowrap;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__detail-btn i { font-size: 15px; }
/* 幅が足りないときはボタンの文字を省略し、価格と数字を守る。 */
#sp-mitsumori-bar .sp-bar__btn-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__cart-badge {
position: absolute;
top: -6px;
right: -6px;
background: #c00;
color: #fff;
border-radius: 50%;
min-width: 16px;
height: 16px;
font-size: 10px;
line-height: 16px;
padding: 0 4px;
font-weight: bold;
}
#sp-mitsumori-bar .sp-bar__home-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
flex: 0 0 auto;
border: 1px solid #ccc;
border-radius: 6px;
background: #fff;
color: #333;
text-decoration: none;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__home-btn i {
font-size: 16px;
}
#sp-mitsumori-bar .sp-bar__home-btn:hover {
background: #f0f0f0;
}
/* 下部バーの高さ分ページ下部にpaddingを追加 (iOS safe-area 込み) */
body {
padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
}
/* ============================================
カート追加モーダル: 縦並び中央配置
============================================ */
.add-cart-modal__wrap {
text-align: center;
}
.add-cart-modal__header {
font-size: 16px;
margin: 20px 0 24px;
text-align: center;
}
.add-cart-modal__actions {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
padding: 0 20px 20px;
}
.add-cart-modal__primary {
display: inline-block;
width: 80%;
max-width: 320px;
padding: 14px 20px;
font-size: 15px;
font-weight: bold;
text-align: center;
background: #d9534f;
color: #fff !important;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
}
.add-cart-modal__primary:hover {
background: #c9302c;
color: #fff !important;
text-decoration: none;
}
.add-cart-modal__secondary {
display: inline-block;
padding: 6px 14px;
font-size: 12px;
color: #666;
border: 1px solid #ccc;
border-radius: 4px;
background: #fff;
cursor: pointer;
}
.add-cart-modal__secondary:hover {
background: #f0f0f0;
color: #333;
}
@media (max-width: 767px) {
.add-cart-modal__actions {
gap: 20px;
}
}
</style>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 1037
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 1038
echo "
<script>
eccube.classCategories = ";
// line 1040
echo $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getClassCategoriesAsJson((isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1040, $this->source); })()));
echo ";
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var \$form = \$(form);
var product_id = \$form.find('input[name=product_id]').val();
var \$sele1 = \$form.find('select[name=classcategory_id1]');
var \$sele2 = \$form.find('select[name=classcategory_id2]');
eccube.setClassCategories(\$form, product_id, \$sele1, \$sele2, classcat_id2_selected);
}
";
// line 1051
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 1051)) {
// line 1052
echo " fnSetClassCategories(
\$('#form1'), ";
// line 1053
echo json_encode(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 1053, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 1053), "vars", [], "any", false, false, false, 1053), "value", [], "any", false, false, false, 1053));
echo "
);
";
} elseif (twig_get_attribute($this->env, $this->source, // line 1055
($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 1055)) {
// line 1056
echo " eccube.checkStock(\$('#form1'), ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1056, $this->source); })()), "id", [], "any", false, false, false, 1056), "html", null, true);
echo ", ";
echo json_encode(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 1056, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 1056), "vars", [], "any", false, false, false, 1056), "value", [], "any", false, false, false, 1056));
echo ", null);
";
}
// line 1058
echo " </script>
<script>
\$(function() {
// bfcache無効化
\$(window).bind('pageshow', function(event) {
if (event.originalEvent.persisted) {
location.reload(true);
}
});
// Core Web Vital の Cumulative Layout Shift(CLS)対策のため
// img タグに width, height が付与されている.
// 630px 未満の画面サイズでは縦横比が壊れるための対策
// see https://github.com/EC-CUBE/ec-cube/pull/5023
\$('.ec-grid2__cell').hide();
var removeSize = function () {
\$('.slide-item').height('');
\$('.slide-item img')
.removeAttr('width')
.removeAttr('height')
.removeAttr('style');
};
var slickInitial = function(slick) {
\$('.ec-grid2__cell').fadeIn(1500);
var baseHeight = \$(slick.target).height();
var baseWidth = \$(slick.target).width();
var rate = baseWidth / baseHeight;
\t\t\t\tif(baseHeight * rate < 400){
\t \$('.slide-item').height(baseHeight * rate); // 余白を削除する
\t\t\t\t}else{
\t \$('.slide-item').height(400); // 余白を削除する
\t\t\t\t}
// transform を使用することでCLSの影響を受けないようにする
\$('.slide-item img')
.css(
{
'transform-origin': 'top left',
'transform': 'scaleY(' + rate + ')',
'transition': 'transform .1s'
}
);
// 正しいサイズに近くなったら属性を解除する
setTimeout(removeSize, 500);
};
\$('.item_visual').on('init', slickInitial);
// リサイズ時は CLS の影響を受けないため属性を解除する
\$(window).resize(removeSize);
\$('.item_visual').slick({
dots: false,
arrows: true,
responsive: [{
breakpoint: 768,
settings: {
dots: true,
\t\tarrows: false
}
}]
});
\$('.slideThumb').on('click', function() {
var index = \$(this).attr('data-index');
\$('.item_visual').slick('slickGoTo', index, false);
})
});
</script>
<script>
\$(function() {
\$('.add-cart').on('click', function(event) {
";
// line 1128
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 1128)) {
// line 1129
echo " // 規格1フォームの必須チェック
if (\$('#classcategory_id1').val() == '__unselected' || \$('#classcategory_id1').val() == '') {
\$('#classcategory_id1')[0].setCustomValidity('";
// line 1131
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("項目が選択されていません"), "html", null, true);
echo "');
return true;
} else {
\$('#classcategory_id1')[0].setCustomValidity('');
}
";
}
// line 1137
echo "
";
// line 1138
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 1138)) {
// line 1139
echo " // 規格2フォームの必須チェック
if (\$('#classcategory_id2').val() == '__unselected' || \$('#classcategory_id2').val() == '') {
\$('#classcategory_id2')[0].setCustomValidity('";
// line 1141
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("項目が選択されていません"), "html", null, true);
echo "');
return true;
} else {
\$('#classcategory_id2')[0].setCustomValidity('');
}
";
}
// line 1147
echo "
// タイプ2: カート送信直前に set_count を quantity に同期
if(\$('#set_count').length){
var _sc = parseInt(\$('#set_count').val()) || 1;
\$('#quantity').val(_sc);
\$('input[name=\"quantity\"]').val(_sc);
}
// 個数フォームのチェック
if (\$('#quantity').val() < 1) {
\$('#quantity')[0].setCustomValidity('";
// line 1157
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("1以上で入力してください。"), "html", null, true);
echo "');
return true;
} else {
\$('#quantity')[0].setCustomValidity('');
}
event.preventDefault();
\$form = \$('#form1');
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$('.add-cart').prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: \"";
// line 1184
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("block_cart");
echo "\",
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('";
// line 1191
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html", null, true);
echo "');
}).always(function(data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
});
\$('.ec-modal-wrap').on('click', function(e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
\t\tvar pw = \"";
// line 1208
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1208, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1208, $this->source); })()), "pw", [], "any", false, false, false, 1208), "html", null, true);
}
echo "\";
\t\tvar pd = \"";
// line 1209
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1209, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1209, $this->source); })()), "pd", [], "any", false, false, false, 1209), "html", null, true);
}
echo "\";
\t\tvar ph = \"";
// line 1210
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1210, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1210, $this->source); })()), "ph", [], "any", false, false, false, 1210), "html", null, true);
}
echo "\";
\t\tvar pm = \"";
// line 1211
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1211, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1211, $this->source); })()), "pm", [], "any", false, false, false, 1211), "html", null, true);
}
echo "\";
\t\tvar pc = \"";
// line 1212
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1212, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1212, $this->source); })()), "pc", [], "any", false, false, false, 1212), "html", null, true);
}
echo "\";
\t\t// option1 / option2: カテゴリ別 option 軸 (um: タイプ=subtype, fe: ct_up 等)
\t\tvar option1 = \"";
// line 1214
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1214, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 1214))) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1214, $this->source); })()), "option1", [], "any", false, false, false, 1214), "html", null, true);
}
echo "\";
\t\tvar option2 = \"";
// line 1215
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1215, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 1215))) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1215, $this->source); })()), "option2", [], "any", false, false, false, 1215), "html", null, true);
}
echo "\";
\t\tvar op0 = \"";
// line 1216
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1216, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1216, $this->source); })()), "op", [], "any", false, false, false, 1216), 0, [], "array", false, false, false, 1216), "html", null, true);
}
echo "\";
\t\tvar op1 = \"";
// line 1217
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1217, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1217, $this->source); })()), "op", [], "any", false, false, false, 1217), 1, [], "array", false, false, false, 1217), "html", null, true);
}
echo "\";
\t\tvar op2 = \"";
// line 1218
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1218, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1218, $this->source); })()), "op", [], "any", false, false, false, 1218), 2, [], "array", false, false, false, 1218), "html", null, true);
}
echo "\";
\t\tvar op3 = \"";
// line 1219
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1219, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1219, $this->source); })()), "op", [], "any", false, false, false, 1219), 3, [], "array", false, false, false, 1219), "html", null, true);
}
echo "\";
\t\tvar op4 = \"";
// line 1220
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1220, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1220, $this->source); })()), "op", [], "any", false, false, false, 1220), 4, [], "array", false, false, false, 1220), "html", null, true);
}
echo "\";
\t\tvar op5 = \"";
// line 1221
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1221, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1221, $this->source); })()), "op", [], "any", false, false, false, 1221), 5, [], "array", false, false, false, 1221), "html", null, true);
}
echo "\";
\t\tvar op6 = \"";
// line 1222
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1222, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1222, $this->source); })()), "op", [], "any", false, false, false, 1222), 6, [], "array", false, false, false, 1222), "html", null, true);
}
echo "\";
\t\tvar op7 = \"";
// line 1223
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1223, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1223, $this->source); })()), "op", [], "any", false, false, false, 1223), 7, [], "array", false, false, false, 1223), "html", null, true);
}
echo "\";
\t\tvar op8 = \"";
// line 1224
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1224, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1224, $this->source); })()), "op", [], "any", false, false, false, 1224), 8, [], "array", false, false, false, 1224), "html", null, true);
}
echo "\";
\t\tvar op9 = \"";
// line 1225
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1225, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1225, $this->source); })()), "op", [], "any", false, false, false, 1225), 9, [], "array", false, false, false, 1225), "html", null, true);
}
echo "\";
\t\tvar op10 = \"";
// line 1226
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1226, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1226, $this->source); })()), "op", [], "any", false, false, false, 1226), 10, [], "array", false, false, false, 1226), "html", null, true);
}
echo "\";
\t\tconst formatter = new Intl.NumberFormat('ja-JP');
\t\t// ============================================================
\t\t// free_area 1 エントリのスキーマ(11 キー固定)
\t\t// ============================================================
\t\t// w : 幅 (string, 例 \"239.9cm\" / tf は \"1m\")
\t\t// d : 奥行
\t\t// h : 高さ (tf はロール長 \"10m\")
\t\t// m : 素材
\t\t// c : カラー
\t\t// price : 販売価格 (税抜、amount=1 ベース)
\t\t// unit_price : 商品 per-unit 増分 (税抜、AMOUNT_CATEGORIES のみ)
\t\t// maker_price : メーカー価格 (税抜)
\t\t// ct : 基本工事費 (税抜、amount=1 ベース)
\t\t// option1 : fe → ct_up / その他カテゴリ → category-specific
\t\t// option2 : um → ct_up / その他カテゴリ → category-specific
\t\t//
\t\t// ct4 (設置場所) / ct5 (撤去) / ct6 (残土) は option_area 側で扱う.
\t\t// ============================================================
\t\t// 施工オプション定義(option_area)— 各エントリ {name, comment, on, off, price}
\t\tvar op_data = ";
// line 1249
echo ((array_key_exists("op_json", $context)) ? (_twig_default_filter((isset($context["op_json"]) || array_key_exists("op_json", $context) ? $context["op_json"] : (function () { throw new RuntimeError('Variable "op_json" does not exist.', 1249, $this->source); })()), "[]")) : ("[]"));
echo ";
\t\t// option_item_area:
\t\t// tg 用 — block 別オプション差額表
\t\t// { axis_labels: {F:'床材',front:'前面型',side1:'右側面型',side2:'左側面型'},
\t\t// blocks: { 'W_label|D_label': { F:[{idx,label,diff},...], front:[...], side1:[...], side2:[...] }, ... } }
\t\t// fe (sale_type=4) 用 — ブロックの種類×段数の差額表 (fe_block キー)
\t\t// { fe_block: { depends_on_name: '...', depends_on_value: '...',
\t\t// title: '...', default_key: '...',
\t\t// choices: [{key,label,price}, ...] } }
\t\t// 該当しないカテゴリでは fe_block は null. axis_labels/blocks は空.
\t\tvar oi_data = ";
// line 1260
echo ((array_key_exists("oi_json", $context)) ? (_twig_default_filter((isset($context["oi_json"]) || array_key_exists("oi_json", $context) ? $context["oi_json"] : (function () { throw new RuntimeError('Variable "oi_json" does not exist.', 1260, $this->source); })()), "{\"axis_labels\":{},\"blocks\":{},\"fe_block\":null}")) : ("{\"axis_labels\":{},\"blocks\":{},\"fe_block\":null}"));
echo ";
\t\t// 選択中の tg オプション差額 (axis -> selected choice_idx). ラジオ click で更新される.
\t\tvar oi_selected = { F: 1, front: 1, side1: 1, side2: 1 };
\t\t// 選択中の fe ブロック種類×段数 (key 文字列). 既定は oi_data.fe_block.default_key.
\t\tvar fe_block_selected = (oi_data && oi_data.fe_block && oi_data.fe_block.default_key) || '';
\t\t// sale_type ID(mtb_sale_type の id。本サイトでの意味は次の通り):
\t\t// 1 通常 / 2 補助金窓 / 3 物置 / 4 フェンス / 5 デッキ / 6 芝生 / 9 商品のみ
\t\tvar SALE_TYPE_ID = ";
// line 1270
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 1270, $this->source); })()), "SaleType", [], "any", false, false, false, 1270), "id", [], "any", false, false, false, 1270), "html", null, true);
echo ";
\t\t";
// line 1273
echo "\t\t";
$context["option1_label"] = "オプション1";
// line 1274
echo "\t\t";
$context["option2_label"] = "オプション2";
// line 1275
echo "\t\t";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1275, $this->source); })()), "ProductCategories", [], "any", false, false, false, 1275))) {
// line 1276
echo "\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1276, $this->source); })()), "ProductCategories", [], "any", false, false, false, 1276));
foreach ($context['_seq'] as $context["_key"] => $context["pcat"]) {
// line 1277
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1277) == 31)) {
$context["option1_label"] = "サイズプリセット";
$context["option2_label"] = "駆動方式";
}
// line 1278
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1278) == 43)) {
$context["option1_label"] = "ランマ";
$context["option2_label"] = "タイプ";
}
// line 1279
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1279) == 15)) {
$context["option1_label"] = "棚タイプ";
}
// line 1280
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1280) == 17)) {
$context["option1_label"] = "窓タイプ";
}
// line 1281
echo "\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pcat'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 1282
echo "\t\t";
}
// line 1283
echo "
\t\t// 消費税率(pp.price/pp.ct/op_data.price は scraper が税抜で保存しているため、
\t\t// calcGoukei 出口で 1+TAX_RATE を掛けて税込 mitsumori_goukei にする)
\t\tvar TAX_RATE = 0.10;
\t\tfunction toIncTax(v) { return Math.round(v * (1 + TAX_RATE)); }
\t\t/**
\t\t * tg 用 block 別オプション差額の集計.
\t\t * 現選択 (W, D) から block key を作り、oi_data.blocks[blockKey] を取得.
\t\t * 各 axis (F/front/side1/side2) で oi_selected[axis] の choice の diff を合計.
\t\t * 戻り値: { total: 差額合計(税抜), items: [{name, label, diff}, ...] }
\t\t * block が無い (tg 以外 / 該当 (W,D) が未取得) なら total=0.
\t\t */
\t\tfunction collectOptionItems(curW, curD) {
\t\t\tvar result = { total: 0, items: [] };
\t\t\tif (!oi_data || !oi_data.blocks) return result;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return result;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\tfor (var i = 0; i < axes.length; i++) {
\t\t\t\tvar axis = axes[i];
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) continue;
\t\t\t\tvar idx = oi_selected[axis] || 1;
\t\t\t\tvar pick = null;
\t\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\t\tif (parseInt(choices[j].idx) === parseInt(idx)) { pick = choices[j]; break; }
\t\t\t\t}
\t\t\t\tif (!pick) pick = choices[0];
\t\t\t\tvar diff = parseInt(pick.diff) || 0;
\t\t\t\tresult.total += diff;
\t\t\t\tresult.items.push({
\t\t\t\t\tname: oi_data.axis_labels[axis] || axis,
\t\t\t\t\tlabel: pick.label,
\t\t\t\t\tdiff: diff,
\t\t\t\t});
\t\t\t}
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * tg ラジオ群を block 別に DOM へ描画する.
\t\t * W/D が確定したら現 block の 4 軸 (F/front/side1/side2) ラジオを #tg-options 要素に出す.
\t\t * block が空なら #tg-options を空にする.
\t\t */
\t\tfunction renderOptionItemRadios(curW, curD) {
\t\t\tvar \$box = \$('#tg-options');
\t\t\tif (!\$box.length) return;
\t\t\t\$box.empty();
\t\t\tif (!oi_data || !oi_data.blocks) return;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\taxes.forEach(function(axis) {
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) return;
\t\t\t\tvar axisLabel = (oi_data.axis_labels && oi_data.axis_labels[axis]) || axis;
\t\t\t\tvar \$section = \$('<div class=\"form-group tg-axis\"></div>');
\t\t\t\t\$section.append('<p class=\"rp-section-label\"><strong>' + axisLabel + '</strong>: <span class=\"tg-axis-selected\"></span></p>');
\t\t\t\tvar \$list = \$('<div class=\"tg-choice-list\"></div>');
\t\t\t\tchoices.forEach(function(ch, i) {
\t\t\t\t\tvar inputId = 'tg_' + axis + '_' + ch.idx;
\t\t\t\t\tvar name = 'tg_' + axis;
\t\t\t\t\tvar checked = (parseInt(ch.idx) === parseInt(oi_selected[axis] || 1)) ? ' checked' : '';
\t\t\t\t\tvar diffTxt = ch.diff > 0 ? '+' + formatter.format(ch.diff) + '円' : (ch.diff < 0 ? formatter.format(ch.diff) + '円' : '±0');
\t\t\t\t\t\$list.append(
\t\t\t\t\t\t'<label class=\"tg-choice\"><input type=\"radio\" name=\"' + name + '\" id=\"' + inputId + '\" value=\"' + ch.idx + '\" data-axis=\"' + axis + '\"' + checked + '> ' +
\t\t\t\t\t\tch.label + '<span class=\"tg-diff\">(' + diffTxt + ')</span></label>'
\t\t\t\t\t);
\t\t\t\t});
\t\t\t\t\$section.append(\$list);
\t\t\t\t\$box.append(\$section);
\t\t\t});
\t\t\t// ラジオ click で oi_selected を更新 → 再計算
\t\t\t\$box.off('change.tg').on('change.tg', 'input[type=\"radio\"][data-axis]', function() {
\t\t\t\tvar axis = \$(this).data('axis');
\t\t\t\toi_selected[axis] = parseInt(\$(this).val()) || 1;
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t\tupdateOptionItemSelectedLabels();
\t\t}
\t\tfunction updateOptionItemSelectedLabels() {
\t\t\t\$('#tg-options .tg-axis').each(function() {
\t\t\t\tvar \$sel = \$(this).find('input[type=\"radio\"]:checked');
\t\t\t\tif (!\$sel.length) return;
\t\t\t\tvar label = \$sel.parent().contents().filter(function() { return this.nodeType === 3; }).text().trim();
\t\t\t\t\$(this).find('.tg-axis-selected').text(label);
\t\t\t});
\t\t}
\t\t// =========================================================
\t\t// fe (sale_type=4) ブロック種類×段数 サブ UI
\t\t// =========================================================
\t\t/**
\t\t * fe_block の親オプション (= op_data 内の「ご希望のフェンス設置方法」 entry)
\t\t * を name でルックアップし、その index を返す. 見つからなければ -1.
\t\t * fe_block.depends_on_name が設定されていればそれで照合.
\t\t * 未設定なら 'ご希望のフェンス設置方法' を含む name にフォールバック.
\t\t */
\t\tfunction findFeBlockParentOpIndex() {
\t\t\tif (!oi_data || !oi_data.fe_block) return -1;
\t\t\tvar needle = oi_data.fe_block.depends_on_name || 'ご希望のフェンス設置方法';
\t\t\tfor (var i = 0; i < op_data.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tif (op_data[i].name.indexOf(needle) >= 0) return i;
\t\t\t}
\t\t\treturn -1;
\t\t}
\t\t/**
\t\t * fe_block の現在の選択値の price (税抜) と choice 内容を集計.
\t\t * 親オプション (= 'ご希望のフェンス設置方法') が depends_on_value を選んでいる
\t\t * ときだけ加算する. それ以外 (既存ブロック側 / 親未選択) は price=0.
\t\t * 戻り値: { price: 0|N, choice: {key,label,price}|null, active: bool }
\t\t */
\t\tfunction collectFeBlock() {
\t\t\tvar result = { price: 0, choice: null, active: false };
\t\t\tif (SALE_TYPE_ID !== 4) return result;
\t\t\tif (!oi_data || !oi_data.fe_block) return result;
\t\t\tif (!oi_data.fe_block.choices || !oi_data.fe_block.choices.length) return result;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return result;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tif (parentSel !== triggerValue) return result; // 親が新規ブロック積み以外なら無加算
\t\t\tresult.active = true;
\t\t\tvar choices = oi_data.fe_block.choices;
\t\t\tvar pick = null;
\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\tif (choices[j].key === fe_block_selected) { pick = choices[j]; break; }
\t\t\t}
\t\t\tif (!pick) pick = choices[0];
\t\t\tresult.choice = pick;
\t\t\tresult.price = parseInt(pick.price) || 0;
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * fe_block ラジオ群を #fe-block-options 要素に描画する.
\t\t * active=false (親が「新規にブロック積み」以外) のときは非表示.
\t\t */
\t\tfunction renderFeBlockRadios() {
\t\t\tvar \$box = \$('#fe-block-options');
\t\t\tif (!\$box.length) return;
\t\t\tif (!oi_data || !oi_data.fe_block || !oi_data.fe_block.choices) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tvar visible = (ops[parentIdx] === triggerValue);
\t\t\tif (!visible) {
\t\t\t\t\$box.hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar fb = oi_data.fe_block;
\t\t\t\$box.empty();
\t\t\tvar \$title = \$('<p class=\"rp-section-label\"><strong>' + (fb.title || 'ブロックの種類と段数') + '</strong></p>');
\t\t\t\$box.append(\$title);
\t\t\t// 他オプション群と同じ .opt-btn-group / .opt-btn 形式で描画.
\t\t\t// 生の <label><input type=radio> ... 形式だと CSS 定義が無く
\t\t\t// ラベル折り返し・縦ズレ・隣接 opt-btn との間隔不揃いが発生する.
\t\t\tvar \$list = \$('<div class=\"opt-btn-group\" style=\"flex-direction:column;align-items:stretch;\"></div>');
\t\t\tfb.choices.forEach(function(ch) {
\t\t\t\tvar inputId = 'fe_block_' + ch.key;
\t\t\t\tvar isSel = (ch.key === fe_block_selected);
\t\t\t\tvar checked = isSel ? ' checked' : '';
\t\t\t\tvar selCls = isSel ? ' is-selected' : '';
\t\t\t\tvar priceTxt = (parseInt(ch.price) || 0) > 0
\t\t\t\t\t? ' <span class=\"fe-block-price\" style=\"margin-left:6px;color:#666;font-size:12px;white-space:nowrap;\">(+' + formatter.format(toIncTax(parseInt(ch.price))) + '円 税込)</span>'
\t\t\t\t\t: '';
\t\t\t\t\$list.append(
\t\t\t\t\t'<label class=\"opt-btn' + selCls + '\" style=\"text-align:left;display:flex;align-items:center;flex-wrap:wrap;\">' +
\t\t\t\t\t'<input type=\"radio\" name=\"fe_block\" id=\"' + inputId + '\" value=\"' + ch.key + '\"' + checked + '>' +
\t\t\t\t\t'<span class=\"fe-block-label\">' + ch.label + '</span>' +
\t\t\t\t\tpriceTxt +
\t\t\t\t\t'</label>'
\t\t\t\t);
\t\t\t});
\t\t\t\$box.append(\$list);
\t\t\t\$box.show();
\t\t\t\$box.off('change.fe_block').on('change.fe_block', 'input[type=\"radio\"][name=\"fe_block\"]', function() {
\t\t\t\tfe_block_selected = \$(this).val();
\t\t\t\t// is-selected 切替 (opt-btn 形式共通)
\t\t\t\t\$box.find('label.opt-btn').removeClass('is-selected');
\t\t\t\t\$(this).closest('label.opt-btn').addClass('is-selected');
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t}
\t\t/**
\t\t * fe (sale_type=4) で op_data エントリの連動表示制御.
\t\t * 親「ご希望のフェンス設置方法」の選択値に応じて、
\t\t * - 「既存ブロックに穴空け工事が必要ですか?」 entry を表示/非表示
\t\t * 切替の trigger は親選択値の文字列で判定 (entry index にハードコードしない).
\t\t */
\t\tfunction updateFeOpConditionalVisibility() {
\t\t\tif (SALE_TYPE_ID !== 4) return;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\t// 親が「既存ブロックに設置する」 (= off 側) のとき穴空け entry を表示
\t\t\tvar triggerOffValue = (op_data[parentIdx] && op_data[parentIdx].off) || '既存ブロックに設置する';
\t\t\t\$('div[data-op-name]').each(function() {
\t\t\t\tvar n = \$(this).attr('data-op-name') || '';
\t\t\t\tif (n.indexOf('穴空け') >= 0) {
\t\t\t\t\tif (parentSel === triggerOffValue) {
\t\t\t\t\t\t\$(this).show();
\t\t\t\t\t} else {
\t\t\t\t\t\t\$(this).hide();
\t\t\t\t\t}
\t\t\t\t}
\t\t\t});
\t\t}
\t\t/**
\t\t * 選択中の施工オプションを集計し、ON選択分の price を合計する.
\t\t * 戻り値: { total: 合計金額, items: [{name, value, price}, ...] }
\t\t */
\t\tfunction collectOptions() {
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar total = 0;
\t\t\tvar items = [];
\t\t\tfor (var i = 0; i < ops.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tvar sel = ops[i];
\t\t\t\tif (!sel) continue;
\t\t\t\tvar price = parseInt(op_data[i].price) || 0;
\t\t\t\t// 「ON」選択時のみ加算(OFF や「不要」「商品購入のみ」は加算しない)
\t\t\t\tvar isOn = (sel === op_data[i].on);
\t\t\t\titems.push({
\t\t\t\t\tname: op_data[i].name,
\t\t\t\t\tvalue: sel,
\t\t\t\t\tprice: isOn ? price : 0,
\t\t\t\t\ton: op_data[i].on,
\t\t\t\t\toff: op_data[i].off,
\t\t\t\t});
\t\t\t\tif (isOn) total += price;
\t\t\t}
\t\t\t// fe (sale_type=4) のブロック種類×段数 分を items / total に統合.
\t\t\t// 親オプション「ご希望のフェンス設置方法」 が 「新規にブロック積みを行う」 のとき
\t\t\t// だけ加算される (collectFeBlock 内で判定済み).
\t\t\tvar fb = collectFeBlock();
\t\t\tif (fb.active && fb.choice) {
\t\t\t\titems.push({
\t\t\t\t\tname: (oi_data.fe_block && oi_data.fe_block.title) || 'ブロックの種類と段数',
\t\t\t\t\tvalue: fb.choice.label,
\t\t\t\t\tprice: fb.price,
\t\t\t\t\ton: fb.choice.label,
\t\t\t\t\toff: '',
\t\t\t\t});
\t\t\t\ttotal += fb.price;
\t\t\t}
\t\t\treturn { total: total, items: items };
\t\t}
\t\t/**
\t\t * free_area 1 エントリ ({w,d,h,m,c,price,unit_price,maker_price,ct,option1,option2})
\t\t * から sale_type 別に最終金額を算出する.
\t\t *
\t\t * 計算式(amount=1 ベース、出口で × 1.10 税込化):
\t\t * 1 通常 : price + ct + option_sum
\t\t * 2 補助金窓 : price × set_count + (ct + (set_count-1) × option2) + option_sum
\t\t * 3 物置 : (price + ct) × daisu + option_sum
\t\t * 4 フェンス : price + (maisu-1) × unit_price
\t\t * + ct + max(0, maisu-3) × option1
\t\t * + option_sum (maisu >= 3)
\t\t * 5 デッキ : price + ct + option_sum (area は表示用、計算非関与)
\t\t * 6 芝生 : price × ceil(area / (w_m × h_m)) + ct + option_sum
\t\t * 9 商品のみ : price のみ(カート quantity 倍で総額)
\t\t *
\t\t * fe では option1 を ct_up、um では option2 を ct_up として転用.
\t\t * tf では w / h にロール幅・長さが格納されており parseLen で数値抽出.
\t\t *
\t\t * @param {Object} pp free_area の 1 行(matrix エントリ)
\t\t * @param {number} optionTotal collectOptions().total
\t\t * @param {Object} ctx UI 入力 {set_count, daisu, maisu, area, quantityOnly, ...}
\t\t * @returns {Object} {goukei, price, ct, opt, qty} すべて税込整数
\t\t */
\t\tfunction calcGoukei(pp, optionTotal, ctx) {
\t\t\tvar basePrice = parseInt(pp.price) || 0;
\t\t\tvar baseCt = parseInt(pp.ct) || 0;
\t\t\tvar unitPrice = parseInt(pp.unit_price) || 0;
\t\t\tvar optSum = optionTotal;
\t\t\tvar price = basePrice;
\t\t\tvar ct = baseCt;
\t\t\tvar qty = 1;
\t\t\tvar goukei = 0;
\t\t\t// 「商品購入のみ」選択時は工事費・オプションをゼロにする(任意 sale_type で適用)
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tif (purchaseOnly) {
\t\t\t\tbaseCt = 0;
\t\t\t\tct = 0;
\t\t\t\toptSum = 0;
\t\t\t}
\t\t\tswitch (SALE_TYPE_ID) {
\t\t\t\tcase 2: { // 補助金・窓 (シンプル表引き方式 2026-05-)
\t\t\t\t\t// 2026-05 仕様簡素化: 枚数軸を廃止し、subtype に枚数を内包.
\t\t\t\t\t// pp.price / pp.ct は (W, H, ガラス, subtype) の単一価格.
\t\t\t\t\t// 複数枚をまとめて買う場合はカート quantity で表現.
\t\t\t\t\tqty = 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 3: { // 物置・ゴミステーション
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.daisu) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt * qty;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 4: { // フェンス・組み立て式(maisu ≥ 3、base_amount = 3)
\t\t\t\t\t// scraper は amount=3 を base にしているので pp.price = price(3),
\t\t\t\t\t// pp.unit_price = price(4) - price(3).
\t\t\t\t\tqty = Math.max(3, parseInt(ctx.maisu) || 3);
\t\t\t\t\tprice = basePrice + (qty - 3) * unitPrice;
\t\t\t\t\t// option1 が ct_up (4枚目以降の増分). 未設定なら ct 固定動作
\t\t\t\t\tvar ctUp1 = parseInt(pp.option1) || 0;
\t\t\t\t\tct = baseCt + Math.max(0, qty - 3) * ctUp1;
\t\t\t\t\t// fe_block(ブロック積み段数): collectOptions が base(3枚分)を optSum に
\t\t\t\t\t// 算入済み. ブロック費も本体同様に枚数連動するため、4枚目以降は 1枚毎に
\t\t\t\t\t// choice.unit_price(= block(4)-block(3)) を加算する.
\t\t\t\t\t// (顧客指摘「何枚施工でも増える金額が同じ」の是正。unit_price 未設定の
\t\t\t\t\t// 旧データでは +0 で従来動作。)
\t\t\t\t\tif (!purchaseOnly) {
\t\t\t\t\t\tvar fbC = collectFeBlock();
\t\t\t\t\t\tif (fbC.active && fbC.choice) {
\t\t\t\t\t\t\toptSum += Math.max(0, qty - 3) * (parseInt(fbC.choice.unit_price) || 0);
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 5: { // ウッドデッキ・タイルデッキ
\t\t\t\t\t// area は担当者向けの参考値として保持(計算には使わない)
\t\t\t\t\tqty = 1;
\t\t\t\t\tgoukei = basePrice + baseCt + optSum;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 6: { // 芝生・人工芝(ロール単位)
\t\t\t\t\t// pp.w \"1m\", pp.h \"10m\" から数値抽出
\t\t\t\t\tvar w_m = parseLen(pp.w);
\t\t\t\t\tvar h_m = parseLen(pp.h);
\t\t\t\t\tvar rollSize = w_m * h_m;
\t\t\t\t\tif (!rollSize || rollSize <= 0) rollSize = 1;
\t\t\t\t\t// 施工サイズ(面積)があれば必要枚数を自動算出。無ければ直接指定の枚数を使う。
\t\t\t\t\tvar area = parseFloat(ctx.area) || 0;
\t\t\t\t\tif (area > 0) {
\t\t\t\t\t\tqty = Math.max(1, Math.ceil(area / rollSize));
\t\t\t\t\t} else {
\t\t\t\t\t\tqty = Math.max(1, parseInt(ctx.tf_qty) || 1);
\t\t\t\t\t}
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 7: { // 数量買い・基本工事費固定(gf ガーデンファニチャー / st 石材)
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.suuryou) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt; // ct は固定(数量に依らない)
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 9: { // 商品のみ購入
\t\t\t\t\t// カート側で quantity × unit price するため goukei は単品価格
\t\t\t\t\tqty = parseInt(ctx.quantityOnly) || 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = 0;
\t\t\t\t\toptSum = 0;
\t\t\t\t\tgoukei = price;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tdefault: { // 1: 通常(カーポート等、matrix 選択のみ)
\t\t\t\t\tqty = 1;
\t\t\t\t\tgoukei = basePrice + baseCt + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t}
\t\t\t// 出口で税込化(pp.price/pp.ct/op_data.price はすべて税抜で保存されている前提)
\t\t\treturn {
\t\t\t\tgoukei: toIncTax(goukei),
\t\t\t\tprice: toIncTax(price),
\t\t\t\tct: toIncTax(ct),
\t\t\t\topt: toIncTax(optSum),
\t\t\t\tqty: qty,
\t\t\t};
\t\t}
\t\t/**
\t\t * 寸法文字列から「メートル単位の数値」を抽出する.
\t\t *
\t\t * 単位は m / cm / mm を認識し、いずれも m 単位に正規化して返す.
\t\t * 単位が無い場合は m 単位とみなす(旧 tf データ \"1m\" \"10m\" との互換).
\t\t * 数値が見つからない場合は 0 を返す(呼び出し側で fallback).
\t\t *
\t\t * 例:
\t\t * \"1m\" → 1
\t\t * \"100cm\" → 1 (2026-06 以降の m → cm 正規化に対応)
\t\t * \"200cm\" → 2
\t\t * \"5.5m\" → 5.5
\t\t * \"1000mm\" → 1
\t\t * \"\" → 0
\t\t */
\t\tfunction parseLen(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)\\s*(mm|cm|m)?/i);
\t\t\tif (!m) return 0;
\t\t\tvar n = parseFloat(m[1]);
\t\t\tif (isNaN(n)) return 0;
\t\t\tvar unit = (m[2] || 'm').toLowerCase();
\t\t\tif (unit === 'cm') return n / 100;
\t\t\tif (unit === 'mm') return n / 1000;
\t\t\treturn n; // 'm' or no unit
\t\t}
\t\t// pp は autoSelectFirstColor 等からも参照するので global にする
\t\tvar pp = ";
// line 1730
echo (isset($context["pp"]) || array_key_exists("pp", $context) ? $context["pp"] : (function () { throw new RuntimeError('Variable "pp" does not exist.', 1730, $this->source); })());
echo ";
\t\t// sale_type=2 の幅 / 高さ ladder (Twig p_w / p_h を JS で参照するため).
\t\t// 入力 mm 値を pp の幅・高さバケット文字列にマッピングする際の元データ.
\t\t// p_w / p_h は連想配列で来ることがあるため Object.values で配列化する.
\t\tvar PP_W_LADDER = Object.values(";
// line 1735
echo json_encode(((array_key_exists("p_w", $context)) ? (_twig_default_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 1735, $this->source); })()), [])) : ([])));
echo " || {});
\t\tvar PP_H_LADDER = Object.values(";
// line 1736
echo json_encode(((array_key_exists("p_h", $context)) ? (_twig_default_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 1736, $this->source); })()), [])) : ([])));
echo " || {});
\t\t/* ============================================================
\t\t sale_type=2 (補助金窓) 専用: 複数タイプ集計 & 補助金計算
\t\t ============================================================
\t\t - 入力 UI: #window-types-container 配下の .window-type-block
\t\t - 補助金根拠: 先進的窓リノベ2026事業
\t\t https://window-renovation2026.env.go.jp/construction/inner-window.html
\t\t - 価格軸: (subtype, w, h, glass, color) で pp を lookup
\t\t - 1 商品 = 1 明細 にまとめ、内訳 JSON を別途保存予定 (cart 連携は後続タスク)
\t\t ============================================================ */
\t\t// 補助金マトリクス: [住宅区分][性能][サイズ区分] → 1 箇所あたり金額 (税抜・端数なし)
\t\tvar WINDOW_SUBSIDY_MATRIX = {
\t\t\tdetached: { // 戸建住宅・延床240㎡以下の非住宅
\t\t\t\tP: { G: 140000, L: 89000, M: 58000, S: 36000 },
\t\t\t\tS: { G: 76000, L: 52000, M: 34000, S: 22000 }
\t\t\t},
\t\t\tapartment: { // 低層・中高層集合住宅・240㎡超の非住宅
\t\t\t\tP: { G: 152000, L: 98000, M: 64000, S: 40000 },
\t\t\t\tS: { G: 83000, L: 57000, M: 37000, S: 24000 }
\t\t\t}
\t\t};
\t\t// 住宅区分: 画面 UI (input[name=\"window_housing_type\"]) から取得する.
\t\t// 既定値は PFC meta_key=\"住宅区分\" を fallback (未設定なら '戸建').
\t\tvar HOUSING_TYPE_DEFAULT = ";
// line 1762
echo json_encode(_twig_default_filter($this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1762, $this->source); })()), "id", [], "any", false, false, false, 1762), "住宅区分"), "戸建"));
echo ";
\t\tfunction getCurrentHousingKey() {
\t\t\tvar el = document.querySelector('input[name=\"window_housing_type\"]:checked');
\t\t\tvar v = el ? el.value : HOUSING_TYPE_DEFAULT;
\t\t\treturn (v === '集合住宅') ? 'apartment' : 'detached';
\t\t}
\t\t// 商品シリーズ自動判定 (Product.name から)
\t\t// 根拠カタログ: YKK AP「ウチリモ」XAAAA-H26-067-1 (2026.04), 同「LiteU」XAAAA-H16-088-2,
\t\t// 三協アルミ「プラメイクEII」0142_STJ1931L, LIXIL「インプラス」(既知)
\t\tvar PRODUCT_NAME_RAW = ";
// line 1772
echo json_encode(((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "name", [], "any", true, true, false, 1772)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "name", [], "any", false, false, false, 1772), "")) : ("")));
echo ";
\t\tfunction detectProductSeries(name) {
\t\t\tif (!name) return null;
\t\t\tif (/ウチリモ/.test(name)) return 'uchirimo';
\t\t\tif (/プラマード\\s*U/i.test(name)) return 'pramado_u';
\t\t\tif (/インプラス/.test(name)) return 'inplus';
\t\t\tif (/プラメイク\\s*EII|プラメイクEII/i.test(name)) return 'plamake_eii';
\t\t\tif (/LiteU/i.test(name)) return 'lite_u';
\t\t\treturn null;
\t\t}
\t\t// シリーズ上限グレード:
\t\t// 'P' = SS/P まで到達可能 (真空断熱ガラス採用シリーズ)
\t\t// 'S' = Low-E 複層止まり (真空断熱ガラスのラインなし)
\t\t// null = 単板のみ → 補助金対象外
\t\tvar SERIES_GRADE_CAP = {
\t\t\tuchirimo: 'P',
\t\t\tpramado_u: 'P',
\t\t\tinplus: 'S',
\t\t\tplamake_eii: 'S',
\t\t\tlite_u: null
\t\t};
\t\tvar DETECTED_SERIES = detectProductSeries(PRODUCT_NAME_RAW);
\t\tvar SERIES_GRADE_CAP_VAL = (DETECTED_SERIES !== null && Object.prototype.hasOwnProperty.call(SERIES_GRADE_CAP, DETECTED_SERIES))
\t\t\t? SERIES_GRADE_CAP[DETECTED_SERIES]
\t\t\t: undefined;
\t\t// 商品単位グレード上限 (PFC `meta_key=補助金グレード上限` で個別上書き)
\t\t// 値: 'P' / 'SS' / 'S' / '対象外' / '無' / 'NONE' / 空文字 (未指定)
\t\tvar PRODUCT_GRADE_CAP_RAW = ";
// line 1800
echo json_encode(_twig_default_filter($this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1800, $this->source); })()), "id", [], "any", false, false, false, 1800), "補助金グレード上限"), ""));
echo ";
\t\tfunction normalizeGradeCap(v) {
\t\t\tif (v === null || v === undefined || v === '') return undefined;
\t\t\tvar s = String(v).trim().toUpperCase();
\t\t\tif (s === 'NONE' || s === '対象外' || s === '無') return null;
\t\t\tif (s === 'P' || s === 'SS') return 'P';
\t\t\tif (s === 'S') return 'S';
\t\t\treturn undefined;
\t\t}
\t\tvar PRODUCT_GRADE_CAP = normalizeGradeCap(PRODUCT_GRADE_CAP_RAW);
\t\t// 窓種 (subtype = option1) ごとのグレード上限.
\t\t// 根拠: YKK AP「ウチリモ」業務用 (XAAAA-H26-067-1) の窓種別ラインナップで
\t\t// 真空ガラス (Glavenir) の設定有無を確認:
\t\t// 引違い窓 (2/3/4枚建) / 浴室仕様 引違い窓 / FIX窓 → P 到達可能
\t\t// 内開き窓 (居室/浴室) / 開き窓テラス / テラスドア類 → 真空ガラスなし → S 止まり
\t\tfunction detectSubtypeGradeCap(subtype) {
\t\t\tif (!subtype) return undefined;
\t\t\tvar s = String(subtype);
\t\t\tif (/内開|開き窓テラス|テラスドア|開き戸/.test(s)) return 'S';
\t\t\treturn undefined;
\t\t}
\t\t// クリップ: 強さは 'P' > 'S' > null (対象外). cap=null は強制対象外, cap=undefined は無効化なし.
\t\tfunction clipGradeBy(grade, cap) {
\t\t\tif (cap === undefined) return grade;
\t\t\tif (cap === null) return null;
\t\t\tif (grade === null) return null;
\t\t\tif (cap === 'S' && grade === 'P') return 'S';
\t\t\treturn grade;
\t\t}
\t\tfunction finalizeGlassGrade(raw, subtype) {
\t\t\tvar g = clipGradeBy(raw, SERIES_GRADE_CAP_VAL);
\t\t\tg = clipGradeBy(g, detectSubtypeGradeCap(subtype));
\t\t\tg = clipGradeBy(g, PRODUCT_GRADE_CAP);
\t\t\treturn g;
\t\t}
\t\t/**
\t\t * ガラスタイプ名から性能区分 'P' (SS, Uw≤1.1) / 'S' (Uw≤1.5) / null を判別.
\t\t * null = 補助対象外.
\t\t *
\t\t * 根拠: YKK AP「ウチリモ 内窓」業務用カタログ (XAAAA-H26-069-1) で
\t\t * P (SS) は真空断熱ガラスのみ、Low-E はアルゴン入りでも S 止まり、
\t\t * Low-E ガス無 + 型ガラス / フロストは 2026年4月で対象外、
\t\t * が確認できた。アルゴン入り Low-E を P 判定する旧ルールは誤りだった。
\t\t *
\t\t * シリーズによっては P がそもそも存在しない (LIXIL インプラスは S 一律)
\t\t * ため、最終的には PFC で商品単位の上限を上書きできる仕組みが必要。
\t\t */
\t\tfunction detectGlassPerformance(glassName) {
\t\t\tif (!glassName) return null;
\t\t\tvar n = String(glassName);
\t\t\t// 補助対象外: 単板 / 和紙調 / 防音 / 防犯 / 型ガラス・フロスト (Low-E ガス無の型は 2026/4 で対象外)
\t\t\tif (/単ガラス|単板|和紙調|防音|防犯|複層\\/型|型ガラス|フロスト/.test(n)) return null;
\t\t\t// P (SS): 真空断熱ガラスのみ
\t\t\tif (/真空断熱/.test(n)) return 'P';
\t\t\t// S: Low-E 系のみ (アルゴン入りでも S 止まり)
\t\t\tif (/Low-?E/i.test(n)) return 'S';
\t\t\t// 一般複層 / ブラインドイン複層 / 複層強化 など Low-E 無しの複層は補助対象外
\t\t\treturn null;
\t\t}
\t\t/**
\t\t * 幅 mm × 高さ mm からサイズ区分 'G' (≥4.0㎡) / 'L' (2.8-3.9) / 'M' (1.6-2.7) / 'S' (0.2-1.5) / null.
\t\t * null = 補助対象外 (0.2㎡ 未満).
\t\t */
\t\tfunction detectSizeClass(w_mm, h_mm) {
\t\t\tvar w = parseFloat(w_mm) || 0;
\t\t\tvar h = parseFloat(h_mm) || 0;
\t\t\tif (w <= 0 || h <= 0) return null;
\t\t\tvar area = (w * h) / 1000000.0;
\t\t\tif (area < 0.2) return null;
\t\t\tif (area < 1.6) return 'S';
\t\t\tif (area < 2.8) return 'M';
\t\t\tif (area < 4.0) return 'L';
\t\t\treturn 'G';
\t\t}
\t\tfunction lookupSubsidyAmount(performance, sizeClass) {
\t\t\tif (!performance || !sizeClass) return 0;
\t\t\tvar t = WINDOW_SUBSIDY_MATRIX[getCurrentHousingKey()];
\t\t\tif (!t || !t[performance]) return 0;
\t\t\treturn t[performance][sizeClass] || 0;
\t\t}
\t\t/**
\t\t * mm 入力値を ladder バケット文字列に変換する.
\t\t * bucketizeMm(1750, [\"100cm まで\",\"150cm まで\",\"200cm まで\",\"300cm まで\"]) → \"200cm まで\"
\t\t * - 入力が空 or 0 のときはそのまま返す (未入力扱い)
\t\t * - 入力がラダー最大を超えるときは最大バケットを返す (= 価格上限の保護)
\t\t * - 入力文字列が既にラダーラベルそのものなら無変換 (互換のため)
\t\t */
\t\tfunction bucketizeMm(input, ladder) {
\t\t\tif (!input && input !== 0) return '';
\t\t\tif (!ladder || ladder.length === 0) return input;
\t\t\tvar s = String(input).trim();
\t\t\tif (s === '') return '';
\t\t\tif (ladder.indexOf(s) >= 0) return s;
\t\t\tvar mm = parseMm(s);
\t\t\tif (mm <= 0) return s;
\t\t\tvar withMax = ladder.map(function(b) { return { label: b, max: parseMm(b) }; });
\t\t\twithMax.sort(function(a, b) { return a.max - b.max; });
\t\t\tfor (var i = 0; i < withMax.length; i++) {
\t\t\t\tif (mm <= withMax[i].max) return withMax[i].label;
\t\t\t}
\t\t\treturn withMax[withMax.length - 1].label;
\t\t}
\t\t/**
\t\t * pp 配列から該当 1 行を返す. 完全一致優先、見つからなければ最初の候補.
\t\t * 軸: subtype (option1) / w / h / m / c. axisMatch は既存ロジックと同じ.
\t\t * sale_type=2 では pw_val / ph_val に mm 数値が来るため、内部で bucketizeMm
\t\t * を通してから既存マッチングに渡す.
\t\t */
\t\tfunction lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val) {
\t\t\tif (!pp || pp.length === 0) return null;
\t\t\tvar pw_bucket = bucketizeMm(pw_val, PP_W_LADDER);
\t\t\tvar ph_bucket = bucketizeMm(ph_val, PP_H_LADDER);
\t\t\tvar axMatch = function(input, value) {
\t\t\t\treturn input == value || input === '指定なし' || value === '' || value == null;
\t\t\t};
\t\t\tvar colMatch = function(input, value) {
\t\t\t\tif (axMatch(input, value)) return true;
\t\t\t\tif (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t\treturn value.split('/').some(function(s) { return s.trim() === input; });
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t};
\t\t\tvar candidates = pp.filter(function(el) {
\t\t\t\treturn axMatch(pw_bucket, el.w)
\t\t\t\t\t&& axMatch(ph_bucket, el.h)
\t\t\t\t\t&& axMatch(pm_val, el.m)
\t\t\t\t\t&& axMatch(subtype, el.option1);
\t\t\t});
\t\t\tfor (var i = 0; i < candidates.length; i++) {
\t\t\t\tif (colMatch(pc_val, candidates[i].c)) return candidates[i];
\t\t\t}
\t\t\treturn candidates[0] || null;
\t\t}
\t\t/**
\t\t * \"1000mm\" / \"200cm\" / \"1.0m\" / 単位なし → mm に正規化して返す.
\t\t * UI 上の「200cm まで」等の文字列をそのまま渡せるようにする.
\t\t */
\t\tfunction parseMm(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)/);
\t\t\tif (!m) return 0;
\t\t\tvar num = parseFloat(m[1]);
\t\t\tif (/mm/i.test(str)) return num;
\t\t\tif (/cm/i.test(str)) return num * 10;
\t\t\tif (/(^|\\d)\\s*m(\$|\\W)/i.test(str)) return num * 1000;
\t\t\treturn num;
\t\t}
\t\t/**
\t\t * 1 タイプブロックから入力を読み、pp lookup → 単価・補助金額を計算して返す.
\t\t * incomplete=true: 軸のどれかが未選択 → 計算しない (UI で「未選択」を示すため).
\t\t */
\t\tfunction collectWindowTypeRow(block) {
\t\t\tvar get = function(axis) {
\t\t\t\t// radio / checkbox は :checked、それ以外 (number/text) は値そのまま.
\t\t\t\tvar radio = block.querySelector('input[data-axis=\"' + axis + '\"]:checked');
\t\t\t\tif (radio) return radio.value;
\t\t\t\tvar any = block.querySelector('input[data-axis=\"' + axis + '\"]');
\t\t\t\tif (!any) return '';
\t\t\t\tif (any.type === 'radio' || any.type === 'checkbox') return '';
\t\t\t\treturn (any.value || '').trim();
\t\t\t};
\t\t\tvar setqtyEl = block.querySelector('input[data-axis=\"setqty\"]');
\t\t\tvar subtype = get('subtype');
\t\t\tvar pw_val = get('pw');
\t\t\tvar ph_val = get('ph');
\t\t\tvar pm_val = get('pm');
\t\t\tvar pc_val = get('pc');
\t\t\tvar setqty = setqtyEl ? Math.max(1, parseInt(setqtyEl.value) || 1) : 1;
\t\t\tvar row = {
\t\t\t\tsubtype: subtype, pw: pw_val, ph: ph_val, pm: pm_val, pc: pc_val, setqty: setqty,
\t\t\t\tunit_price_exc: 0, unit_ct_exc: 0, subsidy: 0,
\t\t\t\tsize_class: null, glass_perf: null,
\t\t\t\tincomplete: false
\t\t\t};
\t\t\t// p_option1 / p_w / p_h / p_m / color のいずれかが商品データに無いときは未選択でも完了扱いにする.
\t\t\t// (例: 商品によっては subtype が無い場合がある)
\t\t\tvar hasSubtype = !!block.querySelector('input[data-axis=\"subtype\"]');
\t\t\tvar hasPw = !!block.querySelector('input[data-axis=\"pw\"]');
\t\t\tvar hasPh = !!block.querySelector('input[data-axis=\"ph\"]');
\t\t\tvar hasPm = !!block.querySelector('input[data-axis=\"pm\"]');
\t\t\tvar hasPc = !!block.querySelector('input[data-axis=\"pc\"]');
\t\t\tif ((hasSubtype && !subtype) || (hasPw && !pw_val) || (hasPh && !ph_val)
\t\t\t || (hasPm && !pm_val) || (hasPc && !pc_val)) {
\t\t\t\trow.incomplete = true;
\t\t\t\treturn row;
\t\t\t}
\t\t\tvar ppRow = lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val);
\t\t\tif (ppRow) {
\t\t\t\trow.unit_price_exc = parseInt(ppRow.price) || 0;
\t\t\t\trow.unit_ct_exc = parseInt(ppRow.ct) || 0;
\t\t\t}
\t\t\t// ガラス名検出 → シリーズ上限 → subtype 上限 → 商品上限 の順で min クリップ.
\t\t\t// 例: LiteU (SERIES_GRADE_CAP_VAL=null) は Low-E でも null に落ちて補助対象外.
\t\t\t// 例: ウチリモの「内開き窓」subtype は真空ガラスでも S に落ちる.
\t\t\trow.glass_perf = finalizeGlassGrade(detectGlassPerformance(pm_val), subtype);
\t\t\trow.size_class = detectSizeClass(parseMm(pw_val), parseMm(ph_val));
\t\t\trow.subsidy = lookupSubsidyAmount(row.glass_perf, row.size_class);
\t\t\treturn row;
\t\t}
\t\t/**
\t\t * sale_type=2 用集計: 全タイプから合計を出し DOM 更新.
\t\t * 計算式 (税抜→税込で出口で 1.10 倍):
\t\t * 商品金額 = Σ(各タイプ単価 × set_qty)
\t\t * 基本工事費 = 1 回分 (各タイプ pp.ct のうち最初に得た非ゼロ値)
\t\t * 補助金合計 = Σ(各タイプ補助金 × set_qty)
\t\t * 実質支払額 = (商品+ct+option) 税込 - 補助金合計
\t\t */
\t\tfunction recalcAllForSaleType2() {
\t\t\tif (typeof SALE_TYPE_ID === 'undefined' || SALE_TYPE_ID != 2) return;
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text('価格データ準備中');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t['#mitsumori_goukei','#mitsumori_off','#mitsumori_price','#maker_price',
\t\t\t\t '#mitsumori_ct','#mitsumori_option','#mitsumori_kei','#mitsumori_shoukei','#mitsumori_tax']
\t\t\t\t .forEach(function(s){ \$(s).text('---円'); });
\t\t\t\treturn;
\t\t\t}
\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\tif (blocks.length === 0) return;
\t\t\tvar rows = [];
\t\t\tvar hasIncomplete = false;
\t\t\tvar baseCt = 0;
\t\t\tvar hasAnyPriced = false;
\t\t\tblocks.forEach(function(b) {
\t\t\t\tvar r = collectWindowTypeRow(b);
\t\t\t\trows.push({ block: b, row: r });
\t\t\t\tif (r.incomplete) hasIncomplete = true;
\t\t\t\tif (r.unit_ct_exc > 0 && baseCt === 0) baseCt = r.unit_ct_exc;
\t\t\t\tif (r.unit_price_exc > 0) hasAnyPriced = true;
\t\t\t\tvar subSpan = b.querySelector('.wt-subsidy-amount');
\t\t\t\tif (subSpan) subSpan.textContent = r.incomplete ? '―' : Math.round(r.subsidy * r.setqty).toLocaleString();
\t\t\t});
\t\t\tif (hasIncomplete || !hasAnyPriced) {
\t\t\t\t\$('#mitsumori_message').text('窓タイプを選択してください');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tvar sumPriceExc = 0, sumSubsidy = 0, totalPanes = 0;
\t\t\trows.forEach(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\tsumPriceExc += r.unit_price_exc * r.setqty;
\t\t\t\tsumSubsidy += r.subsidy * r.setqty;
\t\t\t\tif (r.unit_price_exc > 0) totalPanes += r.setqty;
\t\t\t});
\t\t\t// 内窓 工事費(顧客最終回答): 1枚目 22,000円 + 2枚目以降 1枚あたり +5,000円(税込表示額)。
\t\t\t// 既存パイプライン整合のため税抜(ctExc)も用意(税行 taxAmt 用)。商品購入のみは 0。
\t\t\tvar WINDOW_CT_BASE = 22000, WINDOW_CT_ADD = 5000;
\t\t\tvar ctIncTarget = purchaseOnly ? 0 : (WINDOW_CT_BASE + Math.max(0, totalPanes - 1) * WINDOW_CT_ADD);
\t\t\tvar ctExc = purchaseOnly ? 0 : Math.round(ctIncTarget / (1 + TAX_RATE));
\t\t\tvar optExc = purchaseOnly ? 0 : (collectOptions().total || 0);
\t\t\tvar sumPriceInc = Math.round(sumPriceExc * (1 + TAX_RATE));
\t\t\tvar ctInc = ctIncTarget;
\t\t\tvar optInc = Math.round(optExc * (1 + TAX_RATE));
\t\t\tvar goukeiInc = sumPriceInc + ctInc + optInc;
\t\t\t// 窓リノベ2026 申請条件:
\t\t\t// - 補助金合計 ≥ 50,000 円 (5 万円未満は申請不可 → 還元 0 円扱い)
\t\t\t// - 1 戸あたり上限 1,000,000 円 (住宅・非住宅240㎡以下)
\t\t\t// ※ 非住宅 240㎡超の 10,000,000 円上限は対象外 (商品設計時に別扱い想定)
\t\t\tvar SUBSIDY_MIN_AMOUNT = 50000;
\t\t\tvar SUBSIDY_MAX_PER_UNIT = 1000000;
\t\t\tvar subsidyRawSum = sumSubsidy;
\t\t\tvar subsidyEligible = subsidyRawSum >= SUBSIDY_MIN_AMOUNT;
\t\t\tvar subsidyAmt = 0;
\t\t\tvar subsidyNote = '';
\t\t\tif (subsidyEligible) {
\t\t\t\tif (subsidyRawSum > SUBSIDY_MAX_PER_UNIT) {
\t\t\t\t\tsubsidyAmt = SUBSIDY_MAX_PER_UNIT;
\t\t\t\t\tsubsidyNote = '※補助上限 ' + SUBSIDY_MAX_PER_UNIT.toLocaleString()
\t\t\t\t\t\t+ '円 超過分は控除対象外(補助金合計 ' + subsidyRawSum.toLocaleString() + '円)';
\t\t\t\t} else {
\t\t\t\t\tsubsidyAmt = subsidyRawSum;
\t\t\t\t}
\t\t\t} else if (subsidyRawSum > 0) {
\t\t\t\tsubsidyNote = '※補助金合計が 5 万円未満のため申請対象外です('
\t\t\t\t\t+ subsidyRawSum.toLocaleString() + '円)';
\t\t\t} else if (SERIES_GRADE_CAP_VAL === null) {
\t\t\t\t// LiteU 等の単板構成シリーズ: グレード判定で必ず null になる
\t\t\t\tsubsidyNote = '※本商品は補助金(先進的窓リノベ2026事業)対象外です';
\t\t\t} else if (PRODUCT_GRADE_CAP === null) {
\t\t\t\tsubsidyNote = '※本商品は補助金対象外として登録されています';
\t\t\t}
\t\t\tvar implementedInc = Math.max(0, goukeiInc - subsidyAmt);
\t\t\tvar taxAmt = Math.round((sumPriceExc + ctExc + optExc) * TAX_RATE);
\t\t\t\$('#mitsumori_message').text(subsidyNote);
\t\t\t\$('#mitsumori_btn').show();
\t\t\t\$('#mitsumori_goukei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_price').text(sumPriceInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_ct').text(ctInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_option').text(optInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_off').text((subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円');
\t\t\t\$('#maker_price').text('---円'); // 補助金窓では未使用
\t\t\t\$('#mitsumori_kei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_shoukei').text(implementedInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_tax').text(taxAmt.toLocaleString() + '円');
\t\t\t// 内訳を mitsumori_json に詰めて hidden input にセット (PDF / カート連携用)
\t\t\tvar window_types = rows.map(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\t// 幅 / 高さは数値入力 (mm) が来るので \"1750mm\" 形式で保存する.
\t\t\t\t// 古い radio 由来の \"200cm まで\" 形式が来た場合はそのまま保存して互換.
\t\t\t\tvar w_mm = parseMm(r.pw);
\t\t\t\tvar h_mm = parseMm(r.ph);
\t\t\t\tvar w_save = (w_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.pw))) ? (w_mm + 'mm') : r.pw;
\t\t\t\tvar h_save = (h_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.ph))) ? (h_mm + 'mm') : r.ph;
\t\t\t\treturn {
\t\t\t\t\tsubtype: r.subtype,
\t\t\t\t\tw: w_save,
\t\t\t\t\th: h_save,
\t\t\t\t\tglass: r.pm,
\t\t\t\t\tcolor: r.pc,
\t\t\t\t\tsetqty: r.setqty,
\t\t\t\t\tunit_price_inc: Math.round(r.unit_price_exc * (1 + TAX_RATE)),
\t\t\t\t\tline_total_inc: Math.round(r.unit_price_exc * r.setqty * (1 + TAX_RATE)),
\t\t\t\t\tsize_class: r.size_class,
\t\t\t\t\tglass_perf: r.glass_perf,
\t\t\t\t\tsubsidy_unit: r.subsidy,
\t\t\t\t\tsubsidy_total: r.subsidy * r.setqty
\t\t\t\t};
\t\t\t});
\t\t\tvar opCalc2 = collectOptions();
\t\t\tvar mitsumori_json = {
\t\t\t\t\"mitsumori_goukei\": goukeiInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_price\": sumPriceInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_ct\": ctInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_option\": optInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_off\": (subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円',
\t\t\t\t\"maker_price\": '---円',
\t\t\t\t\"product_id\": ";
// line 2154
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 2154, $this->source); })()), "id", [], "any", false, false, false, 2154), "html", null, true);
echo ",
\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\"housing_key\": getCurrentHousingKey(),
\t\t\t\t\"series_key\": DETECTED_SERIES,
\t\t\t\t\"series_grade_cap\": (SERIES_GRADE_CAP_VAL === undefined) ? null : SERIES_GRADE_CAP_VAL,
\t\t\t\t\"product_grade_cap\":(PRODUCT_GRADE_CAP === undefined) ? null : PRODUCT_GRADE_CAP,
\t\t\t\t\"window_types\": window_types,
\t\t\t\t\"subsidy_total\": subsidyAmt,
\t\t\t\t\"subsidy_raw\": subsidyRawSum,
\t\t\t\t\"subsidy_eligible\": subsidyEligible,
\t\t\t\t\"subsidy_note\": subsidyNote,
\t\t\t\t\"op_items\": opCalc2.items
\t\t\t};
\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\trenderWindowTypesModalRows(window_types, subsidyAmt);
\t\t}
\t\t/**
\t\t * sale_type=2 用: 見積モーダル明細テーブルを window_types で動的展開.
\t\t * - 既存の商品名行 (1 行目) は hide() し、各タイプ行を上に挿入
\t\t * - 基本工事費行はそのまま (#mitsumori_ct_01 / _02 が更新されている)
\t\t * - 補助金 (割引額) 行を末尾に追加
\t\t * - 既存の renderOptionDetailRows と共存できるよう class で区別
\t\t */
\t\tfunction renderWindowTypesModalRows(window_types, subsidyAmt) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t// 既存の動的行を全削除 (opt-row は既存実装、wt-row / wt-subsidy-row は今回追加)
\t\t\t\$tbody.find('tr.wt-row, tr.wt-subsidy-row').remove();
\t\t\tvar \$itemRow = \$tbody.find('tr').first();
\t\t\tvar fmt = new Intl.NumberFormat('ja-JP');
\t\t\tif (!window_types || window_types.length === 0) {
\t\t\t\t// 集計対象なし → 商品名行を表示に戻す
\t\t\t\t\$itemRow.show();
\t\t\t\treturn;
\t\t\t}
\t\t\twindow_types.forEach(function(wt, i) {
\t\t\t\tvar label = '窓タイプ' + (i + 1) + ':'
\t\t\t\t\t+ (wt.subtype || '') + ' / '
\t\t\t\t\t+ (wt.w || '') + '×' + (wt.h || '') + ' / '
\t\t\t\t\t+ (wt.glass || '') + ' / '
\t\t\t\t\t+ (wt.color || '');
\t\t\t\tvar \$tr = \$('<tr class=\"wt-row\"></tr>')
\t\t\t\t\t.append('<td>' + label + '</td>')
\t\t\t\t\t.append('<td>' + wt.setqty + '</td>')
\t\t\t\t\t.append('<td>セット</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.unit_price_inc) + '円</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.line_total_inc) + '円</td>');
\t\t\t\t\$itemRow.before(\$tr);
\t\t\t});
\t\t\t// 元の商品名行は複数タイプに置換されたので非表示
\t\t\t\$itemRow.hide();
\t\t\t// 補助金(割引額)行を末尾に追加
\t\t\tif (subsidyAmt > 0) {
\t\t\t\tvar \$subRow = \$('<tr class=\"wt-subsidy-row\"></tr>')
\t\t\t\t\t.append('<td>補助金(割引額)</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>');
\t\t\t\t\$tbody.append(\$subRow);
\t\t\t}
\t\t}
\t\t// 公開: onWindowTypeAxisChange (UI 骨格 task 1) からも呼ばれる
\t\twindow.recalcAll = recalcAllForSaleType2;
\t\t// 公開: ガラス選択肢が補助金対象か (窓タイプブロック生成時のバッジ判定に使う).
\t\t// subtype は P→S に落とすことはあっても null にはしないため、性能区分の
\t\t// 対象/対象外は subtype に依存しない。ここでは series/product 上限のみ適用し、
\t\t// finalizeGlassGrade が null でなければ「補助金対象ガラス」と判定する。
\t\twindow.glassYieldsSubsidy = function(glassName) {
\t\t\tif (!glassName) return false;
\t\t\treturn finalizeGlassGrade(detectGlassPerformance(glassName), '') !== null;
\t\t};
\t\tfunction mitsumori_simulation(type , value_id){
\t\t\t// sale_type=2 (補助金窓) は複数タイプ集計 UI に統合済み. 既存 mitsumori_simulation は使わない.
\t\t\tif (typeof SALE_TYPE_ID !== 'undefined' && SALE_TYPE_ID == 2) {
\t\t\t\t// type/value_id が op\\d+ (施工オプション) の場合はグローバル変数を先に更新
\t\t\t\tif (type && /^op\\d+\$/.test(type) && value_id) {
\t\t\t\t\tvar v = \$('#'+value_id).val();
\t\t\t\t\tif (type === 'op0') op0 = v;
\t\t\t\t\tif (type === 'op1') op1 = v;
\t\t\t\t\tif (type === 'op2') op2 = v;
\t\t\t\t\tif (type === 'op3') op3 = v;
\t\t\t\t\tif (type === 'op4') op4 = v;
\t\t\t\t\tif (type === 'op5') op5 = v;
\t\t\t\t\tif (type === 'op6') op6 = v;
\t\t\t\t\tif (type === 'op7') op7 = v;
\t\t\t\t\tif (type === 'op8') op8 = v;
\t\t\t\t\tif (type === 'op9') op9 = v;
\t\t\t\t\tif (type === 'op10') op10 = v;
\t\t\t\t}
\t\t\t\trecalcAllForSaleType2();
\t\t\t\treturn;
\t\t\t}
\t\t\t// 価格データ未登録 (pp 行 0 件) の商品は axis 入力に依存せず
\t\t\t// 「価格データ準備中」を表示して終了する.
\t\t\t// (例: scrape 未対象の新規商品 — um のウチリモ 7487/7488 等)
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text(\"価格データ準備中\");
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\treturn;
\t\t\t}
\t\t\tif(type == \"pw\"){
\t\t\t\tpw = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pd\"){
\t\t\t\tpd = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"ph\"){
\t\t\t\tph = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pm\"){
\t\t\t\tpm = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pc\"){
\t\t\t\tpc = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option1\"){
\t\t\t\toption1 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option2\"){
\t\t\t\toption2 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"op0\"){ op0 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op1\"){ op1 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op2\"){ op2 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op3\"){ op3 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op4\"){ op4 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op5\"){ op5 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op6\"){ op6 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op7\"){ op7 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op8\"){ op8 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op9\"){ op9 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op10\"){ op10 = \$('#'+value_id).val(); }
\t\t\t// op0 が「商品購入のみ」のとき、他のオプション (op1..op10) を disable 化.
\t\t\t// 価格計算側 (calcGoukei の purchaseOnly 分岐) は既にゼロ化しているが、
\t\t\t// UI で選択可能に見えるとユーザーが混乱するため radio を完全に無効化する.
\t\t\t(function applyPurchaseOnlyUI() {
\t\t\t\tvar isPurchaseOnly = (op0 === '商品購入のみ');
\t\t\t\tfor (var k = 1; k <= 10; k++) {
\t\t\t\t\tvar \$inputs = \$('input[name=\"op' + k + '\"]');
\t\t\t\t\tif (\$inputs.length === 0) continue;
\t\t\t\t\t\$inputs.prop('disabled', isPurchaseOnly);
\t\t\t\t\tvar \$group = \$inputs.first().closest('.form-group');
\t\t\t\t\t\$group.css({
\t\t\t\t\t\t'opacity': isPurchaseOnly ? '0.4' : '1',
\t\t\t\t\t\t'pointer-events': isPurchaseOnly ? 'none' : 'auto'
\t\t\t\t\t});
\t\t\t\t}
\t\t\t})();
\t\t\t// 全 type 共通: 該当 radio を checked にし、ボタンの is-selected を付け替え + ラベル更新.
\t\t\t// value_id が指定されていて、対応する DOM 要素が opt-btn 配下にあれば適用する.
\t\t\t// (icheck-danger 形式から opt-btn 形式に統一した際、option1/option2/pw/pd/ph/pm/pc 等の
\t\t\t// クリックで is-selected が更新されない不具合があったため、op\\d+ 限定の処理を一般化)
\t\t\tif (value_id) {
\t\t\t\tvar \$clicked = \$('#' + value_id);
\t\t\t\tif (\$clicked.length && \$clicked.closest('.opt-btn').length) {
\t\t\t\t\t\$clicked.prop('checked', true);
\t\t\t\t\tvar groupName = \$clicked.attr('name');
\t\t\t\t\t\$('input[name=\"' + groupName + '\"]').closest('.opt-btn').removeClass('is-selected');
\t\t\t\t\t\$clicked.closest('.opt-btn').addClass('is-selected');
\t\t\t\t\tvar \$group = \$clicked.closest('.form-group');
\t\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\tif (\$label.length) {
\t\t\t\t\t\tvar labelText = \$label.text().split(':')[0].trim();
\t\t\t\t\t\t\$label.html(labelText + ': <span>' + \$clicked.val() + '</span>');
\t\t\t\t\t}
\t\t\t\t\t// op_data の price=0 & 解体/撤去/設置場所 オプションの場合、ON 選択時に「現場調査後に正式お見積もり」文言を表示.
\t\t\t\t\t// (twig 側で is_removal_unknown ブロックを描画済み。display 切替のみ JS で行う)
\t\t\t\t\tif (/^op\\d+\$/.test(type)) {
\t\t\t\t\t\tvar opIdx = type.replace('op', '');
\t\t\t\t\t\tvar opEntry = op_data[parseInt(opIdx)];
\t\t\t\t\t\tif (opEntry) {
\t\t\t\t\t\t\tvar \$note = \$group.find('.opt-survey-note[data-op-idx=\"' + opIdx + '\"]');
\t\t\t\t\t\t\tif (\$note.length) {
\t\t\t\t\t\t\t\tvar isOn = (\$clicked.val() === opEntry.on);
\t\t\t\t\t\t\t\t\$note.toggle(isOn);
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
\t\t\t\t\t\t// wd (sale_type=5) のステップ / デッキフェンス用の注記もここで切替.
\t\t\t\t\t\t// ステップ → deck_step (op0 だが op_data 範囲外), 必要 選択時に表示.
\t\t\t\t\t\tvar radioName = \$clicked.attr('name');
\t\t\t\t\t\tif (radioName === 'deck_step') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-step').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t} else if (radioName === 'deck_fence') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-fence').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t\t// 必須項目チェックは sale_type 1 系(カーポート/物置/フェンスなど価格マトリクス必要)に限定
\t\t\tvar requireMatrix = (SALE_TYPE_ID == 1 || SALE_TYPE_ID == 2 || SALE_TYPE_ID == 3 || SALE_TYPE_ID == 4 || SALE_TYPE_ID == 5 || SALE_TYPE_ID == 6 || SALE_TYPE_ID == 7 || SALE_TYPE_ID == 9);
\t\t\t// sale_type=3 (物置・ゴミステーション・照明 等) では「素材」を選択肢として扱わない.
\t\t\t// - mo/gs/sy は m が \"指定なし\" など名目的にしか入っていない
\t\t\t// - sl は m が空のままで matrix に行が来る
\t\t\t// そのため pm の必須チェックを sale_type=3 でスキップする。
\t\t\tvar pmRequired = (SALE_TYPE_ID != 3);
\t\t\tif (requireMatrix) {
\t\t\t\tif(pmRequired && pm == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"素材を選択してください\");
\t\t\t\t}
\t\t\t\tif(ph == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"高さを選択してください\");
\t\t\t\t}
\t\t\t\tif(pd == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"奥行きを選択してください\");
\t\t\t\t}
\t\t\t\tif(pw == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"幅を選択してください\");
\t\t\t\t}
\t\t\t\tif(pc == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"カラーを選択してください\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t}
\t\t\t}
\t\t\tif(pw != \"\" && pd != \"\" && ph != \"\" && (!pmRequired || pm != \"\") && pc != \"\"){
\t\t\t\t\$('#mitsumori_btn').show();
\t\t\t\t// 入力コンテキスト(sale_type 別パラメータ)
\t\t\t\tvar ctx = {
\t\t\t\t\tset_count: parseInt(\$('#set_count').val()) || 1,
\t\t\t\t\tdaisu: parseInt(\$('#daisu').val()) || 1,
\t\t\t\t\tmaisu: parseInt(\$('#maisu').val()) || 3,
\t\t\t\t\tsuuryou: parseInt(\$('#suuryou').val()) || 1,
\t\t\t\t\tarea: (function(){
\t\t\t\t\t\t// tf(人工芝): 施工サイズ 縦(m)×横(m) から面積を算出し #area に反映.
\t\t\t\t\t\tvar L = parseFloat(\$('#tf_len').val()) || 0;
\t\t\t\t\t\tvar W = parseFloat(\$('#tf_wid').val()) || 0;
\t\t\t\t\t\tif (L > 0 && W > 0) { var a = L * W; \$('#area').val(a); return a; }
\t\t\t\t\t\treturn parseFloat(\$('#area').val()) || 0;
\t\t\t\t\t})(),
\t\t\t\t\ttf_len: parseFloat(\$('#tf_len').val()) || 0,
\t\t\t\t\ttf_wid: parseFloat(\$('#tf_wid').val()) || 0,
\t\t\t\t\ttf_qty: parseInt(\$('#tf_qty').val()) || 1,
\t\t\t\t\tquantityOnly: parseInt(\$('#quantity_only').val())|| 1,
\t\t\t\t\tmado_w: \$('#mado_w').val() || '',
\t\t\t\t\tmado_h: \$('#mado_h').val() || '',
\t\t\t\t\tmado_type: \$('input[name=mado_type]:checked').val() || '',
\t\t\t\t\tglass_type: \$('input[name=glass_type]:checked').val() || '',
\t\t\t\t\tdeck_step: \$('input[name=deck_step]:checked').val() || '',
\t\t\t\t\tdeck_fence: \$('input[name=deck_fence]:checked').val() || '',
\t\t\t\t};
\t\t\t\t// 施工オプション集計(残土処理を含む)
\t\t\t\tvar opCalc = collectOptions();
\t\t\t\tvar pp_matched = false;
\t\t\t\t// 各軸の汎用 axisMatch:
\t\t\t\t// user 選択 == matrix 値 / user \"指定なし\" / matrix 値が空
\t\t\t\tvar axisMatch = function(input, value){
\t\t\t\t return input == value || input == \"指定なし\" || value === \"\" || value == null;
\t\t\t\t};
\t\t\t\t// 色専用マッチャー: scraper のデータ形式に合わせて拡張する
\t\t\t\t// 1. 完全一致 / \"指定なし\" / 値が空 → 真 (axisMatch と同じ)
\t\t\t\t// 2. matrix 値が \"色1/色2/色3\" の形 (同価格グループ) → split して user 選択が含まれれば真
\t\t\t\t// scraper のロジック (scraper_price.py L765-779):
\t\t\t\t// 全色同価格 → c=\"\"、価格違いグループあり → 各 group を \"/\" 結合した色名で 1 行
\t\t\t\tvar colorMatch = function(input, value){
\t\t\t\t if (axisMatch(input, value)) return true;
\t\t\t\t if (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t var parts = value.split('/');
\t\t\t\t for (var idx = 0; idx < parts.length; idx++) {
\t\t\t\t if (parts[idx].trim() === input) return true;
\t\t\t\t }
\t\t\t\t }
\t\t\t\t return false;
\t\t\t\t};
\t\t\t\t// 他軸 (w/d/h/m + option1/option2) でマッチする pp 行を抽出.
\t\t\t\t// option1/option2 は um の subtype 等で使われる. axisMatch は free_area 側が
\t\t\t\t// 空のとき真を返すので、um 以外のカテゴリ (option 軸を使わない) でも影響なし.
\t\t\t\tvar candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m)
\t\t\t\t && axisMatch(option1, el.option1) && axisMatch(option2, el.option2);
\t\t\t\t});
\t\t\t\t// フォールバック: 全軸一致が 0 件のときに限り option1/option2 を無視して再マッチ。
\t\t\t\t// 玄関ドア等で option1(なし/ランマ付き)・option2(◯◯タイプ) が pm(開き方) から
\t\t\t\t// 導出可能な冗長軸で、未選択だと全軸 AND 一致を満たせず価格が出ない事象の救済。
\t\t\t\t// pm/幅/奥行/高さ は従来どおり一致を要求するため通常商品の価格選択に影響しない。
\t\t\t\tif (candidates.length === 0) {
\t\t\t\t candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m);
\t\t\t\t });
\t\t\t\t}
\t\t\t\tvar picked = null;
\t\t\t\t// 優先 1: 色も含めて完全一致 (\"色1/色2\" 形式の split match を含む)
\t\t\t\tfor (var ii = 0; ii < candidates.length; ii++) {
\t\t\t\t if (colorMatch(pc, candidates[ii].c)) { picked = candidates[ii]; break; }
\t\t\t\t}
\t\t\t\t// 優先 2: 完全一致なし & user の pc が候補のどの c 値にも該当しない (= 命名違い等)
\t\t\t\t// かつ候補全行で price が一致する場合は、色軸を実質無視して先頭行を採用.
\t\t\t\t// 例 id=3353: pp.c は \"ステンカラー+...\" 6種だが price は全て同じなので
\t\t\t\t// SM(スミ) を選んでも安全に最初の行の価格を返せる.
\t\t\t\tif (!picked && candidates.length > 0) {
\t\t\t\t var ppCsInCand = candidates.map(function(r){ return r.c || ''; });
\t\t\t\t var pcAbsent = (pc !== '' && pc !== '指定なし' && ppCsInCand.indexOf(pc) === -1
\t\t\t\t && ppCsInCand.every(function(v){ return v.indexOf('/') === -1 || v.split('/').map(function(s){return s.trim();}).indexOf(pc) === -1; }));
\t\t\t\t if (pcAbsent) {
\t\t\t\t var uniqPrices = new Set();
\t\t\t\t candidates.forEach(function(r){ uniqPrices.add(String(r.price)); });
\t\t\t\t if (uniqPrices.size === 1) {
\t\t\t\t // 全候補同価格 → 色軸を wildcard 扱いで OK
\t\t\t\t picked = candidates[0];
\t\t\t\t }
\t\t\t\t // 価格が異なる場合は意図的に picked=null のまま「対応しておりません」.
\t\t\t\t }
\t\t\t\t}
\t\t\t\tpp.forEach((el) => {
\t\t\t\t if (el === picked) {
\t\t\t\t\tpp_matched = true;
\t\t\t\t\t// tg block-keyed オプション差額を集計 (tg 以外は total=0)
\t\t\t\t\tvar oiCalc = collectOptionItems(el.w || '', el.d || '');
\t\t\t\t\t// tg ブロックに合わせてラジオを再描画 (tg 以外は no-op)
\t\t\t\t\trenderOptionItemRadios(el.w || '', el.d || '');
\t\t\t\t\t// fe ブロックの種類×段数 サブ radio (fe 以外/未設定は no-op)
\t\t\t\t\trenderFeBlockRadios();
\t\t\t\t\t// fe ご希望のフェンス設置方法 — 「既存ブロックに穴空け」 entry の連動表示
\t\t\t\t\tupdateFeOpConditionalVisibility();
\t\t\t\t\tvar calc = calcGoukei(el, opCalc.total, ctx);
\t\t\t\t\tvar goukei = calc.goukei;
\t\t\t\t\tvar price = calc.price;
\t\t\t\t\tvar ct = calc.ct;
\t\t\t\t\tvar optionSum = calc.opt;
\t\t\t\t\t// tf(人工芝): 必要枚数入力へ算出結果を反映(施工サイズ入力時は上書き、
\t\t\t\t\t// 直接指定時は同値なので実質変化なし。要素が無い sale_type では no-op)
\t\t\t\t\tvar \$tfQty = \$('#tf_qty');
\t\t\t\t\tif (\$tfQty.length) \$tfQty.val(calc.qty || 1);
\t\t\t\t\t// オプション差額は税抜 → 税込に変換して合計に加算
\t\t\t\t\tvar oiIncTax = toIncTax(oiCalc.total);
\t\t\t\t\tgoukei += oiIncTax;
\t\t\t\t\tprice += oiIncTax; // 差額は本体価格扱いとして mitsumori_price にも加算
\t\t\t\t\t// maker_price も scraper が税抜で保存しているため税込に変換
\t\t\t\tvar makerPrice = toIncTax(parseInt(el.maker_price) || 0);
\t\t\t\t\t\$('#mitsumori_message').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_off').text(formatter.format(price - makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_price').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#maker_price').text(formatter.format(makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_option').text(formatter.format(optionSum) + \"円\");
\t\t\t\t\t\$('#mitsumori_kei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_01').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_02').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_01').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_02').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei_02').text(formatter.format(goukei) + \"円\");
\t\t\t\t\tvar shoukei = goukei / 1.1;
\t\t\t\t\tvar tax = parseInt(goukei - shoukei);
\t\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + \"円\");
\t\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + \"円\");
\t\t\t\t\t// PDF 明細用:オプション内訳テーブルを差し込む (施工オプション + tg block オプション)
\t\t\t\t\trenderOptionDetailRows(opCalc.items.concat(oiCalc.items.map(function(it){
\t\t\t\t\t\treturn { name: it.name, value: it.label, price: it.diff };
\t\t\t\t\t})));
\t\t\t\t }
\t\t\t\t});
\t\t\t\tif (!pp_matched) {
\t\t\t\t\t\$('#mitsumori_message').text(\"この組み合わせは対応しておりません\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\t}
\t\t\t\t// mitsumori_json: バック側に送信する見積データ
\t\t\t\tvar mitsumori_json = { \"mitsumori_goukei\": \$('#mitsumori_goukei').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_goukei_02\": \$('#mitsumori_goukei_02').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_price\": \$('#mitsumori_price').text(),
\t\t\t\t\t\t\t\t\t\t\"maker_price\": \$('#maker_price').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_off\": \$('#mitsumori_off').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_ct\": \$('#mitsumori_ct').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_option\": \$('#mitsumori_option').text(),
\t\t\t\t\t\t\t\t\t\t\"product_id\": ";
// line 2571
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 2571, $this->source); })()), "id", [], "any", false, false, false, 2571), "html", null, true);
echo ",
\t\t\t\t\t\t\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\t\t\t\t\t\t\"pw\": pw,
\t\t\t\t\t\t\t\t\t\t\"pd\": pd,
\t\t\t\t\t\t\t\t\t\t\"ph\": ph,
\t\t\t\t\t\t\t\t\t\t\"pm\": pm,
\t\t\t\t\t\t\t\t\t\t\"pc\": pc,
\t\t\t\t\t\t\t\t\t\t\"op\": [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10],
\t\t\t\t\t\t\t\t\t\t\"op_items\": opCalc.items,
\t\t\t\t\t\t\t\t\t\t\"mado_w\": ctx.mado_w,
\t\t\t\t\t\t\t\t\t\t\"mado_h\": ctx.mado_h,
\t\t\t\t\t\t\t\t\t\t\"mado_type\": ctx.mado_type,
\t\t\t\t\t\t\t\t\t\t\"glass_type\": ctx.glass_type,
\t\t\t\t\t\t\t\t\t\t\"set_count\": ctx.set_count,
\t\t\t\t\t\t\t\t\t\t\"daisu\": ctx.daisu,
\t\t\t\t\t\t\t\t\t\t\"maisu\": ctx.maisu,
\t\t\t\t\t\t\t\t\t\t\"suuryou\": ctx.suuryou,
\t\t\t\t\t\t\t\t\t\t\"area\": ctx.area,
\t\t\t\t\t\t\t\t\t\t\"tf_len\": ctx.tf_len,
\t\t\t\t\t\t\t\t\t\t\"tf_wid\": ctx.tf_wid,
\t\t\t\t\t\t\t\t\t\t\"tf_qty\": \$('#tf_qty').val(),
\t\t\t\t\t\t\t\t\t\t\"deck_step\": ctx.deck_step,
\t\t\t\t\t\t\t\t\t\t\"deck_fence\": ctx.deck_fence };
\t\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\t}
\t\t}
\t\t// PDF/モーダル明細の動的差し替え(基本工事費の次にオプション行を追加)
\t\tfunction renderOptionDetailRows(items) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t\$tbody.find('tr.opt-row').remove();
\t\t\tvar anchorRow = \$tbody.find('tr').filter(function(){
\t\t\t\treturn \$(this).find('td:first').text().indexOf('残土') !== -1
\t\t\t\t\t|| \$(this).find('td:first').text().indexOf('基本工事費') !== -1;
\t\t\t}).last();
\t\t\titems.forEach(function(it){
\t\t\t\tif (!it.name || !it.value) return;
\t\t\t\tvar priceTxt = it.price > 0
\t\t\t\t\t? formatter.format(it.price) + '円'
\t\t\t\t\t: '0円';
\t\t\t\tvar \$tr = \$('<tr class=\"opt-row\"></tr>')
\t\t\t\t\t.append('<td>' + it.name + ':' + it.value + '</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>' + priceTxt + '</td>')
\t\t\t\t\t.append('<td>' + (it.price > 0 ? formatter.format(it.price) + '円' : '') + '</td>');
\t\t\t\tif (anchorRow.length) {
\t\t\t\t\tanchorRow.after(\$tr);
\t\t\t\t\tanchorRow = \$tr;
\t\t\t\t} else {
\t\t\t\t\t\$tbody.append(\$tr);
\t\t\t\t}
\t\t\t});
\t\t}
\t\t// 見積書モーダルを開く直前に、右側「現在のお見積り額」パネルの表示値を
\t\t// モーダル内の対応 ID にコピーして金額の食い違いを防ぐ。
\t\t// pw/pd/ph/pm が未選択で mitsumori_simulation の full update に到達しない場合でも、
\t\t// パネル側の値(HTML 静的初期値 or 直近の simulation 結果)が modal にも反映される。
\t\tfunction syncMitsumoriModalFromPanel() {
\t\t\tvar goukeiText = \$('#mitsumori_goukei').text();
\t\t\tvar priceText = \$('#mitsumori_price').text();
\t\t\tvar ctText = \$('#mitsumori_ct').text();
\t\t\t\$('#mitsumori_kei').text(goukeiText);
\t\t\t\$('#mitsumori_price_01').text(priceText);
\t\t\t\$('#mitsumori_price_02').text(priceText);
\t\t\t\$('#mitsumori_ct_01').text(ctText);
\t\t\t\$('#mitsumori_ct_02').text(ctText);
\t\t\t\$('#mitsumori_goukei_02').text(goukeiText);
\t\t\t// 小計 / 消費税 は税込 goukei から逆算
\t\t\tvar num = parseInt(goukeiText.replace(/[^\\d-]/g, ''), 10);
\t\t\tif (!isNaN(num) && num > 0) {
\t\t\t\tvar shoukei = Math.round(num / 1.1);
\t\t\t\tvar tax = num - shoukei;
\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(shoukei) + '円');
\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + '円');
\t\t\t} else {
\t\t\t\t\$('#mitsumori_shoukei').text('---円');
\t\t\t\t\$('#mitsumori_tax').text('---円');
\t\t\t}
\t\t}
\t\t\$(document).on('show.bs.modal', '#modal-mitsumori', function () {
\t\t\tsyncMitsumoriModalFromPanel();
\t\t});
";
// line 2665
echo " ";
if (((isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2665, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2665, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2665, $this->source); })())) == "")))) {
// line 2666
echo " pc = \"指定なし\";
";
// line 2667
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2667, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pc_val"]) {
if ($context["pc_val"]) {
echo " pc = \"";
echo twig_escape_filter($this->env, $context["pc_val"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pc_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2668
echo " ";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2668, $this->source); })()) && (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2668, $this->source); })())) == 1))) {
// line 2669
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2669, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2669))) {
echo " pc = \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2669), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2670
echo " ";
}
// line 2671
echo " ";
} elseif (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2671, $this->source); })()) && (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2671, $this->source); })())) == 1))) {
// line 2672
echo " pc = \"指定なし\";
\t\t\t";
// line 2673
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2673, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2673))) {
echo " pc = \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2673), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2674
echo "\t\t";
}
// line 2675
echo "
";
// line 2676
if (((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2676, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2676, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2676, $this->source); })())) == "")))) {
// line 2677
echo " pw = \"指定なし\";
\t\t\t";
// line 2678
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2678, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw"]) {
if ($context["pw"]) {
echo " pw = \"";
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2679
echo "\t\t";
}
// line 2680
echo "
";
// line 2681
if (((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2681, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2681, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2681, $this->source); })())) == "")))) {
// line 2682
echo " pd = \"指定なし\";
\t\t\t";
// line 2683
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2683, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pd"]) {
if ($context["pd"]) {
echo " pd = \"";
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pd'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2684
echo "\t\t";
}
// line 2685
echo "
";
// line 2686
if (((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2686, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2686, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2686, $this->source); })())) == "")))) {
// line 2687
echo " ph = \"指定なし\";
\t\t\t";
// line 2688
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2688, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["ph"]) {
if ($context["ph"]) {
echo " ph = \"";
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ph'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2689
echo "\t\t";
}
// line 2690
echo "
";
// line 2691
if (((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2691, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2691, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2691, $this->source); })())) == "")))) {
// line 2692
echo " pm = \"指定なし\";
\t\t\t";
// line 2693
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2693, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm"]) {
if ($context["pm"]) {
echo " pm = \"";
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2694
echo "\t\t";
}
// line 2695
echo "
";
// line 2697
echo " ";
if (((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2697, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2697, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2697, $this->source); })())) == "")))) {
// line 2698
echo " option1 = \"\";
\t\t\t";
// line 2699
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2699, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt1"]) {
if ($context["opt1"]) {
echo " option1 = \"";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt1"], "js"), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt1'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2700
echo "\t\t";
}
// line 2701
echo "
";
// line 2702
if (((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2702, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2702, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2702, $this->source); })())) == "")))) {
// line 2703
echo " option2 = \"\";
\t\t\t";
// line 2704
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2704, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt2"]) {
if ($context["opt2"]) {
echo " option2 = \"";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt2"], "js"), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt2'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2705
echo "\t\t";
}
// line 2706
echo "
\t\t// カラー radio が複数あるとき初期チェックが無いと「カラーを選択してください」固定になるので、
\t\t// 何もチェックされていなければ「最初の radio」を選択する。
\t\t// sale_type≠3 は name=\"color\", sale_type=3 は name=\"color3\".
\t\t//
\t\t// 注意:
\t\t// ・search_word(= radio の値)と pp.c(= matrix の色軸)は別の命名体系のケースがある
\t\t// (例 id=3353: radio=\"SM(スミ)\" / pp.c=\"ステンカラー+セピアブラウン\")
\t\t// ・pp.c に合わせて radio を選ぼうとしても文字列一致しないので無意味。
\t\t// ・単純に「先頭の radio」を選ぶ実装に戻し、マッチング側で命名体系違いを吸収する
\t\t// (pc が pp.c のどの値にもマッチしないときは色軸を wildcard 扱いにする)。
\t\t// ・.rp-section-label のテキストも忘れずに同期する(古い session 値が残ると
\t\t// \"ステンカラー+セピアブラウン\" のような表示と実際の radio が食い違う)。
\t\t(function autoSelectFirstColor(){
\t\t\tvar groups = ['color', 'color3'];
\t\t\tfor (var gi = 0; gi < groups.length; gi++) {
\t\t\t\tvar name = groups[gi];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\tpc = target.value;
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// 「カラー: <name>」表示の同期(古い mitsumori_json.pc が残らないように)
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// option1 / option2 / pw / pd / ph / pm (matrix 軸の radio 群) も同様に
\t\t// 「どれもチェックされていなければ先頭を選ぶ」を適用する.
\t\t// sale_type=2 の窓タイプ等で「初期表示時に一番初めの選択肢が選択されていない」事象を解消.
\t\t(function autoSelectFirstMatrixAxis(){
\t\t\tvar axes = [
\t\t\t\t{ name: 'pw', jsVar: 'pw' },
\t\t\t\t{ name: 'pd', jsVar: 'pd' },
\t\t\t\t{ name: 'ph', jsVar: 'ph' },
\t\t\t\t{ name: 'pm', jsVar: 'pm' },
\t\t\t\t{ name: 'glass_type', jsVar: 'pm' },
\t\t\t\t{ name: 'option1', jsVar: 'option1' },
\t\t\t\t{ name: 'option2', jsVar: 'option2' }
\t\t\t];
\t\t\tfor (var ai = 0; ai < axes.length; ai++) {
\t\t\t\tvar ax = axes[ai];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + ax.name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\t// グローバル JS 変数も埋める
\t\t\t\tif (ax.jsVar === 'pw') pw = target.value;
\t\t\t\telse if (ax.jsVar === 'pd') pd = target.value;
\t\t\t\telse if (ax.jsVar === 'ph') ph = target.value;
\t\t\t\telse if (ax.jsVar === 'pm') pm = target.value;
\t\t\t\telse if (ax.jsVar === 'option1') option1 = target.value;
\t\t\t\telse if (ax.jsVar === 'option2') option2 = target.value;
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// 取付/設置工事トグル(off 値が「商品購入のみ」のオプション)は、新規アクセス時に
\t\t// どちらの radio も未チェックのため初期価格が「商品購入のみ」= 基本工事費抜きになる。
\t\t// 顧客要望(#10)に合わせ、未選択時は「工事も希望する」(on 側) を初期選択し、
\t\t// 初期表示を基本工事費込みの最安値に統一する(色・寸法軸の先頭自動選択と同型)。
\t\t// ・判定キーは calcGoukei / applyPurchaseOnlyUI と同じ定数「商品購入のみ」。
\t\t// ・別用途で op{n} を流用する商品(ウッドデッキ deck_step 等)は radio 値に
\t\t// 「商品購入のみ」を含まないため対象外(既存挙動を壊さない)。
\t\t// ・mitsumori_json 復元やユーザー操作で既に選択済みなら尊重する。
\t\t(function autoSelectFirstInstall(){
\t\t\tfor (var i = 0; i <= 10; i++) {
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"op' + i + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\t// このグループが「商品購入のみ」を off に持つ工事トグルか判定し、
\t\t\t\t// 「商品購入のみ」でない側 (= 工事希望 on) を取得する。
\t\t\t\tvar hasPurchaseOnly = false;
\t\t\t\tvar onNode = null;
\t\t\t\tfor (var j = 0; j < nodes.length; j++) {
\t\t\t\t\tif (nodes[j].value === '商品購入のみ') hasPurchaseOnly = true;
\t\t\t\t\telse if (!onNode) onNode = nodes[j];
\t\t\t\t}
\t\t\t\tif (!hasPurchaseOnly || !onNode) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var k = 0; k < nodes.length; k++) {
\t\t\t\t\tif (nodes[k].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tonNode.checked = true;
\t\t\t\t// グローバル op 変数を on 値で埋める(calcGoukei の purchaseOnly 判定が参照)
\t\t\t\tswitch (i) {
\t\t\t\t\tcase 0: op0 = onNode.value; break;
\t\t\t\t\tcase 1: op1 = onNode.value; break;
\t\t\t\t\tcase 2: op2 = onNode.value; break;
\t\t\t\t\tcase 3: op3 = onNode.value; break;
\t\t\t\t\tcase 4: op4 = onNode.value; break;
\t\t\t\t\tcase 5: op5 = onNode.value; break;
\t\t\t\t\tcase 6: op6 = onNode.value; break;
\t\t\t\t\tcase 7: op7 = onNode.value; break;
\t\t\t\t\tcase 8: op8 = onNode.value; break;
\t\t\t\t\tcase 9: op9 = onNode.value; break;
\t\t\t\t\tcase 10: op10 = onNode.value; break;
\t\t\t\t}
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = onNode.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var s = 0; s < sib.length; s++) sib[s].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// rp-section-label 表示同期 + 現地調査文言(is_removal_unknown / is_tf_kouji)を on 表示に
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || onNode.closest('.form-group');
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + onNode.value + '</span>';
\t\t\t\t\t}
\t\t\t\t\tvar note = grp.querySelector('.opt-survey-note[data-op-idx=\"' + i + '\"]');
\t\t\t\t\tif (note) note.style.display = '';
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// ページ読み込み時: 見積金額が「合計」になっているため、カート数量は基本1
\t\t// sale_type=9(商品のみ購入)だけ通常 EC として数量を引き継ぐ
\t\t(function initQuantityByType(){
\t\t\tvar saleType = ";
// line 2872
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 2872, $this->source); })()), "SaleType", [], "any", false, false, false, 2872), "id", [], "any", false, false, false, 2872), "html", null, true);
echo ";
\t\t\tif (saleType == 9 && \$('#quantity_only').length) {
\t\t\t\t\$('#quantity').val(parseInt(\$('#quantity_only').val()) || 1);
\t\t\t} else {
\t\t\t\t\$('#quantity').val(1);
\t\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\t}
\t\t})();
\t\t// type → ラベルのプレフィックス文字列
\t\t// option1/option2 のラベルは category 依存 (rd: ランマ/タイプ, sh: サイズプリセット/駆動方式 等).
\t\t// PHP から渡された option1_label / option2_label を埋め込み、JS 側でラベル更新に使う.
\t\tvar optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'素材',
\t\t option1: '";
// line 2885
echo twig_escape_filter($this->env, twig_escape_filter($this->env, ((array_key_exists("option1_label", $context)) ? (_twig_default_filter((isset($context["option1_label"]) || array_key_exists("option1_label", $context) ? $context["option1_label"] : (function () { throw new RuntimeError('Variable "option1_label" does not exist.', 2885, $this->source); })()), "オプション1")) : ("オプション1")), "js"), "html", null, true);
echo "',
\t\t option2: '";
// line 2886
echo twig_escape_filter($this->env, twig_escape_filter($this->env, ((array_key_exists("option2_label", $context)) ? (_twig_default_filter((isset($context["option2_label"]) || array_key_exists("option2_label", $context) ? $context["option2_label"] : (function () { throw new RuntimeError('Variable "option2_label" does not exist.', 2886, $this->source); })()), "オプション2")) : ("オプション2")), "js"), "html", null, true);
echo "'};
\t\t// type → input[name]
\t\tvar optNameMap = {pc:'color', pw:'pw', pd:'pd', ph:'ph', pm:'pm',
\t\t option1: 'option1', option2: 'option2'};
\t\t// opt-btn用: 値を直接受け取るラッパー
\t\tfunction mitsumori_simulation_val(type, value) {
\t\t\tif (type === 'pc') pc = value;
\t\t\tif (type === 'pw') pw = value;
\t\t\tif (type === 'pd') pd = value;
\t\t\tif (type === 'ph') ph = value;
\t\t\tif (type === 'pm') pm = value;
\t\t\tif (type === 'option1') option1 = value;
\t\t\tif (type === 'option2') option2 = value;
\t\t\t// is-selected クラスを同グループ内で付け替え
\t\t\tvar inputName = optNameMap[type];
\t\t\tif (inputName) {
\t\t\t\tvar \$btns = \$('input[name=\"' + inputName + '\"]').closest('.opt-btn');
\t\t\t\t\$btns.removeClass('is-selected');
\t\t\t\t\$btns.filter(function(){
\t\t\t\t\treturn \$(this).find('input').val() === value;
\t\t\t\t}).addClass('is-selected');
\t\t\t}
\t\t\t// ラベル行の選択値テキストを更新(例: 「カラー: ブラック」)
\t\t\tvar labelPrefix = optLabelMap[type];
\t\t\tif (labelPrefix) {
\t\t\t\t// 対象のrp-section-labelを特定(input[name]を含む親を遡る)
\t\t\t\tvar \$group = \$('input[name=\"' + inputName + '\"]').first().closest('.form-group');
\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\$label.html(labelPrefix + ': <span>' + value + '</span>');
\t\t\t}
\t\t\t// simulation本体を呼ぶ(value_idは空でOK、グローバル変数を使う)
\t\t\tmitsumori_simulation('', '');
\t\t}
\t\tmitsumori_simulation(\"\",\"\");
\t\t// ボタン群: 親幅を超える、または3行以上になる場合は is-scroll を付与し
\t\t// 縦3段グリッド+横スクロール表示にする(顧客要望「3列くらいで横スクロール」)
\t\tfunction applyBtnGroupScroll() {
\t\t\t\$('.rp-btn-group, .opt-btn-group').each(function() {
\t\t\t\tvar \$group = \$(this);
\t\t\t\t\$group.removeClass('is-scroll');
\t\t\t\tvar \$items = \$group.children();
\t\t\t\tif (\$items.length === 0) return;
\t\t\t\tvar parentWidth = \$group.parent().width() || \$group.width();
\t\t\t\tvar totalWidth = 0;
\t\t\t\tvar gap = parseInt(\$group.css('gap'), 10) || 8;
\t\t\t\t\$items.each(function() {
\t\t\t\t\ttotalWidth += this.offsetWidth + gap;
\t\t\t\t});
\t\t\t\t// 単一ボタンが親幅を超える、もしくは合計幅が親幅を超える → 横スクロール化
\t\t\t\tvar anyTooWide = false;
\t\t\t\t\$items.each(function() {
\t\t\t\t\tif (this.offsetWidth > parentWidth) { anyTooWide = true; return false; }
\t\t\t\t});
\t\t\t\t// 折り返し時の行数も計測
\t\t\t\tvar tops = {};
\t\t\t\t\$items.each(function() { tops[this.offsetTop] = true; });
\t\t\t\tvar rowCount = Object.keys(tops).length;
\t\t\t\tif (anyTooWide || totalWidth > parentWidth * 2 || rowCount >= 3) {
\t\t\t\t\t\$group.addClass('is-scroll');
\t\t\t\t}
\t\t\t});
\t\t}
\t\tapplyBtnGroupScroll();
\t\t\$(window).on('resize', function() {
\t\t\tclearTimeout(window._btnScrollTimer);
\t\t\twindow._btnScrollTimer = setTimeout(applyBtnGroupScroll, 150);
\t\t});
\t\t// onload: 見積金額が確定している場合は「工事費込み価格」表示を一致させる
\t\t(function syncPrice02Display() {
\t\t\tvar goukeiEl = document.getElementById('mitsumori_goukei');
\t\t\tvar displayEl = document.getElementById('price02-display');
\t\t\tif (!goukeiEl || !displayEl) return;
\t\t\tvar goukeiText = goukeiEl.textContent.trim();
\t\t\t// ---円(未確定)の場合は書き換えない
\t\t\tif (goukeiText && goukeiText !== '---円') {
\t\t\t\tdisplayEl.textContent = goukeiText;
\t\t\t}
\t\t\t// 以降の変更にも追従: mitsumori_goukei を監視
\t\t\tnew MutationObserver(function() {
\t\t\t\tvar text = goukeiEl.textContent.trim();
\t\t\t\tif (text && text !== '---円') {
\t\t\t\t\tdisplayEl.textContent = text;
\t\t\t\t}
\t\t\t}).observe(goukeiEl, { childList: true, subtree: true, characterData: true });
\t\t})();
\t\tfunction contact_form(product_id){
\t\t\t\$('#form1').attr('action', '";
// line 2983
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact", ["product" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 2983, $this->source); })()), "id", [], "any", false, false, false, 2983)]), "html", null, true);
echo "');
\t\t\t\$('#form1').submit();
\t\t}
\t\t// maisu / madoset は下部の新しい関数定義を使用
\t\tfunction heibei(bei){
\t\t\t\$('#heibei').val(parseInt(\$('#heibei').val()) + bei);
\t\t\tif(parseInt(\$('#heibei').val()) < 1){ \$('#heibei').val(1); }
\t\t\tif(parseInt(\$('#heibei').val()) > 100){ \$('#heibei').val(100); }
\t\t\t// goukei に既に枚数を含むため、カート数量は1で固定
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('heibei','heibei');
\t\t}
\t\tfunction daisu(dai){
\t\t\t\$('#daisu').val(parseInt(\$('#daisu').val()) + dai);
\t\t\tif(parseInt(\$('#daisu').val()) < 1){ \$('#daisu').val(1); }
\t\t\tif(parseInt(\$('#daisu').val()) > 10){ \$('#daisu').val(10); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('daisu','daisu');
\t\t}
\t\t// sale_type=7(数量買い・基本工事費固定)用:個数入力
\t\tfunction suuryou(n){
\t\t\t\$('#suuryou').val(parseInt(\$('#suuryou').val()) + n);
\t\t\tif(parseInt(\$('#suuryou').val()) < 1){ \$('#suuryou').val(1); }
\t\t\tif(parseInt(\$('#suuryou').val()) > 100){ \$('#suuryou').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('suuryou','suuryou');
\t\t}
\t\tfunction maisu(mai){
\t\t\t\$('#maisu').val(parseInt(\$('#maisu').val()) + mai);
\t\t\t// sale_type=4 (フェンス) は3枚未満不可、6 (芝生) は1枚から
\t\t\tvar minMai = (SALE_TYPE_ID == 4) ? 3 : 1;
\t\t\tif(parseInt(\$('#maisu').val()) < minMai){ \$('#maisu').val(minMai); }
\t\t\tif(parseInt(\$('#maisu').val()) > 100){ \$('#maisu').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('maisu','maisu');
\t\t}
\t\t// タイプ2: セット数プルダウン連動
\t\tfunction madosetSelect(val){
\t\t\tvar v = parseInt(val);
\t\t\tif(v < 1) v = 1;
\t\t\tif(v > 20) v = 20;
\t\t\t\$('#set_count').val(v);
\t\t\t\$('#quantity').val(1);
\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\tmitsumori_simulation('set','set_count');
\t\t}
\t\t// タイプ2: ±ボタン版(後方互換)
\t\tfunction madoset(mai){
\t\t\tvar current = parseInt(\$('#set_count').val()) || 1;
\t\t\tvar next = current + mai;
\t\t\tif(next < 1) next = 1;
\t\t\tif(next > 20) next = 20;
\t\t\t\$('#set_count').val(next);
\t\t\tmadosetSelect(next);
\t\t}
\t\t// タイプ5: ステップ・フェンス選択値を mitsumori_json に保存するためのグローバル変数
\t\tvar deck_step = \"";
// line 3044
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3044, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 3044))) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 3044)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", false, false, false, 3044), "不要")) : ("不要")), "html", null, true);
} else {
echo "不要";
}
echo "\";
\t\tvar deck_fence = \"";
// line 3045
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3045, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 3045))) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 3045)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", false, false, false, 3045), "不要")) : ("不要")), "html", null, true);
} else {
echo "不要";
}
echo "\";
\t\t// PDF出力: モーダルの mitsumori_json をフォームに同期してから送信
\t\tfunction syncPdfJson(){
\t\t\tvar jsonVal = \$('#mitsumori_json').val();
\t\t\t\$('#pdf_mitsumori_json').val(jsonVal);
\t\t}
\t\t// タイプ9: 商品のみ購入
\t\tfunction quantityOnly(val){
\t\t\tvar current = parseInt(\$('#quantity_only').val()) || 1;
\t\t\tvar next = current + val;
\t\t\tif(next < 1) next = 1;
\t\t\t\$('#quantity_only').val(next);
\t\t\t\$('#quantity').val(next);
\t\t}
// ===== スマホ用下部固定バーへの金額同期 =====
// mitsumori_message と mitsumori_goukei を監視して下部バーを更新
(function() {
var msgTarget = document.getElementById('mitsumori_message');
var goukeiTarget = document.getElementById('mitsumori_goukei');
var spPrice = document.getElementById('sp-mitsumori-price');
var spBtn = document.querySelector('#sp-mitsumori-bar .sp-bar__btn');
if (!spPrice || !spBtn) return;
function syncBar() {
var msg = msgTarget ? msgTarget.textContent : '';
var goukei = goukeiTarget ? goukeiTarget.textContent : '---円';
// メッセージが「〇〇を選択してください」の場合はメッセージを表示しボタンを非表示
if (msg.indexOf('選択してください') !== -1) {
spPrice.textContent = msg;
spPrice.style.fontSize = '13px';
spPrice.style.color = '#888';
spBtn.style.display = 'none';
} else {
// 価格確定時はボタンを表示
spPrice.textContent = goukei;
spPrice.style.fontSize = '18px';
spPrice.style.color = '#c00';
spBtn.style.display = 'block';
}
}
// 初期値を同期
syncBar();
// mitsumori_message の変化を監視
if (msgTarget) {
new MutationObserver(syncBar).observe(
msgTarget, { childList: true, subtree: true, characterData: true }
);
}
// mitsumori_goukei の変化も監視
if (goukeiTarget) {
new MutationObserver(syncBar).observe(
goukeiTarget, { childList: true, subtree: true, characterData: true }
);
}
})();
// ===== スマホ用 お見積りの詳細 ボトムシート 開閉 =====
// 現在の内訳カード(.mitsumori-card-pc .card-body)を複製して表示する。
// 価格計算ロジックには触れず、その時点で表示中の内訳をそのまま見せる。
// window に直接ぶら下げてスコープに依存せず onclick から呼べるようにする。
window.openSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
var body = document.getElementById('sp-detail-body');
var src = document.querySelector('.mitsumori-card-pc .card-body');
if (!sheet || !body) return;
body.innerHTML = '';
if (src) {
// 複製し、重複 id を避けるため clone 側の id を除去する
var clone = src.cloneNode(true);
var ided = clone.querySelectorAll('[id]');
for (var i = 0; i < ided.length; i++) { ided[i].removeAttribute('id'); }
body.appendChild(clone);
}
sheet.classList.add('is-open');
sheet.setAttribute('aria-hidden', 'false');
document.body.style.overflow = 'hidden';
};
window.closeSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
if (!sheet) return;
sheet.classList.remove('is-open');
sheet.setAttribute('aria-hidden', 'true');
document.body.style.overflow = '';
};
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(function() {
var card = document.querySelector('.mitsumori-card-pc');
var btn = document.querySelector('.btn-mitsumori-toggle .toggle-icon');
if (!card || !btn) return;
// MutationObserverでcollapsed-cardクラスの変化を監視
new MutationObserver(function() {
if (card.classList.contains('collapsed-card')) {
btn.textContent = '▼ 詳細';
} else {
btn.textContent = '▲ 閉じる';
}
}).observe(card, { attributes: true, attributeFilter: ['class'] });
})();
// ===== エリア案内: スマホのみタップで展開 =====
(function() {
var notice = document.querySelector('.ec-areaNotice');
if (!notice) return;
notice.addEventListener('click', function(e) {
if (window.innerWidth > 767) return;
// リンククリック時は展開/折りたたみせずリンク遷移
if (e.target.tagName === 'A') return;
notice.classList.toggle('is-open');
});
})();
</script>
<script type=\"application/ld+json\">
{
\"@context\": \"https://schema.org/\",
\"@type\": \"Product\",
\"name\": \"";
// line 3168
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3168, $this->source); })()), "name", [], "any", false, false, false, 3168), "html", null, true);
echo "\",
\"image\": [
";
// line 3170
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3170, $this->source); })()), "ProductImage", [], "any", false, false, false, 3170));
$context['_iterated'] = false;
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["img"]) {
// line 3171
echo " \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3171, $this->source); })()), "request", [], "any", false, false, false, 3171), "schemeAndHttpHost", [], "any", false, false, false, 3171), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["img"], "save_image"), "html", null, true);
echo "\"";
if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 3171)) {
echo ",";
}
// line 3172
echo "
";
$context['_iterated'] = true;
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
if (!$context['_iterated']) {
// line 3174
echo " \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3174, $this->source); })()), "request", [], "any", false, false, false, 3174), "schemeAndHttpHost", [], "any", false, false, false, 3174), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"), "html", null, true);
echo "\"
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['img'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3176
echo " ],
\"description\": \"";
// line 3177
echo twig_escape_filter($this->env, twig_slice($this->env, twig_replace_filter(((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", true, true, false, 3177)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", false, false, false, 3177), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3177, $this->source); })()), "description_detail", [], "any", false, false, false, 3177))) : (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3177, $this->source); })()), "description_detail", [], "any", false, false, false, 3177))), ["
" => "", "
" => ""]), 0, 300), "html", null, true);
echo "\",
";
// line 3178
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3178, $this->source); })()), "code_min", [], "any", false, false, false, 3178)) {
// line 3179
echo " \"sku\": \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3179, $this->source); })()), "code_min", [], "any", false, false, false, 3179), "html", null, true);
echo "\",
";
}
// line 3181
echo " \"offers\": {
\"@type\": \"Offer\",
\"url\": \"";
// line 3183
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3183, $this->source); })()), "id", [], "any", false, false, false, 3183)]), "html", null, true);
echo "\",
\"priceCurrency\": \"";
// line 3184
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 3184, $this->source); })()), "currency", [], "any", false, false, false, 3184), "html", null, true);
echo "\",
\"price\": ";
// line 3185
((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3185, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3185)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3185, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3185), "html", null, true))) : (print (0)));
echo ",
\"availability\": \"";
// line 3186
echo ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3186, $this->source); })()), "stock_find", [], "any", false, false, false, 3186)) ? ("InStock") : ("OutOfStock"));
echo "\"
}
}
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 3193
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 3194
echo " ";
// line 3195
echo " ";
$context["option1_label"] = "オプション1";
// line 3196
echo " ";
$context["option2_label"] = "オプション2";
// line 3197
echo " ";
// line 3200
echo " ";
$context["is_cat43"] = false;
// line 3201
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3201, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3201))) {
// line 3202
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3202, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3202));
foreach ($context['_seq'] as $context["_key"] => $context["pcat"]) {
// line 3203
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3203) == 31)) {
$context["option1_label"] = "サイズプリセット";
$context["option2_label"] = "駆動方式";
}
// line 3204
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3204) == 43)) {
$context["option1_label"] = "ランマ";
$context["option2_label"] = "タイプ";
$context["is_cat43"] = true;
}
// line 3205
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3205) == 15)) {
$context["option1_label"] = "棚タイプ";
}
// line 3206
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3206) == 17)) {
$context["option1_label"] = "窓タイプ";
}
// line 3207
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pcat'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3208
echo " ";
}
// line 3209
echo " <div class=\"ec-productRole\" style=\"margin-top:20px;\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell\">
<div class=\"ec-sliderItemRole\">
\t ";
// line 3214
echo "\t <div class=\"ec-productRole__title\">
\t <div class=\"ec-productRole__titleRow\">
\t <h2 class=\"ec-headingTitle\">";
// line 3216
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3216, $this->source); })()), "name", [], "any", false, false, false, 3216), "html", null, true);
echo "</h2>
\t <div class=\"ec-share-inline\">
\t <a href=\"https://twitter.com/share?url=";
// line 3218
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3218, $this->source); })()), "request", [], "any", false, false, false, 3218), "uri", [], "any", false, false, false, 3218)), "html", null, true);
echo "&text=";
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3218, $this->source); })()), "name", [], "any", false, false, false, 3218)), "html", null, true);
echo "\"
\t class=\"share-twitter\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Xでシェア\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.74l7.73-8.835L1.254 2.25H8.08l4.254 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z\"/></svg>
\t </a>
\t <a href=\"https://www.instagram.com/\" class=\"share-facebook\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Instagram\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z\"/></svg>
\t </a>
\t <a href=\"https://social-plugins.line.me/lineit/share?url=";
// line 3225
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3225, $this->source); })()), "request", [], "any", false, false, false, 3225), "uri", [], "any", false, false, false, 3225)), "html", null, true);
echo "\"
\t class=\"share-line\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"LINEでシェア\">
\t <i class=\"fab fa-line\"></i>
\t </a>
\t </div>
\t </div>
\t </div>
";
// line 3232
if (twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 3232, $this->source); })()), "option_favorite_product", [], "any", false, false, false, 3232)) {
// line 3233
echo " <div style=\"position:relative;top: 20px;left: 10px;z-index:100;\">
\t\t\t\t\t\t";
// line 3234
if (((isset($context["is_favorite"]) || array_key_exists("is_favorite", $context) ? $context["is_favorite"] : (function () { throw new RuntimeError('Variable "is_favorite" does not exist.', 3234, $this->source); })()) == false)) {
// line 3235
echo " <form action=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3235, $this->source); })()), "id", [], "any", false, false, false, 3235)]), "html", null, true);
echo "\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\">♡</button>
</form>
";
} else {
// line 3239
echo " <form action=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3239, $this->source); })()), "id", [], "any", false, false, false, 3239)]), "html", null, true);
echo "\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\" style=\"color:red;\">♥</button>
</form>
";
}
// line 3243
echo " </div>
";
}
// line 3245
echo " <div class=\"item_visual\">
";
// line 3246
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3246, $this->source); })()), "ProductImage", [], "any", false, false, false, 3246));
$context['_iterated'] = false;
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["ProductImage"]) {
// line 3247
echo " <div class=\"slide-item\">
<a class=\"js-zoom\" href=\"";
// line 3248
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["ProductImage"], "save_image"), "html", null, true);
echo "\" aria-label=\"";
((twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, false, 3248)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3248, $this->source); })()), "name", [], "any", false, false, false, 3248), "html", null, true))) : (print ("")));
echo "\">
<img src=\"";
// line 3249
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["ProductImage"], "save_image"), "html", null, true);
echo "\" alt=\"";
((twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, false, 3249)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3249, $this->source); })()), "name", [], "any", false, false, false, 3249), "html", null, true))) : (print ("")));
echo "\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 3249) > 1)) {
echo " loading=\"lazy\"";
}
echo ">
</a>
</div>
";
$context['_iterated'] = true;
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
if (!$context['_iterated']) {
// line 3253
echo " <div class=\"slide-item\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3253, $this->source); })()), "name", [], "any", false, false, false, 3253), "html", null, true);
echo "\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"></div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductImage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3255
echo " </div>
<div class=\"item_nav\">
";
// line 3257
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3257, $this->source); })()), "ProductImage", [], "any", false, false, false, 3257));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["ProductImage"]) {
// line 3258
echo " <div class=\"slideThumb\" data-index=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, false, 3258), "html", null, true);
echo "\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["ProductImage"], "save_image"), "html", null, true);
echo "\" alt=\"\" width=\"80\" height=\"80\" loading=\"lazy\"></div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductImage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3260
echo " </div>
</div>
";
// line 3265
echo " <div class=\"ec-areaNotice\" style=\"margin-top:16px;margin-right:10px;\">
<div class=\"ec-areaNotice__inner\">
<div class=\"ec-areaNotice__icon\">📍</div>
<div class=\"ec-areaNotice__body\">
<p class=\"ec-areaNotice__title\">施工対応エリアについて</p>
<div class=\"ec-areaNotice__detail\">
<p class=\"ec-areaNotice__text\">
当店の施工サービスは、<strong>山梨県全域</strong>および<br>
<strong>諏訪エリア(諏訪市・岡谷市・茅野市・諏訪郡)</strong>を対象としております。<br>
上記エリア外のお客様には、商品のみのご購入が可能でございます。<br>
ご不明な点がございましたら、お気軽にお問い合わせください。
</p>
<a class=\"ec-areaNotice__link\" href=\"";
// line 3277
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact");
echo "\">エリア外のお客様・ご相談はこちら →</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-grid2__cell2\">
<div class=\"ec-productRole__profile\" >
";
// line 3288
echo " ";
$context["hidden_cat_ids"] = [0 => 21, 1 => 28, 2 => 44];
// line 3289
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3289, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3289))) {
// line 3290
echo " <div class=\"ec-productRole__category\" style=\"padding:10px 0;\">
";
// line 3291
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3291, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3291));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 3292
echo " ";
if (!twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, false, 3292), "id", [], "any", false, false, false, 3292), (isset($context["hidden_cat_ids"]) || array_key_exists("hidden_cat_ids", $context) ? $context["hidden_cat_ids"] : (function () { throw new RuntimeError('Variable "hidden_cat_ids" does not exist.', 3292, $this->source); })()))) {
// line 3293
echo " <ul>
<li>
";
// line 3295
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, false, 3295), "path", [], "any", false, false, false, 3295));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["Category"]) {
// line 3296
echo " <a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Category"], "id", [], "any", false, false, false, 3296), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Category"], "name", [], "any", false, false, false, 3296), "html", null, true);
echo "</a>";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 3296) == false)) {
// line 3297
echo " <span>></span>";
}
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3299
echo " </li>
</ul>
";
}
// line 3302
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3303
echo " </div>
";
}
// line 3305
echo " ";
// line 3306
echo " <div class=\"ec-productRole__price\">
\t\t\t\t\t\t<span style=\"color:black;font-size:15px;\">工事費込み価格</span>
";
// line 3308
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3308, $this->source); })()), "hasProductClass", [], "any", false, false, false, 3308)) {
// line 3309
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3309, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3309) == twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3309, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, false, 3309))) {
// line 3310
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">";
// line 3311
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3311, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3311)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(";
// line 3312
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo ")~</span>
</div>
";
} else {
// line 3315
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">";
// line 3316
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3316, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3316)), "html", null, true);
echo " ~ ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3316, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, false, 3316)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(";
// line 3317
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo ")</span>
</div>
";
}
// line 3320
echo " ";
} else {
// line 3321
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price\">";
// line 3322
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3322, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3322)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(";
// line 3323
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo ")~</span>
</div>
";
}
// line 3326
echo " </div>
";
// line 3328
echo " <ul class=\"ec-productRole__tags\">
";
// line 3329
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3329, $this->source); })()), "Tags", [], "any", false, false, false, 3329));
foreach ($context['_seq'] as $context["_key"] => $context["Tag"]) {
// line 3330
echo " <li class=\"ec-productRole__tag tag_";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Tag"], "id", [], "any", false, false, false, 3330), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $context["Tag"], "html", null, true);
echo "</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Tag'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3332
echo " </ul>
";
// line 3334
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3334, $this->source); })()), "code_min", [], "any", false, false, false, 3334))) {
// line 3335
echo " <div class=\"ec-productRole__code\">
";
// line 3336
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品コード"), "html", null, true);
echo ": <span class=\"product-code-default\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3336, $this->source); })()), "code_min", [], "any", false, false, false, 3336), "html", null, true);
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3336, $this->source); })()), "code_min", [], "any", false, false, false, 3336) != twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3336, $this->source); })()), "code_max", [], "any", false, false, false, 3336))) {
echo " ~ ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3336, $this->source); })()), "code_max", [], "any", false, false, false, 3336), "html", null, true);
}
echo "</span>
</div>
";
}
// line 3339
echo "
<div class=\"ec-productRole__description\">
\t\t\t\t <div class=\"ec-rectHeading\">
\t\t\t\t <h4>製品情報</h4>
\t\t\t\t </div>
\t\t\t\t\t\t";
// line 3344
echo twig_nl2br(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3344, $this->source); })()), "sales_infomation", [], "any", false, false, false, 3344));
echo "
</div>
\t\t\t\t\t<div class=\"card card-danger\" style=\"clear:both;margin:1px;\">
\t\t\t\t\t <div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">見積シミュレーション</h3>
\t\t\t\t\t </div>
\t\t\t\t\t <div class=\"card-body p-2\">
";
// line 3353
$context["related_image"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3353, $this->source); })()), "id", [], "any", false, false, false, 3353), "related_image");
// line 3354
echo " ";
// line 3355
echo " ";
$context["img1"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3355, $this->source); })()) && twig_in_filter("1段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3355, $this->source); })())));
// line 3356
echo " ";
$context["img2"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3356, $this->source); })()) && twig_in_filter("2段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3356, $this->source); })())));
// line 3357
echo " ";
$context["img3"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3357, $this->source); })()) && twig_in_filter("3段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3357, $this->source); })())));
// line 3358
echo " ";
$context["img4"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3358, $this->source); })()) && twig_in_filter("4段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3358, $this->source); })())));
// line 3359
echo "\t\t\t\t\t ";
$context["type1"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3359, $this->source); })()), "id", [], "any", false, false, false, 3359), "related_name1");
// line 3360
echo "\t\t\t\t\t\t";
$context["type2"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3360, $this->source); })()), "id", [], "any", false, false, false, 3360), "related_name2");
// line 3361
echo "\t\t\t\t\t\t";
$context["type3"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3361, $this->source); })()), "id", [], "any", false, false, false, 3361), "related_name3");
// line 3362
echo "\t\t\t\t\t\t";
$context["type4"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3362, $this->source); })()), "id", [], "any", false, false, false, 3362), "related_name4");
// line 3363
echo "\t\t\t\t\t\t";
$context["hasRelated"] = ((((((isset($context["type1"]) || array_key_exists("type1", $context) ? $context["type1"] : (function () { throw new RuntimeError('Variable "type1" does not exist.', 3363, $this->source); })()) && (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3363, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3363, $this->source); })()))) || (( // line 3364
(isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3364, $this->source); })()) && (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3364, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3364, $this->source); })())))) || (( // line 3365
(isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3365, $this->source); })()) && (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3365, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3365, $this->source); })())))) || (( // line 3366
(isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3366, $this->source); })()) && (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3366, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3366, $this->source); })()))));
// line 3367
echo "\t\t\t\t\t\t";
if ((isset($context["hasRelated"]) || array_key_exists("hasRelated", $context) ? $context["hasRelated"] : (function () { throw new RuntimeError('Variable "hasRelated" does not exist.', 3367, $this->source); })())) {
// line 3368
echo "\t\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のタイプを選択してください。</label></div>
\t\t\t\t\t\t";
}
// line 3370
echo "
\t\t\t\t\t\t";
// line 3372
echo "\t\t\t\t\t\t";
if ((((isset($context["type1"]) || array_key_exists("type1", $context) ? $context["type1"] : (function () { throw new RuntimeError('Variable "type1" does not exist.', 3372, $this->source); })()) && (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3372, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3372, $this->source); })())))) {
// line 3373
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3374
echo twig_escape_filter($this->env, (isset($context["type1"]) || array_key_exists("type1", $context) ? $context["type1"] : (function () { throw new RuntimeError('Variable "type1" does not exist.', 3374, $this->source); })()), "html", null, true);
if (((isset($context["img1"]) || array_key_exists("img1", $context) ? $context["img1"] : (function () { throw new RuntimeError('Variable "img1" does not exist.', 3374, $this->source); })()) && (isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3374, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3374, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3375
if ((isset($context["img1"]) || array_key_exists("img1", $context) ? $context["img1"] : (function () { throw new RuntimeError('Variable "img1" does not exist.', 3375, $this->source); })())) {
// line 3376
echo "\t\t\t\t\t\t ";
// line 3377
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3378
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3378, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3379
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3379, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3381
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3381) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3381, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3381))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3381, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3381), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3382
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">";
// line 3386
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3389
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3391
echo "\t\t\t\t\t\t ";
// line 3392
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3393
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3393, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3394
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3394, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3395
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3398
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3400
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3402
echo "
\t\t\t\t\t\t";
// line 3404
echo "\t\t\t\t\t\t";
if ((((isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3404, $this->source); })()) && (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3404, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3404, $this->source); })())))) {
// line 3405
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3406
echo twig_escape_filter($this->env, (isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3406, $this->source); })()), "html", null, true);
if (((isset($context["img2"]) || array_key_exists("img2", $context) ? $context["img2"] : (function () { throw new RuntimeError('Variable "img2" does not exist.', 3406, $this->source); })()) && (isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3406, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3406, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3407
if ((isset($context["img2"]) || array_key_exists("img2", $context) ? $context["img2"] : (function () { throw new RuntimeError('Variable "img2" does not exist.', 3407, $this->source); })())) {
// line 3408
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3409
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3409, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3410
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3410, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3412
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3412) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3412, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3412))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3412, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3412), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3413
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">";
// line 3417
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3420
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3422
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3423
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3423, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3424
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3424, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3425
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3428
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3430
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3432
echo "
\t\t\t\t\t\t";
// line 3434
echo "\t\t\t\t\t\t";
if ((((isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3434, $this->source); })()) && (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3434, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3434, $this->source); })())))) {
// line 3435
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3436
echo twig_escape_filter($this->env, (isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3436, $this->source); })()), "html", null, true);
if (((isset($context["img3"]) || array_key_exists("img3", $context) ? $context["img3"] : (function () { throw new RuntimeError('Variable "img3" does not exist.', 3436, $this->source); })()) && (isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3436, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3436, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3437
if ((isset($context["img3"]) || array_key_exists("img3", $context) ? $context["img3"] : (function () { throw new RuntimeError('Variable "img3" does not exist.', 3437, $this->source); })())) {
// line 3438
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3439
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3439, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3440
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3440, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3442
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3442) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3442, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3442))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3442, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3442), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3443
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">";
// line 3447
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3450
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3452
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3453
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3453, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3454
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3454, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3455
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3458
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3460
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3462
echo "
\t\t\t\t\t\t";
// line 3464
echo "\t\t\t\t\t\t";
if ((((isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3464, $this->source); })()) && (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3464, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3464, $this->source); })())))) {
// line 3465
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3466
echo twig_escape_filter($this->env, (isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3466, $this->source); })()), "html", null, true);
if (((isset($context["img4"]) || array_key_exists("img4", $context) ? $context["img4"] : (function () { throw new RuntimeError('Variable "img4" does not exist.', 3466, $this->source); })()) && (isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3466, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3466, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3467
if ((isset($context["img4"]) || array_key_exists("img4", $context) ? $context["img4"] : (function () { throw new RuntimeError('Variable "img4" does not exist.', 3467, $this->source); })())) {
// line 3468
echo "\t\t\t\t\t\t ";
// line 3469
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3470
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3470, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3471
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3471, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3473
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3473) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3473, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3473))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3473, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3473), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3474
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\" width=\"120\" height=\"120\" loading=\"lazy\">
\t\t\t\t\t\t <span class=\"rp-card__label\">";
// line 3475
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3478
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3480
echo "\t\t\t\t\t\t ";
// line 3481
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3482
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3482, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3483
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3483, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3484
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3487
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3489
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3491
echo "
\t\t\t\t\t ";
// line 3500
echo "\t\t\t\t\t ";
$context["is_gs_h"] = false;
// line 3501
echo "\t\t\t\t\t ";
$context["is_cg_h"] = false;
// line 3502
echo "\t\t\t\t\t ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3502, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3502))) {
// line 3503
echo "\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3503, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3503));
foreach ($context['_seq'] as $context["_key"] => $context["pc_h"]) {
// line 3504
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, $context["pc_h"], "category_id", [], "any", false, false, false, 3504) == 27)) {
$context["is_gs_h"] = true;
}
// line 3505
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, $context["pc_h"], "category_id", [], "any", false, false, false, 3505) == 9)) {
$context["is_cg_h"] = true;
}
// line 3506
echo "\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pc_h'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3507
echo "\t\t\t\t\t ";
}
// line 3508
echo "\t\t\t\t\t ";
$context["visible_op_count"] = 0;
// line 3509
echo "\t\t\t\t\t ";
if (((isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 3509, $this->source); })()) && twig_length_filter($this->env, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 3509, $this->source); })())))) {
// line 3510
echo "\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 3510, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opi"]) {
// line 3511
echo "\t\t\t\t\t ";
if (twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3511)) {
// line 3512
echo "\t\t\t\t\t ";
$context["_hide_h"] = false;
// line 3513
echo "\t\t\t\t\t ";
if (((isset($context["is_gs_h"]) || array_key_exists("is_gs_h", $context) ? $context["is_gs_h"] : (function () { throw new RuntimeError('Variable "is_gs_h" does not exist.', 3513, $this->source); })()) && (preg_match("/撤去/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3513)) || preg_match("/残土/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3513))))) {
$context["_hide_h"] = true;
}
// line 3514
echo "\t\t\t\t\t ";
if (((isset($context["is_cg_h"]) || array_key_exists("is_cg_h", $context) ? $context["is_cg_h"] : (function () { throw new RuntimeError('Variable "is_cg_h" does not exist.', 3514, $this->source); })()) && preg_match("/残土/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3514)))) {
$context["_hide_h"] = true;
}
// line 3515
echo "\t\t\t\t\t ";
if ( !(isset($context["_hide_h"]) || array_key_exists("_hide_h", $context) ? $context["_hide_h"] : (function () { throw new RuntimeError('Variable "_hide_h" does not exist.', 3515, $this->source); })())) {
$context["visible_op_count"] = ((isset($context["visible_op_count"]) || array_key_exists("visible_op_count", $context) ? $context["visible_op_count"] : (function () { throw new RuntimeError('Variable "visible_op_count" does not exist.', 3515, $this->source); })()) + 1);
}
// line 3516
echo "\t\t\t\t\t ";
}
// line 3517
echo "\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opi'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3518
echo "\t\t\t\t\t ";
}
// line 3519
echo "\t\t\t\t\t ";
$context["has_any_option"] = ((((((((( // line 3520
(isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3520, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3520, $this->source); })()))) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3520, $this->source); })()), "SaleType", [], "any", false, false, false, 3520), "id", [], "any", false, false, false, 3520) != 3)) || (( // line 3521
(isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3521, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3521, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3521, $this->source); })())) != ""))) || (( // line 3522
(isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3522, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3522, $this->source); })()))) && (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3522, $this->source); })())) != ""))) || (( // line 3523
(isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3523, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3523, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3523, $this->source); })())) != ""))) || (( // line 3524
(isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3524, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3524, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3524, $this->source); })())) != ""))) || (( // line 3525
(isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3525, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3525, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3525, $this->source); })())) != ""))) || (( // line 3526
(isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3526, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3526, $this->source); })()))) && (twig_join_filter((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3526, $this->source); })())) != ""))) || twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 3527
(isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3527, $this->source); })()), "SaleType", [], "any", false, false, false, 3527), "id", [], "any", false, false, false, 3527), [0 => 2, 1 => 5, 2 => 6, 3 => 7, 4 => 9]));
// line 3529
echo "\t\t\t\t\t ";
if ((isset($context["has_any_option"]) || array_key_exists("has_any_option", $context) ? $context["has_any_option"] : (function () { throw new RuntimeError('Variable "has_any_option" does not exist.', 3529, $this->source); })())) {
// line 3530
echo "\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のオプションを選択してください。</label></div>
\t\t\t\t\t ";
}
// line 3532
echo "
";
// line 3534
echo " ";
if (((((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3534, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3534, $this->source); })()))) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3534, $this->source); })()), "SaleType", [], "any", false, false, false, 3534), "id", [], "any", false, false, false, 3534) != 3)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3534, $this->source); })()), "SaleType", [], "any", false, false, false, 3534), "id", [], "any", false, false, false, 3534) != 2))) {
// line 3535
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">カラー";
// line 3536
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3536, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3536, $this->source); })()), "pc", [], "any", false, false, false, 3536))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3536, $this->source); })()), "pc", [], "any", false, false, false, 3536), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3538
$context["idx"] = 0;
// line 3539
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3539, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3539))) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3539, $this->source); })()) + 1);
// line 3540
echo " ";
$context["has_img"] = (twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", true, true, false, 3540) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3540)));
// line 3541
echo " <label class=\"opt-btn";
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3541, $this->source); })())) {
echo " opt-btn--with-image";
}
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3541, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3541, $this->source); })()), "pc", [], "any", false, false, false, 3541) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3541))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3541, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pc', '";
// line 3542
echo twig_escape_filter($this->env, twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3542), "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"color\" id=\"cc_";
// line 3543
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3543, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3543), "html", null, true);
echo "\"
";
// line 3544
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3544, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3544, $this->source); })()), "pc", [], "any", false, false, false, 3544) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3544))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3544, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3545
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3545, $this->source); })())) {
// line 3546
echo " <img src=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3546), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3546), "html", null, true);
echo "\" class=\"opt-btn__img\"
onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
<span class=\"opt-btn__name\">";
// line 3548
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3548), "html", null, true);
echo "</span>
";
} else {
// line 3550
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3550), "html", null, true);
echo "
";
}
// line 3552
echo " </label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3554
echo " </div>
</div>
";
}
// line 3557
echo "
";
// line 3562
echo " ";
if (((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3562, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3562, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3562, $this->source); })())) != "")) && !twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3562, $this->source); })()), "SaleType", [], "any", false, false, false, 3562), "id", [], "any", false, false, false, 3562), [0 => 2, 1 => 3, 2 => 6]))) {
// line 3563
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">幅";
// line 3564
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3564, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3564, $this->source); })()), "pw", [], "any", false, false, false, 3564))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3564, $this->source); })()), "pw", [], "any", false, false, false, 3564), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3566
$context["idx"] = 0;
// line 3567
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3567, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw"]) {
if ($context["pw"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3567, $this->source); })()) + 1);
// line 3568
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3568, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3568, $this->source); })()), "pw", [], "any", false, false, false, 3568) == $context["pw"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3568, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pw', '";
// line 3569
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["pw"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"pw\" id=\"pw_";
// line 3570
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3570, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "\"
";
// line 3571
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3571, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3571, $this->source); })()), "pw", [], "any", false, false, false, 3571) == $context["pw"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3571, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3572
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3575
echo " </div>
</div>
";
}
// line 3578
echo "
";
// line 3579
if (((((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3579, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3579, $this->source); })()))) && (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3579, $this->source); })())) != "")) && !twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3579, $this->source); })()), "SaleType", [], "any", false, false, false, 3579), "id", [], "any", false, false, false, 3579), [0 => 3, 1 => 6]))) {
// line 3580
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">奥行き";
// line 3581
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3581, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3581, $this->source); })()), "pd", [], "any", false, false, false, 3581))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3581, $this->source); })()), "pd", [], "any", false, false, false, 3581), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3583
$context["idx"] = 0;
// line 3584
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3584, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pd"]) {
if ($context["pd"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3584, $this->source); })()) + 1);
// line 3585
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3585, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3585, $this->source); })()), "pd", [], "any", false, false, false, 3585) == $context["pd"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3585, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pd', '";
// line 3586
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["pd"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"pd\" id=\"pd_";
// line 3587
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3587, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "\"
";
// line 3588
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3588, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3588, $this->source); })()), "pd", [], "any", false, false, false, 3588) == $context["pd"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3588, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3589
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pd'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3592
echo " </div>
</div>
";
}
// line 3595
echo "
";
// line 3598
echo " ";
if (((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3598, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3598, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3598, $this->source); })())) != "")) && !twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3598, $this->source); })()), "SaleType", [], "any", false, false, false, 3598), "id", [], "any", false, false, false, 3598), [0 => 2, 1 => 3, 2 => 6]))) {
// line 3599
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">高さ";
// line 3600
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3600, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3600, $this->source); })()), "ph", [], "any", false, false, false, 3600))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3600, $this->source); })()), "ph", [], "any", false, false, false, 3600), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3602
$context["idx"] = 0;
// line 3603
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3603, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["ph"]) {
if ($context["ph"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3603, $this->source); })()) + 1);
// line 3604
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3604, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3604, $this->source); })()), "ph", [], "any", false, false, false, 3604) == $context["ph"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3604, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('ph', '";
// line 3605
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["ph"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"ph\" id=\"ph_";
// line 3606
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3606, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "\"
";
// line 3607
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3607, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3607, $this->source); })()), "ph", [], "any", false, false, false, 3607) == $context["ph"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3607, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3608
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ph'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3611
echo " </div>
</div>
";
}
// line 3614
echo "
";
// line 3616
echo " ";
if ((((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3616, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3616, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3616, $this->source); })())) != "")) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3616, $this->source); })()), "SaleType", [], "any", false, false, false, 3616), "id", [], "any", false, false, false, 3616) != 3)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3616, $this->source); })()), "SaleType", [], "any", false, false, false, 3616), "id", [], "any", false, false, false, 3616) != 2))) {
// line 3617
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">";
// line 3618
if ((isset($context["is_cat43"]) || array_key_exists("is_cat43", $context) ? $context["is_cat43"] : (function () { throw new RuntimeError('Variable "is_cat43" does not exist.', 3618, $this->source); })())) {
echo "開き方";
} else {
echo "素材";
}
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3618, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3618, $this->source); })()), "pm", [], "any", false, false, false, 3618))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3618, $this->source); })()), "pm", [], "any", false, false, false, 3618), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3620
$context["idx"] = 0;
// line 3621
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3621, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm"]) {
if ($context["pm"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3621, $this->source); })()) + 1);
// line 3622
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3622, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3622, $this->source); })()), "pm", [], "any", false, false, false, 3622) == $context["pm"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3622, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pm', '";
// line 3623
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["pm"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"pm\" id=\"pm_";
// line 3624
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3624, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "\"
";
// line 3625
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3625, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3625, $this->source); })()), "pm", [], "any", false, false, false, 3625) == $context["pm"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3625, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3626
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3629
echo " </div>
</div>
";
}
// line 3632
echo "
";
// line 3637
echo " ";
if ((((((((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3637, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3637, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3637, $this->source); })())) != "")) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3637, $this->source); })()), "SaleType", [], "any", false, false, false, 3637), "id", [], "any", false, false, false, 3637) != 2)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3637, $this->source); })()), "SaleType", [], "any", false, false, false, 3637), "id", [], "any", false, false, false, 3637) != 3)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3637, $this->source); })()), "SaleType", [], "any", false, false, false, 3637), "id", [], "any", false, false, false, 3637) != 4)) && !(isset($context["is_cat43"]) || array_key_exists("is_cat43", $context) ? $context["is_cat43"] : (function () { throw new RuntimeError('Variable "is_cat43" does not exist.', 3637, $this->source); })()))) {
// line 3638
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">";
// line 3639
echo twig_escape_filter($this->env, (isset($context["option1_label"]) || array_key_exists("option1_label", $context) ? $context["option1_label"] : (function () { throw new RuntimeError('Variable "option1_label" does not exist.', 3639, $this->source); })()), "html", null, true);
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3639, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3639)) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3639, $this->source); })()), "option1", [], "any", false, false, false, 3639))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3639, $this->source); })()), "option1", [], "any", false, false, false, 3639), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3641
$context["idx"] = 0;
// line 3642
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3642, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt1"]) {
if ($context["opt1"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3642, $this->source); })()) + 1);
// line 3643
echo " <label class=\"opt-btn";
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3643, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3643)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3643, $this->source); })()), "option1", [], "any", false, false, false, 3643) == $context["opt1"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3643, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('option1', '";
// line 3644
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt1"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"option1\" id=\"option1_";
// line 3645
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3645, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt1"], "html", null, true);
echo "\"
";
// line 3646
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3646, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3646)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3646, $this->source); })()), "option1", [], "any", false, false, false, 3646) == $context["opt1"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3646, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3647
echo twig_escape_filter($this->env, $context["opt1"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt1'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3650
echo " </div>
</div>
";
}
// line 3653
echo "
";
// line 3655
echo " ";
if (((((((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3655, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3655, $this->source); })()))) && (twig_join_filter((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3655, $this->source); })())) != "")) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3655, $this->source); })()), "SaleType", [], "any", false, false, false, 3655), "id", [], "any", false, false, false, 3655) != 2)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3655, $this->source); })()), "SaleType", [], "any", false, false, false, 3655), "id", [], "any", false, false, false, 3655) != 3)) && !(isset($context["is_cat43"]) || array_key_exists("is_cat43", $context) ? $context["is_cat43"] : (function () { throw new RuntimeError('Variable "is_cat43" does not exist.', 3655, $this->source); })()))) {
// line 3656
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">";
// line 3657
echo twig_escape_filter($this->env, (isset($context["option2_label"]) || array_key_exists("option2_label", $context) ? $context["option2_label"] : (function () { throw new RuntimeError('Variable "option2_label" does not exist.', 3657, $this->source); })()), "html", null, true);
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3657, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3657)) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3657, $this->source); })()), "option2", [], "any", false, false, false, 3657))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3657, $this->source); })()), "option2", [], "any", false, false, false, 3657), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3659
$context["idx"] = 0;
// line 3660
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3660, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt2"]) {
if ($context["opt2"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3660, $this->source); })()) + 1);
// line 3661
echo " <label class=\"opt-btn";
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3661, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3661)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3661, $this->source); })()), "option2", [], "any", false, false, false, 3661) == $context["opt2"])) || (twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3661, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('option2', '";
// line 3662
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt2"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"option2\" id=\"option2_";
// line 3663
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3663, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt2"], "html", null, true);
echo "\"
";
// line 3664
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3664, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3664)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3664, $this->source); })()), "option2", [], "any", false, false, false, 3664) == $context["opt2"])) || (twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3664, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3665
echo twig_escape_filter($this->env, $context["opt2"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt2'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3668
echo " </div>
</div>
";
}
// line 3671
echo "
\t\t\t\t\t\t<!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
\t\t\t\t\t\t";
// line 3673
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3673, $this->source); })()), "SaleType", [], "any", false, false, false, 3673), "id", [], "any", false, false, false, 3673) == 1)) {
// line 3674
echo "\t\t\t\t\t\t";
}
// line 3675
echo "
\t\t\t\t\t\t<!-- 2: 施工見積(補助金・窓) 複数タイプ追加対応 (2026-05) -->
\t\t\t\t\t\t";
// line 3677
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3677, $this->source); })()), "SaleType", [], "any", false, false, false, 3677), "id", [], "any", false, false, false, 3677) == 2)) {
// line 3678
echo "
\t\t\t\t\t\t\t";
// line 3682
echo "
\t\t\t\t\t\t\t";
// line 3686
echo "\t\t\t\t\t\t\t<style>
\t\t\t\t\t\t\t\t.ec-productRole__profile {
\t\t\t\t\t\t\t\t\toverflow: visible !important;
\t\t\t\t\t\t\t\t\tmax-height: none !important;
\t\t\t\t\t\t\t\t\theight: auto !important;
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t</style>
\t\t\t\t\t\t\t";
// line 3695
echo "\t\t\t\t\t\t\t";
$context["housing_default"] = _twig_default_filter($this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3695, $this->source); })()), "id", [], "any", false, false, false, 3695), "住宅区分"), "戸建");
// line 3696
echo "\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>お住まいの種別を選択</strong>
\t\t\t\t\t\t\t <small class=\"ms-2 text-muted\">補助金単価が変わります</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t <div class=\"opt-btn-group\" id=\"window-housing-type-group\">
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"戸建\"
\t\t\t\t\t\t\t ";
// line 3705
if (((isset($context["housing_default"]) || array_key_exists("housing_default", $context) ? $context["housing_default"] : (function () { throw new RuntimeError('Variable "housing_default" does not exist.', 3705, $this->source); })()) != "集合住宅")) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 戸建住宅<small class=\"d-block text-muted\">(延床240㎡以下の非住宅含む)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"集合住宅\"
\t\t\t\t\t\t\t ";
// line 3710
if (((isset($context["housing_default"]) || array_key_exists("housing_default", $context) ? $context["housing_default"] : (function () { throw new RuntimeError('Variable "housing_default" does not exist.', 3710, $this->source); })()) == "集合住宅")) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 集合住宅<small class=\"d-block text-muted\">(低層・中高層/240㎡超の非住宅)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>窓タイプを選択(複数追加可・最大 20)</strong>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t <div id=\"window-types-container\"><!-- 動的に窓タイプブロックが追加される --></div>
\t\t\t\t\t\t\t <div class=\"text-center mt-2\">
\t\t\t\t\t\t\t <button type=\"button\" id=\"btn-add-window-type\" class=\"btn btn-outline-primary btn-sm\" onclick=\"addWindowType();\">+ 窓タイプを追加</button>
\t\t\t\t\t\t\t <div class=\"small text-muted mt-1\">最大 20 タイプまで追加できます</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
// line 3731
echo "\t\t\t\t\t\t\t<template id=\"window-type-template\">
\t\t\t\t\t\t\t <div class=\"window-type-block\" data-type-idx=\"__IDX__\" style=\"border:1px solid #ddd;border-radius:6px;padding:10px;margin-bottom:10px;background:#fafafa;\">
\t\t\t\t\t\t\t <div class=\"d-flex justify-content-between align-items-center mb-2\">
\t\t\t\t\t\t\t <strong>窓タイプ <span class=\"wt-num\">__IDX__</span></strong>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-sm btn-outline-danger btn-remove-window-type\" onclick=\"removeWindowType(this);\">× 削除</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 3739
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3739, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3739, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3739, $this->source); })())) != ""))) {
// line 3740
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓タイプ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 3743
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3743, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 3744
echo "\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_subtype___IDX__\" value=\"";
// line 3745
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "\" data-axis=\"subtype\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 3746
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3749
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3752
echo "
\t\t\t\t\t\t\t ";
// line 3754
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3754, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3754, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3754, $this->source); })())) != ""))) {
// line 3755
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_pw___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1750\" data-axis=\"pw\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応幅: 〜";
// line 3763
echo twig_escape_filter($this->env, _twig_default_filter(twig_last($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3763, $this->source); })())), ""), "html", null, true);
echo "(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3763, $this->source); })())), "html", null, true);
echo " 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3766
echo "
\t\t\t\t\t\t\t ";
// line 3768
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3768, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3768, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3768, $this->source); })())) != ""))) {
// line 3769
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_ph___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1200\" data-axis=\"ph\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応高さ: 〜";
// line 3777
echo twig_escape_filter($this->env, _twig_default_filter(twig_last($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3777, $this->source); })())), ""), "html", null, true);
echo "(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3777, $this->source); })())), "html", null, true);
echo " 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3780
echo "
\t\t\t\t\t\t\t ";
// line 3782
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3782, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3782, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3782, $this->source); })())) != ""))) {
// line 3783
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ガラスタイプ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 3786
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3786, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 3787
echo "\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pm___IDX__\" value=\"";
// line 3788
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "\" data-axis=\"pm\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 3789
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3792
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">「<span style=\"color:#2e7d32;font-weight:bold;\">補助金対象</span>」が付いたガラスは、先進的窓リノベ補助金の対象です。</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3796
echo "
\t\t\t\t\t\t\t ";
// line 3798
echo "\t\t\t\t\t\t\t ";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3798, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3798, $this->source); })())))) {
// line 3799
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓枠カラー</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 3802
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3802, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3802))) {
// line 3803
echo "\t\t\t\t\t\t\t ";
$context["has_img"] = (twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", true, true, false, 3803) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3803)));
// line 3804
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3804, $this->source); })())) {
echo " opt-btn--with-image";
}
echo "\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pc___IDX__\" value=\"";
// line 3805
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3805), "html", null, true);
echo "\" data-axis=\"pc\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 3806
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3806, $this->source); })())) {
// line 3807
echo "\t\t\t\t\t\t\t <img src=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3807), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3807), "html", null, true);
echo "\" class=\"opt-btn__img\"
\t\t\t\t\t\t\t onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
\t\t\t\t\t\t\t <span class=\"opt-btn__name\">";
// line 3809
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3809), "html", null, true);
echo "</span>
\t\t\t\t\t\t\t ";
} else {
// line 3811
echo "\t\t\t\t\t\t\t ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3811), "html", null, true);
echo "
\t\t\t\t\t\t\t ";
}
// line 3813
echo "\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3815
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3818
echo "
\t\t\t\t\t\t\t ";
// line 3820
echo "\t\t\t\t\t\t\t <div class=\"form-group row mt-2 align-items-center\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">セット数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_setqty___IDX__\" class=\"form-control wt-input-setqty\" value=\"1\" min=\"1\" max=\"99\" data-axis=\"setqty\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">セット</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4 text-end\">
\t\t\t\t\t\t\t <small class=\"text-muted\">補助金額<br><span class=\"wt-subsidy-amount\">―</span> 円</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</template>
\t\t\t\t\t\t\t";
// line 3836
echo "\t\t\t\t\t\t\t<script>
\t\t\t\t\t\t\t(function() {
\t\t\t\t\t\t\t\tvar MAX_WINDOW_TYPES = 20;
\t\t\t\t\t\t\t\tfunction addWindowType() {
\t\t\t\t\t\t\t\t\tvar container = document.getElementById('window-types-container');
\t\t\t\t\t\t\t\t\tif (!container) return;
\t\t\t\t\t\t\t\t\tvar existing = container.querySelectorAll('.window-type-block');
\t\t\t\t\t\t\t\t\tif (existing.length >= MAX_WINDOW_TYPES) return;
\t\t\t\t\t\t\t\t\tvar newIdx = existing.length + 1;
\t\t\t\t\t\t\t\t\tvar tpl = document.getElementById('window-type-template');
\t\t\t\t\t\t\t\t\tif (!tpl) return;
\t\t\t\t\t\t\t\t\t// <template> の innerHTML を取り出して __IDX__ を新規連番に置換し、要素化して append.
\t\t\t\t\t\t\t\t\tvar html = tpl.innerHTML.replace(/__IDX__/g, String(newIdx));
\t\t\t\t\t\t\t\t\tvar wrapper = document.createElement('div');
\t\t\t\t\t\t\t\t\twrapper.innerHTML = html.trim();
\t\t\t\t\t\t\t\t\tvar block = wrapper.firstChild;
\t\t\t\t\t\t\t\t\tcontainer.appendChild(block);
\t\t\t\t\t\t\t\t\tdecorateSubsidyGlass(block);
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 補助金対象ガラスの選択肢に「補助金対象」バッジ + 緑枠を付与する.
\t\t\t\t\t\t\t\t// 判定は calc script 側の window.glassYieldsSubsidy に委譲 (ロジック二重化を避ける)。
\t\t\t\t\t\t\t\tfunction decorateSubsidyGlass(block) {
\t\t\t\t\t\t\t\t\tif (!block || typeof window.glassYieldsSubsidy !== 'function') return;
\t\t\t\t\t\t\t\t\tvar radios = block.querySelectorAll('input[data-axis=\"pm\"]');
\t\t\t\t\t\t\t\t\tradios.forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\tvar label = inp.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\tif (!label || label.querySelector('.opt-btn__subsidy-badge')) return;
\t\t\t\t\t\t\t\t\t\tif (window.glassYieldsSubsidy(inp.value)) {
\t\t\t\t\t\t\t\t\t\t\tlabel.classList.add('opt-btn--subsidy');
\t\t\t\t\t\t\t\t\t\t\tvar badge = document.createElement('span');
\t\t\t\t\t\t\t\t\t\t\tbadge.className = 'opt-btn__subsidy-badge';
\t\t\t\t\t\t\t\t\t\t\tbadge.textContent = '補助金対象';
\t\t\t\t\t\t\t\t\t\t\tlabel.appendChild(badge);
\t\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction removeWindowType(btn) {
\t\t\t\t\t\t\t\t\tvar block = btn.closest('.window-type-block');
\t\t\t\t\t\t\t\t\tif (!block) return;
\t\t\t\t\t\t\t\t\tblock.remove();
\t\t\t\t\t\t\t\t\treindexBlocks();
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction updateRemoveButtonVisibility() {
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b) {
\t\t\t\t\t\t\t\t\t\tvar btn = b.querySelector('.btn-remove-window-type');
\t\t\t\t\t\t\t\t\t\tif (btn) btn.style.display = blocks.length > 1 ? '' : 'none';
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction reindexBlocks() {
\t\t\t\t\t\t\t\t\t// ブロック削除後に 1 から振り直し. input[name] の末尾 _N も書き換える.
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b, i) {
\t\t\t\t\t\t\t\t\t\tvar n = i + 1;
\t\t\t\t\t\t\t\t\t\tb.setAttribute('data-type-idx', String(n));
\t\t\t\t\t\t\t\t\t\tvar numSpan = b.querySelector('.wt-num');
\t\t\t\t\t\t\t\t\t\tif (numSpan) numSpan.textContent = String(n);
\t\t\t\t\t\t\t\t\t\tb.querySelectorAll('input[name]').forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\t\tinp.name = inp.name.replace(/_\\d+\$/, '_' + n);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 軸変更イベント. recalcAll が定義されていれば再計算 (task 2 で実装).
\t\t\t\t\t\t\t\twindow.onWindowTypeAxisChange = function() {
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\twindow.addWindowType = addWindowType;
\t\t\t\t\t\t\t\twindow.removeWindowType = removeWindowType;
\t\t\t\t\t\t\t\t// 隠し radio(opacity:0/pointer-events:none) を label で包む opt-btn は iOS で初回タップの
\t\t\t\t\t\t\t\t// change が不発になりやすい。窓タイプ/住宅区分は label に onclick が無く change 依存だった
\t\t\t\t\t\t\t\t// ため「2回タッチ/選択できない」が発生。click は確実に発火するので委譲 click で選択状態・
\t\t\t\t\t\t\t\t// is-selected・再計算を行う(JSで複製される窓タイプにも委譲で対応)。
\t\t\t\t\t\t\t\tdocument.addEventListener('click', function(ev) {
\t\t\t\t\t\t\t\t\tif (!ev.target || !ev.target.closest) return;
\t\t\t\t\t\t\t\t\tvar label = ev.target.closest('.opt-btn');
\t\t\t\t\t\t\t\t\tif (!label) return;
\t\t\t\t\t\t\t\t\tif (!label.closest('#window-types-container') && !label.closest('#window-housing-type-group')) return;
\t\t\t\t\t\t\t\t\tvar input = label.querySelector('input[type=\"radio\"]');
\t\t\t\t\t\t\t\t\tif (!input || input.disabled) return;
\t\t\t\t\t\t\t\t\tinput.checked = true;
\t\t\t\t\t\t\t\t\tvar nm = input.getAttribute('name');
\t\t\t\t\t\t\t\t\tif (nm) {
\t\t\t\t\t\t\t\t\t\tdocument.querySelectorAll('input[name=\"' + nm + '\"]').forEach(function(i) {
\t\t\t\t\t\t\t\t\t\t\tvar l = i.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (l) l.classList.toggle('is-selected', i.checked);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t// 初期表示で 1 ブロック追加 + 住宅区分ラジオの change で再計算.
\t\t\t\t\t\t\t\tdocument.addEventListener('DOMContentLoaded', function() {
\t\t\t\t\t\t\t\t\tif (document.querySelector('#window-types-container')) {
\t\t\t\t\t\t\t\t\t\taddWindowType();
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tvar housingInputs = document.querySelectorAll('input[name=\"window_housing_type\"]');
\t\t\t\t\t\t\t\t\tvar syncHousingSelectedClass = function() {
\t\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\t\tvar lbl = el.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (!lbl) return;
\t\t\t\t\t\t\t\t\t\t\tif (el.checked) lbl.classList.add('is-selected');
\t\t\t\t\t\t\t\t\t\t\telse lbl.classList.remove('is-selected');
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\tel.addEventListener('change', function() {
\t\t\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t})();
\t\t\t\t\t\t\t</script>
\t\t\t\t\t\t";
}
// line 3964
echo "
\t\t\t\t\t\t<!-- 3: 施工見積(物置・ゴミステーション) -->
\t\t\t\t\t\t";
// line 3966
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3966, $this->source); })()), "SaleType", [], "any", false, false, false, 3966), "id", [], "any", false, false, false, 3966) == 3)) {
// line 3967
echo "
\t\t\t\t\t\t\t";
// line 3969
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3969, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3969, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3969, $this->source); })())) != ""))) {
// line 3970
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅";
// line 3971
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3971, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3971, $this->source); })()), "pw", [], "any", false, false, false, 3971))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3971, $this->source); })()), "pw", [], "any", false, false, false, 3971), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 3973
$context["idx"] = 0;
// line 3974
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3974, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw_val"]) {
if ($context["pw_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3974, $this->source); })()) + 1);
// line 3975
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3975, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3975, $this->source); })()), "pw", [], "any", false, false, false, 3975) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3975, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw3_";
// line 3976
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3976, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw3_";
// line 3977
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3977, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 3978
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3978, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3978, $this->source); })()), "pw", [], "any", false, false, false, 3978) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3978, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3979
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3982
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 3985
echo "
\t\t\t\t\t\t\t";
// line 3986
if ((((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3986, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3986, $this->source); })()))) && (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3986, $this->source); })())) != ""))) {
// line 3987
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">奥行き";
// line 3988
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3988, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3988, $this->source); })()), "pd", [], "any", false, false, false, 3988))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3988, $this->source); })()), "pd", [], "any", false, false, false, 3988), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 3990
$context["idx"] = 0;
// line 3991
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3991, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pd_val"]) {
if ($context["pd_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3991, $this->source); })()) + 1);
// line 3992
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3992, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3992, $this->source); })()), "pd", [], "any", false, false, false, 3992) == $context["pd_val"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3992, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pd','pd3_";
// line 3993
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3993, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pd\" id=\"pd3_";
// line 3994
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3994, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pd_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 3995
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3995, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3995, $this->source); })()), "pd", [], "any", false, false, false, 3995) == $context["pd_val"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3995, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3996
echo twig_escape_filter($this->env, $context["pd_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pd_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3999
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4002
echo "
\t\t\t\t\t\t\t";
// line 4003
if ((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4003, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4003, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4003, $this->source); })())) != ""))) {
// line 4004
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ";
// line 4005
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4005, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4005, $this->source); })()), "ph", [], "any", false, false, false, 4005))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4005, $this->source); })()), "ph", [], "any", false, false, false, 4005), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4007
$context["idx"] = 0;
// line 4008
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4008, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["ph_val"]) {
if ($context["ph_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4008, $this->source); })()) + 1);
// line 4009
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4009, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4009, $this->source); })()), "ph", [], "any", false, false, false, 4009) == $context["ph_val"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4009, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('ph','ph3_";
// line 4010
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4010, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"ph\" id=\"ph3_";
// line 4011
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4011, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["ph_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4012
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4012, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4012, $this->source); })()), "ph", [], "any", false, false, false, 4012) == $context["ph_val"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4012, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4013
echo twig_escape_filter($this->env, $context["ph_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ph_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4016
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4019
echo "
\t\t\t\t\t\t\t";
// line 4021
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4021, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4021, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4021, $this->source); })())) != ""))) {
// line 4022
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">棚タイプ <small class=\"text-muted\">(間仕切り仕様)</small>";
// line 4023
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4023, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4023, $this->source); })()), "pm", [], "any", false, false, false, 4023))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4023, $this->source); })()), "pm", [], "any", false, false, false, 4023), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4025
$context["idx"] = 0;
// line 4026
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4026, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm_val"]) {
if ($context["pm_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4026, $this->source); })()) + 1);
// line 4027
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4027, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4027, $this->source); })()), "pm", [], "any", false, false, false, 4027) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4027, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm3_";
// line 4028
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4028, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm3_";
// line 4029
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4029, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4030
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4030, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4030, $this->source); })()), "pm", [], "any", false, false, false, 4030) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4030, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4031
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4034
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4037
echo "
\t\t\t\t\t\t\t";
// line 4039
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4039, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4039, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4039, $this->source); })())) != ""))) {
// line 4040
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 4041
echo twig_escape_filter($this->env, (isset($context["option1_label"]) || array_key_exists("option1_label", $context) ? $context["option1_label"] : (function () { throw new RuntimeError('Variable "option1_label" does not exist.', 4041, $this->source); })()), "html", null, true);
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4041, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 4041)) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4041, $this->source); })()), "option1", [], "any", false, false, false, 4041))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4041, $this->source); })()), "option1", [], "any", false, false, false, 4041), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4043
$context["idx"] = 0;
// line 4044
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4044, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt1_val"]) {
if ($context["opt1_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4044, $this->source); })()) + 1);
// line 4045
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4045, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 4045)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4045, $this->source); })()), "option1", [], "any", false, false, false, 4045) == $context["opt1_val"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4045, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('option1','option1_3_";
// line 4046
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4046, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"option1\" id=\"option1_3_";
// line 4047
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4047, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt1_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4048
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4048, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 4048)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4048, $this->source); })()), "option1", [], "any", false, false, false, 4048) == $context["opt1_val"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4048, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4049
echo twig_escape_filter($this->env, $context["opt1_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt1_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4052
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4055
echo "
\t\t\t\t\t\t\t";
// line 4057
echo "\t\t\t\t\t\t\t";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4057, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4057, $this->source); })())))) {
// line 4058
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">カラー";
// line 4059
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4059, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4059, $this->source); })()), "pc", [], "any", false, false, false, 4059))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4059, $this->source); })()), "pc", [], "any", false, false, false, 4059), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4061
$context["idx"] = 0;
// line 4062
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4062, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4062))) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4062, $this->source); })()) + 1);
// line 4063
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4063, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4063, $this->source); })()), "pc", [], "any", false, false, false, 4063) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4063))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4063, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pc','cc3_";
// line 4064
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4064, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"color3\" id=\"cc3_";
// line 4065
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4065, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4065), "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4066
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4066, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4066, $this->source); })()), "pc", [], "any", false, false, false, 4066) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4066))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4066, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4067
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4067), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4070
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4073
echo "
\t\t\t\t\t\t\t";
// line 4075
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">台数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"daisu\" id=\"daisu\" class=\"form-control\" value=\"";
// line 4079
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "daisu", [], "any", true, true, false, 4079)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "daisu", [], "any", false, false, false, 4079), "1")) : ("1")), "html", null, true);
echo "\" min=\"1\" max=\"10\" onchange=\"mitsumori_simulation('daisu','daisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">台</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"daisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"daisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4090
echo "
\t\t\t\t\t\t<!-- 4: 施工見積(フェンス・組み立て式) -->
\t\t\t\t\t\t";
// line 4092
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4092, $this->source); })()), "SaleType", [], "any", false, false, false, 4092), "id", [], "any", false, false, false, 4092) == 4)) {
// line 4093
echo "
\t\t\t\t\t\t\t";
// line 4095
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">枚数</label>
\t\t\t\t\t\t\t <div class=\"col-4 mb-3\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"maisu\" id=\"maisu\" class=\"form-control\" value=\"";
// line 4099
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maisu", [], "any", true, true, false, 4099)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maisu", [], "any", false, false, false, 4099), "3")) : ("3")), "html", null, true);
echo "\" min=\"3\" max=\"20\" onchange=\"if(parseInt(this.value)<3)this.value=3; mitsumori_simulation('maisu','maisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">枚</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"maisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"maisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4110
echo "
\t\t\t\t\t\t<!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
\t\t\t\t\t\t";
// line 4112
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4112, $this->source); })()), "SaleType", [], "any", false, false, false, 4112), "id", [], "any", false, false, false, 4112) == 5)) {
// line 4113
echo "
\t\t\t\t\t\t\t";
// line 4115
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ステップ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4118
$context["step_yes_checked"] = (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4118, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 4118)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4118, $this->source); })()), "deck_step", [], "any", false, false, false, 4118) == "必要"));
// line 4119
echo "\t\t\t\t\t\t\t ";
$context["step_no_checked"] = ((( !(isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4119, $this->source); })()) || !twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 4119)) || (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4119, $this->source); })()), "deck_step", [], "any", false, false, false, 4119) == "不要")) || !twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4119, $this->source); })()), "deck_step", [], "any", false, false, false, 4119));
// line 4120
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((isset($context["step_yes_checked"]) || array_key_exists("step_yes_checked", $context) ? $context["step_yes_checked"] : (function () { throw new RuntimeError('Variable "step_yes_checked" does not exist.', 4120, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_yes\" value=\"必要\"
\t\t\t\t\t\t\t ";
// line 4123
if ((isset($context["step_yes_checked"]) || array_key_exists("step_yes_checked", $context) ? $context["step_yes_checked"] : (function () { throw new RuntimeError('Variable "step_yes_checked" does not exist.', 4123, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn";
// line 4126
if ((isset($context["step_no_checked"]) || array_key_exists("step_no_checked", $context) ? $context["step_no_checked"] : (function () { throw new RuntimeError('Variable "step_no_checked" does not exist.', 4126, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_no\" value=\"不要\"
\t\t\t\t\t\t\t ";
// line 4129
if ((isset($context["step_no_checked"]) || array_key_exists("step_no_checked", $context) ? $context["step_no_checked"] : (function () { throw new RuntimeError('Variable "step_no_checked" does not exist.', 4129, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-step\" style=\"font-size:12px;color:#c00;margin-top:6px;";
// line 4133
if ( !(isset($context["step_yes_checked"]) || array_key_exists("step_yes_checked", $context) ? $context["step_yes_checked"] : (function () { throw new RuntimeError('Variable "step_yes_checked" does not exist.', 4133, $this->source); })())) {
echo "display:none;";
}
echo "\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
// line 4139
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">デッキフェンス</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4142
$context["fence_yes_checked"] = (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4142, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 4142)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4142, $this->source); })()), "deck_fence", [], "any", false, false, false, 4142) == "必要"));
// line 4143
echo "\t\t\t\t\t\t\t ";
$context["fence_no_checked"] = ((( !(isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4143, $this->source); })()) || !twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 4143)) || (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4143, $this->source); })()), "deck_fence", [], "any", false, false, false, 4143) == "不要")) || !twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4143, $this->source); })()), "deck_fence", [], "any", false, false, false, 4143));
// line 4144
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((isset($context["fence_yes_checked"]) || array_key_exists("fence_yes_checked", $context) ? $context["fence_yes_checked"] : (function () { throw new RuntimeError('Variable "fence_yes_checked" does not exist.', 4144, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_yes\" value=\"必要\"
\t\t\t\t\t\t\t ";
// line 4147
if ((isset($context["fence_yes_checked"]) || array_key_exists("fence_yes_checked", $context) ? $context["fence_yes_checked"] : (function () { throw new RuntimeError('Variable "fence_yes_checked" does not exist.', 4147, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn";
// line 4150
if ((isset($context["fence_no_checked"]) || array_key_exists("fence_no_checked", $context) ? $context["fence_no_checked"] : (function () { throw new RuntimeError('Variable "fence_no_checked" does not exist.', 4150, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_no\" value=\"不要\"
\t\t\t\t\t\t\t ";
// line 4153
if ((isset($context["fence_no_checked"]) || array_key_exists("fence_no_checked", $context) ? $context["fence_no_checked"] : (function () { throw new RuntimeError('Variable "fence_no_checked" does not exist.', 4153, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-fence\" style=\"font-size:12px;color:#c00;margin-top:6px;";
// line 4157
if ( !(isset($context["fence_yes_checked"]) || array_key_exists("fence_yes_checked", $context) ? $context["fence_yes_checked"] : (function () { throw new RuntimeError('Variable "fence_yes_checked" does not exist.', 4157, $this->source); })())) {
echo "display:none;";
}
echo "\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4163
echo "
\t\t\t\t\t\t<!-- 6: 施工見積(芝生・枚数・数量買い) -->
\t\t\t\t\t\t";
// line 4165
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4165, $this->source); })()), "SaleType", [], "any", false, false, false, 4165), "id", [], "any", false, false, false, 4165) == 6)) {
// line 4166
echo "
\t\t\t\t\t\t\t";
// line 4168
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4168, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4168, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4168, $this->source); })())) != ""))) {
// line 4169
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">規格";
// line 4170
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4170, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4170, $this->source); })()), "pm", [], "any", false, false, false, 4170))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4170, $this->source); })()), "pm", [], "any", false, false, false, 4170), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4172
$context["idx"] = 0;
// line 4173
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4173, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm_val"]) {
if ($context["pm_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4173, $this->source); })()) + 1);
// line 4174
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4174, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4174, $this->source); })()), "pm", [], "any", false, false, false, 4174) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4174, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm6_";
// line 4175
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4175, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm6_";
// line 4176
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4176, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4177
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4177, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4177, $this->source); })()), "pm", [], "any", false, false, false, 4177) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4177, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4178
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4181
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4184
echo "
\t\t\t\t\t\t\t";
// line 4187
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4187, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4187, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4187, $this->source); })())) != ""))) {
// line 4188
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">芝の幅";
// line 4189
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4189, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4189, $this->source); })()), "pw", [], "any", false, false, false, 4189))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4189, $this->source); })()), "pw", [], "any", false, false, false, 4189), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4191
$context["idx"] = 0;
// line 4192
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4192, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw_val"]) {
if ($context["pw_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4192, $this->source); })()) + 1);
// line 4193
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4193, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4193, $this->source); })()), "pw", [], "any", false, false, false, 4193) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4193, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw6_";
// line 4194
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4194, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw6_";
// line 4195
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4195, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4196
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4196, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4196, $this->source); })()), "pw", [], "any", false, false, false, 4196) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4196, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4197
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4200
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4203
echo "
\t\t\t\t\t\t\t";
// line 4205
echo "\t\t\t\t\t\t\t";
$context["_roll_h"] = (((array_key_exists("p_h", $context) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4205, $this->source); })())))) ? (twig_first($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4205, $this->source); })()))) : (""));
// line 4206
echo "\t\t\t\t\t\t\t";
if ((isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4206, $this->source); })())) {
// line 4207
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">1ロールの長さ:<span style=\"font-weight:bold;\">";
// line 4208
if (twig_in_filter("cm", (isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4208, $this->source); })()))) {
echo twig_escape_filter($this->env, (twig_trim_filter(twig_replace_filter((isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4208, $this->source); })()), ["cm" => "", "," => ""])) / 100), "html", null, true);
echo "m";
} else {
echo twig_escape_filter($this->env, (isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4208, $this->source); })()), "html", null, true);
}
echo "</span></div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4211
echo "
\t\t\t\t\t\t\t";
// line 4214
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">施工サイズ</label>
\t\t\t\t\t\t\t <div class=\"col-8\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_len\" id=\"tf_len\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"";
// line 4220
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_len", [], "any", true, true, false, 4220)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_len", [], "any", false, false, false, 4220), "")) : ("")), "html", null, true);
echo "\"
\t\t\t\t\t\t\t placeholder=\"縦\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_len','tf_len');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m ×</span>
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_wid\" id=\"tf_wid\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"";
// line 4226
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_wid", [], "any", true, true, false, 4226)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_wid", [], "any", false, false, false, 4226), "")) : ("")), "html", null, true);
echo "\"
\t\t\t\t\t\t\t placeholder=\"横\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_wid','tf_wid');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 4232
echo "\t\t\t\t\t\t\t <input type=\"hidden\" name=\"area\" id=\"area\" value=\"";
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "area", [], "any", true, true, false, 4232)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "area", [], "any", false, false, false, 4232), "")) : ("")), "html", null, true);
echo "\">
\t\t\t\t\t\t\t ";
// line 4235
echo "\t\t\t\t\t\t\t <div style=\"margin-top:10px;display:inline-block;background:#fff3cd;border:1px solid #ffe69c;border-radius:6px;padding:8px 14px;font-size:16px;color:#c00;font-weight:bold;\">
\t\t\t\t\t\t\t 必要枚数:<input type=\"number\" name=\"tf_qty\" id=\"tf_qty\"
\t\t\t\t\t\t\t value=\"";
// line 4237
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_qty", [], "any", true, true, false, 4237)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_qty", [], "any", false, false, false, 4237), "1")) : ("1")), "html", null, true);
echo "\" min=\"1\" step=\"1\"
\t\t\t\t\t\t\t style=\"width:80px;font-size:22px;font-weight:bold;color:#c00;text-align:right;border:1px solid #ffe69c;border-radius:4px;padding:2px 6px;\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_qty','tf_qty');\"> 枚
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div style=\"margin-top:6px;font-size:12px;color:#666;\">※ 施工サイズを入力すると必要枚数を自動計算します。サイズが分からない場合は枚数を直接ご指定ください。</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4246
echo "
\t\t\t\t\t\t<!-- 7: 施工見積(数量買い・基本工事費固定) -->
\t\t\t\t\t\t";
// line 4248
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4248, $this->source); })()), "SaleType", [], "any", false, false, false, 4248), "id", [], "any", false, false, false, 4248) == 7)) {
// line 4249
echo "\t\t\t\t\t\t\t";
// line 4250
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">個数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"suuryou\" id=\"suuryou\" class=\"form-control\"
\t\t\t\t\t\t\t value=\"";
// line 4255
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "suuryou", [], "any", true, true, false, 4255)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "suuryou", [], "any", false, false, false, 4255), "1")) : ("1")), "html", null, true);
echo "\" min=\"1\" max=\"100\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('suuryou','suuryou');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"suuryou(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"suuryou(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4266
echo "
\t\t\t\t\t\t<!-- 9: 商品のみ購入 -->
\t\t\t\t\t\t";
// line 4268
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4268, $this->source); })()), "SaleType", [], "any", false, false, false, 4268), "id", [], "any", false, false, false, 4268) == 9)) {
// line 4269
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">数量</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"quantity_only\" id=\"quantity_only\" class=\"form-control\" value=\"1\" min=\"1\" onchange=\"\$('#quantity').val(this.value);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"quantityOnly(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"quantityOnly(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4283
echo "
\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">取り付け工事のご希望に関してお答えください。</label></div>
\t\t\t\t\t\t";
// line 4291
echo "\t\t\t\t\t\t";
$context["is_gs"] = false;
// line 4292
echo "\t\t\t\t\t\t";
$context["is_cg"] = false;
// line 4293
echo "\t\t\t\t\t\t";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4293, $this->source); })()), "ProductCategories", [], "any", false, false, false, 4293))) {
// line 4294
echo "\t\t\t\t\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4294, $this->source); })()), "ProductCategories", [], "any", false, false, false, 4294));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 4295
echo "\t\t\t\t\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "category_id", [], "any", false, false, false, 4295) == 27)) {
$context["is_gs"] = true;
}
// line 4296
echo "\t\t\t\t\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "category_id", [], "any", false, false, false, 4296) == 9)) {
$context["is_cg"] = true;
}
// line 4297
echo "\t\t\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4298
echo "\t\t\t\t\t\t";
}
// line 4299
echo "\t\t\t\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(range(0, 10));
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 4300
echo "\t\t\t\t\t\t\t";
if (((isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4300, $this->source); })()) && (twig_length_filter($this->env, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4300, $this->source); })())) >= ($context["i"] + 1)))) {
// line 4301
echo "\t\t\t\t\t\t\t";
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4301, $this->source); })()), $context["i"], [], "array", false, false, false, 4301), "name", [], "array", false, false, false, 4301)) {
// line 4302
echo "\t\t\t\t\t\t\t";
$context["hide_opt"] = false;
// line 4303
echo "\t\t\t\t\t\t\t";
if (((isset($context["is_gs"]) || array_key_exists("is_gs", $context) ? $context["is_gs"] : (function () { throw new RuntimeError('Variable "is_gs" does not exist.', 4303, $this->source); })()) && (preg_match("/撤去/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4303, $this->source); })()), $context["i"], [], "array", false, false, false, 4303), "name", [], "array", false, false, false, 4303)) || preg_match("/残土/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4303, $this->source); })()), $context["i"], [], "array", false, false, false, 4303), "name", [], "array", false, false, false, 4303))))) {
// line 4304
echo "\t\t\t\t\t\t\t\t";
$context["hide_opt"] = true;
// line 4305
echo "\t\t\t\t\t\t\t";
}
// line 4306
echo "\t\t\t\t\t\t\t";
if (((isset($context["is_cg"]) || array_key_exists("is_cg", $context) ? $context["is_cg"] : (function () { throw new RuntimeError('Variable "is_cg" does not exist.', 4306, $this->source); })()) && preg_match("/残土/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4306, $this->source); })()), $context["i"], [], "array", false, false, false, 4306), "name", [], "array", false, false, false, 4306)))) {
// line 4307
echo "\t\t\t\t\t\t\t\t";
$context["hide_opt"] = true;
// line 4308
echo "\t\t\t\t\t\t\t";
}
// line 4309
echo "\t\t\t\t\t\t\t";
if ( !(isset($context["hide_opt"]) || array_key_exists("hide_opt", $context) ? $context["hide_opt"] : (function () { throw new RuntimeError('Variable "hide_opt" does not exist.', 4309, $this->source); })())) {
// line 4310
echo "\t\t\t\t\t\t\t";
// line 4312
echo "\t\t\t\t\t\t\t";
$context["is_removal_unknown"] = (((((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4312), "price", [], "array", true, true, false, 4312)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4312), "price", [], "array", false, false, false, 4312), 0)) : (0)) == 0) || (((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4312), "price", [], "array", true, true, false, 4312)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4312), "price", [], "array", false, false, false, 4312), "0")) : ("0")) == "0")) && ((preg_match("/解体/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 4313
(isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4313, $this->source); })()), $context["i"], [], "array", false, false, false, 4313), "name", [], "array", false, false, false, 4313)) || preg_match("/撤去/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4313, $this->source); })()), $context["i"], [], "array", false, false, false, 4313), "name", [], "array", false, false, false, 4313))) || preg_match("/設置場所/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4313, $this->source); })()), $context["i"], [], "array", false, false, false, 4313), "name", [], "array", false, false, false, 4313))));
// line 4314
echo "\t\t\t\t\t\t\t";
// line 4315
echo "\t\t\t\t\t\t\t";
$context["is_tf_kouji"] = ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4315, $this->source); })()), "SaleType", [], "any", false, false, false, 4315), "id", [], "any", false, false, false, 4315) == 6) && preg_match("/取り付け工事/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4315, $this->source); })()), $context["i"], [], "array", false, false, false, 4315), "name", [], "array", false, false, false, 4315)));
// line 4316
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" data-op-idx=\"";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" data-op-name=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4316, $this->source); })()), $context["i"], [], "array", false, false, false, 4316), "name", [], "array", false, false, false, 4316), "html_attr");
echo "\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 4318
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4318, $this->source); })()), $context["i"], [], "array", false, false, false, 4318), "name", [], "array", false, false, false, 4318), "html", null, true);
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4318, $this->source); })()) && twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4318, $this->source); })()), "op", [], "any", false, false, false, 4318), $context["i"], [], "array", false, false, false, 4318))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4318, $this->source); })()), "op", [], "any", false, false, false, 4318), $context["i"], [], "array", false, false, false, 4318), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t ";
// line 4319
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4319, $this->source); })()), $context["i"], [], "array", false, false, false, 4319), "comment", [], "array", false, false, false, 4319)) {
echo "<div class=\"opt-comment\" style=\"font-size:12px;color:#666;margin:4px 0 6px;\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4319, $this->source); })()), $context["i"], [], "array", false, false, false, 4319), "comment", [], "array", false, false, false, 4319), "html", null, true);
echo "</div>";
}
// line 4320
echo "\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4323
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4323, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4323, $this->source); })()), "op", [], "any", false, false, false, 4323), $context["i"], [], "array", false, false, false, 4323) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4323, $this->source); })()), $context["i"], [], "array", false, false, false, 4323), "on", [], "array", false, false, false, 4323))) || !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4323, $this->source); })()), $context["i"], [], "array", false, false, false, 4323), "off", [], "array", false, false, false, 4323))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op";
// line 4324
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "','op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_1');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op";
// line 4325
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" id=\"op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_1\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4325, $this->source); })()), $context["i"], [], "array", false, false, false, 4325), "on", [], "array", false, false, false, 4325), "html", null, true);
echo "\" ";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4325, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4325, $this->source); })()), "op", [], "any", false, false, false, 4325), $context["i"], [], "array", false, false, false, 4325) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4325, $this->source); })()), $context["i"], [], "array", false, false, false, 4325), "on", [], "array", false, false, false, 4325))) || !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4325, $this->source); })()), $context["i"], [], "array", false, false, false, 4325), "off", [], "array", false, false, false, 4325))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4326
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4326, $this->source); })()), $context["i"], [], "array", false, false, false, 4326), "on", [], "array", false, false, false, 4326), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
// line 4328
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4328, $this->source); })()), $context["i"], [], "array", false, false, false, 4328), "off", [], "array", false, false, false, 4328)) {
// line 4329
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4329, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4329, $this->source); })()), "op", [], "any", false, false, false, 4329), $context["i"], [], "array", false, false, false, 4329) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4329, $this->source); })()), $context["i"], [], "array", false, false, false, 4329), "off", [], "array", false, false, false, 4329)))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op";
// line 4330
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "','op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_2');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op";
// line 4331
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" id=\"op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_2\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4331, $this->source); })()), $context["i"], [], "array", false, false, false, 4331), "off", [], "array", false, false, false, 4331), "html", null, true);
echo "\" ";
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4331, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4331, $this->source); })()), "op", [], "any", false, false, false, 4331), $context["i"], [], "array", false, false, false, 4331) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4331, $this->source); })()), $context["i"], [], "array", false, false, false, 4331), "off", [], "array", false, false, false, 4331)))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4332
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4332, $this->source); })()), $context["i"], [], "array", false, false, false, 4332), "off", [], "array", false, false, false, 4332), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
// line 4335
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 4336
if (((isset($context["is_removal_unknown"]) || array_key_exists("is_removal_unknown", $context) ? $context["is_removal_unknown"] : (function () { throw new RuntimeError('Variable "is_removal_unknown" does not exist.', 4336, $this->source); })()) || (isset($context["is_tf_kouji"]) || array_key_exists("is_tf_kouji", $context) ? $context["is_tf_kouji"] : (function () { throw new RuntimeError('Variable "is_tf_kouji" does not exist.', 4336, $this->source); })()))) {
// line 4337
echo "\t\t\t\t\t\t\t <div class=\"opt-survey-note\" data-op-idx=\"";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" style=\"font-size:12px;color:#c00;margin-top:6px;";
if ( !((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4337, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4337, $this->source); })()), "op", [], "any", false, false, false, 4337), $context["i"], [], "array", false, false, false, 4337) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4337, $this->source); })()), $context["i"], [], "array", false, false, false, 4337), "on", [], "array", false, false, false, 4337)))) {
echo "display:none;";
}
echo "\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4341
echo "\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4343
echo "\t\t\t\t\t\t\t";
}
// line 4344
echo "\t\t\t\t\t\t\t";
}
// line 4345
echo "\t\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4346
echo "
\t\t\t\t\t\t";
// line 4350
echo "\t\t\t\t\t\t";
if ((((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4350, $this->source); })()), "SaleType", [], "any", false, false, false, 4350), "id", [], "any", false, false, false, 4350) == 4) && (isset($context["oi"]) || array_key_exists("oi", $context) ? $context["oi"] : (function () { throw new RuntimeError('Variable "oi" does not exist.', 4350, $this->source); })())) && twig_get_attribute($this->env, $this->source, (isset($context["oi"]) || array_key_exists("oi", $context) ? $context["oi"] : (function () { throw new RuntimeError('Variable "oi" does not exist.', 4350, $this->source); })()), "fe_block", [], "any", false, false, false, 4350))) {
// line 4351
echo "\t\t\t\t\t\t<div id=\"fe-block-options\" class=\"form-group mt-3 pb-3\" style=\"display:none;border-bottom:1px solid rgba(0,0,0,.125)\"></div>
\t\t\t\t\t\t";
}
// line 4353
echo "
\t\t\t\t\t </div>
\t\t\t\t\t <!-- /.card-body -->
\t\t\t\t\t</div>
<form action=\"";
// line 4359
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_cart", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4359, $this->source); })()), "id", [], "any", false, false, false, 4359)]), "html", null, true);
echo "\" method=\"post\" id=\"form1\" name=\"form1\">
";
// line 4360
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4360, $this->source); })()), "stock_find", [], "any", false, false, false, 4360)) {
// line 4361
echo " <div class=\"ec-productRole__actions\">
";
// line 4362
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 4362)) {
// line 4363
echo " <div class=\"ec-select\">
";
// line 4364
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4364, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 4364), 'row');
echo "
";
// line 4365
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4365, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 4365), 'errors');
echo "
</div>
";
// line 4367
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 4367)) {
// line 4368
echo " <div class=\"ec-select\">
";
// line 4369
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4369, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 4369), 'row');
echo "
";
// line 4370
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4370, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 4370), 'errors');
echo "
</div>
";
}
// line 4373
echo " ";
}
// line 4374
echo " <div class=\"ec-numberInput\">
";
// line 4375
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4375, $this->source); })()), "quantity", [], "any", false, false, false, 4375), 'widget', ["type" => "hidden"]);
echo "
";
// line 4376
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4376, $this->source); })()), "quantity", [], "any", false, false, false, 4376), 'errors');
echo "
</div>
</div>
";
} else {
// line 4381
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
";
// line 4383
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ただいま品切れ中です。"), "html", null, true);
echo "
</button>
</div>
";
}
// line 4387
echo " <div class=\"ec-productRole__btn mt-3\">
<button type=\"submit\" id=\"cart_btn\" class=\"ec-blockBtn--action add-cart\">カートに入れる</button>
</div>
";
// line 4390
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4390, $this->source); })()), 'rest');
echo "
</form>
<div class=\"ec-modal add-cart-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap add-cart-modal__wrap\">
<span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"";
// line 4395
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross-dark.svg"), "html", null, true);
echo "\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center add-cart-modal__header\">";
// line 4396
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "</div>
<div class=\"ec-modal-box add-cart-modal__box\">
<div class=\"ec-role add-cart-modal__actions\">
<a href=\"";
// line 4399
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\" class=\"ec-inlineBtn--action add-cart-modal__primary\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに進む"), "html", null, true);
echo "</a>
<span class=\"ec-inlineBtn--cancel add-cart-modal__secondary\">";
// line 4400
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品検索を続ける"), "html", null, true);
echo "</span>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-productRole__description\">";
// line 4406
echo twig_nl2br(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4406, $this->source); })()), "description_detail", [], "any", false, false, false, 4406));
echo "
</div>
";
// line 4410
echo " <div class=\"ec-productRole__share\">
<ul class=\"ec-share\">
<li class=\"ec-share__item\">
<a href=\"https://twitter.com/share?url=";
// line 4413
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4413, $this->source); })()), "request", [], "any", false, false, false, 4413), "uri", [], "any", false, false, false, 4413)), "html", null, true);
echo "&text=";
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4413, $this->source); })()), "name", [], "any", false, false, false, 4413)), "html", null, true);
echo "\" class=\"ec-share__link ec-share__link--twitter\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-twitter\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://www.facebook.com/sharer/sharer.php?u=";
// line 4418
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4418, $this->source); })()), "request", [], "any", false, false, false, 4418), "uri", [], "any", false, false, false, 4418)), "html", null, true);
echo "\" class=\"ec-share__link ec-share__link--facebook\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-facebook-f\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://social-plugins.line.me/lineit/share?url=";
// line 4423
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4423, $this->source); })()), "request", [], "any", false, false, false, 4423), "uri", [], "any", false, false, false, 4423)), "html", null, true);
echo "\" class=\"ec-share__link ec-share__link--line\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-line\"></i>
</a>
</li>
</ul>
</div>
</div>
\t\t\t\t";
// line 4431
echo "\t\t\t\t<div id=\"sp-mitsumori-bar\">
\t\t\t\t <div class=\"sp-bar__pricewrap\">
\t\t\t\t <div class=\"sp-bar__label\">合計(工事費・税込)</div>
\t\t\t\t <div class=\"sp-bar__price\" id=\"sp-mitsumori-price\">---円</div>
\t\t\t\t </div>
\t\t\t\t <button type=\"button\" class=\"sp-bar__detail-btn\"
\t\t\t\t onclick=\"openSpMitsumoriDetail();\" title=\"お見積りの詳細(内訳)を表示\">
\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t <span>詳細</span>
\t\t\t\t </button>
\t\t\t\t <button type=\"button\" class=\"sp-bar__btn\"
\t\t\t\t onclick=\"document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">
\t\t\t\t <i class=\"fas fa-shopping-cart\"></i>
\t\t\t\t <span class=\"sp-bar__btn-label\">カートへ</span>
\t\t\t\t ";
// line 4445
$context["spTotalQty"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_quantity();
// line 4446
echo "\t\t\t\t ";
if (((isset($context["spTotalQty"]) || array_key_exists("spTotalQty", $context) ? $context["spTotalQty"] : (function () { throw new RuntimeError('Variable "spTotalQty" does not exist.', 4446, $this->source); })()) > 0)) {
// line 4447
echo "\t\t\t\t <span class=\"sp-bar__cart-badge\">";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, (isset($context["spTotalQty"]) || array_key_exists("spTotalQty", $context) ? $context["spTotalQty"] : (function () { throw new RuntimeError('Variable "spTotalQty" does not exist.', 4447, $this->source); })())), "html", null, true);
echo "</span>
\t\t\t\t ";
}
// line 4449
echo "\t\t\t\t </button>
\t\t\t\t <a href=\"";
// line 4450
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("homepage");
echo "\" class=\"sp-bar__home-btn\" title=\"トップページへ\">
\t\t\t\t <i class=\"fas fa-home\"></i>
\t\t\t\t </a>
\t\t\t\t</div>
\t\t\t\t";
// line 4456
echo "\t\t\t\t";
// line 4458
echo "\t\t\t\t<div id=\"sp-mitsumori-detail\" class=\"sp-detail-sheet\" aria-hidden=\"true\">
\t\t\t\t <div class=\"sp-detail-sheet__overlay\" onclick=\"closeSpMitsumoriDetail();\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__panel\" role=\"dialog\" aria-label=\"お見積りの詳細\">
\t\t\t\t <div class=\"sp-detail-sheet__header\">
\t\t\t\t <span class=\"sp-detail-sheet__title\">お見積りの詳細</span>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__close\" onclick=\"closeSpMitsumoriDetail();\" aria-label=\"閉じる\">×</button>
\t\t\t\t </div>
\t\t\t\t <div class=\"sp-detail-sheet__body\" id=\"sp-detail-body\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__footer\">
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__invoice\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('mitsumori_btn') && document.getElementById('mitsumori_btn').click();\">見積書を表示</button>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__cart\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">カートに入れる</button>
\t\t\t\t </div>
\t\t\t\t </div>
\t\t\t\t</div>
\t\t\t\t";
// line 4476
echo "\t\t\t\t<div id=\"tg-options\" class=\"tg-options-container col-12\"></div>
\t\t\t\t<div class=\"card col-12 collapsed-card sticky-top float-right mitsumori-card-pc\">
\t\t\t\t\t<div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">現在のお見積り額</h3>
\t\t\t\t\t <div class=\"card-tools\">
\t\t\t\t\t <span class=\"float-left\" id=\"mitsumori_message\">395000円</span>
\t\t\t\t\t <button type=\"button\" class=\"btn btn-tool btn-mitsumori-toggle\" data-card-widget=\"collapse\" title=\"詳細を表示\">
\t\t\t\t\t <span class=\"toggle-icon\">▼ 詳細</span>
\t\t\t\t\t </button>
\t\t\t\t\t </div>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-body p-0\">
\t\t\t\t\t <ul class=\"nav nav-pills flex-column\">
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 合計(工事費・税込)
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_goukei\">395,000円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 商品価格
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_price\">307,008円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4503
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4503, $this->source); })()), "SaleType", [], "any", false, false, false, 4503), "id", [], "any", false, false, false, 4503) != 2)) {
// line 4504
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> カタログ価格
\t\t\t\t\t <span class=\"float-right\" id=\"maker_price\">479,700円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
} else {
// line 4511
echo "\t\t\t\t\t ";
// line 4512
echo "\t\t\t\t\t <span id=\"maker_price\" style=\"display:none;\">---円</span>
\t\t\t\t\t ";
}
// line 4514
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t\t ";
// line 4517
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4517, $this->source); })()), "SaleType", [], "any", false, false, false, 4517), "id", [], "any", false, false, false, 4517) == 2)) {
echo "補助金(割引額)";
} else {
echo "お値引き";
}
// line 4518
echo "\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_off\">-172,692円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4522
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4522, $this->source); })()), "SaleType", [], "any", false, false, false, 4522), "id", [], "any", false, false, false, 4522) == 2)) {
// line 4523
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <div style=\"padding:4px 12px 8px;color:#6c757d;font-size:11px;line-height:1.4;\">
\t\t\t\t\t ※当店が補助金事業者として申請代行し、契約代金に充当します
\t\t\t\t\t </div>
\t\t\t\t\t </li>
\t\t\t\t\t ";
}
// line 4529
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 基本工事費
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_ct\">53,250円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 施工オプション
\t\t\t\t\t <span class=\"float-right\"id=\"mitsumori_option\">6,297円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t </ul>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-footer\">
\t\t <button type=\"button\" id=\"mitsumori_btn\" class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#modal-mitsumori\">
\t\t 見積書表示
\t\t </button>
<button type=\"submit\" id=\"cart_btn2\" class=\"btn btn-info add-cart\">カートに入れる</button>
\t\t\t\t\t</div>
\t\t\t\t</div>
</div>
</div>
</div>
<div class=\"modal\" id=\"modal-mitsumori\">
<div class=\"modal-dialog modal-mitsumori\" style=\"max-width:1000px\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h4 class=\"modal-title\">お見積書</h4>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">×</span>
</button>
</div>
<div class=\"modal-body\">
\t\t\t<div class=\"invoice p-3 mb-5\" style=\"max-width:1000px; margin:auto;\">
\t\t\t <!-- title row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12\">
\t\t\t <h2>概算お見積書
\t\t\t <small class=\"float-right\" style=\"font-size:14px;\">発行日: 2025/03/14</small>
\t\t\t </h2>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- info row -->
\t\t\t <div class=\"row invoice-info\">
\t\t\t <div class=\"col-sm-8 invoice-col\">
\t\t\t <h3>お客様</h3>
\t\t\t <span>下記の通り、お見積もり申し上げます。</span>
\t\t\t <br />
\t\t\t <br / >
\t\t\t <br />
\t\t\t <h2>お見積金額: <span id=\"mitsumori_kei\">399,080円</span></h2>
\t\t\t <span>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t </span>
\t\t\t </div>
\t\t\t <div class=\"col-sm-4 invoice-col\">
\t\t\t <p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/logo.png\" style=\"width: 260px; max-width: 100%; max-height: 10mm;\">
\t\t\t </p>
\t\t\t <p>有限会社プラス</p>
\t\t\t <p>〒400-0334</p>
\t\t\t <p>山梨県南アルプス市藤田1450番地2</p>
\t\t\t <p>TEL: 055-284-6480</p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/seal.svg\" style=\"z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;\">
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <!-- Table row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12 table-responsive\">
\t\t\t <table class=\"table table-striped\">
\t\t\t <thead>
\t\t\t <tr>
\t\t\t <th>項目</th>
\t\t\t <th>数量</th>
\t\t\t <th>単位</th>
\t\t\t <th>単価</th>
\t\t\t <th>小計</th>
\t\t\t </tr>
\t\t\t </thead>
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <td id=\"mitsumori_item_name\">";
// line 4622
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4622, $this->source); })()), "name", [], "any", false, false, false, 4622), "html", null, true);
echo "</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_price_01\">352,800</td>
\t\t\t <td id=\"mitsumori_price_02\">352,800</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>基本工事費</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_ct_01\">10,000</td>
\t\t\t <td id=\"mitsumori_ct_02\">10,000</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>残土・ガラ処理</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td>0円</td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td> </td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <div class=\"row\">
\t\t\t <!-- accepted payments column -->
\t\t\t <div class=\"col-6\">
\t\t\t <p class=\"lead\">お支払い方法</p>
\t\t\t <p class=\"text-muted well well-sm shadow-none\" style=\"margin-top: 10px;\">銀行振込、クレジットカード決済、PAYPAY決済
\t\t\t <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
\t\t\t <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。
\t\t\t </p>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <div class=\"col-6\">
\t\t\t <div class=\"table-responsive\">
\t\t\t <table class=\"table\">
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <th style=\"width:50%\">小計:</th>
\t\t\t <td id=\"mitsumori_shoukei\">362,800</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>消費税 (10%)</th>
\t\t\t <td id=\"mitsumori_tax\">36,280</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>合計:</th>
\t\t\t <td id=\"mitsumori_goukei_02\">399,080</td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t</div>
</div>
<div class=\"modal-footer justify-content-between\">
\t\t\t ";
// line 4692
echo "\t\t\t <form method=\"post\" action=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mitsumori_pdf");
echo "\" target=\"_blank\" id=\"pdf_download_form\">
\t\t\t <input type=\"hidden\" name=\"_token\" value=\"";
// line 4693
echo twig_escape_filter($this->env, $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken("mitsumori_pdf"), "html", null, true);
echo "\">
\t\t\t <input type=\"hidden\" name=\"mitsumori_json\" id=\"pdf_mitsumori_json\">
\t\t\t <button type=\"submit\" class=\"btn btn-primary float-right\" style=\"margin-right: 5px;\" onclick=\"syncPdfJson();\">
\t\t\t <i class=\"fas fa-download\"></i>PDF出力
\t\t\t </button>
\t\t\t </form>
<button type=\"submit\" id=\"cart_btn3\" class=\"btn btn-info add-cart\">カートに入れる</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Image zoom modal: custom lightweight lightbox (no CDN dependency) -->
<div id=\"img-modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"画像拡大\">
<button id=\"img-modal__close\" aria-label=\"閉じる\">×</button>
<button id=\"img-modal__prev\" aria-label=\"前の画像\">❮</button>
<img id=\"img-modal__img\" src=\"\" alt=\"\">
<button id=\"img-modal__next\" aria-label=\"次の画像\">❯</button>
</div>
<style>
#img-modal {
display: none;
position: fixed;
inset: 0;
z-index: 9999;
background: rgba(0,0,0,0.88);
align-items: center;
justify-content: center;
cursor: zoom-out;
}
#img-modal.is-open { display: flex; }
#img-modal__img {
max-width: 92vw;
max-height: 88vh;
object-fit: contain;
border-radius: 4px;
cursor: default;
user-select: none;
touch-action: pinch-zoom;
display: block;
}
#img-modal__close {
position: absolute;
top: 14px;
right: 18px;
font-size: 38px;
color: #fff;
cursor: pointer;
background: none;
border: none;
padding: 0;
line-height: 1;
z-index: 1;
opacity: 0.85;
}
#img-modal__close:hover { opacity: 1; }
#img-modal__prev,
#img-modal__next {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 36px;
color: #fff;
cursor: pointer;
background: rgba(0,0,0,0.32);
border: none;
padding: 10px 16px;
line-height: 1;
border-radius: 6px;
z-index: 1;
opacity: 0.8;
user-select: none;
}
#img-modal__prev:hover, #img-modal__next:hover { opacity: 1; }
#img-modal__prev { left: 12px; }
#img-modal__next { right: 12px; }
@media (max-width: 767px) {
#img-modal__prev, #img-modal__next { font-size: 28px; padding: 8px 12px; }
}
</style>
<script>
(function(){
var images = [];
var current = 0;
// Collect original (non-cloned) slide images at click time.
// After Slick init, slides are wrapped in .slick-slide; clones have .slick-cloned.
function collectImages() {
images = [];
var \$slides = \$('.item_visual .slick-slide:not(.slick-cloned)');
if (!\$slides.length) {
// Slick not yet initialized (fallback)
\$slides = \$('.item_visual .slide-item');
}
\$slides.each(function() {
var \$a = \$(this).find('a.js-zoom');
if (\$a.length) {
images.push({ src: \$a.attr('href'), alt: \$a.find('img').attr('alt') || '' });
}
});
}
function showImage(idx) {
current = ((idx % images.length) + images.length) % images.length;
\$('#img-modal__img').attr({ src: images[current].src, alt: images[current].alt });
}
function openModal(href) {
collectImages();
if (!images.length) return;
var idx = 0;
for (var i = 0; i < images.length; i++) {
if (images[i].src === href) { idx = i; break; }
}
showImage(idx);
\$('#img-modal').addClass('is-open');
\$('body').css('overflow', 'hidden');
}
function closeModal() {
\$('#img-modal').removeClass('is-open');
\$('body').css('overflow', '');
}
// Click handler: works for both original and Slick-cloned anchors
\$(document).on('click', '.item_visual a.js-zoom', function(e) {
e.preventDefault();
openModal(\$(this).attr('href'));
});
// Close on backdrop click
\$('#img-modal').on('click', function(e) {
if (e.target === this) closeModal();
});
\$('#img-modal__close').on('click', closeModal);
\$('#img-modal__prev').on('click', function(e) { e.stopPropagation(); showImage(current - 1); });
\$('#img-modal__next').on('click', function(e) { e.stopPropagation(); showImage(current + 1); });
// Keyboard navigation
\$(document).on('keydown', function(e) {
if (!\$('#img-modal').hasClass('is-open')) return;
if (e.key === 'Escape') closeModal();
if (e.key === 'ArrowLeft') showImage(current - 1);
if (e.key === 'ArrowRight') showImage(current + 1);
});
// Touch swipe (horizontal only)
var _tx = 0;
var \$modal = document.getElementById('img-modal');
\$modal.addEventListener('touchstart', function(e) {
_tx = e.changedTouches[0].clientX;
}, { passive: true });
\$modal.addEventListener('touchend', function(e) {
var dx = e.changedTouches[0].clientX - _tx;
if (Math.abs(dx) > 48) {
dx < 0 ? showImage(current + 1) : showImage(current - 1);
}
}, { passive: true });
})();
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "Product/detail.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 7123 => 4693, 7118 => 4692, 7046 => 4622, 6951 => 4529, 6943 => 4523, 6940 => 4522, 6935 => 4518, 6929 => 4517, 6924 => 4514, 6920 => 4512, 6918 => 4511, 6909 => 4504, 6906 => 4503, 6878 => 4476, 6859 => 4458, 6857 => 4456, 6849 => 4450, 6846 => 4449, 6840 => 4447, 6837 => 4446, 6835 => 4445, 6819 => 4431, 6809 => 4423, 6801 => 4418, 6791 => 4413, 6786 => 4410, 6780 => 4406, 6771 => 4400, 6765 => 4399, 6759 => 4396, 6755 => 4395, 6747 => 4390, 6742 => 4387, 6735 => 4383, 6731 => 4381, 6723 => 4376, 6719 => 4375, 6716 => 4374, 6713 => 4373, 6707 => 4370, 6703 => 4369, 6700 => 4368, 6698 => 4367, 6693 => 4365, 6689 => 4364, 6686 => 4363, 6684 => 4362, 6681 => 4361, 6679 => 4360, 6675 => 4359, 6667 => 4353, 6663 => 4351, 6660 => 4350, 6657 => 4346, 6651 => 4345, 6648 => 4344, 6645 => 4343, 6641 => 4341, 6629 => 4337, 6627 => 4336, 6624 => 4335, 6618 => 4332, 6606 => 4331, 6600 => 4330, 6593 => 4329, 6591 => 4328, 6586 => 4326, 6574 => 4325, 6568 => 4324, 6561 => 4323, 6558 => 4320, 6552 => 4319, 6543 => 4318, 6535 => 4316, 6532 => 4315, 6530 => 4314, 6528 => 4313, 6526 => 4312, 6524 => 4310, 6521 => 4309, 6518 => 4308, 6515 => 4307, 6512 => 4306, 6509 => 4305, 6506 => 4304, 6503 => 4303, 6500 => 4302, 6497 => 4301, 6494 => 4300, 6489 => 4299, 6486 => 4298, 6480 => 4297, 6475 => 4296, 6470 => 4295, 6465 => 4294, 6462 => 4293, 6459 => 4292, 6456 => 4291, 6449 => 4283, 6433 => 4269, 6431 => 4268, 6427 => 4266, 6413 => 4255, 6406 => 4250, 6404 => 4249, 6402 => 4248, 6398 => 4246, 6386 => 4237, 6382 => 4235, 6377 => 4232, 6369 => 4226, 6360 => 4220, 6352 => 4214, 6349 => 4211, 6338 => 4208, 6335 => 4207, 6332 => 4206, 6329 => 4205, 6326 => 4203, 6321 => 4200, 6311 => 4197, 6305 => 4196, 6299 => 4195, 6295 => 4194, 6288 => 4193, 6281 => 4192, 6279 => 4191, 6270 => 4189, 6267 => 4188, 6264 => 4187, 6261 => 4184, 6256 => 4181, 6246 => 4178, 6240 => 4177, 6234 => 4176, 6230 => 4175, 6223 => 4174, 6216 => 4173, 6214 => 4172, 6205 => 4170, 6202 => 4169, 6199 => 4168, 6196 => 4166, 6194 => 4165, 6190 => 4163, 6179 => 4157, 6170 => 4153, 6162 => 4150, 6154 => 4147, 6145 => 4144, 6142 => 4143, 6140 => 4142, 6135 => 4139, 6125 => 4133, 6116 => 4129, 6108 => 4126, 6100 => 4123, 6091 => 4120, 6088 => 4119, 6086 => 4118, 6081 => 4115, 6078 => 4113, 6076 => 4112, 6072 => 4110, 6058 => 4099, 6052 => 4095, 6049 => 4093, 6047 => 4092, 6043 => 4090, 6029 => 4079, 6023 => 4075, 6020 => 4073, 6015 => 4070, 6005 => 4067, 5999 => 4066, 5993 => 4065, 5989 => 4064, 5982 => 4063, 5975 => 4062, 5973 => 4061, 5964 => 4059, 5961 => 4058, 5958 => 4057, 5955 => 4055, 5950 => 4052, 5940 => 4049, 5934 => 4048, 5928 => 4047, 5924 => 4046, 5917 => 4045, 5910 => 4044, 5908 => 4043, 5898 => 4041, 5895 => 4040, 5892 => 4039, 5889 => 4037, 5884 => 4034, 5874 => 4031, 5868 => 4030, 5862 => 4029, 5858 => 4028, 5851 => 4027, 5844 => 4026, 5842 => 4025, 5833 => 4023, 5830 => 4022, 5827 => 4021, 5824 => 4019, 5819 => 4016, 5809 => 4013, 5803 => 4012, 5797 => 4011, 5793 => 4010, 5786 => 4009, 5779 => 4008, 5777 => 4007, 5768 => 4005, 5765 => 4004, 5763 => 4003, 5760 => 4002, 5755 => 3999, 5745 => 3996, 5739 => 3995, 5733 => 3994, 5729 => 3993, 5722 => 3992, 5715 => 3991, 5713 => 3990, 5704 => 3988, 5701 => 3987, 5699 => 3986, 5696 => 3985, 5691 => 3982, 5681 => 3979, 5675 => 3978, 5669 => 3977, 5665 => 3976, 5658 => 3975, 5651 => 3974, 5649 => 3973, 5640 => 3971, 5637 => 3970, 5634 => 3969, 5631 => 3967, 5629 => 3966, 5625 => 3964, 5495 => 3836, 5478 => 3820, 5475 => 3818, 5470 => 3815, 5462 => 3813, 5456 => 3811, 5451 => 3809, 5443 => 3807, 5441 => 3806, 5437 => 3805, 5430 => 3804, 5427 => 3803, 5422 => 3802, 5417 => 3799, 5414 => 3798, 5411 => 3796, 5405 => 3792, 5395 => 3789, 5391 => 3788, 5388 => 3787, 5383 => 3786, 5378 => 3783, 5375 => 3782, 5372 => 3780, 5364 => 3777, 5354 => 3769, 5351 => 3768, 5348 => 3766, 5340 => 3763, 5330 => 3755, 5327 => 3754, 5324 => 3752, 5319 => 3749, 5309 => 3746, 5305 => 3745, 5302 => 3744, 5297 => 3743, 5292 => 3740, 5289 => 3739, 5280 => 3731, 5255 => 3710, 5245 => 3705, 5234 => 3696, 5231 => 3695, 5221 => 3686, 5218 => 3682, 5215 => 3678, 5213 => 3677, 5209 => 3675, 5206 => 3674, 5204 => 3673, 5200 => 3671, 5195 => 3668, 5185 => 3665, 5179 => 3664, 5173 => 3663, 5169 => 3662, 5162 => 3661, 5155 => 3660, 5153 => 3659, 5143 => 3657, 5140 => 3656, 5137 => 3655, 5134 => 3653, 5129 => 3650, 5119 => 3647, 5113 => 3646, 5107 => 3645, 5103 => 3644, 5096 => 3643, 5089 => 3642, 5087 => 3641, 5077 => 3639, 5074 => 3638, 5071 => 3637, 5068 => 3632, 5063 => 3629, 5053 => 3626, 5047 => 3625, 5041 => 3624, 5037 => 3623, 5030 => 3622, 5023 => 3621, 5021 => 3620, 5007 => 3618, 5004 => 3617, 5001 => 3616, 4998 => 3614, 4993 => 3611, 4983 => 3608, 4977 => 3607, 4971 => 3606, 4967 => 3605, 4960 => 3604, 4953 => 3603, 4951 => 3602, 4942 => 3600, 4939 => 3599, 4936 => 3598, 4933 => 3595, 4928 => 3592, 4918 => 3589, 4912 => 3588, 4906 => 3587, 4902 => 3586, 4895 => 3585, 4888 => 3584, 4886 => 3583, 4877 => 3581, 4874 => 3580, 4872 => 3579, 4869 => 3578, 4864 => 3575, 4854 => 3572, 4848 => 3571, 4842 => 3570, 4838 => 3569, 4831 => 3568, 4824 => 3567, 4822 => 3566, 4813 => 3564, 4810 => 3563, 4807 => 3562, 4804 => 3557, 4799 => 3554, 4791 => 3552, 4785 => 3550, 4780 => 3548, 4772 => 3546, 4770 => 3545, 4764 => 3544, 4758 => 3543, 4754 => 3542, 4744 => 3541, 4741 => 3540, 4734 => 3539, 4732 => 3538, 4723 => 3536, 4720 => 3535, 4717 => 3534, 4714 => 3532, 4710 => 3530, 4707 => 3529, 4705 => 3527, 4704 => 3526, 4703 => 3525, 4702 => 3524, 4701 => 3523, 4700 => 3522, 4699 => 3521, 4698 => 3520, 4696 => 3519, 4693 => 3518, 4687 => 3517, 4684 => 3516, 4679 => 3515, 4674 => 3514, 4669 => 3513, 4666 => 3512, 4663 => 3511, 4658 => 3510, 4655 => 3509, 4652 => 3508, 4649 => 3507, 4643 => 3506, 4638 => 3505, 4633 => 3504, 4628 => 3503, 4625 => 3502, 4622 => 3501, 4619 => 3500, 4615 => 3491, 4611 => 3489, 4607 => 3487, 4598 => 3484, 4589 => 3483, 4585 => 3482, 4582 => 3481, 4580 => 3480, 4576 => 3478, 4567 => 3475, 4563 => 3474, 4559 => 3473, 4549 => 3471, 4545 => 3470, 4542 => 3469, 4540 => 3468, 4538 => 3467, 4529 => 3466, 4526 => 3465, 4523 => 3464, 4520 => 3462, 4516 => 3460, 4512 => 3458, 4503 => 3455, 4494 => 3454, 4490 => 3453, 4487 => 3452, 4483 => 3450, 4474 => 3447, 4467 => 3443, 4463 => 3442, 4453 => 3440, 4449 => 3439, 4446 => 3438, 4444 => 3437, 4435 => 3436, 4432 => 3435, 4429 => 3434, 4426 => 3432, 4422 => 3430, 4418 => 3428, 4409 => 3425, 4400 => 3424, 4396 => 3423, 4393 => 3422, 4389 => 3420, 4380 => 3417, 4373 => 3413, 4369 => 3412, 4359 => 3410, 4355 => 3409, 4352 => 3408, 4350 => 3407, 4341 => 3406, 4338 => 3405, 4335 => 3404, 4332 => 3402, 4328 => 3400, 4324 => 3398, 4315 => 3395, 4306 => 3394, 4302 => 3393, 4299 => 3392, 4297 => 3391, 4293 => 3389, 4284 => 3386, 4277 => 3382, 4273 => 3381, 4263 => 3379, 4259 => 3378, 4256 => 3377, 4254 => 3376, 4252 => 3375, 4243 => 3374, 4240 => 3373, 4237 => 3372, 4234 => 3370, 4230 => 3368, 4227 => 3367, 4225 => 3366, 4224 => 3365, 4223 => 3364, 4221 => 3363, 4218 => 3362, 4215 => 3361, 4212 => 3360, 4209 => 3359, 4206 => 3358, 4203 => 3357, 4200 => 3356, 4197 => 3355, 4195 => 3354, 4193 => 3353, 4181 => 3344, 4174 => 3339, 4162 => 3336, 4159 => 3335, 4156 => 3334, 4153 => 3332, 4142 => 3330, 4138 => 3329, 4135 => 3328, 4132 => 3326, 4126 => 3323, 4122 => 3322, 4119 => 3321, 4116 => 3320, 4110 => 3317, 4104 => 3316, 4101 => 3315, 4095 => 3312, 4091 => 3311, 4088 => 3310, 4086 => 3309, 4084 => 3308, 4080 => 3306, 4078 => 3305, 4074 => 3303, 4068 => 3302, 4063 => 3299, 4048 => 3297, 4039 => 3296, 4022 => 3295, 4018 => 3293, 4015 => 3292, 4011 => 3291, 4008 => 3290, 4005 => 3289, 4002 => 3288, 3989 => 3277, 3975 => 3265, 3969 => 3260, 3950 => 3258, 3933 => 3257, 3929 => 3255, 3918 => 3253, 3895 => 3249, 3889 => 3248, 3886 => 3247, 3868 => 3246, 3865 => 3245, 3861 => 3243, 3853 => 3239, 3845 => 3235, 3843 => 3234, 3840 => 3233, 3838 => 3232, 3828 => 3225, 3816 => 3218, 3811 => 3216, 3807 => 3214, 3801 => 3209, 3798 => 3208, 3792 => 3207, 3787 => 3206, 3782 => 3205, 3775 => 3204, 3769 => 3203, 3764 => 3202, 3761 => 3201, 3758 => 3200, 3756 => 3197, 3753 => 3196, 3750 => 3195, 3748 => 3194, 3738 => 3193, 3722 => 3186, 3718 => 3185, 3714 => 3184, 3710 => 3183, 3706 => 3181, 3700 => 3179, 3698 => 3178, 3693 => 3177, 3690 => 3176, 3680 => 3174, 3666 => 3172, 3658 => 3171, 3640 => 3170, 3635 => 3168, 3505 => 3045, 3497 => 3044, 3433 => 2983, 3333 => 2886, 3329 => 2885, 3313 => 2872, 3145 => 2706, 3142 => 2705, 3129 => 2704, 3126 => 2703, 3124 => 2702, 3121 => 2701, 3118 => 2700, 3105 => 2699, 3102 => 2698, 3099 => 2697, 3096 => 2695, 3093 => 2694, 3080 => 2693, 3077 => 2692, 3075 => 2691, 3072 => 2690, 3069 => 2689, 3056 => 2688, 3053 => 2687, 3051 => 2686, 3048 => 2685, 3045 => 2684, 3032 => 2683, 3029 => 2682, 3027 => 2681, 3024 => 2680, 3021 => 2679, 3008 => 2678, 3005 => 2677, 3003 => 2676, 3000 => 2675, 2997 => 2674, 2984 => 2673, 2981 => 2672, 2978 => 2671, 2975 => 2670, 2961 => 2669, 2958 => 2668, 2945 => 2667, 2942 => 2666, 2939 => 2665, 2846 => 2571, 2426 => 2154, 2069 => 1800, 2038 => 1772, 2025 => 1762, 1996 => 1736, 1992 => 1735, 1984 => 1730, 1535 => 1283, 1532 => 1282, 1526 => 1281, 1521 => 1280, 1516 => 1279, 1510 => 1278, 1504 => 1277, 1499 => 1276, 1496 => 1275, 1493 => 1274, 1490 => 1273, 1485 => 1270, 1472 => 1260, 1458 => 1249, 1430 => 1226, 1424 => 1225, 1418 => 1224, 1412 => 1223, 1406 => 1222, 1400 => 1221, 1394 => 1220, 1388 => 1219, 1382 => 1218, 1376 => 1217, 1370 => 1216, 1364 => 1215, 1358 => 1214, 1351 => 1212, 1345 => 1211, 1339 => 1210, 1333 => 1209, 1327 => 1208, 1307 => 1191, 1297 => 1184, 1267 => 1157, 1255 => 1147, 1246 => 1141, 1242 => 1139, 1240 => 1138, 1237 => 1137, 1228 => 1131, 1224 => 1129, 1222 => 1128, 1150 => 1058, 1142 => 1056, 1140 => 1055, 1135 => 1053, 1132 => 1052, 1130 => 1051, 1116 => 1040, 1112 => 1038, 1102 => 1037, 73 => 16, 63 => 15, 52 => 11, 50 => 13, 37 => 11,);
}
public function getSourceContext()
{
return new Source("{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block stylesheet %}
<style>
.slick-slider {
margin-bottom: 10px;
\t\t\tmargin-top: -20px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: \" \";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</style>
<link rel=\"stylesheet\" href=\"/html/user_data/js/style.css\">
<link rel=\"stylesheet\" href=\"/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css\">
<style>
/* Show zoom cursor on product images to hint click-to-expand */
.item_visual .slide-item a { display: block; cursor: zoom-in; }
</style>
<style>
/* ============================================
商品詳細グリッド: 画像50% / 内容50%(均等)
============================================ */
@media (min-width: 768px) {
body.product_page .ec-grid2 {
display: flex;
align-items: flex-start;
}
body.product_page .ec-grid2 .ec-grid2__cell {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
body.product_page .ec-grid2 .ec-grid2__cell2 {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
}
/* ============================================
商品説明欄内のHTMLが画面幅を突き抜けないように
============================================ */
body.product_page .ec-productRole__description {
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
}
body.product_page .ec-productRole__description img,
body.product_page .ec-productRole__description table,
body.product_page .ec-productRole__description iframe,
body.product_page .ec-productRole__description video {
max-width: 100% !important;
height: auto;
}
body.product_page .ec-productRole__description table {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
スマホ用 お見積りの詳細 ボトムシート
============================================ */
.sp-detail-sheet { display: none; }
.sp-detail-sheet.is-open {
display: block;
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 2000;
}
.sp-detail-sheet__overlay {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.45);
}
.sp-detail-sheet__panel {
position: absolute;
left: 0; right: 0; bottom: 0;
background: #fff;
border-radius: 14px 14px 0 0;
max-height: 82vh;
display: flex;
flex-direction: column;
box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
padding-bottom: env(safe-area-inset-bottom);
animation: spSheetUp 0.22s ease-out;
}
@keyframes spSheetUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.sp-detail-sheet__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__title { font-size: 16px; font-weight: bold; color: #333; }
.sp-detail-sheet__close {
background: none;
border: none;
font-size: 26px;
line-height: 1;
color: #888;
cursor: pointer;
padding: 0 4px;
}
.sp-detail-sheet__body {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 4px 0;
flex: 1 1 auto;
}
.sp-detail-sheet__body ul { list-style: none; margin: 0; padding: 0; }
.sp-detail-sheet__body li { border-bottom: 1px solid #f2f2f2; }
.sp-detail-sheet__body .nav-link {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
color: #333;
font-size: 14px;
}
.sp-detail-sheet__body .nav-link .float-right {
float: none !important;
font-weight: bold;
white-space: nowrap;
margin-left: auto;
}
.sp-detail-sheet__footer {
display: flex;
gap: 8px;
padding: 12px 16px 16px;
border-top: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__footer button {
flex: 1 1 auto;
padding: 12px;
border-radius: 8px;
font-size: 14px;
font-weight: bold;
cursor: pointer;
}
.sp-detail-sheet__invoice {
background: #fff;
border: 1px solid #17a2b8;
color: #17a2b8;
}
.sp-detail-sheet__cart {
background: #c00;
border: 1px solid #c00;
color: #fff;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.rp-section-label {
font-size: 14px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.rp-section-label span {
font-weight: normal;
color: #c00;
}
/* ---- 1. 画像付きカード ---- */
.rp-card-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
}
.rp-card {
position: relative;
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: prevent the first tap from being consumed as a text
selection (\"字だけ青くなる\" = selection highlight) which forced a
2nd tap to actually switch the option (#15). */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
width: 110px;
border: 2px solid #ddd;
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
background: #fff;
text-decoration: none;
color: #333;
display: block;
}
/* Gate :hover behind real hover-capable pointers. On iOS Safari a
:hover rule that changes appearance makes the first tap apply the
hover state and suppresses the click, so the option chip needed a
second tap to fire its onclick (is-selected + price update). */
@media (hover: hover) and (pointer: fine) {
.rp-card:hover {
border-color: #999;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
}
.rp-card.is-selected {
border-color: #1a6fcf;
box-shadow: 0 2px 10px rgba(26,111,207,0.25);
}
/* visually-hidden instead of display:none. A label wrapping a
display:none radio fires its tap unreliably on iOS Safari (first tap
often ignored -> \"2回タッチ\"). Keeping the input in the layout but
invisible makes the first tap register. */
.rp-card input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
.rp-card__image {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
display: block;
background: #f5f5f5;
}
.rp-card__placeholder {
width: 100%;
aspect-ratio: 1 / 1;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
color: #bbb;
font-size: 24px;
}
.rp-card__name {
display: block;
padding: 5px 5px;
font-size: 11px;
color: #333;
text-align: center;
line-height: 1.4;
word-break: break-all;
}
.rp-card.is-selected .rp-card__name { color: #1a6fcf; font-weight: bold; }
.rp-card.is-selected::after {
content: \"✓\";
position: absolute;
top: 3px; right: 6px;
color: #1a6fcf;
font-size: 13px;
font-weight: bold;
}
/* ---- 2. ボタン式ラジオ(画像なし・8個以内)---- */
.rp-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
max-width: 100%;
min-width: 0;
}
.rp-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 8px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.rp-btn:hover { border-color: #999; }
}
.rp-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.rp-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* iOS Safari \"2回タッチ\" fix for the type-selection link chips.
The global theme stylesheet ships an ungated `a:hover{color:#296292}`
(paired with `a{color:#337ab7;text-decoration:underline}`). Because
.rp-btn / .rp-card are real <a> links, iOS Safari applies that hover
colour on the FIRST tap — the chip text turns blue (#296292, the
reported \"字だけ青くなる\") — and treats the tap as a hover, swallowing
the navigation so a 2nd tap was needed. The local .rp-*:hover rules
are already gated behind (hover:hover), but this inherited global
rule was not. Pin the hover/active colour to the base/selected colour
so tapping produces no visual change and the first tap navigates
immediately. Higher specificity (0,2,0 / 0,3,0) overrides a:hover. */
.rp-btn:hover,
.rp-btn:active { color: #333; text-decoration: none; }
.rp-btn.is-selected:hover,
.rp-btn.is-selected:active { color: #1a6fcf; text-decoration: none; }
.rp-card:hover,
.rp-card:active { color: #333; text-decoration: none; }
.rp-card:hover .rp-card__name,
.rp-card:active .rp-card__name { color: #333; }
.rp-card.is-selected:hover .rp-card__name,
.rp-card.is-selected:active .rp-card__name { color: #1a6fcf; }
/* ---- 選択肢が多い場合: 縦3段に収めて横スクロール(顧客要望「3列くらいで横スクロール」)---- */
/* grid-auto-flow:column + 3行固定 → 選択肢が縦に最大3段、超過分は右へ伸び横スクロールで閲覧 */
.rp-btn-group.is-scroll,
.opt-btn-group.is-scroll {
display: grid;
grid-auto-flow: column;
grid-template-rows: repeat(3, auto);
grid-auto-columns: max-content;
justify-content: start;
align-items: start;
gap: 8px;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
/* 上下に余白を確保して、行の枠線が overflow クリップ/スクロールバーに
切り取られないようにする(「文字列が長いと下枠が消える」対策)。 */
padding: 2px 0 12px;
}
/* is-scroll(横スクロール)内では選択肢を折り返さず単一行に固定する。
折り返すと行高が不揃いになり overflow-y:hidden で下枠が切れるため、
長い選択肢は折り返さず横スクロールで見せる(本来の設計意図)。 */
.rp-btn-group.is-scroll .rp-btn,
.rp-btn-group.is-scroll .opt-btn,
.opt-btn-group.is-scroll .rp-btn,
.opt-btn-group.is-scroll .opt-btn {
white-space: nowrap;
word-break: normal;
overflow-wrap: normal;
}
.rp-btn-group.is-scroll::-webkit-scrollbar,
.opt-btn-group.is-scroll::-webkit-scrollbar {
height: 6px;
}
.rp-btn-group.is-scroll::-webkit-scrollbar-thumb,
.opt-btn-group.is-scroll::-webkit-scrollbar-thumb {
background: #c0c0c0;
border-radius: 3px;
}
/* ---- 3. プルダウン(画像なし・9個以上)---- */
.rp-select-wrap {
margin-bottom: 4px;
}
.rp-select {
width: 100%;
max-width: 420px;
padding: 8px 12px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
appearance: none;
background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E\");
background-repeat: no-repeat;
background-position: right 12px center;
cursor: pointer;
}
.rp-select:focus {
outline: none;
border-color: #1a6fcf;
}
/* ---- オプション選択ボタン(枠線ラジオ)---- */
.opt-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 6px 0;
max-width: 100%;
min-width: 0;
}
.opt-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 7px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.opt-btn:hover { border-color: #999; }
}
.opt-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.opt-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* opt-btn with color swatch image. The label still works as a
radio target — clicking the image checks the input. The text
label stays under the image so users can still read the name. */
.opt-btn--with-image {
padding: 4px 6px 6px;
white-space: normal;
text-align: center;
display: inline-flex;
flex-direction: column;
align-items: center;
min-width: 96px;
max-width: 140px;
}
.opt-btn--with-image .opt-btn__img {
display: block;
width: 88px;
height: 66px;
object-fit: cover;
border-radius: 6px;
margin-bottom: 4px;
background: #f5f5f5;
}
.opt-btn--with-image .opt-btn__name {
display: block;
font-size: 11px;
line-height: 1.3;
color: inherit;
}
.opt-btn--with-image.is-selected .opt-btn__img {
outline: 2px solid #1a6fcf;
outline-offset: 1px;
}
/* sale_type=2 (内窓) 補助金対象ガラスの強調表示.
補助金が出る性能区分 (真空断熱 / Low-E複層 等) のガラス選択肢に
緑枠 + 「補助金対象」バッジを付け、選択前から判別できるようにする。 */
.opt-btn--subsidy {
border-color: #2e7d32;
}
.opt-btn--subsidy.is-selected {
border-color: #1a6fcf;
}
.opt-btn__subsidy-badge {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
border-radius: 6px;
background: #2e7d32;
color: #fff;
font-size: 11px;
font-weight: bold;
white-space: nowrap;
}
/* ============================================
施工エリア案内
============================================ */
.ec-areaNotice {
margin: 16px 0;
padding: 16px 20px;
background: #f8f9fa;
border-left: 4px solid #1a6fcf;
border-radius: 0 8px 8px 0;
}
.ec-areaNotice__inner {
display: flex;
align-items: flex-start;
gap: 12px;
}
.ec-areaNotice__icon {
font-size: 22px;
line-height: 1;
flex-shrink: 0;
margin-top: 2px;
}
.ec-areaNotice__body {
flex: 1;
}
.ec-areaNotice__title {
font-size: 13px;
font-weight: bold;
color: #1a6fcf;
margin: 0 0 6px;
}
.ec-areaNotice__text {
font-size: 13px;
color: #444;
line-height: 1.7;
margin: 0;
}
.ec-areaNotice__text strong {
color: #222;
}
.ec-areaNotice__link {
display: inline-block;
margin-top: 8px;
font-size: 12px;
color: #1a6fcf;
text-decoration: underline;
}
.ec-areaNotice__link:hover {
color: #0d4fa0;
}
/* ============================================
SNSシェア + ブランド名 タイトル行
============================================ */
.ec-productRole__titleRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}
.ec-productRole__titleRow .ec-headingTitle {
margin: 0;
flex: 1;
font-size: 18px;
}
.ec-share-inline {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
@media (max-width: 767px) {
/* maker_area の float を解除して独立表示 */
#maker_area {
float: none !important;
width: auto !important;
height: auto !important;
display: block;
margin-bottom: 4px;
}
/* タイトル行: 商品名が全幅を占有しSNSは右寄せ下段 */
.ec-productRole__titleRow {
flex-wrap: wrap;
clear: both;
}
.ec-productRole__titleRow .ec-headingTitle {
flex: 1 1 100%;
font-size: 16px;
}
.ec-share-inline {
flex: 0 0 auto;
margin-left: auto;
}
}
.ec-share-inline a {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 15px;
color: #fff;
text-decoration: none;
transition: opacity 0.2s;
}
.ec-share-inline a:hover { opacity: 0.8; }
.ec-share-inline .share-twitter { background: #000; }
.ec-share-inline .share-facebook { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ec-share-inline .share-line { background: #06c755; }
/* description_detail下のシェアブロックはPC/スマホ共通で非表示(タイトル行に移動) */
.ec-productRole__share { display: none; }
/* ============================================
PC用: 現在のお見積り額カード強調
============================================ */
@media (min-width: 768px) {
.mitsumori-card-pc {
border: 2px solid #1a6fcf !important;
border-radius: 10px !important;
box-shadow: 0 4px 16px rgba(26,111,207,0.18) !important;
margin-top: 20px;
overflow: hidden;
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
}
.mitsumori-card-pc .card-header {
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
color: #fff !important;
padding: 14px 16px !important;
border-bottom: none !important;
}
.mitsumori-card-pc .card-title {
color: #fff !important;
font-size: 15px !important;
font-weight: bold !important;
margin: 0 !important;
}
.mitsumori-card-pc #mitsumori_message {
font-size: 22px !important;
font-weight: bold !important;
color: #fff !important;
}
.mitsumori-card-pc .btn-tool {
color: #fff !important;
}
/* 合計行を大きく強調 */
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: 16px !important;
font-weight: bold !important;
color: #c00 !important;
background: #fff8f8 !important;
padding: 12px 16px !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: 20px !important;
font-weight: bold !important;
color: #c00 !important;
}
/* card-body(明細リスト)を白背景に */
.mitsumori-card-pc .card-body {
background: #fff !important;
}
.mitsumori-card-pc .card-footer {
background: #f8faff !important;
border-top: 1px solid #dce8fb !important;
padding: 12px 16px !important;
}
}
@media (max-width: 767px) {
/* スマホでは現在のお見積り額カードの強調スタイルをすべてリセット */
.mitsumori-card-pc {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
margin-top: 0 !important;
overflow: visible !important;
background: none !important;
/* sticky-top(position:sticky / z-index:1020) を解除。
そのままだと最下部で #sp-mitsumori-bar(z-index:1000) の上に
重なり、合計バーと文字が被るため通常フローへ戻す。 */
position: static !important;
z-index: auto !important;
}
.mitsumori-card-pc .card-header {
background: none !important;
color: inherit !important;
padding: inherit !important;
border-bottom: inherit !important;
}
.mitsumori-card-pc .card-title { color: inherit !important; }
.mitsumori-card-pc #mitsumori_message { font-size: inherit !important; color: inherit !important; }
.mitsumori-card-pc .btn-tool { color: inherit !important; }
/* 折りたたみトグルボタン */
.btn-mitsumori-toggle {
background: none !important;
border: 1px solid #aaa !important;
border-radius: 4px !important;
padding: 2px 8px !important;
font-size: 12px !important;
color: #333 !important;
line-height: 1.4 !important;
}
.btn-mitsumori-toggle .toggle-icon {
display: inline-block;
transition: transform 0.2s;
}
/* 展開状態: ▼→▲ */
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon::before {
content: \"▲ 閉じる\";
}
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon {
display: none;
}
.card:not(.collapsed-card) .btn-mitsumori-toggle::after {
content: \"▲ 閉じる\";
font-size: 12px;
}
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: inherit !important;
color: inherit !important;
background: none !important;
padding: inherit !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: inherit !important;
color: inherit !important;
}
.mitsumori-card-pc .card-footer {
background: none !important;
border-top: inherit !important;
padding: inherit !important;
}
/* 横スクロール禁止 */
body, html {
overflow-x: hidden;
max-width: 100vw;
}
/* ボタンの折り返しを許可(nowrapが原因で横スクロール発生するため) */
.opt-btn,
.rp-btn {
white-space: normal;
word-break: break-all;
}
/* エリア案内: スマホでコンパクト */
.ec-areaNotice {
margin: 8px 0;
padding: 8px 10px;
border-left-width: 3px;
cursor: pointer;
}
.ec-areaNotice__inner {
flex-direction: row;
gap: 8px;
align-items: flex-start;
}
.ec-areaNotice__icon { font-size: 15px; }
/* タイトル行: 展開トグル */
.ec-areaNotice__title {
font-size: 11px;
margin-bottom: 3px;
display: flex;
justify-content: space-between;
align-items: center;
}
.ec-areaNotice__title::after {
content: \"▼\";
font-size: 9px;
color: #888;
margin-left: 6px;
transition: transform 0.2s;
}
.ec-areaNotice.is-open .ec-areaNotice__title::after {
transform: rotate(180deg);
}
/* 折りたたみ対象: 閉じた状態では非表示 */
.ec-areaNotice__detail {
display: none;
}
.ec-areaNotice.is-open .ec-areaNotice__detail {
display: block;
}
.ec-areaNotice__text { font-size: 11px; line-height: 1.5; }
.ec-areaNotice__text br { display: none; }
.ec-areaNotice__link { font-size: 11px; margin-top: 3px; }
.rp-card { width: calc(33.333% - 6px); min-width: 80px; }
#sp-mitsumori-bar {
display: flex;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
background: #fff;
border-top: 2px solid #e0e0e0;
box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
align-items: center;
padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
gap: 8px;
}
#sp-mitsumori-bar .sp-bar__label {
font-size: 11px;
color: #666;
white-space: nowrap;
}
/* 価格ラッパ: 合計金額は最重要のため常に全桁表示する(縮小・省略しない)。
幅が足りない場合は下のボタン側を縮める(flex 配分でボタンが先に縮む)。 */
#sp-mitsumori-bar .sp-bar__pricewrap {
flex: 0 0 auto;
min-width: 0;
}
#sp-mitsumori-bar .sp-bar__price {
font-size: 18px;
font-weight: bold;
color: #c00;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__btn {
font-size: 12px;
padding: 8px 12px;
background: #333;
color: #fff;
border: none;
border-radius: 6px;
white-space: nowrap;
cursor: pointer;
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
flex: 1 1 auto;
min-width: 0;
justify-content: center;
}
#sp-mitsumori-bar .sp-bar__btn i {
font-size: 14px;
flex: 0 0 auto;
}
/* お見積りの詳細(内訳)を開くボタン。価格・カートボタンを圧迫しないよう
最小幅のアイコン+短ラベルにし、幅不足時も縮まない固定幅で維持する。 */
#sp-mitsumori-bar .sp-bar__detail-btn {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
flex: 0 0 auto;
padding: 4px 8px;
background: #fff;
color: #c00;
border: 1px solid #c00;
border-radius: 6px;
font-size: 10px;
font-weight: bold;
line-height: 1.1;
white-space: nowrap;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__detail-btn i { font-size: 15px; }
/* 幅が足りないときはボタンの文字を省略し、価格と数字を守る。 */
#sp-mitsumori-bar .sp-bar__btn-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__cart-badge {
position: absolute;
top: -6px;
right: -6px;
background: #c00;
color: #fff;
border-radius: 50%;
min-width: 16px;
height: 16px;
font-size: 10px;
line-height: 16px;
padding: 0 4px;
font-weight: bold;
}
#sp-mitsumori-bar .sp-bar__home-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
flex: 0 0 auto;
border: 1px solid #ccc;
border-radius: 6px;
background: #fff;
color: #333;
text-decoration: none;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__home-btn i {
font-size: 16px;
}
#sp-mitsumori-bar .sp-bar__home-btn:hover {
background: #f0f0f0;
}
/* 下部バーの高さ分ページ下部にpaddingを追加 (iOS safe-area 込み) */
body {
padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
}
/* ============================================
カート追加モーダル: 縦並び中央配置
============================================ */
.add-cart-modal__wrap {
text-align: center;
}
.add-cart-modal__header {
font-size: 16px;
margin: 20px 0 24px;
text-align: center;
}
.add-cart-modal__actions {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
padding: 0 20px 20px;
}
.add-cart-modal__primary {
display: inline-block;
width: 80%;
max-width: 320px;
padding: 14px 20px;
font-size: 15px;
font-weight: bold;
text-align: center;
background: #d9534f;
color: #fff !important;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
}
.add-cart-modal__primary:hover {
background: #c9302c;
color: #fff !important;
text-decoration: none;
}
.add-cart-modal__secondary {
display: inline-block;
padding: 6px 14px;
font-size: 12px;
color: #666;
border: 1px solid #ccc;
border-radius: 4px;
background: #fff;
cursor: pointer;
}
.add-cart-modal__secondary:hover {
background: #f0f0f0;
color: #333;
}
@media (max-width: 767px) {
.add-cart-modal__actions {
gap: 20px;
}
}
</style>
{% endblock %}
{% block javascript %}
<script>
eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var \$form = \$(form);
var product_id = \$form.find('input[name=product_id]').val();
var \$sele1 = \$form.find('select[name=classcategory_id1]');
var \$sele2 = \$form.find('select[name=classcategory_id2]');
eccube.setClassCategories(\$form, product_id, \$sele1, \$sele2, classcat_id2_selected);
}
{% if form.classcategory_id2 is defined %}
fnSetClassCategories(
\$('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
);
{% elseif form.classcategory_id1 is defined %}
eccube.checkStock(\$('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
{% endif %}
</script>
<script>
\$(function() {
// bfcache無効化
\$(window).bind('pageshow', function(event) {
if (event.originalEvent.persisted) {
location.reload(true);
}
});
// Core Web Vital の Cumulative Layout Shift(CLS)対策のため
// img タグに width, height が付与されている.
// 630px 未満の画面サイズでは縦横比が壊れるための対策
// see https://github.com/EC-CUBE/ec-cube/pull/5023
\$('.ec-grid2__cell').hide();
var removeSize = function () {
\$('.slide-item').height('');
\$('.slide-item img')
.removeAttr('width')
.removeAttr('height')
.removeAttr('style');
};
var slickInitial = function(slick) {
\$('.ec-grid2__cell').fadeIn(1500);
var baseHeight = \$(slick.target).height();
var baseWidth = \$(slick.target).width();
var rate = baseWidth / baseHeight;
\t\t\t\tif(baseHeight * rate < 400){
\t \$('.slide-item').height(baseHeight * rate); // 余白を削除する
\t\t\t\t}else{
\t \$('.slide-item').height(400); // 余白を削除する
\t\t\t\t}
// transform を使用することでCLSの影響を受けないようにする
\$('.slide-item img')
.css(
{
'transform-origin': 'top left',
'transform': 'scaleY(' + rate + ')',
'transition': 'transform .1s'
}
);
// 正しいサイズに近くなったら属性を解除する
setTimeout(removeSize, 500);
};
\$('.item_visual').on('init', slickInitial);
// リサイズ時は CLS の影響を受けないため属性を解除する
\$(window).resize(removeSize);
\$('.item_visual').slick({
dots: false,
arrows: true,
responsive: [{
breakpoint: 768,
settings: {
dots: true,
\t\tarrows: false
}
}]
});
\$('.slideThumb').on('click', function() {
var index = \$(this).attr('data-index');
\$('.item_visual').slick('slickGoTo', index, false);
})
});
</script>
<script>
\$(function() {
\$('.add-cart').on('click', function(event) {
{% if form.classcategory_id1 is defined %}
// 規格1フォームの必須チェック
if (\$('#classcategory_id1').val() == '__unselected' || \$('#classcategory_id1').val() == '') {
\$('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
\$('#classcategory_id1')[0].setCustomValidity('');
}
{% endif %}
{% if form.classcategory_id2 is defined %}
// 規格2フォームの必須チェック
if (\$('#classcategory_id2').val() == '__unselected' || \$('#classcategory_id2').val() == '') {
\$('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
\$('#classcategory_id2')[0].setCustomValidity('');
}
{% endif %}
// タイプ2: カート送信直前に set_count を quantity に同期
if(\$('#set_count').length){
var _sc = parseInt(\$('#set_count').val()) || 1;
\$('#quantity').val(_sc);
\$('input[name=\"quantity\"]').val(_sc);
}
// 個数フォームのチェック
if (\$('#quantity').val() < 1) {
\$('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
return true;
} else {
\$('#quantity')[0].setCustomValidity('');
}
event.preventDefault();
\$form = \$('#form1');
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$('.add-cart').prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: \"{{ url('block_cart') }}\",
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
}).always(function(data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
});
\$('.ec-modal-wrap').on('click', function(e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
\t\tvar pw = \"{% if mitsumori_json %}{{ mitsumori_json.pw }}{% endif %}\";
\t\tvar pd = \"{% if mitsumori_json %}{{ mitsumori_json.pd }}{% endif %}\";
\t\tvar ph = \"{% if mitsumori_json %}{{ mitsumori_json.ph }}{% endif %}\";
\t\tvar pm = \"{% if mitsumori_json %}{{ mitsumori_json.pm }}{% endif %}\";
\t\tvar pc = \"{% if mitsumori_json %}{{ mitsumori_json.pc }}{% endif %}\";
\t\t// option1 / option2: カテゴリ別 option 軸 (um: タイプ=subtype, fe: ct_up 等)
\t\tvar option1 = \"{% if mitsumori_json and mitsumori_json.option1 is defined %}{{ mitsumori_json.option1 }}{% endif %}\";
\t\tvar option2 = \"{% if mitsumori_json and mitsumori_json.option2 is defined %}{{ mitsumori_json.option2 }}{% endif %}\";
\t\tvar op0 = \"{% if mitsumori_json %}{{ mitsumori_json.op[0] }}{% endif %}\";
\t\tvar op1 = \"{% if mitsumori_json %}{{ mitsumori_json.op[1] }}{% endif %}\";
\t\tvar op2 = \"{% if mitsumori_json %}{{ mitsumori_json.op[2] }}{% endif %}\";
\t\tvar op3 = \"{% if mitsumori_json %}{{ mitsumori_json.op[3] }}{% endif %}\";
\t\tvar op4 = \"{% if mitsumori_json %}{{ mitsumori_json.op[4] }}{% endif %}\";
\t\tvar op5 = \"{% if mitsumori_json %}{{ mitsumori_json.op[5] }}{% endif %}\";
\t\tvar op6 = \"{% if mitsumori_json %}{{ mitsumori_json.op[6] }}{% endif %}\";
\t\tvar op7 = \"{% if mitsumori_json %}{{ mitsumori_json.op[7] }}{% endif %}\";
\t\tvar op8 = \"{% if mitsumori_json %}{{ mitsumori_json.op[8] }}{% endif %}\";
\t\tvar op9 = \"{% if mitsumori_json %}{{ mitsumori_json.op[9] }}{% endif %}\";
\t\tvar op10 = \"{% if mitsumori_json %}{{ mitsumori_json.op[10] }}{% endif %}\";
\t\tconst formatter = new Intl.NumberFormat('ja-JP');
\t\t// ============================================================
\t\t// free_area 1 エントリのスキーマ(11 キー固定)
\t\t// ============================================================
\t\t// w : 幅 (string, 例 \"239.9cm\" / tf は \"1m\")
\t\t// d : 奥行
\t\t// h : 高さ (tf はロール長 \"10m\")
\t\t// m : 素材
\t\t// c : カラー
\t\t// price : 販売価格 (税抜、amount=1 ベース)
\t\t// unit_price : 商品 per-unit 増分 (税抜、AMOUNT_CATEGORIES のみ)
\t\t// maker_price : メーカー価格 (税抜)
\t\t// ct : 基本工事費 (税抜、amount=1 ベース)
\t\t// option1 : fe → ct_up / その他カテゴリ → category-specific
\t\t// option2 : um → ct_up / その他カテゴリ → category-specific
\t\t//
\t\t// ct4 (設置場所) / ct5 (撤去) / ct6 (残土) は option_area 側で扱う.
\t\t// ============================================================
\t\t// 施工オプション定義(option_area)— 各エントリ {name, comment, on, off, price}
\t\tvar op_data = {{ op_json|default('[]')|raw }};
\t\t// option_item_area:
\t\t// tg 用 — block 別オプション差額表
\t\t// { axis_labels: {F:'床材',front:'前面型',side1:'右側面型',side2:'左側面型'},
\t\t// blocks: { 'W_label|D_label': { F:[{idx,label,diff},...], front:[...], side1:[...], side2:[...] }, ... } }
\t\t// fe (sale_type=4) 用 — ブロックの種類×段数の差額表 (fe_block キー)
\t\t// { fe_block: { depends_on_name: '...', depends_on_value: '...',
\t\t// title: '...', default_key: '...',
\t\t// choices: [{key,label,price}, ...] } }
\t\t// 該当しないカテゴリでは fe_block は null. axis_labels/blocks は空.
\t\tvar oi_data = {{ oi_json|default('{\"axis_labels\":{},\"blocks\":{},\"fe_block\":null}')|raw }};
\t\t// 選択中の tg オプション差額 (axis -> selected choice_idx). ラジオ click で更新される.
\t\tvar oi_selected = { F: 1, front: 1, side1: 1, side2: 1 };
\t\t// 選択中の fe ブロック種類×段数 (key 文字列). 既定は oi_data.fe_block.default_key.
\t\tvar fe_block_selected = (oi_data && oi_data.fe_block && oi_data.fe_block.default_key) || '';
\t\t// sale_type ID(mtb_sale_type の id。本サイトでの意味は次の通り):
\t\t// 1 通常 / 2 補助金窓 / 3 物置 / 4 フェンス / 5 デッキ / 6 芝生 / 9 商品のみ
\t\tvar SALE_TYPE_ID = {{ ProductClass.SaleType.id }};
\t\t{# option1 / option2 ラベルをカテゴリ別に決定 (sh=31, rd=43, mo=15) — 以降の UI / JS 両方で使用 #}
\t\t{% set option1_label = 'オプション1' %}
\t\t{% set option2_label = 'オプション2' %}
\t\t{% if Product.ProductCategories is not empty %}
\t\t\t{% for pcat in Product.ProductCategories %}
\t\t\t\t{% if pcat.category_id == 31 %}{% set option1_label = 'サイズプリセット' %}{% set option2_label = '駆動方式' %}{% endif %}
\t\t\t\t{% if pcat.category_id == 43 %}{% set option1_label = 'ランマ' %}{% set option2_label = 'タイプ' %}{% endif %}
\t\t\t\t{% if pcat.category_id == 15 %}{% set option1_label = '棚タイプ' %}{% endif %}
\t\t\t\t{% if pcat.category_id == 17 %}{% set option1_label = '窓タイプ' %}{% endif %}
\t\t\t{% endfor %}
\t\t{% endif %}
\t\t// 消費税率(pp.price/pp.ct/op_data.price は scraper が税抜で保存しているため、
\t\t// calcGoukei 出口で 1+TAX_RATE を掛けて税込 mitsumori_goukei にする)
\t\tvar TAX_RATE = 0.10;
\t\tfunction toIncTax(v) { return Math.round(v * (1 + TAX_RATE)); }
\t\t/**
\t\t * tg 用 block 別オプション差額の集計.
\t\t * 現選択 (W, D) から block key を作り、oi_data.blocks[blockKey] を取得.
\t\t * 各 axis (F/front/side1/side2) で oi_selected[axis] の choice の diff を合計.
\t\t * 戻り値: { total: 差額合計(税抜), items: [{name, label, diff}, ...] }
\t\t * block が無い (tg 以外 / 該当 (W,D) が未取得) なら total=0.
\t\t */
\t\tfunction collectOptionItems(curW, curD) {
\t\t\tvar result = { total: 0, items: [] };
\t\t\tif (!oi_data || !oi_data.blocks) return result;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return result;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\tfor (var i = 0; i < axes.length; i++) {
\t\t\t\tvar axis = axes[i];
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) continue;
\t\t\t\tvar idx = oi_selected[axis] || 1;
\t\t\t\tvar pick = null;
\t\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\t\tif (parseInt(choices[j].idx) === parseInt(idx)) { pick = choices[j]; break; }
\t\t\t\t}
\t\t\t\tif (!pick) pick = choices[0];
\t\t\t\tvar diff = parseInt(pick.diff) || 0;
\t\t\t\tresult.total += diff;
\t\t\t\tresult.items.push({
\t\t\t\t\tname: oi_data.axis_labels[axis] || axis,
\t\t\t\t\tlabel: pick.label,
\t\t\t\t\tdiff: diff,
\t\t\t\t});
\t\t\t}
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * tg ラジオ群を block 別に DOM へ描画する.
\t\t * W/D が確定したら現 block の 4 軸 (F/front/side1/side2) ラジオを #tg-options 要素に出す.
\t\t * block が空なら #tg-options を空にする.
\t\t */
\t\tfunction renderOptionItemRadios(curW, curD) {
\t\t\tvar \$box = \$('#tg-options');
\t\t\tif (!\$box.length) return;
\t\t\t\$box.empty();
\t\t\tif (!oi_data || !oi_data.blocks) return;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\taxes.forEach(function(axis) {
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) return;
\t\t\t\tvar axisLabel = (oi_data.axis_labels && oi_data.axis_labels[axis]) || axis;
\t\t\t\tvar \$section = \$('<div class=\"form-group tg-axis\"></div>');
\t\t\t\t\$section.append('<p class=\"rp-section-label\"><strong>' + axisLabel + '</strong>: <span class=\"tg-axis-selected\"></span></p>');
\t\t\t\tvar \$list = \$('<div class=\"tg-choice-list\"></div>');
\t\t\t\tchoices.forEach(function(ch, i) {
\t\t\t\t\tvar inputId = 'tg_' + axis + '_' + ch.idx;
\t\t\t\t\tvar name = 'tg_' + axis;
\t\t\t\t\tvar checked = (parseInt(ch.idx) === parseInt(oi_selected[axis] || 1)) ? ' checked' : '';
\t\t\t\t\tvar diffTxt = ch.diff > 0 ? '+' + formatter.format(ch.diff) + '円' : (ch.diff < 0 ? formatter.format(ch.diff) + '円' : '±0');
\t\t\t\t\t\$list.append(
\t\t\t\t\t\t'<label class=\"tg-choice\"><input type=\"radio\" name=\"' + name + '\" id=\"' + inputId + '\" value=\"' + ch.idx + '\" data-axis=\"' + axis + '\"' + checked + '> ' +
\t\t\t\t\t\tch.label + '<span class=\"tg-diff\">(' + diffTxt + ')</span></label>'
\t\t\t\t\t);
\t\t\t\t});
\t\t\t\t\$section.append(\$list);
\t\t\t\t\$box.append(\$section);
\t\t\t});
\t\t\t// ラジオ click で oi_selected を更新 → 再計算
\t\t\t\$box.off('change.tg').on('change.tg', 'input[type=\"radio\"][data-axis]', function() {
\t\t\t\tvar axis = \$(this).data('axis');
\t\t\t\toi_selected[axis] = parseInt(\$(this).val()) || 1;
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t\tupdateOptionItemSelectedLabels();
\t\t}
\t\tfunction updateOptionItemSelectedLabels() {
\t\t\t\$('#tg-options .tg-axis').each(function() {
\t\t\t\tvar \$sel = \$(this).find('input[type=\"radio\"]:checked');
\t\t\t\tif (!\$sel.length) return;
\t\t\t\tvar label = \$sel.parent().contents().filter(function() { return this.nodeType === 3; }).text().trim();
\t\t\t\t\$(this).find('.tg-axis-selected').text(label);
\t\t\t});
\t\t}
\t\t// =========================================================
\t\t// fe (sale_type=4) ブロック種類×段数 サブ UI
\t\t// =========================================================
\t\t/**
\t\t * fe_block の親オプション (= op_data 内の「ご希望のフェンス設置方法」 entry)
\t\t * を name でルックアップし、その index を返す. 見つからなければ -1.
\t\t * fe_block.depends_on_name が設定されていればそれで照合.
\t\t * 未設定なら 'ご希望のフェンス設置方法' を含む name にフォールバック.
\t\t */
\t\tfunction findFeBlockParentOpIndex() {
\t\t\tif (!oi_data || !oi_data.fe_block) return -1;
\t\t\tvar needle = oi_data.fe_block.depends_on_name || 'ご希望のフェンス設置方法';
\t\t\tfor (var i = 0; i < op_data.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tif (op_data[i].name.indexOf(needle) >= 0) return i;
\t\t\t}
\t\t\treturn -1;
\t\t}
\t\t/**
\t\t * fe_block の現在の選択値の price (税抜) と choice 内容を集計.
\t\t * 親オプション (= 'ご希望のフェンス設置方法') が depends_on_value を選んでいる
\t\t * ときだけ加算する. それ以外 (既存ブロック側 / 親未選択) は price=0.
\t\t * 戻り値: { price: 0|N, choice: {key,label,price}|null, active: bool }
\t\t */
\t\tfunction collectFeBlock() {
\t\t\tvar result = { price: 0, choice: null, active: false };
\t\t\tif (SALE_TYPE_ID !== 4) return result;
\t\t\tif (!oi_data || !oi_data.fe_block) return result;
\t\t\tif (!oi_data.fe_block.choices || !oi_data.fe_block.choices.length) return result;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return result;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tif (parentSel !== triggerValue) return result; // 親が新規ブロック積み以外なら無加算
\t\t\tresult.active = true;
\t\t\tvar choices = oi_data.fe_block.choices;
\t\t\tvar pick = null;
\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\tif (choices[j].key === fe_block_selected) { pick = choices[j]; break; }
\t\t\t}
\t\t\tif (!pick) pick = choices[0];
\t\t\tresult.choice = pick;
\t\t\tresult.price = parseInt(pick.price) || 0;
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * fe_block ラジオ群を #fe-block-options 要素に描画する.
\t\t * active=false (親が「新規にブロック積み」以外) のときは非表示.
\t\t */
\t\tfunction renderFeBlockRadios() {
\t\t\tvar \$box = \$('#fe-block-options');
\t\t\tif (!\$box.length) return;
\t\t\tif (!oi_data || !oi_data.fe_block || !oi_data.fe_block.choices) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tvar visible = (ops[parentIdx] === triggerValue);
\t\t\tif (!visible) {
\t\t\t\t\$box.hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar fb = oi_data.fe_block;
\t\t\t\$box.empty();
\t\t\tvar \$title = \$('<p class=\"rp-section-label\"><strong>' + (fb.title || 'ブロックの種類と段数') + '</strong></p>');
\t\t\t\$box.append(\$title);
\t\t\t// 他オプション群と同じ .opt-btn-group / .opt-btn 形式で描画.
\t\t\t// 生の <label><input type=radio> ... 形式だと CSS 定義が無く
\t\t\t// ラベル折り返し・縦ズレ・隣接 opt-btn との間隔不揃いが発生する.
\t\t\tvar \$list = \$('<div class=\"opt-btn-group\" style=\"flex-direction:column;align-items:stretch;\"></div>');
\t\t\tfb.choices.forEach(function(ch) {
\t\t\t\tvar inputId = 'fe_block_' + ch.key;
\t\t\t\tvar isSel = (ch.key === fe_block_selected);
\t\t\t\tvar checked = isSel ? ' checked' : '';
\t\t\t\tvar selCls = isSel ? ' is-selected' : '';
\t\t\t\tvar priceTxt = (parseInt(ch.price) || 0) > 0
\t\t\t\t\t? ' <span class=\"fe-block-price\" style=\"margin-left:6px;color:#666;font-size:12px;white-space:nowrap;\">(+' + formatter.format(toIncTax(parseInt(ch.price))) + '円 税込)</span>'
\t\t\t\t\t: '';
\t\t\t\t\$list.append(
\t\t\t\t\t'<label class=\"opt-btn' + selCls + '\" style=\"text-align:left;display:flex;align-items:center;flex-wrap:wrap;\">' +
\t\t\t\t\t'<input type=\"radio\" name=\"fe_block\" id=\"' + inputId + '\" value=\"' + ch.key + '\"' + checked + '>' +
\t\t\t\t\t'<span class=\"fe-block-label\">' + ch.label + '</span>' +
\t\t\t\t\tpriceTxt +
\t\t\t\t\t'</label>'
\t\t\t\t);
\t\t\t});
\t\t\t\$box.append(\$list);
\t\t\t\$box.show();
\t\t\t\$box.off('change.fe_block').on('change.fe_block', 'input[type=\"radio\"][name=\"fe_block\"]', function() {
\t\t\t\tfe_block_selected = \$(this).val();
\t\t\t\t// is-selected 切替 (opt-btn 形式共通)
\t\t\t\t\$box.find('label.opt-btn').removeClass('is-selected');
\t\t\t\t\$(this).closest('label.opt-btn').addClass('is-selected');
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t}
\t\t/**
\t\t * fe (sale_type=4) で op_data エントリの連動表示制御.
\t\t * 親「ご希望のフェンス設置方法」の選択値に応じて、
\t\t * - 「既存ブロックに穴空け工事が必要ですか?」 entry を表示/非表示
\t\t * 切替の trigger は親選択値の文字列で判定 (entry index にハードコードしない).
\t\t */
\t\tfunction updateFeOpConditionalVisibility() {
\t\t\tif (SALE_TYPE_ID !== 4) return;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\t// 親が「既存ブロックに設置する」 (= off 側) のとき穴空け entry を表示
\t\t\tvar triggerOffValue = (op_data[parentIdx] && op_data[parentIdx].off) || '既存ブロックに設置する';
\t\t\t\$('div[data-op-name]').each(function() {
\t\t\t\tvar n = \$(this).attr('data-op-name') || '';
\t\t\t\tif (n.indexOf('穴空け') >= 0) {
\t\t\t\t\tif (parentSel === triggerOffValue) {
\t\t\t\t\t\t\$(this).show();
\t\t\t\t\t} else {
\t\t\t\t\t\t\$(this).hide();
\t\t\t\t\t}
\t\t\t\t}
\t\t\t});
\t\t}
\t\t/**
\t\t * 選択中の施工オプションを集計し、ON選択分の price を合計する.
\t\t * 戻り値: { total: 合計金額, items: [{name, value, price}, ...] }
\t\t */
\t\tfunction collectOptions() {
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar total = 0;
\t\t\tvar items = [];
\t\t\tfor (var i = 0; i < ops.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tvar sel = ops[i];
\t\t\t\tif (!sel) continue;
\t\t\t\tvar price = parseInt(op_data[i].price) || 0;
\t\t\t\t// 「ON」選択時のみ加算(OFF や「不要」「商品購入のみ」は加算しない)
\t\t\t\tvar isOn = (sel === op_data[i].on);
\t\t\t\titems.push({
\t\t\t\t\tname: op_data[i].name,
\t\t\t\t\tvalue: sel,
\t\t\t\t\tprice: isOn ? price : 0,
\t\t\t\t\ton: op_data[i].on,
\t\t\t\t\toff: op_data[i].off,
\t\t\t\t});
\t\t\t\tif (isOn) total += price;
\t\t\t}
\t\t\t// fe (sale_type=4) のブロック種類×段数 分を items / total に統合.
\t\t\t// 親オプション「ご希望のフェンス設置方法」 が 「新規にブロック積みを行う」 のとき
\t\t\t// だけ加算される (collectFeBlock 内で判定済み).
\t\t\tvar fb = collectFeBlock();
\t\t\tif (fb.active && fb.choice) {
\t\t\t\titems.push({
\t\t\t\t\tname: (oi_data.fe_block && oi_data.fe_block.title) || 'ブロックの種類と段数',
\t\t\t\t\tvalue: fb.choice.label,
\t\t\t\t\tprice: fb.price,
\t\t\t\t\ton: fb.choice.label,
\t\t\t\t\toff: '',
\t\t\t\t});
\t\t\t\ttotal += fb.price;
\t\t\t}
\t\t\treturn { total: total, items: items };
\t\t}
\t\t/**
\t\t * free_area 1 エントリ ({w,d,h,m,c,price,unit_price,maker_price,ct,option1,option2})
\t\t * から sale_type 別に最終金額を算出する.
\t\t *
\t\t * 計算式(amount=1 ベース、出口で × 1.10 税込化):
\t\t * 1 通常 : price + ct + option_sum
\t\t * 2 補助金窓 : price × set_count + (ct + (set_count-1) × option2) + option_sum
\t\t * 3 物置 : (price + ct) × daisu + option_sum
\t\t * 4 フェンス : price + (maisu-1) × unit_price
\t\t * + ct + max(0, maisu-3) × option1
\t\t * + option_sum (maisu >= 3)
\t\t * 5 デッキ : price + ct + option_sum (area は表示用、計算非関与)
\t\t * 6 芝生 : price × ceil(area / (w_m × h_m)) + ct + option_sum
\t\t * 9 商品のみ : price のみ(カート quantity 倍で総額)
\t\t *
\t\t * fe では option1 を ct_up、um では option2 を ct_up として転用.
\t\t * tf では w / h にロール幅・長さが格納されており parseLen で数値抽出.
\t\t *
\t\t * @param {Object} pp free_area の 1 行(matrix エントリ)
\t\t * @param {number} optionTotal collectOptions().total
\t\t * @param {Object} ctx UI 入力 {set_count, daisu, maisu, area, quantityOnly, ...}
\t\t * @returns {Object} {goukei, price, ct, opt, qty} すべて税込整数
\t\t */
\t\tfunction calcGoukei(pp, optionTotal, ctx) {
\t\t\tvar basePrice = parseInt(pp.price) || 0;
\t\t\tvar baseCt = parseInt(pp.ct) || 0;
\t\t\tvar unitPrice = parseInt(pp.unit_price) || 0;
\t\t\tvar optSum = optionTotal;
\t\t\tvar price = basePrice;
\t\t\tvar ct = baseCt;
\t\t\tvar qty = 1;
\t\t\tvar goukei = 0;
\t\t\t// 「商品購入のみ」選択時は工事費・オプションをゼロにする(任意 sale_type で適用)
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tif (purchaseOnly) {
\t\t\t\tbaseCt = 0;
\t\t\t\tct = 0;
\t\t\t\toptSum = 0;
\t\t\t}
\t\t\tswitch (SALE_TYPE_ID) {
\t\t\t\tcase 2: { // 補助金・窓 (シンプル表引き方式 2026-05-)
\t\t\t\t\t// 2026-05 仕様簡素化: 枚数軸を廃止し、subtype に枚数を内包.
\t\t\t\t\t// pp.price / pp.ct は (W, H, ガラス, subtype) の単一価格.
\t\t\t\t\t// 複数枚をまとめて買う場合はカート quantity で表現.
\t\t\t\t\tqty = 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 3: { // 物置・ゴミステーション
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.daisu) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt * qty;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 4: { // フェンス・組み立て式(maisu ≥ 3、base_amount = 3)
\t\t\t\t\t// scraper は amount=3 を base にしているので pp.price = price(3),
\t\t\t\t\t// pp.unit_price = price(4) - price(3).
\t\t\t\t\tqty = Math.max(3, parseInt(ctx.maisu) || 3);
\t\t\t\t\tprice = basePrice + (qty - 3) * unitPrice;
\t\t\t\t\t// option1 が ct_up (4枚目以降の増分). 未設定なら ct 固定動作
\t\t\t\t\tvar ctUp1 = parseInt(pp.option1) || 0;
\t\t\t\t\tct = baseCt + Math.max(0, qty - 3) * ctUp1;
\t\t\t\t\t// fe_block(ブロック積み段数): collectOptions が base(3枚分)を optSum に
\t\t\t\t\t// 算入済み. ブロック費も本体同様に枚数連動するため、4枚目以降は 1枚毎に
\t\t\t\t\t// choice.unit_price(= block(4)-block(3)) を加算する.
\t\t\t\t\t// (顧客指摘「何枚施工でも増える金額が同じ」の是正。unit_price 未設定の
\t\t\t\t\t// 旧データでは +0 で従来動作。)
\t\t\t\t\tif (!purchaseOnly) {
\t\t\t\t\t\tvar fbC = collectFeBlock();
\t\t\t\t\t\tif (fbC.active && fbC.choice) {
\t\t\t\t\t\t\toptSum += Math.max(0, qty - 3) * (parseInt(fbC.choice.unit_price) || 0);
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 5: { // ウッドデッキ・タイルデッキ
\t\t\t\t\t// area は担当者向けの参考値として保持(計算には使わない)
\t\t\t\t\tqty = 1;
\t\t\t\t\tgoukei = basePrice + baseCt + optSum;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 6: { // 芝生・人工芝(ロール単位)
\t\t\t\t\t// pp.w \"1m\", pp.h \"10m\" から数値抽出
\t\t\t\t\tvar w_m = parseLen(pp.w);
\t\t\t\t\tvar h_m = parseLen(pp.h);
\t\t\t\t\tvar rollSize = w_m * h_m;
\t\t\t\t\tif (!rollSize || rollSize <= 0) rollSize = 1;
\t\t\t\t\t// 施工サイズ(面積)があれば必要枚数を自動算出。無ければ直接指定の枚数を使う。
\t\t\t\t\tvar area = parseFloat(ctx.area) || 0;
\t\t\t\t\tif (area > 0) {
\t\t\t\t\t\tqty = Math.max(1, Math.ceil(area / rollSize));
\t\t\t\t\t} else {
\t\t\t\t\t\tqty = Math.max(1, parseInt(ctx.tf_qty) || 1);
\t\t\t\t\t}
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 7: { // 数量買い・基本工事費固定(gf ガーデンファニチャー / st 石材)
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.suuryou) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt; // ct は固定(数量に依らない)
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 9: { // 商品のみ購入
\t\t\t\t\t// カート側で quantity × unit price するため goukei は単品価格
\t\t\t\t\tqty = parseInt(ctx.quantityOnly) || 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = 0;
\t\t\t\t\toptSum = 0;
\t\t\t\t\tgoukei = price;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tdefault: { // 1: 通常(カーポート等、matrix 選択のみ)
\t\t\t\t\tqty = 1;
\t\t\t\t\tgoukei = basePrice + baseCt + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t}
\t\t\t// 出口で税込化(pp.price/pp.ct/op_data.price はすべて税抜で保存されている前提)
\t\t\treturn {
\t\t\t\tgoukei: toIncTax(goukei),
\t\t\t\tprice: toIncTax(price),
\t\t\t\tct: toIncTax(ct),
\t\t\t\topt: toIncTax(optSum),
\t\t\t\tqty: qty,
\t\t\t};
\t\t}
\t\t/**
\t\t * 寸法文字列から「メートル単位の数値」を抽出する.
\t\t *
\t\t * 単位は m / cm / mm を認識し、いずれも m 単位に正規化して返す.
\t\t * 単位が無い場合は m 単位とみなす(旧 tf データ \"1m\" \"10m\" との互換).
\t\t * 数値が見つからない場合は 0 を返す(呼び出し側で fallback).
\t\t *
\t\t * 例:
\t\t * \"1m\" → 1
\t\t * \"100cm\" → 1 (2026-06 以降の m → cm 正規化に対応)
\t\t * \"200cm\" → 2
\t\t * \"5.5m\" → 5.5
\t\t * \"1000mm\" → 1
\t\t * \"\" → 0
\t\t */
\t\tfunction parseLen(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)\\s*(mm|cm|m)?/i);
\t\t\tif (!m) return 0;
\t\t\tvar n = parseFloat(m[1]);
\t\t\tif (isNaN(n)) return 0;
\t\t\tvar unit = (m[2] || 'm').toLowerCase();
\t\t\tif (unit === 'cm') return n / 100;
\t\t\tif (unit === 'mm') return n / 1000;
\t\t\treturn n; // 'm' or no unit
\t\t}
\t\t// pp は autoSelectFirstColor 等からも参照するので global にする
\t\tvar pp = {{ pp|raw }};
\t\t// sale_type=2 の幅 / 高さ ladder (Twig p_w / p_h を JS で参照するため).
\t\t// 入力 mm 値を pp の幅・高さバケット文字列にマッピングする際の元データ.
\t\t// p_w / p_h は連想配列で来ることがあるため Object.values で配列化する.
\t\tvar PP_W_LADDER = Object.values({{ p_w|default({})|json_encode|raw }} || {});
\t\tvar PP_H_LADDER = Object.values({{ p_h|default({})|json_encode|raw }} || {});
\t\t/* ============================================================
\t\t sale_type=2 (補助金窓) 専用: 複数タイプ集計 & 補助金計算
\t\t ============================================================
\t\t - 入力 UI: #window-types-container 配下の .window-type-block
\t\t - 補助金根拠: 先進的窓リノベ2026事業
\t\t https://window-renovation2026.env.go.jp/construction/inner-window.html
\t\t - 価格軸: (subtype, w, h, glass, color) で pp を lookup
\t\t - 1 商品 = 1 明細 にまとめ、内訳 JSON を別途保存予定 (cart 連携は後続タスク)
\t\t ============================================================ */
\t\t// 補助金マトリクス: [住宅区分][性能][サイズ区分] → 1 箇所あたり金額 (税抜・端数なし)
\t\tvar WINDOW_SUBSIDY_MATRIX = {
\t\t\tdetached: { // 戸建住宅・延床240㎡以下の非住宅
\t\t\t\tP: { G: 140000, L: 89000, M: 58000, S: 36000 },
\t\t\t\tS: { G: 76000, L: 52000, M: 34000, S: 22000 }
\t\t\t},
\t\t\tapartment: { // 低層・中高層集合住宅・240㎡超の非住宅
\t\t\t\tP: { G: 152000, L: 98000, M: 64000, S: 40000 },
\t\t\t\tS: { G: 83000, L: 57000, M: 37000, S: 24000 }
\t\t\t}
\t\t};
\t\t// 住宅区分: 画面 UI (input[name=\"window_housing_type\"]) から取得する.
\t\t// 既定値は PFC meta_key=\"住宅区分\" を fallback (未設定なら '戸建').
\t\tvar HOUSING_TYPE_DEFAULT = {{ getProduct_field(Product.id, '住宅区分')|default('戸建')|json_encode|raw }};
\t\tfunction getCurrentHousingKey() {
\t\t\tvar el = document.querySelector('input[name=\"window_housing_type\"]:checked');
\t\t\tvar v = el ? el.value : HOUSING_TYPE_DEFAULT;
\t\t\treturn (v === '集合住宅') ? 'apartment' : 'detached';
\t\t}
\t\t// 商品シリーズ自動判定 (Product.name から)
\t\t// 根拠カタログ: YKK AP「ウチリモ」XAAAA-H26-067-1 (2026.04), 同「LiteU」XAAAA-H16-088-2,
\t\t// 三協アルミ「プラメイクEII」0142_STJ1931L, LIXIL「インプラス」(既知)
\t\tvar PRODUCT_NAME_RAW = {{ Product.name|default('')|json_encode|raw }};
\t\tfunction detectProductSeries(name) {
\t\t\tif (!name) return null;
\t\t\tif (/ウチリモ/.test(name)) return 'uchirimo';
\t\t\tif (/プラマード\\s*U/i.test(name)) return 'pramado_u';
\t\t\tif (/インプラス/.test(name)) return 'inplus';
\t\t\tif (/プラメイク\\s*EII|プラメイクEII/i.test(name)) return 'plamake_eii';
\t\t\tif (/LiteU/i.test(name)) return 'lite_u';
\t\t\treturn null;
\t\t}
\t\t// シリーズ上限グレード:
\t\t// 'P' = SS/P まで到達可能 (真空断熱ガラス採用シリーズ)
\t\t// 'S' = Low-E 複層止まり (真空断熱ガラスのラインなし)
\t\t// null = 単板のみ → 補助金対象外
\t\tvar SERIES_GRADE_CAP = {
\t\t\tuchirimo: 'P',
\t\t\tpramado_u: 'P',
\t\t\tinplus: 'S',
\t\t\tplamake_eii: 'S',
\t\t\tlite_u: null
\t\t};
\t\tvar DETECTED_SERIES = detectProductSeries(PRODUCT_NAME_RAW);
\t\tvar SERIES_GRADE_CAP_VAL = (DETECTED_SERIES !== null && Object.prototype.hasOwnProperty.call(SERIES_GRADE_CAP, DETECTED_SERIES))
\t\t\t? SERIES_GRADE_CAP[DETECTED_SERIES]
\t\t\t: undefined;
\t\t// 商品単位グレード上限 (PFC `meta_key=補助金グレード上限` で個別上書き)
\t\t// 値: 'P' / 'SS' / 'S' / '対象外' / '無' / 'NONE' / 空文字 (未指定)
\t\tvar PRODUCT_GRADE_CAP_RAW = {{ getProduct_field(Product.id, '補助金グレード上限')|default('')|json_encode|raw }};
\t\tfunction normalizeGradeCap(v) {
\t\t\tif (v === null || v === undefined || v === '') return undefined;
\t\t\tvar s = String(v).trim().toUpperCase();
\t\t\tif (s === 'NONE' || s === '対象外' || s === '無') return null;
\t\t\tif (s === 'P' || s === 'SS') return 'P';
\t\t\tif (s === 'S') return 'S';
\t\t\treturn undefined;
\t\t}
\t\tvar PRODUCT_GRADE_CAP = normalizeGradeCap(PRODUCT_GRADE_CAP_RAW);
\t\t// 窓種 (subtype = option1) ごとのグレード上限.
\t\t// 根拠: YKK AP「ウチリモ」業務用 (XAAAA-H26-067-1) の窓種別ラインナップで
\t\t// 真空ガラス (Glavenir) の設定有無を確認:
\t\t// 引違い窓 (2/3/4枚建) / 浴室仕様 引違い窓 / FIX窓 → P 到達可能
\t\t// 内開き窓 (居室/浴室) / 開き窓テラス / テラスドア類 → 真空ガラスなし → S 止まり
\t\tfunction detectSubtypeGradeCap(subtype) {
\t\t\tif (!subtype) return undefined;
\t\t\tvar s = String(subtype);
\t\t\tif (/内開|開き窓テラス|テラスドア|開き戸/.test(s)) return 'S';
\t\t\treturn undefined;
\t\t}
\t\t// クリップ: 強さは 'P' > 'S' > null (対象外). cap=null は強制対象外, cap=undefined は無効化なし.
\t\tfunction clipGradeBy(grade, cap) {
\t\t\tif (cap === undefined) return grade;
\t\t\tif (cap === null) return null;
\t\t\tif (grade === null) return null;
\t\t\tif (cap === 'S' && grade === 'P') return 'S';
\t\t\treturn grade;
\t\t}
\t\tfunction finalizeGlassGrade(raw, subtype) {
\t\t\tvar g = clipGradeBy(raw, SERIES_GRADE_CAP_VAL);
\t\t\tg = clipGradeBy(g, detectSubtypeGradeCap(subtype));
\t\t\tg = clipGradeBy(g, PRODUCT_GRADE_CAP);
\t\t\treturn g;
\t\t}
\t\t/**
\t\t * ガラスタイプ名から性能区分 'P' (SS, Uw≤1.1) / 'S' (Uw≤1.5) / null を判別.
\t\t * null = 補助対象外.
\t\t *
\t\t * 根拠: YKK AP「ウチリモ 内窓」業務用カタログ (XAAAA-H26-069-1) で
\t\t * P (SS) は真空断熱ガラスのみ、Low-E はアルゴン入りでも S 止まり、
\t\t * Low-E ガス無 + 型ガラス / フロストは 2026年4月で対象外、
\t\t * が確認できた。アルゴン入り Low-E を P 判定する旧ルールは誤りだった。
\t\t *
\t\t * シリーズによっては P がそもそも存在しない (LIXIL インプラスは S 一律)
\t\t * ため、最終的には PFC で商品単位の上限を上書きできる仕組みが必要。
\t\t */
\t\tfunction detectGlassPerformance(glassName) {
\t\t\tif (!glassName) return null;
\t\t\tvar n = String(glassName);
\t\t\t// 補助対象外: 単板 / 和紙調 / 防音 / 防犯 / 型ガラス・フロスト (Low-E ガス無の型は 2026/4 で対象外)
\t\t\tif (/単ガラス|単板|和紙調|防音|防犯|複層\\/型|型ガラス|フロスト/.test(n)) return null;
\t\t\t// P (SS): 真空断熱ガラスのみ
\t\t\tif (/真空断熱/.test(n)) return 'P';
\t\t\t// S: Low-E 系のみ (アルゴン入りでも S 止まり)
\t\t\tif (/Low-?E/i.test(n)) return 'S';
\t\t\t// 一般複層 / ブラインドイン複層 / 複層強化 など Low-E 無しの複層は補助対象外
\t\t\treturn null;
\t\t}
\t\t/**
\t\t * 幅 mm × 高さ mm からサイズ区分 'G' (≥4.0㎡) / 'L' (2.8-3.9) / 'M' (1.6-2.7) / 'S' (0.2-1.5) / null.
\t\t * null = 補助対象外 (0.2㎡ 未満).
\t\t */
\t\tfunction detectSizeClass(w_mm, h_mm) {
\t\t\tvar w = parseFloat(w_mm) || 0;
\t\t\tvar h = parseFloat(h_mm) || 0;
\t\t\tif (w <= 0 || h <= 0) return null;
\t\t\tvar area = (w * h) / 1000000.0;
\t\t\tif (area < 0.2) return null;
\t\t\tif (area < 1.6) return 'S';
\t\t\tif (area < 2.8) return 'M';
\t\t\tif (area < 4.0) return 'L';
\t\t\treturn 'G';
\t\t}
\t\tfunction lookupSubsidyAmount(performance, sizeClass) {
\t\t\tif (!performance || !sizeClass) return 0;
\t\t\tvar t = WINDOW_SUBSIDY_MATRIX[getCurrentHousingKey()];
\t\t\tif (!t || !t[performance]) return 0;
\t\t\treturn t[performance][sizeClass] || 0;
\t\t}
\t\t/**
\t\t * mm 入力値を ladder バケット文字列に変換する.
\t\t * bucketizeMm(1750, [\"100cm まで\",\"150cm まで\",\"200cm まで\",\"300cm まで\"]) → \"200cm まで\"
\t\t * - 入力が空 or 0 のときはそのまま返す (未入力扱い)
\t\t * - 入力がラダー最大を超えるときは最大バケットを返す (= 価格上限の保護)
\t\t * - 入力文字列が既にラダーラベルそのものなら無変換 (互換のため)
\t\t */
\t\tfunction bucketizeMm(input, ladder) {
\t\t\tif (!input && input !== 0) return '';
\t\t\tif (!ladder || ladder.length === 0) return input;
\t\t\tvar s = String(input).trim();
\t\t\tif (s === '') return '';
\t\t\tif (ladder.indexOf(s) >= 0) return s;
\t\t\tvar mm = parseMm(s);
\t\t\tif (mm <= 0) return s;
\t\t\tvar withMax = ladder.map(function(b) { return { label: b, max: parseMm(b) }; });
\t\t\twithMax.sort(function(a, b) { return a.max - b.max; });
\t\t\tfor (var i = 0; i < withMax.length; i++) {
\t\t\t\tif (mm <= withMax[i].max) return withMax[i].label;
\t\t\t}
\t\t\treturn withMax[withMax.length - 1].label;
\t\t}
\t\t/**
\t\t * pp 配列から該当 1 行を返す. 完全一致優先、見つからなければ最初の候補.
\t\t * 軸: subtype (option1) / w / h / m / c. axisMatch は既存ロジックと同じ.
\t\t * sale_type=2 では pw_val / ph_val に mm 数値が来るため、内部で bucketizeMm
\t\t * を通してから既存マッチングに渡す.
\t\t */
\t\tfunction lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val) {
\t\t\tif (!pp || pp.length === 0) return null;
\t\t\tvar pw_bucket = bucketizeMm(pw_val, PP_W_LADDER);
\t\t\tvar ph_bucket = bucketizeMm(ph_val, PP_H_LADDER);
\t\t\tvar axMatch = function(input, value) {
\t\t\t\treturn input == value || input === '指定なし' || value === '' || value == null;
\t\t\t};
\t\t\tvar colMatch = function(input, value) {
\t\t\t\tif (axMatch(input, value)) return true;
\t\t\t\tif (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t\treturn value.split('/').some(function(s) { return s.trim() === input; });
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t};
\t\t\tvar candidates = pp.filter(function(el) {
\t\t\t\treturn axMatch(pw_bucket, el.w)
\t\t\t\t\t&& axMatch(ph_bucket, el.h)
\t\t\t\t\t&& axMatch(pm_val, el.m)
\t\t\t\t\t&& axMatch(subtype, el.option1);
\t\t\t});
\t\t\tfor (var i = 0; i < candidates.length; i++) {
\t\t\t\tif (colMatch(pc_val, candidates[i].c)) return candidates[i];
\t\t\t}
\t\t\treturn candidates[0] || null;
\t\t}
\t\t/**
\t\t * \"1000mm\" / \"200cm\" / \"1.0m\" / 単位なし → mm に正規化して返す.
\t\t * UI 上の「200cm まで」等の文字列をそのまま渡せるようにする.
\t\t */
\t\tfunction parseMm(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)/);
\t\t\tif (!m) return 0;
\t\t\tvar num = parseFloat(m[1]);
\t\t\tif (/mm/i.test(str)) return num;
\t\t\tif (/cm/i.test(str)) return num * 10;
\t\t\tif (/(^|\\d)\\s*m(\$|\\W)/i.test(str)) return num * 1000;
\t\t\treturn num;
\t\t}
\t\t/**
\t\t * 1 タイプブロックから入力を読み、pp lookup → 単価・補助金額を計算して返す.
\t\t * incomplete=true: 軸のどれかが未選択 → 計算しない (UI で「未選択」を示すため).
\t\t */
\t\tfunction collectWindowTypeRow(block) {
\t\t\tvar get = function(axis) {
\t\t\t\t// radio / checkbox は :checked、それ以外 (number/text) は値そのまま.
\t\t\t\tvar radio = block.querySelector('input[data-axis=\"' + axis + '\"]:checked');
\t\t\t\tif (radio) return radio.value;
\t\t\t\tvar any = block.querySelector('input[data-axis=\"' + axis + '\"]');
\t\t\t\tif (!any) return '';
\t\t\t\tif (any.type === 'radio' || any.type === 'checkbox') return '';
\t\t\t\treturn (any.value || '').trim();
\t\t\t};
\t\t\tvar setqtyEl = block.querySelector('input[data-axis=\"setqty\"]');
\t\t\tvar subtype = get('subtype');
\t\t\tvar pw_val = get('pw');
\t\t\tvar ph_val = get('ph');
\t\t\tvar pm_val = get('pm');
\t\t\tvar pc_val = get('pc');
\t\t\tvar setqty = setqtyEl ? Math.max(1, parseInt(setqtyEl.value) || 1) : 1;
\t\t\tvar row = {
\t\t\t\tsubtype: subtype, pw: pw_val, ph: ph_val, pm: pm_val, pc: pc_val, setqty: setqty,
\t\t\t\tunit_price_exc: 0, unit_ct_exc: 0, subsidy: 0,
\t\t\t\tsize_class: null, glass_perf: null,
\t\t\t\tincomplete: false
\t\t\t};
\t\t\t// p_option1 / p_w / p_h / p_m / color のいずれかが商品データに無いときは未選択でも完了扱いにする.
\t\t\t// (例: 商品によっては subtype が無い場合がある)
\t\t\tvar hasSubtype = !!block.querySelector('input[data-axis=\"subtype\"]');
\t\t\tvar hasPw = !!block.querySelector('input[data-axis=\"pw\"]');
\t\t\tvar hasPh = !!block.querySelector('input[data-axis=\"ph\"]');
\t\t\tvar hasPm = !!block.querySelector('input[data-axis=\"pm\"]');
\t\t\tvar hasPc = !!block.querySelector('input[data-axis=\"pc\"]');
\t\t\tif ((hasSubtype && !subtype) || (hasPw && !pw_val) || (hasPh && !ph_val)
\t\t\t || (hasPm && !pm_val) || (hasPc && !pc_val)) {
\t\t\t\trow.incomplete = true;
\t\t\t\treturn row;
\t\t\t}
\t\t\tvar ppRow = lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val);
\t\t\tif (ppRow) {
\t\t\t\trow.unit_price_exc = parseInt(ppRow.price) || 0;
\t\t\t\trow.unit_ct_exc = parseInt(ppRow.ct) || 0;
\t\t\t}
\t\t\t// ガラス名検出 → シリーズ上限 → subtype 上限 → 商品上限 の順で min クリップ.
\t\t\t// 例: LiteU (SERIES_GRADE_CAP_VAL=null) は Low-E でも null に落ちて補助対象外.
\t\t\t// 例: ウチリモの「内開き窓」subtype は真空ガラスでも S に落ちる.
\t\t\trow.glass_perf = finalizeGlassGrade(detectGlassPerformance(pm_val), subtype);
\t\t\trow.size_class = detectSizeClass(parseMm(pw_val), parseMm(ph_val));
\t\t\trow.subsidy = lookupSubsidyAmount(row.glass_perf, row.size_class);
\t\t\treturn row;
\t\t}
\t\t/**
\t\t * sale_type=2 用集計: 全タイプから合計を出し DOM 更新.
\t\t * 計算式 (税抜→税込で出口で 1.10 倍):
\t\t * 商品金額 = Σ(各タイプ単価 × set_qty)
\t\t * 基本工事費 = 1 回分 (各タイプ pp.ct のうち最初に得た非ゼロ値)
\t\t * 補助金合計 = Σ(各タイプ補助金 × set_qty)
\t\t * 実質支払額 = (商品+ct+option) 税込 - 補助金合計
\t\t */
\t\tfunction recalcAllForSaleType2() {
\t\t\tif (typeof SALE_TYPE_ID === 'undefined' || SALE_TYPE_ID != 2) return;
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text('価格データ準備中');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t['#mitsumori_goukei','#mitsumori_off','#mitsumori_price','#maker_price',
\t\t\t\t '#mitsumori_ct','#mitsumori_option','#mitsumori_kei','#mitsumori_shoukei','#mitsumori_tax']
\t\t\t\t .forEach(function(s){ \$(s).text('---円'); });
\t\t\t\treturn;
\t\t\t}
\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\tif (blocks.length === 0) return;
\t\t\tvar rows = [];
\t\t\tvar hasIncomplete = false;
\t\t\tvar baseCt = 0;
\t\t\tvar hasAnyPriced = false;
\t\t\tblocks.forEach(function(b) {
\t\t\t\tvar r = collectWindowTypeRow(b);
\t\t\t\trows.push({ block: b, row: r });
\t\t\t\tif (r.incomplete) hasIncomplete = true;
\t\t\t\tif (r.unit_ct_exc > 0 && baseCt === 0) baseCt = r.unit_ct_exc;
\t\t\t\tif (r.unit_price_exc > 0) hasAnyPriced = true;
\t\t\t\tvar subSpan = b.querySelector('.wt-subsidy-amount');
\t\t\t\tif (subSpan) subSpan.textContent = r.incomplete ? '―' : Math.round(r.subsidy * r.setqty).toLocaleString();
\t\t\t});
\t\t\tif (hasIncomplete || !hasAnyPriced) {
\t\t\t\t\$('#mitsumori_message').text('窓タイプを選択してください');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tvar sumPriceExc = 0, sumSubsidy = 0, totalPanes = 0;
\t\t\trows.forEach(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\tsumPriceExc += r.unit_price_exc * r.setqty;
\t\t\t\tsumSubsidy += r.subsidy * r.setqty;
\t\t\t\tif (r.unit_price_exc > 0) totalPanes += r.setqty;
\t\t\t});
\t\t\t// 内窓 工事費(顧客最終回答): 1枚目 22,000円 + 2枚目以降 1枚あたり +5,000円(税込表示額)。
\t\t\t// 既存パイプライン整合のため税抜(ctExc)も用意(税行 taxAmt 用)。商品購入のみは 0。
\t\t\tvar WINDOW_CT_BASE = 22000, WINDOW_CT_ADD = 5000;
\t\t\tvar ctIncTarget = purchaseOnly ? 0 : (WINDOW_CT_BASE + Math.max(0, totalPanes - 1) * WINDOW_CT_ADD);
\t\t\tvar ctExc = purchaseOnly ? 0 : Math.round(ctIncTarget / (1 + TAX_RATE));
\t\t\tvar optExc = purchaseOnly ? 0 : (collectOptions().total || 0);
\t\t\tvar sumPriceInc = Math.round(sumPriceExc * (1 + TAX_RATE));
\t\t\tvar ctInc = ctIncTarget;
\t\t\tvar optInc = Math.round(optExc * (1 + TAX_RATE));
\t\t\tvar goukeiInc = sumPriceInc + ctInc + optInc;
\t\t\t// 窓リノベ2026 申請条件:
\t\t\t// - 補助金合計 ≥ 50,000 円 (5 万円未満は申請不可 → 還元 0 円扱い)
\t\t\t// - 1 戸あたり上限 1,000,000 円 (住宅・非住宅240㎡以下)
\t\t\t// ※ 非住宅 240㎡超の 10,000,000 円上限は対象外 (商品設計時に別扱い想定)
\t\t\tvar SUBSIDY_MIN_AMOUNT = 50000;
\t\t\tvar SUBSIDY_MAX_PER_UNIT = 1000000;
\t\t\tvar subsidyRawSum = sumSubsidy;
\t\t\tvar subsidyEligible = subsidyRawSum >= SUBSIDY_MIN_AMOUNT;
\t\t\tvar subsidyAmt = 0;
\t\t\tvar subsidyNote = '';
\t\t\tif (subsidyEligible) {
\t\t\t\tif (subsidyRawSum > SUBSIDY_MAX_PER_UNIT) {
\t\t\t\t\tsubsidyAmt = SUBSIDY_MAX_PER_UNIT;
\t\t\t\t\tsubsidyNote = '※補助上限 ' + SUBSIDY_MAX_PER_UNIT.toLocaleString()
\t\t\t\t\t\t+ '円 超過分は控除対象外(補助金合計 ' + subsidyRawSum.toLocaleString() + '円)';
\t\t\t\t} else {
\t\t\t\t\tsubsidyAmt = subsidyRawSum;
\t\t\t\t}
\t\t\t} else if (subsidyRawSum > 0) {
\t\t\t\tsubsidyNote = '※補助金合計が 5 万円未満のため申請対象外です('
\t\t\t\t\t+ subsidyRawSum.toLocaleString() + '円)';
\t\t\t} else if (SERIES_GRADE_CAP_VAL === null) {
\t\t\t\t// LiteU 等の単板構成シリーズ: グレード判定で必ず null になる
\t\t\t\tsubsidyNote = '※本商品は補助金(先進的窓リノベ2026事業)対象外です';
\t\t\t} else if (PRODUCT_GRADE_CAP === null) {
\t\t\t\tsubsidyNote = '※本商品は補助金対象外として登録されています';
\t\t\t}
\t\t\tvar implementedInc = Math.max(0, goukeiInc - subsidyAmt);
\t\t\tvar taxAmt = Math.round((sumPriceExc + ctExc + optExc) * TAX_RATE);
\t\t\t\$('#mitsumori_message').text(subsidyNote);
\t\t\t\$('#mitsumori_btn').show();
\t\t\t\$('#mitsumori_goukei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_price').text(sumPriceInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_ct').text(ctInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_option').text(optInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_off').text((subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円');
\t\t\t\$('#maker_price').text('---円'); // 補助金窓では未使用
\t\t\t\$('#mitsumori_kei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_shoukei').text(implementedInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_tax').text(taxAmt.toLocaleString() + '円');
\t\t\t// 内訳を mitsumori_json に詰めて hidden input にセット (PDF / カート連携用)
\t\t\tvar window_types = rows.map(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\t// 幅 / 高さは数値入力 (mm) が来るので \"1750mm\" 形式で保存する.
\t\t\t\t// 古い radio 由来の \"200cm まで\" 形式が来た場合はそのまま保存して互換.
\t\t\t\tvar w_mm = parseMm(r.pw);
\t\t\t\tvar h_mm = parseMm(r.ph);
\t\t\t\tvar w_save = (w_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.pw))) ? (w_mm + 'mm') : r.pw;
\t\t\t\tvar h_save = (h_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.ph))) ? (h_mm + 'mm') : r.ph;
\t\t\t\treturn {
\t\t\t\t\tsubtype: r.subtype,
\t\t\t\t\tw: w_save,
\t\t\t\t\th: h_save,
\t\t\t\t\tglass: r.pm,
\t\t\t\t\tcolor: r.pc,
\t\t\t\t\tsetqty: r.setqty,
\t\t\t\t\tunit_price_inc: Math.round(r.unit_price_exc * (1 + TAX_RATE)),
\t\t\t\t\tline_total_inc: Math.round(r.unit_price_exc * r.setqty * (1 + TAX_RATE)),
\t\t\t\t\tsize_class: r.size_class,
\t\t\t\t\tglass_perf: r.glass_perf,
\t\t\t\t\tsubsidy_unit: r.subsidy,
\t\t\t\t\tsubsidy_total: r.subsidy * r.setqty
\t\t\t\t};
\t\t\t});
\t\t\tvar opCalc2 = collectOptions();
\t\t\tvar mitsumori_json = {
\t\t\t\t\"mitsumori_goukei\": goukeiInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_price\": sumPriceInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_ct\": ctInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_option\": optInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_off\": (subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円',
\t\t\t\t\"maker_price\": '---円',
\t\t\t\t\"product_id\": {{ Product.id }},
\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\"housing_key\": getCurrentHousingKey(),
\t\t\t\t\"series_key\": DETECTED_SERIES,
\t\t\t\t\"series_grade_cap\": (SERIES_GRADE_CAP_VAL === undefined) ? null : SERIES_GRADE_CAP_VAL,
\t\t\t\t\"product_grade_cap\":(PRODUCT_GRADE_CAP === undefined) ? null : PRODUCT_GRADE_CAP,
\t\t\t\t\"window_types\": window_types,
\t\t\t\t\"subsidy_total\": subsidyAmt,
\t\t\t\t\"subsidy_raw\": subsidyRawSum,
\t\t\t\t\"subsidy_eligible\": subsidyEligible,
\t\t\t\t\"subsidy_note\": subsidyNote,
\t\t\t\t\"op_items\": opCalc2.items
\t\t\t};
\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\trenderWindowTypesModalRows(window_types, subsidyAmt);
\t\t}
\t\t/**
\t\t * sale_type=2 用: 見積モーダル明細テーブルを window_types で動的展開.
\t\t * - 既存の商品名行 (1 行目) は hide() し、各タイプ行を上に挿入
\t\t * - 基本工事費行はそのまま (#mitsumori_ct_01 / _02 が更新されている)
\t\t * - 補助金 (割引額) 行を末尾に追加
\t\t * - 既存の renderOptionDetailRows と共存できるよう class で区別
\t\t */
\t\tfunction renderWindowTypesModalRows(window_types, subsidyAmt) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t// 既存の動的行を全削除 (opt-row は既存実装、wt-row / wt-subsidy-row は今回追加)
\t\t\t\$tbody.find('tr.wt-row, tr.wt-subsidy-row').remove();
\t\t\tvar \$itemRow = \$tbody.find('tr').first();
\t\t\tvar fmt = new Intl.NumberFormat('ja-JP');
\t\t\tif (!window_types || window_types.length === 0) {
\t\t\t\t// 集計対象なし → 商品名行を表示に戻す
\t\t\t\t\$itemRow.show();
\t\t\t\treturn;
\t\t\t}
\t\t\twindow_types.forEach(function(wt, i) {
\t\t\t\tvar label = '窓タイプ' + (i + 1) + ':'
\t\t\t\t\t+ (wt.subtype || '') + ' / '
\t\t\t\t\t+ (wt.w || '') + '×' + (wt.h || '') + ' / '
\t\t\t\t\t+ (wt.glass || '') + ' / '
\t\t\t\t\t+ (wt.color || '');
\t\t\t\tvar \$tr = \$('<tr class=\"wt-row\"></tr>')
\t\t\t\t\t.append('<td>' + label + '</td>')
\t\t\t\t\t.append('<td>' + wt.setqty + '</td>')
\t\t\t\t\t.append('<td>セット</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.unit_price_inc) + '円</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.line_total_inc) + '円</td>');
\t\t\t\t\$itemRow.before(\$tr);
\t\t\t});
\t\t\t// 元の商品名行は複数タイプに置換されたので非表示
\t\t\t\$itemRow.hide();
\t\t\t// 補助金(割引額)行を末尾に追加
\t\t\tif (subsidyAmt > 0) {
\t\t\t\tvar \$subRow = \$('<tr class=\"wt-subsidy-row\"></tr>')
\t\t\t\t\t.append('<td>補助金(割引額)</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>');
\t\t\t\t\$tbody.append(\$subRow);
\t\t\t}
\t\t}
\t\t// 公開: onWindowTypeAxisChange (UI 骨格 task 1) からも呼ばれる
\t\twindow.recalcAll = recalcAllForSaleType2;
\t\t// 公開: ガラス選択肢が補助金対象か (窓タイプブロック生成時のバッジ判定に使う).
\t\t// subtype は P→S に落とすことはあっても null にはしないため、性能区分の
\t\t// 対象/対象外は subtype に依存しない。ここでは series/product 上限のみ適用し、
\t\t// finalizeGlassGrade が null でなければ「補助金対象ガラス」と判定する。
\t\twindow.glassYieldsSubsidy = function(glassName) {
\t\t\tif (!glassName) return false;
\t\t\treturn finalizeGlassGrade(detectGlassPerformance(glassName), '') !== null;
\t\t};
\t\tfunction mitsumori_simulation(type , value_id){
\t\t\t// sale_type=2 (補助金窓) は複数タイプ集計 UI に統合済み. 既存 mitsumori_simulation は使わない.
\t\t\tif (typeof SALE_TYPE_ID !== 'undefined' && SALE_TYPE_ID == 2) {
\t\t\t\t// type/value_id が op\\d+ (施工オプション) の場合はグローバル変数を先に更新
\t\t\t\tif (type && /^op\\d+\$/.test(type) && value_id) {
\t\t\t\t\tvar v = \$('#'+value_id).val();
\t\t\t\t\tif (type === 'op0') op0 = v;
\t\t\t\t\tif (type === 'op1') op1 = v;
\t\t\t\t\tif (type === 'op2') op2 = v;
\t\t\t\t\tif (type === 'op3') op3 = v;
\t\t\t\t\tif (type === 'op4') op4 = v;
\t\t\t\t\tif (type === 'op5') op5 = v;
\t\t\t\t\tif (type === 'op6') op6 = v;
\t\t\t\t\tif (type === 'op7') op7 = v;
\t\t\t\t\tif (type === 'op8') op8 = v;
\t\t\t\t\tif (type === 'op9') op9 = v;
\t\t\t\t\tif (type === 'op10') op10 = v;
\t\t\t\t}
\t\t\t\trecalcAllForSaleType2();
\t\t\t\treturn;
\t\t\t}
\t\t\t// 価格データ未登録 (pp 行 0 件) の商品は axis 入力に依存せず
\t\t\t// 「価格データ準備中」を表示して終了する.
\t\t\t// (例: scrape 未対象の新規商品 — um のウチリモ 7487/7488 等)
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text(\"価格データ準備中\");
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\treturn;
\t\t\t}
\t\t\tif(type == \"pw\"){
\t\t\t\tpw = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pd\"){
\t\t\t\tpd = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"ph\"){
\t\t\t\tph = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pm\"){
\t\t\t\tpm = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pc\"){
\t\t\t\tpc = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option1\"){
\t\t\t\toption1 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option2\"){
\t\t\t\toption2 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"op0\"){ op0 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op1\"){ op1 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op2\"){ op2 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op3\"){ op3 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op4\"){ op4 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op5\"){ op5 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op6\"){ op6 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op7\"){ op7 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op8\"){ op8 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op9\"){ op9 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op10\"){ op10 = \$('#'+value_id).val(); }
\t\t\t// op0 が「商品購入のみ」のとき、他のオプション (op1..op10) を disable 化.
\t\t\t// 価格計算側 (calcGoukei の purchaseOnly 分岐) は既にゼロ化しているが、
\t\t\t// UI で選択可能に見えるとユーザーが混乱するため radio を完全に無効化する.
\t\t\t(function applyPurchaseOnlyUI() {
\t\t\t\tvar isPurchaseOnly = (op0 === '商品購入のみ');
\t\t\t\tfor (var k = 1; k <= 10; k++) {
\t\t\t\t\tvar \$inputs = \$('input[name=\"op' + k + '\"]');
\t\t\t\t\tif (\$inputs.length === 0) continue;
\t\t\t\t\t\$inputs.prop('disabled', isPurchaseOnly);
\t\t\t\t\tvar \$group = \$inputs.first().closest('.form-group');
\t\t\t\t\t\$group.css({
\t\t\t\t\t\t'opacity': isPurchaseOnly ? '0.4' : '1',
\t\t\t\t\t\t'pointer-events': isPurchaseOnly ? 'none' : 'auto'
\t\t\t\t\t});
\t\t\t\t}
\t\t\t})();
\t\t\t// 全 type 共通: 該当 radio を checked にし、ボタンの is-selected を付け替え + ラベル更新.
\t\t\t// value_id が指定されていて、対応する DOM 要素が opt-btn 配下にあれば適用する.
\t\t\t// (icheck-danger 形式から opt-btn 形式に統一した際、option1/option2/pw/pd/ph/pm/pc 等の
\t\t\t// クリックで is-selected が更新されない不具合があったため、op\\d+ 限定の処理を一般化)
\t\t\tif (value_id) {
\t\t\t\tvar \$clicked = \$('#' + value_id);
\t\t\t\tif (\$clicked.length && \$clicked.closest('.opt-btn').length) {
\t\t\t\t\t\$clicked.prop('checked', true);
\t\t\t\t\tvar groupName = \$clicked.attr('name');
\t\t\t\t\t\$('input[name=\"' + groupName + '\"]').closest('.opt-btn').removeClass('is-selected');
\t\t\t\t\t\$clicked.closest('.opt-btn').addClass('is-selected');
\t\t\t\t\tvar \$group = \$clicked.closest('.form-group');
\t\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\tif (\$label.length) {
\t\t\t\t\t\tvar labelText = \$label.text().split(':')[0].trim();
\t\t\t\t\t\t\$label.html(labelText + ': <span>' + \$clicked.val() + '</span>');
\t\t\t\t\t}
\t\t\t\t\t// op_data の price=0 & 解体/撤去/設置場所 オプションの場合、ON 選択時に「現場調査後に正式お見積もり」文言を表示.
\t\t\t\t\t// (twig 側で is_removal_unknown ブロックを描画済み。display 切替のみ JS で行う)
\t\t\t\t\tif (/^op\\d+\$/.test(type)) {
\t\t\t\t\t\tvar opIdx = type.replace('op', '');
\t\t\t\t\t\tvar opEntry = op_data[parseInt(opIdx)];
\t\t\t\t\t\tif (opEntry) {
\t\t\t\t\t\t\tvar \$note = \$group.find('.opt-survey-note[data-op-idx=\"' + opIdx + '\"]');
\t\t\t\t\t\t\tif (\$note.length) {
\t\t\t\t\t\t\t\tvar isOn = (\$clicked.val() === opEntry.on);
\t\t\t\t\t\t\t\t\$note.toggle(isOn);
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
\t\t\t\t\t\t// wd (sale_type=5) のステップ / デッキフェンス用の注記もここで切替.
\t\t\t\t\t\t// ステップ → deck_step (op0 だが op_data 範囲外), 必要 選択時に表示.
\t\t\t\t\t\tvar radioName = \$clicked.attr('name');
\t\t\t\t\t\tif (radioName === 'deck_step') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-step').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t} else if (radioName === 'deck_fence') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-fence').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t\t// 必須項目チェックは sale_type 1 系(カーポート/物置/フェンスなど価格マトリクス必要)に限定
\t\t\tvar requireMatrix = (SALE_TYPE_ID == 1 || SALE_TYPE_ID == 2 || SALE_TYPE_ID == 3 || SALE_TYPE_ID == 4 || SALE_TYPE_ID == 5 || SALE_TYPE_ID == 6 || SALE_TYPE_ID == 7 || SALE_TYPE_ID == 9);
\t\t\t// sale_type=3 (物置・ゴミステーション・照明 等) では「素材」を選択肢として扱わない.
\t\t\t// - mo/gs/sy は m が \"指定なし\" など名目的にしか入っていない
\t\t\t// - sl は m が空のままで matrix に行が来る
\t\t\t// そのため pm の必須チェックを sale_type=3 でスキップする。
\t\t\tvar pmRequired = (SALE_TYPE_ID != 3);
\t\t\tif (requireMatrix) {
\t\t\t\tif(pmRequired && pm == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"素材を選択してください\");
\t\t\t\t}
\t\t\t\tif(ph == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"高さを選択してください\");
\t\t\t\t}
\t\t\t\tif(pd == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"奥行きを選択してください\");
\t\t\t\t}
\t\t\t\tif(pw == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"幅を選択してください\");
\t\t\t\t}
\t\t\t\tif(pc == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"カラーを選択してください\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t}
\t\t\t}
\t\t\tif(pw != \"\" && pd != \"\" && ph != \"\" && (!pmRequired || pm != \"\") && pc != \"\"){
\t\t\t\t\$('#mitsumori_btn').show();
\t\t\t\t// 入力コンテキスト(sale_type 別パラメータ)
\t\t\t\tvar ctx = {
\t\t\t\t\tset_count: parseInt(\$('#set_count').val()) || 1,
\t\t\t\t\tdaisu: parseInt(\$('#daisu').val()) || 1,
\t\t\t\t\tmaisu: parseInt(\$('#maisu').val()) || 3,
\t\t\t\t\tsuuryou: parseInt(\$('#suuryou').val()) || 1,
\t\t\t\t\tarea: (function(){
\t\t\t\t\t\t// tf(人工芝): 施工サイズ 縦(m)×横(m) から面積を算出し #area に反映.
\t\t\t\t\t\tvar L = parseFloat(\$('#tf_len').val()) || 0;
\t\t\t\t\t\tvar W = parseFloat(\$('#tf_wid').val()) || 0;
\t\t\t\t\t\tif (L > 0 && W > 0) { var a = L * W; \$('#area').val(a); return a; }
\t\t\t\t\t\treturn parseFloat(\$('#area').val()) || 0;
\t\t\t\t\t})(),
\t\t\t\t\ttf_len: parseFloat(\$('#tf_len').val()) || 0,
\t\t\t\t\ttf_wid: parseFloat(\$('#tf_wid').val()) || 0,
\t\t\t\t\ttf_qty: parseInt(\$('#tf_qty').val()) || 1,
\t\t\t\t\tquantityOnly: parseInt(\$('#quantity_only').val())|| 1,
\t\t\t\t\tmado_w: \$('#mado_w').val() || '',
\t\t\t\t\tmado_h: \$('#mado_h').val() || '',
\t\t\t\t\tmado_type: \$('input[name=mado_type]:checked').val() || '',
\t\t\t\t\tglass_type: \$('input[name=glass_type]:checked').val() || '',
\t\t\t\t\tdeck_step: \$('input[name=deck_step]:checked').val() || '',
\t\t\t\t\tdeck_fence: \$('input[name=deck_fence]:checked').val() || '',
\t\t\t\t};
\t\t\t\t// 施工オプション集計(残土処理を含む)
\t\t\t\tvar opCalc = collectOptions();
\t\t\t\tvar pp_matched = false;
\t\t\t\t// 各軸の汎用 axisMatch:
\t\t\t\t// user 選択 == matrix 値 / user \"指定なし\" / matrix 値が空
\t\t\t\tvar axisMatch = function(input, value){
\t\t\t\t return input == value || input == \"指定なし\" || value === \"\" || value == null;
\t\t\t\t};
\t\t\t\t// 色専用マッチャー: scraper のデータ形式に合わせて拡張する
\t\t\t\t// 1. 完全一致 / \"指定なし\" / 値が空 → 真 (axisMatch と同じ)
\t\t\t\t// 2. matrix 値が \"色1/色2/色3\" の形 (同価格グループ) → split して user 選択が含まれれば真
\t\t\t\t// scraper のロジック (scraper_price.py L765-779):
\t\t\t\t// 全色同価格 → c=\"\"、価格違いグループあり → 各 group を \"/\" 結合した色名で 1 行
\t\t\t\tvar colorMatch = function(input, value){
\t\t\t\t if (axisMatch(input, value)) return true;
\t\t\t\t if (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t var parts = value.split('/');
\t\t\t\t for (var idx = 0; idx < parts.length; idx++) {
\t\t\t\t if (parts[idx].trim() === input) return true;
\t\t\t\t }
\t\t\t\t }
\t\t\t\t return false;
\t\t\t\t};
\t\t\t\t// 他軸 (w/d/h/m + option1/option2) でマッチする pp 行を抽出.
\t\t\t\t// option1/option2 は um の subtype 等で使われる. axisMatch は free_area 側が
\t\t\t\t// 空のとき真を返すので、um 以外のカテゴリ (option 軸を使わない) でも影響なし.
\t\t\t\tvar candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m)
\t\t\t\t && axisMatch(option1, el.option1) && axisMatch(option2, el.option2);
\t\t\t\t});
\t\t\t\t// フォールバック: 全軸一致が 0 件のときに限り option1/option2 を無視して再マッチ。
\t\t\t\t// 玄関ドア等で option1(なし/ランマ付き)・option2(◯◯タイプ) が pm(開き方) から
\t\t\t\t// 導出可能な冗長軸で、未選択だと全軸 AND 一致を満たせず価格が出ない事象の救済。
\t\t\t\t// pm/幅/奥行/高さ は従来どおり一致を要求するため通常商品の価格選択に影響しない。
\t\t\t\tif (candidates.length === 0) {
\t\t\t\t candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m);
\t\t\t\t });
\t\t\t\t}
\t\t\t\tvar picked = null;
\t\t\t\t// 優先 1: 色も含めて完全一致 (\"色1/色2\" 形式の split match を含む)
\t\t\t\tfor (var ii = 0; ii < candidates.length; ii++) {
\t\t\t\t if (colorMatch(pc, candidates[ii].c)) { picked = candidates[ii]; break; }
\t\t\t\t}
\t\t\t\t// 優先 2: 完全一致なし & user の pc が候補のどの c 値にも該当しない (= 命名違い等)
\t\t\t\t// かつ候補全行で price が一致する場合は、色軸を実質無視して先頭行を採用.
\t\t\t\t// 例 id=3353: pp.c は \"ステンカラー+...\" 6種だが price は全て同じなので
\t\t\t\t// SM(スミ) を選んでも安全に最初の行の価格を返せる.
\t\t\t\tif (!picked && candidates.length > 0) {
\t\t\t\t var ppCsInCand = candidates.map(function(r){ return r.c || ''; });
\t\t\t\t var pcAbsent = (pc !== '' && pc !== '指定なし' && ppCsInCand.indexOf(pc) === -1
\t\t\t\t && ppCsInCand.every(function(v){ return v.indexOf('/') === -1 || v.split('/').map(function(s){return s.trim();}).indexOf(pc) === -1; }));
\t\t\t\t if (pcAbsent) {
\t\t\t\t var uniqPrices = new Set();
\t\t\t\t candidates.forEach(function(r){ uniqPrices.add(String(r.price)); });
\t\t\t\t if (uniqPrices.size === 1) {
\t\t\t\t // 全候補同価格 → 色軸を wildcard 扱いで OK
\t\t\t\t picked = candidates[0];
\t\t\t\t }
\t\t\t\t // 価格が異なる場合は意図的に picked=null のまま「対応しておりません」.
\t\t\t\t }
\t\t\t\t}
\t\t\t\tpp.forEach((el) => {
\t\t\t\t if (el === picked) {
\t\t\t\t\tpp_matched = true;
\t\t\t\t\t// tg block-keyed オプション差額を集計 (tg 以外は total=0)
\t\t\t\t\tvar oiCalc = collectOptionItems(el.w || '', el.d || '');
\t\t\t\t\t// tg ブロックに合わせてラジオを再描画 (tg 以外は no-op)
\t\t\t\t\trenderOptionItemRadios(el.w || '', el.d || '');
\t\t\t\t\t// fe ブロックの種類×段数 サブ radio (fe 以外/未設定は no-op)
\t\t\t\t\trenderFeBlockRadios();
\t\t\t\t\t// fe ご希望のフェンス設置方法 — 「既存ブロックに穴空け」 entry の連動表示
\t\t\t\t\tupdateFeOpConditionalVisibility();
\t\t\t\t\tvar calc = calcGoukei(el, opCalc.total, ctx);
\t\t\t\t\tvar goukei = calc.goukei;
\t\t\t\t\tvar price = calc.price;
\t\t\t\t\tvar ct = calc.ct;
\t\t\t\t\tvar optionSum = calc.opt;
\t\t\t\t\t// tf(人工芝): 必要枚数入力へ算出結果を反映(施工サイズ入力時は上書き、
\t\t\t\t\t// 直接指定時は同値なので実質変化なし。要素が無い sale_type では no-op)
\t\t\t\t\tvar \$tfQty = \$('#tf_qty');
\t\t\t\t\tif (\$tfQty.length) \$tfQty.val(calc.qty || 1);
\t\t\t\t\t// オプション差額は税抜 → 税込に変換して合計に加算
\t\t\t\t\tvar oiIncTax = toIncTax(oiCalc.total);
\t\t\t\t\tgoukei += oiIncTax;
\t\t\t\t\tprice += oiIncTax; // 差額は本体価格扱いとして mitsumori_price にも加算
\t\t\t\t\t// maker_price も scraper が税抜で保存しているため税込に変換
\t\t\t\tvar makerPrice = toIncTax(parseInt(el.maker_price) || 0);
\t\t\t\t\t\$('#mitsumori_message').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_off').text(formatter.format(price - makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_price').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#maker_price').text(formatter.format(makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_option').text(formatter.format(optionSum) + \"円\");
\t\t\t\t\t\$('#mitsumori_kei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_01').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_02').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_01').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_02').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei_02').text(formatter.format(goukei) + \"円\");
\t\t\t\t\tvar shoukei = goukei / 1.1;
\t\t\t\t\tvar tax = parseInt(goukei - shoukei);
\t\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + \"円\");
\t\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + \"円\");
\t\t\t\t\t// PDF 明細用:オプション内訳テーブルを差し込む (施工オプション + tg block オプション)
\t\t\t\t\trenderOptionDetailRows(opCalc.items.concat(oiCalc.items.map(function(it){
\t\t\t\t\t\treturn { name: it.name, value: it.label, price: it.diff };
\t\t\t\t\t})));
\t\t\t\t }
\t\t\t\t});
\t\t\t\tif (!pp_matched) {
\t\t\t\t\t\$('#mitsumori_message').text(\"この組み合わせは対応しておりません\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\t}
\t\t\t\t// mitsumori_json: バック側に送信する見積データ
\t\t\t\tvar mitsumori_json = { \"mitsumori_goukei\": \$('#mitsumori_goukei').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_goukei_02\": \$('#mitsumori_goukei_02').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_price\": \$('#mitsumori_price').text(),
\t\t\t\t\t\t\t\t\t\t\"maker_price\": \$('#maker_price').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_off\": \$('#mitsumori_off').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_ct\": \$('#mitsumori_ct').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_option\": \$('#mitsumori_option').text(),
\t\t\t\t\t\t\t\t\t\t\"product_id\": {{ Product.id }},
\t\t\t\t\t\t\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\t\t\t\t\t\t\"pw\": pw,
\t\t\t\t\t\t\t\t\t\t\"pd\": pd,
\t\t\t\t\t\t\t\t\t\t\"ph\": ph,
\t\t\t\t\t\t\t\t\t\t\"pm\": pm,
\t\t\t\t\t\t\t\t\t\t\"pc\": pc,
\t\t\t\t\t\t\t\t\t\t\"op\": [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10],
\t\t\t\t\t\t\t\t\t\t\"op_items\": opCalc.items,
\t\t\t\t\t\t\t\t\t\t\"mado_w\": ctx.mado_w,
\t\t\t\t\t\t\t\t\t\t\"mado_h\": ctx.mado_h,
\t\t\t\t\t\t\t\t\t\t\"mado_type\": ctx.mado_type,
\t\t\t\t\t\t\t\t\t\t\"glass_type\": ctx.glass_type,
\t\t\t\t\t\t\t\t\t\t\"set_count\": ctx.set_count,
\t\t\t\t\t\t\t\t\t\t\"daisu\": ctx.daisu,
\t\t\t\t\t\t\t\t\t\t\"maisu\": ctx.maisu,
\t\t\t\t\t\t\t\t\t\t\"suuryou\": ctx.suuryou,
\t\t\t\t\t\t\t\t\t\t\"area\": ctx.area,
\t\t\t\t\t\t\t\t\t\t\"tf_len\": ctx.tf_len,
\t\t\t\t\t\t\t\t\t\t\"tf_wid\": ctx.tf_wid,
\t\t\t\t\t\t\t\t\t\t\"tf_qty\": \$('#tf_qty').val(),
\t\t\t\t\t\t\t\t\t\t\"deck_step\": ctx.deck_step,
\t\t\t\t\t\t\t\t\t\t\"deck_fence\": ctx.deck_fence };
\t\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\t}
\t\t}
\t\t// PDF/モーダル明細の動的差し替え(基本工事費の次にオプション行を追加)
\t\tfunction renderOptionDetailRows(items) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t\$tbody.find('tr.opt-row').remove();
\t\t\tvar anchorRow = \$tbody.find('tr').filter(function(){
\t\t\t\treturn \$(this).find('td:first').text().indexOf('残土') !== -1
\t\t\t\t\t|| \$(this).find('td:first').text().indexOf('基本工事費') !== -1;
\t\t\t}).last();
\t\t\titems.forEach(function(it){
\t\t\t\tif (!it.name || !it.value) return;
\t\t\t\tvar priceTxt = it.price > 0
\t\t\t\t\t? formatter.format(it.price) + '円'
\t\t\t\t\t: '0円';
\t\t\t\tvar \$tr = \$('<tr class=\"opt-row\"></tr>')
\t\t\t\t\t.append('<td>' + it.name + ':' + it.value + '</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>' + priceTxt + '</td>')
\t\t\t\t\t.append('<td>' + (it.price > 0 ? formatter.format(it.price) + '円' : '') + '</td>');
\t\t\t\tif (anchorRow.length) {
\t\t\t\t\tanchorRow.after(\$tr);
\t\t\t\t\tanchorRow = \$tr;
\t\t\t\t} else {
\t\t\t\t\t\$tbody.append(\$tr);
\t\t\t\t}
\t\t\t});
\t\t}
\t\t// 見積書モーダルを開く直前に、右側「現在のお見積り額」パネルの表示値を
\t\t// モーダル内の対応 ID にコピーして金額の食い違いを防ぐ。
\t\t// pw/pd/ph/pm が未選択で mitsumori_simulation の full update に到達しない場合でも、
\t\t// パネル側の値(HTML 静的初期値 or 直近の simulation 結果)が modal にも反映される。
\t\tfunction syncMitsumoriModalFromPanel() {
\t\t\tvar goukeiText = \$('#mitsumori_goukei').text();
\t\t\tvar priceText = \$('#mitsumori_price').text();
\t\t\tvar ctText = \$('#mitsumori_ct').text();
\t\t\t\$('#mitsumori_kei').text(goukeiText);
\t\t\t\$('#mitsumori_price_01').text(priceText);
\t\t\t\$('#mitsumori_price_02').text(priceText);
\t\t\t\$('#mitsumori_ct_01').text(ctText);
\t\t\t\$('#mitsumori_ct_02').text(ctText);
\t\t\t\$('#mitsumori_goukei_02').text(goukeiText);
\t\t\t// 小計 / 消費税 は税込 goukei から逆算
\t\t\tvar num = parseInt(goukeiText.replace(/[^\\d-]/g, ''), 10);
\t\t\tif (!isNaN(num) && num > 0) {
\t\t\t\tvar shoukei = Math.round(num / 1.1);
\t\t\t\tvar tax = num - shoukei;
\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(shoukei) + '円');
\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + '円');
\t\t\t} else {
\t\t\t\t\$('#mitsumori_shoukei').text('---円');
\t\t\t\t\$('#mitsumori_tax').text('---円');
\t\t\t}
\t\t}
\t\t\$(document).on('show.bs.modal', '#modal-mitsumori', function () {
\t\t\tsyncMitsumoriModalFromPanel();
\t\t});
{# pc の auto-init: pw/pd/ph/pm と同じく p_c(matrix 派生)の length==1 or 全空で「指定なし」化.
search_word(color) が空の「複合色」型商品で pc が空のまま放置されて
「カラーを選択してください」固定になるバグの修正.
search_word に登録された name があれば優先採用. #}
{% if p_c and (p_c|length == 1 or p_c|join == \"\") %}
pc = \"指定なし\";
{% for pc_val in p_c %}{% if pc_val %} pc = \"{{ pc_val }}\"; {% endif %}{% endfor %}
{% if color and color|length == 1 %}
{% for cc in color %}{% if cc and cc['name'] %} pc = \"{{ cc['name'] }}\"; {% endif %}{% endfor %}
{% endif %}
{% elseif color and color|length == 1 %}
pc = \"指定なし\";
\t\t\t{% for cc in color %}{% if cc and cc['name'] %} pc = \"{{ cc['name'] }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_w and (p_w|length == 1 or p_w|join == \"\") %}
pw = \"指定なし\";
\t\t\t{% for pw in p_w %}{% if pw %} pw = \"{{ pw }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_d and (p_d|length == 1 or p_d|join == \"\") %}
pd = \"指定なし\";
\t\t\t{% for pd in p_d %}{% if pd %} pd = \"{{ pd }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_h and (p_h|length == 1 or p_h|join == \"\") %}
ph = \"指定なし\";
\t\t\t{% for ph in p_h %}{% if ph %} ph = \"{{ ph }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_m and (p_m|length == 1 or p_m|join == \"\") %}
pm = \"指定なし\";
\t\t\t{% for pm in p_m %}{% if pm %} pm = \"{{ pm }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{# p_option1 / p_option2 の auto-init: length==1 or 全空で JS 変数を埋める #}
{% if p_option1 and (p_option1|length == 1 or p_option1|join == \"\") %}
option1 = \"\";
\t\t\t{% for opt1 in p_option1 %}{% if opt1 %} option1 = \"{{ opt1|e('js') }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_option2 and (p_option2|length == 1 or p_option2|join == \"\") %}
option2 = \"\";
\t\t\t{% for opt2 in p_option2 %}{% if opt2 %} option2 = \"{{ opt2|e('js') }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
\t\t// カラー radio が複数あるとき初期チェックが無いと「カラーを選択してください」固定になるので、
\t\t// 何もチェックされていなければ「最初の radio」を選択する。
\t\t// sale_type≠3 は name=\"color\", sale_type=3 は name=\"color3\".
\t\t//
\t\t// 注意:
\t\t// ・search_word(= radio の値)と pp.c(= matrix の色軸)は別の命名体系のケースがある
\t\t// (例 id=3353: radio=\"SM(スミ)\" / pp.c=\"ステンカラー+セピアブラウン\")
\t\t// ・pp.c に合わせて radio を選ぼうとしても文字列一致しないので無意味。
\t\t// ・単純に「先頭の radio」を選ぶ実装に戻し、マッチング側で命名体系違いを吸収する
\t\t// (pc が pp.c のどの値にもマッチしないときは色軸を wildcard 扱いにする)。
\t\t// ・.rp-section-label のテキストも忘れずに同期する(古い session 値が残ると
\t\t// \"ステンカラー+セピアブラウン\" のような表示と実際の radio が食い違う)。
\t\t(function autoSelectFirstColor(){
\t\t\tvar groups = ['color', 'color3'];
\t\t\tfor (var gi = 0; gi < groups.length; gi++) {
\t\t\t\tvar name = groups[gi];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\tpc = target.value;
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// 「カラー: <name>」表示の同期(古い mitsumori_json.pc が残らないように)
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// option1 / option2 / pw / pd / ph / pm (matrix 軸の radio 群) も同様に
\t\t// 「どれもチェックされていなければ先頭を選ぶ」を適用する.
\t\t// sale_type=2 の窓タイプ等で「初期表示時に一番初めの選択肢が選択されていない」事象を解消.
\t\t(function autoSelectFirstMatrixAxis(){
\t\t\tvar axes = [
\t\t\t\t{ name: 'pw', jsVar: 'pw' },
\t\t\t\t{ name: 'pd', jsVar: 'pd' },
\t\t\t\t{ name: 'ph', jsVar: 'ph' },
\t\t\t\t{ name: 'pm', jsVar: 'pm' },
\t\t\t\t{ name: 'glass_type', jsVar: 'pm' },
\t\t\t\t{ name: 'option1', jsVar: 'option1' },
\t\t\t\t{ name: 'option2', jsVar: 'option2' }
\t\t\t];
\t\t\tfor (var ai = 0; ai < axes.length; ai++) {
\t\t\t\tvar ax = axes[ai];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + ax.name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\t// グローバル JS 変数も埋める
\t\t\t\tif (ax.jsVar === 'pw') pw = target.value;
\t\t\t\telse if (ax.jsVar === 'pd') pd = target.value;
\t\t\t\telse if (ax.jsVar === 'ph') ph = target.value;
\t\t\t\telse if (ax.jsVar === 'pm') pm = target.value;
\t\t\t\telse if (ax.jsVar === 'option1') option1 = target.value;
\t\t\t\telse if (ax.jsVar === 'option2') option2 = target.value;
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// 取付/設置工事トグル(off 値が「商品購入のみ」のオプション)は、新規アクセス時に
\t\t// どちらの radio も未チェックのため初期価格が「商品購入のみ」= 基本工事費抜きになる。
\t\t// 顧客要望(#10)に合わせ、未選択時は「工事も希望する」(on 側) を初期選択し、
\t\t// 初期表示を基本工事費込みの最安値に統一する(色・寸法軸の先頭自動選択と同型)。
\t\t// ・判定キーは calcGoukei / applyPurchaseOnlyUI と同じ定数「商品購入のみ」。
\t\t// ・別用途で op{n} を流用する商品(ウッドデッキ deck_step 等)は radio 値に
\t\t// 「商品購入のみ」を含まないため対象外(既存挙動を壊さない)。
\t\t// ・mitsumori_json 復元やユーザー操作で既に選択済みなら尊重する。
\t\t(function autoSelectFirstInstall(){
\t\t\tfor (var i = 0; i <= 10; i++) {
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"op' + i + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\t// このグループが「商品購入のみ」を off に持つ工事トグルか判定し、
\t\t\t\t// 「商品購入のみ」でない側 (= 工事希望 on) を取得する。
\t\t\t\tvar hasPurchaseOnly = false;
\t\t\t\tvar onNode = null;
\t\t\t\tfor (var j = 0; j < nodes.length; j++) {
\t\t\t\t\tif (nodes[j].value === '商品購入のみ') hasPurchaseOnly = true;
\t\t\t\t\telse if (!onNode) onNode = nodes[j];
\t\t\t\t}
\t\t\t\tif (!hasPurchaseOnly || !onNode) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var k = 0; k < nodes.length; k++) {
\t\t\t\t\tif (nodes[k].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tonNode.checked = true;
\t\t\t\t// グローバル op 変数を on 値で埋める(calcGoukei の purchaseOnly 判定が参照)
\t\t\t\tswitch (i) {
\t\t\t\t\tcase 0: op0 = onNode.value; break;
\t\t\t\t\tcase 1: op1 = onNode.value; break;
\t\t\t\t\tcase 2: op2 = onNode.value; break;
\t\t\t\t\tcase 3: op3 = onNode.value; break;
\t\t\t\t\tcase 4: op4 = onNode.value; break;
\t\t\t\t\tcase 5: op5 = onNode.value; break;
\t\t\t\t\tcase 6: op6 = onNode.value; break;
\t\t\t\t\tcase 7: op7 = onNode.value; break;
\t\t\t\t\tcase 8: op8 = onNode.value; break;
\t\t\t\t\tcase 9: op9 = onNode.value; break;
\t\t\t\t\tcase 10: op10 = onNode.value; break;
\t\t\t\t}
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = onNode.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var s = 0; s < sib.length; s++) sib[s].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// rp-section-label 表示同期 + 現地調査文言(is_removal_unknown / is_tf_kouji)を on 表示に
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || onNode.closest('.form-group');
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + onNode.value + '</span>';
\t\t\t\t\t}
\t\t\t\t\tvar note = grp.querySelector('.opt-survey-note[data-op-idx=\"' + i + '\"]');
\t\t\t\t\tif (note) note.style.display = '';
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// ページ読み込み時: 見積金額が「合計」になっているため、カート数量は基本1
\t\t// sale_type=9(商品のみ購入)だけ通常 EC として数量を引き継ぐ
\t\t(function initQuantityByType(){
\t\t\tvar saleType = {{ ProductClass.SaleType.id }};
\t\t\tif (saleType == 9 && \$('#quantity_only').length) {
\t\t\t\t\$('#quantity').val(parseInt(\$('#quantity_only').val()) || 1);
\t\t\t} else {
\t\t\t\t\$('#quantity').val(1);
\t\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\t}
\t\t})();
\t\t// type → ラベルのプレフィックス文字列
\t\t// option1/option2 のラベルは category 依存 (rd: ランマ/タイプ, sh: サイズプリセット/駆動方式 等).
\t\t// PHP から渡された option1_label / option2_label を埋め込み、JS 側でラベル更新に使う.
\t\tvar optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'素材',
\t\t option1: '{{ option1_label|default('オプション1')|e('js') }}',
\t\t option2: '{{ option2_label|default('オプション2')|e('js') }}'};
\t\t// type → input[name]
\t\tvar optNameMap = {pc:'color', pw:'pw', pd:'pd', ph:'ph', pm:'pm',
\t\t option1: 'option1', option2: 'option2'};
\t\t// opt-btn用: 値を直接受け取るラッパー
\t\tfunction mitsumori_simulation_val(type, value) {
\t\t\tif (type === 'pc') pc = value;
\t\t\tif (type === 'pw') pw = value;
\t\t\tif (type === 'pd') pd = value;
\t\t\tif (type === 'ph') ph = value;
\t\t\tif (type === 'pm') pm = value;
\t\t\tif (type === 'option1') option1 = value;
\t\t\tif (type === 'option2') option2 = value;
\t\t\t// is-selected クラスを同グループ内で付け替え
\t\t\tvar inputName = optNameMap[type];
\t\t\tif (inputName) {
\t\t\t\tvar \$btns = \$('input[name=\"' + inputName + '\"]').closest('.opt-btn');
\t\t\t\t\$btns.removeClass('is-selected');
\t\t\t\t\$btns.filter(function(){
\t\t\t\t\treturn \$(this).find('input').val() === value;
\t\t\t\t}).addClass('is-selected');
\t\t\t}
\t\t\t// ラベル行の選択値テキストを更新(例: 「カラー: ブラック」)
\t\t\tvar labelPrefix = optLabelMap[type];
\t\t\tif (labelPrefix) {
\t\t\t\t// 対象のrp-section-labelを特定(input[name]を含む親を遡る)
\t\t\t\tvar \$group = \$('input[name=\"' + inputName + '\"]').first().closest('.form-group');
\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\$label.html(labelPrefix + ': <span>' + value + '</span>');
\t\t\t}
\t\t\t// simulation本体を呼ぶ(value_idは空でOK、グローバル変数を使う)
\t\t\tmitsumori_simulation('', '');
\t\t}
\t\tmitsumori_simulation(\"\",\"\");
\t\t// ボタン群: 親幅を超える、または3行以上になる場合は is-scroll を付与し
\t\t// 縦3段グリッド+横スクロール表示にする(顧客要望「3列くらいで横スクロール」)
\t\tfunction applyBtnGroupScroll() {
\t\t\t\$('.rp-btn-group, .opt-btn-group').each(function() {
\t\t\t\tvar \$group = \$(this);
\t\t\t\t\$group.removeClass('is-scroll');
\t\t\t\tvar \$items = \$group.children();
\t\t\t\tif (\$items.length === 0) return;
\t\t\t\tvar parentWidth = \$group.parent().width() || \$group.width();
\t\t\t\tvar totalWidth = 0;
\t\t\t\tvar gap = parseInt(\$group.css('gap'), 10) || 8;
\t\t\t\t\$items.each(function() {
\t\t\t\t\ttotalWidth += this.offsetWidth + gap;
\t\t\t\t});
\t\t\t\t// 単一ボタンが親幅を超える、もしくは合計幅が親幅を超える → 横スクロール化
\t\t\t\tvar anyTooWide = false;
\t\t\t\t\$items.each(function() {
\t\t\t\t\tif (this.offsetWidth > parentWidth) { anyTooWide = true; return false; }
\t\t\t\t});
\t\t\t\t// 折り返し時の行数も計測
\t\t\t\tvar tops = {};
\t\t\t\t\$items.each(function() { tops[this.offsetTop] = true; });
\t\t\t\tvar rowCount = Object.keys(tops).length;
\t\t\t\tif (anyTooWide || totalWidth > parentWidth * 2 || rowCount >= 3) {
\t\t\t\t\t\$group.addClass('is-scroll');
\t\t\t\t}
\t\t\t});
\t\t}
\t\tapplyBtnGroupScroll();
\t\t\$(window).on('resize', function() {
\t\t\tclearTimeout(window._btnScrollTimer);
\t\t\twindow._btnScrollTimer = setTimeout(applyBtnGroupScroll, 150);
\t\t});
\t\t// onload: 見積金額が確定している場合は「工事費込み価格」表示を一致させる
\t\t(function syncPrice02Display() {
\t\t\tvar goukeiEl = document.getElementById('mitsumori_goukei');
\t\t\tvar displayEl = document.getElementById('price02-display');
\t\t\tif (!goukeiEl || !displayEl) return;
\t\t\tvar goukeiText = goukeiEl.textContent.trim();
\t\t\t// ---円(未確定)の場合は書き換えない
\t\t\tif (goukeiText && goukeiText !== '---円') {
\t\t\t\tdisplayEl.textContent = goukeiText;
\t\t\t}
\t\t\t// 以降の変更にも追従: mitsumori_goukei を監視
\t\t\tnew MutationObserver(function() {
\t\t\t\tvar text = goukeiEl.textContent.trim();
\t\t\t\tif (text && text !== '---円') {
\t\t\t\t\tdisplayEl.textContent = text;
\t\t\t\t}
\t\t\t}).observe(goukeiEl, { childList: true, subtree: true, characterData: true });
\t\t})();
\t\tfunction contact_form(product_id){
\t\t\t\$('#form1').attr('action', '{{ url('contact', {product:Product.id}) }}');
\t\t\t\$('#form1').submit();
\t\t}
\t\t// maisu / madoset は下部の新しい関数定義を使用
\t\tfunction heibei(bei){
\t\t\t\$('#heibei').val(parseInt(\$('#heibei').val()) + bei);
\t\t\tif(parseInt(\$('#heibei').val()) < 1){ \$('#heibei').val(1); }
\t\t\tif(parseInt(\$('#heibei').val()) > 100){ \$('#heibei').val(100); }
\t\t\t// goukei に既に枚数を含むため、カート数量は1で固定
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('heibei','heibei');
\t\t}
\t\tfunction daisu(dai){
\t\t\t\$('#daisu').val(parseInt(\$('#daisu').val()) + dai);
\t\t\tif(parseInt(\$('#daisu').val()) < 1){ \$('#daisu').val(1); }
\t\t\tif(parseInt(\$('#daisu').val()) > 10){ \$('#daisu').val(10); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('daisu','daisu');
\t\t}
\t\t// sale_type=7(数量買い・基本工事費固定)用:個数入力
\t\tfunction suuryou(n){
\t\t\t\$('#suuryou').val(parseInt(\$('#suuryou').val()) + n);
\t\t\tif(parseInt(\$('#suuryou').val()) < 1){ \$('#suuryou').val(1); }
\t\t\tif(parseInt(\$('#suuryou').val()) > 100){ \$('#suuryou').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('suuryou','suuryou');
\t\t}
\t\tfunction maisu(mai){
\t\t\t\$('#maisu').val(parseInt(\$('#maisu').val()) + mai);
\t\t\t// sale_type=4 (フェンス) は3枚未満不可、6 (芝生) は1枚から
\t\t\tvar minMai = (SALE_TYPE_ID == 4) ? 3 : 1;
\t\t\tif(parseInt(\$('#maisu').val()) < minMai){ \$('#maisu').val(minMai); }
\t\t\tif(parseInt(\$('#maisu').val()) > 100){ \$('#maisu').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('maisu','maisu');
\t\t}
\t\t// タイプ2: セット数プルダウン連動
\t\tfunction madosetSelect(val){
\t\t\tvar v = parseInt(val);
\t\t\tif(v < 1) v = 1;
\t\t\tif(v > 20) v = 20;
\t\t\t\$('#set_count').val(v);
\t\t\t\$('#quantity').val(1);
\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\tmitsumori_simulation('set','set_count');
\t\t}
\t\t// タイプ2: ±ボタン版(後方互換)
\t\tfunction madoset(mai){
\t\t\tvar current = parseInt(\$('#set_count').val()) || 1;
\t\t\tvar next = current + mai;
\t\t\tif(next < 1) next = 1;
\t\t\tif(next > 20) next = 20;
\t\t\t\$('#set_count').val(next);
\t\t\tmadosetSelect(next);
\t\t}
\t\t// タイプ5: ステップ・フェンス選択値を mitsumori_json に保存するためのグローバル変数
\t\tvar deck_step = \"{% if mitsumori_json and mitsumori_json.deck_step is defined %}{{ mitsumori_json.deck_step|default('不要') }}{% else %}不要{% endif %}\";
\t\tvar deck_fence = \"{% if mitsumori_json and mitsumori_json.deck_fence is defined %}{{ mitsumori_json.deck_fence|default('不要') }}{% else %}不要{% endif %}\";
\t\t// PDF出力: モーダルの mitsumori_json をフォームに同期してから送信
\t\tfunction syncPdfJson(){
\t\t\tvar jsonVal = \$('#mitsumori_json').val();
\t\t\t\$('#pdf_mitsumori_json').val(jsonVal);
\t\t}
\t\t// タイプ9: 商品のみ購入
\t\tfunction quantityOnly(val){
\t\t\tvar current = parseInt(\$('#quantity_only').val()) || 1;
\t\t\tvar next = current + val;
\t\t\tif(next < 1) next = 1;
\t\t\t\$('#quantity_only').val(next);
\t\t\t\$('#quantity').val(next);
\t\t}
// ===== スマホ用下部固定バーへの金額同期 =====
// mitsumori_message と mitsumori_goukei を監視して下部バーを更新
(function() {
var msgTarget = document.getElementById('mitsumori_message');
var goukeiTarget = document.getElementById('mitsumori_goukei');
var spPrice = document.getElementById('sp-mitsumori-price');
var spBtn = document.querySelector('#sp-mitsumori-bar .sp-bar__btn');
if (!spPrice || !spBtn) return;
function syncBar() {
var msg = msgTarget ? msgTarget.textContent : '';
var goukei = goukeiTarget ? goukeiTarget.textContent : '---円';
// メッセージが「〇〇を選択してください」の場合はメッセージを表示しボタンを非表示
if (msg.indexOf('選択してください') !== -1) {
spPrice.textContent = msg;
spPrice.style.fontSize = '13px';
spPrice.style.color = '#888';
spBtn.style.display = 'none';
} else {
// 価格確定時はボタンを表示
spPrice.textContent = goukei;
spPrice.style.fontSize = '18px';
spPrice.style.color = '#c00';
spBtn.style.display = 'block';
}
}
// 初期値を同期
syncBar();
// mitsumori_message の変化を監視
if (msgTarget) {
new MutationObserver(syncBar).observe(
msgTarget, { childList: true, subtree: true, characterData: true }
);
}
// mitsumori_goukei の変化も監視
if (goukeiTarget) {
new MutationObserver(syncBar).observe(
goukeiTarget, { childList: true, subtree: true, characterData: true }
);
}
})();
// ===== スマホ用 お見積りの詳細 ボトムシート 開閉 =====
// 現在の内訳カード(.mitsumori-card-pc .card-body)を複製して表示する。
// 価格計算ロジックには触れず、その時点で表示中の内訳をそのまま見せる。
// window に直接ぶら下げてスコープに依存せず onclick から呼べるようにする。
window.openSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
var body = document.getElementById('sp-detail-body');
var src = document.querySelector('.mitsumori-card-pc .card-body');
if (!sheet || !body) return;
body.innerHTML = '';
if (src) {
// 複製し、重複 id を避けるため clone 側の id を除去する
var clone = src.cloneNode(true);
var ided = clone.querySelectorAll('[id]');
for (var i = 0; i < ided.length; i++) { ided[i].removeAttribute('id'); }
body.appendChild(clone);
}
sheet.classList.add('is-open');
sheet.setAttribute('aria-hidden', 'false');
document.body.style.overflow = 'hidden';
};
window.closeSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
if (!sheet) return;
sheet.classList.remove('is-open');
sheet.setAttribute('aria-hidden', 'true');
document.body.style.overflow = '';
};
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(function() {
var card = document.querySelector('.mitsumori-card-pc');
var btn = document.querySelector('.btn-mitsumori-toggle .toggle-icon');
if (!card || !btn) return;
// MutationObserverでcollapsed-cardクラスの変化を監視
new MutationObserver(function() {
if (card.classList.contains('collapsed-card')) {
btn.textContent = '▼ 詳細';
} else {
btn.textContent = '▲ 閉じる';
}
}).observe(card, { attributes: true, attributeFilter: ['class'] });
})();
// ===== エリア案内: スマホのみタップで展開 =====
(function() {
var notice = document.querySelector('.ec-areaNotice');
if (!notice) return;
notice.addEventListener('click', function(e) {
if (window.innerWidth > 767) return;
// リンククリック時は展開/折りたたみせずリンク遷移
if (e.target.tagName === 'A') return;
notice.classList.toggle('is-open');
});
})();
</script>
<script type=\"application/ld+json\">
{
\"@context\": \"https://schema.org/\",
\"@type\": \"Product\",
\"name\": \"{{ Product.name }}\",
\"image\": [
{% for img in Product.ProductImage %}
\"{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}\"{% if not loop.last %},{% endif %}
{% else %}
\"{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}\"
{% endfor %}
],
\"description\": \"{{ Product.description_list | default(Product.description_detail) | replace({'\\n': '', '\\r': ''}) | slice(0,300) }}\",
{% if Product.code_min %}
\"sku\": \"{{ Product.code_min }}\",
{% endif %}
\"offers\": {
\"@type\": \"Offer\",
\"url\": \"{{ url('product_detail', {'id': Product.id}) }}\",
\"priceCurrency\": \"{{ eccube_config.currency }}\",
\"price\": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
\"availability\": \"{{ Product.stock_find ? \"InStock\" : \"OutOfStock\" }}\"
}
}
</script>
{% endblock %}
{% block main %}
{# option1 / option2 ラベルをカテゴリ別に決定 (sh=31, rd=43, mo=15) - block scope のため main 側でも再定義 #}
{% set option1_label = 'オプション1' %}
{% set option2_label = 'オプション2' %}
{# rd(玄関ドア, cat43) は素材(m)が開き方+ランマを内包し option1(ランマ)/option2(タイプ) が
完全な冗長軸のため、素材のみ「開き方」として表示し option1/option2 の選択 UI は抑制する。
価格マッチングは m + カラーで一意に決まり、未選択 option は fallback が無視するため影響なし。 #}
{% set is_cat43 = false %}
{% if Product.ProductCategories is not empty %}
{% for pcat in Product.ProductCategories %}
{% if pcat.category_id == 31 %}{% set option1_label = 'サイズプリセット' %}{% set option2_label = '駆動方式' %}{% endif %}
{% if pcat.category_id == 43 %}{% set option1_label = 'ランマ' %}{% set option2_label = 'タイプ' %}{% set is_cat43 = true %}{% endif %}
{% if pcat.category_id == 15 %}{% set option1_label = '棚タイプ' %}{% endif %}
{% if pcat.category_id == 17 %}{% set option1_label = '窓タイプ' %}{% endif %}
{% endfor %}
{% endif %}
<div class=\"ec-productRole\" style=\"margin-top:20px;\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell\">
<div class=\"ec-sliderItemRole\">
\t {# 商品名 + ブランド名 + SNSシェア #}
\t <div class=\"ec-productRole__title\">
\t <div class=\"ec-productRole__titleRow\">
\t <h2 class=\"ec-headingTitle\">{{ Product.name }}</h2>
\t <div class=\"ec-share-inline\">
\t <a href=\"https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}\"
\t class=\"share-twitter\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Xでシェア\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.74l7.73-8.835L1.254 2.25H8.08l4.254 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z\"/></svg>
\t </a>
\t <a href=\"https://www.instagram.com/\" class=\"share-facebook\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Instagram\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z\"/></svg>
\t </a>
\t <a href=\"https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}\"
\t class=\"share-line\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"LINEでシェア\">
\t <i class=\"fab fa-line\"></i>
\t </a>
\t </div>
\t </div>
\t </div>
{% if BaseInfo.option_favorite_product %}
<div style=\"position:relative;top: 20px;left: 10px;z-index:100;\">
\t\t\t\t\t\t{% if is_favorite == false %}
<form action=\"{{ url('product_add_favorite', {id:Product.id}) }}\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\">♡</button>
</form>
{% else %}
<form action=\"{{ url('product_add_favorite', {id:Product.id}) }}\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\" style=\"color:red;\">♥</button>
</form>
{% endif %}
</div>
{% endif %}
<div class=\"item_visual\">
{% for ProductImage in Product.ProductImage %}
<div class=\"slide-item\">
<a class=\"js-zoom\" href=\"{{ asset(ProductImage, 'save_image') }}\" aria-label=\"{{ loop.first ? Product.name : '' }}\">
<img src=\"{{ asset(ProductImage, 'save_image') }}\" alt=\"{{ loop.first ? Product.name : '' }}\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"{% if loop.index > 1 %} loading=\"lazy\"{% endif %}>
</a>
</div>
{% else %}
<div class=\"slide-item\"><img src=\"{{ asset(''|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"></div>
{% endfor %}
</div>
<div class=\"item_nav\">
{% for ProductImage in Product.ProductImage %}
<div class=\"slideThumb\" data-index=\"{{ loop.index0 }}\"><img src=\"{{ asset(ProductImage, 'save_image') }}\" alt=\"\" width=\"80\" height=\"80\" loading=\"lazy\"></div>
{% endfor %}
</div>
</div>
{# ===== 施工エリア案内(見積シミュレーションの下)===== #}
<div class=\"ec-areaNotice\" style=\"margin-top:16px;margin-right:10px;\">
<div class=\"ec-areaNotice__inner\">
<div class=\"ec-areaNotice__icon\">📍</div>
<div class=\"ec-areaNotice__body\">
<p class=\"ec-areaNotice__title\">施工対応エリアについて</p>
<div class=\"ec-areaNotice__detail\">
<p class=\"ec-areaNotice__text\">
当店の施工サービスは、<strong>山梨県全域</strong>および<br>
<strong>諏訪エリア(諏訪市・岡谷市・茅野市・諏訪郡)</strong>を対象としております。<br>
上記エリア外のお客様には、商品のみのご購入が可能でございます。<br>
ご不明な点がございましたら、お気軽にお問い合わせください。
</p>
<a class=\"ec-areaNotice__link\" href=\"{{ url('contact') }}\">エリア外のお客様・ご相談はこちら →</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-grid2__cell2\">
<div class=\"ec-productRole__profile\" >
{# 関連カテゴリ (DIY=21 / 石材=28 / 照明=44 は非表示要件のため除外) #}
{% set hidden_cat_ids = [21, 28, 44] %}
{% if Product.ProductCategories is not empty %}
<div class=\"ec-productRole__category\" style=\"padding:10px 0;\">
{% for ProductCategory in Product.ProductCategories %}
{% if ProductCategory.Category.id not in hidden_cat_ids %}
<ul>
<li>
{% for Category in ProductCategory.Category.path %}
<a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">{{ Category.name }}</a> {%- if loop.last == false %}
<span>></span>{% endif -%}
{% endfor %}
</li>
</ul>
{% endif %}
{% endfor %}
</div>
{% endif %}
{# 販売価格 #}
<div class=\"ec-productRole__price\">
\t\t\t\t\t\t<span style=\"color:black;font-size:15px;\">工事費込み価格</span>
{% if Product.hasProductClass -%}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class=\"ec-price__tax\">({{ '税込'|trans }})~</span>
</div>
{% else %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
<span class=\"ec-price__tax\">({{ '税込'|trans }})</span>
</div>
{% endif %}
{% else %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price\">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class=\"ec-price__tax\">({{ '税込'|trans }})~</span>
</div>
{% endif %}
</div>
{# タグ #}
<ul class=\"ec-productRole__tags\">
{% for Tag in Product.Tags %}
<li class=\"ec-productRole__tag tag_{{ Tag.id }}\">{{ Tag }}</li>
{% endfor %}
</ul>
{# 商品コード #}
{% if Product.code_min is not empty %}
<div class=\"ec-productRole__code\">
{{ '商品コード'|trans }}: <span class=\"product-code-default\">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
</div>
{% endif %}
<div class=\"ec-productRole__description\">
\t\t\t\t <div class=\"ec-rectHeading\">
\t\t\t\t <h4>製品情報</h4>
\t\t\t\t </div>
\t\t\t\t\t\t{{ Product.sales_infomation|raw|nl2br }}
</div>
\t\t\t\t\t<div class=\"card card-danger\" style=\"clear:both;margin:1px;\">
\t\t\t\t\t <div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">見積シミュレーション</h3>
\t\t\t\t\t </div>
\t\t\t\t\t <div class=\"card-body p-2\">
{% set related_image = getProduct_field(Product.id,\"related_image\") %}
{# related_image は配列: [\"1段目画像あり\",\"2段目画像あり\",\"3段目画像あり\"] のうち該当するものが格納 #}
{% set img1 = related_image and (\"1段目画像あり\" in related_image) %}
{% set img2 = related_image and (\"2段目画像あり\" in related_image) %}
{% set img3 = related_image and (\"3段目画像あり\" in related_image) %}
{% set img4 = related_image and (\"4段目画像あり\" in related_image) %}
\t\t\t\t\t {% set type1 = getProduct_field(Product.id,\"related_name1\") %}
\t\t\t\t\t\t{% set type2 = getProduct_field(Product.id,\"related_name2\") %}
\t\t\t\t\t\t{% set type3 = getProduct_field(Product.id,\"related_name3\") %}
\t\t\t\t\t\t{% set type4 = getProduct_field(Product.id,\"related_name4\") %}
\t\t\t\t\t\t{% set hasRelated = (type1 and related_product1 and related_product1|length)
\t\t\t\t\t\t or (type2 and related_product2 and related_product2|length)
\t\t\t\t\t\t or (type3 and related_product3 and related_product3|length)
\t\t\t\t\t\t or (type4 and related_product4 and related_product4|length) %}
\t\t\t\t\t\t{% if hasRelated %}
\t\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のタイプを選択してください。</label></div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 1段目 ===== #}
\t\t\t\t\t\t{% if type1 and related_product1 and related_product1|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type1 }}{% if img1 and base_select1 %}: <span>{{ base_select1 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img1 %}
\t\t\t\t\t\t {# --- 画像付きカード --- #}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product1 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select1 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t {# --- ボタン式ラジオ --- #}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product1 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select1 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 2段目 ===== #}
\t\t\t\t\t\t{% if type2 and related_product2 and related_product2|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type2 }}{% if img2 and base_select2 %}: <span>{{ base_select2 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img2 %}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product2 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select2 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product2 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select2 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 3段目 ===== #}
\t\t\t\t\t\t{% if type3 and related_product3 and related_product3|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type3 }}{% if img3 and base_select3 %}: <span>{{ base_select3 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img3 %}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product3 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select3 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product3 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select3 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 4段目 ===== #}
\t\t\t\t\t\t{% if type4 and related_product4 and related_product4|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type4 }}{% if img4 and base_select4 %}: <span>{{ base_select4 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img4 %}
\t\t\t\t\t\t {# --- 画像付きカード --- #}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product4 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select4 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\" width=\"120\" height=\"120\" loading=\"lazy\">
\t\t\t\t\t\t <span class=\"rp-card__label\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t {# --- ボタン式ラジオ --- #}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product4 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select4 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t {# ガレージ等で全オプション空のときに見出しのみ表示される事象を回避.
\t\t\t\t\t 色 / 寸法 / 素材 / option1/2 / op_data いずれかに「描画される」要素がある場合のみ
\t\t\t\t\t 「この商品のオプションを選択してください。」見出しを表示する.
\t\t\t\t\t op_data は cg=9 で「残土」 / gs=27 で「撤去」「残土」を後段ループで
\t\t\t\t\t hide するため、単純な op|length > 0 では「見出しだけ残る」事象が
\t\t\t\t\t wh / cg の一部商品で発生していた. 描画される entry を事前カウントする. #}
\t\t\t\t\t {% set is_gs_h = false %}
\t\t\t\t\t {% set is_cg_h = false %}
\t\t\t\t\t {% if Product.ProductCategories is not empty %}
\t\t\t\t\t {% for pc_h in Product.ProductCategories %}
\t\t\t\t\t {% if pc_h.category_id == 27 %}{% set is_gs_h = true %}{% endif %}
\t\t\t\t\t {% if pc_h.category_id == 9 %}{% set is_cg_h = true %}{% endif %}
\t\t\t\t\t {% endfor %}
\t\t\t\t\t {% endif %}
\t\t\t\t\t {% set visible_op_count = 0 %}
\t\t\t\t\t {% if op and op|length %}
\t\t\t\t\t {% for opi in op %}
\t\t\t\t\t {% if opi['name'] %}
\t\t\t\t\t {% set _hide_h = false %}
\t\t\t\t\t {% if is_gs_h and (opi['name'] matches '/撤去/' or opi['name'] matches '/残土/') %}{% set _hide_h = true %}{% endif %}
\t\t\t\t\t {% if is_cg_h and opi['name'] matches '/残土/' %}{% set _hide_h = true %}{% endif %}
\t\t\t\t\t {% if not _hide_h %}{% set visible_op_count = visible_op_count + 1 %}{% endif %}
\t\t\t\t\t {% endif %}
\t\t\t\t\t {% endfor %}
\t\t\t\t\t {% endif %}
\t\t\t\t\t {% set has_any_option =
\t\t\t\t\t (color and color|length and ProductClass.SaleType.id != 3)
\t\t\t\t\t or (p_w and p_w|length and p_w|join != \"\")
\t\t\t\t\t or (p_d and p_d|length and p_d|join != \"\")
\t\t\t\t\t or (p_h and p_h|length and p_h|join != \"\")
\t\t\t\t\t or (p_m and p_m|length and p_m|join != \"\")
\t\t\t\t\t or (p_option1 and p_option1|length and p_option1|join != \"\")
\t\t\t\t\t or (p_option2 and p_option2|length and p_option2|join != \"\")
\t\t\t\t\t or ProductClass.SaleType.id in [2, 5, 6, 7, 9]
\t\t\t\t\t %}
\t\t\t\t\t {% if has_any_option %}
\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のオプションを選択してください。</label></div>
\t\t\t\t\t {% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別カラー選択するため共通カラーは非表示 #}
{% if color and color|length and ProductClass.SaleType.id != 3 and ProductClass.SaleType.id != 2 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">カラー{% if mitsumori_json and mitsumori_json.pc %}: <span>{{ mitsumori_json.pc }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
{% set has_img = cc['img'] is defined and cc['img'] is not empty %}
<label class=\"opt-btn{% if has_img %} opt-btn--with-image{% endif %}{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pc', '{{ cc['name']|e('js') }}');\">
<input type=\"radio\" name=\"color\" id=\"cc_{{ idx }}\" value=\"{{ cc['name'] }}\"
{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}>
{% if has_img %}
<img src=\"{{ cc['img'] }}\" alt=\"{{ cc['name'] }}\" class=\"opt-btn__img\"
onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
<span class=\"opt-btn__name\">{{ cc['name'] }}</span>
{% else %}
{{ cc['name'] }}
{% endif %}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別幅選択するため共通幅は非表示.
tf (人工芝, sale_type=6) は専用の「芝の幅」+「施工サイズ」UI を下部に持つため、
汎用の 幅/奥行/高さ は描画しない (両方出すと name=\"pw\"/\"ph\" が重複し、
片方を選ぶともう片方の選択が外れる顧客指摘あり). #}
{% if p_w and p_w|length and p_w|join != \"\" and ProductClass.SaleType.id not in [2, 3, 6] %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for pw in p_w %}{% if pw %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pw', '{{ pw|e('js') }}');\">
<input type=\"radio\" name=\"pw\" id=\"pw_{{ idx }}\" value=\"{{ pw }}\"
{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %}checked{% endif %}>
{{ pw }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{% if p_d and p_d|length and p_d|join != \"\" and ProductClass.SaleType.id not in [3, 6] %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">奥行き{% if mitsumori_json and mitsumori_json.pd %}: <span>{{ mitsumori_json.pd }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for pd in p_d %}{% if pd %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pd', '{{ pd|e('js') }}');\">
<input type=\"radio\" name=\"pd\" id=\"pd_{{ idx }}\" value=\"{{ pd }}\"
{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %}checked{% endif %}>
{{ pd }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別高さ選択するため共通高さは非表示.
sale_type=6 (人工芝) は専用 UI なので汎用高さは描画しない. #}
{% if p_h and p_h|length and p_h|join != \"\" and ProductClass.SaleType.id not in [2, 3, 6] %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">高さ{% if mitsumori_json and mitsumori_json.ph %}: <span>{{ mitsumori_json.ph }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for ph in p_h %}{% if ph %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('ph', '{{ ph|e('js') }}');\">
<input type=\"radio\" name=\"ph\" id=\"ph_{{ idx }}\" value=\"{{ ph }}\"
{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %}checked{% endif %}>
{{ ph }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別ガラス選択するため共通素材は非表示 #}
{% if p_m and p_m|length and p_m|join != \"\" and ProductClass.SaleType.id != 3 and ProductClass.SaleType.id != 2 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">{% if is_cat43 %}開き方{% else %}素材{% endif %}{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for pm in p_m %}{% if pm %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pm', '{{ pm|e('js') }}');\">
<input type=\"radio\" name=\"pm\" id=\"pm_{{ idx }}\" value=\"{{ pm }}\"
{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %}checked{% endif %}>
{{ pm }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# option1 (sale_type 2 は専用 UI が下にあるため除外 / sale_type 3 は下部ブロックで描画 /
sale_type 4 = fe・ts は option1 が ct_unit_price (枚数増分の工事費単価) で
ユーザー選択肢ではなく計算用の内部値のため radio として表示しない. 値は
上の auto-init (p_option1|length == 1) で JS の option1 変数に埋め込み済み) #}
{% if p_option1 and p_option1|length and p_option1|join != \"\" and ProductClass.SaleType.id != 2 and ProductClass.SaleType.id != 3 and ProductClass.SaleType.id != 4 and not is_cat43 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">{{ option1_label }}{% if mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 %}: <span>{{ mitsumori_json.option1 }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for opt1 in p_option1 %}{% if opt1 %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1) or p_option1|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('option1', '{{ opt1|e('js') }}');\">
<input type=\"radio\" name=\"option1\" id=\"option1_{{ idx }}\" value=\"{{ opt1 }}\"
{% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1) or p_option1|length == 1 %}checked{% endif %}>
{{ opt1 }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# option2 #}
{% if p_option2 and p_option2|length and p_option2|join != \"\" and ProductClass.SaleType.id != 2 and ProductClass.SaleType.id != 3 and not is_cat43 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">{{ option2_label }}{% if mitsumori_json and mitsumori_json.option2 is defined and mitsumori_json.option2 %}: <span>{{ mitsumori_json.option2 }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for opt2 in p_option2 %}{% if opt2 %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.option2 is defined and mitsumori_json.option2 == opt2) or p_option2|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('option2', '{{ opt2|e('js') }}');\">
<input type=\"radio\" name=\"option2\" id=\"option2_{{ idx }}\" value=\"{{ opt2 }}\"
{% if (mitsumori_json and mitsumori_json.option2 is defined and mitsumori_json.option2 == opt2) or p_option2|length == 1 %}checked{% endif %}>
{{ opt2 }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
\t\t\t\t\t\t<!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 1 %}
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 2: 施工見積(補助金・窓) 複数タイプ追加対応 (2026-05) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 2 %}
\t\t\t\t\t\t\t{# 2026-05 改修: ex-shop プラメイク方式に倣い、1 商品で
\t\t\t\t\t\t\t 複数の「窓タイプ」(subtype × 幅 × 高さ × ガラス × カラー × セット数)
\t\t\t\t\t\t\t を追加できる UI に変更. 各タイプは内訳 JSON として 1 明細にまとめる. #}
\t\t\t\t\t\t\t{# ec-productRole__profile は標準テンプレで height:600px / overflow:auto
\t\t\t\t\t\t\t が当たっており、複数タイプ追加カードが内部スクロールに押し込まれて
\t\t\t\t\t\t\t 見えない. sale_type=2 のときだけ縦方向に伸ばす. #}
\t\t\t\t\t\t\t<style>
\t\t\t\t\t\t\t\t.ec-productRole__profile {
\t\t\t\t\t\t\t\t\toverflow: visible !important;
\t\t\t\t\t\t\t\t\tmax-height: none !important;
\t\t\t\t\t\t\t\t\theight: auto !important;
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t</style>
\t\t\t\t\t\t\t{# 住宅区分 UI: 補助金単価が戸建 / 集合住宅で異なるためお客様に申告いただく. #}
\t\t\t\t\t\t\t{% set housing_default = getProduct_field(Product.id, '住宅区分')|default('戸建') %}
\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>お住まいの種別を選択</strong>
\t\t\t\t\t\t\t <small class=\"ms-2 text-muted\">補助金単価が変わります</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t <div class=\"opt-btn-group\" id=\"window-housing-type-group\">
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"戸建\"
\t\t\t\t\t\t\t {% if housing_default != '集合住宅' %}checked{% endif %}>
\t\t\t\t\t\t\t 戸建住宅<small class=\"d-block text-muted\">(延床240㎡以下の非住宅含む)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"集合住宅\"
\t\t\t\t\t\t\t {% if housing_default == '集合住宅' %}checked{% endif %}>
\t\t\t\t\t\t\t 集合住宅<small class=\"d-block text-muted\">(低層・中高層/240㎡超の非住宅)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>窓タイプを選択(複数追加可・最大 20)</strong>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t <div id=\"window-types-container\"><!-- 動的に窓タイプブロックが追加される --></div>
\t\t\t\t\t\t\t <div class=\"text-center mt-2\">
\t\t\t\t\t\t\t <button type=\"button\" id=\"btn-add-window-type\" class=\"btn btn-outline-primary btn-sm\" onclick=\"addWindowType();\">+ 窓タイプを追加</button>
\t\t\t\t\t\t\t <div class=\"small text-muted mt-1\">最大 20 タイプまで追加できます</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{# 窓タイプブロックのテンプレート. __IDX__ を JS で連番に置換して clone する. #}
\t\t\t\t\t\t\t<template id=\"window-type-template\">
\t\t\t\t\t\t\t <div class=\"window-type-block\" data-type-idx=\"__IDX__\" style=\"border:1px solid #ddd;border-radius:6px;padding:10px;margin-bottom:10px;background:#fafafa;\">
\t\t\t\t\t\t\t <div class=\"d-flex justify-content-between align-items-center mb-2\">
\t\t\t\t\t\t\t <strong>窓タイプ <span class=\"wt-num\">__IDX__</span></strong>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-sm btn-outline-danger btn-remove-window-type\" onclick=\"removeWindowType(this);\">× 削除</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {# 窓タイプ (subtype) #}
\t\t\t\t\t\t\t {% if p_option1 and p_option1|length and p_option1|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓タイプ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% for v in p_option1 %}{% if v %}
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_subtype___IDX__\" value=\"{{ v }}\" data-axis=\"subtype\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t {{ v }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# 幅 (mm 直接入力) #}
\t\t\t\t\t\t\t {% if p_w and p_w|length and p_w|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_pw___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1750\" data-axis=\"pw\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応幅: 〜{{ (p_w|last)|default('') }}({{ p_w|length }} 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# 高さ (mm 直接入力) #}
\t\t\t\t\t\t\t {% if p_h and p_h|length and p_h|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_ph___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1200\" data-axis=\"ph\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応高さ: 〜{{ (p_h|last)|default('') }}({{ p_h|length }} 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# ガラスタイプ #}
\t\t\t\t\t\t\t {% if p_m and p_m|length and p_m|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ガラスタイプ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% for v in p_m %}{% if v %}
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pm___IDX__\" value=\"{{ v }}\" data-axis=\"pm\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t {{ v }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">「<span style=\"color:#2e7d32;font-weight:bold;\">補助金対象</span>」が付いたガラスは、先進的窓リノベ補助金の対象です。</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# 窓枠カラー #}
\t\t\t\t\t\t\t {% if color and color|length %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓枠カラー</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% for cc in color %}{% if cc and cc['name'] %}
\t\t\t\t\t\t\t {% set has_img = cc['img'] is defined and cc['img'] is not empty %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if has_img %} opt-btn--with-image{% endif %}\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pc___IDX__\" value=\"{{ cc['name'] }}\" data-axis=\"pc\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t {% if has_img %}
\t\t\t\t\t\t\t <img src=\"{{ cc['img'] }}\" alt=\"{{ cc['name'] }}\" class=\"opt-btn__img\"
\t\t\t\t\t\t\t onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
\t\t\t\t\t\t\t <span class=\"opt-btn__name\">{{ cc['name'] }}</span>
\t\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t\t {{ cc['name'] }}
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# セット数 + タイプごとの補助金額表示 (補助金は task 2 で実計算) #}
\t\t\t\t\t\t\t <div class=\"form-group row mt-2 align-items-center\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">セット数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_setqty___IDX__\" class=\"form-control wt-input-setqty\" value=\"1\" min=\"1\" max=\"99\" data-axis=\"setqty\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">セット</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4 text-end\">
\t\t\t\t\t\t\t <small class=\"text-muted\">補助金額<br><span class=\"wt-subsidy-amount\">―</span> 円</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</template>
\t\t\t\t\t\t\t{# 複数タイプ管理 JS. addWindowType / removeWindowType / 再番号付け. #}
\t\t\t\t\t\t\t<script>
\t\t\t\t\t\t\t(function() {
\t\t\t\t\t\t\t\tvar MAX_WINDOW_TYPES = 20;
\t\t\t\t\t\t\t\tfunction addWindowType() {
\t\t\t\t\t\t\t\t\tvar container = document.getElementById('window-types-container');
\t\t\t\t\t\t\t\t\tif (!container) return;
\t\t\t\t\t\t\t\t\tvar existing = container.querySelectorAll('.window-type-block');
\t\t\t\t\t\t\t\t\tif (existing.length >= MAX_WINDOW_TYPES) return;
\t\t\t\t\t\t\t\t\tvar newIdx = existing.length + 1;
\t\t\t\t\t\t\t\t\tvar tpl = document.getElementById('window-type-template');
\t\t\t\t\t\t\t\t\tif (!tpl) return;
\t\t\t\t\t\t\t\t\t// <template> の innerHTML を取り出して __IDX__ を新規連番に置換し、要素化して append.
\t\t\t\t\t\t\t\t\tvar html = tpl.innerHTML.replace(/__IDX__/g, String(newIdx));
\t\t\t\t\t\t\t\t\tvar wrapper = document.createElement('div');
\t\t\t\t\t\t\t\t\twrapper.innerHTML = html.trim();
\t\t\t\t\t\t\t\t\tvar block = wrapper.firstChild;
\t\t\t\t\t\t\t\t\tcontainer.appendChild(block);
\t\t\t\t\t\t\t\t\tdecorateSubsidyGlass(block);
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 補助金対象ガラスの選択肢に「補助金対象」バッジ + 緑枠を付与する.
\t\t\t\t\t\t\t\t// 判定は calc script 側の window.glassYieldsSubsidy に委譲 (ロジック二重化を避ける)。
\t\t\t\t\t\t\t\tfunction decorateSubsidyGlass(block) {
\t\t\t\t\t\t\t\t\tif (!block || typeof window.glassYieldsSubsidy !== 'function') return;
\t\t\t\t\t\t\t\t\tvar radios = block.querySelectorAll('input[data-axis=\"pm\"]');
\t\t\t\t\t\t\t\t\tradios.forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\tvar label = inp.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\tif (!label || label.querySelector('.opt-btn__subsidy-badge')) return;
\t\t\t\t\t\t\t\t\t\tif (window.glassYieldsSubsidy(inp.value)) {
\t\t\t\t\t\t\t\t\t\t\tlabel.classList.add('opt-btn--subsidy');
\t\t\t\t\t\t\t\t\t\t\tvar badge = document.createElement('span');
\t\t\t\t\t\t\t\t\t\t\tbadge.className = 'opt-btn__subsidy-badge';
\t\t\t\t\t\t\t\t\t\t\tbadge.textContent = '補助金対象';
\t\t\t\t\t\t\t\t\t\t\tlabel.appendChild(badge);
\t\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction removeWindowType(btn) {
\t\t\t\t\t\t\t\t\tvar block = btn.closest('.window-type-block');
\t\t\t\t\t\t\t\t\tif (!block) return;
\t\t\t\t\t\t\t\t\tblock.remove();
\t\t\t\t\t\t\t\t\treindexBlocks();
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction updateRemoveButtonVisibility() {
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b) {
\t\t\t\t\t\t\t\t\t\tvar btn = b.querySelector('.btn-remove-window-type');
\t\t\t\t\t\t\t\t\t\tif (btn) btn.style.display = blocks.length > 1 ? '' : 'none';
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction reindexBlocks() {
\t\t\t\t\t\t\t\t\t// ブロック削除後に 1 から振り直し. input[name] の末尾 _N も書き換える.
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b, i) {
\t\t\t\t\t\t\t\t\t\tvar n = i + 1;
\t\t\t\t\t\t\t\t\t\tb.setAttribute('data-type-idx', String(n));
\t\t\t\t\t\t\t\t\t\tvar numSpan = b.querySelector('.wt-num');
\t\t\t\t\t\t\t\t\t\tif (numSpan) numSpan.textContent = String(n);
\t\t\t\t\t\t\t\t\t\tb.querySelectorAll('input[name]').forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\t\tinp.name = inp.name.replace(/_\\d+\$/, '_' + n);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 軸変更イベント. recalcAll が定義されていれば再計算 (task 2 で実装).
\t\t\t\t\t\t\t\twindow.onWindowTypeAxisChange = function() {
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\twindow.addWindowType = addWindowType;
\t\t\t\t\t\t\t\twindow.removeWindowType = removeWindowType;
\t\t\t\t\t\t\t\t// 隠し radio(opacity:0/pointer-events:none) を label で包む opt-btn は iOS で初回タップの
\t\t\t\t\t\t\t\t// change が不発になりやすい。窓タイプ/住宅区分は label に onclick が無く change 依存だった
\t\t\t\t\t\t\t\t// ため「2回タッチ/選択できない」が発生。click は確実に発火するので委譲 click で選択状態・
\t\t\t\t\t\t\t\t// is-selected・再計算を行う(JSで複製される窓タイプにも委譲で対応)。
\t\t\t\t\t\t\t\tdocument.addEventListener('click', function(ev) {
\t\t\t\t\t\t\t\t\tif (!ev.target || !ev.target.closest) return;
\t\t\t\t\t\t\t\t\tvar label = ev.target.closest('.opt-btn');
\t\t\t\t\t\t\t\t\tif (!label) return;
\t\t\t\t\t\t\t\t\tif (!label.closest('#window-types-container') && !label.closest('#window-housing-type-group')) return;
\t\t\t\t\t\t\t\t\tvar input = label.querySelector('input[type=\"radio\"]');
\t\t\t\t\t\t\t\t\tif (!input || input.disabled) return;
\t\t\t\t\t\t\t\t\tinput.checked = true;
\t\t\t\t\t\t\t\t\tvar nm = input.getAttribute('name');
\t\t\t\t\t\t\t\t\tif (nm) {
\t\t\t\t\t\t\t\t\t\tdocument.querySelectorAll('input[name=\"' + nm + '\"]').forEach(function(i) {
\t\t\t\t\t\t\t\t\t\t\tvar l = i.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (l) l.classList.toggle('is-selected', i.checked);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t// 初期表示で 1 ブロック追加 + 住宅区分ラジオの change で再計算.
\t\t\t\t\t\t\t\tdocument.addEventListener('DOMContentLoaded', function() {
\t\t\t\t\t\t\t\t\tif (document.querySelector('#window-types-container')) {
\t\t\t\t\t\t\t\t\t\taddWindowType();
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tvar housingInputs = document.querySelectorAll('input[name=\"window_housing_type\"]');
\t\t\t\t\t\t\t\t\tvar syncHousingSelectedClass = function() {
\t\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\t\tvar lbl = el.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (!lbl) return;
\t\t\t\t\t\t\t\t\t\t\tif (el.checked) lbl.classList.add('is-selected');
\t\t\t\t\t\t\t\t\t\t\telse lbl.classList.remove('is-selected');
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\tel.addEventListener('change', function() {
\t\t\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t})();
\t\t\t\t\t\t\t</script>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 3: 施工見積(物置・ゴミステーション) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 3 %}
\t\t\t\t\t\t\t{# 幅・奥行き・高さ(p_w/p_d/p_h からボタン型ラジオ生成) #}
\t\t\t\t\t\t\t{% if p_w and p_w|length and p_w|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw3_{{ idx }}\" value=\"{{ pw_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pw_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if p_d and p_d|length and p_d|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">奥行き{% if mitsumori_json and mitsumori_json.pd %}: <span>{{ mitsumori_json.pd }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pd_val in p_d %}{% if pd_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pd == pd_val) or p_d|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pd','pd3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pd\" id=\"pd3_{{ idx }}\" value=\"{{ pd_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pd == pd_val) or p_d|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pd_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if p_h and p_h|length and p_h|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ{% if mitsumori_json and mitsumori_json.ph %}: <span>{{ mitsumori_json.ph }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for ph_val in p_h %}{% if ph_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.ph == ph_val) or p_h|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('ph','ph3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"ph\" id=\"ph3_{{ idx }}\" value=\"{{ ph_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.ph == ph_val) or p_h|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ ph_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 棚タイプ(p_m データから選択肢を生成) #}
\t\t\t\t\t\t\t{% if p_m and p_m|length and p_m|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">棚タイプ <small class=\"text-muted\">(間仕切り仕様)</small>{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm3_{{ idx }}\" value=\"{{ pm_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pm_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# option1 (mo の 棚タイプ 等、p_option1 データから選択肢を生成) #}
\t\t\t\t\t\t\t{% if p_option1 and p_option1|length and p_option1|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">{{ option1_label }}{% if mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 %}: <span>{{ mitsumori_json.option1 }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for opt1_val in p_option1 %}{% if opt1_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1_val) or p_option1|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('option1','option1_3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"option1\" id=\"option1_3_{{ idx }}\" value=\"{{ opt1_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1_val) or p_option1|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ opt1_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# カラー(共通の color データ使用) #}
\t\t\t\t\t\t\t{% if color and color|length %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">カラー{% if mitsumori_json and mitsumori_json.pc %}: <span>{{ mitsumori_json.pc }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pc','cc3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"color3\" id=\"cc3_{{ idx }}\" value=\"{{ cc['name'] }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ cc['name'] }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 台数 #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">台数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"daisu\" id=\"daisu\" class=\"form-control\" value=\"{{ mitsumori_json.daisu|default('1') }}\" min=\"1\" max=\"10\" onchange=\"mitsumori_simulation('daisu','daisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">台</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"daisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"daisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 4: 施工見積(フェンス・組み立て式) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 4 %}
\t\t\t\t\t\t\t{# 枚数 #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">枚数</label>
\t\t\t\t\t\t\t <div class=\"col-4 mb-3\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"maisu\" id=\"maisu\" class=\"form-control\" value=\"{{ mitsumori_json.maisu|default('3') }}\" min=\"3\" max=\"20\" onchange=\"if(parseInt(this.value)<3)this.value=3; mitsumori_simulation('maisu','maisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">枚</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"maisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"maisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 5 %}
\t\t\t\t\t\t\t{# ステップの有無 #}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ステップ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set step_yes_checked = (mitsumori_json and mitsumori_json.deck_step is defined and mitsumori_json.deck_step == '必要') %}
\t\t\t\t\t\t\t {% set step_no_checked = (not mitsumori_json or mitsumori_json.deck_step is not defined or mitsumori_json.deck_step == '不要' or not mitsumori_json.deck_step) %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if step_yes_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_yes\" value=\"必要\"
\t\t\t\t\t\t\t {% if step_yes_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn{% if step_no_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_no\" value=\"不要\"
\t\t\t\t\t\t\t {% if step_no_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-step\" style=\"font-size:12px;color:#c00;margin-top:6px;{% if not step_yes_checked %}display:none;{% endif %}\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{# ウッドデッキフェンスの有無 #}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">デッキフェンス</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set fence_yes_checked = (mitsumori_json and mitsumori_json.deck_fence is defined and mitsumori_json.deck_fence == '必要') %}
\t\t\t\t\t\t\t {% set fence_no_checked = (not mitsumori_json or mitsumori_json.deck_fence is not defined or mitsumori_json.deck_fence == '不要' or not mitsumori_json.deck_fence) %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if fence_yes_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_yes\" value=\"必要\"
\t\t\t\t\t\t\t {% if fence_yes_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn{% if fence_no_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_no\" value=\"不要\"
\t\t\t\t\t\t\t {% if fence_no_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-fence\" style=\"font-size:12px;color:#c00;margin-top:6px;{% if not fence_yes_checked %}display:none;{% endif %}\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 6: 施工見積(芝生・枚数・数量買い) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 6 %}
\t\t\t\t\t\t\t{# 規格(p_m データ → 素材から抽出) #}
\t\t\t\t\t\t\t{% if p_m and p_m|length and p_m|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">規格{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm6_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm6_{{ idx }}\" value=\"{{ pm_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pm_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 芝の幅(p_w = ロール幅。free_area の w。例 100cm/200cm = 1m/2m 幅。
\t\t\t\t\t\t\t h はロール長(例 1000cm=10m)で固定のため UI には出さない)。 #}
\t\t\t\t\t\t\t{% if p_w and p_w|length and p_w|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">芝の幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw6_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw6_{{ idx }}\" value=\"{{ pw_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pw_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 1ロールの長さ表記(顧客要望 #10)。h はロール長 (例 1000cm=10m) で固定のため選択ではなく表示のみ。 #}
\t\t\t\t\t\t\t{% set _roll_h = (p_h is defined and p_h|length) ? (p_h|first) : '' %}
\t\t\t\t\t\t\t{% if _roll_h %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">1ロールの長さ:<span style=\"font-weight:bold;\">{% if 'cm' in _roll_h %}{{ (_roll_h|replace({'cm':'', ',':''})|trim) / 100 }}m{% else %}{{ _roll_h }}{% endif %}</span></div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 施工サイズ(縦 × 横、m 入力)→ 必要枚数を自動算出して表示.
\t\t\t\t\t\t\t 面積=縦×横 を #area に流し込み、case 6 の qty=ceil(area/ロール面積) を流用. #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">施工サイズ</label>
\t\t\t\t\t\t\t <div class=\"col-8\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_len\" id=\"tf_len\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.tf_len|default('') }}\"
\t\t\t\t\t\t\t placeholder=\"縦\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_len','tf_len');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m ×</span>
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_wid\" id=\"tf_wid\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.tf_wid|default('') }}\"
\t\t\t\t\t\t\t placeholder=\"横\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_wid','tf_wid');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {# area は内部計算用に保持(縦×横を JS で書き込む) #}
\t\t\t\t\t\t\t <input type=\"hidden\" name=\"area\" id=\"area\" value=\"{{ mitsumori_json.area|default('') }}\">
\t\t\t\t\t\t\t {# 必要枚数は直接入力も可能。施工サイズ入力時は自動算出して上書きする。
\t\t\t\t\t\t\t 施工サイズ未入力でも、ここで枚数だけ指定してカートに入れられる。 #}
\t\t\t\t\t\t\t <div style=\"margin-top:10px;display:inline-block;background:#fff3cd;border:1px solid #ffe69c;border-radius:6px;padding:8px 14px;font-size:16px;color:#c00;font-weight:bold;\">
\t\t\t\t\t\t\t 必要枚数:<input type=\"number\" name=\"tf_qty\" id=\"tf_qty\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.tf_qty|default('1') }}\" min=\"1\" step=\"1\"
\t\t\t\t\t\t\t style=\"width:80px;font-size:22px;font-weight:bold;color:#c00;text-align:right;border:1px solid #ffe69c;border-radius:4px;padding:2px 6px;\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_qty','tf_qty');\"> 枚
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div style=\"margin-top:6px;font-size:12px;color:#666;\">※ 施工サイズを入力すると必要枚数を自動計算します。サイズが分からない場合は枚数を直接ご指定ください。</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 7: 施工見積(数量買い・基本工事費固定) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 7 %}
\t\t\t\t\t\t\t{# 個数(物置の daisu と同形式、単位は「個」) #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">個数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"suuryou\" id=\"suuryou\" class=\"form-control\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.suuryou|default('1') }}\" min=\"1\" max=\"100\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('suuryou','suuryou');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"suuryou(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"suuryou(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 9: 商品のみ購入 -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 9 %}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">数量</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"quantity_only\" id=\"quantity_only\" class=\"form-control\" value=\"1\" min=\"1\" onchange=\"\$('#quantity').val(this.value);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"quantityOnly(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"quantityOnly(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">取り付け工事のご希望に関してお答えください。</label></div>
\t\t\t\t\t\t{# gs (ゴミステーション, category id=27) では「撤去対応」「残土・ガラ処理」は ex-shop に存在しないため非表示
\t\t\t\t\t\t cg (カーゲート, category id=9) では「残土・ガラ処理」分は撤去金額側に内包済みのため非表示
\t\t\t\t\t\t (撤去オプション自体は残す) #}
\t\t\t\t\t\t{% set is_gs = false %}
\t\t\t\t\t\t{% set is_cg = false %}
\t\t\t\t\t\t{% if Product.ProductCategories is not empty %}
\t\t\t\t\t\t\t{% for ProductCategory in Product.ProductCategories %}
\t\t\t\t\t\t\t\t{% if ProductCategory.category_id == 27 %}{% set is_gs = true %}{% endif %}
\t\t\t\t\t\t\t\t{% if ProductCategory.category_id == 9 %}{% set is_cg = true %}{% endif %}
\t\t\t\t\t\t\t{% endfor %}
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{% for i in 0..10 %}
\t\t\t\t\t\t\t{% if op and op|length >= i+1 %}
\t\t\t\t\t\t\t{% if op[i]['name'] %}
\t\t\t\t\t\t\t{% set hide_opt = false %}
\t\t\t\t\t\t\t{% if is_gs and (op[i]['name'] matches '/撤去/' or op[i]['name'] matches '/残土/') %}
\t\t\t\t\t\t\t\t{% set hide_opt = true %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if is_cg and op[i]['name'] matches '/残土/' %}
\t\t\t\t\t\t\t\t{% set hide_opt = true %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if not hide_opt %}
\t\t\t\t\t\t\t{# price=0 で「解体」「撤去」「設置場所」(wd 等で API 差額未提供) を含むオプションは
\t\t\t\t\t\t\t 選択時に「現場調査後に正式お見積もり」文言を出す. #}
\t\t\t\t\t\t\t{% set is_removal_unknown = (op[i]['price']|default(0) == 0 or op[i]['price']|default('0') == '0')
\t\t\t\t\t\t\t and (op[i]['name'] matches '/解体/' or op[i]['name'] matches '/撤去/' or op[i]['name'] matches '/設置場所/') %}
\t\t\t\t\t\t\t{# tf (人工芝, sale_type=6): ex-shop に施工価格がないため「取り付け工事も希望する」選択時に現地調査文言を表示 #}
\t\t\t\t\t\t\t{% set is_tf_kouji = (ProductClass.SaleType.id == 6 and op[i]['name'] matches '/取り付け工事/') %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" data-op-idx=\"{{ i }}\" data-op-name=\"{{ op[i]['name']|e('html_attr') }}\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">{{ op[i]['name'] }}{% if mitsumori_json and mitsumori_json.op[i] %}: <span>{{ mitsumori_json.op[i] }}</span>{% endif %}</div>
\t\t\t\t\t\t\t {% if op[i]['comment'] %}<div class=\"opt-comment\" style=\"font-size:12px;color:#666;margin:4px 0 6px;\">{{ op[i]['comment'] }}</div>{% endif %}
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {# off が空 (= ex-shop に選択肢が 1 つしかない基礎施工等) のときは on 側を
\t\t\t\t\t\t\t 既定選択にして 2 個目の空ラジオを描画しない. #}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.op[i] == op[i]['on']) or not op[i]['off'] %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op{{ i }}','op{{ i }}_1');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op{{ i }}\" id=\"op{{ i }}_1\" value=\"{{ op[i]['on'] }}\" {% if (mitsumori_json and mitsumori_json.op[i] == op[i]['on']) or not op[i]['off'] %}checked{% endif %}>
\t\t\t\t\t\t\t {{ op[i]['on'] }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% if op[i]['off'] %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op{{ i }}','op{{ i }}_2');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op{{ i }}\" id=\"op{{ i }}_2\" value=\"{{ op[i]['off'] }}\" {% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %}checked{% endif %}>
\t\t\t\t\t\t\t {{ op[i]['off'] }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% if is_removal_unknown or is_tf_kouji %}
\t\t\t\t\t\t\t <div class=\"opt-survey-note\" data-op-idx=\"{{ i }}\" style=\"font-size:12px;color:#c00;margin-top:6px;{% if not (mitsumori_json and mitsumori_json.op[i] == op[i]['on']) %}display:none;{% endif %}\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{% endfor %}
\t\t\t\t\t\t{# fe (sale_type=4) ブロックの種類×段数 サブ UI コンテナ.
\t\t\t\t\t\t 親オプション「ご希望のフェンス設置方法」 = 「新規にブロック積みを行う」
\t\t\t\t\t\t を選択したときだけ JS (renderFeBlockRadios) で表示される. #}
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 4 and oi and oi.fe_block %}
\t\t\t\t\t\t<div id=\"fe-block-options\" class=\"form-group mt-3 pb-3\" style=\"display:none;border-bottom:1px solid rgba(0,0,0,.125)\"></div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t </div>
\t\t\t\t\t <!-- /.card-body -->
\t\t\t\t\t</div>
<form action=\"{{ url('product_add_cart', {id:Product.id}) }}\" method=\"post\" id=\"form1\" name=\"form1\">
{% if Product.stock_find %}
<div class=\"ec-productRole__actions\">
{% if form.classcategory_id1 is defined %}
<div class=\"ec-select\">
{{ form_row(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class=\"ec-select\">
{{ form_row(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
<div class=\"ec-numberInput\">
{{ form_widget(form.quantity, { type: 'hidden' }) }}
{{ form_errors(form.quantity) }}
</div>
</div>
{% else %}
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</div>
{% endif %}
<div class=\"ec-productRole__btn mt-3\">
<button type=\"submit\" id=\"cart_btn\" class=\"ec-blockBtn--action add-cart\">カートに入れる</button>
</div>
{{ form_rest(form) }}
</form>
<div class=\"ec-modal add-cart-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap add-cart-modal__wrap\">
<span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"{{ asset('assets/icon/cross-dark.svg') }}\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center add-cart-modal__header\">{{ 'カートに追加しました。'|trans }}</div>
<div class=\"ec-modal-box add-cart-modal__box\">
<div class=\"ec-role add-cart-modal__actions\">
<a href=\"{{ url('cart') }}\" class=\"ec-inlineBtn--action add-cart-modal__primary\">{{ 'カートに進む'|trans }}</a>
<span class=\"ec-inlineBtn--cancel add-cart-modal__secondary\">{{ '商品検索を続ける'|trans }}</span>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-productRole__description\">{{ Product.description_detail|raw|nl2br }}
</div>
{# SNSシェア #}
<div class=\"ec-productRole__share\">
<ul class=\"ec-share\">
<li class=\"ec-share__item\">
<a href=\"https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}\" class=\"ec-share__link ec-share__link--twitter\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-twitter\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri|url_encode }}\" class=\"ec-share__link ec-share__link--facebook\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-facebook-f\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}\" class=\"ec-share__link ec-share__link--line\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-line\"></i>
</a>
</li>
</ul>
</div>
</div>
\t\t\t\t{# ===== スマホ用 見積金額 下部固定バー ===== #}
\t\t\t\t<div id=\"sp-mitsumori-bar\">
\t\t\t\t <div class=\"sp-bar__pricewrap\">
\t\t\t\t <div class=\"sp-bar__label\">合計(工事費・税込)</div>
\t\t\t\t <div class=\"sp-bar__price\" id=\"sp-mitsumori-price\">---円</div>
\t\t\t\t </div>
\t\t\t\t <button type=\"button\" class=\"sp-bar__detail-btn\"
\t\t\t\t onclick=\"openSpMitsumoriDetail();\" title=\"お見積りの詳細(内訳)を表示\">
\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t <span>詳細</span>
\t\t\t\t </button>
\t\t\t\t <button type=\"button\" class=\"sp-bar__btn\"
\t\t\t\t onclick=\"document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">
\t\t\t\t <i class=\"fas fa-shopping-cart\"></i>
\t\t\t\t <span class=\"sp-bar__btn-label\">カートへ</span>
\t\t\t\t {% set spTotalQty = get_carts_total_quantity() %}
\t\t\t\t {% if spTotalQty > 0 %}
\t\t\t\t <span class=\"sp-bar__cart-badge\">{{ spTotalQty|number_format }}</span>
\t\t\t\t {% endif %}
\t\t\t\t </button>
\t\t\t\t <a href=\"{{ url('homepage') }}\" class=\"sp-bar__home-btn\" title=\"トップページへ\">
\t\t\t\t <i class=\"fas fa-home\"></i>
\t\t\t\t </a>
\t\t\t\t</div>
\t\t\t\t{# ===== スマホ用 お見積りの詳細 ボトムシート ===== #}
\t\t\t\t{# タップ時に現在の内訳カード(.mitsumori-card-pc)の中身を複製して表示する。
\t\t\t\t 価格計算には触れず、ライブ同期済みの表示値をそのまま見せる方式。 #}
\t\t\t\t<div id=\"sp-mitsumori-detail\" class=\"sp-detail-sheet\" aria-hidden=\"true\">
\t\t\t\t <div class=\"sp-detail-sheet__overlay\" onclick=\"closeSpMitsumoriDetail();\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__panel\" role=\"dialog\" aria-label=\"お見積りの詳細\">
\t\t\t\t <div class=\"sp-detail-sheet__header\">
\t\t\t\t <span class=\"sp-detail-sheet__title\">お見積りの詳細</span>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__close\" onclick=\"closeSpMitsumoriDetail();\" aria-label=\"閉じる\">×</button>
\t\t\t\t </div>
\t\t\t\t <div class=\"sp-detail-sheet__body\" id=\"sp-detail-body\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__footer\">
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__invoice\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('mitsumori_btn') && document.getElementById('mitsumori_btn').click();\">見積書を表示</button>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__cart\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">カートに入れる</button>
\t\t\t\t </div>
\t\t\t\t </div>
\t\t\t\t</div>
\t\t\t\t{# tg カテゴリ用: block 別オプション差額ラジオ (W/D 確定後に JS が動的描画) #}
\t\t\t\t<div id=\"tg-options\" class=\"tg-options-container col-12\"></div>
\t\t\t\t<div class=\"card col-12 collapsed-card sticky-top float-right mitsumori-card-pc\">
\t\t\t\t\t<div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">現在のお見積り額</h3>
\t\t\t\t\t <div class=\"card-tools\">
\t\t\t\t\t <span class=\"float-left\" id=\"mitsumori_message\">395000円</span>
\t\t\t\t\t <button type=\"button\" class=\"btn btn-tool btn-mitsumori-toggle\" data-card-widget=\"collapse\" title=\"詳細を表示\">
\t\t\t\t\t <span class=\"toggle-icon\">▼ 詳細</span>
\t\t\t\t\t </button>
\t\t\t\t\t </div>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-body p-0\">
\t\t\t\t\t <ul class=\"nav nav-pills flex-column\">
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 合計(工事費・税込)
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_goukei\">395,000円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 商品価格
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_price\">307,008円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {# sale_type=2 (補助金窓) ではカタログ価格軸を使わないので非表示. JS 側で #maker_price には \"---円\" を入れる. #}
\t\t\t\t\t {% if ProductClass.SaleType.id != 2 %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> カタログ価格
\t\t\t\t\t <span class=\"float-right\" id=\"maker_price\">479,700円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {% else %}
\t\t\t\t\t {# sale_type=2 でも JS が #maker_price を参照するので hidden で残す #}
\t\t\t\t\t <span id=\"maker_price\" style=\"display:none;\">---円</span>
\t\t\t\t\t {% endif %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t\t {% if ProductClass.SaleType.id == 2 %}補助金(割引額){% else %}お値引き{% endif %}
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_off\">-172,692円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {# 補助金窓のみ: 当店が申請代行する旨を補助金行の直下に小さく表示 (消費者の手続き勘違い防止) #}
\t\t\t\t\t {% if ProductClass.SaleType.id == 2 %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <div style=\"padding:4px 12px 8px;color:#6c757d;font-size:11px;line-height:1.4;\">
\t\t\t\t\t ※当店が補助金事業者として申請代行し、契約代金に充当します
\t\t\t\t\t </div>
\t\t\t\t\t </li>
\t\t\t\t\t {% endif %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 基本工事費
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_ct\">53,250円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 施工オプション
\t\t\t\t\t <span class=\"float-right\"id=\"mitsumori_option\">6,297円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t </ul>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-footer\">
\t\t <button type=\"button\" id=\"mitsumori_btn\" class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#modal-mitsumori\">
\t\t 見積書表示
\t\t </button>
<button type=\"submit\" id=\"cart_btn2\" class=\"btn btn-info add-cart\">カートに入れる</button>
\t\t\t\t\t</div>
\t\t\t\t</div>
</div>
</div>
</div>
<div class=\"modal\" id=\"modal-mitsumori\">
<div class=\"modal-dialog modal-mitsumori\" style=\"max-width:1000px\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h4 class=\"modal-title\">お見積書</h4>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">×</span>
</button>
</div>
<div class=\"modal-body\">
\t\t\t<div class=\"invoice p-3 mb-5\" style=\"max-width:1000px; margin:auto;\">
\t\t\t <!-- title row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12\">
\t\t\t <h2>概算お見積書
\t\t\t <small class=\"float-right\" style=\"font-size:14px;\">発行日: 2025/03/14</small>
\t\t\t </h2>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- info row -->
\t\t\t <div class=\"row invoice-info\">
\t\t\t <div class=\"col-sm-8 invoice-col\">
\t\t\t <h3>お客様</h3>
\t\t\t <span>下記の通り、お見積もり申し上げます。</span>
\t\t\t <br />
\t\t\t <br / >
\t\t\t <br />
\t\t\t <h2>お見積金額: <span id=\"mitsumori_kei\">399,080円</span></h2>
\t\t\t <span>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t </span>
\t\t\t </div>
\t\t\t <div class=\"col-sm-4 invoice-col\">
\t\t\t <p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/logo.png\" style=\"width: 260px; max-width: 100%; max-height: 10mm;\">
\t\t\t </p>
\t\t\t <p>有限会社プラス</p>
\t\t\t <p>〒400-0334</p>
\t\t\t <p>山梨県南アルプス市藤田1450番地2</p>
\t\t\t <p>TEL: 055-284-6480</p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/seal.svg\" style=\"z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;\">
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <!-- Table row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12 table-responsive\">
\t\t\t <table class=\"table table-striped\">
\t\t\t <thead>
\t\t\t <tr>
\t\t\t <th>項目</th>
\t\t\t <th>数量</th>
\t\t\t <th>単位</th>
\t\t\t <th>単価</th>
\t\t\t <th>小計</th>
\t\t\t </tr>
\t\t\t </thead>
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <td id=\"mitsumori_item_name\">{{ Product.name }}</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_price_01\">352,800</td>
\t\t\t <td id=\"mitsumori_price_02\">352,800</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>基本工事費</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_ct_01\">10,000</td>
\t\t\t <td id=\"mitsumori_ct_02\">10,000</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>残土・ガラ処理</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td>0円</td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td> </td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <div class=\"row\">
\t\t\t <!-- accepted payments column -->
\t\t\t <div class=\"col-6\">
\t\t\t <p class=\"lead\">お支払い方法</p>
\t\t\t <p class=\"text-muted well well-sm shadow-none\" style=\"margin-top: 10px;\">銀行振込、クレジットカード決済、PAYPAY決済
\t\t\t <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
\t\t\t <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。
\t\t\t </p>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <div class=\"col-6\">
\t\t\t <div class=\"table-responsive\">
\t\t\t <table class=\"table\">
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <th style=\"width:50%\">小計:</th>
\t\t\t <td id=\"mitsumori_shoukei\">362,800</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>消費税 (10%)</th>
\t\t\t <td id=\"mitsumori_tax\">36,280</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>合計:</th>
\t\t\t <td id=\"mitsumori_goukei_02\">399,080</td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t</div>
</div>
<div class=\"modal-footer justify-content-between\">
\t\t\t {# PDF出力: mitsumori_json を POST して PDF ダウンロード #}
\t\t\t <form method=\"post\" action=\"{{ url('mitsumori_pdf') }}\" target=\"_blank\" id=\"pdf_download_form\">
\t\t\t <input type=\"hidden\" name=\"_token\" value=\"{{ csrf_token('mitsumori_pdf') }}\">
\t\t\t <input type=\"hidden\" name=\"mitsumori_json\" id=\"pdf_mitsumori_json\">
\t\t\t <button type=\"submit\" class=\"btn btn-primary float-right\" style=\"margin-right: 5px;\" onclick=\"syncPdfJson();\">
\t\t\t <i class=\"fas fa-download\"></i>PDF出力
\t\t\t </button>
\t\t\t </form>
<button type=\"submit\" id=\"cart_btn3\" class=\"btn btn-info add-cart\">カートに入れる</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Image zoom modal: custom lightweight lightbox (no CDN dependency) -->
<div id=\"img-modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"画像拡大\">
<button id=\"img-modal__close\" aria-label=\"閉じる\">×</button>
<button id=\"img-modal__prev\" aria-label=\"前の画像\">❮</button>
<img id=\"img-modal__img\" src=\"\" alt=\"\">
<button id=\"img-modal__next\" aria-label=\"次の画像\">❯</button>
</div>
<style>
#img-modal {
display: none;
position: fixed;
inset: 0;
z-index: 9999;
background: rgba(0,0,0,0.88);
align-items: center;
justify-content: center;
cursor: zoom-out;
}
#img-modal.is-open { display: flex; }
#img-modal__img {
max-width: 92vw;
max-height: 88vh;
object-fit: contain;
border-radius: 4px;
cursor: default;
user-select: none;
touch-action: pinch-zoom;
display: block;
}
#img-modal__close {
position: absolute;
top: 14px;
right: 18px;
font-size: 38px;
color: #fff;
cursor: pointer;
background: none;
border: none;
padding: 0;
line-height: 1;
z-index: 1;
opacity: 0.85;
}
#img-modal__close:hover { opacity: 1; }
#img-modal__prev,
#img-modal__next {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 36px;
color: #fff;
cursor: pointer;
background: rgba(0,0,0,0.32);
border: none;
padding: 10px 16px;
line-height: 1;
border-radius: 6px;
z-index: 1;
opacity: 0.8;
user-select: none;
}
#img-modal__prev:hover, #img-modal__next:hover { opacity: 1; }
#img-modal__prev { left: 12px; }
#img-modal__next { right: 12px; }
@media (max-width: 767px) {
#img-modal__prev, #img-modal__next { font-size: 28px; padding: 8px 12px; }
}
</style>
<script>
(function(){
var images = [];
var current = 0;
// Collect original (non-cloned) slide images at click time.
// After Slick init, slides are wrapped in .slick-slide; clones have .slick-cloned.
function collectImages() {
images = [];
var \$slides = \$('.item_visual .slick-slide:not(.slick-cloned)');
if (!\$slides.length) {
// Slick not yet initialized (fallback)
\$slides = \$('.item_visual .slide-item');
}
\$slides.each(function() {
var \$a = \$(this).find('a.js-zoom');
if (\$a.length) {
images.push({ src: \$a.attr('href'), alt: \$a.find('img').attr('alt') || '' });
}
});
}
function showImage(idx) {
current = ((idx % images.length) + images.length) % images.length;
\$('#img-modal__img').attr({ src: images[current].src, alt: images[current].alt });
}
function openModal(href) {
collectImages();
if (!images.length) return;
var idx = 0;
for (var i = 0; i < images.length; i++) {
if (images[i].src === href) { idx = i; break; }
}
showImage(idx);
\$('#img-modal').addClass('is-open');
\$('body').css('overflow', 'hidden');
}
function closeModal() {
\$('#img-modal').removeClass('is-open');
\$('body').css('overflow', '');
}
// Click handler: works for both original and Slick-cloned anchors
\$(document).on('click', '.item_visual a.js-zoom', function(e) {
e.preventDefault();
openModal(\$(this).attr('href'));
});
// Close on backdrop click
\$('#img-modal').on('click', function(e) {
if (e.target === this) closeModal();
});
\$('#img-modal__close').on('click', closeModal);
\$('#img-modal__prev').on('click', function(e) { e.stopPropagation(); showImage(current - 1); });
\$('#img-modal__next').on('click', function(e) { e.stopPropagation(); showImage(current + 1); });
// Keyboard navigation
\$(document).on('keydown', function(e) {
if (!\$('#img-modal').hasClass('is-open')) return;
if (e.key === 'Escape') closeModal();
if (e.key === 'ArrowLeft') showImage(current - 1);
if (e.key === 'ArrowRight') showImage(current + 1);
});
// Touch swipe (horizontal only)
var _tx = 0;
var \$modal = document.getElementById('img-modal');
\$modal.addEventListener('touchstart', function(e) {
_tx = e.changedTouches[0].clientX;
}, { passive: true });
\$modal.addEventListener('touchend', function(e) {
var dx = e.changedTouches[0].clientX - _tx;
if (Math.abs(dx) > 48) {
dx < 0 ? showImage(current + 1) : showImage(current - 1);
}
}, { passive: true });
})();
</script>
{% endblock %}
", "Product/detail.twig", "/home/xs538259/exterior-plus.jp/public_html/app/template/default/Product/detail.twig");
}
}