diff --git a/app/Http/Controllers/Dashboard/ProcurementController.php b/app/Http/Controllers/Dashboard/ProcurementController.php index d1696e2c4..c1f527dff 100644 --- a/app/Http/Controllers/Dashboard/ProcurementController.php +++ b/app/Http/Controllers/Dashboard/ProcurementController.php @@ -27,6 +27,7 @@ use Illuminate\Database\Eloquent\Collection; use Illuminate\Http\Request; use Illuminate\Support\Facades\View; +use Illuminate\Support\Str; class ProcurementController extends DashboardController { @@ -324,4 +325,14 @@ public function editProcurementProduct( ProcurementProduct $product ) { return ProcurementProductCrud::form( $product ); } + + public function preload( $uuid ) + { + return $this->procurementService->preload( $uuid ); + } + + public function storePreload( Request $request ) + { + return $this->procurementService->storePreload( Str::uuid(), $request->only([ 'products' ]) ); + } } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 9cccf1bcf..4b0ba4693 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -328,5 +328,44 @@ protected function loadConfiguration() OrderProductRefund::CONDITION_UNSPOILED => __( 'Good Condition' ), ], ] ); + + /** + * We cannot set callback function on the configuration file + * as using optimize will throw an exception. + */ + config([ + 'accounting.accounts' => [ + 'assets' => [ + 'increase' => 'debit', + 'decrease' => 'credit', + 'label' => __( 'Assets' ), + 'account' => 1000, + ], + 'liabilities' => [ + 'increase' => 'credit', + 'decrease' => 'debit', + 'label' => __( 'Liabilities' ), + 'account' => 2000, + ], + 'equity' => [ + 'increase' => 'credit', + 'decrease' => 'debit', + 'label' => __( 'Equity' ), + 'account' => 3000, + ], + 'revenues' => [ + 'increase' => 'credit', + 'decrease' => 'debit', + 'label' => __( 'Revenues' ), + 'account' => 4000, + ], + 'expenses' => [ + 'increase' => 'debit', + 'decrease' => 'credit', + 'label' => __( 'Expenses' ), + 'account' => 5000, + ], + ] + ]); } } diff --git a/app/Services/ProcurementService.php b/app/Services/ProcurementService.php index 7f7bce0fa..aee96055c 100644 --- a/app/Services/ProcurementService.php +++ b/app/Services/ProcurementService.php @@ -13,6 +13,7 @@ use App\Events\ProcurementBeforeHandledEvent; use App\Events\ProcurementBeforeUpdateEvent; use App\Exceptions\NotAllowedException; +use App\Exceptions\NotFoundException; use App\Models\Procurement; use App\Models\ProcurementProduct; use App\Models\Product; @@ -25,6 +26,8 @@ use Illuminate\Database\Eloquent\Collection as EloquentCollection; use Illuminate\Support\Collection; use Illuminate\Support\Facades\Auth; +use Illuminate\Support\Facades\Cache; +use stdClass; class ProcurementService { @@ -1004,7 +1007,7 @@ public function getPaymentLabel( $label ) } } - public function searchProduct( $argument, $limit = 10 ) + public function searchQuery() { return Product::query() ->whereIn( 'type', Hook::filter( 'ns-procurement-searchable-product-type', [ @@ -1012,44 +1015,54 @@ public function searchProduct( $argument, $limit = 10 ) Product::TYPE_MATERIALIZED, ]) ) ->notGrouped() + ->withStockEnabled() + ->with( 'unit_quantities.unit' ); + } + + public function searchProduct( $argument, $limit = 10 ) + { + return $this->searchQuery() + ->limit( $limit ) ->where( function ( $query ) use ( $argument ) { $query->orWhere( 'name', 'LIKE', "%{$argument}%" ) ->orWhere( 'sku', 'LIKE', "%{$argument}%" ) ->orWhere( 'barcode', 'LIKE', "%{$argument}%" ); } ) - ->withStockEnabled() - ->with( 'unit_quantities.unit' ) - ->limit( $limit ) ->get() ->map( function ( $product ) { - $units = json_decode( $product->purchase_unit_ids ); + return $this->populateLoadedProduct( $product ); + } ); + } - if ( $units ) { - $product->purchase_units = collect(); - collect( $units )->each( function ( $unitID ) use ( &$product ) { - $product->purchase_units->push( Unit::find( $unitID ) ); - } ); - } + public function populateLoadedProduct( $product ) + { + $units = json_decode( $product->purchase_unit_ids ); - /** - * We'll pull the last purchase - * price for the item retreived - */ - $product->unit_quantities->each( function ( $unitQuantity ) use ( $product ) { - $unitQuantity->load( 'unit' ); + if ( $units ) { + $product->purchase_units = collect(); + collect( $units )->each( function ( $unitID ) use ( &$product ) { + $product->purchase_units->push( Unit::find( $unitID ) ); + } ); + } - /** - * just in case it's not a valid instance - * we'll provide a default value "0" - */ - $unitQuantity->last_purchase_price = $this->productService->getLastPurchasePrice( - product: $product, - unit: $unitQuantity->unit - ); - } ); + /** + * We'll pull the last purchase + * price for the item retreived + */ + $product->unit_quantities->each( function ( $unitQuantity ) use ( $product ) { + $unitQuantity->load( 'unit' ); - return $product; - } ); + /** + * just in case it's not a valid instance + * we'll provide a default value "0" + */ + $unitQuantity->last_purchase_price = $this->productService->getLastPurchasePrice( + product: $product, + unit: $unitQuantity->unit + ); + } ); + + return $product; } public function searchProcurementProduct( $argument ) @@ -1068,10 +1081,59 @@ public function searchProcurementProduct( $argument ) return $procurementProduct; } - public function handlePaymentStatusChanging( Procurement $procurement, string $previous, string $new ) + public function preload( string $hash ) { - // if ( $previous === Procurement::PAYMENT_UNPAID && $new === Procurement::PAYMENT_PAID ) { - // $this->transn - // } + if ( Cache::has( 'procurements-' . $hash ) ) { + $data = Cache::get( 'procurements-' . $hash ); + + return [ + 'items' => collect( $data[ 'items' ] )->map( function( $item ) use ( $data ) { + $query = $this->searchQuery() + ->where( 'id', $item[ 'product_id' ] ) + ->whereHas( 'unit_quantities', function( $query ) use( $item ) { + $query->where( 'unit_id', $item[ 'unit_id' ] ); + } ); + + $product = $query->first(); + + if ( $product instanceof Product ) { + + /** + * This will be helpful to set the desired unit + * and quantity provided on the preload configuration. + */ + $product->procurement = new stdClass; + $product->procurement->unit_id = $item[ 'unit_id' ]; + $product->procurement->quantity = ns()->currency + ->define( $item[ 'quantity' ] ) + ->multipliedBy( $data[ 'multiplier' ] )->toFloat(); + + return $this->populateLoadedProduct( $product ); + } + + return false; + })->filter() + ]; + } + + throw new NotFoundException( __( 'Unable to preload products. The hash might have expired or is invalid.' ) ); + } + + public function storePreload( string $hash, Collection | array $items, $expiration = 86400, $multiplier = 1 ) + { + if ( ! empty( $items ) ) { + $data = []; + $data[ 'multiplier' ] = $multiplier; + $data[ 'items' ] = $items; + + Cache::put( 'procurements-' . $hash, $data, $expiration ); + + return [ + 'status' => 'success', + 'message' => __( 'The procurement has been saved for later use.' ), + ]; + } + + throw new Exception( __( 'Unable to save the procurement for later use.' ) ); } } diff --git a/config/accounting.php b/config/accounting.php deleted file mode 100644 index 50889f336..000000000 --- a/config/accounting.php +++ /dev/null @@ -1,36 +0,0 @@ - [ - 'assets' => [ - 'increase' => 'debit', - 'decrease' => 'credit', - 'label' => fn() => __( 'Assets' ), - 'account' => 1000, - ], - 'liabilities' => [ - 'increase' => 'credit', - 'decrease' => 'debit', - 'label' => fn() => __( 'Liabilities' ), - 'account' => 2000, - ], - 'equity' => [ - 'increase' => 'credit', - 'decrease' => 'debit', - 'label' => fn() => __( 'Equity' ), - 'account' => 3000, - ], - 'revenues' => [ - 'increase' => 'credit', - 'decrease' => 'debit', - 'label' => fn() => __( 'Revenues' ), - 'account' => 4000, - ], - 'expenses' => [ - 'increase' => 'debit', - 'decrease' => 'credit', - 'label' => fn() => __( 'Expenses' ), - 'account' => 5000, - ], - ], -]; diff --git a/public/build/assets/app-DF-tuBxr.js b/public/build/assets/app-CYNtFyJ2.js similarity index 96% rename from public/build/assets/app-DF-tuBxr.js rename to public/build/assets/app-CYNtFyJ2.js index e627e5f49..a543a8e42 100644 --- a/public/build/assets/app-DF-tuBxr.js +++ b/public/build/assets/app-CYNtFyJ2.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./rewards-system-BiuV1FtS.js","./bootstrap-Dea9XoG9.js","./currency-Dtag6qPd.js","./chart-Ozef1QaY.js","./runtime-core.esm-bundler-VrNrzzXC.js","./_plugin-vue_export-helper-DlAUqK2U.js","./create-coupons-DYyqLn74.js","./ns-settings-DcTDh_HF.js","./components-CxIJxoVN.js","./ns-prompt-popup-7xlV5yZV.js","./ns-prompt-popup-BW2hEF0p.css","./ns-avatar-image-Pigdi04i.js","./reset-N7SWAWxc.js","./modules-Bu6KfA-Y.js","./ns-permissions-JMoWKSsL.js","./ns-procurement-CKZvMuQI.js","./manage-products-S0TS_1i7.js","./select-api-entities-DY8e84Xd.js","./join-array-NDqpMoMN.js","./ns-notifications-DTgViA_N.js","./ns-transaction-Blqx32cw.js","./ns-dashboard-Cf_lbzGm.js","./ns-low-stock-report-BTC2n9h7.js","./ns-sale-report-GLlFxdxN.js","./ns-sold-stock-report-BmDdk5W6.js","./ns-profit-report-BFidAF-s.js","./ns-stock-combined-report-DjeIcmrp.js","./ns-cash-flow-report-BtUS3-4v.js","./ns-yearly-report-BmtgFNPy.js","./ns-best-products-report-Dfkx0hDF.js","./ns-payment-types-report-BuVVhxIs.js","./ns-customers-statement-report-BEnd_qb4.js","./ns-stock-adjustment-C25P3SIo.js","./ns-procurement-quantity-Cve1nnuk.js","./ns-order-invoice-C8eORg6S.js","./ns-print-label-C5QsB0Rm.js","./ns-transactions-rules-o6Dosml4.js","./ns-token-t9X9rA7q.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./rewards-system-BiuV1FtS.js","./bootstrap-Dea9XoG9.js","./currency-Dtag6qPd.js","./chart-Ozef1QaY.js","./runtime-core.esm-bundler-VrNrzzXC.js","./_plugin-vue_export-helper-DlAUqK2U.js","./create-coupons-DYyqLn74.js","./ns-settings-DWcCMpBe.js","./components-CxIJxoVN.js","./ns-prompt-popup-7xlV5yZV.js","./ns-prompt-popup-BW2hEF0p.css","./ns-avatar-image-Pigdi04i.js","./reset-N7SWAWxc.js","./modules-Bu6KfA-Y.js","./ns-permissions-JMoWKSsL.js","./ns-procurement-BAj_8zXp.js","./manage-products-S0TS_1i7.js","./select-api-entities-DY8e84Xd.js","./join-array-NDqpMoMN.js","./ns-notifications-DTgViA_N.js","./ns-transaction-Blqx32cw.js","./ns-dashboard-Cf_lbzGm.js","./ns-low-stock-report-BTC2n9h7.js","./ns-sale-report-GLlFxdxN.js","./ns-sold-stock-report-BmDdk5W6.js","./ns-profit-report-BFidAF-s.js","./ns-stock-combined-report-DjeIcmrp.js","./ns-cash-flow-report-BtUS3-4v.js","./ns-yearly-report-BmtgFNPy.js","./ns-best-products-report-Dfkx0hDF.js","./ns-payment-types-report-BuVVhxIs.js","./ns-customers-statement-report-BEnd_qb4.js","./ns-stock-adjustment-C25P3SIo.js","./ns-procurement-quantity-Cve1nnuk.js","./ns-order-invoice-C8eORg6S.js","./ns-print-label-C5QsB0Rm.js","./ns-transactions-rules-o6Dosml4.js","./ns-token-t9X9rA7q.js"])))=>i.map(i=>d[i]); import{_ as e}from"./preload-helper-C1FmrZbK.js";import"./time-xdvp-erG.js";import{b as w,n as f,a as I}from"./components-CxIJxoVN.js";import{c as m,n as L}from"./bootstrap-Dea9XoG9.js";import{N as y}from"./ns-hotpress-CTuwUR6C.js";import{d as t}from"./runtime-core.esm-bundler-VrNrzzXC.js";import"./ns-prompt-popup-7xlV5yZV.js";import"./currency-Dtag6qPd.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";import"./ns-avatar-image-Pigdi04i.js";import"./chart-Ozef1QaY.js";function V(o,_){_.forEach(a=>{let r=o.document.createElement("link");r.setAttribute("rel","stylesheet"),r.setAttribute("type","text/css"),r.setAttribute("href",a),o.document.getElementsByTagName("head")[0].appendChild(r)})}const O={install(o,_={}){o.config.globalProperties.$htmlToPaper=(a,r,D=()=>!0)=>{let P="_blank",R=["fullscreen=yes","titlebar=yes","scrollbars=yes"],v=!0,T=[],{name:u=P,specs:i=R,replace:A=v,styles:p=T}=_;r&&(r.name&&(u=r.name),r.specs&&(i=r.specs),r.replace&&(A=r.replace),r.styles&&(p=r.styles)),i=i.length?i.join(","):"";const l=window.document.getElementById(a);if(!l){alert(`Element to print #${a} not found!`);return}const s=window.open("",u,i);return s.document.write(` @@ -8,4 +8,4 @@ import{_ as e}from"./preload-helper-C1FmrZbK.js";import"./time-xdvp-erG.js";impo ${l.innerHTML} - `),V(s,p),setTimeout(()=>{s.document.close(),s.focus(),s.print(),s.close(),D()},1e3),!0}}},S=t(()=>e(()=>import("./rewards-system-BiuV1FtS.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),g=t(()=>e(()=>import("./create-coupons-DYyqLn74.js"),__vite__mapDeps([6,1,2,3,4,5]),import.meta.url)),C=t(()=>e(()=>import("./ns-settings-DcTDh_HF.js"),__vite__mapDeps([7,2,1,3,4,8,9,5,10,11]),import.meta.url)),k=t(()=>e(()=>import("./reset-N7SWAWxc.js"),__vite__mapDeps([12,2,1,3,4,5]),import.meta.url)),H=t(()=>e(()=>import("./modules-Bu6KfA-Y.js"),__vite__mapDeps([13,1,2,3,4,9,5,10]),import.meta.url)),M=t(()=>e(()=>import("./ns-permissions-JMoWKSsL.js"),__vite__mapDeps([14,1,2,3,4,5]),import.meta.url)),j=t(()=>e(()=>import("./ns-procurement-CKZvMuQI.js"),__vite__mapDeps([15,1,2,3,4,16,9,5,10,8,11,17,18]),import.meta.url)),N=t(()=>e(()=>import("./manage-products-S0TS_1i7.js"),__vite__mapDeps([16,1,2,3,4,9,5,10,8,11]),import.meta.url)),q=t(()=>e(()=>import("./ns-procurement-invoice-DSSNRCNz.js"),[],import.meta.url)),x=t(()=>e(()=>import("./ns-notifications-DTgViA_N.js"),__vite__mapDeps([19,1,2,3,4,9,5,10,8,11]),import.meta.url)),$=t(()=>e(()=>import("./components-CxIJxoVN.js").then(o=>o.j),__vite__mapDeps([8,9,2,5,4,1,3,10,11]),import.meta.url)),B=t(()=>e(()=>import("./ns-transaction-Blqx32cw.js"),__vite__mapDeps([20,1,2,3,4,9,5,10]),import.meta.url)),F=t(()=>e(()=>import("./ns-dashboard-Cf_lbzGm.js"),__vite__mapDeps([21,1,2,3,4,5]),import.meta.url)),Y=t(()=>e(()=>import("./ns-low-stock-report-BTC2n9h7.js"),__vite__mapDeps([22,1,2,3,4,8,9,5,10,11,18]),import.meta.url)),z=t(()=>e(()=>import("./ns-sale-report-GLlFxdxN.js"),__vite__mapDeps([23,1,2,3,4,8,9,5,10,11,18]),import.meta.url)),G=t(()=>e(()=>import("./ns-sold-stock-report-BmDdk5W6.js"),__vite__mapDeps([24,1,2,3,4,8,9,5,10,11,17,18]),import.meta.url)),J=t(()=>e(()=>import("./ns-profit-report-BFidAF-s.js"),__vite__mapDeps([25,1,2,3,4,8,9,5,10,11,17,18]),import.meta.url)),K=t(()=>e(()=>import("./ns-stock-combined-report-DjeIcmrp.js"),__vite__mapDeps([26,1,2,3,4,17,9,5,10,18]),import.meta.url)),Q=t(()=>e(()=>import("./ns-cash-flow-report-BtUS3-4v.js"),__vite__mapDeps([27,1,2,3,4,8,9,5,10,11]),import.meta.url)),U=t(()=>e(()=>import("./ns-yearly-report-BmtgFNPy.js"),__vite__mapDeps([28,1,2,3,4,8,9,5,10,11]),import.meta.url)),W=t(()=>e(()=>import("./ns-best-products-report-Dfkx0hDF.js"),__vite__mapDeps([29,1,2,3,4,8,9,5,10,11]),import.meta.url)),X=t(()=>e(()=>import("./ns-payment-types-report-BuVVhxIs.js"),__vite__mapDeps([30,1,2,3,4,8,9,5,10,11]),import.meta.url)),Z=t(()=>e(()=>import("./ns-customers-statement-report-BEnd_qb4.js"),__vite__mapDeps([31,2,5,4]),import.meta.url)),ee=t(()=>e(()=>import("./ns-stock-adjustment-C25P3SIo.js"),__vite__mapDeps([32,1,2,3,4,33,5,9,10]),import.meta.url)),te=t(()=>e(()=>import("./ns-order-invoice-C8eORg6S.js"),__vite__mapDeps([34,2,5,4]),import.meta.url)),oe=t(()=>e(()=>import("./ns-print-label-C5QsB0Rm.js"),__vite__mapDeps([35,2,4,1,3,5]),import.meta.url)),re=t(()=>e(()=>import("./ns-transactions-rules-o6Dosml4.js"),__vite__mapDeps([36,1,2,3,4,9,5,10,8,11]),import.meta.url)),n=window.nsState,se=window.nsScreen;nsExtraComponents.nsToken=t(()=>e(()=>import("./ns-token-t9X9rA7q.js"),__vite__mapDeps([37,1,2,3,4,5,9,10]),import.meta.url));window.nsHotPress=new y;const d=Object.assign({nsModules:H,nsRewardsSystem:S,nsCreateCoupons:g,nsManageProducts:N,nsSettings:C,nsReset:k,nsPermissions:M,nsProcurement:j,nsProcurementInvoice:q,nsMedia:$,nsTransaction:B,nsDashboard:F,nsPrintLabel:oe,nsNotifications:x,nsSaleReport:z,nsSoldStockReport:G,nsProfitReport:J,nsStockCombinedReport:K,nsCashFlowReport:Q,nsYearlyReport:U,nsPaymentTypesReport:X,nsBestProductsReport:W,nsLowStockReport:Y,nsCustomersStatementReport:Z,nsTransactionsRules:re,nsStockAdjustment:ee,nsOrderInvoice:te,...w},nsExtraComponents);window.nsDashboardAside=m({data(){return{sidebar:"visible",popups:[]}},components:{nsMenu:f,nsSubmenu:I},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardOverlay=m({data(){return{sidebar:null,popups:[]}},components:d,mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})},methods:{closeMenu(){n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}}});window.nsDashboardHeader=m({data(){return{menuToggled:!1,sidebar:null}},components:d,methods:{toggleMenu(){this.menuToggled=!this.menuToggled},toggleSideMenu(){["lg","xl"].includes(se.breakpoint)?n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"}):n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardContent=m({});for(let o in d)window.nsDashboardContent.component(o,d[o]);window.nsDashboardContent.use(O,{styles:Object.values(window.ns.cssFiles)});window.nsComponents=Object.assign(d,w);L.doAction("ns-before-mount");const c=document.querySelector("#dashboard-aside");window.nsDashboardAside&&c&&window.nsDashboardAside.mount(c);const b=document.querySelector("#dashboard-overlay");window.nsDashboardOverlay&&b&&window.nsDashboardOverlay.mount(b);const E=document.querySelector("#dashboard-header");window.nsDashboardHeader&&E&&window.nsDashboardHeader.mount(E);const h=document.querySelector("#dashboard-content");window.nsDashboardContent&&h&&window.nsDashboardContent.mount(h); + `),V(s,p),setTimeout(()=>{s.document.close(),s.focus(),s.print(),s.close(),D()},1e3),!0}}},S=t(()=>e(()=>import("./rewards-system-BiuV1FtS.js"),__vite__mapDeps([0,1,2,3,4,5]),import.meta.url)),g=t(()=>e(()=>import("./create-coupons-DYyqLn74.js"),__vite__mapDeps([6,1,2,3,4,5]),import.meta.url)),C=t(()=>e(()=>import("./ns-settings-DWcCMpBe.js"),__vite__mapDeps([7,2,1,3,4,8,9,5,10,11]),import.meta.url)),k=t(()=>e(()=>import("./reset-N7SWAWxc.js"),__vite__mapDeps([12,2,1,3,4,5]),import.meta.url)),H=t(()=>e(()=>import("./modules-Bu6KfA-Y.js"),__vite__mapDeps([13,1,2,3,4,9,5,10]),import.meta.url)),M=t(()=>e(()=>import("./ns-permissions-JMoWKSsL.js"),__vite__mapDeps([14,1,2,3,4,5]),import.meta.url)),j=t(()=>e(()=>import("./ns-procurement-BAj_8zXp.js"),__vite__mapDeps([15,1,2,3,4,16,9,5,10,8,11,17,18]),import.meta.url)),N=t(()=>e(()=>import("./manage-products-S0TS_1i7.js"),__vite__mapDeps([16,1,2,3,4,9,5,10,8,11]),import.meta.url)),q=t(()=>e(()=>import("./ns-procurement-invoice-DSSNRCNz.js"),[],import.meta.url)),x=t(()=>e(()=>import("./ns-notifications-DTgViA_N.js"),__vite__mapDeps([19,1,2,3,4,9,5,10,8,11]),import.meta.url)),$=t(()=>e(()=>import("./components-CxIJxoVN.js").then(o=>o.j),__vite__mapDeps([8,9,2,5,4,1,3,10,11]),import.meta.url)),B=t(()=>e(()=>import("./ns-transaction-Blqx32cw.js"),__vite__mapDeps([20,1,2,3,4,9,5,10]),import.meta.url)),F=t(()=>e(()=>import("./ns-dashboard-Cf_lbzGm.js"),__vite__mapDeps([21,1,2,3,4,5]),import.meta.url)),Y=t(()=>e(()=>import("./ns-low-stock-report-BTC2n9h7.js"),__vite__mapDeps([22,1,2,3,4,8,9,5,10,11,18]),import.meta.url)),z=t(()=>e(()=>import("./ns-sale-report-GLlFxdxN.js"),__vite__mapDeps([23,1,2,3,4,8,9,5,10,11,18]),import.meta.url)),G=t(()=>e(()=>import("./ns-sold-stock-report-BmDdk5W6.js"),__vite__mapDeps([24,1,2,3,4,8,9,5,10,11,17,18]),import.meta.url)),J=t(()=>e(()=>import("./ns-profit-report-BFidAF-s.js"),__vite__mapDeps([25,1,2,3,4,8,9,5,10,11,17,18]),import.meta.url)),K=t(()=>e(()=>import("./ns-stock-combined-report-DjeIcmrp.js"),__vite__mapDeps([26,1,2,3,4,17,9,5,10,18]),import.meta.url)),Q=t(()=>e(()=>import("./ns-cash-flow-report-BtUS3-4v.js"),__vite__mapDeps([27,1,2,3,4,8,9,5,10,11]),import.meta.url)),U=t(()=>e(()=>import("./ns-yearly-report-BmtgFNPy.js"),__vite__mapDeps([28,1,2,3,4,8,9,5,10,11]),import.meta.url)),W=t(()=>e(()=>import("./ns-best-products-report-Dfkx0hDF.js"),__vite__mapDeps([29,1,2,3,4,8,9,5,10,11]),import.meta.url)),X=t(()=>e(()=>import("./ns-payment-types-report-BuVVhxIs.js"),__vite__mapDeps([30,1,2,3,4,8,9,5,10,11]),import.meta.url)),Z=t(()=>e(()=>import("./ns-customers-statement-report-BEnd_qb4.js"),__vite__mapDeps([31,2,5,4]),import.meta.url)),ee=t(()=>e(()=>import("./ns-stock-adjustment-C25P3SIo.js"),__vite__mapDeps([32,1,2,3,4,33,5,9,10]),import.meta.url)),te=t(()=>e(()=>import("./ns-order-invoice-C8eORg6S.js"),__vite__mapDeps([34,2,5,4]),import.meta.url)),oe=t(()=>e(()=>import("./ns-print-label-C5QsB0Rm.js"),__vite__mapDeps([35,2,4,1,3,5]),import.meta.url)),re=t(()=>e(()=>import("./ns-transactions-rules-o6Dosml4.js"),__vite__mapDeps([36,1,2,3,4,9,5,10,8,11]),import.meta.url)),n=window.nsState,se=window.nsScreen;nsExtraComponents.nsToken=t(()=>e(()=>import("./ns-token-t9X9rA7q.js"),__vite__mapDeps([37,1,2,3,4,5,9,10]),import.meta.url));window.nsHotPress=new y;const d=Object.assign({nsModules:H,nsRewardsSystem:S,nsCreateCoupons:g,nsManageProducts:N,nsSettings:C,nsReset:k,nsPermissions:M,nsProcurement:j,nsProcurementInvoice:q,nsMedia:$,nsTransaction:B,nsDashboard:F,nsPrintLabel:oe,nsNotifications:x,nsSaleReport:z,nsSoldStockReport:G,nsProfitReport:J,nsStockCombinedReport:K,nsCashFlowReport:Q,nsYearlyReport:U,nsPaymentTypesReport:X,nsBestProductsReport:W,nsLowStockReport:Y,nsCustomersStatementReport:Z,nsTransactionsRules:re,nsStockAdjustment:ee,nsOrderInvoice:te,...w},nsExtraComponents);window.nsDashboardAside=m({data(){return{sidebar:"visible",popups:[]}},components:{nsMenu:f,nsSubmenu:I},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardOverlay=m({data(){return{sidebar:null,popups:[]}},components:d,mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})},methods:{closeMenu(){n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}}});window.nsDashboardHeader=m({data(){return{menuToggled:!1,sidebar:null}},components:d,methods:{toggleMenu(){this.menuToggled=!this.menuToggled},toggleSideMenu(){["lg","xl"].includes(se.breakpoint)?n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"}):n.setState({sidebar:this.sidebar==="hidden"?"visible":"hidden"})}},mounted(){n.subscribe(o=>{o.sidebar&&(this.sidebar=o.sidebar)})}});window.nsDashboardContent=m({});for(let o in d)window.nsDashboardContent.component(o,d[o]);window.nsDashboardContent.use(O,{styles:Object.values(window.ns.cssFiles)});window.nsComponents=Object.assign(d,w);L.doAction("ns-before-mount");const c=document.querySelector("#dashboard-aside");window.nsDashboardAside&&c&&window.nsDashboardAside.mount(c);const b=document.querySelector("#dashboard-overlay");window.nsDashboardOverlay&&b&&window.nsDashboardOverlay.mount(b);const E=document.querySelector("#dashboard-header");window.nsDashboardHeader&&E&&window.nsDashboardHeader.mount(E);const h=document.querySelector("#dashboard-content");window.nsDashboardContent&&h&&window.nsDashboardContent.mount(h); diff --git a/public/build/assets/app-DP4WGg5r.css b/public/build/assets/app-DP4WGg5r.css deleted file mode 100644 index 7fd6ddf91..000000000 --- a/public/build/assets/app-DP4WGg5r.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none!important}.\!visible,.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.relative{position:relative!important}.inset-y-0{top:0!important;bottom:0!important}.-bottom-10{bottom:-5em!important}.-top-10{top:-5em!important}.-top-\[5px\]{top:-5px!important}.bottom-0{bottom:0!important}.left-0{left:0!important}.right-0{right:0!important}.top-0{top:0!important}.z-10{z-index:10!important}.z-30{z-index:30!important}.z-40{z-index:40!important}.z-50{z-index:50!important}.col-span-2{grid-column:span 2 / span 2!important}.col-span-3{grid-column:span 3 / span 3!important}.-m-2{margin:-.5rem!important}.-m-3{margin:-.75rem!important}.-m-4{margin:-1rem!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-4{margin:1rem!important}.-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.-mx-3{margin-left:-.75rem!important;margin-right:-.75rem!important}.-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.-my-1{margin-top:-.25rem!important;margin-bottom:-.25rem!important}.-my-2{margin-top:-.5rem!important;margin-bottom:-.5rem!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-4{margin-left:1rem!important;margin-right:1rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:.75rem!important;margin-bottom:.75rem!important}.my-4{margin-top:1rem!important;margin-bottom:1rem!important}.my-5{margin-top:1.25rem!important;margin-bottom:1.25rem!important}.-mb-2{margin-bottom:-.5rem!important}.-ml-28{margin-left:-7rem!important}.-ml-3{margin-left:-.75rem!important}.-ml-6{margin-left:-1.5rem!important}.-mt-4{margin-top:-1rem!important}.-mt-8{margin-top:-2rem!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:.75rem!important}.mb-4{margin-bottom:1rem!important}.mb-6{margin-bottom:1.5rem!important}.mb-8{margin-bottom:2rem!important}.ml-1{margin-left:.25rem!important}.ml-2{margin-left:.5rem!important}.ml-3{margin-left:.75rem!important}.ml-4{margin-left:1rem!important}.mr-1{margin-right:.25rem!important}.mr-2{margin-right:.5rem!important}.mr-4{margin-right:1rem!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-4{margin-top:1rem!important}.mt-5{margin-top:1.25rem!important}.mt-8{margin-top:2rem!important}.box-border{box-sizing:border-box!important}.block{display:block!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.table{display:table!important}.table-cell{display:table-cell!important}.grid{display:grid!important}.hidden{display:none!important}.aspect-square{aspect-ratio:1 / 1!important}.h-0{height:0px!important}.h-1\/3-screen{height:33.33vh!important}.h-1\/4-screen{height:25vh!important}.h-1\/5-screen{height:20vh!important}.h-1\/6-screen{height:16.66vh!important}.h-1\/7-screen{height:14.28vh!important}.h-10{height:2.5rem!important}.h-12{height:3rem!important}.h-16{height:4rem!important}.h-2{height:.5rem!important}.h-2\/3-screen{height:66.66vh!important}.h-2\/4-screen{height:50vh!important}.h-2\/5-screen{height:40vh!important}.h-2\/6-screen{height:33.33vh!important}.h-2\/7-screen{height:28.57vh!important}.h-20{height:5rem!important}.h-24{height:6rem!important}.h-3\/4-screen{height:75vh!important}.h-3\/5-screen{height:60vh!important}.h-3\/6-screen{height:50vh!important}.h-3\/7-screen{height:42.85vh!important}.h-32{height:8rem!important}.h-36{height:9rem!important}.h-4\/5-screen{height:80vh!important}.h-4\/6-screen{height:66.66vh!important}.h-4\/7-screen{height:57.14vh!important}.h-40{height:10rem!important}.h-5{height:1.25rem!important}.h-5\/6-screen{height:83.33vh!important}.h-5\/7-screen{height:71.42vh!important}.h-56{height:14rem!important}.h-6{height:1.5rem!important}.h-6\/7-screen{height:85.71vh!important}.h-60{height:15rem!important}.h-64{height:16rem!important}.h-72{height:18rem!important}.h-8{height:2rem!important}.h-95vh{height:95vh!important}.h-96{height:24rem!important}.h-full{height:100%!important}.h-half{height:50vh!important}.h-screen{height:100vh!important}.max-h-5\/6-screen{max-height:83.33vh!important}.max-h-6\/7-screen{max-height:85.71vh!important}.max-h-80{max-height:20rem!important}.min-h-2\/5-screen{min-height:40vh!important}.w-0{width:0px!important}.w-1\/2{width:50%!important}.w-1\/3{width:33.333333%!important}.w-1\/3-screen{width:33.33vw!important}.w-1\/4{width:25%!important}.w-1\/4-screen{width:25vw!important}.w-1\/5-screen{width:20vw!important}.w-1\/6{width:16.666667%!important}.w-1\/6-screen{width:16.66vw!important}.w-1\/7-screen{width:14.28vw!important}.w-10{width:2.5rem!important}.w-11\/12{width:91.666667%!important}.w-12{width:3rem!important}.w-16{width:4rem!important}.w-2\/3-screen{width:66.66vw!important}.w-2\/4-screen{width:50vw!important}.w-2\/5-screen{width:40vw!important}.w-2\/6-screen{width:33.33vw!important}.w-2\/7-screen{width:28.57vw!important}.w-20{width:5rem!important}.w-24{width:6rem!important}.w-3\/4-screen{width:75vw!important}.w-3\/5-screen{width:60vw!important}.w-3\/6-screen{width:50vw!important}.w-3\/7-screen{width:42.85vw!important}.w-32{width:8rem!important}.w-36{width:9rem!important}.w-4\/5-screen{width:80vw!important}.w-4\/6-screen{width:66.66vw!important}.w-4\/7-screen{width:57.14vw!important}.w-48{width:12rem!important}.w-5{width:1.25rem!important}.w-5\/6-screen{width:83.33vw!important}.w-5\/7-screen{width:71.42vw!important}.w-52{width:13rem!important}.w-56{width:14rem!important}.w-6{width:1.5rem!important}.w-6\/7-screen{width:85.71vw!important}.w-60{width:15rem!important}.w-64{width:16rem!important}.w-72{width:18rem!important}.w-8{width:2rem!important}.w-95vw{width:95vw!important}.w-\[225px\]{width:225px!important}.w-auto{width:auto!important}.w-full{width:100%!important}.w-screen{width:100vw!important}.min-w-\[2rem\]{min-width:2rem!important}.min-w-fit{min-width:fit-content!important}.flex-auto{flex:1 1 auto!important}.flex-shrink-0{flex-shrink:0!important}.grow-0{flex-grow:0!important}.table-auto{table-layout:auto!important}.origin-bottom-right{transform-origin:bottom right!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite!important}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite!important}.cursor-default{cursor:default!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.select-none{-webkit-user-select:none!important;user-select:none!important}.resize{resize:both!important}.appearance-none{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.grid-flow-row{grid-auto-flow:row!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))!important}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))!important}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))!important}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))!important}.flex-row{flex-direction:row!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.justify-around{justify-content:space-around!important}.gap-0{gap:0px!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0 !important;border-right-width:calc(1px * var(--tw-divide-x-reverse))!important;border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))!important}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px * var(--tw-divide-y-reverse))!important}.divide-y-4>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(4px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(4px * var(--tw-divide-y-reverse))!important}.self-center{align-self:center!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-x-auto{overflow-x:auto!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-scroll{overflow-y:scroll!important}.truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.whitespace-pre-wrap{white-space:pre-wrap!important}.rounded{border-radius:.25rem!important}.rounded-full{border-radius:9999px!important}.rounded-lg{border-radius:.5rem!important}.rounded-md{border-radius:.375rem!important}.rounded-none{border-radius:0!important}.rounded-b-md{border-bottom-right-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.rounded-t-lg{border-top-left-radius:.5rem!important;border-top-right-radius:.5rem!important}.rounded-t-md{border-top-left-radius:.375rem!important;border-top-right-radius:.375rem!important}.rounded-bl{border-bottom-left-radius:.25rem!important}.rounded-bl-lg{border-bottom-left-radius:.5rem!important}.rounded-br{border-bottom-right-radius:.25rem!important}.rounded-br-lg{border-bottom-right-radius:.5rem!important}.rounded-tl{border-top-left-radius:.25rem!important}.rounded-tl-lg{border-top-left-radius:.5rem!important}.rounded-tr{border-top-right-radius:.25rem!important}.rounded-tr-lg{border-top-right-radius:.5rem!important}.border{border-width:1px!important}.border-0{border-width:0px!important}.border-2{border-width:2px!important}.border-4{border-width:4px!important}.border-b{border-bottom-width:1px!important}.border-b-0{border-bottom-width:0px!important}.border-b-2{border-bottom-width:2px!important}.border-b-4{border-bottom-width:4px!important}.border-l{border-left-width:1px!important}.border-l-0{border-left-width:0px!important}.border-l-2{border-left-width:2px!important}.border-l-4{border-left-width:4px!important}.border-l-8{border-left-width:8px!important}.border-r{border-right-width:1px!important}.border-r-0{border-right-width:0px!important}.border-r-2{border-right-width:2px!important}.border-t{border-top-width:1px!important}.border-t-0{border-top-width:0px!important}.border-t-4{border-top-width:4px!important}.border-dashed{border-style:dashed!important}.border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity))!important}.border-blue-200{--tw-border-opacity: 1 !important;border-color:rgb(191 219 254 / var(--tw-border-opacity))!important}.border-blue-400{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.border-blue-600{--tw-border-opacity: 1 !important;border-color:rgb(37 99 235 / var(--tw-border-opacity))!important}.border-box-background{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-background) / var(--tw-border-opacity))!important}.border-box-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))!important}.border-box-elevation-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity))!important}.border-danger-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--danger-secondary) / var(--tw-border-opacity))!important}.border-error-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))!important}.border-error-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))!important}.border-error-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))!important}.border-floating-menu-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--floating-menu-edge) / var(--tw-border-opacity))!important}.border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity))!important}.border-gray-300{--tw-border-opacity: 1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity))!important}.border-gray-400{--tw-border-opacity: 1 !important;border-color:rgb(156 163 175 / var(--tw-border-opacity))!important}.border-gray-500{--tw-border-opacity: 1 !important;border-color:rgb(107 114 128 / var(--tw-border-opacity))!important}.border-gray-700{--tw-border-opacity: 1 !important;border-color:rgb(55 65 81 / var(--tw-border-opacity))!important}.border-gray-800{--tw-border-opacity: 1 !important;border-color:rgb(31 41 55 / var(--tw-border-opacity))!important}.border-green-200{--tw-border-opacity: 1 !important;border-color:rgb(187 247 208 / var(--tw-border-opacity))!important}.border-green-600{--tw-border-opacity: 1 !important;border-color:rgb(22 163 74 / var(--tw-border-opacity))!important}.border-info-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.border-info-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity))!important}.border-info-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))!important}.border-input-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))!important}.border-input-option-hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-option-hover) / var(--tw-border-opacity))!important}.border-numpad-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}.border-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--primary) / var(--tw-border-opacity))!important}.border-red-200{--tw-border-opacity: 1 !important;border-color:rgb(254 202 202 / var(--tw-border-opacity))!important}.border-slate-400{--tw-border-opacity: 1 !important;border-color:rgb(148 163 184 / var(--tw-border-opacity))!important}.border-slate-600{--tw-border-opacity: 1 !important;border-color:rgb(71 85 105 / var(--tw-border-opacity))!important}.border-success-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))!important}.border-success-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity))!important}.border-success-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))!important}.border-tab-table-th{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th) / var(--tw-border-opacity))!important}.border-tab-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity))!important}.border-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))!important}.border-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--tertiary) / var(--tw-border-opacity))!important}.border-transparent{border-color:transparent!important}.border-yellow-200{--tw-border-opacity: 1 !important;border-color:rgb(254 240 138 / var(--tw-border-opacity))!important}.border-b-transparent{border-bottom-color:transparent!important}.border-l-box-edge{--tw-border-opacity: 1 !important;border-left-color:rgb(var(--box-edge) / var(--tw-border-opacity))!important}.bg-blue-100{--tw-bg-opacity: 1 !important;background-color:rgb(219 234 254 / var(--tw-bg-opacity))!important}.bg-blue-400{--tw-bg-opacity: 1 !important;background-color:rgb(96 165 250 / var(--tw-bg-opacity))!important}.bg-blue-500{--tw-bg-opacity: 1 !important;background-color:rgb(59 130 246 / var(--tw-bg-opacity))!important}.bg-box-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.bg-error-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))!important}.bg-error-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.bg-error-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.bg-floating-menu{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu) / var(--tw-bg-opacity))!important}.bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity))!important}.bg-gray-300{--tw-bg-opacity: 1 !important;background-color:rgb(209 213 219 / var(--tw-bg-opacity))!important}.bg-gray-400{--tw-bg-opacity: 1 !important;background-color:rgb(156 163 175 / var(--tw-bg-opacity))!important}.bg-gray-500{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.bg-gray-600{--tw-bg-opacity: 1 !important;background-color:rgb(75 85 99 / var(--tw-bg-opacity))!important}.bg-gray-700{--tw-bg-opacity: 1 !important;background-color:rgb(55 65 81 / var(--tw-bg-opacity))!important}.bg-gray-800{--tw-bg-opacity: 1 !important;background-color:rgb(31 41 55 / var(--tw-bg-opacity))!important}.bg-gray-900{--tw-bg-opacity: 1 !important;background-color:rgb(17 24 39 / var(--tw-bg-opacity))!important}.bg-green-100{--tw-bg-opacity: 1 !important;background-color:rgb(220 252 231 / var(--tw-bg-opacity))!important}.bg-green-200{--tw-bg-opacity: 1 !important;background-color:rgb(187 247 208 / var(--tw-bg-opacity))!important}.bg-green-400{--tw-bg-opacity: 1 !important;background-color:rgb(74 222 128 / var(--tw-bg-opacity))!important}.bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.bg-info-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.bg-info-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.bg-info-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.bg-input-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))!important}.bg-input-button{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button) / var(--tw-bg-opacity))!important}.bg-input-disabled{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))!important}.bg-input-edge{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))!important}.bg-popup-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))!important}.bg-red-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 226 226 / var(--tw-bg-opacity))!important}.bg-red-400{--tw-bg-opacity: 1 !important;background-color:rgb(248 113 113 / var(--tw-bg-opacity))!important}.bg-red-500{--tw-bg-opacity: 1 !important;background-color:rgb(239 68 68 / var(--tw-bg-opacity))!important}.bg-slate-200{--tw-bg-opacity: 1 !important;background-color:rgb(226 232 240 / var(--tw-bg-opacity))!important}.bg-slate-300{--tw-bg-opacity: 1 !important;background-color:rgb(203 213 225 / var(--tw-bg-opacity))!important}.bg-success-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))!important}.bg-success-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))!important}.bg-success-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.bg-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--surface) / var(--tw-bg-opacity))!important}.bg-tab-active{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))!important}.bg-tab-inactive{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))!important}.bg-tab-table-th{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-table-th) / var(--tw-bg-opacity))!important}.bg-transparent{background-color:transparent!important}.bg-warning-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity))!important}.bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.bg-yellow-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 249 195 / var(--tw-bg-opacity))!important}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))!important}.bg-gradient-to-bl{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))!important}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))!important}.from-blue-200{--tw-gradient-from: #bfdbfe var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(191 219 254 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-error-secondary{--tw-gradient-from: rgb(var(--error-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--error-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-green-400{--tw-gradient-from: #4ade80 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(74 222 128 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-indigo-400{--tw-gradient-from: #818cf8 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(129 140 248 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-info-secondary{--tw-gradient-from: rgb(var(--info-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--info-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-pink-400{--tw-gradient-from: #f472b6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(244 114 182 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-300{--tw-gradient-from: #d8b4fe var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(216 180 254 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-400{--tw-gradient-from: #f87171 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(248 113 113 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-success-secondary{--tw-gradient-from: rgb(var(--success-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--success-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-teal-500{--tw-gradient-from: #14b8a6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(20 184 166 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position) !important}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position) !important}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position) !important}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position) !important}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position) !important}.to-green-700{--tw-gradient-to: #15803d var(--tw-gradient-to-position) !important}.to-indigo-400{--tw-gradient-to: #818cf8 var(--tw-gradient-to-position) !important}.to-indigo-600{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position) !important}.to-info-tertiary{--tw-gradient-to: rgb(var(--info-tertiary)) var(--tw-gradient-to-position) !important}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position) !important}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position) !important}.to-purple-700{--tw-gradient-to: #7e22ce var(--tw-gradient-to-position) !important}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position) !important}.to-red-600{--tw-gradient-to: #dc2626 var(--tw-gradient-to-position) !important}.to-red-700{--tw-gradient-to: #b91c1c var(--tw-gradient-to-position) !important}.to-teal-700{--tw-gradient-to: #0f766e var(--tw-gradient-to-position) !important}.bg-clip-text{-webkit-background-clip:text!important;background-clip:text!important}.object-cover{object-fit:cover!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-10{padding:2.5rem!important}.p-2{padding:.5rem!important}.p-3{padding:.75rem!important}.p-4{padding:1rem!important}.p-8{padding:2rem!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-10{padding-top:2.5rem!important;padding-bottom:2.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.py-4{padding-top:1rem!important;padding-bottom:1rem!important}.py-5{padding-top:1.25rem!important;padding-bottom:1.25rem!important}.py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-8{padding-top:2rem!important;padding-bottom:2rem!important}.pb-1{padding-bottom:.25rem!important}.pb-10{padding-bottom:2.5rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:.75rem!important}.pb-4{padding-bottom:1rem!important}.pl-0{padding-left:0!important}.pl-1{padding-left:.25rem!important}.pl-2{padding-left:.5rem!important}.pl-3{padding-left:.75rem!important}.pl-4{padding-left:1rem!important}.pl-7{padding-left:1.75rem!important}.pl-8{padding-left:2rem!important}.pr-1{padding-right:.25rem!important}.pr-12{padding-right:3rem!important}.pr-2{padding-right:.5rem!important}.pr-4{padding-right:1rem!important}.pr-8{padding-right:2rem!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-6{padding-top:1.5rem!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}.font-body{font-family:Graphik,sans-serif!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important;line-height:1!important}.text-6xl{font-size:3.75rem!important;line-height:1!important}.text-7xl{font-size:4.5rem!important;line-height:1!important}.text-8xl{font-size:6rem!important;line-height:1!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-black{font-weight:900!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.font-semibold{font-weight:600!important}.uppercase{text-transform:uppercase!important}.leading-5{line-height:1.25rem!important}.text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.text-blue-500{--tw-text-opacity: 1 !important;color:rgb(59 130 246 / var(--tw-text-opacity))!important}.text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity))!important}.text-danger-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--danger-light-tertiary) / var(--tw-text-opacity))!important}.text-error-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-light-tertiary) / var(--tw-text-opacity))!important}.text-error-primary{--tw-text-opacity: 1 !important;color:rgb(var(--error-primary) / var(--tw-text-opacity))!important}.text-error-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.text-error-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-tertiary) / var(--tw-text-opacity))!important}.text-gray-100{--tw-text-opacity: 1 !important;color:rgb(243 244 246 / var(--tw-text-opacity))!important}.text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity))!important}.text-gray-600{--tw-text-opacity: 1 !important;color:rgb(75 85 99 / var(--tw-text-opacity))!important}.text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.text-gray-800{--tw-text-opacity: 1 !important;color:rgb(31 41 55 / var(--tw-text-opacity))!important}.text-green-700{--tw-text-opacity: 1 !important;color:rgb(21 128 61 / var(--tw-text-opacity))!important}.text-info-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--info-secondary) / var(--tw-text-opacity))!important}.text-info-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))!important}.text-primary{--tw-text-opacity: 1 !important;color:rgb(var(--primary) / var(--tw-text-opacity))!important}.text-purple-500{--tw-text-opacity: 1 !important;color:rgb(168 85 247 / var(--tw-text-opacity))!important}.text-red-500{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.text-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--secondary) / var(--tw-text-opacity))!important}.text-soft-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-secondary) / var(--tw-text-opacity))!important}.text-soft-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-tertiary) / var(--tw-text-opacity))!important}.text-success-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.text-success-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))!important}.text-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--tertiary) / var(--tw-text-opacity))!important}.text-transparent{color:transparent!important}.text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.underline{text-decoration-line:underline!important}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.blur{--tw-blur: blur(8px) !important;filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.duration-100{transition-duration:.1s!important}.ease-linear{transition-timing-function:linear!important}.\[key\:string\]{key:string!important}html,body{height:100%;font-family:Jost;width:100%}.bg-overlay{background:#33333342}[v-cloak]>*{display:none}.loader{border-top-color:#3498db!important}.loader.slow{-webkit-animation:spinner 1.5s linear infinite;animation:spinner 1.5s linear infinite}.loader.fast{-webkit-animation:spinner .7s linear infinite;animation:spinner .7s linear infinite}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}button{border-radius:0}#editor h1{font-size:3rem;line-height:1;font-weight:700}#editor h2{font-size:2.25rem;line-height:2.5rem;font-weight:700}#editor h3{font-size:1.875rem;line-height:2.25rem;font-weight:700}#editor h4{font-size:1.5rem;line-height:2rem;font-weight:700}#editor h5{font-size:1.25rem;line-height:1.75rem;font-weight:700}#grid-items .vue-recycle-scroller__item-wrapper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0px;overflow-y:auto}@media (min-width: 768px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1280px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(5,minmax(0,1fr))}}#grid-items .vue-recycle-scroller__item-view{display:flex;height:8rem;cursor:pointer;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-view{height:10rem}}#grid-items .vue-recycle-scroller__item-view:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.popup-heading{display:flex;align-items:center;justify-content:space-between;padding:.5rem}.popup-heading h3{font-weight:600}.hover\:cursor-pointer:hover{cursor:pointer!important}.hover\:border-error-secondary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))!important}.hover\:border-error-tertiary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))!important}.hover\:border-info-primary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.hover\:border-info-secondary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity))!important}.hover\:border-transparent:hover{border-color:transparent!important}.hover\:border-opacity-0:hover{--tw-border-opacity: 0 !important}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.hover\:bg-box-elevation-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.hover\:bg-error-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-error-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-floating-menu-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu-hover) / var(--tw-bg-opacity))!important}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.hover\:bg-green-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.hover\:bg-green-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(22 163 74 / var(--tw-bg-opacity))!important}.hover\:bg-info-primary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.hover\:bg-info-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-info-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-input-button-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))!important}.hover\:bg-numpad-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))!important}.hover\:bg-red-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}.hover\:bg-success-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-white:hover{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.hover\:text-blue-400:hover{--tw-text-opacity: 1 !important;color:rgb(96 165 250 / var(--tw-text-opacity))!important}.hover\:text-error-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.hover\:text-gray-700:hover{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.hover\:text-info-primary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--info-primary) / var(--tw-text-opacity))!important}.hover\:text-success-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.hover\:text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:underline:hover{text-decoration-line:underline!important}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.focus\:border-blue-400:focus{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.focus\:shadow-sm:focus{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.active\:border-numpad-edge:active{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(29 78 216 / var(--tw-border-opacity))!important}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(22 101 52 / var(--tw-border-opacity))!important}.dark\:border-red-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(185 28 28 / var(--tw-border-opacity))!important}.dark\:border-yellow-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(161 98 7 / var(--tw-border-opacity))!important}.dark\:bg-blue-600:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.dark\:bg-green-700:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(21 128 61 / var(--tw-bg-opacity))!important}.dark\:bg-red-600:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}.dark\:bg-yellow-600:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(202 138 4 / var(--tw-bg-opacity))!important}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1 !important;color:rgb(203 213 225 / var(--tw-text-opacity))!important}@media (min-width: 640px){.sm\:relative{position:relative!important}.sm\:mx-auto{margin-left:auto!important;margin-right:auto!important}.sm\:hidden{display:none!important}.sm\:h-1\/3-screen{height:33.33vh!important}.sm\:h-1\/4-screen{height:25vh!important}.sm\:h-1\/5-screen{height:20vh!important}.sm\:h-1\/6-screen{height:16.66vh!important}.sm\:h-1\/7-screen{height:14.28vh!important}.sm\:h-108{height:27rem!important}.sm\:h-2\/3-screen{height:66.66vh!important}.sm\:h-2\/4-screen{height:50vh!important}.sm\:h-2\/5-screen{height:40vh!important}.sm\:h-2\/6-screen{height:33.33vh!important}.sm\:h-2\/7-screen{height:28.57vh!important}.sm\:h-3\/4-screen{height:75vh!important}.sm\:h-3\/5-screen{height:60vh!important}.sm\:h-3\/6-screen{height:50vh!important}.sm\:h-3\/7-screen{height:42.85vh!important}.sm\:h-4\/5-screen{height:80vh!important}.sm\:h-4\/6-screen{height:66.66vh!important}.sm\:h-4\/7-screen{height:57.14vh!important}.sm\:h-5\/6-screen{height:83.33vh!important}.sm\:h-5\/7-screen{height:71.42vh!important}.sm\:h-6\/7-screen{height:85.71vh!important}.sm\:w-1\/3-screen{width:33.33vw!important}.sm\:w-1\/4-screen{width:25vw!important}.sm\:w-1\/5-screen{width:20vw!important}.sm\:w-1\/6-screen{width:16.66vw!important}.sm\:w-1\/7-screen{width:14.28vw!important}.sm\:w-2\/3-screen{width:66.66vw!important}.sm\:w-2\/4-screen{width:50vw!important}.sm\:w-2\/5-screen{width:40vw!important}.sm\:w-2\/6-screen{width:33.33vw!important}.sm\:w-2\/7-screen{width:28.57vw!important}.sm\:w-3\/4-screen{width:75vw!important}.sm\:w-3\/5-screen{width:60vw!important}.sm\:w-3\/6-screen{width:50vw!important}.sm\:w-3\/7-screen{width:42.85vw!important}.sm\:w-4\/5-screen{width:80vw!important}.sm\:w-4\/6-screen{width:66.66vw!important}.sm\:w-4\/7-screen{width:57.14vw!important}.sm\:w-5\/6-screen{width:83.33vw!important}.sm\:w-5\/7-screen{width:71.42vw!important}.sm\:w-6\/7-screen{width:85.71vw!important}.sm\:w-64{width:16rem!important}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.sm\:flex-row{flex-direction:row!important}.sm\:rounded-lg{border-radius:.5rem!important}.sm\:text-sm{font-size:.875rem!important;line-height:1.25rem!important}.sm\:leading-5{line-height:1.25rem!important}}@media (min-width: 768px){.md\:visible{visibility:visible!important}.md\:static{position:static!important}.md\:-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.md\:-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.md\:-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.md\:my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.md\:mb-0{margin-bottom:0!important}.md\:mt-0{margin-top:0!important}.md\:mt-2{margin-top:.5rem!important}.md\:block{display:block!important}.md\:inline-block{display:inline-block!important}.md\:inline{display:inline!important}.md\:flex{display:flex!important}.md\:table-cell{display:table-cell!important}.md\:hidden{display:none!important}.md\:h-1\/3-screen{height:33.33vh!important}.md\:h-1\/4-screen{height:25vh!important}.md\:h-1\/5-screen{height:20vh!important}.md\:h-1\/6-screen{height:16.66vh!important}.md\:h-1\/7-screen{height:14.28vh!important}.md\:h-10{height:2.5rem!important}.md\:h-2\/3-screen{height:66.66vh!important}.md\:h-2\/4-screen{height:50vh!important}.md\:h-2\/5-screen{height:40vh!important}.md\:h-2\/6-screen{height:33.33vh!important}.md\:h-2\/7-screen{height:28.57vh!important}.md\:h-3\/4-screen{height:75vh!important}.md\:h-3\/5-screen{height:60vh!important}.md\:h-3\/6-screen{height:50vh!important}.md\:h-3\/7-screen{height:42.85vh!important}.md\:h-4\/5-screen{height:80vh!important}.md\:h-4\/6-screen{height:66.66vh!important}.md\:h-4\/7-screen{height:57.14vh!important}.md\:h-5\/6-screen{height:83.33vh!important}.md\:h-5\/7-screen{height:71.42vh!important}.md\:h-6\/7-screen{height:85.71vh!important}.md\:h-full{height:100%!important}.md\:w-1\/2{width:50%!important}.md\:w-1\/3{width:33.333333%!important}.md\:w-1\/3-screen{width:33.33vw!important}.md\:w-1\/4{width:25%!important}.md\:w-1\/4-screen{width:25vw!important}.md\:w-1\/5-screen{width:20vw!important}.md\:w-1\/6-screen{width:16.66vw!important}.md\:w-1\/7-screen{width:14.28vw!important}.md\:w-10{width:2.5rem!important}.md\:w-16{width:4rem!important}.md\:w-2\/3{width:66.666667%!important}.md\:w-2\/3-screen{width:66.66vw!important}.md\:w-2\/4-screen{width:50vw!important}.md\:w-2\/5{width:40%!important}.md\:w-2\/5-screen{width:40vw!important}.md\:w-2\/6-screen{width:33.33vw!important}.md\:w-2\/7-screen{width:28.57vw!important}.md\:w-24{width:6rem!important}.md\:w-28{width:7rem!important}.md\:w-3\/4{width:75%!important}.md\:w-3\/4-screen{width:75vw!important}.md\:w-3\/5{width:60%!important}.md\:w-3\/5-screen{width:60vw!important}.md\:w-3\/6-screen{width:50vw!important}.md\:w-3\/7-screen{width:42.85vw!important}.md\:w-4\/5{width:80%!important}.md\:w-4\/5-screen{width:80vw!important}.md\:w-4\/6-screen{width:66.66vw!important}.md\:w-4\/7-screen{width:57.14vw!important}.md\:w-5\/6-screen{width:83.33vw!important}.md\:w-5\/7-screen{width:71.42vw!important}.md\:w-56{width:14rem!important}.md\:w-6\/7-screen{width:85.71vw!important}.md\:w-60{width:15rem!important}.md\:w-72{width:18rem!important}.md\:w-80{width:20rem!important}.md\:w-96{width:24rem!important}.md\:w-\[550px\]{width:550px!important}.md\:w-auto{width:auto!important}.md\:w-full{width:100%!important}.md\:flex-auto{flex:1 1 auto!important}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.md\:flex-row{flex-direction:row!important}.md\:flex-col{flex-direction:column!important}.md\:flex-wrap{flex-wrap:wrap!important}.md\:items-start{align-items:flex-start!important}.md\:items-center{align-items:center!important}.md\:justify-center{justify-content:center!important}.md\:justify-between{justify-content:space-between!important}.md\:rounded{border-radius:.25rem!important}.md\:border-l{border-left-width:1px!important}.md\:p-0{padding:0!important}.md\:px-1{padding-left:.25rem!important;padding-right:.25rem!important}.md\:px-2{padding-left:.5rem!important;padding-right:.5rem!important}.md\:px-4{padding-left:1rem!important;padding-right:1rem!important}.md\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}.md\:text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:text-base{font-size:1rem!important;line-height:1.5rem!important}.md\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1024px){.lg\:my-8{margin-top:2rem!important;margin-bottom:2rem!important}.lg\:block{display:block!important}.lg\:flex{display:flex!important}.lg\:hidden{display:none!important}.lg\:h-1\/3-screen{height:33.33vh!important}.lg\:h-1\/4-screen{height:25vh!important}.lg\:h-1\/5-screen{height:20vh!important}.lg\:h-1\/6-screen{height:16.66vh!important}.lg\:h-1\/7-screen{height:14.28vh!important}.lg\:h-2\/3-screen{height:66.66vh!important}.lg\:h-2\/4-screen{height:50vh!important}.lg\:h-2\/5-screen{height:40vh!important}.lg\:h-2\/6-screen{height:33.33vh!important}.lg\:h-2\/7-screen{height:28.57vh!important}.lg\:h-3\/4-screen{height:75vh!important}.lg\:h-3\/5-screen{height:60vh!important}.lg\:h-3\/6-screen{height:50vh!important}.lg\:h-3\/7-screen{height:42.85vh!important}.lg\:h-4\/5-screen{height:80vh!important}.lg\:h-4\/6-screen{height:66.66vh!important}.lg\:h-4\/7-screen{height:57.14vh!important}.lg\:h-5\/6-screen{height:83.33vh!important}.lg\:h-5\/7-screen{height:71.42vh!important}.lg\:h-6\/7-screen{height:85.71vh!important}.lg\:h-full{height:100%!important}.lg\:w-1\/2{width:50%!important}.lg\:w-1\/3{width:33.333333%!important}.lg\:w-1\/3-screen{width:33.33vw!important}.lg\:w-1\/4{width:25%!important}.lg\:w-1\/4-screen{width:25vw!important}.lg\:w-1\/5-screen{width:20vw!important}.lg\:w-1\/6{width:16.666667%!important}.lg\:w-1\/6-screen{width:16.66vw!important}.lg\:w-1\/7-screen{width:14.28vw!important}.lg\:w-2\/3{width:66.666667%!important}.lg\:w-2\/3-screen{width:66.66vw!important}.lg\:w-2\/4{width:50%!important}.lg\:w-2\/4-screen{width:50vw!important}.lg\:w-2\/5{width:40%!important}.lg\:w-2\/5-screen{width:40vw!important}.lg\:w-2\/6-screen{width:33.33vw!important}.lg\:w-2\/7-screen{width:28.57vw!important}.lg\:w-3\/4-screen{width:75vw!important}.lg\:w-3\/5{width:60%!important}.lg\:w-3\/5-screen{width:60vw!important}.lg\:w-3\/6-screen{width:50vw!important}.lg\:w-3\/7-screen{width:42.85vw!important}.lg\:w-4\/5-screen{width:80vw!important}.lg\:w-4\/6{width:66.666667%!important}.lg\:w-4\/6-screen{width:66.66vw!important}.lg\:w-4\/7-screen{width:57.14vw!important}.lg\:w-5\/6-screen{width:83.33vw!important}.lg\:w-5\/7-screen{width:71.42vw!important}.lg\:w-56{width:14rem!important}.lg\:w-6\/7-screen{width:85.71vw!important}.lg\:w-auto{width:auto!important}.lg\:w-full{width:100%!important}.lg\:w-half{width:50vw!important}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.lg\:flex-row{flex-direction:row!important}.lg\:items-start{align-items:flex-start!important}.lg\:px-0{padding-left:0!important;padding-right:0!important}.lg\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}.lg\:text-5xl{font-size:3rem!important;line-height:1!important}.lg\:text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.lg\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1280px){.xl\:h-1\/3-screen{height:33.33vh!important}.xl\:h-1\/4-screen{height:25vh!important}.xl\:h-1\/5-screen{height:20vh!important}.xl\:h-1\/6-screen{height:16.66vh!important}.xl\:h-1\/7-screen{height:14.28vh!important}.xl\:h-2\/3-screen{height:66.66vh!important}.xl\:h-2\/4-screen{height:50vh!important}.xl\:h-2\/5-screen{height:40vh!important}.xl\:h-2\/6-screen{height:33.33vh!important}.xl\:h-2\/7-screen{height:28.57vh!important}.xl\:h-3\/4-screen{height:75vh!important}.xl\:h-3\/5-screen{height:60vh!important}.xl\:h-3\/6-screen{height:50vh!important}.xl\:h-3\/7-screen{height:42.85vh!important}.xl\:h-4\/5-screen{height:80vh!important}.xl\:h-4\/6-screen{height:66.66vh!important}.xl\:h-4\/7-screen{height:57.14vh!important}.xl\:h-5\/6-screen{height:83.33vh!important}.xl\:h-5\/7-screen{height:71.42vh!important}.xl\:h-6\/7-screen{height:85.71vh!important}.xl\:w-1\/3-screen{width:33.33vw!important}.xl\:w-1\/4{width:25%!important}.xl\:w-1\/4-screen{width:25vw!important}.xl\:w-1\/5-screen{width:20vw!important}.xl\:w-1\/6-screen{width:16.66vw!important}.xl\:w-1\/7-screen{width:14.28vw!important}.xl\:w-108{width:27rem!important}.xl\:w-2\/3-screen{width:66.66vw!important}.xl\:w-2\/4-screen{width:50vw!important}.xl\:w-2\/5-screen{width:40vw!important}.xl\:w-2\/6-screen{width:33.33vw!important}.xl\:w-2\/7-screen{width:28.57vw!important}.xl\:w-3\/4-screen{width:75vw!important}.xl\:w-3\/5-screen{width:60vw!important}.xl\:w-3\/6-screen{width:50vw!important}.xl\:w-3\/7-screen{width:42.85vw!important}.xl\:w-4\/5-screen{width:80vw!important}.xl\:w-4\/6-screen{width:66.66vw!important}.xl\:w-4\/7-screen{width:57.14vw!important}.xl\:w-5\/6-screen{width:83.33vw!important}.xl\:w-5\/7-screen{width:71.42vw!important}.xl\:w-6\/7-screen{width:85.71vw!important}.xl\:w-84{width:21rem!important}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))!important}.xl\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media print{.print\:w-1\/2{width:50%!important}.print\:w-1\/3{width:33.333333%!important}.print\:text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}} diff --git a/public/build/assets/app-fGnO6HDn.css b/public/build/assets/app-fGnO6HDn.css new file mode 100644 index 000000000..a8f889a23 --- /dev/null +++ b/public/build/assets/app-fGnO6HDn.css @@ -0,0 +1 @@ +*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none!important}.\!visible,.visible{visibility:visible!important}.static{position:static!important}.fixed{position:fixed!important}.absolute{position:absolute!important}.relative{position:relative!important}.inset-y-0{top:0!important;bottom:0!important}.-bottom-10{bottom:-5em!important}.-top-10{top:-5em!important}.-top-\[5px\]{top:-5px!important}.bottom-0{bottom:0!important}.left-0{left:0!important}.right-0{right:0!important}.top-0{top:0!important}.z-10{z-index:10!important}.z-30{z-index:30!important}.z-40{z-index:40!important}.z-50{z-index:50!important}.col-span-2{grid-column:span 2 / span 2!important}.col-span-3{grid-column:span 3 / span 3!important}.-m-2{margin:-.5rem!important}.-m-3{margin:-.75rem!important}.-m-4{margin:-1rem!important}.m-1{margin:.25rem!important}.m-2{margin:.5rem!important}.m-4{margin:1rem!important}.-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.-mx-3{margin-left:-.75rem!important;margin-right:-.75rem!important}.-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.-my-1{margin-top:-.25rem!important;margin-bottom:-.25rem!important}.-my-2{margin-top:-.5rem!important;margin-bottom:-.5rem!important}.mx-1{margin-left:.25rem!important;margin-right:.25rem!important}.mx-2{margin-left:.5rem!important;margin-right:.5rem!important}.mx-4{margin-left:1rem!important;margin-right:1rem!important}.mx-auto{margin-left:auto!important;margin-right:auto!important}.my-1{margin-top:.25rem!important;margin-bottom:.25rem!important}.my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.my-3{margin-top:.75rem!important;margin-bottom:.75rem!important}.my-4{margin-top:1rem!important;margin-bottom:1rem!important}.my-5{margin-top:1.25rem!important;margin-bottom:1.25rem!important}.-mb-2{margin-bottom:-.5rem!important}.-ml-28{margin-left:-7rem!important}.-ml-3{margin-left:-.75rem!important}.-ml-6{margin-left:-1.5rem!important}.-mt-4{margin-top:-1rem!important}.-mt-8{margin-top:-2rem!important}.mb-1{margin-bottom:.25rem!important}.mb-2{margin-bottom:.5rem!important}.mb-3{margin-bottom:.75rem!important}.mb-4{margin-bottom:1rem!important}.mb-6{margin-bottom:1.5rem!important}.mb-8{margin-bottom:2rem!important}.ml-1{margin-left:.25rem!important}.ml-2{margin-left:.5rem!important}.ml-3{margin-left:.75rem!important}.ml-4{margin-left:1rem!important}.mr-1{margin-right:.25rem!important}.mr-2{margin-right:.5rem!important}.mr-4{margin-right:1rem!important}.mt-1{margin-top:.25rem!important}.mt-2{margin-top:.5rem!important}.mt-4{margin-top:1rem!important}.mt-5{margin-top:1.25rem!important}.mt-8{margin-top:2rem!important}.box-border{box-sizing:border-box!important}.block{display:block!important}.inline-block{display:inline-block!important}.flex{display:flex!important}.table{display:table!important}.table-cell{display:table-cell!important}.grid{display:grid!important}.hidden{display:none!important}.aspect-square{aspect-ratio:1 / 1!important}.h-0{height:0px!important}.h-1\/3-screen{height:33.33vh!important}.h-1\/4-screen{height:25vh!important}.h-1\/5-screen{height:20vh!important}.h-1\/6-screen{height:16.66vh!important}.h-1\/7-screen{height:14.28vh!important}.h-10{height:2.5rem!important}.h-12{height:3rem!important}.h-16{height:4rem!important}.h-2{height:.5rem!important}.h-2\/3-screen{height:66.66vh!important}.h-2\/4-screen{height:50vh!important}.h-2\/5-screen{height:40vh!important}.h-2\/6-screen{height:33.33vh!important}.h-2\/7-screen{height:28.57vh!important}.h-20{height:5rem!important}.h-24{height:6rem!important}.h-3\/4-screen{height:75vh!important}.h-3\/5-screen{height:60vh!important}.h-3\/6-screen{height:50vh!important}.h-3\/7-screen{height:42.85vh!important}.h-32{height:8rem!important}.h-36{height:9rem!important}.h-4\/5-screen{height:80vh!important}.h-4\/6-screen{height:66.66vh!important}.h-4\/7-screen{height:57.14vh!important}.h-40{height:10rem!important}.h-5{height:1.25rem!important}.h-5\/6-screen{height:83.33vh!important}.h-5\/7-screen{height:71.42vh!important}.h-56{height:14rem!important}.h-6{height:1.5rem!important}.h-6\/7-screen{height:85.71vh!important}.h-60{height:15rem!important}.h-64{height:16rem!important}.h-72{height:18rem!important}.h-8{height:2rem!important}.h-95vh{height:95vh!important}.h-96{height:24rem!important}.h-full{height:100%!important}.h-half{height:50vh!important}.h-screen{height:100vh!important}.max-h-5\/6-screen{max-height:83.33vh!important}.max-h-6\/7-screen{max-height:85.71vh!important}.max-h-80{max-height:20rem!important}.min-h-2\/5-screen{min-height:40vh!important}.w-0{width:0px!important}.w-1\/2{width:50%!important}.w-1\/3{width:33.333333%!important}.w-1\/3-screen{width:33.33vw!important}.w-1\/4{width:25%!important}.w-1\/4-screen{width:25vw!important}.w-1\/5-screen{width:20vw!important}.w-1\/6{width:16.666667%!important}.w-1\/6-screen{width:16.66vw!important}.w-1\/7-screen{width:14.28vw!important}.w-10{width:2.5rem!important}.w-11\/12{width:91.666667%!important}.w-12{width:3rem!important}.w-16{width:4rem!important}.w-2\/3-screen{width:66.66vw!important}.w-2\/4-screen{width:50vw!important}.w-2\/5-screen{width:40vw!important}.w-2\/6-screen{width:33.33vw!important}.w-2\/7-screen{width:28.57vw!important}.w-20{width:5rem!important}.w-24{width:6rem!important}.w-3\/4-screen{width:75vw!important}.w-3\/5-screen{width:60vw!important}.w-3\/6-screen{width:50vw!important}.w-3\/7-screen{width:42.85vw!important}.w-32{width:8rem!important}.w-36{width:9rem!important}.w-4\/5-screen{width:80vw!important}.w-4\/6-screen{width:66.66vw!important}.w-4\/7-screen{width:57.14vw!important}.w-48{width:12rem!important}.w-5{width:1.25rem!important}.w-5\/6-screen{width:83.33vw!important}.w-5\/7-screen{width:71.42vw!important}.w-52{width:13rem!important}.w-56{width:14rem!important}.w-6{width:1.5rem!important}.w-6\/7-screen{width:85.71vw!important}.w-60{width:15rem!important}.w-64{width:16rem!important}.w-72{width:18rem!important}.w-8{width:2rem!important}.w-95vw{width:95vw!important}.w-\[225px\]{width:225px!important}.w-auto{width:auto!important}.w-full{width:100%!important}.w-screen{width:100vw!important}.min-w-6{min-width:1.5rem!important}.min-w-\[2rem\]{min-width:2rem!important}.min-w-fit{min-width:fit-content!important}.flex-auto{flex:1 1 auto!important}.flex-shrink-0{flex-shrink:0!important}.grow-0{flex-grow:0!important}.table-auto{table-layout:auto!important}.origin-bottom-right{transform-origin:bottom right!important}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))!important}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite!important}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite!important}.cursor-default{cursor:default!important}.cursor-not-allowed{cursor:not-allowed!important}.cursor-pointer{cursor:pointer!important}.select-none{-webkit-user-select:none!important;user-select:none!important}.resize{resize:both!important}.appearance-none{-webkit-appearance:none!important;-moz-appearance:none!important;appearance:none!important}.grid-flow-row{grid-auto-flow:row!important}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))!important}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))!important}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))!important}.grid-rows-1{grid-template-rows:repeat(1,minmax(0,1fr))!important}.grid-rows-2{grid-template-rows:repeat(2,minmax(0,1fr))!important}.grid-rows-3{grid-template-rows:repeat(3,minmax(0,1fr))!important}.flex-row{flex-direction:row!important}.flex-row-reverse{flex-direction:row-reverse!important}.flex-col{flex-direction:column!important}.flex-wrap{flex-wrap:wrap!important}.items-start{align-items:flex-start!important}.items-end{align-items:flex-end!important}.items-center{align-items:center!important}.justify-start{justify-content:flex-start!important}.justify-end{justify-content:flex-end!important}.justify-center{justify-content:center!important}.justify-between{justify-content:space-between!important}.justify-around{justify-content:space-around!important}.gap-0{gap:0px!important}.gap-1{gap:.25rem!important}.gap-2{gap:.5rem!important}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse: 0 !important;border-right-width:calc(1px * var(--tw-divide-x-reverse))!important;border-left-width:calc(1px * calc(1 - var(--tw-divide-x-reverse)))!important}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(1px * var(--tw-divide-y-reverse))!important}.divide-y-4>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0 !important;border-top-width:calc(4px * calc(1 - var(--tw-divide-y-reverse)))!important;border-bottom-width:calc(4px * var(--tw-divide-y-reverse))!important}.self-center{align-self:center!important}.overflow-auto{overflow:auto!important}.overflow-hidden{overflow:hidden!important}.overflow-x-auto{overflow-x:auto!important}.overflow-y-auto{overflow-y:auto!important}.overflow-y-hidden{overflow-y:hidden!important}.overflow-y-scroll{overflow-y:scroll!important}.truncate{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}.whitespace-pre-wrap{white-space:pre-wrap!important}.rounded{border-radius:.25rem!important}.rounded-full{border-radius:9999px!important}.rounded-lg{border-radius:.5rem!important}.rounded-md{border-radius:.375rem!important}.rounded-none{border-radius:0!important}.rounded-b-md{border-bottom-right-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.rounded-t-lg{border-top-left-radius:.5rem!important;border-top-right-radius:.5rem!important}.rounded-t-md{border-top-left-radius:.375rem!important;border-top-right-radius:.375rem!important}.rounded-bl{border-bottom-left-radius:.25rem!important}.rounded-bl-lg{border-bottom-left-radius:.5rem!important}.rounded-br{border-bottom-right-radius:.25rem!important}.rounded-br-lg{border-bottom-right-radius:.5rem!important}.rounded-tl{border-top-left-radius:.25rem!important}.rounded-tl-lg{border-top-left-radius:.5rem!important}.rounded-tr{border-top-right-radius:.25rem!important}.rounded-tr-lg{border-top-right-radius:.5rem!important}.border{border-width:1px!important}.border-0{border-width:0px!important}.border-2{border-width:2px!important}.border-4{border-width:4px!important}.border-b{border-bottom-width:1px!important}.border-b-0{border-bottom-width:0px!important}.border-b-2{border-bottom-width:2px!important}.border-b-4{border-bottom-width:4px!important}.border-l{border-left-width:1px!important}.border-l-0{border-left-width:0px!important}.border-l-2{border-left-width:2px!important}.border-l-4{border-left-width:4px!important}.border-l-8{border-left-width:8px!important}.border-r{border-right-width:1px!important}.border-r-0{border-right-width:0px!important}.border-r-2{border-right-width:2px!important}.border-t{border-top-width:1px!important}.border-t-0{border-top-width:0px!important}.border-t-4{border-top-width:4px!important}.border-dashed{border-style:dashed!important}.border-black{--tw-border-opacity: 1 !important;border-color:rgb(0 0 0 / var(--tw-border-opacity))!important}.border-blue-200{--tw-border-opacity: 1 !important;border-color:rgb(191 219 254 / var(--tw-border-opacity))!important}.border-blue-400{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.border-blue-600{--tw-border-opacity: 1 !important;border-color:rgb(37 99 235 / var(--tw-border-opacity))!important}.border-box-background{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-background) / var(--tw-border-opacity))!important}.border-box-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-edge) / var(--tw-border-opacity))!important}.border-box-elevation-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--box-elevation-edge) / var(--tw-border-opacity))!important}.border-danger-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--danger-secondary) / var(--tw-border-opacity))!important}.border-error-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-primary) / var(--tw-border-opacity))!important}.border-error-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))!important}.border-error-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))!important}.border-floating-menu-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--floating-menu-edge) / var(--tw-border-opacity))!important}.border-gray-200{--tw-border-opacity: 1 !important;border-color:rgb(229 231 235 / var(--tw-border-opacity))!important}.border-gray-300{--tw-border-opacity: 1 !important;border-color:rgb(209 213 219 / var(--tw-border-opacity))!important}.border-gray-400{--tw-border-opacity: 1 !important;border-color:rgb(156 163 175 / var(--tw-border-opacity))!important}.border-gray-500{--tw-border-opacity: 1 !important;border-color:rgb(107 114 128 / var(--tw-border-opacity))!important}.border-gray-700{--tw-border-opacity: 1 !important;border-color:rgb(55 65 81 / var(--tw-border-opacity))!important}.border-gray-800{--tw-border-opacity: 1 !important;border-color:rgb(31 41 55 / var(--tw-border-opacity))!important}.border-green-200{--tw-border-opacity: 1 !important;border-color:rgb(187 247 208 / var(--tw-border-opacity))!important}.border-green-600{--tw-border-opacity: 1 !important;border-color:rgb(22 163 74 / var(--tw-border-opacity))!important}.border-info-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.border-info-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity))!important}.border-info-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-tertiary) / var(--tw-border-opacity))!important}.border-input-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-edge) / var(--tw-border-opacity))!important}.border-input-option-hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--input-option-hover) / var(--tw-border-opacity))!important}.border-numpad-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}.border-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--primary) / var(--tw-border-opacity))!important}.border-red-200{--tw-border-opacity: 1 !important;border-color:rgb(254 202 202 / var(--tw-border-opacity))!important}.border-slate-400{--tw-border-opacity: 1 !important;border-color:rgb(148 163 184 / var(--tw-border-opacity))!important}.border-slate-600{--tw-border-opacity: 1 !important;border-color:rgb(71 85 105 / var(--tw-border-opacity))!important}.border-success-primary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-primary) / var(--tw-border-opacity))!important}.border-success-secondary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-secondary) / var(--tw-border-opacity))!important}.border-success-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--success-tertiary) / var(--tw-border-opacity))!important}.border-tab-table-th{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th) / var(--tw-border-opacity))!important}.border-tab-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--tab-table-th-edge) / var(--tw-border-opacity))!important}.border-table-th-edge{--tw-border-opacity: 1 !important;border-color:rgb(var(--table-th-edge) / var(--tw-border-opacity))!important}.border-tertiary{--tw-border-opacity: 1 !important;border-color:rgb(var(--tertiary) / var(--tw-border-opacity))!important}.border-transparent{border-color:transparent!important}.border-yellow-200{--tw-border-opacity: 1 !important;border-color:rgb(254 240 138 / var(--tw-border-opacity))!important}.border-b-transparent{border-bottom-color:transparent!important}.border-l-box-edge{--tw-border-opacity: 1 !important;border-left-color:rgb(var(--box-edge) / var(--tw-border-opacity))!important}.bg-blue-100{--tw-bg-opacity: 1 !important;background-color:rgb(219 234 254 / var(--tw-bg-opacity))!important}.bg-blue-400{--tw-bg-opacity: 1 !important;background-color:rgb(96 165 250 / var(--tw-bg-opacity))!important}.bg-blue-500{--tw-bg-opacity: 1 !important;background-color:rgb(59 130 246 / var(--tw-bg-opacity))!important}.bg-box-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-background) / var(--tw-bg-opacity))!important}.bg-box-elevation-hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.bg-error-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-primary) / var(--tw-bg-opacity))!important}.bg-error-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.bg-error-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.bg-floating-menu{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu) / var(--tw-bg-opacity))!important}.bg-gray-200{--tw-bg-opacity: 1 !important;background-color:rgb(229 231 235 / var(--tw-bg-opacity))!important}.bg-gray-300{--tw-bg-opacity: 1 !important;background-color:rgb(209 213 219 / var(--tw-bg-opacity))!important}.bg-gray-400{--tw-bg-opacity: 1 !important;background-color:rgb(156 163 175 / var(--tw-bg-opacity))!important}.bg-gray-500{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.bg-gray-600{--tw-bg-opacity: 1 !important;background-color:rgb(75 85 99 / var(--tw-bg-opacity))!important}.bg-gray-700{--tw-bg-opacity: 1 !important;background-color:rgb(55 65 81 / var(--tw-bg-opacity))!important}.bg-gray-800{--tw-bg-opacity: 1 !important;background-color:rgb(31 41 55 / var(--tw-bg-opacity))!important}.bg-gray-900{--tw-bg-opacity: 1 !important;background-color:rgb(17 24 39 / var(--tw-bg-opacity))!important}.bg-green-100{--tw-bg-opacity: 1 !important;background-color:rgb(220 252 231 / var(--tw-bg-opacity))!important}.bg-green-200{--tw-bg-opacity: 1 !important;background-color:rgb(187 247 208 / var(--tw-bg-opacity))!important}.bg-green-400{--tw-bg-opacity: 1 !important;background-color:rgb(74 222 128 / var(--tw-bg-opacity))!important}.bg-green-500{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.bg-info-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.bg-info-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.bg-info-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.bg-input-background{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-background) / var(--tw-bg-opacity))!important}.bg-input-button{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button) / var(--tw-bg-opacity))!important}.bg-input-disabled{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-disabled) / var(--tw-bg-opacity))!important}.bg-input-edge{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-edge) / var(--tw-bg-opacity))!important}.bg-popup-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--popup-surface) / var(--tw-bg-opacity))!important}.bg-red-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 226 226 / var(--tw-bg-opacity))!important}.bg-red-400{--tw-bg-opacity: 1 !important;background-color:rgb(248 113 113 / var(--tw-bg-opacity))!important}.bg-red-500{--tw-bg-opacity: 1 !important;background-color:rgb(239 68 68 / var(--tw-bg-opacity))!important}.bg-slate-200{--tw-bg-opacity: 1 !important;background-color:rgb(226 232 240 / var(--tw-bg-opacity))!important}.bg-slate-300{--tw-bg-opacity: 1 !important;background-color:rgb(203 213 225 / var(--tw-bg-opacity))!important}.bg-success-primary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-primary) / var(--tw-bg-opacity))!important}.bg-success-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-secondary) / var(--tw-bg-opacity))!important}.bg-success-tertiary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.bg-surface{--tw-bg-opacity: 1 !important;background-color:rgb(var(--surface) / var(--tw-bg-opacity))!important}.bg-tab-active{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-active) / var(--tw-bg-opacity))!important}.bg-tab-inactive{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-inactive) / var(--tw-bg-opacity))!important}.bg-tab-table-th{--tw-bg-opacity: 1 !important;background-color:rgb(var(--tab-table-th) / var(--tw-bg-opacity))!important}.bg-transparent{background-color:transparent!important}.bg-warning-secondary{--tw-bg-opacity: 1 !important;background-color:rgb(var(--warning-secondary) / var(--tw-bg-opacity))!important}.bg-white{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.bg-yellow-100{--tw-bg-opacity: 1 !important;background-color:rgb(254 249 195 / var(--tw-bg-opacity))!important}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))!important}.bg-gradient-to-bl{background-image:linear-gradient(to bottom left,var(--tw-gradient-stops))!important}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))!important}.from-blue-200{--tw-gradient-from: #bfdbfe var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(191 219 254 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-400{--tw-gradient-from: #60a5fa var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-blue-500{--tw-gradient-from: #3b82f6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(59 130 246 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-error-secondary{--tw-gradient-from: rgb(var(--error-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--error-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-green-400{--tw-gradient-from: #4ade80 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(74 222 128 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-indigo-400{--tw-gradient-from: #818cf8 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(129 140 248 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-info-secondary{--tw-gradient-from: rgb(var(--info-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--info-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-orange-500{--tw-gradient-from: #f97316 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(249 115 22 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-pink-400{--tw-gradient-from: #f472b6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(244 114 182 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-300{--tw-gradient-from: #d8b4fe var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(216 180 254 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-400{--tw-gradient-from: #c084fc var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(192 132 252 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-purple-500{--tw-gradient-from: #a855f7 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(168 85 247 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-400{--tw-gradient-from: #f87171 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(248 113 113 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-red-500{--tw-gradient-from: #ef4444 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(239 68 68 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-success-secondary{--tw-gradient-from: rgb(var(--success-secondary)) var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(var(--success-secondary) / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.from-teal-500{--tw-gradient-from: #14b8a6 var(--tw-gradient-from-position) !important;--tw-gradient-to: rgb(20 184 166 / 0) var(--tw-gradient-to-position) !important;--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important}.to-blue-400{--tw-gradient-to: #60a5fa var(--tw-gradient-to-position) !important}.to-blue-500{--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position) !important}.to-blue-600{--tw-gradient-to: #2563eb var(--tw-gradient-to-position) !important}.to-blue-700{--tw-gradient-to: #1d4ed8 var(--tw-gradient-to-position) !important}.to-green-600{--tw-gradient-to: #16a34a var(--tw-gradient-to-position) !important}.to-green-700{--tw-gradient-to: #15803d var(--tw-gradient-to-position) !important}.to-indigo-400{--tw-gradient-to: #818cf8 var(--tw-gradient-to-position) !important}.to-indigo-600{--tw-gradient-to: #4f46e5 var(--tw-gradient-to-position) !important}.to-info-tertiary{--tw-gradient-to: rgb(var(--info-tertiary)) var(--tw-gradient-to-position) !important}.to-pink-500{--tw-gradient-to: #ec4899 var(--tw-gradient-to-position) !important}.to-purple-600{--tw-gradient-to: #9333ea var(--tw-gradient-to-position) !important}.to-purple-700{--tw-gradient-to: #7e22ce var(--tw-gradient-to-position) !important}.to-red-500{--tw-gradient-to: #ef4444 var(--tw-gradient-to-position) !important}.to-red-600{--tw-gradient-to: #dc2626 var(--tw-gradient-to-position) !important}.to-red-700{--tw-gradient-to: #b91c1c var(--tw-gradient-to-position) !important}.to-teal-700{--tw-gradient-to: #0f766e var(--tw-gradient-to-position) !important}.bg-clip-text{-webkit-background-clip:text!important;background-clip:text!important}.object-cover{object-fit:cover!important}.p-0{padding:0!important}.p-1{padding:.25rem!important}.p-10{padding:2.5rem!important}.p-2{padding:.5rem!important}.p-3{padding:.75rem!important}.p-4{padding:1rem!important}.p-8{padding:2rem!important}.px-1{padding-left:.25rem!important;padding-right:.25rem!important}.px-2{padding-left:.5rem!important;padding-right:.5rem!important}.px-3{padding-left:.75rem!important;padding-right:.75rem!important}.px-4{padding-left:1rem!important;padding-right:1rem!important}.py-1{padding-top:.25rem!important;padding-bottom:.25rem!important}.py-10{padding-top:2.5rem!important;padding-bottom:2.5rem!important}.py-2{padding-top:.5rem!important;padding-bottom:.5rem!important}.py-3{padding-top:.75rem!important;padding-bottom:.75rem!important}.py-4{padding-top:1rem!important;padding-bottom:1rem!important}.py-5{padding-top:1.25rem!important;padding-bottom:1.25rem!important}.py-6{padding-top:1.5rem!important;padding-bottom:1.5rem!important}.py-8{padding-top:2rem!important;padding-bottom:2rem!important}.pb-1{padding-bottom:.25rem!important}.pb-10{padding-bottom:2.5rem!important}.pb-2{padding-bottom:.5rem!important}.pb-3{padding-bottom:.75rem!important}.pb-4{padding-bottom:1rem!important}.pl-0{padding-left:0!important}.pl-1{padding-left:.25rem!important}.pl-2{padding-left:.5rem!important}.pl-3{padding-left:.75rem!important}.pl-4{padding-left:1rem!important}.pl-7{padding-left:1.75rem!important}.pl-8{padding-left:2rem!important}.pr-1{padding-right:.25rem!important}.pr-12{padding-right:3rem!important}.pr-2{padding-right:.5rem!important}.pr-4{padding-right:1rem!important}.pr-8{padding-right:2rem!important}.pt-1{padding-top:.25rem!important}.pt-2{padding-top:.5rem!important}.pt-6{padding-top:1.5rem!important}.text-left{text-align:left!important}.text-center{text-align:center!important}.text-right{text-align:right!important}.font-body{font-family:Graphik,sans-serif!important}.text-2xl{font-size:1.5rem!important;line-height:2rem!important}.text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.text-4xl{font-size:2.25rem!important;line-height:2.5rem!important}.text-5xl{font-size:3rem!important;line-height:1!important}.text-6xl{font-size:3.75rem!important;line-height:1!important}.text-7xl{font-size:4.5rem!important;line-height:1!important}.text-8xl{font-size:6rem!important;line-height:1!important}.text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.text-sm{font-size:.875rem!important;line-height:1.25rem!important}.text-xl{font-size:1.25rem!important;line-height:1.75rem!important}.text-xs{font-size:.75rem!important;line-height:1rem!important}.font-black{font-weight:900!important}.font-bold{font-weight:700!important}.font-medium{font-weight:500!important}.font-semibold{font-weight:600!important}.uppercase{text-transform:uppercase!important}.leading-5{line-height:1.25rem!important}.text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}.text-blue-500{--tw-text-opacity: 1 !important;color:rgb(59 130 246 / var(--tw-text-opacity))!important}.text-blue-600{--tw-text-opacity: 1 !important;color:rgb(37 99 235 / var(--tw-text-opacity))!important}.text-danger-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--danger-light-tertiary) / var(--tw-text-opacity))!important}.text-error-light-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-light-tertiary) / var(--tw-text-opacity))!important}.text-error-primary{--tw-text-opacity: 1 !important;color:rgb(var(--error-primary) / var(--tw-text-opacity))!important}.text-error-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.text-error-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--error-tertiary) / var(--tw-text-opacity))!important}.text-gray-100{--tw-text-opacity: 1 !important;color:rgb(243 244 246 / var(--tw-text-opacity))!important}.text-gray-500{--tw-text-opacity: 1 !important;color:rgb(107 114 128 / var(--tw-text-opacity))!important}.text-gray-600{--tw-text-opacity: 1 !important;color:rgb(75 85 99 / var(--tw-text-opacity))!important}.text-gray-700{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.text-gray-800{--tw-text-opacity: 1 !important;color:rgb(31 41 55 / var(--tw-text-opacity))!important}.text-green-700{--tw-text-opacity: 1 !important;color:rgb(21 128 61 / var(--tw-text-opacity))!important}.text-info-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--info-secondary) / var(--tw-text-opacity))!important}.text-info-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--info-tertiary) / var(--tw-text-opacity))!important}.text-primary{--tw-text-opacity: 1 !important;color:rgb(var(--primary) / var(--tw-text-opacity))!important}.text-purple-500{--tw-text-opacity: 1 !important;color:rgb(168 85 247 / var(--tw-text-opacity))!important}.text-red-500{--tw-text-opacity: 1 !important;color:rgb(239 68 68 / var(--tw-text-opacity))!important}.text-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--secondary) / var(--tw-text-opacity))!important}.text-soft-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-secondary) / var(--tw-text-opacity))!important}.text-soft-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--soft-tertiary) / var(--tw-text-opacity))!important}.text-success-secondary{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.text-success-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--success-tertiary) / var(--tw-text-opacity))!important}.text-tertiary{--tw-text-opacity: 1 !important;color:rgb(var(--tertiary) / var(--tw-text-opacity))!important}.text-transparent{color:transparent!important}.text-white{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.underline{text-decoration-line:underline!important}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: inset 0 2px 4px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.outline-none{outline:2px solid transparent!important;outline-offset:2px!important}.ring-4{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color) !important;--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color) !important;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)!important}.blur{--tw-blur: blur(8px) !important;filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)!important}.transition-all{transition-property:all!important;transition-timing-function:cubic-bezier(.4,0,.2,1)!important;transition-duration:.15s!important}.duration-100{transition-duration:.1s!important}.ease-linear{transition-timing-function:linear!important}.\[key\:string\]{key:string!important}html,body{height:100%;font-family:Jost;width:100%}.bg-overlay{background:#33333342}[v-cloak]>*{display:none}.loader{border-top-color:#3498db!important}.loader.slow{-webkit-animation:spinner 1.5s linear infinite;animation:spinner 1.5s linear infinite}.loader.fast{-webkit-animation:spinner .7s linear infinite;animation:spinner .7s linear infinite}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(360deg)}}@keyframes spinner{0%{transform:rotate(0)}to{transform:rotate(360deg)}}button{border-radius:0}#editor h1{font-size:3rem;line-height:1;font-weight:700}#editor h2{font-size:2.25rem;line-height:2.5rem;font-weight:700}#editor h3{font-size:1.875rem;line-height:2.25rem;font-weight:700}#editor h4{font-size:1.5rem;line-height:2rem;font-weight:700}#editor h5{font-size:1.25rem;line-height:1.75rem;font-weight:700}#grid-items .vue-recycle-scroller__item-wrapper{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0px;overflow-y:auto}@media (min-width: 768px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width: 1280px){#grid-items .vue-recycle-scroller__item-wrapper{grid-template-columns:repeat(5,minmax(0,1fr))}}#grid-items .vue-recycle-scroller__item-view{display:flex;height:8rem;cursor:pointer;flex-direction:column;align-items:center;justify-content:center;overflow:hidden;border-width:1px;--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}@media (min-width: 1024px){#grid-items .vue-recycle-scroller__item-view{height:10rem}}#grid-items .vue-recycle-scroller__item-view:hover{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity))}.popup-heading{display:flex;align-items:center;justify-content:space-between;padding:.5rem}.popup-heading h3{font-weight:600}.hover\:cursor-pointer:hover{cursor:pointer!important}.hover\:border-error-secondary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-secondary) / var(--tw-border-opacity))!important}.hover\:border-error-tertiary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--error-tertiary) / var(--tw-border-opacity))!important}.hover\:border-info-primary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-primary) / var(--tw-border-opacity))!important}.hover\:border-info-secondary:hover{--tw-border-opacity: 1 !important;border-color:rgb(var(--info-secondary) / var(--tw-border-opacity))!important}.hover\:border-transparent:hover{border-color:transparent!important}.hover\:border-opacity-0:hover{--tw-border-opacity: 0 !important}.hover\:bg-blue-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.hover\:bg-box-elevation-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--box-elevation-hover) / var(--tw-bg-opacity))!important}.hover\:bg-error-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-error-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--error-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-floating-menu-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--floating-menu-hover) / var(--tw-bg-opacity))!important}.hover\:bg-gray-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(107 114 128 / var(--tw-bg-opacity))!important}.hover\:bg-green-500:hover{--tw-bg-opacity: 1 !important;background-color:rgb(34 197 94 / var(--tw-bg-opacity))!important}.hover\:bg-green-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(22 163 74 / var(--tw-bg-opacity))!important}.hover\:bg-info-primary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-primary) / var(--tw-bg-opacity))!important}.hover\:bg-info-secondary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-secondary) / var(--tw-bg-opacity))!important}.hover\:bg-info-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--info-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-input-button-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--input-button-hover) / var(--tw-bg-opacity))!important}.hover\:bg-numpad-hover:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--numpad-hover) / var(--tw-bg-opacity))!important}.hover\:bg-red-600:hover{--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}.hover\:bg-success-tertiary:hover{--tw-bg-opacity: 1 !important;background-color:rgb(var(--success-tertiary) / var(--tw-bg-opacity))!important}.hover\:bg-white:hover{--tw-bg-opacity: 1 !important;background-color:rgb(255 255 255 / var(--tw-bg-opacity))!important}.hover\:text-blue-400:hover{--tw-text-opacity: 1 !important;color:rgb(96 165 250 / var(--tw-text-opacity))!important}.hover\:text-error-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--error-secondary) / var(--tw-text-opacity))!important}.hover\:text-gray-700:hover{--tw-text-opacity: 1 !important;color:rgb(55 65 81 / var(--tw-text-opacity))!important}.hover\:text-info-primary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--info-primary) / var(--tw-text-opacity))!important}.hover\:text-success-secondary:hover{--tw-text-opacity: 1 !important;color:rgb(var(--success-secondary) / var(--tw-text-opacity))!important}.hover\:text-white:hover{--tw-text-opacity: 1 !important;color:rgb(255 255 255 / var(--tw-text-opacity))!important}.hover\:underline:hover{text-decoration-line:underline!important}.hover\:shadow-lg:hover{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1) !important;--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.focus\:border-blue-400:focus{--tw-border-opacity: 1 !important;border-color:rgb(96 165 250 / var(--tw-border-opacity))!important}.focus\:shadow-sm:focus{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05) !important;--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color) !important;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)!important}.active\:border-numpad-edge:active{--tw-border-opacity: 1 !important;border-color:rgb(var(--numpad-edge) / var(--tw-border-opacity))!important}.dark\:border-blue-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(29 78 216 / var(--tw-border-opacity))!important}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(22 101 52 / var(--tw-border-opacity))!important}.dark\:border-red-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(185 28 28 / var(--tw-border-opacity))!important}.dark\:border-yellow-700:is(.dark *){--tw-border-opacity: 1 !important;border-color:rgb(161 98 7 / var(--tw-border-opacity))!important}.dark\:bg-blue-600:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(37 99 235 / var(--tw-bg-opacity))!important}.dark\:bg-green-700:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(21 128 61 / var(--tw-bg-opacity))!important}.dark\:bg-red-600:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(220 38 38 / var(--tw-bg-opacity))!important}.dark\:bg-yellow-600:is(.dark *){--tw-bg-opacity: 1 !important;background-color:rgb(202 138 4 / var(--tw-bg-opacity))!important}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1 !important;color:rgb(203 213 225 / var(--tw-text-opacity))!important}@media (min-width: 640px){.sm\:relative{position:relative!important}.sm\:mx-auto{margin-left:auto!important;margin-right:auto!important}.sm\:hidden{display:none!important}.sm\:h-1\/3-screen{height:33.33vh!important}.sm\:h-1\/4-screen{height:25vh!important}.sm\:h-1\/5-screen{height:20vh!important}.sm\:h-1\/6-screen{height:16.66vh!important}.sm\:h-1\/7-screen{height:14.28vh!important}.sm\:h-108{height:27rem!important}.sm\:h-2\/3-screen{height:66.66vh!important}.sm\:h-2\/4-screen{height:50vh!important}.sm\:h-2\/5-screen{height:40vh!important}.sm\:h-2\/6-screen{height:33.33vh!important}.sm\:h-2\/7-screen{height:28.57vh!important}.sm\:h-3\/4-screen{height:75vh!important}.sm\:h-3\/5-screen{height:60vh!important}.sm\:h-3\/6-screen{height:50vh!important}.sm\:h-3\/7-screen{height:42.85vh!important}.sm\:h-4\/5-screen{height:80vh!important}.sm\:h-4\/6-screen{height:66.66vh!important}.sm\:h-4\/7-screen{height:57.14vh!important}.sm\:h-5\/6-screen{height:83.33vh!important}.sm\:h-5\/7-screen{height:71.42vh!important}.sm\:h-6\/7-screen{height:85.71vh!important}.sm\:w-1\/3-screen{width:33.33vw!important}.sm\:w-1\/4-screen{width:25vw!important}.sm\:w-1\/5-screen{width:20vw!important}.sm\:w-1\/6-screen{width:16.66vw!important}.sm\:w-1\/7-screen{width:14.28vw!important}.sm\:w-2\/3-screen{width:66.66vw!important}.sm\:w-2\/4-screen{width:50vw!important}.sm\:w-2\/5-screen{width:40vw!important}.sm\:w-2\/6-screen{width:33.33vw!important}.sm\:w-2\/7-screen{width:28.57vw!important}.sm\:w-3\/4-screen{width:75vw!important}.sm\:w-3\/5-screen{width:60vw!important}.sm\:w-3\/6-screen{width:50vw!important}.sm\:w-3\/7-screen{width:42.85vw!important}.sm\:w-4\/5-screen{width:80vw!important}.sm\:w-4\/6-screen{width:66.66vw!important}.sm\:w-4\/7-screen{width:57.14vw!important}.sm\:w-5\/6-screen{width:83.33vw!important}.sm\:w-5\/7-screen{width:71.42vw!important}.sm\:w-6\/7-screen{width:85.71vw!important}.sm\:w-64{width:16rem!important}.sm\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.sm\:flex-row{flex-direction:row!important}.sm\:rounded-lg{border-radius:.5rem!important}.sm\:text-sm{font-size:.875rem!important;line-height:1.25rem!important}.sm\:leading-5{line-height:1.25rem!important}}@media (min-width: 768px){.md\:visible{visibility:visible!important}.md\:static{position:static!important}.md\:-mx-1{margin-left:-.25rem!important;margin-right:-.25rem!important}.md\:-mx-2{margin-left:-.5rem!important;margin-right:-.5rem!important}.md\:-mx-4{margin-left:-1rem!important;margin-right:-1rem!important}.md\:my-2{margin-top:.5rem!important;margin-bottom:.5rem!important}.md\:mb-0{margin-bottom:0!important}.md\:mt-0{margin-top:0!important}.md\:mt-2{margin-top:.5rem!important}.md\:block{display:block!important}.md\:inline-block{display:inline-block!important}.md\:inline{display:inline!important}.md\:flex{display:flex!important}.md\:table-cell{display:table-cell!important}.md\:hidden{display:none!important}.md\:h-1\/3-screen{height:33.33vh!important}.md\:h-1\/4-screen{height:25vh!important}.md\:h-1\/5-screen{height:20vh!important}.md\:h-1\/6-screen{height:16.66vh!important}.md\:h-1\/7-screen{height:14.28vh!important}.md\:h-10{height:2.5rem!important}.md\:h-2\/3-screen{height:66.66vh!important}.md\:h-2\/4-screen{height:50vh!important}.md\:h-2\/5-screen{height:40vh!important}.md\:h-2\/6-screen{height:33.33vh!important}.md\:h-2\/7-screen{height:28.57vh!important}.md\:h-3\/4-screen{height:75vh!important}.md\:h-3\/5-screen{height:60vh!important}.md\:h-3\/6-screen{height:50vh!important}.md\:h-3\/7-screen{height:42.85vh!important}.md\:h-4\/5-screen{height:80vh!important}.md\:h-4\/6-screen{height:66.66vh!important}.md\:h-4\/7-screen{height:57.14vh!important}.md\:h-5\/6-screen{height:83.33vh!important}.md\:h-5\/7-screen{height:71.42vh!important}.md\:h-6\/7-screen{height:85.71vh!important}.md\:h-full{height:100%!important}.md\:w-1\/2{width:50%!important}.md\:w-1\/3{width:33.333333%!important}.md\:w-1\/3-screen{width:33.33vw!important}.md\:w-1\/4{width:25%!important}.md\:w-1\/4-screen{width:25vw!important}.md\:w-1\/5-screen{width:20vw!important}.md\:w-1\/6-screen{width:16.66vw!important}.md\:w-1\/7-screen{width:14.28vw!important}.md\:w-10{width:2.5rem!important}.md\:w-16{width:4rem!important}.md\:w-2\/3{width:66.666667%!important}.md\:w-2\/3-screen{width:66.66vw!important}.md\:w-2\/4-screen{width:50vw!important}.md\:w-2\/5{width:40%!important}.md\:w-2\/5-screen{width:40vw!important}.md\:w-2\/6-screen{width:33.33vw!important}.md\:w-2\/7-screen{width:28.57vw!important}.md\:w-24{width:6rem!important}.md\:w-28{width:7rem!important}.md\:w-3\/4{width:75%!important}.md\:w-3\/4-screen{width:75vw!important}.md\:w-3\/5{width:60%!important}.md\:w-3\/5-screen{width:60vw!important}.md\:w-3\/6-screen{width:50vw!important}.md\:w-3\/7-screen{width:42.85vw!important}.md\:w-4\/5{width:80%!important}.md\:w-4\/5-screen{width:80vw!important}.md\:w-4\/6-screen{width:66.66vw!important}.md\:w-4\/7-screen{width:57.14vw!important}.md\:w-5\/6-screen{width:83.33vw!important}.md\:w-5\/7-screen{width:71.42vw!important}.md\:w-56{width:14rem!important}.md\:w-6\/7-screen{width:85.71vw!important}.md\:w-60{width:15rem!important}.md\:w-72{width:18rem!important}.md\:w-80{width:20rem!important}.md\:w-96{width:24rem!important}.md\:w-\[550px\]{width:550px!important}.md\:w-auto{width:auto!important}.md\:w-full{width:100%!important}.md\:flex-auto{flex:1 1 auto!important}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))!important}.md\:flex-row{flex-direction:row!important}.md\:flex-col{flex-direction:column!important}.md\:flex-wrap{flex-wrap:wrap!important}.md\:items-start{align-items:flex-start!important}.md\:items-center{align-items:center!important}.md\:justify-center{justify-content:center!important}.md\:justify-between{justify-content:space-between!important}.md\:rounded{border-radius:.25rem!important}.md\:border-l{border-left-width:1px!important}.md\:p-0{padding:0!important}.md\:px-1{padding-left:.25rem!important;padding-right:.25rem!important}.md\:px-2{padding-left:.5rem!important;padding-right:.5rem!important}.md\:px-4{padding-left:1rem!important;padding-right:1rem!important}.md\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}.md\:text-3xl{font-size:1.875rem!important;line-height:2.25rem!important}.md\:text-base{font-size:1rem!important;line-height:1.5rem!important}.md\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1024px){.lg\:my-8{margin-top:2rem!important;margin-bottom:2rem!important}.lg\:block{display:block!important}.lg\:flex{display:flex!important}.lg\:hidden{display:none!important}.lg\:h-1\/3-screen{height:33.33vh!important}.lg\:h-1\/4-screen{height:25vh!important}.lg\:h-1\/5-screen{height:20vh!important}.lg\:h-1\/6-screen{height:16.66vh!important}.lg\:h-1\/7-screen{height:14.28vh!important}.lg\:h-2\/3-screen{height:66.66vh!important}.lg\:h-2\/4-screen{height:50vh!important}.lg\:h-2\/5-screen{height:40vh!important}.lg\:h-2\/6-screen{height:33.33vh!important}.lg\:h-2\/7-screen{height:28.57vh!important}.lg\:h-3\/4-screen{height:75vh!important}.lg\:h-3\/5-screen{height:60vh!important}.lg\:h-3\/6-screen{height:50vh!important}.lg\:h-3\/7-screen{height:42.85vh!important}.lg\:h-4\/5-screen{height:80vh!important}.lg\:h-4\/6-screen{height:66.66vh!important}.lg\:h-4\/7-screen{height:57.14vh!important}.lg\:h-5\/6-screen{height:83.33vh!important}.lg\:h-5\/7-screen{height:71.42vh!important}.lg\:h-6\/7-screen{height:85.71vh!important}.lg\:h-full{height:100%!important}.lg\:w-1\/2{width:50%!important}.lg\:w-1\/3{width:33.333333%!important}.lg\:w-1\/3-screen{width:33.33vw!important}.lg\:w-1\/4{width:25%!important}.lg\:w-1\/4-screen{width:25vw!important}.lg\:w-1\/5-screen{width:20vw!important}.lg\:w-1\/6{width:16.666667%!important}.lg\:w-1\/6-screen{width:16.66vw!important}.lg\:w-1\/7-screen{width:14.28vw!important}.lg\:w-2\/3{width:66.666667%!important}.lg\:w-2\/3-screen{width:66.66vw!important}.lg\:w-2\/4{width:50%!important}.lg\:w-2\/4-screen{width:50vw!important}.lg\:w-2\/5{width:40%!important}.lg\:w-2\/5-screen{width:40vw!important}.lg\:w-2\/6-screen{width:33.33vw!important}.lg\:w-2\/7-screen{width:28.57vw!important}.lg\:w-3\/4-screen{width:75vw!important}.lg\:w-3\/5{width:60%!important}.lg\:w-3\/5-screen{width:60vw!important}.lg\:w-3\/6-screen{width:50vw!important}.lg\:w-3\/7-screen{width:42.85vw!important}.lg\:w-4\/5-screen{width:80vw!important}.lg\:w-4\/6{width:66.666667%!important}.lg\:w-4\/6-screen{width:66.66vw!important}.lg\:w-4\/7-screen{width:57.14vw!important}.lg\:w-5\/6-screen{width:83.33vw!important}.lg\:w-5\/7-screen{width:71.42vw!important}.lg\:w-56{width:14rem!important}.lg\:w-6\/7-screen{width:85.71vw!important}.lg\:w-auto{width:auto!important}.lg\:w-full{width:100%!important}.lg\:w-half{width:50vw!important}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))!important}.lg\:flex-row{flex-direction:row!important}.lg\:items-start{align-items:flex-start!important}.lg\:px-0{padding-left:0!important;padding-right:0!important}.lg\:text-2xl{font-size:1.5rem!important;line-height:2rem!important}.lg\:text-5xl{font-size:3rem!important;line-height:1!important}.lg\:text-lg{font-size:1.125rem!important;line-height:1.75rem!important}.lg\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media (min-width: 1280px){.xl\:h-1\/3-screen{height:33.33vh!important}.xl\:h-1\/4-screen{height:25vh!important}.xl\:h-1\/5-screen{height:20vh!important}.xl\:h-1\/6-screen{height:16.66vh!important}.xl\:h-1\/7-screen{height:14.28vh!important}.xl\:h-2\/3-screen{height:66.66vh!important}.xl\:h-2\/4-screen{height:50vh!important}.xl\:h-2\/5-screen{height:40vh!important}.xl\:h-2\/6-screen{height:33.33vh!important}.xl\:h-2\/7-screen{height:28.57vh!important}.xl\:h-3\/4-screen{height:75vh!important}.xl\:h-3\/5-screen{height:60vh!important}.xl\:h-3\/6-screen{height:50vh!important}.xl\:h-3\/7-screen{height:42.85vh!important}.xl\:h-4\/5-screen{height:80vh!important}.xl\:h-4\/6-screen{height:66.66vh!important}.xl\:h-4\/7-screen{height:57.14vh!important}.xl\:h-5\/6-screen{height:83.33vh!important}.xl\:h-5\/7-screen{height:71.42vh!important}.xl\:h-6\/7-screen{height:85.71vh!important}.xl\:w-1\/3-screen{width:33.33vw!important}.xl\:w-1\/4{width:25%!important}.xl\:w-1\/4-screen{width:25vw!important}.xl\:w-1\/5-screen{width:20vw!important}.xl\:w-1\/6-screen{width:16.66vw!important}.xl\:w-1\/7-screen{width:14.28vw!important}.xl\:w-108{width:27rem!important}.xl\:w-2\/3-screen{width:66.66vw!important}.xl\:w-2\/4-screen{width:50vw!important}.xl\:w-2\/5-screen{width:40vw!important}.xl\:w-2\/6-screen{width:33.33vw!important}.xl\:w-2\/7-screen{width:28.57vw!important}.xl\:w-3\/4-screen{width:75vw!important}.xl\:w-3\/5-screen{width:60vw!important}.xl\:w-3\/6-screen{width:50vw!important}.xl\:w-3\/7-screen{width:42.85vw!important}.xl\:w-4\/5-screen{width:80vw!important}.xl\:w-4\/6-screen{width:66.66vw!important}.xl\:w-4\/7-screen{width:57.14vw!important}.xl\:w-5\/6-screen{width:83.33vw!important}.xl\:w-5\/7-screen{width:71.42vw!important}.xl\:w-6\/7-screen{width:85.71vw!important}.xl\:w-84{width:21rem!important}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))!important}.xl\:text-xl{font-size:1.25rem!important;line-height:1.75rem!important}}@media print{.print\:w-1\/2{width:50%!important}.print\:w-1\/3{width:33.333333%!important}.print\:text-black{--tw-text-opacity: 1 !important;color:rgb(0 0 0 / var(--tw-text-opacity))!important}} diff --git a/public/build/assets/ns-procurement-BAj_8zXp.js b/public/build/assets/ns-procurement-BAj_8zXp.js new file mode 100644 index 000000000..4c349d6f9 --- /dev/null +++ b/public/build/assets/ns-procurement-BAj_8zXp.js @@ -0,0 +1 @@ +import{F as S,d as b,b as y,B as O,f as E,T as q,I as N,P as w,v as F,i as j}from"./bootstrap-Dea9XoG9.js";import R from"./manage-products-S0TS_1i7.js";import{_ as c,n as B}from"./currency-Dtag6qPd.js";import{_ as A}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as T,o as l,c as u,a as r,t as d,F as v,b as g,g as D,f as L,w as I,i as k,e as h,n as P,B as C,A as U}from"./runtime-core.esm-bundler-VrNrzzXC.js";import{_ as K}from"./components-CxIJxoVN.js";import{b as M,N as V}from"./ns-prompt-popup-7xlV5yZV.js";import{s as G}from"./select-api-entities-DY8e84Xd.js";import"./chart-Ozef1QaY.js";import"./ns-avatar-image-Pigdi04i.js";import"./join-array-NDqpMoMN.js";const J={name:"ns-procurement-product-options",props:["popup"],data(){return{validation:new S,fields:[],rawFields:[{label:c("Expiration Date"),name:"expiration_date",description:c("Define when that specific product should expire."),type:"datetimepicker"},{label:c("Barcode"),name:"barcode",description:c("Renders the automatically generated barcode."),type:"text",disabled:!0},{label:c("Tax Type"),name:"tax_type",description:c("Adjust how tax is calculated on the item."),type:"select",options:[{label:c("Inclusive"),value:"inclusive"},{label:c("Exclusive"),value:"exclusive"}]}]}},methods:{__:c,applyChanges(){if(this.validation.validateFields(this.fields)){const e=this.validation.extractFields(this.fields);return this.popup.params.resolve(e),this.popup.close()}return b.error(c("Unable to proceed. The form is not valid.")).subscribe()}},mounted(){const t=this.rawFields.map(e=>(e.name==="expiration_date"&&(e.value=this.popup.params.product.procurement.expiration_date),e.name==="tax_type"&&(e.value=this.popup.params.product.procurement.tax_type),e.name==="barcode"&&(e.value=this.popup.params.product.procurement.barcode),e));this.fields=this.validation.createFields(t)}},z={class:"ns-box shadow-lg w-6/7-screen md:w-5/7-screen lg:w-3/7-screen"},H={class:"p-2 border-b ns-box-header"},Q={class:"font-semibold"},W={class:"p-2 border-b ns-box-body"},X={class:"p-2 flex justify-end ns-box-body"};function Y(t,e,o,n,s,i){const x=T("ns-field"),a=T("ns-button");return l(),u("div",z,[r("div",H,[r("h5",Q,d(i.__("Options")),1)]),r("div",W,[(l(!0),u(v,null,g(s.fields,(p,f)=>(l(),D(x,{class:"w-full",field:p,key:f},null,8,["field"]))),128))]),r("div",X,[L(a,{onClick:e[0]||(e[0]=p=>i.applyChanges()),type:"info"},{default:I(()=>[k(d(i.__("Save")),1)]),_:1})])])}const Z=A(J,[["render",Y]]),$={name:"ns-procurement",mounted(){this.reloadEntities(),this.shouldPreventAccidentlRefreshSubscriber=this.shouldPreventAccidentalRefresh.subscribe({next:o=>{o?window.addEventListener("beforeunload",this.addAccidentalCloseListener):window.removeEventListener("beforeunload",this.addAccidentalCloseListener)}});const e=new URLSearchParams(window.location.search).get("preload");e&&y.get(`/api/procurements/preload/${e}`).subscribe({next:o=>{o.items!==void 0&&o.items.forEach(n=>{this.addProductList(n)})},error:o=>{b.error(o.message||c("An error occured while preloading the procurement.")).subscribe()}})},computed:{activeTab(){return this.validTabs.filter(t=>t.active).length>0?this.validTabs.filter(t=>t.active)[0]:!1}},data(){return{totalTaxValues:0,totalPurchasePrice:0,formValidation:new S,form:{},nsSnackBar:b,fields:[],searchResult:[],searchValue:"",debounceSearch:null,nsHttpClient:y,taxes:[],validTabs:[{label:c("Details"),identifier:"details",active:!0},{label:c("Products"),identifier:"products",active:!1}],reloading:!1,shouldPreventAccidentalRefresh:new O(!1),shouldPreventAccidentlRefreshSubscriber:null,showInfo:!1}},watch:{form:{handler(){this.formValidation.isFormUntouched(this.form)?this.shouldPreventAccidentalRefresh.next(!1):this.shouldPreventAccidentalRefresh.next(!0)},deep:!0},searchValue(t){t&&(clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout(()=>{this.doSearch(t)},500))}},components:{nsManageProducts:R},props:["submitMethod","submitUrl","returnUrl","src","rules"],methods:{__:c,nsCurrency:B,addAccidentalCloseListener(t){return t.preventDefault(),!0},async defineConversionOption(t){try{const e=this.form.products[t];if(e.procurement.unit_id===void 0)return E.error(c("An error has occured"),c("Select the procured unit first before selecting the conversion unit."),{actions:{learnMore:{label:c("Learn More"),onClick:n=>{console.log(n)}},close:{label:c("Close"),onClick:n=>{n.close()}}},duration:5e3});const o=await G(`/api/units/${e.procurement.unit_id}/siblings`,c("Convert to unit"),e.procurement.convert_unit_id||null,"select");e.procurement.convert_unit_id=o.values[0],e.procurement.convert_unit_label=o.labels[0]}catch(e){if(e!==!1)return b.error(e.message||c("An unexpected error has occured")).subscribe()}},computeTotal(){this.totalTaxValues=0,this.form.products.length>0&&(this.totalTaxValues=this.form.products.map(t=>t.procurement.tax_value).reduce((t,e)=>t+e)),this.totalPurchasePrice=0,this.form.products.length>0&&(this.totalPurchasePrice=this.form.products.map(t=>parseFloat(t.procurement.total_purchase_price)).reduce((t,e)=>t+e))},updateLine(t){const e=this.form.products[t],o=this.taxes.filter(n=>n.id===e.procurement.tax_group_id);if(parseFloat(e.procurement.purchase_price_edit)>0&&parseFloat(e.procurement.quantity)>0){if(o.length>0){const n=o[0].taxes.map(s=>q.getTaxValue(e.procurement.tax_type,e.procurement.purchase_price_edit,parseFloat(s.rate)));e.procurement.tax_value=n.reduce((s,i)=>s+i),e.procurement.tax_type==="inclusive"?(e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit)-e.procurement.tax_value,e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price)):(e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit)+e.procurement.tax_value,e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price))}else e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.tax_value=0;e.procurement.tax_value=e.procurement.tax_value*parseFloat(e.procurement.quantity),e.procurement.total_purchase_price=e.procurement.purchase_price*parseFloat(e.procurement.quantity)}this.computeTotal(),this.$forceUpdate()},fetchLastPurchasePrice(t){const e=this.form.products[t],o=e.unit_quantities.filter(n=>e.procurement.unit_id===n.unit_id);o.length>0&&(e.procurement.purchase_price_edit=o[0].last_purchase_price||0),this.updateLine(t)},switchTaxType(t,e){t.procurement.tax_type=t.procurement.tax_type==="inclusive"?"exclusive":"inclusive",this.updateLine(e)},doSearch(t){y.post("/api/procurements/products/search-product",{search:t}).subscribe(e=>{e.length===1?this.addProductList(e[0]):e.length>1?this.searchResult=e:b.error(c("No result match your query.")).subscribe()})},reloadEntities(){this.reloading=!0,N([y.get("/api/categories"),y.get("/api/products"),y.get(this.src),y.get("/api/taxes/groups")]).subscribe(t=>{this.reloading=!1,this.categories=t[0],this.products=t[1],this.taxes=t[3],this.form.general&&t[2].tabs.general.fieds.forEach((e,o)=>{e.value=this.form.tabs.general.fields[o].value||""}),this.form=Object.assign(JSON.parse(JSON.stringify(t[2])),this.form),this.form=this.formValidation.createForm(this.form),this.form.tabs&&this.form.tabs.general.fields.forEach((e,o)=>{e.options&&(e.options=t[2].tabs.general.fields[o].options)}),this.form.products.length===0&&(this.form.products=this.form.products.map(e=>(["gross_purchase_price","purchase_price_edit","tax_value","net_purchase_price","purchase_price","total_price","total_purchase_price","quantity","tax_group_id"].forEach(o=>{e[o]===void 0&&(e[o]=e[o]===void 0?0:e[o])}),e.$invalid=e.$invalid||!1,e.purchase_price_edit=e.purchase_price,{name:e.name,purchase_units:e.purchase_units,procurement:e,unit_quantities:e.unit_quantities||[]}))),this.$forceUpdate()})},setTabActive(t){this.validTabs.forEach(e=>e.active=!1),this.$forceUpdate(),this.$nextTick().then(()=>{t.active=!0})},addProductList(t){if(t.unit_quantities===void 0)return b.error(c("Unable to add product which doesn't unit quantities defined.")).subscribe();t.procurement===void 0&&(t.procurement={});const e={gross_purchase_price:0,purchase_price_edit:0,tax_value:0,net_purchase_price:0,purchase_price:0,total_price:0,total_purchase_price:0,quantity:1,expiration_date:null,tax_group_id:t.tax_group_id,tax_type:t.tax_type||"inclusive",unit_id:t.unit_quantities[0].unit_id,product_id:t.id,convert_unit_id:t.unit_quantities[0].convert_unit_id,procurement_id:null,$invalid:!1};t.procurement=Object.assign(e,t.procurement),this.searchResult=[],this.searchValue="",this.form.products.push(t);const o=this.form.products.length-1;this.fetchLastPurchasePrice(o)},submit(){if(this.form.products.length===0)return b.error(c("Unable to proceed, no product were provided."),c("OK")).subscribe();if(this.form.products.forEach(n=>{parseFloat(n.procurement.quantity)>=1?n.procurement.unit_id===0?n.procurement.$invalid=!0:n.procurement.$invalid=!1:n.procurement.$invalid=!0}),this.form.products.filter(n=>n.procurement.$invalid).length>0)return b.error(c("Unable to proceed, one or more product has incorrect values."),c("OK")).subscribe();if(this.formValidation.validateForm(this.form).length>0)return this.setTabActive(this.activeTab),b.error(c("Unable to proceed, the procurement form is not valid."),c("OK")).subscribe();if(this.submitUrl===void 0)return b.error(c("Unable to submit, no valid submit URL were provided."),c("OK")).subscribe();this.formValidation.disableForm(this.form);const e={...this.formValidation.extractForm(this.form),products:this.form.products.map(n=>n.procurement)},o=w.show(M);y[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,e).subscribe({next:n=>{if(n.status==="success")return this.shouldPreventAccidentalRefresh.next(!1),document.location=this.returnUrl;o.close(),this.formValidation.enableForm(this.form)},error:n=>{o.close(),b.error(n.message,void 0,{duration:5e3}).subscribe(),this.formValidation.enableForm(this.form),n.errors&&this.formValidation.triggerError(this.form,n.errors)}})},deleteProduct(t){this.form.products.splice(t,1),this.$forceUpdate()},handleGlobalChange(t){this.globallyChecked=t,this.rows.forEach(e=>e.$checked=t)},setProductOptions(t){new Promise((o,n)=>{w.show(Z,{product:this.form.products[t],resolve:o,reject:n})}).then(o=>{for(let n in o)this.form.products[t].procurement[n]=o[n];this.updateLine(t)})},async selectUnitForProduct(t){try{const e=this.form.products[t],o=await new Promise((s,i)=>{w.show(V,{label:c("{product}: Purchase Unit").replace("{product}",e.name),description:c("The product will be procured on that unit."),value:e.unit_id,resolve:s,reject:i,options:e.unit_quantities.map(x=>({label:x.unit.name,value:x.unit.id}))})});e.procurement.unit_id=o;const n=e.unit_quantities.filter(s=>parseInt(s.unit_id)===+o);e.procurement.convert_unit_id=n[0].convert_unit_id||void 0,e.procurement.convert_unit_label=await new Promise((s,i)=>{e.procurement.convert_unit_id!==void 0?y.get(`/api/units/${e.procurement.convert_unit_id}`).subscribe({next:x=>{s(x.name)},error:x=>{s(c("Unkown Unit"))}}):s(c("N/A"))}),this.fetchLastPurchasePrice(t)}catch(e){console.log(e)}},async selectTax(t){try{const e=this.form.products[t],o=await new Promise((n,s)=>{w.show(V,{label:c("Choose Tax"),description:c("The tax will be assigned to the procured product."),resolve:n,reject:s,options:this.taxes.map(i=>({label:i.name,value:i.id}))})});e.procurement.tax_group_id=o,this.updateLine(t)}catch{}},async triggerKeyboard(t,e,o){try{const n=await new Promise((s,i)=>{w.show(K,{value:t[e],resolve:s,reject:i})});t[e]=n,this.updateLine(o)}catch(n){console.log({exception:n})}},getSelectedTax(t){const e=this.form.products[t],o=this.taxes.filter(n=>!!(e.procurement.tax_group_id&&e.procurement.tax_group_id===n.id));return o.length===1?o[0].name:c("N/A")},getSelectedUnit(t){const e=this.form.products[t],n=e.unit_quantities.map(s=>s.unit).filter(s=>e.procurement.unit_id!==void 0?s.id===e.procurement.unit_id:!1);return n.length===1?n[0].name:c("N/A")},handleSavedEvent(t,e){t.data&&(e.options.push({label:t.data.entry.first_name,value:t.data.entry.id}),e.value=t.data.entry.id)}}},ee={class:"form flex-auto flex flex-col",id:"crud-form"},te={class:"flex flex-col"},re={class:"flex justify-between items-center"},se={for:"title",class:"font-bold my-2 text-primary"},ie={for:"title",class:"text-sm my-2 -mx-1 flex text-primary"},oe={key:0,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},ne={key:1,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},ae={class:"px-1"},ce=["href"],le=["disabled"],ue=["disabled"],de={key:0,class:"text-xs text-primary py-1"},pe={key:0,class:"rounded border-2 bg-info-primary border-info-tertiary flex"},he={class:"text flex-auto py-4"},me={class:"font-bold text-lg"},_e={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},fe={class:"px-4 w-full"},be={id:"tabbed-card",class:"ns-tab"},ve={id:"card-header",class:"flex flex-wrap"},xe=["onClick"],ye={key:0,class:"ml-2 rounded-full bg-info-tertiary text-primary h-6 min-w-6 flex items-center justify-center"},ge={key:0,class:"ns-tab-item"},we={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Pe={key:0,class:"-mx-4 flex flex-wrap"},ke={key:1,class:"ns-tab-item"},Ce={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Te={class:"mb-2"},Fe={class:"input-group info flex border-2 rounded overflow-hidden"},Ue=["placeholder"],Ve={class:"h-0"},Se={class:"shadow bg-floating-menu relative z-10"},Ae=["onClick"],Le={class:"block font-bold text-primary"},Oe={class:"block text-sm text-priamry"},Ee={class:"block text-sm text-primary"},qe={class:"overflow-x-auto"},Ne={class:"w-full ns-table"},je={class:""},Re={class:"flex"},Be={class:"flex md:flex-row flex-col md:-mx-1"},De={class:"md:px-1"},Ie=["onClick"],Ke={class:"md:px-1"},Me=["onClick"],Ge={class:"md:px-1"},Je=["onClick"],ze={class:"md:px-1"},He=["onClick"],Qe={class:"md:px-1"},We=["onClick"],Xe=["onClick"],Ye={class:"flex justify-center"},Ze={key:0,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},$e={key:1,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},et={class:"flex items-start"},tt={class:"input-group rounded border-2"},rt=["onChange","onUpdate:modelValue"],st=["value"],it={class:"flex items-start flex-col justify-end"},ot={class:"text-sm text-primary"},nt={class:"text-primary"},at=["colspan"],ct={class:"p-2 border"},lt=["colspan"],ut={class:"p-2 border"};function dt(t,e,o,n,s,i){const x=T("ns-field");return l(),u("div",ee,[s.form.main?(l(),u(v,{key:0},[r("div",te,[r("div",re,[r("label",se,d(s.form.main.label||i.__("No title is provided")),1),r("div",ie,[r("div",{class:"px-1",onClick:e[0]||(e[0]=a=>s.showInfo=!s.showInfo)},[s.showInfo?h("",!0):(l(),u("span",oe,d(i.__("Show Details")),1)),s.showInfo?(l(),u("span",ne,d(i.__("Hide Details")),1)):h("",!0)]),r("div",ae,[o.returnUrl?(l(),u("a",{key:0,href:o.returnUrl,class:"rounded-full ns-inset-button border px-2 py-1"},d(i.__("Go Back")),9,ce)):h("",!0)])])]),r("div",{class:P([s.form.main.disabled?"disabled":s.form.main.errors.length>0?"error":"","flex border-2 rounded input-group info overflow-hidden"])},[C(r("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>s.form.main.value=a),onKeypress:e[2]||(e[2]=a=>s.formValidation.checkField(s.form.main)),onBlur:e[3]||(e[3]=a=>s.formValidation.checkField(s.form.main)),onChange:e[4]||(e[4]=a=>s.formValidation.checkField(s.form.main)),disabled:s.form.main.disabled,type:"text",class:P([(s.form.main.disabled,""),"flex-auto outline-none h-10 px-2"])},null,42,le),[[F,s.form.main.value]]),r("button",{disabled:s.form.main.disabled,onClick:e[5]||(e[5]=a=>i.submit()),class:"outline-none px-4 h-10 border-l"},[U(t.$slots,"save",{},()=>[k(d(i.__("Save")),1)])],8,ue),r("button",{onClick:e[6]||(e[6]=a=>i.reloadEntities()),class:"outline-none px-4 h-10"},[r("i",{class:P([s.reloading?"animate animate-spin":"","las la-sync"])},null,2)])],2),s.form.main.description&&s.form.main.errors.length===0?(l(),u("p",de,d(s.form.main.description),1)):h("",!0),(l(!0),u(v,null,g(s.form.main.errors,(a,p)=>(l(),u("p",{class:"text-xs py-1 text-error-primary",key:p},[r("span",null,[U(t.$slots,"error-required",{},()=>[k(d(a.identifier),1)])])]))),128))]),s.showInfo?(l(),u("div",pe,[e[10]||(e[10]=r("div",{class:"icon w-16 flex py-4 justify-center"},[r("i",{class:"las la-info-circle text-4xl"})],-1)),r("div",he,[r("h3",me,d(i.__("Important Notes")),1),r("ul",null,[r("li",null,[e[8]||(e[8]=r("i",{class:"las la-hand-point-right"}," ",-1)),r("span",null,d(i.__("Stock Management Products.")),1)]),r("li",null,[e[9]||(e[9]=r("i",{class:"las la-hand-point-right"}," ",-1)),r("span",null,d(i.__("Doesn't work with Grouped Product.")),1)])])])])):h("",!0),r("div",_e,[r("div",fe,[r("div",be,[r("div",ve,[(l(!0),u(v,null,g(s.validTabs,(a,p)=>(l(),u("div",{onClick:f=>i.setTabActive(a),class:P([a.active?"active":"inactive","tab cursor-pointer px-4 py-2 rounded-tl-lg flex rounded-tr-lg text-primary"]),key:p},[k(d(a.label)+" ",1),a.identifier==="products"?(l(),u("div",ye,d(s.form.products.length),1)):h("",!0)],10,xe))),128))]),i.activeTab.identifier==="details"?(l(),u("div",ge,[r("div",we,[s.form.tabs?(l(),u("div",Pe,[(l(!0),u(v,null,g(s.form.tabs.general.fields,(a,p)=>(l(),u("div",{class:"flex px-4 w-full md:w-1/2 lg:w-1/3",key:p},[L(x,{onSaved:f=>i.handleSavedEvent(f,a),field:a},null,8,["onSaved","field"])]))),128))])):h("",!0)])])):h("",!0),i.activeTab.identifier==="products"?(l(),u("div",ke,[r("div",Ce,[r("div",Te,[r("div",Fe,[C(r("input",{"onUpdate:modelValue":e[7]||(e[7]=a=>s.searchValue=a),type:"text",placeholder:i.__("SKU, Barcode, Name"),class:"flex-auto text-primary outline-none h-10 px-2"},null,8,Ue),[[F,s.searchValue]])]),r("div",Ve,[r("div",Se,[(l(!0),u(v,null,g(s.searchResult,(a,p)=>(l(),u("div",{onClick:f=>i.addProductList(a),key:p,class:"cursor-pointer border border-b hover:bg-floating-menu-hover border-floating-menu-edge p-2 text-primary"},[r("span",Le,d(a.name),1),r("span",Oe,d(i.__("SKU"))+" : "+d(a.sku),1),r("span",Ee,d(i.__("Barcode"))+" : "+d(a.barcode),1)],8,Ae))),128))])])]),r("div",qe,[r("table",Ne,[r("thead",null,[r("tr",null,[(l(!0),u(v,null,g(s.form.columns,(a,p)=>(l(),u("td",{width:"200",key:p,class:"text-primary p-2 border"},d(a.label),1))),128))])]),r("tbody",null,[(l(!0),u(v,null,g(s.form.products,(a,p)=>(l(),u("tr",{key:p,class:P(a.procurement.$invalid?"error border-2 border-error-primary":"")},[(l(!0),u(v,null,g(s.form.columns,(f,m)=>(l(),u(v,null,[f.type==="name"?(l(),u("td",{key:m,width:"500",class:"p-2 text-primary border"},[r("span",je,d(a.name),1),r("div",Re,[r("div",Be,[r("div",De,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.deleteProduct(p)},d(i.__("Delete")),9,Ie)]),r("div",Ke,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.setProductOptions(p)},d(i.__("Options")),9,Me)]),r("div",Ge,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.selectUnitForProduct(p)},d(i.__("Unit"))+": "+d(i.getSelectedUnit(p)),9,Je)]),r("div",ze,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.selectTax(p)},d(i.__("Tax"))+": "+d(i.getSelectedTax(p)),9,He)]),r("div",Qe,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.defineConversionOption(p)},d(i.__("Convert"))+": "+d(a.procurement.convert_unit_id?a.procurement.convert_unit_label:i.__("N/A")),9,We)])])])])):h("",!0),f.type==="text"?(l(),u("td",{key:m,onClick:_=>i.triggerKeyboard(a.procurement,m,p),class:"text-primary border cursor-pointer"},[r("div",Ye,[["purchase_price_edit"].includes(m)?(l(),u("span",Ze,d(i.nsCurrency(a.procurement[m])),1)):h("",!0),["purchase_price_edit"].includes(m)?h("",!0):(l(),u("span",$e,d(a.procurement[m]),1))])],8,Xe)):h("",!0),f.type==="custom_select"?(l(),u("td",{key:m,class:"p-2 text-primary border"},[r("div",et,[r("div",tt,[C(r("select",{onChange:_=>i.updateLine(p),"onUpdate:modelValue":_=>a.procurement[m]=_,class:"p-2"},[(l(!0),u(v,null,g(f.options,_=>(l(),u("option",{key:_.value,value:_.value},d(_.label),9,st))),128))],40,rt),[[j,a.procurement[m]]])])])])):h("",!0),f.type==="currency"?(l(),u("td",{key:m,class:"p-2 text-primary border"},[r("div",it,[r("span",ot,d(i.nsCurrency(a.procurement[m])),1)])])):h("",!0)],64))),256))],2))),128)),r("tr",nt,[r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("tax_value")},null,8,at),r("td",ct,d(i.nsCurrency(s.totalTaxValues)),1),r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("total_purchase_price")-(Object.keys(s.form.columns).indexOf("tax_value")+1)},null,8,lt),r("td",ut,d(i.nsCurrency(s.totalPurchasePrice)),1)])])])])])])):h("",!0)])])])],64)):h("",!0)])}const Pt=A($,[["render",dt]]);export{Pt as default}; diff --git a/public/build/assets/ns-procurement-CKZvMuQI.js b/public/build/assets/ns-procurement-CKZvMuQI.js deleted file mode 100644 index cd631402b..000000000 --- a/public/build/assets/ns-procurement-CKZvMuQI.js +++ /dev/null @@ -1 +0,0 @@ -import{F as S,d as v,b as g,B as O,f as q,T as E,I as N,P as w,v as F,i as j}from"./bootstrap-Dea9XoG9.js";import B from"./manage-products-S0TS_1i7.js";import{_ as c,n as R}from"./currency-Dtag6qPd.js";import{_ as A}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as C,o as l,c as u,a as r,t as d,F as b,b as y,g as D,f as L,w as I,i as T,e as m,n as k,B as P,A as U}from"./runtime-core.esm-bundler-VrNrzzXC.js";import{_ as K}from"./components-CxIJxoVN.js";import{b as M,N as V}from"./ns-prompt-popup-7xlV5yZV.js";import{s as G}from"./select-api-entities-DY8e84Xd.js";import"./chart-Ozef1QaY.js";import"./ns-avatar-image-Pigdi04i.js";import"./join-array-NDqpMoMN.js";const J={name:"ns-procurement-product-options",props:["popup"],data(){return{validation:new S,fields:[],rawFields:[{label:c("Expiration Date"),name:"expiration_date",description:c("Define when that specific product should expire."),type:"datetimepicker"},{label:c("Barcode"),name:"barcode",description:c("Renders the automatically generated barcode."),type:"text",disabled:!0},{label:c("Tax Type"),name:"tax_type",description:c("Adjust how tax is calculated on the item."),type:"select",options:[{label:c("Inclusive"),value:"inclusive"},{label:c("Exclusive"),value:"exclusive"}]}]}},methods:{__:c,applyChanges(){if(this.validation.validateFields(this.fields)){const e=this.validation.extractFields(this.fields);return this.popup.params.resolve(e),this.popup.close()}return v.error(c("Unable to proceed. The form is not valid.")).subscribe()}},mounted(){const t=this.rawFields.map(e=>(e.name==="expiration_date"&&(e.value=this.popup.params.product.procurement.expiration_date),e.name==="tax_type"&&(e.value=this.popup.params.product.procurement.tax_type),e.name==="barcode"&&(e.value=this.popup.params.product.procurement.barcode),e));this.fields=this.validation.createFields(t)}},z={class:"ns-box shadow-lg w-6/7-screen md:w-5/7-screen lg:w-3/7-screen"},H={class:"p-2 border-b ns-box-header"},Q={class:"font-semibold"},W={class:"p-2 border-b ns-box-body"},X={class:"p-2 flex justify-end ns-box-body"};function Y(t,e,n,o,s,i){const x=C("ns-field"),a=C("ns-button");return l(),u("div",z,[r("div",H,[r("h5",Q,d(i.__("Options")),1)]),r("div",W,[(l(!0),u(b,null,y(s.fields,(p,f)=>(l(),D(x,{class:"w-full",field:p,key:f},null,8,["field"]))),128))]),r("div",X,[L(a,{onClick:e[0]||(e[0]=p=>i.applyChanges()),type:"info"},{default:I(()=>[T(d(i.__("Save")),1)]),_:1})])])}const Z=A(J,[["render",Y]]),$={name:"ns-procurement",mounted(){this.reloadEntities(),this.shouldPreventAccidentlRefreshSubscriber=this.shouldPreventAccidentalRefresh.subscribe({next:t=>{t?window.addEventListener("beforeunload",this.addAccidentalCloseListener):window.removeEventListener("beforeunload",this.addAccidentalCloseListener)}})},computed:{activeTab(){return this.validTabs.filter(t=>t.active).length>0?this.validTabs.filter(t=>t.active)[0]:!1}},data(){return{totalTaxValues:0,totalPurchasePrice:0,formValidation:new S,form:{},nsSnackBar:v,fields:[],searchResult:[],searchValue:"",debounceSearch:null,nsHttpClient:g,taxes:[],validTabs:[{label:c("Details"),identifier:"details",active:!0},{label:c("Products"),identifier:"products",active:!1}],reloading:!1,shouldPreventAccidentalRefresh:new O(!1),shouldPreventAccidentlRefreshSubscriber:null,showInfo:!1}},watch:{form:{handler(){this.formValidation.isFormUntouched(this.form)?this.shouldPreventAccidentalRefresh.next(!1):this.shouldPreventAccidentalRefresh.next(!0)},deep:!0},searchValue(t){t&&(clearTimeout(this.debounceSearch),this.debounceSearch=setTimeout(()=>{this.doSearch(t)},500))}},components:{nsManageProducts:B},props:["submitMethod","submitUrl","returnUrl","src","rules"],methods:{__:c,nsCurrency:R,addAccidentalCloseListener(t){return t.preventDefault(),!0},async defineConversionOption(t){try{const e=this.form.products[t];if(e.procurement.unit_id===void 0)return q.error(c("An error has occured"),c("Select the procured unit first before selecting the conversion unit."),{actions:{learnMore:{label:c("Learn More"),onClick:o=>{console.log(o)}},close:{label:c("Close"),onClick:o=>{o.close()}}},duration:5e3});const n=await G(`/api/units/${e.procurement.unit_id}/siblings`,c("Convert to unit"),e.procurement.convert_unit_id||null,"select");e.procurement.convert_unit_id=n.values[0],e.procurement.convert_unit_label=n.labels[0]}catch(e){if(e!==!1)return v.error(e.message||c("An unexpected error has occured")).subscribe()}},computeTotal(){this.totalTaxValues=0,this.form.products.length>0&&(this.totalTaxValues=this.form.products.map(t=>t.procurement.tax_value).reduce((t,e)=>t+e)),this.totalPurchasePrice=0,this.form.products.length>0&&(this.totalPurchasePrice=this.form.products.map(t=>parseFloat(t.procurement.total_purchase_price)).reduce((t,e)=>t+e))},updateLine(t){const e=this.form.products[t],n=this.taxes.filter(o=>o.id===e.procurement.tax_group_id);if(parseFloat(e.procurement.purchase_price_edit)>0&&parseFloat(e.procurement.quantity)>0){if(n.length>0){const o=n[0].taxes.map(s=>E.getTaxValue(e.procurement.tax_type,e.procurement.purchase_price_edit,parseFloat(s.rate)));e.procurement.tax_value=o.reduce((s,i)=>s+i),e.procurement.tax_type==="inclusive"?(e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit)-e.procurement.tax_value,e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price)):(e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit)+e.procurement.tax_value,e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.gross_purchase_price))}else e.procurement.gross_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.net_purchase_price=parseFloat(e.procurement.purchase_price_edit),e.procurement.tax_value=0;e.procurement.tax_value=e.procurement.tax_value*parseFloat(e.procurement.quantity),e.procurement.total_purchase_price=e.procurement.purchase_price*parseFloat(e.procurement.quantity)}this.computeTotal(),this.$forceUpdate()},fetchLastPurchasePrice(t){const e=this.form.products[t],n=e.unit_quantities.filter(o=>e.procurement.unit_id===o.unit_id);n.length>0&&(e.procurement.purchase_price_edit=n[0].last_purchase_price||0),this.updateLine(t)},switchTaxType(t,e){t.procurement.tax_type=t.procurement.tax_type==="inclusive"?"exclusive":"inclusive",this.updateLine(e)},doSearch(t){g.post("/api/procurements/products/search-product",{search:t}).subscribe(e=>{e.length===1?this.addProductList(e[0]):e.length>1?this.searchResult=e:v.error(c("No result match your query.")).subscribe()})},reloadEntities(){this.reloading=!0,N([g.get("/api/categories"),g.get("/api/products"),g.get(this.src),g.get("/api/taxes/groups")]).subscribe(t=>{this.reloading=!1,this.categories=t[0],this.products=t[1],this.taxes=t[3],this.form.general&&t[2].tabs.general.fieds.forEach((e,n)=>{e.value=this.form.tabs.general.fields[n].value||""}),this.form=Object.assign(JSON.parse(JSON.stringify(t[2])),this.form),this.form=this.formValidation.createForm(this.form),this.form.tabs&&this.form.tabs.general.fields.forEach((e,n)=>{e.options&&(e.options=t[2].tabs.general.fields[n].options)}),this.form.products.length===0&&(this.form.products=this.form.products.map(e=>(["gross_purchase_price","purchase_price_edit","tax_value","net_purchase_price","purchase_price","total_price","total_purchase_price","quantity","tax_group_id"].forEach(n=>{e[n]===void 0&&(e[n]=e[n]===void 0?0:e[n])}),e.$invalid=e.$invalid||!1,e.purchase_price_edit=e.purchase_price,{name:e.name,purchase_units:e.purchase_units,procurement:e,unit_quantities:e.unit_quantities||[]}))),this.$forceUpdate()})},setTabActive(t){this.validTabs.forEach(e=>e.active=!1),this.$forceUpdate(),this.$nextTick().then(()=>{t.active=!0})},addProductList(t){if(t.unit_quantities===void 0)return v.error(c("Unable to add product which doesn't unit quantities defined.")).subscribe();t.procurement=new Object,t.procurement.gross_purchase_price=0,t.procurement.purchase_price_edit=0,t.procurement.tax_value=0,t.procurement.net_purchase_price=0,t.procurement.purchase_price=0,t.procurement.total_price=0,t.procurement.total_purchase_price=0,t.procurement.quantity=1,t.procurement.expiration_date=null,t.procurement.tax_group_id=t.tax_group_id,t.procurement.tax_type=t.tax_type||"inclusive",t.procurement.unit_id=t.unit_quantities[0].unit_id,t.procurement.product_id=t.id,t.procurement.convert_unit_id=t.unit_quantities[0].convert_unit_id,t.procurement.procurement_id=null,t.procurement.$invalid=!1,this.searchResult=[],this.searchValue="",this.form.products.push(t);const e=this.form.products.length-1;this.fetchLastPurchasePrice(e)},submit(){if(this.form.products.length===0)return v.error(c("Unable to proceed, no product were provided."),c("OK")).subscribe();if(this.form.products.forEach(o=>{parseFloat(o.procurement.quantity)>=1?o.procurement.unit_id===0?o.procurement.$invalid=!0:o.procurement.$invalid=!1:o.procurement.$invalid=!0}),this.form.products.filter(o=>o.procurement.$invalid).length>0)return v.error(c("Unable to proceed, one or more product has incorrect values."),c("OK")).subscribe();if(this.formValidation.validateForm(this.form).length>0)return this.setTabActive(this.activeTab),v.error(c("Unable to proceed, the procurement form is not valid."),c("OK")).subscribe();if(this.submitUrl===void 0)return v.error(c("Unable to submit, no valid submit URL were provided."),c("OK")).subscribe();this.formValidation.disableForm(this.form);const e={...this.formValidation.extractForm(this.form),products:this.form.products.map(o=>o.procurement)},n=w.show(M);g[this.submitMethod?this.submitMethod.toLowerCase():"post"](this.submitUrl,e).subscribe({next:o=>{if(o.status==="success")return this.shouldPreventAccidentalRefresh.next(!1),document.location=this.returnUrl;n.close(),this.formValidation.enableForm(this.form)},error:o=>{n.close(),v.error(o.message,void 0,{duration:5e3}).subscribe(),this.formValidation.enableForm(this.form),o.errors&&this.formValidation.triggerError(this.form,o.errors)}})},deleteProduct(t){this.form.products.splice(t,1),this.$forceUpdate()},handleGlobalChange(t){this.globallyChecked=t,this.rows.forEach(e=>e.$checked=t)},setProductOptions(t){new Promise((n,o)=>{w.show(Z,{product:this.form.products[t],resolve:n,reject:o})}).then(n=>{for(let o in n)this.form.products[t].procurement[o]=n[o];this.updateLine(t)})},async selectUnitForProduct(t){try{const e=this.form.products[t],n=await new Promise((s,i)=>{w.show(V,{label:c("{product}: Purchase Unit").replace("{product}",e.name),description:c("The product will be procured on that unit."),value:e.unit_id,resolve:s,reject:i,options:e.unit_quantities.map(x=>({label:x.unit.name,value:x.unit.id}))})});e.procurement.unit_id=n;const o=e.unit_quantities.filter(s=>parseInt(s.unit_id)===+n);e.procurement.convert_unit_id=o[0].convert_unit_id||void 0,e.procurement.convert_unit_label=await new Promise((s,i)=>{e.procurement.convert_unit_id!==void 0?g.get(`/api/units/${e.procurement.convert_unit_id}`).subscribe({next:x=>{s(x.name)},error:x=>{s(c("Unkown Unit"))}}):s(c("N/A"))}),this.fetchLastPurchasePrice(t)}catch(e){console.log(e)}},async selectTax(t){try{const e=this.form.products[t],n=await new Promise((o,s)=>{w.show(V,{label:c("Choose Tax"),description:c("The tax will be assigned to the procured product."),resolve:o,reject:s,options:this.taxes.map(i=>({label:i.name,value:i.id}))})});e.procurement.tax_group_id=n,this.updateLine(t)}catch{}},async triggerKeyboard(t,e,n){try{const o=await new Promise((s,i)=>{w.show(K,{value:t[e],resolve:s,reject:i})});t[e]=o,this.updateLine(n)}catch(o){console.log({exception:o})}},getSelectedTax(t){const e=this.form.products[t],n=this.taxes.filter(o=>!!(e.procurement.tax_group_id&&e.procurement.tax_group_id===o.id));return n.length===1?n[0].name:c("N/A")},getSelectedUnit(t){const e=this.form.products[t],o=e.unit_quantities.map(s=>s.unit).filter(s=>e.procurement.unit_id!==void 0?s.id===e.procurement.unit_id:!1);return o.length===1?o[0].name:c("N/A")},handleSavedEvent(t,e){t.data&&(e.options.push({label:t.data.entry.first_name,value:t.data.entry.id}),e.value=t.data.entry.id)}}},ee={class:"form flex-auto flex flex-col",id:"crud-form"},te={class:"flex flex-col"},re={class:"flex justify-between items-center"},se={for:"title",class:"font-bold my-2 text-primary"},ie={for:"title",class:"text-sm my-2 -mx-1 flex text-primary"},oe={key:0,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},ne={key:1,class:"cursor-pointer rounded-full ns-inset-button border px-2 py-1"},ae={class:"px-1"},ce=["href"],le=["disabled"],ue=["disabled"],de={key:0,class:"text-xs text-primary py-1"},pe={key:0,class:"rounded border-2 bg-info-primary border-info-tertiary flex"},me={class:"text flex-auto py-4"},he={class:"font-bold text-lg"},_e={id:"form-container",class:"-mx-4 flex flex-wrap mt-4"},fe={class:"px-4 w-full"},be={id:"tabbed-card",class:"ns-tab"},ve={id:"card-header",class:"flex flex-wrap"},xe=["onClick"],ye={key:0,class:"ns-tab-item"},ge={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},we={key:0,class:"-mx-4 flex flex-wrap"},ke={key:1,class:"ns-tab-item"},Pe={class:"card-body rounded-br-lg rounded-bl-lg shadow p-2"},Ce={class:"mb-2"},Te={class:"input-group info flex border-2 rounded overflow-hidden"},Fe=["placeholder"],Ue={class:"h-0"},Ve={class:"shadow bg-floating-menu relative z-10"},Se=["onClick"],Ae={class:"block font-bold text-primary"},Le={class:"block text-sm text-priamry"},Oe={class:"block text-sm text-primary"},qe={class:"overflow-x-auto"},Ee={class:"w-full ns-table"},Ne={class:""},je={class:"flex"},Be={class:"flex md:flex-row flex-col md:-mx-1"},Re={class:"md:px-1"},De=["onClick"],Ie={class:"md:px-1"},Ke=["onClick"],Me={class:"md:px-1"},Ge=["onClick"],Je={class:"md:px-1"},ze=["onClick"],He={class:"md:px-1"},Qe=["onClick"],We=["onClick"],Xe={class:"flex justify-center"},Ye={key:0,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},Ze={key:1,class:"outline-none border-dashed py-1 border-b border-info-primary text-sm"},$e={class:"flex items-start"},et={class:"input-group rounded border-2"},tt=["onChange","onUpdate:modelValue"],rt=["value"],st={class:"flex items-start flex-col justify-end"},it={class:"text-sm text-primary"},ot={class:"text-primary"},nt=["colspan"],at={class:"p-2 border"},ct=["colspan"],lt={class:"p-2 border"};function ut(t,e,n,o,s,i){const x=C("ns-field");return l(),u("div",ee,[s.form.main?(l(),u(b,{key:0},[r("div",te,[r("div",re,[r("label",se,d(s.form.main.label||i.__("No title is provided")),1),r("div",ie,[r("div",{class:"px-1",onClick:e[0]||(e[0]=a=>s.showInfo=!s.showInfo)},[s.showInfo?m("",!0):(l(),u("span",oe,d(i.__("Show Details")),1)),s.showInfo?(l(),u("span",ne,d(i.__("Hide Details")),1)):m("",!0)]),r("div",ae,[n.returnUrl?(l(),u("a",{key:0,href:n.returnUrl,class:"rounded-full ns-inset-button border px-2 py-1"},d(i.__("Go Back")),9,ce)):m("",!0)])])]),r("div",{class:k([s.form.main.disabled?"disabled":s.form.main.errors.length>0?"error":"","flex border-2 rounded input-group info overflow-hidden"])},[P(r("input",{"onUpdate:modelValue":e[1]||(e[1]=a=>s.form.main.value=a),onKeypress:e[2]||(e[2]=a=>s.formValidation.checkField(s.form.main)),onBlur:e[3]||(e[3]=a=>s.formValidation.checkField(s.form.main)),onChange:e[4]||(e[4]=a=>s.formValidation.checkField(s.form.main)),disabled:s.form.main.disabled,type:"text",class:k([(s.form.main.disabled,""),"flex-auto outline-none h-10 px-2"])},null,42,le),[[F,s.form.main.value]]),r("button",{disabled:s.form.main.disabled,onClick:e[5]||(e[5]=a=>i.submit()),class:"outline-none px-4 h-10 border-l"},[U(t.$slots,"save",{},()=>[T(d(i.__("Save")),1)])],8,ue),r("button",{onClick:e[6]||(e[6]=a=>i.reloadEntities()),class:"outline-none px-4 h-10"},[r("i",{class:k([s.reloading?"animate animate-spin":"","las la-sync"])},null,2)])],2),s.form.main.description&&s.form.main.errors.length===0?(l(),u("p",de,d(s.form.main.description),1)):m("",!0),(l(!0),u(b,null,y(s.form.main.errors,(a,p)=>(l(),u("p",{class:"text-xs py-1 text-error-primary",key:p},[r("span",null,[U(t.$slots,"error-required",{},()=>[T(d(a.identifier),1)])])]))),128))]),s.showInfo?(l(),u("div",pe,[e[10]||(e[10]=r("div",{class:"icon w-16 flex py-4 justify-center"},[r("i",{class:"las la-info-circle text-4xl"})],-1)),r("div",me,[r("h3",he,d(i.__("Important Notes")),1),r("ul",null,[r("li",null,[e[8]||(e[8]=r("i",{class:"las la-hand-point-right"}," ",-1)),r("span",null,d(i.__("Stock Management Products.")),1)]),r("li",null,[e[9]||(e[9]=r("i",{class:"las la-hand-point-right"}," ",-1)),r("span",null,d(i.__("Doesn't work with Grouped Product.")),1)])])])])):m("",!0),r("div",_e,[r("div",fe,[r("div",be,[r("div",ve,[(l(!0),u(b,null,y(s.validTabs,(a,p)=>(l(),u("div",{onClick:f=>i.setTabActive(a),class:k([a.active?"active":"inactive","tab cursor-pointer px-4 py-2 rounded-tl-lg rounded-tr-lg text-primary"]),key:p},d(a.label),11,xe))),128))]),i.activeTab.identifier==="details"?(l(),u("div",ye,[r("div",ge,[s.form.tabs?(l(),u("div",we,[(l(!0),u(b,null,y(s.form.tabs.general.fields,(a,p)=>(l(),u("div",{class:"flex px-4 w-full md:w-1/2 lg:w-1/3",key:p},[L(x,{onSaved:f=>i.handleSavedEvent(f,a),field:a},null,8,["onSaved","field"])]))),128))])):m("",!0)])])):m("",!0),i.activeTab.identifier==="products"?(l(),u("div",ke,[r("div",Pe,[r("div",Ce,[r("div",Te,[P(r("input",{"onUpdate:modelValue":e[7]||(e[7]=a=>s.searchValue=a),type:"text",placeholder:i.__("SKU, Barcode, Name"),class:"flex-auto text-primary outline-none h-10 px-2"},null,8,Fe),[[F,s.searchValue]])]),r("div",Ue,[r("div",Ve,[(l(!0),u(b,null,y(s.searchResult,(a,p)=>(l(),u("div",{onClick:f=>i.addProductList(a),key:p,class:"cursor-pointer border border-b hover:bg-floating-menu-hover border-floating-menu-edge p-2 text-primary"},[r("span",Ae,d(a.name),1),r("span",Le,d(i.__("SKU"))+" : "+d(a.sku),1),r("span",Oe,d(i.__("Barcode"))+" : "+d(a.barcode),1)],8,Se))),128))])])]),r("div",qe,[r("table",Ee,[r("thead",null,[r("tr",null,[(l(!0),u(b,null,y(s.form.columns,(a,p)=>(l(),u("td",{width:"200",key:p,class:"text-primary p-2 border"},d(a.label),1))),128))])]),r("tbody",null,[(l(!0),u(b,null,y(s.form.products,(a,p)=>(l(),u("tr",{key:p,class:k(a.procurement.$invalid?"error border-2 border-error-primary":"")},[(l(!0),u(b,null,y(s.form.columns,(f,h)=>(l(),u(b,null,[f.type==="name"?(l(),u("td",{key:h,width:"500",class:"p-2 text-primary border"},[r("span",Ne,d(a.name),1),r("div",je,[r("div",Be,[r("div",Re,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.deleteProduct(p)},d(i.__("Delete")),9,De)]),r("div",Ie,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.setProductOptions(p)},d(i.__("Options")),9,Ke)]),r("div",Me,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.selectUnitForProduct(p)},d(i.__("Unit"))+": "+d(i.getSelectedUnit(p)),9,Ge)]),r("div",Je,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.selectTax(p)},d(i.__("Tax"))+": "+d(i.getSelectedTax(p)),9,ze)]),r("div",He,[r("span",{class:"text-xs text-info-tertiary cursor-pointer underline",onClick:_=>i.defineConversionOption(p)},d(i.__("Convert"))+": "+d(a.procurement.convert_unit_id?a.procurement.convert_unit_label:i.__("N/A")),9,Qe)])])])])):m("",!0),f.type==="text"?(l(),u("td",{key:h,onClick:_=>i.triggerKeyboard(a.procurement,h,p),class:"text-primary border cursor-pointer"},[r("div",Xe,[["purchase_price_edit"].includes(h)?(l(),u("span",Ye,d(i.nsCurrency(a.procurement[h])),1)):m("",!0),["purchase_price_edit"].includes(h)?m("",!0):(l(),u("span",Ze,d(a.procurement[h]),1))])],8,We)):m("",!0),f.type==="custom_select"?(l(),u("td",{key:h,class:"p-2 text-primary border"},[r("div",$e,[r("div",et,[P(r("select",{onChange:_=>i.updateLine(p),"onUpdate:modelValue":_=>a.procurement[h]=_,class:"p-2"},[(l(!0),u(b,null,y(f.options,_=>(l(),u("option",{key:_.value,value:_.value},d(_.label),9,rt))),128))],40,tt),[[j,a.procurement[h]]])])])])):m("",!0),f.type==="currency"?(l(),u("td",{key:h,class:"p-2 text-primary border"},[r("div",st,[r("span",it,d(i.nsCurrency(a.procurement[h])),1)])])):m("",!0)],64))),256))],2))),128)),r("tr",ot,[r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("tax_value")},null,8,nt),r("td",at,d(i.nsCurrency(s.totalTaxValues)),1),r("td",{class:"p-2 border",colspan:Object.keys(s.form.columns).indexOf("total_purchase_price")-(Object.keys(s.form.columns).indexOf("tax_value")+1)},null,8,ct),r("td",lt,d(i.nsCurrency(s.totalPurchasePrice)),1)])])])])])])):m("",!0)])])])],64)):m("",!0)])}const wt=A($,[["render",ut]]);export{wt as default}; diff --git a/public/build/assets/ns-settings-DWcCMpBe.js b/public/build/assets/ns-settings-DWcCMpBe.js new file mode 100644 index 000000000..41fe18535 --- /dev/null +++ b/public/build/assets/ns-settings-DWcCMpBe.js @@ -0,0 +1 @@ +import{_ as v}from"./currency-Dtag6qPd.js";import{F as T}from"./bootstrap-Dea9XoG9.js";import{g as A}from"./components-CxIJxoVN.js";import{s as y,r as p,o as r,c as l,a as d,F as f,b as h,n as B,t as m,e as u,f as _,w as g,i as k,g as S,j as w,A as H}from"./runtime-core.esm-bundler-VrNrzzXC.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./chart-Ozef1QaY.js";import"./ns-prompt-popup-7xlV5yZV.js";import"./ns-avatar-image-Pigdi04i.js";const O={name:"ns-settings",props:["url"],components:{nsField:A},data(){return{validation:new T,form:{},isSubmitting:!1,test:""}},computed:{component(){return this},formDefined(){return Object.values(this.form).length>0},activeTab(){for(let t in this.form.tabs)if(this.form.tabs[t].active===!0)return this.form.tabs[t]},activeTabIdentifier(){const t=Object.values(this.form.tabs);return Object.keys(this.form.tabs)[t.indexOf(this.activeTab)]}},mounted(){const t=window.location.href,i=new URL(t);this.loadSettingsForm(i.searchParams.get("tab")||null)},methods:{__:v,async handleSaved(t,i){i.options.push({value:t.data.entry[i.props.optionAttributes.value],label:t.data.entry[i.props.optionAttributes.label]}),i.value=t.data.entry[i.props.optionAttributes.value]},loadComponent(t){if(nsExtraComponents[t])return y(nsExtraComponents[t]);if(nsComponents[t])return y(nsComponents[t]);throw`Component ${t} not found.`},async submitForm(){if(this.validation.validateForm(this.form).length>0)return nsSnackBar.error(v("Unable to proceed the form is not valid.")).subscribe();this.validation.disableForm(this.form);const t=this.validation.extractForm(this.form),i=nsHooks.applyFilters("ns-before-saved",()=>new Promise((a,s)=>(this.isSubmitting=!0,nsHttpClient.post(this.url,t).subscribe({next:c=>{this.isSubmitting=!1,a(c)},error:c=>{this.isSubmitting=!1,s(c)}}))));try{const a=await i(t);this.validation.enableForm(this.form);const s=Object.values(this.form.tabs),c=Object.keys(this.form.tabs)[s.indexOf(this.activeTab)];this.loadSettingsForm(c),a.data&&a.data.results&&a.data.results.forEach(e=>{e.status==="error"?nsSnackBar.error(e.message).subscribe():nsSnackBar.success(e.message).subscribe()}),nsHooks.doAction("ns-settings-saved",{result:a,instance:this}),nsSnackBar.success(a.message).subscribe()}catch(a){this.validation.enableForm(this.form),this.validation.triggerFieldsErrors(this.form,a),nsHooks.doAction("ns-settings-failed",{error:a,instance:this}),a.message&&nsSnackBar.error(a.message||v("Unable to proceed the form is not valid.")).subscribe()}},setActive(t,i){for(let a in this.form.tabs)this.form.tabs[a].active=!1;t.active=!0,nsHooks.doAction("ns-settings-change-tab",{tab:t,instance:this,identifier:i})},loadSettingsForm(t=null){return new Promise((i,a)=>{nsHttpClient.get(this.url).subscribe({next:s=>{i(s);let c=0,e=null;this.form={},t=s.tabs[t]!==void 0?t:null;for(let o in s.tabs)this.formDefined?s.tabs[o].active=this.form.tabs[o].active:(s.tabs[o].active=!1,(t===null&&c===0||t!==null&&o===t)&&(s.tabs[o].active=!0,e=o)),c++,s.tabs[o].fields===void 0&&(s.tabs[o].fields=[]);this.form=this.validation.createForm(s),nsHooks.doAction("ns-settings-loaded",this),nsHooks.doAction("ns-settings-change-tab",{tab:this.activeTab,instance:this,identifier:e})},error:s=>{nsSnackBar.error(s.message).subscribe(),a(s)}})})}}},D={key:0,id:"tabbed-card",class:"ns-tab"},E={id:"card-header",class:"flex flex-wrap ml-4"},I=["onClick"],V={key:0,class:"ml-2 rounded-full ns-inset-button error active text-sm h-6 w-6 flex items-center justify-center"},P={class:"card-body ns-tab-item"},U={class:"shadow rounded"},L={key:0,class:"px-2 pt-1"},R={class:"my-2"},z={class:"-mx-4 flex flex-wrap p-2"},q={class:"flex flex-col my-2"},G={key:1,class:"w-full px-4"},J={key:1,class:"ns-tab-item-footer border-t p-2 flex justify-between"};function K(t,i,a,s,c,e){const o=p("ns-notice"),C=p("ns-field"),F=p("ns-button");return e.formDefined?(r(),l("div",D,[d("div",E,[(r(!0),l(f,null,h(c.form.tabs,(n,b)=>(r(),l("div",{class:B([n.active?"active":"inactive","tab cursor-pointer flex items-center px-4 py-2 rounded-tl-lg rounded-tr-lg"]),onClick:x=>e.setActive(n,b),key:b},[d("span",null,m(n.label),1),n.errors&&n.errors.length>0?(r(),l("span",V,m(n.errors.length),1)):u("",!0)],10,I))),128))]),d("div",P,[d("div",U,[e.activeTab.notices?(r(),l("div",L,[(r(!0),l(f,null,h(e.activeTab.notices,n=>(r(),l("div",R,[_(o,{color:n.color||"info"},{title:g(()=>[k(m(n.title),1)]),description:g(()=>[k(m(n.description),1)]),_:2},1032,["color"])]))),256))])):u("",!0),d("div",z,[e.activeTab.fields?(r(!0),l(f,{key:0},h(e.activeTab.fields,(n,b)=>(r(),l("div",{class:"w-full px-4 md:w-1/2 lg:w-1/3",key:b},[d("div",q,[_(C,{onSaved:x=>e.handleSaved(x,n),field:n},null,8,["onSaved","field"])])]))),128)):u("",!0),e.activeTab.component?(r(),l("div",G,[(r(),S(w(e.loadComponent(e.activeTab.component).value)))])):u("",!0)]),e.activeTab.fields&&e.activeTab.fields.length>0?(r(),l("div",J,[d("div",null,[e.activeTab.footer&&e.activeTab.footer.extraComponents?(r(!0),l(f,{key:0},h(e.activeTab.footer.extraComponents,(n,b)=>(r(),S(w(e.loadComponent(n).value),{key:b,parent:n},null,8,["parent"]))),128)):u("",!0)]),d("div",null,[_(F,{disabled:c.isSubmitting,onClick:i[0]||(i[0]=n=>e.submitForm()),type:"info"},{default:g(()=>[H(t.$slots,"submit-button",{},()=>[k(m(e.__("Save Settings")),1)])]),_:3},8,["disabled"])])])):u("",!0)])])])):u("",!0)}const tt=j(O,[["render",K]]);export{tt as default}; diff --git a/public/build/assets/ns-settings-DcTDh_HF.js b/public/build/assets/ns-settings-DcTDh_HF.js deleted file mode 100644 index 582ce5004..000000000 --- a/public/build/assets/ns-settings-DcTDh_HF.js +++ /dev/null @@ -1 +0,0 @@ -import{_ as v}from"./currency-Dtag6qPd.js";import{F as T}from"./bootstrap-Dea9XoG9.js";import{g as A}from"./components-CxIJxoVN.js";import{s as y,r as p,o as r,c as l,a as d,F as f,b as h,n as B,t as m,e as u,f as _,w as g,i as k,g as S,j as C,A as H}from"./runtime-core.esm-bundler-VrNrzzXC.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./chart-Ozef1QaY.js";import"./ns-prompt-popup-7xlV5yZV.js";import"./ns-avatar-image-Pigdi04i.js";const O={name:"ns-settings",props:["url"],components:{nsField:A},data(){return{validation:new T,form:{},isSubmitting:!1,test:""}},computed:{component(){return this},formDefined(){return Object.values(this.form).length>0},activeTab(){for(let t in this.form.tabs)if(this.form.tabs[t].active===!0)return this.form.tabs[t]},activeTabIdentifier(){const t=Object.values(this.form.tabs);return Object.keys(this.form.tabs)[t.indexOf(this.activeTab)]}},mounted(){const t=window.location.href,i=new URL(t);this.loadSettingsForm(i.searchParams.get("tab")||null)},methods:{__:v,async handleSaved(t,i){i.options.push({value:t.data.entry[i.props.optionAttributes.value],label:t.data.entry[i.props.optionAttributes.label]}),i.value=t.data.entry[i.props.optionAttributes.value]},loadComponent(t){return nsExtraComponents[t]?y(nsExtraComponents[t]):nsComponents[t]?y(nsComponents[t]):(console.error(`Component ${t} not found.`),{value:null})},async submitForm(){if(this.validation.validateForm(this.form).length>0)return nsSnackBar.error(v("Unable to proceed the form is not valid.")).subscribe();this.validation.disableForm(this.form);const t=this.validation.extractForm(this.form),i=nsHooks.applyFilters("ns-before-saved",()=>new Promise((a,s)=>(this.isSubmitting=!0,nsHttpClient.post(this.url,t).subscribe({next:c=>{this.isSubmitting=!1,a(c)},error:c=>{this.isSubmitting=!1,s(c)}}))));try{const a=await i(t);this.validation.enableForm(this.form);const s=Object.values(this.form.tabs),c=Object.keys(this.form.tabs)[s.indexOf(this.activeTab)];this.loadSettingsForm(c),a.data&&a.data.results&&a.data.results.forEach(e=>{e.status==="error"?nsSnackBar.error(e.message).subscribe():nsSnackBar.success(e.message).subscribe()}),nsHooks.doAction("ns-settings-saved",{result:a,instance:this}),nsSnackBar.success(a.message).subscribe()}catch(a){this.validation.enableForm(this.form),this.validation.triggerFieldsErrors(this.form,a),nsHooks.doAction("ns-settings-failed",{error:a,instance:this}),a.message&&nsSnackBar.error(a.message||v("Unable to proceed the form is not valid.")).subscribe()}},setActive(t,i){for(let a in this.form.tabs)this.form.tabs[a].active=!1;t.active=!0,nsHooks.doAction("ns-settings-change-tab",{tab:t,instance:this,identifier:i})},loadSettingsForm(t=null){return new Promise((i,a)=>{nsHttpClient.get(this.url).subscribe({next:s=>{i(s);let c=0,e=null;this.form={},t=s.tabs[t]!==void 0?t:null;for(let o in s.tabs)this.formDefined?s.tabs[o].active=this.form.tabs[o].active:(s.tabs[o].active=!1,(t===null&&c===0||t!==null&&o===t)&&(s.tabs[o].active=!0,e=o)),c++,s.tabs[o].fields===void 0&&(s.tabs[o].fields=[]);this.form=this.validation.createForm(s),nsHooks.doAction("ns-settings-loaded",this),nsHooks.doAction("ns-settings-change-tab",{tab:this.activeTab,instance:this,identifier:e})},error:s=>{nsSnackBar.error(s.message).subscribe(),a(s)}})})}}},D={key:0,id:"tabbed-card",class:"ns-tab"},E={id:"card-header",class:"flex flex-wrap ml-4"},I=["onClick"],V={key:0,class:"ml-2 rounded-full ns-inset-button error active text-sm h-6 w-6 flex items-center justify-center"},P={class:"card-body ns-tab-item"},U={class:"shadow rounded"},L={key:0,class:"px-2 pt-1"},R={class:"my-2"},z={class:"-mx-4 flex flex-wrap p-2"},q={class:"flex flex-col my-2"},G={key:1,class:"w-full px-4"},J={key:1,class:"ns-tab-item-footer border-t p-2 flex justify-between"};function K(t,i,a,s,c,e){const o=p("ns-notice"),w=p("ns-field"),F=p("ns-button");return e.formDefined?(r(),l("div",D,[d("div",E,[(r(!0),l(f,null,h(c.form.tabs,(n,b)=>(r(),l("div",{class:B([n.active?"active":"inactive","tab cursor-pointer flex items-center px-4 py-2 rounded-tl-lg rounded-tr-lg"]),onClick:x=>e.setActive(n,b),key:b},[d("span",null,m(n.label),1),n.errors&&n.errors.length>0?(r(),l("span",V,m(n.errors.length),1)):u("",!0)],10,I))),128))]),d("div",P,[d("div",U,[e.activeTab.notices?(r(),l("div",L,[(r(!0),l(f,null,h(e.activeTab.notices,n=>(r(),l("div",R,[_(o,{color:n.color||"info"},{title:g(()=>[k(m(n.title),1)]),description:g(()=>[k(m(n.description),1)]),_:2},1032,["color"])]))),256))])):u("",!0),d("div",z,[e.activeTab.fields?(r(!0),l(f,{key:0},h(e.activeTab.fields,(n,b)=>(r(),l("div",{class:"w-full px-4 md:w-1/2 lg:w-1/3",key:b},[d("div",q,[_(w,{onSaved:x=>e.handleSaved(x,n),field:n},null,8,["onSaved","field"])])]))),128)):u("",!0),e.activeTab.component?(r(),l("div",G,[(r(),S(C(e.loadComponent(e.activeTab.component).value)))])):u("",!0)]),e.activeTab.fields&&e.activeTab.fields.length>0?(r(),l("div",J,[d("div",null,[e.activeTab.footer&&e.activeTab.footer.extraComponents?(r(!0),l(f,{key:0},h(e.activeTab.footer.extraComponents,(n,b)=>(r(),S(C(e.loadComponent(n).value),{key:b,parent:n},null,8,["parent"]))),128)):u("",!0)]),d("div",null,[_(F,{disabled:c.isSubmitting,onClick:i[0]||(i[0]=n=>e.submitForm()),type:"info"},{default:g(()=>[H(t.$slots,"submit-button",{},()=>[k(m(e.__("Save Settings")),1)])]),_:3},8,["disabled"])])])):u("",!0)])])])):u("",!0)}const tt=j(O,[["render",K]]);export{tt as default}; diff --git a/public/build/assets/pos-init-D6tNQ-J4.js b/public/build/assets/pos-init-Dbmh9Kot.js similarity index 99% rename from public/build/assets/pos-init-D6tNQ-J4.js rename to public/build/assets/pos-init-Dbmh9Kot.js index 29301650b..25c3d235d 100644 --- a/public/build/assets/pos-init-D6tNQ-J4.js +++ b/public/build/assets/pos-init-Dbmh9Kot.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ns-pos-dashboard-button-D9RNui2U.js","./currency-Dtag6qPd.js","./_plugin-vue_export-helper-DlAUqK2U.js","./runtime-core.esm-bundler-VrNrzzXC.js","./ns-pos-pending-orders-button-Phma0iDa.js","./bootstrap-Dea9XoG9.js","./chart-Ozef1QaY.js","./ns-prompt-popup-7xlV5yZV.js","./ns-prompt-popup-BW2hEF0p.css","./ns-pos-order-type-button-Dz59gEOp.js","./ns-pos-shipping-popup-DoTikYQ4.js","./ns-orders-preview-popup-E5E8ndto.js","./ns-pos-customers-button-BfeYzU2g.js","./ns-pos-reset-button-pAMiWKTL.js","./ns-pos-registers-button-Dk07B9tB.js"])))=>i.map(i=>d[i]); -var Z=Object.defineProperty;var ee=(n,e,t)=>e in n?Z(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var x=(n,e,t)=>ee(n,typeof e!="symbol"?e+"":e,t);import{_ as U}from"./preload-helper-C1FmrZbK.js";import{n as te,a as se,b as ie,c as z,P as re}from"./ns-pos-shipping-popup-DoTikYQ4.js";import{p as ne,a as K,b as C,d as h,P as w,F as oe,e as ae,n as b,B as k,f as M,T as G,g,h as le}from"./bootstrap-Dea9XoG9.js";import{_ as d,n as T,a as Q}from"./currency-Dtag6qPd.js";import{_ as F}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as S,o as m,c as _,a as o,t as p,F as q,b as I,e as y,f as V,n as B,g as j,w as A,h as ue,i as O,j as ce,d as $}from"./runtime-core.esm-bundler-VrNrzzXC.js";import{n as R,a as de,N as pe,b as D,c as me,d as _e}from"./ns-prompt-popup-7xlV5yZV.js";import"./ns-orders-preview-popup-E5E8ndto.js";import"./chart-Ozef1QaY.js";const he={props:["popup"],data(){return{unitsQuantities:[],loadsUnits:!1,options:null,optionsSubscriber:null}},beforeDestroy(){this.optionsSubscriber.unsubscribe()},mounted(){this.optionsSubscriber=POS.options.subscribe(n=>{this.options=n}),this.popup.params.product.$original().selectedUnitQuantity!==void 0?this.selectUnit(this.popup.params.product.$original().selectedUnitQuantity):this.popup.params.product.$original().unit_quantities!==void 0&&this.popup.params.product.$original().unit_quantities.length===1?this.selectUnit(this.popup.params.product.$original().unit_quantities[0]):(this.loadsUnits=!0,this.loadUnits()),this.popupCloser()},computed:{productName(){return this.popup.params.product.$original().name}},methods:{__:d,nsCurrency:T,popupCloser:ne,popupResolver:K,displayRightPrice(n){return POS.getSalePrice(n,this.popup.params.product.$original())},loadUnits(){C.get(`/api/products/${this.popup.params.product.$original().id}/units/quantities`).subscribe(n=>{if(n.length===0)return this.popup.close(),h.error(d("This product doesn't have any unit defined for selling. Make sure to mark at least one unit as visible.")).subscribe();this.unitsQuantities=n,this.unitsQuantities.length===1&&this.selectUnit(this.unitsQuantities[0])})},selectUnit(n){if(n.unit===null)return h.error(d('The unit attached to this product is missing or not assigned. Please review the "Unit" tab for this product.')).subscribe(),this.popup.close();this.popup.params.resolve({unit_quantity_id:n.id,unit_name:n.unit.name,$quantities:()=>n}),this.popup.close()}}},fe={class:"h-full w-full flex items-center justify-center",id:"ns-units-selector"},ye={key:0,class:"ns-box w-4/5-screen lg:w-1/3-screen overflow-hidden flex flex-col"},xe={id:"header",class:"h-16 flex justify-center items-center flex-shrink-0"},be={class:"font-bold text-primary"},ge={key:0,class:"grid grid-flow-row grid-cols-2 overflow-y-auto"},ve=["onClick"],we={class:"h-40 w-full flex items-center justify-center overflow-hidden"},Pe=["src","alt"],ke={key:1,class:"h-40 flex items-center justify-center"},Ce={class:"h-0 w-full"},Ve={class:"relative w-full flex items-center justify-center -top-10 h-20 py-2 flex-col overlay"},Te={class:"font-bold text-primary py-2 text-center"},Se={class:"text-sm font-medium text-primary"},Oe={key:1,class:"h-56 flex items-center justify-center"};function Ae(n,e,t,s,i,r){const a=S("ns-spinner");return m(),_("div",fe,[i.unitsQuantities.length>0?(m(),_("div",ye,[o("div",xe,[o("h3",be,p(r.__("{product} : Units").replace("{product}",r.productName)),1)]),i.unitsQuantities.length>0?(m(),_("div",ge,[(m(!0),_(q,null,I(i.unitsQuantities,u=>(m(),_("div",{onClick:l=>r.selectUnit(u),key:u.id,class:"ns-numpad-key info cursor-pointer border flex-shrink-0 flex flex-col items-center justify-center"},[o("div",we,[u.preview_url?(m(),_("img",{key:0,src:u.preview_url,class:"object-cover h-full",alt:u.unit.name},null,8,Pe)):y("",!0),u.preview_url?y("",!0):(m(),_("div",ke,e[0]||(e[0]=[o("i",{class:"las la-image text-primary text-6xl"},null,-1)])))]),o("div",Ce,[o("div",Ve,[o("h3",Te,p(u.unit.name)+" ("+p(u.quantity)+")",1),o("p",Se,p(r.nsCurrency(r.displayRightPrice(u))),1)])])],8,ve))),128))])):y("",!0)])):y("",!0),i.unitsQuantities.length===0?(m(),_("div",Oe,[V(a)])):y("",!0)])}const Fe=F(he,[["render",Ae]]);class je{constructor(e){this.product=e}run(){return new Promise((e,t)=>{const s=this.product;w.show(Fe,{resolve:e,reject:t,product:s})})}}class L{constructor(e){this.order=e}run(){return new Promise((e,t)=>this.order.customer===void 0?w.show(te,{resolve:e,reject:t}):e(!0))}}window.CustomerQueue=L;const qe={name:"sample-payment",props:["label","identifier"],data(){return{backValue:"0",number:parseInt(1+new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map(n=>0).join("")),order:null,settings:{},settingsSubscription:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keys:[...[7,8,9].map(n=>({identifier:n,value:n})),...[4,5,6].map(n=>({identifier:n,value:n})),...[1,2,3].map(n=>({identifier:n,value:n})),{identifier:"backspace",icon:"la-backspace"},{identifier:0,value:0},{identifier:"next",icon:"la-share"}]}},computed:{amountShortcuts(){return nsShortcuts.ns_pos_amount_shortcut!==null?nsShortcuts.ns_pos_amount_shortcut.split("|"):[]}},mounted(){this.orderSubscription=POS.order.subscribe(e=>{this.order=e}),this.settingsSubscription=POS.settings.subscribe(e=>{this.settings=e});const n=new Array(10).fill("").map((e,t)=>t);nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(n,(e,t)=>{this.inputValue({value:t})}),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",()=>this.inputValue({identifier:"backspace"})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",()=>{this.backValue===""?(this.$emit("submit"),this.backValue=0):this.inputValue({identifier:"next"})})},beforeDestroy(){nsHotPress.destroy("numpad-keys"),nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-save")},unmounted(){this.orderSubscription.unsubscribe()},methods:{__:d,nsCurrency:T,toggleDiscount(){if(this.settings.cart_discount!==void 0&&this.settings.cart_discount===!0)w.show(se,{reference:this.order,type:"cart",onSubmit:n=>{POS.updateCart(this.order,n)}});else return h.error(d("You're not allowed to add a discount on the cart.")).subscribe()},makeFullPayment(){POS.order.getValue(),w.show(R,{title:d("Confirm Full Payment"),message:d("A full payment will be made using {paymentType} for {total}").replace("{paymentType}",this.label).replace("{total}",T(this.order.total)),onAction:n=>{if(n){const e=POS.order.getValue();e.tendered0).join(""));this.backValue=(parseFloat(n.value)*e+(parseFloat(this.backValue)||0)).toString(),this.allSelected=!1},inputValue(n){n.identifier==="next"?(POS.addPayment({value:parseFloat(this.backValue/this.number),identifier:this.identifier,selected:!1,label:this.label,readonly:!1}),this.backValue="0"):n.identifier==="backspace"?this.allSelected?(this.backValue="0",this.allSelected=!1):this.backValue=this.backValue.slice(0,-1):n.value.toString().match(/^\d+$/)&&(this.allSelected?(this.backValue=n.value.toString(),this.allSelected=!1):(this.backValue+=n.value.toString(),this.mode==="percentage"&&(this.backValue=this.backValue>100?100:this.backValue))),this.backValue==="0"&&(this.backValue="")}}},Ie={class:"h-full w-full py-2"},Qe={key:0,class:"px-2 pb-2"},Ue={class:"grid grid-cols-2 gap-2"},$e={id:"details",class:"h-16 flex justify-between items-center border elevation-surface info text-xl md:text-3xl p-2"},Re={id:"paid",class:"h-16 flex justify-between items-center border elevation-surface success text-xl md:text-3xl p-2"},Ee={id:"change",class:"h-16 flex justify-between items-center border elevation-surface warning text-xl md:text-3xl p-2"},Be={id:"change",class:"col-span-2 h-16 flex justify-between items-center elevation-surface border text-xl md:text-3xl p-2"},De={class:"px-2 pb-2"},Le={class:"-mx-2 flex flex-wrap"},We={class:"pl-2 pr-1 flex-auto"},Ne={id:"numpad",class:"grid grid-flow-row grid-cols-3 gap-2 grid-rows-3",style:{padding:"1px"}},Ye=["onClick"],He={key:0},Me={class:"w-1/2 md:w-72 pr-2 pl-1"},Ge={class:"grid grid-flow-row grid-rows-1 gap-2"},ze=["onClick"];function Ke(n,e,t,s,i,r){return m(),_("div",Ie,[i.order?(m(),_("div",Qe,[o("div",Ue,[o("div",$e,[o("span",null,p(r.__("Total"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.total)),1)]),o("div",{id:"discount",onClick:e[0]||(e[0]=a=>r.toggleDiscount()),class:"cursor-pointer h-16 flex justify-between items-center border elevation-surface error text-xl md:text-3xl p-2"},[o("span",null,p(r.__("Discount"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.discount)),1)]),o("div",Re,[o("span",null,p(r.__("Paid"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.tendered)),1)]),o("div",Ee,[o("span",null,p(r.__("Change"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.change)),1)]),o("div",Be,[o("span",null,p(r.__("Screen"))+" : ",1),o("span",null,p(r.nsCurrency(i.backValue/i.number)),1)])])])):y("",!0),o("div",De,[o("div",Le,[o("div",We,[o("div",Ne,[(m(!0),_(q,null,I(i.keys,(a,u)=>(m(),_("div",{onClick:l=>r.inputValue(a),key:u,style:{margin:"-1px"},class:"ns-numpad-key text-2xl border h-16 flex items-center justify-center cursor-pointer"},[a.value!==void 0?(m(),_("span",He,p(a.value),1)):y("",!0),a.icon?(m(),_("i",{key:1,class:B(["las",a.icon])},null,2)):y("",!0)],8,Ye))),128)),o("div",{onClick:e[1]||(e[1]=a=>r.makeFullPayment()),class:"hover:bg-green-500 col-span-3 bg-success-secondary border-success-tertiary text-2xl text-white border h-16 flex items-center justify-center cursor-pointer"},p(r.__("Full Payment")),1)])]),o("div",Me,[o("div",Ge,[(m(!0),_(q,null,I(r.amountShortcuts,(a,u)=>(m(),_("div",{key:u,onClick:l=>r.increaseBy({value:a}),class:"ns-numpad-key text-2xl border h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(a)),1)],8,ze))),128))])])])])])}const W=F(qe,[["render",Ke]]),Je={name:"cash-payment",props:["identifier","label"],components:{samplePayment:W}};function Xe(n,e,t,s,i,r){const a=S("sample-payment");return m(),j(a,{identifier:t.identifier,label:t.label},null,8,["identifier","label"])}const Ze=F(Je,[["render",Xe]]),et={name:"creditcart-payment",props:["identifier"]};function tt(n,e,t,s,i,r){return m(),_("h1",null,"Credit Card")}const st=F(et,[["render",tt]]),it={name:"bank-payment",props:["identifier","label"],components:{samplePayment:W}};function rt(n,e,t,s,i,r){const a=S("sample-payment");return m(),j(a,{identifier:t.identifier,label:t.label},null,8,["identifier","label"])}const nt=F(it,[["render",rt]]),ot={name:"ns-account-payment",components:{nsNumpad:de},props:["identifier","label"],data(){return{subscription:null,screenValue:0,order:null}},methods:{__:d,nsCurrency:T,handleChange(n){this.screenValue=n},proceedAddingPayment(n){const e=parseFloat(n),t=this.order.payments;if(e<=0)return h.error(d("Please provide a valid payment amount.")).subscribe();if(t.filter(s=>s.identifier==="account-payment").length>0)return h.error(d("The customer account can only be used once per order. Consider deleting the previously used payment.")).subscribe();if(e>this.order.customer.account_amount)return h.error(d("Not enough funds to add {amount} as a payment. Available balance {balance}.").replace("{amount}",T(e)).replace("{balance}",T(this.order.customer.account_amount))).subscribe();POS.addPayment({value:e,identifier:"account-payment",selected:!1,label:this.label,readonly:!1}),this.order.customer.account_amount-=e,POS.selectCustomer(this.order.customer)},proceedFullPayment(){if(this.order.payments.filter(e=>e.identifier==="account-payment").length>0)return h.error(d("The customer account can only be used once per order. Consider deleting the previously used payment.")).subscribe();this.proceedAddingPayment(this.order.total),this.$emit("submit")},makeFullPayment(){Popup.show(R,{title:d("Confirm Full Payment"),message:d("You're about to use {amount} from the customer account to make a payment. Would you like to proceed ?").replace("{amount}",T(this.order.total)),onAction:n=>{n&&this.proceedFullPayment()}})}},mounted(){this.subscription=POS.order.subscribe(n=>this.order=n)},unmounted(){this.subscription.unsubscribe()}},at={class:"h-full w-full py-2"},lt={key:0,class:"px-2 pb-2"},ut={class:"grid grid-cols-2 gap-2"},ct={id:"details",class:"h-16 flex justify-between items-center elevation-surface border info text-xl md:text-3xl p-2"},dt={id:"paid",class:"h-16 flex justify-between items-center elevation-surface success border text-xl md:text-3xl p-2"},pt={id:"change",class:"h-16 flex justify-between items-center elevation-surface warning border text-xl md:text-3xl p-2"},mt={id:"change",class:"col-span-2 h-16 flex justify-between items-center elevation-surface border success text-xl md:text-3xl p-2"},_t={id:"change",class:"col-span-2 h-16 flex justify-between items-center elevation-surface border text-primary text-xl md:text-3xl p-2"},ht={class:"px-2 pb-2"},ft={class:"-mx-2 flex flex-wrap"},yt={class:"pl-2 pr-1 flex-auto"},xt={class:"w-1/2 md:w-72 pr-2 pl-1"},bt={class:"grid grid-flow-row grid-rows-1 gap-2"};function gt(n,e,t,s,i,r){const a=S("ns-numpad");return m(),_("div",at,[i.order?(m(),_("div",lt,[o("div",ut,[o("div",ct,[o("span",null,p(r.__("Total"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.total)),1)]),o("div",{id:"discount",onClick:e[0]||(e[0]=u=>n.toggleDiscount()),class:"cursor-pointer h-16 flex justify-between items-center elevation-surface error border text-xl md:text-3xl p-2"},[o("span",null,p(r.__("Discount"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.discount)),1)]),o("div",dt,[o("span",null,p(r.__("Paid"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.tendered)),1)]),o("div",pt,[o("span",null,p(r.__("Change"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.change)),1)]),o("div",mt,[o("span",null,p(r.__("Current Balance"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.customer.account_amount)),1)]),o("div",_t,[o("span",null,p(r.__("Screen"))+" : ",1),o("span",null,p(r.nsCurrency(i.screenValue)),1)])])])):y("",!0),o("div",ht,[o("div",ft,[o("div",yt,[V(a,{floating:!0,onChanged:e[2]||(e[2]=u=>r.handleChange(u)),onNext:e[3]||(e[3]=u=>r.proceedAddingPayment(u))},{"numpad-footer":A(()=>[o("div",{onClick:e[1]||(e[1]=u=>r.makeFullPayment()),class:"hover:bg-success-tertiary col-span-3 bg-success-secondary text-2xl text-white border border-success-secondary h-16 flex items-center justify-center cursor-pointer"},p(r.__("Full Payment")),1)]),_:1})]),o("div",xt,[o("div",bt,[o("div",{onClick:e[4]||(e[4]=u=>n.increaseBy({value:100})),class:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(100)),1)]),o("div",{onClick:e[5]||(e[5]=u=>n.increaseBy({value:500})),class:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(500)),1)]),o("div",{onClick:e[6]||(e[6]=u=>n.increaseBy({value:1e3})),class:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(1e3)),1)])])])])])])}const vt=F(ot,[["render",gt]]),wt={name:"ns-pos-payment",props:["popup"],data(){return{paymentTypesSubscription:null,paymentsType:[],activePayment:null,order:null,showPayment:!1,orderSubscription:null,currentPaymentComponent:null,activePaymentSubscription:null}},computed:{expectedPayment(){const n=this.order.customer.group.minimal_credit_payment;return this.order.total*n/100}},mounted(){this.orderSubscription=POS.order.subscribe(n=>{this.order=ue(n)}),this.activePaymentSubscription=POS.selectedPaymentType.subscribe(n=>{this.activePayment=n,n!==null&&this.loadPaymentComponent(n)}),this.paymentTypesSubscription=POS.paymentsType.subscribe(n=>{this.paymentsType=n,n.filter(e=>{e.selected&&POS.selectedPaymentType.next(e)})}),nsHooks.doAction("ns-pos-payment-mounted",this)},unmounted(){this.activePaymentSubscription.unsubscribe(),this.paymentTypesSubscription.unsubscribe(),this.orderSubscription.unsubscribe(),nsHooks.doAction("ns-pos-payment-destroyed",this)},methods:{__:d,nsCurrency:T,resolveIfQueued:K,loadPaymentComponent(n){switch(n.identifier){case"cash-payment":this.currentPaymentComponent=shallowRef(Ze);break;case"creditcard-payment":this.currentPaymentComponent=shallowRef(st);break;case"bank-payment":this.currentPaymentComponent=shallowRef(nt);break;case"account-payment":this.currentPaymentComponent=shallowRef(vt);break;default:this.currentPaymentComponent=shallowRef(W);break}},async selectPayment(){try{const n=await new Promise((e,t)=>{w.show(pe,{label:d("Select Payment Gateway"),options:this.paymentsType.map(s=>({label:s.label,value:s.identifier})),value:this.activePayment.identifier,resolve:e,reject:t})});this.select(this.paymentsType.filter(e=>e.identifier===n[0].value)[0])}catch{}},select(n){this.showPayment=!1,POS.setPaymentActive(n)},closePopup(){console.log(this.popup),this.popup.close(),POS.selectedPaymentType.next(null)},deletePayment(n){POS.removePayment(n)},selectPaymentAsActive(n){this.select(this.paymentsType.filter(e=>e.identifier===n.target.value)[0])},async submiAsUnpaid(){let n;try{n=await new Promise(t=>{const s=w.show(R,{title:d("Save As Unpaid"),message:d("Are you sure you want to save this order as unpaid?"),onAction:i=>{t(i)}})})}catch(t){h.error(t.message||d("An unexpected error occured while saving the order as unpaid.")).subscribe(),console.log(t)}if(!n)return!1;const e=w.show(D);try{POS.order.next({...POS.order.getValue(),payments:[]}),POS.refreshCart();const t=await new Promise((s,i)=>{POS.proceedSubmitting(POS.order.getValue(),s,i)});e.close(),this.popup.close(),h.success(t.message).subscribe(),POS.printOrderReceipt(t.data.order,"silent")}catch(t){e.close(),h.error(t.message||d("An error occured while saving the order as unpaid.")).subscribe()}},getPaymentLabel(n){const e=this.paymentsType.filter(t=>t.identifier===n.identifier)[0];return e?e.label:n.identifier},submitOrder(n={}){const e=w.show(D);try{const t={...POS.order.getValue(),...n};POS.submitOrder(t).then(s=>{e.close(),h.success(s.message).subscribe(),POS.printOrderReceipt(s.data.order,"silent"),this.popup.close()},s=>{e.close(),h.error(s.message).subscribe()})}catch(t){e.close(),h.error(t.message||d("An unexpected error occured while submitting the order.")).subscribe(),console.log(t)}}}},Pt={key:0,id:"ns-payment-popup",class:"w-screen h-screen p-8 flex overflow-hidden"},kt={class:"flex flex-col flex-auto lg:flex-row shadow-xl"},Ct={class:"w-full lg:w-56 lg:h-full flex justify-between px-2 lg:px-0 lg:block items-center lg:items-start"},Vt={class:"lg:hidden text-xl text-center my-4 font-bold lg:my-8"},Tt={key:0},St={class:"hidden lg:block"},Ot=["onClick"],At={class:"px-2 rounded-full h-8 w-8 flex items-center justify-center ns-label"},Ft={class:"overflow-hidden flex flex-col flex-auto"},jt={class:"flex flex-col flex-auto overflow-hidden"},qt={class:"h-12 hidden items-center justify-between lg:flex"},It={class:"text-xl hidden lg:block text-center my-4 font-bold lg:my-8"},Qt={key:0,class:"hidden-md"},Ut={class:"px-2"},$t={key:0,class:"flex flex-auto ns-payment-wrapper overflow-y-auto"},Rt={key:1,class:"flex flex-auto items-center justify-center bg-white"},Et={class:"font-bold text-center text-3xl"},Bt={class:"text-center"},Dt={key:2,class:"flex flex-auto ns-payment-wrapper overflow-y-auto p-2 flex-col"},Lt={class:"text-center font-bold py-2"},Wt={class:"flex-auto"},Nt={key:0,class:"p-2 flex justify-center mb-2 items-center"},Yt={class:"font-semibold"},Ht={class:"flex items-center"},Mt=["onClick"],Gt={key:1,class:"default rounded-full h-8 w-8 flex items-center justify-center ml-2"},zt={key:0,class:"flex lg:hidden ns-payment-buttons"},Kt={class:"text-sm"},Jt={class:"text-sm"},Xt={class:"text-sm"},Zt={class:"text-sm mr-1"},es={class:"px-2 rounded-full h-6 w-6 text-xs flex items-center justify-center ns-label"},ts={key:1,class:"flex-col sm:flex-row w-full ns-payment-footer justify-end p-2 hidden lg:flex"},ss={class:"flex justify-end"},is={key:1,class:"flex -mx-2"},rs={class:"px-2"},os={key:0,class:"px-2"};function as(n,e,t,s,i,r){const a=S("ns-close-button"),u=S("ns-button");return i.order?(m(),_("div",Pt,[o("div",kt,[o("div",Ct,[o("h3",Vt,[O(p(r.__("Gateway"))+" ",1),i.activePayment?(m(),_("span",Tt,": "+p(i.activePayment.label),1)):y("",!0)]),e[12]||(e[12]=o("div",{class:"h-16 hidden lg:block"},null,-1)),o("ul",St,[(m(!0),_(q,null,I(i.paymentsType,l=>(m(),_("li",{onClick:c=>r.select(l),class:B([l.selected&&!i.showPayment?"ns-visible":"","cursor-pointer ns-payment-gateway py-2 px-3"]),key:l.identifier},p(l.label),11,Ot))),128)),i.paymentsType.length>0?(m(),_("li",{key:0,onClick:e[0]||(e[0]=l=>i.showPayment=!0),class:B([i.showPayment?"ns-visible":"","cursor-pointer py-2 px-3 ns-payment-list border-t mt-4 flex items-center justify-between"])},[o("span",null,p(r.__("Payment List")),1),o("span",At,p(i.order.payments.length),1)],2)):y("",!0)]),V(a,{class:"lg:hidden",onClick:e[1]||(e[1]=l=>r.closePopup())})]),o("div",Ft,[o("div",jt,[o("div",qt,[o("div",null,[o("h3",It,[O(p(r.__("Gateway"))+" ",1),i.activePayment?(m(),_("span",Qt,": "+p(i.activePayment.label),1)):y("",!0)])]),o("div",Ut,[V(a,{onClick:e[2]||(e[2]=l=>r.closePopup())})])]),!i.showPayment&&i.activePayment?(m(),_("div",$t,[(m(),j(ce(i.currentPaymentComponent),{onSubmit:e[3]||(e[3]=l=>r.submitOrder()),label:i.activePayment.label,identifier:i.activePayment.identifier},null,40,["label","identifier"]))])):y("",!0),i.activePayment?y("",!0):(m(),_("div",Rt,[o("div",null,[o("h3",Et,p(r.__("Unable to Proceed")),1),o("p",Bt,p(r.__("Your system doesn't have any valid Payment Type. Consider creating one and try again.")),1)])])),i.showPayment?(m(),_("div",Dt,[o("h3",Lt,p(r.__("List Of Payments")),1),o("ul",Wt,[i.order.payments.length===0?(m(),_("li",Nt,[o("h3",Yt,p(r.__("No Payment added.")),1)])):y("",!0),(m(!0),_(q,null,I(i.order.payments,(l,c)=>(m(),_("li",{key:c,class:"p-2 flex justify-between mb-2 items-center"},[o("span",null,p(r.getPaymentLabel(l)),1),o("div",Ht,[o("span",null,p(r.nsCurrency(l.value)),1),l.id?y("",!0):(m(),_("button",{key:0,onClick:f=>r.deletePayment(l),class:"error rounded-full h-8 w-8 flex items-center justify-center ml-2"},e[13]||(e[13]=[o("i",{class:"las la-trash-alt"},null,-1)]),8,Mt)),l.id?(m(),_("button",Gt,e[14]||(e[14]=[o("i",{class:"las la-lock"},null,-1)]))):y("",!0)])]))),128))])])):y("",!0)]),i.activePayment?(m(),_("div",zt,[o("button",{onClick:e[4]||(e[4]=l=>r.selectPayment()),class:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 font-bold ns-payment-type-button"},[o("span",Kt,p(r.__("Payment Type")),1)]),i.order.tendered>=i.order.total?(m(),_("button",{key:0,onClick:e[5]||(e[5]=l=>r.submitOrder()),class:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 ns-submit-button font-bold"},[o("span",Jt,p(r.__("Submit Payment")),1)])):y("",!0),i.order.tenderedr.submitOrder({payment_status:"unpaid"})),class:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 ns-layaway-button font-bold"},[o("span",Xt,p(r.__("Layaway")),1)])):y("",!0),o("button",{onClick:e[7]||(e[7]=l=>i.showPayment=!0),class:"w-1/3 flex ns-payment-button text-2xl flex-auto h-12 items-center justify-center font-bold"},[o("span",Zt,p(r.__("Payment List")),1),o("span",es,p(i.order.payments.length),1)])])):y("",!0),i.activePayment?(m(),_("div",ts,[o("div",ss,[i.order.tendered>=i.order.total?(m(),j(u,{key:0,onClick:e[8]||(e[8]=l=>r.submitOrder()),type:i.order.tendered>=i.order.total?"success":"info"},{default:A(()=>[o("span",null,[e[15]||(e[15]=o("i",{class:"las la-cash-register"},null,-1)),O(" "+p(r.__("Submit Payment")),1)])]),_:1},8,["type"])):y("",!0),i.order.tenderedr.submitOrder({payment_status:"unpaid"})),type:i.order.tendered>=i.order.total?"success":"info"},{default:A(()=>[o("span",null,[e[16]||(e[16]=o("i",{class:"las la-bookmark"},null,-1)),O(" "+p(r.__("Layaway"))+" — "+p(r.nsCurrency(r.expectedPayment)),1)])]),_:1},8,["type"])):y("",!0),i.order.tendered>0?(m(),j(u,{key:1,onClick:e[10]||(e[10]=l=>r.submitOrder({payment_status:"unpaid"})),type:"info"},{default:A(()=>[o("span",null,[e[17]||(e[17]=o("i",{class:"las la-save"},null,-1)),O(" "+p(r.__("Update")),1)])]),_:1})):y("",!0)]),i.order.tendered===0?(m(),_("div",os,[V(u,{onClick:e[11]||(e[11]=l=>r.submiAsUnpaid()),type:"info"},{default:A(()=>[o("span",null,[e[18]||(e[18]=o("i",{class:"las la-hands-helping"},null,-1)),O(" "+p(r.__("Save As Unpaid")),1)])]),_:1})])):y("",!0)])):y("",!0)])])):y("",!0)])])])):y("",!0)}const ls=F(wt,[["render",as]]);class N{constructor(e){this.order=e}run(){return new Promise((e,t)=>{w.show(ls,{resolve:e,reject:t,order:this.order})})}}window.PaymentQueue=N;class Y{constructor(e){this.order=e}run(){return new Promise((e,t)=>this.order.products.length===0?(h.error(d("You need to provide some products before proceeding.")).subscribe(),t(!1)):e(!0))}}window.ProductsQueue=Y;class H{constructor(e){this.order=e}run(){return new Promise((e,t)=>{if(this.order.type===void 0)return w.show(ie,{resolve:e,reject:t});e(!0)})}}window.TypeQueue=H;class us{constructor(){x(this,"screenIs");this.detect()}detect(){window.innerWidth<544?this.screenIs="xs":window.innerWidth>=544&&window.innerWidth<768?this.screenIs="sm":window.innerWidth>=768&&window.innerWidth<992?this.screenIs="md":window.innerWidth>=992&&window.innerWidth<1200?this.screenIs="lg":window.innerWidth>=1200&&(this.screenIs="xl")}is(e){return e===void 0?this.screenIs:this.screenIs===e}}const cs={name:"ns-pos-layaway-popup",props:["popup"],data(){return{fields:[],instalments:[],formValidation:new oe,subscription:null,totalPayments:0}},mounted(){this.loadFields()},updated(){setTimeout(()=>{document.querySelector(".is-popup #total_instalments").addEventListener("change",()=>{const n=this.formValidation.extractFields(this.fields).total_instalments;this.generatePaymentFields(n)}),document.querySelector(".is-popup #total_instalments").addEventListener("focus",()=>{document.querySelector(".is-popup #total_instalments").select()})},200)},computed:{expectedPayment(){const n=this.order.customer.group.minimal_credit_payment;return nsRawCurrency(this.order.total*n/100)},order(){return this.popup.params.order.instalments=this.popup.params.order.instalments.map(n=>{for(let e in n)if(typeof n[e]!="object"){if(e==="date"){const t={type:"date",name:e,label:d("Date"),disabled:n.paid===1,value:moment(n.date).format("YYYY-MM-DD")};n[e]=t}else if(e==="amount"){const t={type:"number",name:e,label:d("Amount"),disabled:n.paid===1,value:n.amount};n[e]=t}else if(!["paid","id"].includes(e)){const t={type:"hidden",name:e,value:n[e]};n[e]=t}}return n}),this.popup.params.order}},unmounted(){},methods:{__:d,nsCurrency:T,refreshTotalPayments(){if(this.order.instalments.length>0){const n=nsRawCurrency(this.order.instalments.map(e=>parseFloat(e.amount.value)||0).reduce((e,t)=>parseFloat(e)+parseFloat(t)));this.totalPayments=this.order.total-n}else this.totalPayments=0},removeInstalment(n){const e=this.order.instalments.indexOf(n);this.order.instalments.splice(e,1),this.$forceUpdate()},generatePaymentFields(n){this.order.instalments=new Array(parseInt(n)).fill("").map((e,t)=>({date:{type:"date",name:"date",label:"Date",value:t===0?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:t===0?this.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:this.expectedPayment>0&&t===0}})),this.$forceUpdate(),this.refreshTotalPayments()},close(){this.popup.params.reject({status:"error",message:d("You must define layaway settings before proceeding.")}),this.popup.close()},skipInstalments(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.popup.close(),POS.order.next(this.order);const{resolve:n,reject:e}=this.popup.params;return n({order:this.order,skip_layaway:!0})},updateOrder(){if(this.order.instalments.length===0)return h.error(d("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach(l=>this.formValidation.validateField(l)),!this.formValidation.fieldsValid(this.fields))return h.error(d("Unable to process, the form is not valid")).subscribe();this.$forceUpdate();const n=this.order.instalments.map(l=>({amount:parseFloat(l.amount.value),date:l.date.value})),e=nsRawCurrency(n.map(l=>l.amount).reduce((l,c)=>parseFloat(l)+parseFloat(c)));if(n.filter(l=>l.date===void 0||l.date==="").length>0)return h.error(d("One or more instalments has an invalid date.")).subscribe();if(n.filter(l=>!(l.amount>0)).length>0)return h.error(d("One or more instalments has an invalid amount.")).subscribe();if(n.filter(l=>moment(l.date).isBefore(ns.date.moment.startOf("day"))).length>0)return h.error(d("One or more instalments has a date prior to the current date.")).subscribe();const t=n.filter(l=>moment(l.date).isSame(ns.date.moment.startOf("day"),"day"));let s=0;if(t.forEach(l=>{s+=parseFloat(l.amount)}),s{const f=moment(l.date),P=moment(c.date);return f.isBefore(P)?-1:f.isAfter(P)?1:0});const i=this.formValidation.extractFields(this.fields);i.final_payment_date=n.reverse()[0].date,i.total_instalments=n.length;const r={...this.popup.params.order,...i,instalments:n},{resolve:a,reject:u}=this.popup.params;return this.popup.close(),POS.order.next(r),a({order:r,skip_layaway:!1})},loadFields(){C.get("/api/fields/ns.layaway").subscribe(n=>{this.fields=this.formValidation.createFields(n),this.fields.forEach(e=>{e.name==="total_instalments"&&(e.value=this.order.total_instalments||0)})})}}},ds={class:"shadow-lg h-95vh md:h-5/6-screen lg:h-5/6-screen w-95vw md:w-4/6-screen lg:w-3/6-screen ns-box flex flex-col"},ps={class:"p-2 border-b ns-box-header flex justify-between items-center"},ms={class:"font-semibold"},_s={class:"p-2 flex-auto flex flex-col relative overflow-y-auto"},hs={key:0,class:"absolute h-full w-full flex items-center justify-center"},fs={class:"p-2 elevation-surface info mb-2 text-center text-2xl font-bold flex justify-between"},ys={class:"flex flex-col flex-auto overflow-hidden"},xs={class:"border-b ns-box-body"},bs={class:"text-2xl flex justify-between py-2 text-primary"},gs={class:"text-sm"},vs={class:"p-2 mb-2 text-center bg-green-200 text-green-700"},ws={class:"flex-auto overflow-y-auto"},Ps={class:"flex flex-auto"},ks={class:"px-1 w-full md:w-1/2"},Cs={class:"px-1 w-full md:w-1/2"},Vs={class:"flex items-center"},Ts=["onClick"],Ss={key:0,class:"my-2"},Os={class:"p-2 elevation-surface border text-primary text-center"},As={class:"p-2 flex border-t ns-box-footer justify-between flex-shrink-0"},Fs={class:"md:-mx-1 flex flex-col md:flex-row"},js={class:"md:px-1"},qs={class:"md:-mx-1 flex flex-col md:flex-row"},Is={class:"md:px-1"},Qs={class:"md:px-1"};function Us(n,e,t,s,i,r){const a=S("ns-close-button"),u=S("ns-spinner"),l=S("ns-field"),c=S("ns-button");return m(),_("div",ds,[o("div",ps,[o("h3",ms,p(r.__("Layaway Parameters")),1),o("div",null,[V(a,{onClick:e[0]||(e[0]=f=>r.close())})])]),o("div",_s,[i.fields.length===0?(m(),_("div",hs,[V(u)])):y("",!0),o("div",fs,[o("span",null,p(r.__("Minimum Payment")),1),o("span",null,p(r.nsCurrency(r.expectedPayment)),1)]),o("div",null,[(m(!0),_(q,null,I(i.fields,(f,P)=>(m(),j(l,{field:f,key:P},null,8,["field"]))),128))]),o("div",ys,[o("div",xs,[o("h3",bs,[o("span",null,p(r.__("Instalments & Payments")),1),o("p",null,[o("span",gs,"("+p(r.nsCurrency(i.totalPayments))+")",1),o("span",null,p(r.nsCurrency(n.total)),1)])]),o("p",vs,p(r.__("The final payment date must be the last within the instalments.")),1)]),o("div",ws,[(m(!0),_(q,null,I(r.order.instalments,(f,P)=>(m(),_("div",{class:"flex w-full -mx-1 py-2",key:P},[o("div",Ps,[o("div",ks,[V(l,{onChange:e[1]||(e[1]=v=>r.refreshTotalPayments()),field:f.date},null,8,["field"])]),o("div",Cs,[V(l,{onChange:e[2]||(e[2]=v=>r.refreshTotalPayments()),field:f.amount},null,8,["field"])])]),o("div",Vs,[o("button",{onClick:v=>r.removeInstalment(f),class:"items-center flex justify-center h-8 w-8 rounded border text-primary ns-inset-button error"},e[6]||(e[6]=[o("i",{class:"las la-times"},null,-1)]),8,Ts)])]))),128)),r.order.instalments.length===0?(m(),_("div",Ss,[o("p",Os,p(r.__("There is no instalment defined. Please set how many instalments are allowed for this order")),1)])):y("",!0)])])]),o("div",As,[o("div",Fs,[o("div",js,[V(c,{onClick:e[3]||(e[3]=f=>r.skipInstalments()),type:"info"},{default:A(()=>[O(p(r.__("Skip Instalments")),1)]),_:1})])]),o("div",qs,[o("div",Is,[V(c,{onClick:e[4]||(e[4]=f=>r.close()),type:"error"},{default:A(()=>[O(p(r.__("Cancel")),1)]),_:1})]),o("div",Qs,[V(c,{onClick:e[5]||(e[5]=f=>r.updateOrder()),type:"info"},{default:A(()=>[O(p(r.__("Proceed")),1)]),_:1})])])])])}const J=F(cs,[["render",Us]]),$s=window.nsPosDashboardButton=$(()=>U(()=>import("./ns-pos-dashboard-button-D9RNui2U.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),Rs=window.nsPosPendingOrderButton=$(()=>U(()=>import("./ns-pos-pending-orders-button-Phma0iDa.js"),__vite__mapDeps([4,5,1,6,3,7,2,8]),import.meta.url)),Es=window.nsPosOrderTypeButton=$(()=>U(()=>import("./ns-pos-order-type-button-Dz59gEOp.js"),__vite__mapDeps([9,5,1,6,3,10,7,2,8,11]),import.meta.url)),Bs=window.nsPosCustomersButton=$(()=>U(()=>import("./ns-pos-customers-button-BfeYzU2g.js"),__vite__mapDeps([12,5,1,6,3,10,7,2,8,11]),import.meta.url)),Ds=window.nsPosResetButton=$(()=>U(()=>import("./ns-pos-reset-button-pAMiWKTL.js"),__vite__mapDeps([13,5,1,6,3,7,2,8]),import.meta.url)),Ls=window.nsPosCashRegister=$(()=>U(()=>import("./ns-pos-registers-button-Dk07B9tB.js"),__vite__mapDeps([14,5,1,6,3,7,2,8]),import.meta.url));window.nsLayawayPopup=J;window.nsPosShippingPopup=z;window.CustomerQueue=L;window.PaymentQueue=N;window.ProductsQueue=Y;window.TypeQueue=H;let X=class{constructor(){x(this,"_cartButtons");x(this,"_products");x(this,"_breadcrumbs");x(this,"_customers");x(this,"_settings");x(this,"_types");x(this,"_orderTypeProcessQueue",[]);x(this,"_paymentsType");x(this,"_order");x(this,"_screen");x(this,"_holdPopupEnabled",!0);x(this,"_initialQueue",[]);x(this,"_options");x(this,"_responsive",new us);x(this,"_visibleSection");x(this,"_isSubmitting",!1);x(this,"_processingAddQueue",!1);x(this,"_selectedPaymentType");x(this,"_userPermissions");x(this,"print");x(this,"defaultOrder",()=>({discount_type:null,title:"",discount:0,register_id:this.get("register")?this.get("register").id:void 0,discount_percentage:0,subtotal:0,total:0,coupons:[],total_coupons:0,tendered:0,note:"",note_visibility:"hidden",tax_group_id:void 0,tax_type:void 0,taxes:[],tax_groups:[],payment_status:void 0,customer_id:void 0,change:0,total_products:0,shipping:0,tax_value:0,total_tax_value:0,products_tax_value:0,shipping_rate:0,shipping_type:void 0,customer:void 0,type:void 0,products:[],instalments:[],payments:[],addresses:{shipping:void 0,billing:void 0}}));x(this,"addToCartQueue",[je,re]);this.initialize(),this.print=new ae({urls:systemUrls,options:systemOptions})}get screen(){return this._screen}get visibleSection(){return this._visibleSection}get paymentsType(){return this._paymentsType}get selectedPaymentType(){return this._selectedPaymentType}get order(){return this._order}get types(){return this._types}get products(){return this._products}get customers(){return this._customers}get options(){return this._options}get orderTypeQueue(){return this._orderTypeProcessQueue}get settings(){return this._settings}get breadcrumbs(){return this._breadcrumbs}get initialQueue(){return this._initialQueue}get responsive(){return this._responsive}get processingAddQueue(){return this._processingAddQueue}get cartButtons(){return this._cartButtons}async reset(){return new Promise(async(e,t)=>{try{this._isSubmitting=!1,this.order.next(this.defaultOrder()),this.products.next([]),this._customers.next([]),this._breadcrumbs.next([]),this._cartButtons.next({}),this.defineCurrentScreen(),this.setHoldPopupEnabled(!0),b.doAction("ns-before-cart-reset"),await this.processInitialQueue(),b.doAction("ns-after-cart-changed"),b.doAction("ns-after-cart-reset"),e(!0)}catch(s){t(s)}})}initialize(){this._userPermissions=new k([]),this._products=new k([]),this._customers=new k([]),this._types=new k([]),this._breadcrumbs=new k([]),this._screen=new k(""),this._paymentsType=new k([]),this._visibleSection=new k("both"),this._options=new k({}),this._settings=new k({}),this._order=new k(this.defaultOrder()),this._selectedPaymentType=new k(null),this._cartButtons=new k({}),this._orderTypeProcessQueue=[{identifier:"handle.delivery-order",promise:e=>new Promise((t,s)=>e&&e.identifier==="delivery"?w.show(z,{resolve:t,reject:s}):t({status:"success",message:"Proceed"}))}],this.initialQueue.push(()=>new Promise((e,t)=>{C.get("/api/users/permissions/").subscribe({next:s=>{this._userPermissions.next(s),e(s)},error:s=>{t(s)}})})),this.initialQueue.push(()=>new Promise((e,t)=>{const s=this.options.getValue(),i=this.order.getValue();return i.tax_type=s.ns_pos_tax_type,s.ns_pos_tax_group!==!1&&(i.tax_group_id=s.ns_pos_tax_group,this.order.next(i)),e({status:"success",message:"tax group assignated"})})),this.initialQueue.push(()=>new Promise((e,t)=>{const s=this.options.getValue();return this.order.getValue(),s.ns_customers_default!==!1&&C.get(`/api/customers/${s.ns_customers_default}`).subscribe({next:i=>{this.selectCustomer(i),e({status:"success",message:d("The customer has been loaded")})},error:i=>{M.error(d("An error has occured"),d("Unable to select the default customer. Looks like the customer no longer exists. Consider changing the default customer on the settings."),{actions:{readMore:{label:d("Read More"),onClick:r=>{r.close(),window.open("https://my.nexopos.com/en/documentation/troubleshooting/no-default-customer","_blank")}},close:{label:d("Close")}}}),t(i)}}),e({status:"success",message:"no default customer is selected."})})),b.addAction("ns-after-cart-changed","listen-add-to-cart",()=>this.refreshCart()),this.types.subscribe(e=>{const t=Object.values(e).filter(s=>s.selected);if(t.length>0){const s=this.order.getValue();s.type=t[0],this.order.next(s)}}),window.addEventListener("resize",()=>{this._responsive.detect(),this.defineCurrentScreen()}),window.onbeforeunload=()=>{if(this.products.getValue().length>0)return d("Some products has been added to the cart. Would youl ike to discard this order ?")}}getSalePrice(e){let t=0;return this.options.getValue().ns_pos_price_with_tax==="yes"?t=Q(e.sale_price_with_tax):t=Q(e.sale_price_without_tax),b.applyFilters("ns-pos-product-sale-price",t,e)}getCustomPrice(e){let t=0;return this.options.getValue().ns_pos_price_with_tax==="yes"?t=Q(e.custom_price_with_tax):t=Q(e.custom_price_without_tax),b.applyFilters("ns-pos-product-custom-price",t,e)}getWholesalePrice(e){let t=0;return this.options.getValue().ns_pos_price_with_tax==="yes"?t=Q(e.wholesale_price_with_tax):t=Q(e.wholesale_price_without_tax),b.applyFilters("ns-pos-product-wholesale-price",t,e)}setHoldPopupEnabled(e=!0){this._holdPopupEnabled=e}getHoldPopupEnabled(){return this._holdPopupEnabled}async processInitialQueue(){return new Promise(async(e,t)=>{for(let s in this._initialQueue)try{const i=await Promise.race([this._initialQueue[s](),new Promise((r,a)=>setTimeout(()=>a(new Error("Timeout")),6e4))])}catch(i){t(i),h.error(i.message).subscribe()}e(!0)})}removeCoupon(e){const t=this.order.getValue(),s=t.coupons,i=s.indexOf(e);s.splice(i,1),t.coupons=s,this.order.next(t)}pushCoupon(e){const t=this.order.getValue();t.coupons.forEach(s=>{if(s.code===e.code){const i=d("This coupon is already added to the cart");throw h.error(i).subscribe(),i}}),t.coupons.push(e),this.order.next(t),this.refreshCart()}get header(){const e={buttons:{nsPosDashboardButton:$s,nsPosPendingOrderButton:Rs,nsPosOrderTypeButton:Es,nsPosCustomersButton:Bs,nsPosResetButton:Ds}};return this.options.getValue().ns_pos_registers_enabled==="yes"&&(e.buttons.nsPosCashRegister=Ls),b.doAction("ns-pos-header",e),e}defineOptions(e){this._options.next(e)}defineCurrentScreen(){this._visibleSection.next(["xs","sm"].includes(this._responsive.is())?"grid":"both"),this._screen.next(this._responsive.is())}changeVisibleSection(e){["both","cart","grid"].includes(e)&&(["cart","both"].includes(e)&&this.refreshCart(),this._visibleSection.next(e))}addPayment(e){if(e.value>0){const t=this._order.getValue();return t.payments.push(e),this._order.next(t),this.computePaid()}return h.error("Invalid amount.").subscribe()}removePayment(e){if(e.id!==void 0)return h.error(d("Unable to delete a payment attached to the order.")).subscribe();const t=this._order.getValue(),s=t.payments.indexOf(e);t.payments.splice(s,1),this._order.next(t),nsEvent.emit({identifier:"ns.pos.remove-payment",value:e}),this.updateCustomerAccount(e),this.computePaid()}updateCustomerAccount(e){if(e.identifier==="account-payment"){const t=this.order.getValue().customer;t.account_amount+=e.value,this.selectCustomer(t)}}getPriceWithoutTax(e,t,s){if(s==="inclusive")return G.computeInclusive(e,t);if(s==="exclusive")return e}getPriceWithTax(e,t,s){if(s==="inclusive")return e;if(s==="exclusive")return G.computeExclusive(e,t)}getVatValue(e,t,s){return s==="inclusive"?e-this.getPriceWithoutTax(e,t,s):s==="exclusive"?this.getPriceWithTax(e,t,s)-e:0}computeTaxes(){return new Promise((e,t)=>{let s=this.order.getValue();if(s=this.sumProductsTaxes(s),s.tax_group_id===void 0||s.tax_group_id===null)return this.computeOrderTaxes(s),e({data:{order:s},status:"success"});const i=s.tax_groups;if(Object.values(i).length>0)return i[s.tax_group_id]!==void 0&&(s=this.computeOrderTaxGroup(s,i[s.tax_group_id])),e({status:"success",data:{tax:i[s.tax_group_id],order:s}});if(![void 0,null].includes(s.tax_group_id)&&s.tax_group_id.toString().length>0)C.get(`/api/taxes/groups/${s.tax_group_id}`).subscribe({next:r=>(s=this.computeOrderTaxGroup(s,r),e({status:"success",data:{tax:r,order:s}})),error:r=>t(r)});else return t({status:"error",message:d("No tax group assigned to the order")})})}computeOrderTaxGroup(e,t){const s=t.taxes.map(r=>parseFloat(r.rate)).reduce((r,a)=>r+a),i=this.getVatValue(e.subtotal-e.discount,s,e.tax_type);if(t.taxes=t.taxes.map(r=>{const a=g(g(r.rate).divide(s).done()).multiply(100).done();return{id:r.id,tax_id:r.tax_id,name:r.name,rate:parseFloat(r.rate),tax_value:g(g(i).multiply(a).done()).divide(100).done()}}),t.taxes.length===0){h.error(d("The selected tax group doesn't have any assigned sub taxes. This might cause wrong figures."),d("Proceed"),{duration:!1}).subscribe();return}return e.tax_groups=e.tax_groups||[],e.taxes=t.taxes,e.tax_groups[t.id]=t,this.computeOrderTaxes(e)}computeOrderTaxes(e){const t=this.options.getValue().ns_pos_vat,s=this.options.getValue().ns_pos_price_with_tax==="yes";return["flat_vat","variable_vat","products_variable_vat","products_flat_vat"].includes(t)&&e.taxes&&e.taxes.length>0&&(e.tax_value+=e.taxes.map(i=>i.tax_value).reduce((i,r)=>i+r)),e.total_tax_value=e.tax_value,["products_variable_vat","products_flat_vat","products_vat"].includes(t)&&!s&&(e.total_tax_value=e.products_tax_value+e.tax_value),e}sumProductsTaxes(e){const t=this.products.getValue(),s=this.options.getValue().ns_pos_vat;if(["products_flat_vat","products_variable_vat","products_vat"].includes(s)){const i=t.map(r=>r.total_tax_value);i.length>0&&(e.products_tax_value=i.reduce((r,a)=>r+a))}return e.products=t,e.total_products=t.length,e}canProceedAsLaidAway(e){return new Promise(async(t,s)=>{const i=e.customer.group.minimal_credit_payment,r=g(e.total).multiply(i).done();let a=g(r).divide(100).done();a=parseFloat(a);try{const u=await new Promise((l,c)=>{w.show(J,{order:e,reject:c,resolve:l})});if(u.order.instalments.length===0&&u.order.tenderedP.amount>=a&&le(P.date).isSame(ns.date.moment.startOf("day"),"day"));if(c.length===0)return t({status:"success",message:d("Layaway defined"),data:{order:u.order}});const f=c[0].amount;f>0?w.show(R,{title:d("Initial Payment"),message:d('In order to proceed, an initial payment of {amount} is required for the selected payment type "{paymentType}". Would you like to proceed ?').replace("{amount}",T(f)).replace("{paymentType}",l.label),onAction:P=>{if(P){const v={identifier:l.identifier,label:l.label,value:f,readonly:!1,selected:!0};this.addPayment(v),c[0].paid=!0,t({status:"success",message:d("Layaway defined"),data:{order:u.order}})}else s({status:"error",message:d("The request was canceled")})}}):t({status:"success",message:d("Layaway defined"),data:{order:u.order}})}}catch(u){return s(u)}})}submitOrder(e={}){return new Promise(async(t,s)=>{var i={...this.order.getValue(),...e};const r=i.customer.group.minimal_credit_payment;if(i.payment_status!=="hold"&&i.payments.length===0&&i.total>0&&i.total>i.tendered){if(this.options.getValue().ns_orders_allow_partial==="no"){const a=d("Partially paid orders are disabled.");return s({status:"error",message:a})}else if(r>=0)try{i=(await this.canProceedAsLaidAway(i)).data.order}catch(a){return s(a)}}return this._isSubmitting?s({status:"error",message:d("An order is currently being processed.")}):(this._isSubmitting=!0,this.proceedSubmitting(i,t,s))})}proceedSubmitting(e,t,s){const i=e.id!==void 0?"put":"post";return b.doAction("ns-order-before-submit",e),C[i](`/api/orders${e.id!==void 0?"/"+e.id:""}`,e).subscribe({next:r=>{t(r),this.reset(),b.doAction("ns-order-submit-successful",r),this._isSubmitting=!1;const a=this.options.getValue().ns_pos_complete_sale_audio;a.length>0&&new Audio(a).play()},error:r=>{this._isSubmitting=!1,s(r),b.doAction("ns-order-submit-failed",r)}})}defineQuantities(e,t=[]){return new Promise((s,i)=>{const a={unit:t.filter(l=>l.id===e.unit_id)[0]||{},sale_price_with_tax:e.mode==="normal"?parseFloat(e.price_with_tax):0,sale_price_without_tax:e.mode==="normal"?parseFloat(e.price_without_tax):0,sale_price:e.mode==="normal"?parseFloat(e.unit_price):0,sale_price_tax:e.mode==="normal"?e.tax_value:0,sale_price_edit:0,wholesale_price_with_tax:e.mode==="wholesale"?parseFloat(e.price_with_tax):0,wholesale_price_without_tax:e.mode==="wholesale"?parseFloat(e.price_without_tax):0,wholesale_price:e.mode==="wholesale"?parseFloat(e.unit_price):0,wholesale_price_tax:e.mode==="wholesale"?e.tax_value:0,wholesale_price_edit:0,custom_price_with_tax:e.mode==="custom"?parseFloat(e.price_with_tax):0,custom_price_without_tax:e.mode==="custom"?parseFloat(e.price_without_tax):0,custom_price:e.mode==="custom"?parseFloat(e.unit_price):0,custom_price_tax:e.mode==="custom"?e.tax_value:0,custom_price_edit:e.mode==="custom"?parseFloat(e.unit_price):0};let u;if(["inclusive","exclusive"].includes(e.tax_type))try{if(e.tax_group_id)C.get(`/api/taxes/groups/${e.tax_group_id}`).subscribe({next:l=>(["sale","wholesale","custom"].forEach(c=>{a[c+"_price_tax"]=l.taxes.map(f=>this.getVatValue(a[c+"_price"],f.rate,e.tax_type)).reduce((f,P)=>f+P),a["gross_"+c+"_price"]=a[c+"_price"]+a[c+"_price_tax"],a["net_"+c+"_price"]=a[c+"_price"]-a[c+"_price_tax"]}),u=l,s(a)),error:l=>{i(!1)}});else return a.sale_price_tax=0,a.wholesale_price_tax=0,a.sale_price_without_tax=e.unit_price,s(a)}catch{return h.error(d("An error has occurred while computing the product.")).subscribe()}return s(a)})}loadOrder(e){return new Promise((t,s)=>{C.get(`/api/orders/${e}/pos`).subscribe({next:async i=>{try{b.doAction("ns-before-load-order",{order:i})}catch(a){return s(a)}this.options.getValue(),i={...this.defaultOrder(),...i};const r=[];for(let a=0;au.product,u.$quantities=()=>{let l=u.product.unit_quantities.filter(c=>+c.id==+u.unit_quantity_id||c.id===void 0)[0];return u.mode==="custom"&&(l.custom_price_edit=u.unit_price,l.custom_price_with_tax=u.price_with_tax,l.custom_price_without_tax=u.price_without_tax,l.custom_price_tax=u.tax_value),l},r.push(u)}i.type=Object.values(this.types.getValue()).filter(a=>a.identifier===i.type)[0],i.addresses={shipping:i.shipping_address,billing:i.billing_address},delete i.shipping_address,delete i.billing_address,this.buildOrder(i),this.buildProducts(r),await this.selectCustomer(i.customer),t(i)},error:i=>s(i)})})}buildOrder(e){this.order.next(e)}buildProducts(e){this.recomputeProducts(e),this.products.next(e),b.doAction("ns-after-cart-changed")}printOrderReceipt(e,t){const s=this.options.getValue();if(s.ns_pos_printing_enabled_for==="disabled")return!1;if(s.ns_pos_printing_enabled_for==="all_orders"||s.ns_pos_printing_enabled_for==="partially_paid_orders"&&["paid","partially_paid"].includes(e.payment_status)||s.ns_pos_printing_enabled_for==="only_paid_orders"&&["paid"].includes(e.payment_status))this.print.process(e.id,"sale",t);else return!1}computePaid(){const e=this._order.getValue();e.tendered=0,e.payments.length>0&&(e.tendered=e.payments.map(t=>t.value).reduce((t,s)=>s+t)),e.tendered>=e.total?e.payment_status="paid":e.tendered>0&&e.tendered{s.identifier===e.identifier?s.selected=!0:s.selected=!1}),this._paymentsType.next(t)}definedPaymentsType(e){this._paymentsType.next(e)}selectCustomer(e){return new Promise((t,s)=>{const i=this.order.getValue(),r=Object.assign(e.billing||{},{});if(r.id!==void 0&&delete r.id,i.customer=e,i.customer_id=e.id,i.addresses.billing=r,this.order.next(i),e.group===void 0||e.group===null)C.get(`/api/customers/${e.id}/group`).subscribe({next:a=>{i.customer.group=a,this.order.next(i),t(i)},error:a=>{s(a)}});else return t(i)})}updateCart(e,t){for(let s in t)t[s]!==void 0&&(e[s]=t[s]);this.order.next(e),this.refreshCart()}checkCart(){const e=this.order.getValue(),t=[];e.coupons.forEach(s=>{let i=!0;s.products.length>0&&(i=e.products.filter(a=>s.products.map(u=>u.product_id).includes(a.product_id)).length>0,!i&&t.indexOf(s)===-1&&t.push(s));let r=!0;s.categories.length>0&&(r=e.products.filter(a=>s.categories.map(u=>u.category_id).includes(a.$original().category_id)).length>0,!r&&t.indexOf(s)===-1&&t.push(s))}),t.forEach(s=>{h.error(d(`The coupons "%s" has been removed from the cart, as it's required conditions are no more meet.`).replace("%s",s.name),d("Okay"),{duration:6e3}).subscribe(),this.removeCoupon(s)})}async refreshCart(){this.checkCart();const e=this.products.getValue();let t=this.order.getValue();const s=e.filter(c=>c.product_type!=="dynamic").map(c=>c.total_price);if(s.length>0){let c=s.reduce((v,E)=>v+E),f=0,P=e.filter(v=>v.product_type==="dynamic").map(v=>(v.unit_price=c*v.rate/100,v.total_price=v.unit_price*v.quantity,v.total_price));P.length>0&&(f=P.reduce((v,E)=>v+E)),t.subtotal=c+f}else t.subtotal=0;const i=t.coupons.map(c=>c.type==="percentage_discount"?(c.value=t.subtotal*c.discount_value/100,c.value):(c.value=c.discount_value,c.value));t.total_coupons=0,i.length>0&&(t.total_coupons=i.reduce((c,f)=>c+f)),t.discount_type==="percentage"&&(t.discount=t.discount_percentage*t.subtotal/100),t.discount>t.subtotal&&t.total_coupons===0&&(t.discount=t.subtotal,h.info(d("The discount has been set to the cart subtotal.")).subscribe()),t.tax_value=0,t.total_tax_value=0,this.order.next(t);try{t=(await this.computeTaxes()).data.order}catch(c){c!==!1&&c.message!==void 0&&h.error(c.message||d("An unexpected error has occurred while fecthing taxes."),d("OKAY"),{duration:0}).subscribe()}const r=e.map(c=>c.tax_type==="inclusive"?c.total_tax_value:0);r.length>0&&r.reduce((c,f)=>c+f);const a=t.tax_type,u=this.options.getValue().ns_pos_vat;let l=0;if(["flat_vat","variable_vat","products_vat","products_flat_vat","products_variable_vat"].includes(u)&&(l=t.total_tax_value),a==="exclusive"){const c=g(t.subtotal).add(t.shipping||0).add(l).done();t.total=g(c).subtract(t.discount).subtract(t.total_coupons).done()}else{const c=g(t.subtotal).add(t.shipping||0).done();t.total=g(c).subtract(t.discount).subtract(t.total_coupons).done()}this.order.next(t),b.doAction("ns-cart-after-refreshed",t)}getStockUsage(e,t){const s=this._products.getValue().filter(i=>i.product_id===e&&i.unit_quantity_id===t).map(i=>i.quantity);return s.length>0?s.reduce((i,r)=>i+r):0}async addToCart(e){let t=new Object,s={product_id:e.id||0,name:e.name,discount_type:"percentage",discount:0,discount_percentage:0,product_type:e.product_type||"product",rate:e.rate||0,quantity:e.quantity||0,tax_group_id:e.tax_group_id,tax_type:e.tax_type||void 0,tax_value:0,unit_id:e.unit_id||0,unit_price:e.unit_price||0,price_with_tax:e.price_with_tax||0,price_without_tax:e.price_without_tax||0,unit_name:e.unit_name||"",total_price:0,total_price_without_tax:0,total_price_with_tax:0,mode:e.mode||"normal",$original:e.$original||(()=>e),$quantities:e.$quantities||void 0};if(this._processingAddQueue=!0,s.product_id!==0)for(let a in this.addToCartQueue)try{const l=await new this.addToCartQueue[a](s).run(t);t={...t,...l}}catch(u){if(u===!1)return this._processingAddQueue=!1,!1}this._processingAddQueue=!1,s={...s,...t};const i=this._products.getValue();if(this.settings.getValue().ns_pos_items_merge){const a=i.filter(u=>u.product_id===s.product_id&&u.tax_group_id===s.tax_group_id&&u.unit_id===s.unit_id&&u.unit_quantity_id===s.unit_quantity_id);a.length>0?a[0].quantity+=s.quantity:i.unshift(s)}else i.unshift(s);this.recomputeProducts(i),this.products.next(i);const r=this.options.getValue().ns_pos_new_item_audio;r.length>0&&new Audio(r).play(),b.doAction("ns-after-cart-changed")}defineTypes(e){this._types.next(e)}userCan(e){return this._userPermissions.getValue().filter(i=>i.namespace===e).length>0}async removeProductUsingIndex(e){const t=this._products.getValue();if(t[e].id)try{await new Promise((i,r)=>{const a=w.show(D);C.post("/api/users/check-permission/",{permission:"nexopos.pos.delete-order-product"}).subscribe({next:u=>{a.close(),i(u)},error:u=>{a.close(),r(u)}})}),this.resumeRemovingProductUsingIndex(e,t)}catch{M.error(d("Forbidden Action"),d("You are not allowed to remove this product."))}else this.resumeRemovingProductUsingIndex(e,t)}resumeRemovingProductUsingIndex(e,t){t.splice(e,1),this.products.next(t),b.doAction("ns-after-cart-changed")}removeProduct(e){const t=this._products.getValue(),s=t.indexOf(e);t.splice(s,1),this.products.next(t),b.doAction("ns-after-cart-changed")}updateProduct(e,t,s=null){const i=this._products.getValue();s=s===null?i.indexOf(e):s,s=s===-1?0:s,i[s]={...e,...t},this.recomputeProducts(i),this.products.next(i),b.doAction("ns-after-cart-changed")}recomputeProducts(e=null){e.forEach(t=>{this.computeProduct(t)})}getProductUnitPrice(e,t){switch(e){case"custom":return t.custom_price_edit;case"normal":return t.sale_price_edit;case"wholesale":return t.wholesale_price_edit}}computeProductTax(e){switch(e.mode){case"custom":return this.computeCustomProductTax(e);case"normal":return this.computeNormalProductTax(e);case"wholesale":return this.computeWholesaleProductTax(e);default:return e}}proceedProductTaxComputation(e,t){const s=e.$original(),i=s.tax_group;let r=this.getProductUnitPrice(e.mode,e.$quantities()),a=0,u=this.getProductUnitPrice(e.mode,e.$quantities());if(i!=null&&i.taxes!==void 0){let l=0;switch(i.taxes.length>0&&(l=i.taxes.map(c=>c.rate).reduce((c,f)=>c+f)),s.tax_type){case"inclusive":r=this.getPriceWithoutTax(t,l,s.tax_type),u=t,a=this.getVatValue(g(u).multiply(e.quantity).subtract(e.discount).done(),l,s.tax_type);break;case"exclusive":r=t,u=this.getPriceWithTax(t,l,s.tax_type),a=this.getVatValue(g(r).multiply(e.quantity).subtract(e.discount).done(),l,s.tax_type);break}}return{price_without_tax:r,tax_value:a,price_with_tax:u}}computeCustomProductTax(e){const t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.custom_price_edit);return t.custom_price_without_tax=s.price_without_tax,t.custom_price_with_tax=s.price_with_tax,t.custom_price_tax=s.tax_value,e.$quantities=()=>t,e}computeNormalProductTax(e){const t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.sale_price_edit);return t.sale_price_without_tax=s.price_without_tax,t.sale_price_with_tax=s.price_with_tax,t.sale_price_tax=s.tax_value,e.$quantities=()=>t,e}computeWholesaleProductTax(e){const t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.wholesale_price_edit);return t.wholesale_price_without_tax=s.price_without_tax,t.wholesale_price_with_tax=s.price_with_tax,t.wholesale_price_tax=s.tax_value,e.$quantities=()=>t,e}getPrice(e,t,s){switch(t){case"normal":return e["sale_price_"+s];case"wholesale":return e["wholesale_price_"+s];case"custom":return e["custom_price_"+s]}}computeProduct(e){e.product_type==="product"&&(e.mode==="normal"?e.unit_price=this.getSalePrice(e.$quantities()):e.mode==="wholesale"&&(e.unit_price=this.getWholesalePrice(e.$quantities())),e.mode==="custom"&&(e.unit_price=this.getCustomPrice(e.$quantities()))),this.computeDiscount(e),this.computeProductTaxValue(e);let t=b.applyFilters("ns-pos-product-unit-price",e.unit_price,e);e.total_price=g(t).multiply(e.quantity).subtract(e.discount).done(),e.total_tax_value=g(e.tax_value).multiply(e.quantity).done(),b.doAction("ns-after-product-computed",e)}computeProductTaxValue(e){const t=e.$original().tax_group,s=b.applyFilters("ns-pos-product-unit-price",e.unit_price,e);let i=this.computeTaxForGroup(g(s).multiply(e.quantity).subtract(e.discount).done(),t,this.options.getValue().ns_pos_price_with_tax==="yes"?"inclusive":"exclusive");e.tax_value=i.tax_value,e.price_with_tax=i.price_with_tax,e.price_without_tax=i.price_without_tax}computeTaxForGroup(e,t,s){let i=0,r=0,a=0,u=[];if(t&&(u=t.taxes.map(l=>({...l,tax_value:this.getVatValue(e,l.rate,s)}))),u.length>0){const l=u.map(c=>c.rate).reduce((c,f)=>c+f);i=this.getVatValue(e,l,s),a=this.getPriceWithoutTax(e,l,s),r=this.getPriceWithTax(e,l,s)}return{...t,taxes:u,tax_value:i,price_with_tax:r,price_without_tax:a}}async runPaymentQueue(){const e=b.applyFilters("ns-pay-queue",[Y,L,H,N]);for(let t in e)try{const i=await new e[t](this.order.getValue()).run()}catch(s){return console.log(s),!1}}computeDiscount(e){if(["flat","percentage"].includes(e.discount_type)&&e.discount_type==="percentage"){let t=b.applyFilters("ns-pos-product-unit-price",e.unit_price,e);e.discount=g(g(g(t).multiply(e.discount_percentage).done()).divide(100).done()).multiply(e.quantity).done()}}loadCustomer(e){return C.get(`/api/customers/${e}`)}defineSettings(e){this._settings.next(e)}voidOrder(e){e.id!==void 0?["hold"].includes(e.payment_status)?w.show(R,{title:d("Order Deletion"),message:d("The current order will be deleted as no payment has been made so far."),onAction:t=>{t&&C.delete(`/api/orders/${e.id}`).subscribe({next:s=>{h.success(s.message).subscribe(),this.reset()},error:s=>h.error(s.message).subscribe()})}}):w.show(_e,{title:d("Void The Order"),message:d("The current order will be void. This will cancel the transaction, but the order won't be deleted. Further details about the operation will be tracked on the report. Consider providing the reason of this operation."),onAction:t=>{t!==!1&&C.post(`/api/orders/${e.id}/void`,{reason:t}).subscribe({next:s=>{h.success(s.message).subscribe(),this.reset()},error:s=>h.error(s.message).subscribe()})}}):h.error(d("Unable to void an unpaid order.")).subscribe()}async triggerOrderTypeSelection(e){for(let t=0;te in n?Z(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var x=(n,e,t)=>ee(n,typeof e!="symbol"?e+"":e,t);import{_ as U}from"./preload-helper-C1FmrZbK.js";import{n as te,a as se,b as ie,c as z,P as re}from"./ns-pos-shipping-popup-DoTikYQ4.js";import{p as ne,a as K,b as C,d as h,P as w,F as oe,e as ae,n as b,B as k,f as M,T as G,g,h as le}from"./bootstrap-Dea9XoG9.js";import{_ as d,n as T,a as Q}from"./currency-Dtag6qPd.js";import{_ as F}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{r as S,o as m,c as _,a as o,t as p,F as q,b as I,e as y,f as V,n as B,g as j,w as A,h as ue,i as O,j as ce,d as $}from"./runtime-core.esm-bundler-VrNrzzXC.js";import{n as R,a as de,N as pe,b as D,c as me,d as _e}from"./ns-prompt-popup-7xlV5yZV.js";import"./ns-orders-preview-popup-E5E8ndto.js";import"./chart-Ozef1QaY.js";const he={props:["popup"],data(){return{unitsQuantities:[],loadsUnits:!1,options:null,optionsSubscriber:null}},beforeDestroy(){this.optionsSubscriber.unsubscribe()},mounted(){this.optionsSubscriber=POS.options.subscribe(n=>{this.options=n}),this.popup.params.product.$original().selectedUnitQuantity!==void 0?this.selectUnit(this.popup.params.product.$original().selectedUnitQuantity):this.popup.params.product.$original().unit_quantities!==void 0&&this.popup.params.product.$original().unit_quantities.length===1?this.selectUnit(this.popup.params.product.$original().unit_quantities[0]):(this.loadsUnits=!0,this.loadUnits()),this.popupCloser()},computed:{productName(){return this.popup.params.product.$original().name}},methods:{__:d,nsCurrency:T,popupCloser:ne,popupResolver:K,displayRightPrice(n){return POS.getSalePrice(n,this.popup.params.product.$original())},loadUnits(){C.get(`/api/products/${this.popup.params.product.$original().id}/units/quantities`).subscribe(n=>{if(n.length===0)return this.popup.close(),h.error(d("This product doesn't have any unit defined for selling. Make sure to mark at least one unit as visible.")).subscribe();this.unitsQuantities=n,this.unitsQuantities.length===1&&this.selectUnit(this.unitsQuantities[0])})},selectUnit(n){if(n.unit===null)return h.error(d('The unit attached to this product is missing or not assigned. Please review the "Unit" tab for this product.')).subscribe(),this.popup.close();this.popup.params.resolve({unit_quantity_id:n.id,unit_name:n.unit.name,$quantities:()=>n}),this.popup.close()}}},fe={class:"h-full w-full flex items-center justify-center",id:"ns-units-selector"},ye={key:0,class:"ns-box w-4/5-screen lg:w-1/3-screen overflow-hidden flex flex-col"},xe={id:"header",class:"h-16 flex justify-center items-center flex-shrink-0"},be={class:"font-bold text-primary"},ge={key:0,class:"grid grid-flow-row grid-cols-2 overflow-y-auto"},ve=["onClick"],we={class:"h-40 w-full flex items-center justify-center overflow-hidden"},Pe=["src","alt"],ke={key:1,class:"h-40 flex items-center justify-center"},Ce={class:"h-0 w-full"},Ve={class:"relative w-full flex items-center justify-center -top-10 h-20 py-2 flex-col overlay"},Te={class:"font-bold text-primary py-2 text-center"},Se={class:"text-sm font-medium text-primary"},Oe={key:1,class:"h-56 flex items-center justify-center"};function Ae(n,e,t,s,i,r){const a=S("ns-spinner");return m(),_("div",fe,[i.unitsQuantities.length>0?(m(),_("div",ye,[o("div",xe,[o("h3",be,p(r.__("{product} : Units").replace("{product}",r.productName)),1)]),i.unitsQuantities.length>0?(m(),_("div",ge,[(m(!0),_(q,null,I(i.unitsQuantities,u=>(m(),_("div",{onClick:l=>r.selectUnit(u),key:u.id,class:"ns-numpad-key info cursor-pointer border flex-shrink-0 flex flex-col items-center justify-center"},[o("div",we,[u.preview_url?(m(),_("img",{key:0,src:u.preview_url,class:"object-cover h-full",alt:u.unit.name},null,8,Pe)):y("",!0),u.preview_url?y("",!0):(m(),_("div",ke,e[0]||(e[0]=[o("i",{class:"las la-image text-primary text-6xl"},null,-1)])))]),o("div",Ce,[o("div",Ve,[o("h3",Te,p(u.unit.name)+" ("+p(u.quantity)+")",1),o("p",Se,p(r.nsCurrency(r.displayRightPrice(u))),1)])])],8,ve))),128))])):y("",!0)])):y("",!0),i.unitsQuantities.length===0?(m(),_("div",Oe,[V(a)])):y("",!0)])}const Fe=F(he,[["render",Ae]]);class je{constructor(e){this.product=e}run(){return new Promise((e,t)=>{const s=this.product;w.show(Fe,{resolve:e,reject:t,product:s})})}}class L{constructor(e){this.order=e}run(){return new Promise((e,t)=>this.order.customer===void 0?w.show(te,{resolve:e,reject:t}):e(!0))}}window.CustomerQueue=L;const qe={name:"sample-payment",props:["label","identifier"],data(){return{backValue:"0",number:parseInt(1+new Array(parseInt(ns.currency.ns_currency_precision)).fill("").map(n=>0).join("")),order:null,settings:{},settingsSubscription:null,cursor:parseInt(ns.currency.ns_currency_precision),orderSubscription:null,allSelected:!0,keys:[...[7,8,9].map(n=>({identifier:n,value:n})),...[4,5,6].map(n=>({identifier:n,value:n})),...[1,2,3].map(n=>({identifier:n,value:n})),{identifier:"backspace",icon:"la-backspace"},{identifier:0,value:0},{identifier:"next",icon:"la-share"}]}},computed:{amountShortcuts(){return nsShortcuts.ns_pos_amount_shortcut!==null?nsShortcuts.ns_pos_amount_shortcut.split("|"):[]}},mounted(){this.orderSubscription=POS.order.subscribe(e=>{this.order=e}),this.settingsSubscription=POS.settings.subscribe(e=>{this.settings=e});const n=new Array(10).fill("").map((e,t)=>t);nsHotPress.create("numpad-keys").whenVisible([".is-popup"]).whenPressed(n,(e,t)=>{this.inputValue({value:t})}),nsHotPress.create("numpad-backspace").whenVisible([".is-popup"]).whenPressed("backspace",()=>this.inputValue({identifier:"backspace"})),nsHotPress.create("numpad-save").whenVisible([".is-popup"]).whenPressed("enter",()=>{this.backValue===""?(this.$emit("submit"),this.backValue=0):this.inputValue({identifier:"next"})})},beforeDestroy(){nsHotPress.destroy("numpad-keys"),nsHotPress.destroy("numpad-backspace"),nsHotPress.destroy("numpad-save")},unmounted(){this.orderSubscription.unsubscribe()},methods:{__:d,nsCurrency:T,toggleDiscount(){if(this.settings.cart_discount!==void 0&&this.settings.cart_discount===!0)w.show(se,{reference:this.order,type:"cart",onSubmit:n=>{POS.updateCart(this.order,n)}});else return h.error(d("You're not allowed to add a discount on the cart.")).subscribe()},makeFullPayment(){POS.order.getValue(),w.show(R,{title:d("Confirm Full Payment"),message:d("A full payment will be made using {paymentType} for {total}").replace("{paymentType}",this.label).replace("{total}",T(this.order.total)),onAction:n=>{if(n){const e=POS.order.getValue();e.tendered0).join(""));this.backValue=(parseFloat(n.value)*e+(parseFloat(this.backValue)||0)).toString(),this.allSelected=!1},inputValue(n){n.identifier==="next"?(POS.addPayment({value:parseFloat(this.backValue/this.number),identifier:this.identifier,selected:!1,label:this.label,readonly:!1}),this.backValue="0"):n.identifier==="backspace"?this.allSelected?(this.backValue="0",this.allSelected=!1):this.backValue=this.backValue.slice(0,-1):n.value.toString().match(/^\d+$/)&&(this.allSelected?(this.backValue=n.value.toString(),this.allSelected=!1):(this.backValue+=n.value.toString(),this.mode==="percentage"&&(this.backValue=this.backValue>100?100:this.backValue))),this.backValue==="0"&&(this.backValue="")}}},Ie={class:"h-full w-full py-2"},Qe={key:0,class:"px-2 pb-2"},Ue={class:"grid grid-cols-2 gap-2"},$e={id:"details",class:"h-16 flex justify-between items-center border elevation-surface info text-xl md:text-3xl p-2"},Re={id:"paid",class:"h-16 flex justify-between items-center border elevation-surface success text-xl md:text-3xl p-2"},Ee={id:"change",class:"h-16 flex justify-between items-center border elevation-surface warning text-xl md:text-3xl p-2"},Be={id:"change",class:"col-span-2 h-16 flex justify-between items-center elevation-surface border text-xl md:text-3xl p-2"},De={class:"px-2 pb-2"},Le={class:"-mx-2 flex flex-wrap"},We={class:"pl-2 pr-1 flex-auto"},Ne={id:"numpad",class:"grid grid-flow-row grid-cols-3 gap-2 grid-rows-3",style:{padding:"1px"}},Ye=["onClick"],He={key:0},Me={class:"w-1/2 md:w-72 pr-2 pl-1"},Ge={class:"grid grid-flow-row grid-rows-1 gap-2"},ze=["onClick"];function Ke(n,e,t,s,i,r){return m(),_("div",Ie,[i.order?(m(),_("div",Qe,[o("div",Ue,[o("div",$e,[o("span",null,p(r.__("Total"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.total)),1)]),o("div",{id:"discount",onClick:e[0]||(e[0]=a=>r.toggleDiscount()),class:"cursor-pointer h-16 flex justify-between items-center border elevation-surface error text-xl md:text-3xl p-2"},[o("span",null,p(r.__("Discount"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.discount)),1)]),o("div",Re,[o("span",null,p(r.__("Paid"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.tendered)),1)]),o("div",Ee,[o("span",null,p(r.__("Change"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.change)),1)]),o("div",Be,[o("span",null,p(r.__("Screen"))+" : ",1),o("span",null,p(r.nsCurrency(i.backValue/i.number)),1)])])])):y("",!0),o("div",De,[o("div",Le,[o("div",We,[o("div",Ne,[(m(!0),_(q,null,I(i.keys,(a,u)=>(m(),_("div",{onClick:l=>r.inputValue(a),key:u,style:{margin:"-1px"},class:"ns-numpad-key text-2xl border h-16 flex items-center justify-center cursor-pointer"},[a.value!==void 0?(m(),_("span",He,p(a.value),1)):y("",!0),a.icon?(m(),_("i",{key:1,class:B(["las",a.icon])},null,2)):y("",!0)],8,Ye))),128)),o("div",{onClick:e[1]||(e[1]=a=>r.makeFullPayment()),class:"hover:bg-green-500 col-span-3 bg-success-secondary border-success-tertiary text-2xl text-white border h-16 flex items-center justify-center cursor-pointer"},p(r.__("Full Payment")),1)])]),o("div",Me,[o("div",Ge,[(m(!0),_(q,null,I(r.amountShortcuts,(a,u)=>(m(),_("div",{key:u,onClick:l=>r.increaseBy({value:a}),class:"ns-numpad-key text-2xl border h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(a)),1)],8,ze))),128))])])])])])}const W=F(qe,[["render",Ke]]),Je={name:"cash-payment",props:["identifier","label"],components:{samplePayment:W}};function Xe(n,e,t,s,i,r){const a=S("sample-payment");return m(),j(a,{identifier:t.identifier,label:t.label},null,8,["identifier","label"])}const Ze=F(Je,[["render",Xe]]),et={name:"creditcart-payment",props:["identifier"]};function tt(n,e,t,s,i,r){return m(),_("h1",null,"Credit Card")}const st=F(et,[["render",tt]]),it={name:"bank-payment",props:["identifier","label"],components:{samplePayment:W}};function rt(n,e,t,s,i,r){const a=S("sample-payment");return m(),j(a,{identifier:t.identifier,label:t.label},null,8,["identifier","label"])}const nt=F(it,[["render",rt]]),ot={name:"ns-account-payment",components:{nsNumpad:de},props:["identifier","label"],data(){return{subscription:null,screenValue:0,order:null}},methods:{__:d,nsCurrency:T,handleChange(n){this.screenValue=n},proceedAddingPayment(n){const e=parseFloat(n),t=this.order.payments;if(e<=0)return h.error(d("Please provide a valid payment amount.")).subscribe();if(t.filter(s=>s.identifier==="account-payment").length>0)return h.error(d("The customer account can only be used once per order. Consider deleting the previously used payment.")).subscribe();if(e>this.order.customer.account_amount)return h.error(d("Not enough funds to add {amount} as a payment. Available balance {balance}.").replace("{amount}",T(e)).replace("{balance}",T(this.order.customer.account_amount))).subscribe();POS.addPayment({value:e,identifier:"account-payment",selected:!1,label:this.label,readonly:!1}),this.order.customer.account_amount-=e,POS.selectCustomer(this.order.customer)},proceedFullPayment(){if(this.order.payments.filter(e=>e.identifier==="account-payment").length>0)return h.error(d("The customer account can only be used once per order. Consider deleting the previously used payment.")).subscribe();this.proceedAddingPayment(this.order.total),this.$emit("submit")},makeFullPayment(){Popup.show(R,{title:d("Confirm Full Payment"),message:d("You're about to use {amount} from the customer account to make a payment. Would you like to proceed ?").replace("{amount}",T(this.order.total)),onAction:n=>{n&&this.proceedFullPayment()}})}},mounted(){this.subscription=POS.order.subscribe(n=>this.order=n)},unmounted(){this.subscription.unsubscribe()}},at={class:"h-full w-full py-2"},lt={key:0,class:"px-2 pb-2"},ut={class:"grid grid-cols-2 gap-2"},ct={id:"details",class:"h-16 flex justify-between items-center elevation-surface border info text-xl md:text-3xl p-2"},dt={id:"paid",class:"h-16 flex justify-between items-center elevation-surface success border text-xl md:text-3xl p-2"},pt={id:"change",class:"h-16 flex justify-between items-center elevation-surface warning border text-xl md:text-3xl p-2"},mt={id:"change",class:"col-span-2 h-16 flex justify-between items-center elevation-surface border success text-xl md:text-3xl p-2"},_t={id:"change",class:"col-span-2 h-16 flex justify-between items-center elevation-surface border text-primary text-xl md:text-3xl p-2"},ht={class:"px-2 pb-2"},ft={class:"-mx-2 flex flex-wrap"},yt={class:"pl-2 pr-1 flex-auto"},xt={class:"w-1/2 md:w-72 pr-2 pl-1"},bt={class:"grid grid-flow-row grid-rows-1 gap-2"};function gt(n,e,t,s,i,r){const a=S("ns-numpad");return m(),_("div",at,[i.order?(m(),_("div",lt,[o("div",ut,[o("div",ct,[o("span",null,p(r.__("Total"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.total)),1)]),o("div",{id:"discount",onClick:e[0]||(e[0]=u=>n.toggleDiscount()),class:"cursor-pointer h-16 flex justify-between items-center elevation-surface error border text-xl md:text-3xl p-2"},[o("span",null,p(r.__("Discount"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.discount)),1)]),o("div",dt,[o("span",null,p(r.__("Paid"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.tendered)),1)]),o("div",pt,[o("span",null,p(r.__("Change"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.change)),1)]),o("div",mt,[o("span",null,p(r.__("Current Balance"))+" : ",1),o("span",null,p(r.nsCurrency(i.order.customer.account_amount)),1)]),o("div",_t,[o("span",null,p(r.__("Screen"))+" : ",1),o("span",null,p(r.nsCurrency(i.screenValue)),1)])])])):y("",!0),o("div",ht,[o("div",ft,[o("div",yt,[V(a,{floating:!0,onChanged:e[2]||(e[2]=u=>r.handleChange(u)),onNext:e[3]||(e[3]=u=>r.proceedAddingPayment(u))},{"numpad-footer":A(()=>[o("div",{onClick:e[1]||(e[1]=u=>r.makeFullPayment()),class:"hover:bg-success-tertiary col-span-3 bg-success-secondary text-2xl text-white border border-success-secondary h-16 flex items-center justify-center cursor-pointer"},p(r.__("Full Payment")),1)]),_:1})]),o("div",xt,[o("div",bt,[o("div",{onClick:e[4]||(e[4]=u=>n.increaseBy({value:100})),class:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(100)),1)]),o("div",{onClick:e[5]||(e[5]=u=>n.increaseBy({value:500})),class:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(500)),1)]),o("div",{onClick:e[6]||(e[6]=u=>n.increaseBy({value:1e3})),class:"elevation-surface border hoverable text-2xl text-primary h-16 flex items-center justify-center cursor-pointer"},[o("span",null,p(r.nsCurrency(1e3)),1)])])])])])])}const vt=F(ot,[["render",gt]]),wt={name:"ns-pos-payment",props:["popup"],data(){return{paymentTypesSubscription:null,paymentsType:[],activePayment:null,order:null,showPayment:!1,orderSubscription:null,currentPaymentComponent:null,activePaymentSubscription:null}},computed:{expectedPayment(){const n=this.order.customer.group.minimal_credit_payment;return this.order.total*n/100}},mounted(){this.orderSubscription=POS.order.subscribe(n=>{this.order=ue(n)}),this.activePaymentSubscription=POS.selectedPaymentType.subscribe(n=>{this.activePayment=n,n!==null&&this.loadPaymentComponent(n)}),this.paymentTypesSubscription=POS.paymentsType.subscribe(n=>{this.paymentsType=n,n.filter(e=>{e.selected&&POS.selectedPaymentType.next(e)})}),nsHooks.doAction("ns-pos-payment-mounted",this)},unmounted(){this.activePaymentSubscription.unsubscribe(),this.paymentTypesSubscription.unsubscribe(),this.orderSubscription.unsubscribe(),nsHooks.doAction("ns-pos-payment-destroyed",this)},methods:{__:d,nsCurrency:T,resolveIfQueued:K,loadPaymentComponent(n){switch(n.identifier){case"cash-payment":this.currentPaymentComponent=shallowRef(Ze);break;case"creditcard-payment":this.currentPaymentComponent=shallowRef(st);break;case"bank-payment":this.currentPaymentComponent=shallowRef(nt);break;case"account-payment":this.currentPaymentComponent=shallowRef(vt);break;default:this.currentPaymentComponent=shallowRef(W);break}},async selectPayment(){try{const n=await new Promise((e,t)=>{w.show(pe,{label:d("Select Payment Gateway"),options:this.paymentsType.map(s=>({label:s.label,value:s.identifier})),value:this.activePayment.identifier,resolve:e,reject:t})});this.select(this.paymentsType.filter(e=>e.identifier===n[0].value)[0])}catch{}},select(n){this.showPayment=!1,POS.setPaymentActive(n)},closePopup(){console.log(this.popup),this.popup.close(),POS.selectedPaymentType.next(null)},deletePayment(n){POS.removePayment(n)},selectPaymentAsActive(n){this.select(this.paymentsType.filter(e=>e.identifier===n.target.value)[0])},async submiAsUnpaid(){let n;try{n=await new Promise(t=>{const s=w.show(R,{title:d("Save As Unpaid"),message:d("Are you sure you want to save this order as unpaid?"),onAction:i=>{t(i)}})})}catch(t){h.error(t.message||d("An unexpected error occured while saving the order as unpaid.")).subscribe(),console.log(t)}if(!n)return!1;const e=w.show(D);try{POS.order.next({...POS.order.getValue(),payments:[]}),POS.refreshCart();const t=await new Promise((s,i)=>{POS.proceedSubmitting(POS.order.getValue(),s,i)});e.close(),this.popup.close(),h.success(t.message).subscribe(),POS.printOrderReceipt(t.data.order,"silent")}catch(t){e.close(),h.error(t.message||d("An error occured while saving the order as unpaid.")).subscribe()}},getPaymentLabel(n){const e=this.paymentsType.filter(t=>t.identifier===n.identifier)[0];return e?e.label:n.identifier},submitOrder(n={}){const e=w.show(D);try{const t={...POS.order.getValue(),...n};POS.submitOrder(t).then(s=>{e.close(),h.success(s.message).subscribe(),POS.printOrderReceipt(s.data.order,"silent"),this.popup.close()},s=>{e.close(),h.error(s.message).subscribe()})}catch(t){e.close(),h.error(t.message||d("An unexpected error occured while submitting the order.")).subscribe(),console.log(t)}}}},Pt={key:0,id:"ns-payment-popup",class:"w-screen h-screen p-8 flex overflow-hidden"},kt={class:"flex flex-col flex-auto lg:flex-row shadow-xl"},Ct={class:"w-full lg:w-56 lg:h-full flex justify-between px-2 lg:px-0 lg:block items-center lg:items-start"},Vt={class:"lg:hidden text-xl text-center my-4 font-bold lg:my-8"},Tt={key:0},St={class:"hidden lg:block"},Ot=["onClick"],At={class:"px-2 rounded-full h-8 w-8 flex items-center justify-center ns-label"},Ft={class:"overflow-hidden flex flex-col flex-auto"},jt={class:"flex flex-col flex-auto overflow-hidden"},qt={class:"h-12 hidden items-center justify-between lg:flex"},It={class:"text-xl hidden lg:block text-center my-4 font-bold lg:my-8"},Qt={key:0,class:"hidden-md"},Ut={class:"px-2"},$t={key:0,class:"flex flex-auto ns-payment-wrapper overflow-y-auto"},Rt={key:1,class:"flex flex-auto items-center justify-center bg-white"},Et={class:"font-bold text-center text-3xl"},Bt={class:"text-center"},Dt={key:2,class:"flex flex-auto ns-payment-wrapper overflow-y-auto p-2 flex-col"},Lt={class:"text-center font-bold py-2"},Wt={class:"flex-auto"},Nt={key:0,class:"p-2 flex justify-center mb-2 items-center"},Yt={class:"font-semibold"},Ht={class:"flex items-center"},Mt=["onClick"],Gt={key:1,class:"default rounded-full h-8 w-8 flex items-center justify-center ml-2"},zt={key:0,class:"flex lg:hidden ns-payment-buttons"},Kt={class:"text-sm"},Jt={class:"text-sm"},Xt={class:"text-sm"},Zt={class:"text-sm mr-1"},es={class:"px-2 rounded-full h-6 w-6 text-xs flex items-center justify-center ns-label"},ts={key:1,class:"flex-col sm:flex-row w-full ns-payment-footer justify-end p-2 hidden lg:flex"},ss={class:"flex justify-end"},is={key:1,class:"flex -mx-2"},rs={class:"px-2"},os={key:0,class:"px-2"};function as(n,e,t,s,i,r){const a=S("ns-close-button"),u=S("ns-button");return i.order?(m(),_("div",Pt,[o("div",kt,[o("div",Ct,[o("h3",Vt,[O(p(r.__("Gateway"))+" ",1),i.activePayment?(m(),_("span",Tt,": "+p(i.activePayment.label),1)):y("",!0)]),e[12]||(e[12]=o("div",{class:"h-16 hidden lg:block"},null,-1)),o("ul",St,[(m(!0),_(q,null,I(i.paymentsType,l=>(m(),_("li",{onClick:c=>r.select(l),class:B([l.selected&&!i.showPayment?"ns-visible":"","cursor-pointer ns-payment-gateway py-2 px-3"]),key:l.identifier},p(l.label),11,Ot))),128)),i.paymentsType.length>0?(m(),_("li",{key:0,onClick:e[0]||(e[0]=l=>i.showPayment=!0),class:B([i.showPayment?"ns-visible":"","cursor-pointer py-2 px-3 ns-payment-list border-t mt-4 flex items-center justify-between"])},[o("span",null,p(r.__("Payment List")),1),o("span",At,p(i.order.payments.length),1)],2)):y("",!0)]),V(a,{class:"lg:hidden",onClick:e[1]||(e[1]=l=>r.closePopup())})]),o("div",Ft,[o("div",jt,[o("div",qt,[o("div",null,[o("h3",It,[O(p(r.__("Gateway"))+" ",1),i.activePayment?(m(),_("span",Qt,": "+p(i.activePayment.label),1)):y("",!0)])]),o("div",Ut,[V(a,{onClick:e[2]||(e[2]=l=>r.closePopup())})])]),!i.showPayment&&i.activePayment?(m(),_("div",$t,[(m(),j(ce(i.currentPaymentComponent),{onSubmit:e[3]||(e[3]=l=>r.submitOrder()),label:i.activePayment.label,identifier:i.activePayment.identifier},null,40,["label","identifier"]))])):y("",!0),i.activePayment?y("",!0):(m(),_("div",Rt,[o("div",null,[o("h3",Et,p(r.__("Unable to Proceed")),1),o("p",Bt,p(r.__("Your system doesn't have any valid Payment Type. Consider creating one and try again.")),1)])])),i.showPayment?(m(),_("div",Dt,[o("h3",Lt,p(r.__("List Of Payments")),1),o("ul",Wt,[i.order.payments.length===0?(m(),_("li",Nt,[o("h3",Yt,p(r.__("No Payment added.")),1)])):y("",!0),(m(!0),_(q,null,I(i.order.payments,(l,c)=>(m(),_("li",{key:c,class:"p-2 flex justify-between mb-2 items-center"},[o("span",null,p(r.getPaymentLabel(l)),1),o("div",Ht,[o("span",null,p(r.nsCurrency(l.value)),1),l.id?y("",!0):(m(),_("button",{key:0,onClick:f=>r.deletePayment(l),class:"error rounded-full h-8 w-8 flex items-center justify-center ml-2"},e[13]||(e[13]=[o("i",{class:"las la-trash-alt"},null,-1)]),8,Mt)),l.id?(m(),_("button",Gt,e[14]||(e[14]=[o("i",{class:"las la-lock"},null,-1)]))):y("",!0)])]))),128))])])):y("",!0)]),i.activePayment?(m(),_("div",zt,[o("button",{onClick:e[4]||(e[4]=l=>r.selectPayment()),class:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 font-bold ns-payment-type-button"},[o("span",Kt,p(r.__("Payment Type")),1)]),i.order.tendered>=i.order.total?(m(),_("button",{key:0,onClick:e[5]||(e[5]=l=>r.submitOrder()),class:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 ns-submit-button font-bold"},[o("span",Jt,p(r.__("Submit Payment")),1)])):y("",!0),i.order.tenderedr.submitOrder({payment_status:"unpaid"})),class:"flex items-center justify-center w-1/3 text-2xl flex-auto h-12 ns-layaway-button font-bold"},[o("span",Xt,p(r.__("Layaway")),1)])):y("",!0),o("button",{onClick:e[7]||(e[7]=l=>i.showPayment=!0),class:"w-1/3 flex ns-payment-button text-2xl flex-auto h-12 items-center justify-center font-bold"},[o("span",Zt,p(r.__("Payment List")),1),o("span",es,p(i.order.payments.length),1)])])):y("",!0),i.activePayment?(m(),_("div",ts,[o("div",ss,[i.order.tendered>=i.order.total?(m(),j(u,{key:0,onClick:e[8]||(e[8]=l=>r.submitOrder()),type:i.order.tendered>=i.order.total?"success":"info"},{default:A(()=>[o("span",null,[e[15]||(e[15]=o("i",{class:"las la-cash-register"},null,-1)),O(" "+p(r.__("Submit Payment")),1)])]),_:1},8,["type"])):y("",!0),i.order.tenderedr.submitOrder({payment_status:"unpaid"})),type:i.order.tendered>=i.order.total?"success":"info"},{default:A(()=>[o("span",null,[e[16]||(e[16]=o("i",{class:"las la-bookmark"},null,-1)),O(" "+p(r.__("Layaway"))+" — "+p(r.nsCurrency(r.expectedPayment)),1)])]),_:1},8,["type"])):y("",!0),i.order.tendered>0?(m(),j(u,{key:1,onClick:e[10]||(e[10]=l=>r.submitOrder({payment_status:"unpaid"})),type:"info"},{default:A(()=>[o("span",null,[e[17]||(e[17]=o("i",{class:"las la-save"},null,-1)),O(" "+p(r.__("Update")),1)])]),_:1})):y("",!0)]),i.order.tendered===0?(m(),_("div",os,[V(u,{onClick:e[11]||(e[11]=l=>r.submiAsUnpaid()),type:"info"},{default:A(()=>[o("span",null,[e[18]||(e[18]=o("i",{class:"las la-hands-helping"},null,-1)),O(" "+p(r.__("Save As Unpaid")),1)])]),_:1})])):y("",!0)])):y("",!0)])])):y("",!0)])])])):y("",!0)}const ls=F(wt,[["render",as]]);class N{constructor(e){this.order=e}run(){return new Promise((e,t)=>{w.show(ls,{resolve:e,reject:t,order:this.order})})}}window.PaymentQueue=N;class Y{constructor(e){this.order=e}run(){return new Promise((e,t)=>this.order.products.length===0?(h.error(d("You need to provide some products before proceeding.")).subscribe(),t(!1)):e(!0))}}window.ProductsQueue=Y;class H{constructor(e){this.order=e}run(){return new Promise((e,t)=>{if(this.order.type===void 0)return w.show(ie,{resolve:e,reject:t});e(!0)})}}window.TypeQueue=H;class us{constructor(){x(this,"screenIs");this.detect()}detect(){window.innerWidth<544?this.screenIs="xs":window.innerWidth>=544&&window.innerWidth<768?this.screenIs="sm":window.innerWidth>=768&&window.innerWidth<992?this.screenIs="md":window.innerWidth>=992&&window.innerWidth<1200?this.screenIs="lg":window.innerWidth>=1200&&(this.screenIs="xl")}is(e){return e===void 0?this.screenIs:this.screenIs===e}}const cs={name:"ns-pos-layaway-popup",props:["popup"],data(){return{fields:[],instalments:[],formValidation:new oe,subscription:null,totalPayments:0}},mounted(){this.loadFields()},updated(){setTimeout(()=>{document.querySelector(".is-popup #total_instalments").addEventListener("change",()=>{const n=this.formValidation.extractFields(this.fields).total_instalments;this.generatePaymentFields(n)}),document.querySelector(".is-popup #total_instalments").addEventListener("focus",()=>{document.querySelector(".is-popup #total_instalments").select()})},200)},computed:{expectedPayment(){const n=this.order.customer.group.minimal_credit_payment;return nsRawCurrency(this.order.total*n/100)},order(){return this.popup.params.order.instalments=this.popup.params.order.instalments.map(n=>{for(let e in n)if(typeof n[e]!="object"){if(e==="date"){const t={type:"date",name:e,label:d("Date"),disabled:n.paid===1,value:moment(n.date).format("YYYY-MM-DD")};n[e]=t}else if(e==="amount"){const t={type:"number",name:e,label:d("Amount"),disabled:n.paid===1,value:n.amount};n[e]=t}else if(!["paid","id"].includes(e)){const t={type:"hidden",name:e,value:n[e]};n[e]=t}}return n}),this.popup.params.order}},unmounted(){},methods:{__:d,nsCurrency:T,refreshTotalPayments(){if(this.order.instalments.length>0){const n=nsRawCurrency(this.order.instalments.map(e=>parseFloat(e.amount.value)||0).reduce((e,t)=>parseFloat(e)+parseFloat(t)));this.totalPayments=this.order.total-n}else this.totalPayments=0},removeInstalment(n){const e=this.order.instalments.indexOf(n);this.order.instalments.splice(e,1),this.$forceUpdate()},generatePaymentFields(n){this.order.instalments=new Array(parseInt(n)).fill("").map((e,t)=>({date:{type:"date",name:"date",label:"Date",value:t===0?ns.date.moment.format("YYYY-MM-DD"):""},amount:{type:"number",name:"amount",label:"Amount",value:t===0?this.expectedPayment:0},readonly:{type:"hidden",name:"readonly",value:this.expectedPayment>0&&t===0}})),this.$forceUpdate(),this.refreshTotalPayments()},close(){this.popup.params.reject({status:"error",message:d("You must define layaway settings before proceeding.")}),this.popup.close()},skipInstalments(){this.expectedPayment>0?(this.order.instalments=[{amount:this.expectedPayment,date:ns.date.current}],this.order.final_payment_date=this.order.instalments.reverse()[0].date,this.order.total_instalments=this.order.instalments.length,this.order.support_instalments=!1):(this.order.final_payment_date=ns.date.current,this.order.total_instalments=0,this.order.support_instalments=!1),this.popup.close(),POS.order.next(this.order);const{resolve:n,reject:e}=this.popup.params;return n({order:this.order,skip_layaway:!0})},updateOrder(){if(this.order.instalments.length===0)return h.error(d("Please provide instalments before proceeding.")).subscribe();if(this.fields.forEach(l=>this.formValidation.validateField(l)),!this.formValidation.fieldsValid(this.fields))return h.error(d("Unable to process, the form is not valid")).subscribe();this.$forceUpdate();const n=this.order.instalments.map(l=>({amount:parseFloat(l.amount.value),date:l.date.value})),e=nsRawCurrency(n.map(l=>l.amount).reduce((l,c)=>parseFloat(l)+parseFloat(c)));if(n.filter(l=>l.date===void 0||l.date==="").length>0)return h.error(d("One or more instalments has an invalid date.")).subscribe();if(n.filter(l=>!(l.amount>0)).length>0)return h.error(d("One or more instalments has an invalid amount.")).subscribe();if(n.filter(l=>moment(l.date).isBefore(ns.date.moment.startOf("day"))).length>0)return h.error(d("One or more instalments has a date prior to the current date.")).subscribe();const t=n.filter(l=>moment(l.date).isSame(ns.date.moment.startOf("day"),"day"));let s=0;if(t.forEach(l=>{s+=parseFloat(l.amount)}),s{const f=moment(l.date),P=moment(c.date);return f.isBefore(P)?-1:f.isAfter(P)?1:0});const i=this.formValidation.extractFields(this.fields);i.final_payment_date=n.reverse()[0].date,i.total_instalments=n.length;const r={...this.popup.params.order,...i,instalments:n},{resolve:a,reject:u}=this.popup.params;return this.popup.close(),POS.order.next(r),a({order:r,skip_layaway:!1})},loadFields(){C.get("/api/fields/ns.layaway").subscribe(n=>{this.fields=this.formValidation.createFields(n),this.fields.forEach(e=>{e.name==="total_instalments"&&(e.value=this.order.total_instalments||0)})})}}},ds={class:"shadow-lg h-95vh md:h-5/6-screen lg:h-5/6-screen w-95vw md:w-4/6-screen lg:w-3/6-screen ns-box flex flex-col"},ps={class:"p-2 border-b ns-box-header flex justify-between items-center"},ms={class:"font-semibold"},_s={class:"p-2 flex-auto flex flex-col relative overflow-y-auto"},hs={key:0,class:"absolute h-full w-full flex items-center justify-center"},fs={class:"p-2 elevation-surface info mb-2 text-center text-2xl font-bold flex justify-between"},ys={class:"flex flex-col flex-auto overflow-hidden"},xs={class:"border-b ns-box-body"},bs={class:"text-2xl flex justify-between py-2 text-primary"},gs={class:"text-sm"},vs={class:"p-2 mb-2 text-center bg-green-200 text-green-700"},ws={class:"flex-auto overflow-y-auto"},Ps={class:"flex flex-auto"},ks={class:"px-1 w-full md:w-1/2"},Cs={class:"px-1 w-full md:w-1/2"},Vs={class:"flex items-center"},Ts=["onClick"],Ss={key:0,class:"my-2"},Os={class:"p-2 elevation-surface border text-primary text-center"},As={class:"p-2 flex border-t ns-box-footer justify-between flex-shrink-0"},Fs={class:"md:-mx-1 flex flex-col md:flex-row"},js={class:"md:px-1"},qs={class:"md:-mx-1 flex flex-col md:flex-row"},Is={class:"md:px-1"},Qs={class:"md:px-1"};function Us(n,e,t,s,i,r){const a=S("ns-close-button"),u=S("ns-spinner"),l=S("ns-field"),c=S("ns-button");return m(),_("div",ds,[o("div",ps,[o("h3",ms,p(r.__("Layaway Parameters")),1),o("div",null,[V(a,{onClick:e[0]||(e[0]=f=>r.close())})])]),o("div",_s,[i.fields.length===0?(m(),_("div",hs,[V(u)])):y("",!0),o("div",fs,[o("span",null,p(r.__("Minimum Payment")),1),o("span",null,p(r.nsCurrency(r.expectedPayment)),1)]),o("div",null,[(m(!0),_(q,null,I(i.fields,(f,P)=>(m(),j(l,{field:f,key:P},null,8,["field"]))),128))]),o("div",ys,[o("div",xs,[o("h3",bs,[o("span",null,p(r.__("Instalments & Payments")),1),o("p",null,[o("span",gs,"("+p(r.nsCurrency(i.totalPayments))+")",1),o("span",null,p(r.nsCurrency(n.total)),1)])]),o("p",vs,p(r.__("The final payment date must be the last within the instalments.")),1)]),o("div",ws,[(m(!0),_(q,null,I(r.order.instalments,(f,P)=>(m(),_("div",{class:"flex w-full -mx-1 py-2",key:P},[o("div",Ps,[o("div",ks,[V(l,{onChange:e[1]||(e[1]=v=>r.refreshTotalPayments()),field:f.date},null,8,["field"])]),o("div",Cs,[V(l,{onChange:e[2]||(e[2]=v=>r.refreshTotalPayments()),field:f.amount},null,8,["field"])])]),o("div",Vs,[o("button",{onClick:v=>r.removeInstalment(f),class:"items-center flex justify-center h-8 w-8 rounded border text-primary ns-inset-button error"},e[6]||(e[6]=[o("i",{class:"las la-times"},null,-1)]),8,Ts)])]))),128)),r.order.instalments.length===0?(m(),_("div",Ss,[o("p",Os,p(r.__("There is no instalment defined. Please set how many instalments are allowed for this order")),1)])):y("",!0)])])]),o("div",As,[o("div",Fs,[o("div",js,[V(c,{onClick:e[3]||(e[3]=f=>r.skipInstalments()),type:"info"},{default:A(()=>[O(p(r.__("Skip Instalments")),1)]),_:1})])]),o("div",qs,[o("div",Is,[V(c,{onClick:e[4]||(e[4]=f=>r.close()),type:"error"},{default:A(()=>[O(p(r.__("Cancel")),1)]),_:1})]),o("div",Qs,[V(c,{onClick:e[5]||(e[5]=f=>r.updateOrder()),type:"info"},{default:A(()=>[O(p(r.__("Proceed")),1)]),_:1})])])])])}const J=F(cs,[["render",Us]]),$s=window.nsPosDashboardButton=$(()=>U(()=>import("./ns-pos-dashboard-button-D9RNui2U.js"),__vite__mapDeps([0,1,2,3]),import.meta.url)),Rs=window.nsPosPendingOrderButton=$(()=>U(()=>import("./ns-pos-pending-orders-button-Phma0iDa.js"),__vite__mapDeps([4,5,1,6,3,7,2,8]),import.meta.url)),Es=window.nsPosOrderTypeButton=$(()=>U(()=>import("./ns-pos-order-type-button-Dz59gEOp.js"),__vite__mapDeps([9,5,1,6,3,10,7,2,8,11]),import.meta.url)),Bs=window.nsPosCustomersButton=$(()=>U(()=>import("./ns-pos-customers-button-BfeYzU2g.js"),__vite__mapDeps([12,5,1,6,3,10,7,2,8,11]),import.meta.url)),Ds=window.nsPosResetButton=$(()=>U(()=>import("./ns-pos-reset-button-pAMiWKTL.js"),__vite__mapDeps([13,5,1,6,3,7,2,8]),import.meta.url)),Ls=window.nsPosCashRegister=$(()=>U(()=>import("./ns-pos-registers-button-Dk07B9tB.js"),__vite__mapDeps([14,5,1,6,3,7,2,8]),import.meta.url));window.nsLayawayPopup=J;window.nsPosShippingPopup=z;window.CustomerQueue=L;window.PaymentQueue=N;window.ProductsQueue=Y;window.TypeQueue=H;let X=class{constructor(){x(this,"_cartButtons");x(this,"_products");x(this,"_breadcrumbs");x(this,"_customers");x(this,"_settings");x(this,"_types");x(this,"_orderTypeProcessQueue",[]);x(this,"_paymentsType");x(this,"_order");x(this,"_screen");x(this,"_holdPopupEnabled",!0);x(this,"_initialQueue",[]);x(this,"_options");x(this,"_responsive",new us);x(this,"_visibleSection");x(this,"_isSubmitting",!1);x(this,"_processingAddQueue",!1);x(this,"_selectedPaymentType");x(this,"_userPermissions");x(this,"print");x(this,"defaultOrder",()=>({discount_type:null,title:"",discount:0,register_id:this.get("register")?this.get("register").id:void 0,discount_percentage:0,subtotal:0,total:0,coupons:[],total_coupons:0,tendered:0,note:"",note_visibility:"hidden",tax_group_id:void 0,tax_type:void 0,taxes:[],tax_groups:[],payment_status:void 0,customer_id:void 0,change:0,total_products:0,shipping:0,tax_value:0,total_tax_value:0,products_tax_value:0,shipping_rate:0,shipping_type:void 0,customer:void 0,type:void 0,products:[],instalments:[],payments:[],addresses:{shipping:void 0,billing:void 0}}));x(this,"addToCartQueue",[je,re]);this.initialize(),this.print=new ae({urls:systemUrls,options:systemOptions})}get screen(){return this._screen}get visibleSection(){return this._visibleSection}get paymentsType(){return this._paymentsType}get selectedPaymentType(){return this._selectedPaymentType}get order(){return this._order}get types(){return this._types}get products(){return this._products}get customers(){return this._customers}get options(){return this._options}get orderTypeQueue(){return this._orderTypeProcessQueue}get settings(){return this._settings}get breadcrumbs(){return this._breadcrumbs}get initialQueue(){return this._initialQueue}get responsive(){return this._responsive}get processingAddQueue(){return this._processingAddQueue}get cartButtons(){return this._cartButtons}async reset(){return new Promise(async(e,t)=>{try{this._isSubmitting=!1,this.order.next(this.defaultOrder()),this.products.next([]),this._customers.next([]),this._breadcrumbs.next([]),this._cartButtons.next({}),this.defineCurrentScreen(),this.setHoldPopupEnabled(!0),b.doAction("ns-before-cart-reset"),await this.processInitialQueue(),b.doAction("ns-after-cart-changed"),b.doAction("ns-after-cart-reset"),e(!0)}catch(s){t(s)}})}initialize(){this._userPermissions=new k([]),this._products=new k([]),this._customers=new k([]),this._types=new k([]),this._breadcrumbs=new k([]),this._screen=new k(""),this._paymentsType=new k([]),this._visibleSection=new k("both"),this._options=new k({}),this._settings=new k({}),this._order=new k(this.defaultOrder()),this._selectedPaymentType=new k(null),this._cartButtons=new k({}),this._orderTypeProcessQueue=[{identifier:"handle.delivery-order",promise:e=>new Promise((t,s)=>e&&e.identifier==="delivery"?w.show(z,{resolve:t,reject:s}):t({status:"success",message:"Proceed"}))}],this.initialQueue.push(()=>new Promise((e,t)=>{C.get("/api/users/permissions/").subscribe({next:s=>{this._userPermissions.next(s),e(s)},error:s=>{t(s)}})})),this.initialQueue.push(()=>new Promise((e,t)=>{const s=this.options.getValue(),i=this.order.getValue();return i.tax_type=s.ns_pos_tax_type,s.ns_pos_tax_group!==!1&&(i.tax_group_id=s.ns_pos_tax_group,this.order.next(i)),e({status:"success",message:"tax group assignated"})})),this.initialQueue.push(()=>new Promise((e,t)=>{const s=this.options.getValue();return this.order.getValue(),s.ns_customers_default!==!1&&C.get(`/api/customers/${s.ns_customers_default}`).subscribe({next:i=>{this.selectCustomer(i),e({status:"success",message:d("The customer has been loaded")})},error:i=>{M.error(d("An error has occured"),d("Unable to select the default customer. Looks like the customer no longer exists. Consider changing the default customer on the settings."),{actions:{readMore:{label:d("Read More"),onClick:r=>{r.close(),window.open("https://my.nexopos.com/en/documentation/troubleshooting/no-default-customer","_blank")}},close:{label:d("Close")}}}),t(i)}}),e({status:"success",message:"no default customer is selected."})})),b.addAction("ns-after-cart-changed","listen-add-to-cart",()=>this.refreshCart()),this.types.subscribe(e=>{const t=Object.values(e).filter(s=>s.selected);if(t.length>0){const s=this.order.getValue();s.type=t[0],this.order.next(s)}}),window.addEventListener("resize",()=>{this._responsive.detect(),this.defineCurrentScreen()}),window.onbeforeunload=()=>{if(this.products.getValue().length>0)return d("Some products has been added to the cart. Would you like to discard this order ?")}}getSalePrice(e){let t=0;return this.options.getValue().ns_pos_price_with_tax==="yes"?t=Q(e.sale_price_with_tax):t=Q(e.sale_price_without_tax),b.applyFilters("ns-pos-product-sale-price",t,e)}getCustomPrice(e){let t=0;return this.options.getValue().ns_pos_price_with_tax==="yes"?t=Q(e.custom_price_with_tax):t=Q(e.custom_price_without_tax),b.applyFilters("ns-pos-product-custom-price",t,e)}getWholesalePrice(e){let t=0;return this.options.getValue().ns_pos_price_with_tax==="yes"?t=Q(e.wholesale_price_with_tax):t=Q(e.wholesale_price_without_tax),b.applyFilters("ns-pos-product-wholesale-price",t,e)}setHoldPopupEnabled(e=!0){this._holdPopupEnabled=e}getHoldPopupEnabled(){return this._holdPopupEnabled}async processInitialQueue(){return new Promise(async(e,t)=>{for(let s in this._initialQueue)try{const i=await Promise.race([this._initialQueue[s](),new Promise((r,a)=>setTimeout(()=>a(new Error("Timeout")),6e4))])}catch(i){t(i),h.error(i.message).subscribe()}e(!0)})}removeCoupon(e){const t=this.order.getValue(),s=t.coupons,i=s.indexOf(e);s.splice(i,1),t.coupons=s,this.order.next(t)}pushCoupon(e){const t=this.order.getValue();t.coupons.forEach(s=>{if(s.code===e.code){const i=d("This coupon is already added to the cart");throw h.error(i).subscribe(),i}}),t.coupons.push(e),this.order.next(t),this.refreshCart()}get header(){const e={buttons:{nsPosDashboardButton:$s,nsPosPendingOrderButton:Rs,nsPosOrderTypeButton:Es,nsPosCustomersButton:Bs,nsPosResetButton:Ds}};return this.options.getValue().ns_pos_registers_enabled==="yes"&&(e.buttons.nsPosCashRegister=Ls),b.doAction("ns-pos-header",e),e}defineOptions(e){this._options.next(e)}defineCurrentScreen(){this._visibleSection.next(["xs","sm"].includes(this._responsive.is())?"grid":"both"),this._screen.next(this._responsive.is())}changeVisibleSection(e){["both","cart","grid"].includes(e)&&(["cart","both"].includes(e)&&this.refreshCart(),this._visibleSection.next(e))}addPayment(e){if(e.value>0){const t=this._order.getValue();return t.payments.push(e),this._order.next(t),this.computePaid()}return h.error("Invalid amount.").subscribe()}removePayment(e){if(e.id!==void 0)return h.error(d("Unable to delete a payment attached to the order.")).subscribe();const t=this._order.getValue(),s=t.payments.indexOf(e);t.payments.splice(s,1),this._order.next(t),nsEvent.emit({identifier:"ns.pos.remove-payment",value:e}),this.updateCustomerAccount(e),this.computePaid()}updateCustomerAccount(e){if(e.identifier==="account-payment"){const t=this.order.getValue().customer;t.account_amount+=e.value,this.selectCustomer(t)}}getPriceWithoutTax(e,t,s){if(s==="inclusive")return G.computeInclusive(e,t);if(s==="exclusive")return e}getPriceWithTax(e,t,s){if(s==="inclusive")return e;if(s==="exclusive")return G.computeExclusive(e,t)}getVatValue(e,t,s){return s==="inclusive"?e-this.getPriceWithoutTax(e,t,s):s==="exclusive"?this.getPriceWithTax(e,t,s)-e:0}computeTaxes(){return new Promise((e,t)=>{let s=this.order.getValue();if(s=this.sumProductsTaxes(s),s.tax_group_id===void 0||s.tax_group_id===null)return this.computeOrderTaxes(s),e({data:{order:s},status:"success"});const i=s.tax_groups;if(Object.values(i).length>0)return i[s.tax_group_id]!==void 0&&(s=this.computeOrderTaxGroup(s,i[s.tax_group_id])),e({status:"success",data:{tax:i[s.tax_group_id],order:s}});if(![void 0,null].includes(s.tax_group_id)&&s.tax_group_id.toString().length>0)C.get(`/api/taxes/groups/${s.tax_group_id}`).subscribe({next:r=>(s=this.computeOrderTaxGroup(s,r),e({status:"success",data:{tax:r,order:s}})),error:r=>t(r)});else return t({status:"error",message:d("No tax group assigned to the order")})})}computeOrderTaxGroup(e,t){const s=t.taxes.map(r=>parseFloat(r.rate)).reduce((r,a)=>r+a),i=this.getVatValue(e.subtotal-e.discount,s,e.tax_type);if(t.taxes=t.taxes.map(r=>{const a=g(g(r.rate).divide(s).done()).multiply(100).done();return{id:r.id,tax_id:r.tax_id,name:r.name,rate:parseFloat(r.rate),tax_value:g(g(i).multiply(a).done()).divide(100).done()}}),t.taxes.length===0){h.error(d("The selected tax group doesn't have any assigned sub taxes. This might cause wrong figures."),d("Proceed"),{duration:!1}).subscribe();return}return e.tax_groups=e.tax_groups||[],e.taxes=t.taxes,e.tax_groups[t.id]=t,this.computeOrderTaxes(e)}computeOrderTaxes(e){const t=this.options.getValue().ns_pos_vat,s=this.options.getValue().ns_pos_price_with_tax==="yes";return["flat_vat","variable_vat","products_variable_vat","products_flat_vat"].includes(t)&&e.taxes&&e.taxes.length>0&&(e.tax_value+=e.taxes.map(i=>i.tax_value).reduce((i,r)=>i+r)),e.total_tax_value=e.tax_value,["products_variable_vat","products_flat_vat","products_vat"].includes(t)&&!s&&(e.total_tax_value=e.products_tax_value+e.tax_value),e}sumProductsTaxes(e){const t=this.products.getValue(),s=this.options.getValue().ns_pos_vat;if(["products_flat_vat","products_variable_vat","products_vat"].includes(s)){const i=t.map(r=>r.total_tax_value);i.length>0&&(e.products_tax_value=i.reduce((r,a)=>r+a))}return e.products=t,e.total_products=t.length,e}canProceedAsLaidAway(e){return new Promise(async(t,s)=>{const i=e.customer.group.minimal_credit_payment,r=g(e.total).multiply(i).done();let a=g(r).divide(100).done();a=parseFloat(a);try{const u=await new Promise((l,c)=>{w.show(J,{order:e,reject:c,resolve:l})});if(u.order.instalments.length===0&&u.order.tenderedP.amount>=a&&le(P.date).isSame(ns.date.moment.startOf("day"),"day"));if(c.length===0)return t({status:"success",message:d("Layaway defined"),data:{order:u.order}});const f=c[0].amount;f>0?w.show(R,{title:d("Initial Payment"),message:d('In order to proceed, an initial payment of {amount} is required for the selected payment type "{paymentType}". Would you like to proceed ?').replace("{amount}",T(f)).replace("{paymentType}",l.label),onAction:P=>{if(P){const v={identifier:l.identifier,label:l.label,value:f,readonly:!1,selected:!0};this.addPayment(v),c[0].paid=!0,t({status:"success",message:d("Layaway defined"),data:{order:u.order}})}else s({status:"error",message:d("The request was canceled")})}}):t({status:"success",message:d("Layaway defined"),data:{order:u.order}})}}catch(u){return s(u)}})}submitOrder(e={}){return new Promise(async(t,s)=>{var i={...this.order.getValue(),...e};const r=i.customer.group.minimal_credit_payment;if(i.payment_status!=="hold"&&i.payments.length===0&&i.total>0&&i.total>i.tendered){if(this.options.getValue().ns_orders_allow_partial==="no"){const a=d("Partially paid orders are disabled.");return s({status:"error",message:a})}else if(r>=0)try{i=(await this.canProceedAsLaidAway(i)).data.order}catch(a){return s(a)}}return this._isSubmitting?s({status:"error",message:d("An order is currently being processed.")}):(this._isSubmitting=!0,this.proceedSubmitting(i,t,s))})}proceedSubmitting(e,t,s){const i=e.id!==void 0?"put":"post";return b.doAction("ns-order-before-submit",e),C[i](`/api/orders${e.id!==void 0?"/"+e.id:""}`,e).subscribe({next:r=>{t(r),this.reset(),b.doAction("ns-order-submit-successful",r),this._isSubmitting=!1;const a=this.options.getValue().ns_pos_complete_sale_audio;a.length>0&&new Audio(a).play()},error:r=>{this._isSubmitting=!1,s(r),b.doAction("ns-order-submit-failed",r)}})}defineQuantities(e,t=[]){return new Promise((s,i)=>{const a={unit:t.filter(l=>l.id===e.unit_id)[0]||{},sale_price_with_tax:e.mode==="normal"?parseFloat(e.price_with_tax):0,sale_price_without_tax:e.mode==="normal"?parseFloat(e.price_without_tax):0,sale_price:e.mode==="normal"?parseFloat(e.unit_price):0,sale_price_tax:e.mode==="normal"?e.tax_value:0,sale_price_edit:0,wholesale_price_with_tax:e.mode==="wholesale"?parseFloat(e.price_with_tax):0,wholesale_price_without_tax:e.mode==="wholesale"?parseFloat(e.price_without_tax):0,wholesale_price:e.mode==="wholesale"?parseFloat(e.unit_price):0,wholesale_price_tax:e.mode==="wholesale"?e.tax_value:0,wholesale_price_edit:0,custom_price_with_tax:e.mode==="custom"?parseFloat(e.price_with_tax):0,custom_price_without_tax:e.mode==="custom"?parseFloat(e.price_without_tax):0,custom_price:e.mode==="custom"?parseFloat(e.unit_price):0,custom_price_tax:e.mode==="custom"?e.tax_value:0,custom_price_edit:e.mode==="custom"?parseFloat(e.unit_price):0};let u;if(["inclusive","exclusive"].includes(e.tax_type))try{if(e.tax_group_id)C.get(`/api/taxes/groups/${e.tax_group_id}`).subscribe({next:l=>(["sale","wholesale","custom"].forEach(c=>{a[c+"_price_tax"]=l.taxes.map(f=>this.getVatValue(a[c+"_price"],f.rate,e.tax_type)).reduce((f,P)=>f+P),a["gross_"+c+"_price"]=a[c+"_price"]+a[c+"_price_tax"],a["net_"+c+"_price"]=a[c+"_price"]-a[c+"_price_tax"]}),u=l,s(a)),error:l=>{i(!1)}});else return a.sale_price_tax=0,a.wholesale_price_tax=0,a.sale_price_without_tax=e.unit_price,s(a)}catch{return h.error(d("An error has occurred while computing the product.")).subscribe()}return s(a)})}loadOrder(e){return new Promise((t,s)=>{C.get(`/api/orders/${e}/pos`).subscribe({next:async i=>{try{b.doAction("ns-before-load-order",{order:i})}catch(a){return s(a)}this.options.getValue(),i={...this.defaultOrder(),...i};const r=[];for(let a=0;au.product,u.$quantities=()=>{let l=u.product.unit_quantities.filter(c=>+c.id==+u.unit_quantity_id||c.id===void 0)[0];return u.mode==="custom"&&(l.custom_price_edit=u.unit_price,l.custom_price_with_tax=u.price_with_tax,l.custom_price_without_tax=u.price_without_tax,l.custom_price_tax=u.tax_value),l},r.push(u)}i.type=Object.values(this.types.getValue()).filter(a=>a.identifier===i.type)[0],i.addresses={shipping:i.shipping_address,billing:i.billing_address},delete i.shipping_address,delete i.billing_address,this.buildOrder(i),this.buildProducts(r),await this.selectCustomer(i.customer),t(i)},error:i=>s(i)})})}buildOrder(e){this.order.next(e)}buildProducts(e){this.recomputeProducts(e),this.products.next(e),b.doAction("ns-after-cart-changed")}printOrderReceipt(e,t){const s=this.options.getValue();if(s.ns_pos_printing_enabled_for==="disabled")return!1;if(s.ns_pos_printing_enabled_for==="all_orders"||s.ns_pos_printing_enabled_for==="partially_paid_orders"&&["paid","partially_paid"].includes(e.payment_status)||s.ns_pos_printing_enabled_for==="only_paid_orders"&&["paid"].includes(e.payment_status))this.print.process(e.id,"sale",t);else return!1}computePaid(){const e=this._order.getValue();e.tendered=0,e.payments.length>0&&(e.tendered=e.payments.map(t=>t.value).reduce((t,s)=>s+t)),e.tendered>=e.total?e.payment_status="paid":e.tendered>0&&e.tendered{s.identifier===e.identifier?s.selected=!0:s.selected=!1}),this._paymentsType.next(t)}definedPaymentsType(e){this._paymentsType.next(e)}selectCustomer(e){return new Promise((t,s)=>{const i=this.order.getValue(),r=Object.assign(e.billing||{},{});if(r.id!==void 0&&delete r.id,i.customer=e,i.customer_id=e.id,i.addresses.billing=r,this.order.next(i),e.group===void 0||e.group===null)C.get(`/api/customers/${e.id}/group`).subscribe({next:a=>{i.customer.group=a,this.order.next(i),t(i)},error:a=>{s(a)}});else return t(i)})}updateCart(e,t){for(let s in t)t[s]!==void 0&&(e[s]=t[s]);this.order.next(e),this.refreshCart()}checkCart(){const e=this.order.getValue(),t=[];e.coupons.forEach(s=>{let i=!0;s.products.length>0&&(i=e.products.filter(a=>s.products.map(u=>u.product_id).includes(a.product_id)).length>0,!i&&t.indexOf(s)===-1&&t.push(s));let r=!0;s.categories.length>0&&(r=e.products.filter(a=>s.categories.map(u=>u.category_id).includes(a.$original().category_id)).length>0,!r&&t.indexOf(s)===-1&&t.push(s))}),t.forEach(s=>{h.error(d(`The coupons "%s" has been removed from the cart, as it's required conditions are no more meet.`).replace("%s",s.name),d("Okay"),{duration:6e3}).subscribe(),this.removeCoupon(s)})}async refreshCart(){this.checkCart();const e=this.products.getValue();let t=this.order.getValue();const s=e.filter(c=>c.product_type!=="dynamic").map(c=>c.total_price);if(s.length>0){let c=s.reduce((v,E)=>v+E),f=0,P=e.filter(v=>v.product_type==="dynamic").map(v=>(v.unit_price=c*v.rate/100,v.total_price=v.unit_price*v.quantity,v.total_price));P.length>0&&(f=P.reduce((v,E)=>v+E)),t.subtotal=c+f}else t.subtotal=0;const i=t.coupons.map(c=>c.type==="percentage_discount"?(c.value=t.subtotal*c.discount_value/100,c.value):(c.value=c.discount_value,c.value));t.total_coupons=0,i.length>0&&(t.total_coupons=i.reduce((c,f)=>c+f)),t.discount_type==="percentage"&&(t.discount=t.discount_percentage*t.subtotal/100),t.discount>t.subtotal&&t.total_coupons===0&&(t.discount=t.subtotal,h.info(d("The discount has been set to the cart subtotal.")).subscribe()),t.tax_value=0,t.total_tax_value=0,this.order.next(t);try{t=(await this.computeTaxes()).data.order}catch(c){c!==!1&&c.message!==void 0&&h.error(c.message||d("An unexpected error has occurred while fecthing taxes."),d("OKAY"),{duration:0}).subscribe()}const r=e.map(c=>c.tax_type==="inclusive"?c.total_tax_value:0);r.length>0&&r.reduce((c,f)=>c+f);const a=t.tax_type,u=this.options.getValue().ns_pos_vat;let l=0;if(["flat_vat","variable_vat","products_vat","products_flat_vat","products_variable_vat"].includes(u)&&(l=t.total_tax_value),a==="exclusive"){const c=g(t.subtotal).add(t.shipping||0).add(l).done();t.total=g(c).subtract(t.discount).subtract(t.total_coupons).done()}else{const c=g(t.subtotal).add(t.shipping||0).done();t.total=g(c).subtract(t.discount).subtract(t.total_coupons).done()}this.order.next(t),b.doAction("ns-cart-after-refreshed",t)}getStockUsage(e,t){const s=this._products.getValue().filter(i=>i.product_id===e&&i.unit_quantity_id===t).map(i=>i.quantity);return s.length>0?s.reduce((i,r)=>i+r):0}async addToCart(e){let t=new Object,s={product_id:e.id||0,name:e.name,discount_type:"percentage",discount:0,discount_percentage:0,product_type:e.product_type||"product",rate:e.rate||0,quantity:e.quantity||0,tax_group_id:e.tax_group_id,tax_type:e.tax_type||void 0,tax_value:0,unit_id:e.unit_id||0,unit_price:e.unit_price||0,price_with_tax:e.price_with_tax||0,price_without_tax:e.price_without_tax||0,unit_name:e.unit_name||"",total_price:0,total_price_without_tax:0,total_price_with_tax:0,mode:e.mode||"normal",$original:e.$original||(()=>e),$quantities:e.$quantities||void 0};if(this._processingAddQueue=!0,s.product_id!==0)for(let a in this.addToCartQueue)try{const l=await new this.addToCartQueue[a](s).run(t);t={...t,...l}}catch(u){if(u===!1)return this._processingAddQueue=!1,!1}this._processingAddQueue=!1,s={...s,...t};const i=this._products.getValue();if(this.settings.getValue().ns_pos_items_merge){const a=i.filter(u=>u.product_id===s.product_id&&u.tax_group_id===s.tax_group_id&&u.unit_id===s.unit_id&&u.unit_quantity_id===s.unit_quantity_id);a.length>0?a[0].quantity+=s.quantity:i.unshift(s)}else i.unshift(s);this.recomputeProducts(i),this.products.next(i);const r=this.options.getValue().ns_pos_new_item_audio;r.length>0&&new Audio(r).play(),b.doAction("ns-after-cart-changed")}defineTypes(e){this._types.next(e)}userCan(e){return this._userPermissions.getValue().filter(i=>i.namespace===e).length>0}async removeProductUsingIndex(e){const t=this._products.getValue();if(t[e].id)try{await new Promise((i,r)=>{const a=w.show(D);C.post("/api/users/check-permission/",{permission:"nexopos.pos.delete-order-product"}).subscribe({next:u=>{a.close(),i(u)},error:u=>{a.close(),r(u)}})}),this.resumeRemovingProductUsingIndex(e,t)}catch{M.error(d("Forbidden Action"),d("You are not allowed to remove this product."))}else this.resumeRemovingProductUsingIndex(e,t)}resumeRemovingProductUsingIndex(e,t){t.splice(e,1),this.products.next(t),b.doAction("ns-after-cart-changed")}removeProduct(e){const t=this._products.getValue(),s=t.indexOf(e);t.splice(s,1),this.products.next(t),b.doAction("ns-after-cart-changed")}updateProduct(e,t,s=null){const i=this._products.getValue();s=s===null?i.indexOf(e):s,s=s===-1?0:s,i[s]={...e,...t},this.recomputeProducts(i),this.products.next(i),b.doAction("ns-after-cart-changed")}recomputeProducts(e=null){e.forEach(t=>{this.computeProduct(t)})}getProductUnitPrice(e,t){switch(e){case"custom":return t.custom_price_edit;case"normal":return t.sale_price_edit;case"wholesale":return t.wholesale_price_edit}}computeProductTax(e){switch(e.mode){case"custom":return this.computeCustomProductTax(e);case"normal":return this.computeNormalProductTax(e);case"wholesale":return this.computeWholesaleProductTax(e);default:return e}}proceedProductTaxComputation(e,t){const s=e.$original(),i=s.tax_group;let r=this.getProductUnitPrice(e.mode,e.$quantities()),a=0,u=this.getProductUnitPrice(e.mode,e.$quantities());if(i!=null&&i.taxes!==void 0){let l=0;switch(i.taxes.length>0&&(l=i.taxes.map(c=>c.rate).reduce((c,f)=>c+f)),s.tax_type){case"inclusive":r=this.getPriceWithoutTax(t,l,s.tax_type),u=t,a=this.getVatValue(g(u).multiply(e.quantity).subtract(e.discount).done(),l,s.tax_type);break;case"exclusive":r=t,u=this.getPriceWithTax(t,l,s.tax_type),a=this.getVatValue(g(r).multiply(e.quantity).subtract(e.discount).done(),l,s.tax_type);break}}return{price_without_tax:r,tax_value:a,price_with_tax:u}}computeCustomProductTax(e){const t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.custom_price_edit);return t.custom_price_without_tax=s.price_without_tax,t.custom_price_with_tax=s.price_with_tax,t.custom_price_tax=s.tax_value,e.$quantities=()=>t,e}computeNormalProductTax(e){const t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.sale_price_edit);return t.sale_price_without_tax=s.price_without_tax,t.sale_price_with_tax=s.price_with_tax,t.sale_price_tax=s.tax_value,e.$quantities=()=>t,e}computeWholesaleProductTax(e){const t=e.$quantities(),s=this.proceedProductTaxComputation(e,t.wholesale_price_edit);return t.wholesale_price_without_tax=s.price_without_tax,t.wholesale_price_with_tax=s.price_with_tax,t.wholesale_price_tax=s.tax_value,e.$quantities=()=>t,e}getPrice(e,t,s){switch(t){case"normal":return e["sale_price_"+s];case"wholesale":return e["wholesale_price_"+s];case"custom":return e["custom_price_"+s]}}computeProduct(e){e.product_type==="product"&&(e.mode==="normal"?e.unit_price=this.getSalePrice(e.$quantities()):e.mode==="wholesale"&&(e.unit_price=this.getWholesalePrice(e.$quantities())),e.mode==="custom"&&(e.unit_price=this.getCustomPrice(e.$quantities()))),this.computeDiscount(e),this.computeProductTaxValue(e);let t=b.applyFilters("ns-pos-product-unit-price",e.unit_price,e);e.total_price=g(t).multiply(e.quantity).subtract(e.discount).done(),e.total_tax_value=g(e.tax_value).multiply(e.quantity).done(),b.doAction("ns-after-product-computed",e)}computeProductTaxValue(e){const t=e.$original().tax_group,s=b.applyFilters("ns-pos-product-unit-price",e.unit_price,e);let i=this.computeTaxForGroup(g(s).multiply(e.quantity).subtract(e.discount).done(),t,this.options.getValue().ns_pos_price_with_tax==="yes"?"inclusive":"exclusive");e.tax_value=i.tax_value,e.price_with_tax=i.price_with_tax,e.price_without_tax=i.price_without_tax}computeTaxForGroup(e,t,s){let i=0,r=0,a=0,u=[];if(t&&(u=t.taxes.map(l=>({...l,tax_value:this.getVatValue(e,l.rate,s)}))),u.length>0){const l=u.map(c=>c.rate).reduce((c,f)=>c+f);i=this.getVatValue(e,l,s),a=this.getPriceWithoutTax(e,l,s),r=this.getPriceWithTax(e,l,s)}return{...t,taxes:u,tax_value:i,price_with_tax:r,price_without_tax:a}}async runPaymentQueue(){const e=b.applyFilters("ns-pay-queue",[Y,L,H,N]);for(let t in e)try{const i=await new e[t](this.order.getValue()).run()}catch(s){return console.log(s),!1}}computeDiscount(e){if(["flat","percentage"].includes(e.discount_type)&&e.discount_type==="percentage"){let t=b.applyFilters("ns-pos-product-unit-price",e.unit_price,e);e.discount=g(g(g(t).multiply(e.discount_percentage).done()).divide(100).done()).multiply(e.quantity).done()}}loadCustomer(e){return C.get(`/api/customers/${e}`)}defineSettings(e){this._settings.next(e)}voidOrder(e){e.id!==void 0?["hold"].includes(e.payment_status)?w.show(R,{title:d("Order Deletion"),message:d("The current order will be deleted as no payment has been made so far."),onAction:t=>{t&&C.delete(`/api/orders/${e.id}`).subscribe({next:s=>{h.success(s.message).subscribe(),this.reset()},error:s=>h.error(s.message).subscribe()})}}):w.show(_e,{title:d("Void The Order"),message:d("The current order will be void. This will cancel the transaction, but the order won't be deleted. Further details about the operation will be tracked on the report. Consider providing the reason of this operation."),onAction:t=>{t!==!1&&C.post(`/api/orders/${e.id}/void`,{reason:t}).subscribe({next:s=>{h.success(s.message).subscribe(),this.reset()},error:s=>h.error(s.message).subscribe()})}}):h.error(d("Unable to void an unpaid order.")).subscribe()}async triggerOrderTypeSelection(e){for(let t=0;t { + if ( result.items !== undefined ) { + result.items.forEach( product => { + this.addProductList( product ); + }); + } + }, + error: error => { + nsSnackBar.error( error.message || __( 'An error occured while preloading the procurement.' ) ).subscribe(); + } + }) + } }, computed: { activeTab() { @@ -417,23 +441,34 @@ export default { .subscribe(); } - product.procurement = new Object; - product.procurement.gross_purchase_price = 0; - product.procurement.purchase_price_edit = 0; - product.procurement.tax_value = 0; - product.procurement.net_purchase_price = 0; - product.procurement.purchase_price = 0; - product.procurement.total_price = 0; - product.procurement.total_purchase_price = 0; - product.procurement.quantity = 1; - product.procurement.expiration_date = null; - product.procurement.tax_group_id = product.tax_group_id; - product.procurement.tax_type = product.tax_type || 'inclusive'; - product.procurement.unit_id = product.unit_quantities[0].unit_id; - product.procurement.product_id = product.id; - product.procurement.convert_unit_id = product.unit_quantities[0].convert_unit_id; - product.procurement.procurement_id = null; - product.procurement.$invalid = false; + /** + * if the procurement object is not created we'll create it. + * when it's already provided, probably we have some default values provided. + */ + if ( product.procurement === undefined ) { + product.procurement = {}; + } + + const defaultValues = { + gross_purchase_price: 0, + purchase_price_edit: 0, + tax_value: 0, + net_purchase_price: 0, + purchase_price: 0, + total_price: 0, + total_purchase_price: 0, + quantity: 1, + expiration_date: null, + tax_group_id: product.tax_group_id, + tax_type: product.tax_type || 'inclusive', + unit_id: product.unit_quantities[0].unit_id, + product_id: product.id, + convert_unit_id: product.unit_quantities[0].convert_unit_id, + procurement_id: null, + $invalid: false, + } + + product.procurement = Object.assign( defaultValues, product.procurement ); this.searchResult = []; this.searchValue = ''; @@ -744,8 +779,13 @@ export default {
-
+
{{ tab.label }} +
diff --git a/routes/api/procurements.php b/routes/api/procurements.php index 1b512055c..fcac9db15 100644 --- a/routes/api/procurements.php +++ b/routes/api/procurements.php @@ -7,7 +7,9 @@ Route::get( 'procurements/{id}/products', [ ProcurementController::class, 'procurementProducts' ] ); Route::get( 'procurements/{id}/refresh', [ ProcurementController::class, 'refreshProcurement' ] ); Route::get( 'procurements/{procurement}/set-as-paid', [ ProcurementController::class, 'setAsPaid' ] ); +Route::get( 'procurements/preload/{uuid}', [ ProcurementController::class, 'preload' ] ); +Route::post( 'procurements/preload', [ ProcurementController::class, 'storePreload' ] ); Route::post( 'procurements/{id}/products', [ ProcurementController::class, 'procure' ] ); Route::post( 'procurements', [ ProcurementController::class, 'create' ] ); Route::post( 'procurements/products/search-procurement-product', [ ProcurementController::class, 'searchProcurementProduct' ] );