<?php
    $pickerId = $pickerId ?? 'plDimensionPicker';
    $toggleId = $toggleId ?? $pickerId . 'Toggle';
    $menuId = $menuId ?? $pickerId . 'Menu';
    $treeId = $treeId ?? $pickerId . 'Tree';
    $searchId = $searchId ?? $pickerId . 'Search';
    $emptyId = $emptyId ?? $pickerId . 'Empty';
    $labelId = $labelId ?? $pickerId . 'Label';
    $inputsId = $inputsId ?? $pickerId . 'Inputs';
    $clearId = $clearId ?? $pickerId . 'Clear';
    $inputName = $inputName ?? 'dimension_value_ids[]';
    $emptyLabel = $emptyLabel ?? 'All dimensions';
    $searchPlaceholder = $searchPlaceholder ?? 'Search dimensions...';
    $toggleLabel = $toggleLabel ?? $emptyLabel;
    $selectedIds = array_values(array_unique(array_map('intval', $selectedIds ?? [])));
?>
<div class="pl-dimension-picker" id="<?php echo e($pickerId); ?>"
     data-tree='<?php echo json_encode($dimensionTree ?? [], 15, 512) ?>'
     data-selected='<?php echo json_encode($selectedIds, 15, 512) ?>'>
    <button type="button" class="pl-dimension-picker-toggle form-select text-start" id="<?php echo e($toggleId); ?>" aria-haspopup="listbox" aria-expanded="false">
        <span class="pl-dimension-picker-label" id="<?php echo e($labelId); ?>"><?php echo e($toggleLabel); ?></span>
    </button>
    <div class="pl-dimension-picker-menu d-none" id="<?php echo e($menuId); ?>">
        <div class="pl-dimension-picker-search">
            <i class="bi bi-search"></i>
            <input type="search" class="form-control form-control-sm" id="<?php echo e($searchId); ?>" placeholder="<?php echo e($searchPlaceholder); ?>" autocomplete="off">
        </div>
        <div class="pl-dimension-picker-tree" id="<?php echo e($treeId); ?>" role="listbox"></div>
        <div class="pl-dimension-picker-empty d-none" id="<?php echo e($emptyId); ?>">No matching dimensions</div>
        <div class="pl-dimension-picker-actions">
            <button type="button" class="btn btn-link btn-sm p-0" id="<?php echo e($clearId); ?>">Clear selection</button>
        </div>
    </div>
    <div id="<?php echo e($inputsId); ?>">
        <?php $__currentLoopData = $selectedIds; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $selectedId): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <input type="hidden" name="<?php echo e($inputName); ?>" value="<?php echo e($selectedId); ?>">
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    </div>
</div>
<?php /**PATH /home/duiclick/public_html/test.duiclick.com/resources/views/reports/profit-loss/_dimension-picker.blade.php ENDPATH**/ ?>