<template>
        <div class="row">
            <div class="col">
                <div class="border-sm row align-items-center m-b-15 parentContainer position-relative">
                    <div class="col-auto p-r-0 d-none d-md-block">
                        <div class="padding-5 bg-master-lightest">
                            <svg xmlns="http://www.w3.org/2000/svg" x="0px" y="0px"
                                width="30" height="30"
                                viewBox="0 0 172 172"
                                style=" fill:#000000;"><defs><linearGradient x1="86" y1="104.14063" x2="86" y2="140.57775" gradientUnits="userSpaceOnUse" id="color-1_44825_gr1"><stop offset="0" stop-color="#4ec9ff"></stop><stop offset="1" stop-color="#2bffe6"></stop></linearGradient><linearGradient x1="86" y1="16.125" x2="86" y2="159.93044" gradientUnits="userSpaceOnUse" id="color-2_44825_gr2"><stop offset="0" stop-color="#009add"></stop><stop offset="1" stop-color="#00baa4"></stop></linearGradient></defs><g fill="none" fill-rule="nonzero" stroke="none" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-miterlimit="10" stroke-dasharray="" stroke-dashoffset="0" font-family="none" font-weight="none" font-size="none" text-anchor="none" style="mix-blend-mode: normal"><path d="M0,172v-172h172v172z" fill="none"></path><g><path d="M121.41588,139.75h-70.83175c-2.53431,0 -3.66575,-3.18469 -1.6985,-4.78106l33.72544,-27.40175c1.97531,-1.60444 4.80256,-1.60444 6.77787,0l33.72544,27.40175c1.96725,1.59638 0.83581,4.78106 -1.6985,4.78106z" fill="url(#color-1_44825_gr1)"></path><path d="M148.135,71.77238l-8.385,-8.385v-28.42031c0,-4.46125 -3.63081,-8.09206 -8.09206,-8.09206h-2.65794v-2.65794c0,-4.46125 -3.63081,-8.09206 -8.09206,-8.09206h-69.81587c-4.46125,0 -8.09206,3.63081 -8.09206,8.09206v2.65794h-2.65794c-4.46125,0 -8.09206,3.63081 -8.09206,8.09206v28.42031l-8.385,8.385c-1.5265,1.52381 -2.365,3.55019 -2.365,5.70825v64.95688c0,7.40944 6.02806,13.4375 13.4375,13.4375h102.125c7.40944,0 13.4375,-6.02806 13.4375,-13.4375v-64.95688c0,-2.15806 -0.84119,-4.18444 -2.365,-5.70825zM77.60156,91.96356l-0.30906,0.24725c-1.28731,-1.79525 -2.0425,-3.92375 -2.0425,-6.21081c0,-5.92862 4.82138,-10.75 10.75,-10.75c5.92863,0 10.75,4.82138 10.75,10.75c0,2.26287 -0.70413,4.41019 -2.01294,6.235l-0.34131,-0.27412c-4.93962,-3.95063 -11.84919,-3.95063 -16.79419,0.00269zM86,69.875c-8.89294,0 -16.125,7.23206 -16.125,16.125c0,3.53406 1.14487,6.85581 3.18738,9.59438l-10.578,8.46025l-3.35937,-2.6875v-55.88388c6.95256,-1.06963 12.16094,-6.28069 13.23325,-13.23325h27.2835c1.06963,6.95256 6.28069,12.16094 13.23325,13.23325v55.88656l-3.35937,2.6875l-10.56994,-8.45488c2.07744,-2.79231 3.17931,-6.10869 3.17931,-9.60244c0,-8.89294 -7.23206,-16.125 -16.125,-16.125zM58.179,107.5l-31.304,25.04481v-50.08694zM145.125,82.45519v50.08963l-31.30669,-25.04481zM144.33488,75.5725c0.11825,0.11825 0.18006,0.27412 0.27412,0.4085l-4.859,3.88612v-8.8795zM131.65794,32.25c1.49962,0 2.71706,1.21744 2.71706,2.71706v49.20275l-5.375,4.3v-56.21981zM51.09206,21.5h69.81856c1.49694,0 2.71438,1.21744 2.71438,2.71706v68.55275l-5.375,4.3v-56.75731h-2.6875c-6.22694,0 -10.75,-4.52306 -10.75,-10.75v-2.6875h-37.625v2.6875c0,6.22694 -4.52306,10.75 -10.75,10.75h-2.6875v56.75731l-5.375,-4.3v-68.55275c0,-1.49962 1.21744,-2.71706 2.71706,-2.71706zM40.34206,32.25h2.65794v56.21981l-5.375,-4.3v-49.20275c0,-1.49963 1.21744,-2.71706 2.71706,-2.71706zM32.25,70.98763v8.88219l-4.859,-3.88881c0.09406,-0.13438 0.15587,-0.29025 0.27412,-0.4085zM137.0625,150.5h-102.125c-4.44513,0 -8.0625,-3.61738 -8.0625,-8.0625v-3.00463l54.08325,-43.27144c2.96969,-2.37306 7.11381,-2.37306 10.08081,0l54.08594,43.26875v3.00731c0,4.44513 -3.61737,8.0625 -8.0625,8.0625z" fill="url(#color-2_44825_gr2)"></path></g></g></svg>
                        </div>
                    </div>
                    <div class="col-auto">
                        <div class="row">
                            <div class="col-auto p-r-10 all-caps">
                                <div class="font-heading all-caps bold">{{this.item.marking}}</div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col">
                                <div class="font-heading all-caps muted fs-11">{{this.item.created_at}}</div>
                            </div>
                        </div>
                    </div>
                    <div class="col d-none d-lg-block" v-if="$store.getters.isAdmin">
                        <div class="font-heading fs-10 muted all-caps">Marking</div>
                        <div class="font-heading">
                            <a :href="route('customer.profile', item.company.reference)">{{this.item.company.reference}}</a>
                        </div>
                    </div>
                    <div class="col-auto d-none d-lg-block">
                        <div class="font-heading fs-10 muted all-caps">Currency</div>
                        <div class="font-heading bold">
                            <span class="flag-icon" :class="'flag-icon-'+item.convertible_currency.country.short_code.toLowerCase()"></span> {{this.item.convertible_currency.short_code}}
                        </div>
                    </div>
                    <div class="col-auto d-none d-lg-block">
                        <div class="font-heading fs-10 muted all-caps">Transfer Type</div>
                        <div class="font-heading fs-12">{{this.item.service.name}}</div>
                    </div>
                    <div class="col">
                        <div class="font-heading fs-10 muted all-caps">Payable Amount</div>
                        <div class="font-heading text-success bold">{{this.item.amount}} {{this.item.fixed_currency.short_code}}</div>
                    </div>
                    <div class="col-auto hide" v-if="$store.getters.isCustomer">
                        <div class="font-heading fs-10 muted all-caps">status</div>
                        <div class="font-heading all-caps text-master btn-rounded p-l-10 p-r-10 lh-15 mt-1" :class="[{'bg-warning': item.status !== 3}, {'bg-success': item.status === 3} ]">
                            {{item.status === 3 ? 'Complete' : 'In Progress'}}
                        </div>
                    </div>
                    <div class="col-auto hide d-none d-lg-block" :class="[{'invisible': !item.service.configurations.billable}]" v-if="$store.getters.isCustomer">
                        <div class="font-heading fs-10 muted all-caps">Billing</div>
                        <div class="font-heading all-caps text-danger btn-rounded bg-master-lightest p-l-10 p-r-10 lh-15 mt-1">
                            Pending...
                        </div>
                    </div>
                    <div class="col col-md-2 parentContainer position-static">
                        <div class="row align-items-center justify-content-end">
                            <div class="col-auto position-static no-padding">
                                <div class="btn btn-sm btn-default b-rad-none no-border requestModal" v-if="item.status !== 5 && item.paid_amount === 0 && item.floating_amount === 0 && $store.getters.isAdmin" data-type="cancelBooking">
                                    <i class="fa fa-fw fa-times text-danger"></i>
                                </div>
                                <div class="btn btn-sm btn-default b-rad-none no-border requestModal" v-if="item.status === 5 && item.paid_amount === 0 && item.floating_amount === 0 && $store.getters.isAdmin" data-type="restoreBooking">
                                    <i class="fa fa-fw fa-history text-success"></i>
                                </div>
                            </div>
                            <div class="col-auto no-padding">
                                <div class="btn btn-sm btn-default b-rad-none d-md-none no-border" @click="expanded = !expanded">
                                    <i class="fa fa-fw" :class="[{'fa-angle-up': expanded}, {'fa-angle-down': !expanded}]"></i>
                                </div>
                            </div>
                            <div class="col-auto p-l-0">
                                <a :href="route('booking.details', item.marking)">
                                    <div class="btn btn-sm btn-info b-rad-none" @click="expanded = !expanded">
                                        <i class="fa fa-angle-right fa-fw"></i>
                                    </div>
                                </a>
                            </div>
                        </div>
                        <modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="cancelBooking">
                            <cancel-booking-form-component :data="item" section="oderList" class="text-center"></cancel-booking-form-component>
                        </modal-component>
                        <modal-component class="animate__animated animate__fast animate__fadeIn" styleType="fill-in" type="restoreBooking">
                            <restore-booking-form-component :data="item" section="oderList" class="text-center"></restore-booking-form-component>
                        </modal-component>
                    </div>
                </div>
                <div class="row" v-if="expanded">
                    <div class="col b-b b-grey m-b-15 p-b-15">
                       <div class="row">
                           <div class="col-auto">
                               <div class="font-heading fs-10 muted all-caps">Currency</div>
                               <div class="font-heading bold">
                                   <span class="flag-icon" :class="'flag-icon-'+item.convertible_currency.country.short_code.toLowerCase()"></span> {{this.item.convertible_currency.short_code}}
                               </div>
                           </div>
                           <div class="col-auto">
                               <div class="font-heading fs-10 muted all-caps">Transfer Type</div>
                               <div class="font-heading">{{this.item.service.name}}</div>
                           </div>
                           <div class="col text-right" v-if="$store.getters.isAdmin">
                               <div class="font-heading fs-10 muted all-caps">Marking</div>
                               <div class="font-heading">
                                   <a :href="route('customer.profile', item.company.reference)">{{this.item.company.reference}}</a>
                               </div>
                           </div>
                       </div>
                    </div>
                </div>
            </div>
        </div>
</template>

<script>
    import componentHandler from '../../../general/mixins/componentHandler';
    export default {
        data(){
            return {
                expanded: false
            }
        },
        mixins: [componentHandler]
    }
</script>